Eclipse SUMO - Simulation of Urban MObility
GUIApplicationWindow.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
18 // The main window of the SUMO-gui.
19 /****************************************************************************/
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #ifdef HAVE_VERSION_H
28 #include <version.h>
29 #endif
30 
31 #include <string>
32 #include <sstream>
33 #include <algorithm>
34 #include <iomanip>
35 
36 #include <guisim/GUINet.h>
37 #include <guisim/GUILane.h>
38 #include <netload/NLHandler.h>
40 #include <microsim/MSGlobals.h>
41 #include <microsim/MSEdge.h>
42 #include <microsim/MSVehicle.h>
45 #include <microsim/MSEdgeControl.h>
48 
49 #include "GUISUMOViewParent.h"
50 #include "GUILoadThread.h"
51 #include "GUIRunThread.h"
52 #include "GUIApplicationWindow.h"
55 
56 #include <utils/common/ToString.h>
62 
63 #include <utils/xml/XMLSubSys.h>
76 #include <utils/gui/div/GLHelper.h>
87 #include "GUIGlobals.h"
91 
92 
93 //#define HAVE_DANGEROUS_SOUNDS
94 
95 // ===========================================================================
96 // FOX-declarations
97 // ===========================================================================
98 FXDEFMAP(GUIApplicationWindow) GUIApplicationWindowMap[] = {
102  FXMAPFUNC(SEL_CLOSE, MID_WINDOW, GUIApplicationWindow::onCmdQuit),
103 
108  FXMAPFUNC(SEL_COMMAND, MID_RECENTFILE, GUIApplicationWindow::onCmdOpenRecent),
111  FXMAPFUNC(SEL_COMMAND, MID_EDITCHOSEN, GUIApplicationWindow::onCmdEditChosen),
115  FXMAPFUNC(SEL_COMMAND, MID_NETEDIT, GUIApplicationWindow::onCmdNetedit),
116 
123  FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_F2_ABOUT, GUIApplicationWindow::onCmdAbout),
124  FXMAPFUNC(SEL_COMMAND, MID_NEW_MICROVIEW, GUIApplicationWindow::onCmdNewView),
125 #ifdef HAVE_OSG
126  FXMAPFUNC(SEL_COMMAND, MID_NEW_OSGVIEW, GUIApplicationWindow::onCmdNewOSG),
127 #endif
131  FXMAPFUNC(SEL_COMMAND, MID_SIMSAVE, GUIApplicationWindow::onCmdSaveState),
136 
140 
141  FXMAPFUNC(SEL_UPDATE, MID_OPEN_CONFIG, GUIApplicationWindow::onUpdOpen),
142  FXMAPFUNC(SEL_UPDATE, MID_OPEN_NETWORK, GUIApplicationWindow::onUpdOpen),
143  FXMAPFUNC(SEL_UPDATE, MID_OPEN_NETWORK, GUIApplicationWindow::onUpdOpen),
149 #ifdef HAVE_OSG
150  FXMAPFUNC(SEL_UPDATE, MID_NEW_OSGVIEW, GUIApplicationWindow::onUpdAddView),
151 #endif
164 
165  // forward requests to the active view
166  FXMAPFUNC(SEL_COMMAND, MID_LOCATEJUNCTION, GUIApplicationWindow::onCmdLocate),
167  FXMAPFUNC(SEL_COMMAND, MID_LOCATEEDGE, GUIApplicationWindow::onCmdLocate),
168  FXMAPFUNC(SEL_COMMAND, MID_LOCATEVEHICLE, GUIApplicationWindow::onCmdLocate),
169  FXMAPFUNC(SEL_COMMAND, MID_LOCATEPERSON, GUIApplicationWindow::onCmdLocate),
170  FXMAPFUNC(SEL_COMMAND, MID_LOCATETLS, GUIApplicationWindow::onCmdLocate),
171  FXMAPFUNC(SEL_COMMAND, MID_LOCATEADD, GUIApplicationWindow::onCmdLocate),
172  FXMAPFUNC(SEL_COMMAND, MID_LOCATEPOI, GUIApplicationWindow::onCmdLocate),
173  FXMAPFUNC(SEL_COMMAND, MID_LOCATEPOLY, GUIApplicationWindow::onCmdLocate),
182  FXMAPFUNC(SEL_KEYPRESS, 0, GUIApplicationWindow::onKeyPress),
183  FXMAPFUNC(SEL_KEYRELEASE, 0, GUIApplicationWindow::onKeyRelease),
184 
185  FXMAPFUNC(SEL_CLIPBOARD_REQUEST, 0, GUIApplicationWindow::onClipboardRequest),
186 
191 };
192 
193 // Object implementation
194 FXIMPLEMENT(GUIApplicationWindow, FXMainWindow, GUIApplicationWindowMap, ARRAYNUMBER(GUIApplicationWindowMap))
195 
196 // ===========================================================================
197 // static members
198 // ===========================================================================
200 
201 // ===========================================================================
202 // member method definitions
203 // ===========================================================================
204 GUIApplicationWindow::GUIApplicationWindow(FXApp* a, const std::string& configPattern) :
205  GUIMainWindow(a),
206  myLoadThread(nullptr), myRunThread(nullptr),
207  myAmLoading(false),
208  myAlternateSimDelay(0),
209  myRecentNets(a, "nets"),
210  myConfigPattern(configPattern),
211  hadDependentBuild(false),
212  myShowTimeAsHMS(false),
213  myHaveNotifiedAboutSimEnd(false),
214  // game specific
215  myJamSoundTime(60),
216  myPreviousCollisionNumber(0),
217  myWaitingTime(0),
218  myTimeLoss(0),
219  myEmergencyVehicleCount(0),
220  myTotalDistance(0) {
221  // init icons
223  // init cursors
225 }
226 
227 
228 void
230  // don't do this twice
231  if (hadDependentBuild) {
232  return;
233  }
234  hadDependentBuild = true;
235 
236  setTarget(this);
237  setSelector(MID_WINDOW);
238 
239  // build menu bar
240  myMenuBarDrag = new FXToolBarShell(this, GUIDesignToolBar);
242  new FXToolBarGrip(myMenuBar, myMenuBar, FXMenuBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip);
243  buildToolBars();
244  // build the thread - io
247 
248  // build the status bar
249  myStatusbar = new FXStatusBar(this, GUIDesignStatusBar);
250  {
251  myGeoFrame = new FXHorizontalFrame(myStatusbar, GUIDesignHorizontalFrameStatusBar);
252  myGeoCoordinate = new FXLabel(myGeoFrame, "N/A\t\tOriginal coordinate (before coordinate transformation in NETCONVERT)", nullptr, LAYOUT_CENTER_Y);
254  myCartesianCoordinate = new FXLabel(myCartesianFrame, "N/A\t\tNetwork coordinate", nullptr, LAYOUT_CENTER_Y);
257  myStatButtons.back()->hide();
258  myStatButtons.push_back(new FXButton(myStatusbar, "-", GUIIconSubSys::getIcon(ICON_GREENEDGE), this, MID_SHOWVEHSTATS));
259  myStatButtons.back()->hide();
260  }
261 
262  // make the window a mdi-window
263  myMainSplitter = new FXSplitter(this, GUIDesignSplitter | SPLITTER_VERTICAL | SPLITTER_REVERSED);
264  myMDIClient = new FXMDIClient(myMainSplitter, GUIDesignSplitterMDI);
265  myMDIMenu = new FXMDIMenu(this, myMDIClient);
266  new FXMDIWindowButton(myMenuBar, myMDIMenu, myMDIClient, FXMDIClient::ID_MDI_MENUWINDOW, GUIDesignMDIButtonLeft);
267  new FXMDIDeleteButton(myMenuBar, myMDIClient, FXMDIClient::ID_MDI_MENUCLOSE, GUIDesignMDIButtonRight);
268  new FXMDIRestoreButton(myMenuBar, myMDIClient, FXMDIClient::ID_MDI_MENURESTORE, GUIDesignMDIButtonRight);
269  new FXMDIMinimizeButton(myMenuBar, myMDIClient, FXMDIClient::ID_MDI_MENUMINIMIZE, GUIDesignMDIButtonRight);
270 
271  // build the message window
273  // fill menu and tool bar
274  fillMenuBar();
275  myToolBar6->hide();
276  myToolBar7->hide();
277  myToolBar9->hide();
278  myToolBar10->hide();
279  // build additional threads
280  myLoadThread = new GUILoadThread(getApp(), this, myEvents, myLoadThreadEvent);
282  // set the status bar
283  myStatusbar->getStatusLine()->setText("Ready.");
284  // set the caption
285  setTitle(MFXUtils::getTitleText("SUMO " VERSION_STRING));
286 
287  // start the simulation-thread (it will loop until the application ends deciding by itself whether to perform a step or not)
288  myRunThread->start();
291 }
292 
293 
294 void
297  gCurrentFolder = getApp()->reg().readStringEntry("SETTINGS", "basedir", "");
298  FXMainWindow::create();
299  myMenuBarDrag->create();
300  myToolBarDrag1->create();
301  myToolBarDrag2->create();
302  myToolBarDrag3->create();
303  myToolBarDrag4->create();
304  myToolBarDrag5->create();
305  myToolBarDrag6->create();
306  myToolBarDrag7->create();
307  myFileMenu->create();
308  mySelectByPermissions->create();
309  myEditMenu->create();
310  mySettingsMenu->create();
311  myLocatorMenu->create();
312  myControlMenu->create();
313  myWindowsMenu->create();
314  myHelpMenu->create();
315 
316  FXint textWidth = getApp()->getNormalFont()->getTextWidth("8", 1) * 24;
317  myCartesianFrame->setWidth(textWidth);
318  myGeoFrame->setWidth(textWidth);
319 
320  show(PLACEMENT_DEFAULT);
321  if (!OptionsCont::getOptions().isSet("window-size")) {
322  if (getApp()->reg().readIntEntry("SETTINGS", "maximized", 0) == 1) {
323  maximize();
324  }
325  }
326  myShowTimeAsHMS = (getApp()->reg().readIntEntry("gui", "timeasHMS", 0) == 1);
327  myAlternateSimDelay = getApp()->reg().readIntEntry("gui", "alternateSimDelay", 100);
328 }
329 
330 
333  myRunThread->join();
334  closeAllWindows();
335  //
337  delete myGLVisual;
338  // delete some non-parented windows
339  delete myToolBarDrag1;
340  //
341  delete myRunThread;
342  delete myFileMenu;
343  delete myEditMenu;
344  delete mySelectByPermissions;
345  delete mySettingsMenu;
346  delete myLocatorMenu;
347  delete myControlMenu;
348  delete myWindowsMenu;
349  delete myHelpMenu;
350 
351  delete myLoadThread;
352 
353  while (!myEvents.empty()) {
354  // get the next event
355  GUIEvent* e = myEvents.top();
356  myEvents.pop();
357  delete e;
358  }
359 }
360 
361 
362 void
364  FXMainWindow::detach();
365  myMenuBarDrag->detach();
366  myToolBarDrag1->detach();
367 }
368 
369 
370 void
372  // build file menu
373  myFileMenu = new FXMenuPane(this);
374  new FXMenuTitle(myMenuBar, "&File", nullptr, myFileMenu);
375  new FXMenuCommand(myFileMenu,
376  "&Open Simulation...\tCtrl+O\tOpen a simulation (Configuration file).",
378  new FXMenuCommand(myFileMenu,
379  "Open &Network...\tCtrl+N\tOpen a network.",
381  new FXMenuCommand(myFileMenu,
382  "Open Shapes \tCtrl+P\tLoad POIs and Polygons for visualization.",
384  new FXMenuCommand(myFileMenu,
385  "Open EdgeData \tCtrl+U\tLoad edge related data for visualization.",
387  new FXMenuCommand(myFileMenu,
388  "&Reload\tCtrl+R\tReloads the simulation / the network.",
390  new FXMenuSeparator(myFileMenu);
391  new FXMenuCommand(myFileMenu,
392  "Close\tCtrl+W\tClose the simulation.",
394  // Recent files
395  FXMenuSeparator* sep1 = new FXMenuSeparator(myFileMenu);
396  sep1->setTarget(&myRecentConfigs);
397  sep1->setSelector(FXRecentFiles::ID_ANYFILES);
398  new FXMenuCommand(myFileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_1);
399  new FXMenuCommand(myFileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_2);
400  new FXMenuCommand(myFileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_3);
401  new FXMenuCommand(myFileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_4);
402  new FXMenuCommand(myFileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_5);
403  new FXMenuCommand(myFileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_6);
404  new FXMenuCommand(myFileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_7);
405  new FXMenuCommand(myFileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_8);
406  new FXMenuCommand(myFileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_9);
407  new FXMenuCommand(myFileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_10);
408  new FXMenuCommand(myFileMenu, "C&lear Recent Configurations", nullptr, &myRecentConfigs, FXRecentFiles::ID_CLEAR);
409  myRecentConfigs.setTarget(this);
410  myRecentConfigs.setSelector(MID_RECENTFILE);
411  FXMenuSeparator* sep2 = new FXMenuSeparator(myFileMenu);
412  sep2->setTarget(&myRecentNets);
413  sep2->setSelector(FXRecentFiles::ID_ANYFILES);
414  new FXMenuCommand(myFileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_1);
415  new FXMenuCommand(myFileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_2);
416  new FXMenuCommand(myFileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_3);
417  new FXMenuCommand(myFileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_4);
418  new FXMenuCommand(myFileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_5);
419  new FXMenuCommand(myFileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_6);
420  new FXMenuCommand(myFileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_7);
421  new FXMenuCommand(myFileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_8);
422  new FXMenuCommand(myFileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_9);
423  new FXMenuCommand(myFileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_10);
424  new FXMenuCommand(myFileMenu, "Cl&ear Recent Networks", nullptr, &myRecentNets, FXRecentFiles::ID_CLEAR);
425  myRecentNets.setTarget(this);
426  myRecentNets.setSelector(MID_RECENTFILE);
427  new FXMenuSeparator(myFileMenu);
428  new FXMenuCommand(myFileMenu,
429  "&Quit\tCtrl+Q\tQuit the Application.",
430  nullptr, this, MID_HOTKEY_CTRL_Q_CLOSE, 0);
431 
432  // build edit menu
433  mySelectByPermissions = new FXMenuPane(this);
434  std::vector<std::string> vehicleClasses = SumoVehicleClassStrings.getStrings();
435  for (auto i : vehicleClasses) {
436  new FXMenuCommand(mySelectByPermissions, i.c_str(), nullptr, this, MID_EDITCHOSEN);
437  }
438 
439  myEditMenu = new FXMenuPane(this);
440  new FXMenuTitle(myMenuBar, "&Edit", nullptr, myEditMenu);
441  new FXMenuCommand(myEditMenu,
442  "Edit Selected...\tCtrl+E\tOpens a dialog for editing the list of selected items.",
444  mySelectLanesMenuCascade = new FXMenuCascade(myEditMenu,
445  "Select lanes which allow...\t\tOpens a menu for selecting a vehicle class by which to selected lanes.",
447  new FXMenuSeparator(myEditMenu);
448  new FXMenuCommand(myEditMenu,
449  "Edit Breakpoints\tCtrl+B\tOpens a dialog for editing breakpoints.",
450  nullptr, this, MID_HOTKEY_CTRL_B_EDITBREAKPOINT);
451  new FXMenuCommand(myEditMenu,
452  "Edit Visualisation\tCtrl+V\tOpens a dialog for editing visualization settings.",
453  nullptr, this, MID_EDITVIEWSCHEME);
454  new FXMenuCommand(myEditMenu,
455  "Edit Viewport\tCtrl+I\tOpens a dialog for editing viewing are, zoom and rotation.",
456  nullptr, this, MID_EDITVIEWPORT);
457  new FXMenuSeparator(myEditMenu);
458  new FXMenuCommand(myEditMenu,
459  "Open in Netedit\tCtrl+T\tOpens the netedit application with the current network.",
460  nullptr, this, MID_NETEDIT);
461 
462  // build settings menu
463  mySettingsMenu = new FXMenuPane(this);
464  new FXMenuTitle(myMenuBar, "&Settings", nullptr, mySettingsMenu);
465  new FXMenuCommand(mySettingsMenu,
466  "Application Settings...\t\tOpen a Dialog for Application Settings editing.",
467  nullptr, this, MID_APPSETTINGS);
468  new FXMenuCheck(mySettingsMenu,
469  "Gaming Mode\tCtrl+G\tToggle gaming mode on/off.",
471  new FXMenuCheck(mySettingsMenu,
472  "Full Screen Mode\tCtrl+F\tToggle full screen mode on/off.",
474  // build Locate menu
475  myLocatorMenu = new FXMenuPane(this);
476  new FXMenuTitle(myMenuBar, "&Locate", nullptr, myLocatorMenu);
477  new FXMenuCommand(myLocatorMenu,
478  "Locate &Junctions\t\tOpen a Dialog for Locating a Junction.",
480  new FXMenuCommand(myLocatorMenu,
481  "Locate &Edges\t\tOpen a Dialog for Locating an Edge.",
483  if (!MSGlobals::gUseMesoSim) { // there are no gui-vehicles in mesosim
484  new FXMenuCommand(myLocatorMenu,
485  "Locate &Vehicles\t\tOpen a Dialog for Locating a Vehicle.",
487  }
488  new FXMenuCommand(myLocatorMenu,
489  "Locate &Persons\t\tOpen a Dialog for Locating a Person.",
491  new FXMenuCommand(myLocatorMenu,
492  "Locate &TLS\t\tOpen a Dialog for Locating a Traffic Light.",
494  new FXMenuCommand(myLocatorMenu,
495  "Locate &Additional\t\tOpen a Dialog for Locating an Additional Structure.",
497  new FXMenuCommand(myLocatorMenu,
498  "Locate P&oI\t\tOpen a Dialog for Locating a Point of Intereset.",
500  new FXMenuCommand(myLocatorMenu,
501  "Locate Po&lygon\t\tOpen a Dialog for Locating a Polygon.",
503  new FXMenuSeparator(myLocatorMenu);
504  new FXMenuCheck(myLocatorMenu,
505  "Show Internal Structures\t\tShow internal junctions and streets in locator dialog.",
506  this, MID_LISTINTERNAL);
507  FXMenuCheck* listParking = new FXMenuCheck(myLocatorMenu,
508  "Show Parking Vehicles\t\tShow parking vehicles in locator dialog.",
509  this, MID_LISTPARKING);
510  listParking->setCheck(myListParking);
511  new FXMenuCheck(myLocatorMenu,
512  "Show vehicles outside the road network\t\tShow vehicles that are teleporting or driving remote-controlled outside the road network in locator dialog.",
513  this, MID_LISTTELEPORTING);
514  // build control menu
515  myControlMenu = new FXMenuPane(this);
516  new FXMenuTitle(myMenuBar, "Simulation", nullptr, myControlMenu);
517  new FXMenuCommand(myControlMenu,
518  "Run\tCtrl+A\tStart running the simulation.",
520  new FXMenuCommand(myControlMenu,
521  "Stop\tCtrl+S\tStop running the simulation.",
523  new FXMenuCommand(myControlMenu,
524  "Step\tCtrl+D\tPerform one simulation step.",
526  new FXMenuCommand(myControlMenu,
527  "Save\t\tSave the current simulation state to a file.",
529 
530  // build windows menu
531  myWindowsMenu = new FXMenuPane(this);
532  new FXMenuTitle(myMenuBar, "&Windows", nullptr, myWindowsMenu);
533  new FXMenuCheck(myWindowsMenu,
534  "Show Status Line\t\tToggle the Status Bar on/off.",
535  myStatusbar, FXWindow::ID_TOGGLESHOWN);
536  new FXMenuCheck(myWindowsMenu,
537  "Show Message Window\t\tToggle the Message Window on/off.",
538  myMessageWindow, FXWindow::ID_TOGGLESHOWN);
539  new FXMenuCheck(myWindowsMenu,
540  "Show Simulation Time\t\tToggle the Simulation Time on/off.",
541  myToolBar3, FXWindow::ID_TOGGLESHOWN);
542  new FXMenuCheck(myWindowsMenu,
543  "Show Simulation Delay\t\tToggle the Simulation Delay Entry on/off.",
544  myToolBar4, FXWindow::ID_TOGGLESHOWN);
546  new FXMenuSeparator(myWindowsMenu);
547  new FXMenuCommand(myWindowsMenu, "Tile &Horizontally",
549  myMDIClient, FXMDIClient::ID_MDI_TILEHORIZONTAL);
550  new FXMenuCommand(myWindowsMenu, "Tile &Vertically",
552  myMDIClient, FXMDIClient::ID_MDI_TILEVERTICAL);
553  new FXMenuCommand(myWindowsMenu, "Cascade",
555  myMDIClient, FXMDIClient::ID_MDI_CASCADE);
556  new FXMenuCommand(myWindowsMenu, "&Close", nullptr,
557  myMDIClient, FXMDIClient::ID_MDI_CLOSE);
558  sep1 = new FXMenuSeparator(myWindowsMenu);
559  sep1->setTarget(myMDIClient);
560  sep1->setSelector(FXMDIClient::ID_MDI_ANY);
561  new FXMenuCommand(myWindowsMenu, "", nullptr, myMDIClient, FXMDIClient::ID_MDI_1);
562  new FXMenuCommand(myWindowsMenu, "", nullptr, myMDIClient, FXMDIClient::ID_MDI_2);
563  new FXMenuCommand(myWindowsMenu, "", nullptr, myMDIClient, FXMDIClient::ID_MDI_3);
564  new FXMenuCommand(myWindowsMenu, "", nullptr, myMDIClient, FXMDIClient::ID_MDI_4);
565  new FXMenuCommand(myWindowsMenu, "&Others...", nullptr, myMDIClient, FXMDIClient::ID_MDI_OVER_5);
566  new FXMenuSeparator(myWindowsMenu);
567  new FXMenuCommand(myWindowsMenu,
568  "Clear Message Window\t\tClear the message window.",
569  nullptr, this, MID_CLEARMESSAGEWINDOW);
570 
571  // build help menu
572  myHelpMenu = new FXMenuPane(this);
573  new FXMenuTitle(myMenuBar, "&Help", nullptr, myHelpMenu);
574  new FXMenuCommand(myHelpMenu, "&Online Documentation\tF1\tOpen Online documentation", nullptr, this, MID_HOTKEY_F1_ONLINEDOCUMENTATION);
575  new FXMenuCommand(myHelpMenu, "&About\tF2\tAbout sumo-gui", GUIIconSubSys::getIcon(ICON_SUMO_MINI), this, MID_HOTKEY_F2_ABOUT);
576 
577  //new FXButton(myMenuBar, "\t\tShows TraCI status", GUIIconSubSys::getIcon(ICON_ADD), this, MID_TRACI_STATUS, 0, 0, 0, 14, 14, 0, 0, 0, 0);
578 
579  // build SUMO Accelerators (hotkeys)
581 }
582 
583 
584 void
586  // build tool bars
587  {
588  // file and simulation tool bar
589  myToolBarDrag1 = new FXToolBarShell(this, GUIDesignToolBar);
591  new FXToolBarGrip(myToolBar1, myToolBar1, FXToolBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip);
592  // build file tools
593  new FXButton(myToolBar1, "\t\tOpen a simulation (Configuration file).", GUIIconSubSys::getIcon(ICON_OPEN_CONFIG), this, MID_OPEN_CONFIG, GUIDesignButtonToolbar);
594  new FXButton(myToolBar1, "\t\tOpen a network.", GUIIconSubSys::getIcon(ICON_OPEN_NET), this, MID_OPEN_NETWORK, GUIDesignButtonToolbar);
595  new FXButton(myToolBar1, "\t\tReloads the simulation / the network.", GUIIconSubSys::getIcon(ICON_RELOAD), this, MID_HOTKEY_CTRL_R_RELOAD, GUIDesignButtonToolbar);
596  }
597  {
598  // simulation toolbar
599  myToolBarDrag2 = new FXToolBarShell(this, GUIDesignToolBar);
601  new FXToolBarGrip(myToolBar2, myToolBar2, FXToolBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip);
602  // build simulation tools
604  new FXButton(myToolBar2, "\t\tStop the running simulation.", GUIIconSubSys::getIcon(ICON_STOP), this, MID_HOTKEY_CTRL_S_STOPSIMULATION_SAVENETWORK, GUIDesignButtonToolbar);
605  new FXButton(myToolBar2, "\t\tPerform a single simulation step.", GUIIconSubSys::getIcon(ICON_STEP), this, MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMAND, GUIDesignButtonToolbar);
606  }
607  {
608  // Simulation Step Display
609  myToolBarDrag3 = new FXToolBarShell(this, GUIDesignToolBar);
611  new FXToolBarGrip(myToolBar3, myToolBar3, FXToolBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip);
612  new FXButton(myToolBar3, "Time:\t\tToggle between seconds and hour:minute:seconds display", nullptr, this, MID_TIME_TOOGLE, GUIDesignButtonToolbarText);
613 
614  myLCDLabel = new FXEX::FXLCDLabel(myToolBar3, 16, nullptr, 0, JUSTIFY_RIGHT);
618  myLCDLabel->setGroove(2);
619  myLCDLabel->setText("----------------");
620  }
621  {
622  // Simulation Delay
623  myToolBarDrag4 = new FXToolBarShell(this, GUIDesignToolBar);
625  new FXToolBarGrip(myToolBar4, myToolBar4, FXToolBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip);
626  new FXButton(myToolBar4, "Delay (ms):\t\tDelay per simulated second. Click to toggle between the last two delay values", nullptr, this, MID_DELAY_TOOGLE, GUIDesignButtonToolbarText);
627 
628  mySimDelay = 0;
629  mySimDelayTarget = new FXDataTarget(mySimDelay);
630  mySimDelaySpinner = new FXRealSpinner(myToolBar4, 7, mySimDelayTarget, FXDataTarget::ID_VALUE, GUIDesignSpinDial);
631  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);
632  mySimDelaySlider->setRange(0, 1000);
633  mySimDelaySlider->setHeadSize(10);
634  mySimDelaySlider->setIncrement(50);
635  mySimDelaySlider->setTickDelta(100);
636  mySimDelaySlider->setValue((int)mySimDelay);
637  //mySimDelayTarget->setNumberFormat(0);
638  //mySimDelayTarget->setIncrements(1, 10, 10);
639  mySimDelaySpinner->setIncrement(10);
640  mySimDelaySpinner->setRange(0, 10000);
641  mySimDelaySpinner->setValue(mySimDelay);
642  }
643  {
644  // Scale traffic (flows and incrementally loaded vehicles)
645  myToolBarDrag8 = new FXToolBarShell(this, GUIDesignToolBar);
647  new FXToolBarGrip(myToolBar8, myToolBar8, FXToolBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip);
648  new FXLabel(myToolBar8, "Scale Traffic:\t\tScale traffic from flows and vehicles that are loaded incrementally from route files", nullptr, LAYOUT_TOP | LAYOUT_LEFT);
649  myDemandScaleSpinner = new FXRealSpinner(myToolBar8, 7, this, MID_DEMAND_SCALE, GUIDesignSpinDial);
650  myDemandScaleSpinner->setIncrement(0.5);
651  myDemandScaleSpinner->setRange(0, 1000);
652  myDemandScaleSpinner->setValue(1);
653  }
654  {
655  // Views
656  myToolBarDrag5 = new FXToolBarShell(this, GUIDesignToolBar);
658  new FXToolBarGrip(myToolBar5, myToolBar5, FXToolBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip);
659  // build view tools
660  new FXButton(myToolBar5, "\t\tOpen a new microscopic view.",
662 #ifdef HAVE_OSG
663  new FXButton(myToolBar5, "\t\tOpen a new 3D view.",
665 #endif
666  }
667  {
669  // total waitingTime
670  myToolBarDrag6 = new FXToolBarShell(this, GUIDesignToolBar);
672  new FXToolBarGrip(myToolBar6, myToolBar6, FXToolBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip);
673  new FXLabel(myToolBar6, "Waiting Time:\t\tTime spent waiting accumulated for all vehicles", nullptr, LAYOUT_TOP | LAYOUT_LEFT);
674  myWaitingTimeLabel = new FXEX::FXLCDLabel(myToolBar6, 13, nullptr, 0, JUSTIFY_RIGHT);
679  myWaitingTimeLabel->setText("-------------");
680 
681  // idealistic time loss
682  myToolBarDrag7 = new FXToolBarShell(this, GUIDesignToolBar);
684  new FXToolBarGrip(myToolBar7, myToolBar7, FXToolBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip);
685  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);
686  myTimeLossLabel = new FXEX::FXLCDLabel(myToolBar7, 13, nullptr, 0, JUSTIFY_RIGHT);
691  myTimeLossLabel->setText("-------------");
692 
693  // total driving distance
694  myToolBarDrag9 = new FXToolBarShell(this, GUIDesignToolBar);
696  new FXToolBarGrip(myToolBar9, myToolBar9, FXToolBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip);
697  new FXLabel(myToolBar9, "Distance (km):\t\tTotal distance driven by DRT vehicles", nullptr, LAYOUT_TOP | LAYOUT_LEFT);
698  myTotalDistanceLabel = new FXEX::FXLCDLabel(myToolBar9, 13, nullptr, 0, JUSTIFY_RIGHT);
703  myTotalDistanceLabel->setText("-------------");
704 
705  // emergency vehicle counts
706  myToolBarDrag10 = new FXToolBarShell(this, GUIDesignToolBar);
708  new FXToolBarGrip(myToolBar10, myToolBar10, FXToolBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip);
709  new FXLabel(myToolBar10, "Emergency Vehicle waiting time:\t\tTime spent waiting accumulated for emergency vehicles", nullptr, LAYOUT_TOP | LAYOUT_LEFT);
710  myEmergencyVehicleLabel = new FXEX::FXLCDLabel(myToolBar10, 13, nullptr, 0, JUSTIFY_RIGHT);
715  myEmergencyVehicleLabel->setText("-------------");
716  }
717 }
718 
719 
720 long
721 GUIApplicationWindow::onCmdQuit(FXObject*, FXSelector, void*) {
723  getApp()->reg().writeStringEntry("SETTINGS", "basedir", gCurrentFolder.text());
724  getApp()->reg().writeIntEntry("SETTINGS", "maximized", isMaximized() ? 1 : 0);
725  getApp()->reg().writeIntEntry("gui", "timeasHMS", myShowTimeAsHMS ? 1 : 0);
726  getApp()->reg().writeIntEntry("gui", "alternateSimDelay", (int)myAlternateSimDelay);
727  getApp()->exit(0);
728  return 1;
729 }
730 
731 
732 long
733 GUIApplicationWindow::onCmdEditChosen(FXObject* menu, FXSelector, void*) {
734  FXMenuCommand* mc = dynamic_cast<FXMenuCommand*>(menu);
735  if (mc->getText() == "Edit Selected...") {
736  GUIDialog_GLChosenEditor* chooser =
738  chooser->create();
739  chooser->show();
740  } else {
742  const SUMOVehicleClass svc = SumoVehicleClassStrings.get(mc->getText().text());
743  for (MSEdgeVector::const_iterator i = MSEdge::getAllEdges().begin(); i != MSEdge::getAllEdges().end(); ++i) {
744  const std::vector<MSLane*>& lanes = (*i)->getLanes();
745  for (std::vector<MSLane*>::const_iterator it = lanes.begin(); it != lanes.end(); ++it) {
746  GUILane* lane = dynamic_cast<GUILane*>(*it);
747  assert(lane != 0);
748  if ((lane->getPermissions() & svc) != 0) {
749  gSelected.select(lane->getGlID());
750  }
751  }
752  }
753  if (myMDIClient->numChildren() > 0) {
754  GUISUMOViewParent* w = dynamic_cast<GUISUMOViewParent*>(myMDIClient->getActiveChild());
755  if (w != nullptr) {
756  // color by selection
758  }
759  }
760  }
761  updateChildren();
762  }
763  return 1;
764 }
765 
766 
767 long
768 GUIApplicationWindow::onCmdEditBreakpoints(FXObject*, FXSelector, void*) {
770  chooser->create();
771  chooser->show();
772  return 1;
773 }
774 
775 long
776 GUIApplicationWindow::onCmdEditViewport(FXObject*, FXSelector, void*) {
777  if (!myGLWindows.empty()) {
778  myGLWindows[0]->getView()->showViewportEditor();
779  }
780  return 1;
781 }
782 
783 
784 long
785 GUIApplicationWindow::onCmdEditViewScheme(FXObject*, FXSelector, void*) {
786  if (!myGLWindows.empty()) {
787  myGLWindows[0]->getView()->showViewschemeEditor();
788  }
789  return 1;
790 }
791 
792 
793 long
794 GUIApplicationWindow::onCmdHelp(FXObject*, FXSelector, void*) {
795  FXLinkLabel::fxexecute("https://sumo.dlr.de/wiki/SUMO-GUI");
796  return 1;
797 }
798 
799 
800 long
801 GUIApplicationWindow::onCmdNetedit(FXObject*, FXSelector, void*) {
802  if (myGLWindows.empty()) {
803  return 1;
804  }
805  FXRegistry reg("SUMO netedit", "Eclipse");
806  reg.read();
807  const GUISUMOAbstractView* const v = myGLWindows[0]->getView();
808  reg.writeRealEntry("viewport", "x", v->getChanger().getXPos());
809  reg.writeRealEntry("viewport", "y", v->getChanger().getYPos());
810  reg.writeRealEntry("viewport", "z", v->getChanger().getZPos());
811  reg.write();
812  std::string netedit = "netedit";
813  const char* sumoPath = getenv("SUMO_HOME");
814  if (sumoPath != nullptr) {
815  std::string newPath = std::string(sumoPath) + "/bin/netedit";
816  if (FileHelpers::isReadable(newPath) || FileHelpers::isReadable(newPath + ".exe")) {
817  netedit = "\"" + newPath + "\"";
818  }
819  }
820  std::string cmd = netedit + " --registry-viewport -s " + OptionsCont::getOptions().getString("net-file");
821  // start in background
822 #ifndef WIN32
823  cmd = cmd + " &";
824 #else
825  // see "help start" for the parameters
826  cmd = "start /B \"\" " + cmd;
827 #endif
828  WRITE_MESSAGE("Running " + cmd + ".");
829  // yay! fun with dangerous commands... Never use this over the internet
831  return 1;
832 }
833 
834 
835 long
836 GUIApplicationWindow::onCmdOpenConfiguration(FXObject*, FXSelector, void*) {
837  // get the new file name
838  FXFileDialog opendialog(this, "Open Simulation Configuration");
839  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY));
840  opendialog.setSelectMode(SELECTFILE_EXISTING);
841  opendialog.setPatternList(myConfigPattern.c_str());
842  if (gCurrentFolder.length() != 0) {
843  opendialog.setDirectory(gCurrentFolder);
844  }
845  if (opendialog.execute()) {
846  gCurrentFolder = opendialog.getDirectory();
847  std::string file = opendialog.getFilename().text();
848  loadConfigOrNet(file, false);
849  myRecentConfigs.appendFile(file.c_str());
850  }
851  return 1;
852 }
853 
854 
855 long
856 GUIApplicationWindow::onCmdOpenNetwork(FXObject*, FXSelector, void*) {
857  // get the new file name
858  FXFileDialog opendialog(this, "Open Network");
859  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY));
860  opendialog.setSelectMode(SELECTFILE_EXISTING);
861  opendialog.setPatternList("SUMO nets (*.net.xml)\nAll files (*)");
862  if (gCurrentFolder.length() != 0) {
863  opendialog.setDirectory(gCurrentFolder);
864  }
865  if (opendialog.execute()) {
866  gCurrentFolder = opendialog.getDirectory();
867  std::string file = opendialog.getFilename().text();
868  loadConfigOrNet(file, true);
869  myRecentNets.appendFile(file.c_str());
870  }
871  return 1;
872 }
873 
874 
875 long
876 GUIApplicationWindow::onCmdOpenShapes(FXObject*, FXSelector, void*) {
877  // get the shape file name
878  FXFileDialog opendialog(this, "Open Shapes");
879  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY));
880  opendialog.setSelectMode(SELECTFILE_EXISTING);
881  opendialog.setPatternList("Additional files (*.xml)\nAll files (*)");
882  if (gCurrentFolder.length() != 0) {
883  opendialog.setDirectory(gCurrentFolder);
884  }
885  if (opendialog.execute()) {
886  gCurrentFolder = opendialog.getDirectory();
887  std::string file = opendialog.getFilename().text();
888 
889  dynamic_cast<GUIShapeContainer&>(myRunThread->getNet().getShapeContainer()).allowReplacement();
891  if (!XMLSubSys::runParser(handler, file, false)) {
892  WRITE_MESSAGE("Loading of " + file + " failed.");
893  }
894  update();
895  if (myMDIClient->numChildren() > 0) {
896  GUISUMOViewParent* w = dynamic_cast<GUISUMOViewParent*>(myMDIClient->getActiveChild());
897  if (w != nullptr) {
898  w->getView()->update();
899  }
900  }
901  }
902  return 1;
903 }
904 
905 long
906 GUIApplicationWindow::onCmdOpenEdgeData(FXObject*, FXSelector, void*) {
907  // get the shape file name
908  FXFileDialog opendialog(this, "Open EdgeData");
909  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY));
910  opendialog.setSelectMode(SELECTFILE_EXISTING);
911  opendialog.setPatternList("EdgeData files (*.xml)\nAll files (*)");
912  if (gCurrentFolder.length() != 0) {
913  opendialog.setDirectory(gCurrentFolder);
914  }
915  if (opendialog.execute()) {
916  gCurrentFolder = opendialog.getDirectory();
917  std::string file = opendialog.getFilename().text();
918  if (!GUINet::getGUIInstance()->loadEdgeData(file)) {
919  WRITE_MESSAGE("Loading of " + file + " failed.");
920  }
921  update();
922  if (myMDIClient->numChildren() > 0) {
923  GUISUMOViewParent* w = dynamic_cast<GUISUMOViewParent*>(myMDIClient->getActiveChild());
924  if (w != nullptr) {
925  w->getView()->update();
926  }
927  }
928  }
929  return 1;
930 }
931 
932 long
933 GUIApplicationWindow::onCmdReload(FXObject*, FXSelector, void*) {
935  getApp()->beginWaitCursor();
936  myAmLoading = true;
937  closeAllWindows();
938  myLoadThread->start();
939  setStatusBarText("Reloading.");
940  update();
941  return 1;
942 }
943 
944 
945 long
946 GUIApplicationWindow::onCmdOpenRecent(FXObject* sender, FXSelector, void* data) {
947  if (myAmLoading) {
948  myStatusbar->getStatusLine()->setText("Already loading!");
949  return 1;
950  }
951  std::string file((const char*)data);
952  loadConfigOrNet(file, sender == &myRecentNets);
953  return 1;
954 }
955 
956 
957 long
958 GUIApplicationWindow::onCmdClose(FXObject*, FXSelector, void*) {
959  closeAllWindows();
960  return 1;
961 }
962 
963 
964 long
965 GUIApplicationWindow::onUpdOpen(FXObject* sender, FXSelector, void* ptr) {
966  sender->handle(this,
967  myAmLoading ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
968  ptr);
969  return 1;
970 }
971 
972 
973 long
974 GUIApplicationWindow::onUpdReload(FXObject* sender, FXSelector, void* ptr) {
975  sender->handle(this,
977  ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
978  ptr);
979  return 1;
980 }
981 
982 
983 long
984 GUIApplicationWindow::onUpdOpenRecent(FXObject* sender, FXSelector, void* ptr) {
985  sender->handle(this,
986  myAmLoading ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
987  ptr);
988  return 1;
989 }
990 
991 
992 long
993 GUIApplicationWindow::onUpdAddView(FXObject* sender, FXSelector, void* ptr) {
994  sender->handle(this,
996  ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
997  ptr);
998  return 1;
999 }
1000 
1001 
1002 long
1003 GUIApplicationWindow::onCmdStart(FXObject*, FXSelector, void*) {
1004  // check whether a net was loaded successfully
1005  if (!myRunThread->simulationAvailable()) {
1006  myStatusbar->getStatusLine()->setText("No simulation loaded!");
1007  return 1;
1008  }
1009  // check whether it was started before and paused;
1010  if (!myWasStarted) {
1011  myRunThread->begin();
1012  myWasStarted = true;
1013  }
1014  myRunThread->resume();
1015  getApp()->forceRefresh(); // only callking myToolBar2->forceRefresh somehow loses keyboard focus
1016  return 1;
1017 }
1018 
1019 
1020 long
1021 GUIApplicationWindow::onCmdStop(FXObject*, FXSelector, void*) {
1022  myRunThread->stop();
1023  getApp()->forceRefresh(); // only callking myToolBar2->forceRefresh somehow loses keyboard focus
1024  return 1;
1025 }
1026 
1027 
1028 long
1029 GUIApplicationWindow::onCmdStep(FXObject*, FXSelector, void*) {
1030  // check whether a net was loaded successfully
1031  if (!myRunThread->simulationAvailable()) {
1032  myStatusbar->getStatusLine()->setText("No simulation loaded!");
1033  return 1;
1034  }
1035  // check whether it was started before and paused;
1036  if (!myWasStarted) {
1037  myRunThread->begin();
1038  myWasStarted = true;
1039  }
1041  return 1;
1042 }
1043 
1044 
1045 long
1046 GUIApplicationWindow::onCmdSaveState(FXObject*, FXSelector, void*) {
1047  // get the new file name
1048  FXFileDialog opendialog(this, "Save Simulation State");
1049  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_SAVE));
1050  opendialog.setSelectMode(SELECTFILE_ANY);
1051  opendialog.setPatternList("Binary State (*.sbx)\nXML State (*.xml)");
1052  if (gCurrentFolder.length() != 0) {
1053  opendialog.setDirectory(gCurrentFolder);
1054  }
1055  if (!opendialog.execute() || !MFXUtils::userPermitsOverwritingWhenFileExists(this, opendialog.getFilename())) {
1056  return 1;
1057  }
1058 
1059  FXString file = MFXUtils::assureExtension(opendialog.getFilename(),
1060  opendialog.getPatternText(opendialog.getCurrentPattern()).after('.').before(')'));
1062  myStatusbar->getStatusLine()->setText("Simulation saved to " + file);
1063  return 1;
1064 }
1065 
1066 
1067 long
1068 GUIApplicationWindow::onCmdTimeToggle(FXObject*, FXSelector, void*) {
1072  }
1073  return 1;
1074 }
1075 
1076 
1077 long
1078 GUIApplicationWindow::onCmdDelayToggle(FXObject*, FXSelector, void*) {
1079  const double tmp = myAlternateSimDelay;
1081  mySimDelay = tmp;
1082  return 1;
1083 }
1084 
1085 
1086 long
1087 GUIApplicationWindow::onCmdDemandScale(FXObject*, FXSelector, void*) {
1090  }
1091  return 1;
1092 }
1093 
1094 
1095 long
1096 GUIApplicationWindow::onCmdClearMsgWindow(FXObject*, FXSelector, void*) {
1098  return 1;
1099 }
1100 
1101 
1102 long
1103 GUIApplicationWindow::onUpdStart(FXObject* sender, FXSelector, void* ptr) {
1104  sender->handle(this,
1106  ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1107  ptr);
1108  return 1;
1109 }
1110 
1111 
1112 long
1113 GUIApplicationWindow::onUpdStop(FXObject* sender, FXSelector, void* ptr) {
1114  sender->handle(this,
1116  ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1117  ptr);
1118  return 1;
1119 }
1120 
1121 
1122 long
1123 GUIApplicationWindow::onUpdStep(FXObject* sender, FXSelector, void* ptr) {
1124  sender->handle(this,
1126  ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1127  ptr);
1128  return 1;
1129 }
1130 
1131 
1132 long
1133 GUIApplicationWindow::onUpdNeedsSimulation(FXObject* sender, FXSelector, void* ptr) {
1134  bool disable = !myRunThread->simulationAvailable() || myAmLoading;
1135  sender->handle(this, disable ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), ptr);
1136  // mySelectLanesMenuCascade has to be disabled manually
1137  if (disable) {
1138  mySelectLanesMenuCascade->disable();
1139  } else {
1140  mySelectLanesMenuCascade->enable();
1141  }
1142  return 1;
1143 }
1144 
1145 long
1146 GUIApplicationWindow::onUpdTraCIStatus(FXObject* sender, FXSelector, void* ptr) {
1147  sender->handle(this, TraCIServer::getInstance() == nullptr ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), ptr);
1148  return 1;
1149 }
1150 
1151 
1152 long
1153 GUIApplicationWindow::onCmdLocate(FXObject*, FXSelector sel, void*) {
1154  if (myMDIClient->numChildren() > 0) {
1155  GUISUMOViewParent* w = dynamic_cast<GUISUMOViewParent*>(myMDIClient->getActiveChild());
1156  if (w != nullptr) {
1157  w->onCmdLocate(nullptr, sel, nullptr);
1158  }
1159  }
1160  return 1;
1161 }
1162 
1163 
1164 long
1165 GUIApplicationWindow::onCmdShowStats(FXObject*, FXSelector, void*) {
1166  if (myMDIClient->numChildren() > 0) {
1167  GUISUMOViewParent* w = dynamic_cast<GUISUMOViewParent*>(myMDIClient->getActiveChild());
1169  }
1170  return 1;
1171 }
1172 
1173 
1174 long
1175 GUIApplicationWindow::onCmdAppSettings(FXObject*, FXSelector, void*) {
1177  d->create();
1178  d->show(PLACEMENT_OWNER);
1179  return 1;
1180 }
1181 
1182 
1183 long
1184 GUIApplicationWindow::onCmdGaming(FXObject*, FXSelector, void*) {
1186  myGLWindows[0]->getView()->getVisualisationSettings()->gaming = myAmGaming;;
1187  if (myAmGaming) {
1188  myMenuBar->hide();
1189  myStatusbar->hide();
1190  myToolBar1->hide();
1191  myToolBar2->hide();
1192  myToolBar4->hide();
1193  myToolBar5->hide();
1194  myToolBar6->show();
1195  myToolBar8->hide();
1196  myToolBar10->show();
1197  if (myTLSGame) {
1198  myToolBar7->show();
1199  } else {
1200  myToolBar9->show();
1201  }
1202  myMessageWindow->hide();
1208  } else {
1209  myMenuBar->show();
1210  myStatusbar->show();
1211  myToolBar1->show();
1212  myToolBar2->show();
1213  myToolBar4->show();
1214  myToolBar5->show();
1215  myToolBar6->hide();
1216  myToolBar7->hide();
1217  myToolBar8->show();
1218  myToolBar9->hide();
1219  myToolBar10->hide();
1220  myMessageWindow->show();
1222  }
1223  if (myMDIClient->numChildren() > 0) {
1224  GUISUMOViewParent* w = dynamic_cast<GUISUMOViewParent*>(myMDIClient->getActiveChild());
1225  if (w != nullptr) {
1227  }
1228  }
1229  update();
1230  return 1;
1231 }
1232 
1233 
1234 long
1235 GUIApplicationWindow::onCmdFullScreen(FXObject*, FXSelector, void*) {
1237  if (myAmFullScreen) {
1238  getApp()->reg().writeIntEntry("SETTINGS", "x", getX());
1239  getApp()->reg().writeIntEntry("SETTINGS", "y", getY());
1240  getApp()->reg().writeIntEntry("SETTINGS", "width", getWidth());
1241  getApp()->reg().writeIntEntry("SETTINGS", "height", getHeight());
1242  maximize();
1243  setDecorations(DECOR_NONE);
1244  place(PLACEMENT_MAXIMIZED);
1245  myMenuBar->hide();
1246  myStatusbar->hide();
1247  myToolBar1->hide();
1248  myToolBar2->hide();
1249  myToolBar3->hide();
1250  myToolBar4->hide();
1251  myToolBar5->hide();
1252  myToolBar6->hide();
1253  myToolBar7->hide();
1254  myToolBar8->hide();
1255  myMessageWindow->hide();
1256  if (myMDIClient->numChildren() > 0) {
1257  GUISUMOViewParent* w = dynamic_cast<GUISUMOViewParent*>(myMDIClient->getActiveChild());
1258  if (w != nullptr) {
1259  w->setToolBarVisibility(false);
1260  }
1261  }
1262  update();
1263  } else {
1264  place(PLACEMENT_VISIBLE);
1265  setDecorations(DECOR_ALL);
1266  restore();
1267  myToolBar3->show();
1269  onCmdGaming(nullptr, 0, nullptr);
1270  setWidth(getApp()->reg().readIntEntry("SETTINGS", "width", 600));
1271  setHeight(getApp()->reg().readIntEntry("SETTINGS", "height", 400));
1272  setX(getApp()->reg().readIntEntry("SETTINGS", "x", 150));
1273  setY(getApp()->reg().readIntEntry("SETTINGS", "y", 150));
1274  }
1275  return 1;
1276 }
1277 
1278 
1279 long
1280 GUIApplicationWindow::onCmdListInternal(FXObject*, FXSelector, void*) {
1282  return 1;
1283 }
1284 
1285 
1286 long
1287 GUIApplicationWindow::onCmdListParking(FXObject*, FXSelector, void*) {
1289  return 1;
1290 }
1291 
1292 long
1293 GUIApplicationWindow::onCmdListTeleporting(FXObject*, FXSelector, void*) {
1295  return 1;
1296 }
1297 
1298 
1299 long
1300 GUIApplicationWindow::onCmdNewView(FXObject*, FXSelector, void*) {
1302  return 1;
1303 }
1304 
1305 
1306 #ifdef HAVE_OSG
1307 long
1308 GUIApplicationWindow::onCmdNewOSG(FXObject*, FXSelector, void*) {
1310  return 1;
1311 }
1312 #endif
1313 
1314 
1315 long
1316 GUIApplicationWindow::onCmdAbout(FXObject*, FXSelector, void*) {
1317  GUIDialog_AboutSUMO* about = new GUIDialog_AboutSUMO(this);
1318  about->create();
1319  about->show(PLACEMENT_OWNER);
1320  return 1;
1321 }
1322 
1323 
1324 long GUIApplicationWindow::onClipboardRequest(FXObject* /* sender */, FXSelector /* sel */, void* ptr) {
1325  FXEvent* event = (FXEvent*)ptr;
1326  FXString string = GUIUserIO::clipped.c_str();
1327  setDNDData(FROM_CLIPBOARD, event->target, string);
1328  return 1;
1329 }
1330 
1331 
1332 long
1333 GUIApplicationWindow::onLoadThreadEvent(FXObject*, FXSelector, void*) {
1334  eventOccurred();
1335  return 1;
1336 }
1337 
1338 
1339 long
1340 GUIApplicationWindow::onRunThreadEvent(FXObject*, FXSelector, void*) {
1341  eventOccurred();
1342  return 1;
1343 }
1344 
1345 
1346 void
1348  while (!myEvents.empty()) {
1349  // get the next event
1350  GUIEvent* e = myEvents.top();
1351  myEvents.pop();
1352  // process
1353  switch (e->getOwnType()) {
1356  break;
1357  case EVENT_SIMULATION_STEP:
1358  if (myRunThread->simulationAvailable()) { // avoid race-condition related crash if reload was pressed
1360  }
1361  break;
1364  case EVENT_ERROR_OCCURRED:
1365  case EVENT_DEBUG_OCCURRED:
1367  case EVENT_STATUS_OCCURRED:
1369  break;
1372  break;
1373  default:
1374  break;
1375  }
1376  delete e;
1377  }
1378  myToolBar2->forceRefresh();
1379  myToolBar3->forceRefresh();
1380 }
1381 
1382 
1383 void
1385  myAmLoading = false;
1386  GUIEvent_SimulationLoaded* ec = static_cast<GUIEvent_SimulationLoaded*>(e);
1387  // check whether the loading was successfull
1388  if (ec->myNet == nullptr) {
1389  // report failure
1390  setStatusBarText("Loading of '" + ec->myFile + "' failed!");
1391  if (GUIGlobals::gQuitOnEnd) {
1392  closeAllWindows();
1393  getApp()->exit(1);
1394  }
1395  } else {
1396  // initialise simulation thread
1397  if (!myRunThread->init(ec->myNet, ec->myBegin, ec->myEnd)) {
1398  if (GUIGlobals::gQuitOnEnd) {
1399  closeAllWindows();
1400  getApp()->exit(1);
1401  }
1402  } else {
1403  // report success
1404  setStatusBarText("'" + ec->myFile + "' loaded.");
1406  myWasStarted = false;
1407  myHaveNotifiedAboutSimEnd = false;
1408  // initialise views
1409  myViewNumber = 0;
1411  if (ec->mySettingsFiles.size() > 0) {
1412  // open a view for each file and apply settings
1413  for (std::vector<std::string>::const_iterator it = ec->mySettingsFiles.begin(); it != ec->mySettingsFiles.end(); ++it) {
1414  GUISettingsHandler settings(*it);
1415  GUISUMOViewParent::ViewType vt = defaultType;
1416  if (settings.getViewType() == "osg" || settings.getViewType() == "3d") {
1418  }
1419  if (settings.getViewType() == "opengl" || settings.getViewType() == "2d") {
1421  }
1422  GUISUMOAbstractView* view = openNewView(vt);
1423  if (view == nullptr) {
1424  break;
1425  }
1426  std::string settingsName = settings.addSettings(view);
1427  view->addDecals(settings.getDecals());
1428  settings.applyViewport(view);
1429  settings.setSnapshots(view);
1430  if (settings.getDelay() > 0.) {
1431  mySimDelay = settings.getDelay();
1432  }
1433  if (settings.getBreakpoints().size() > 0) {
1434  myRunThread->getBreakpointLock().lock();
1435  myRunThread->getBreakpoints().assign(settings.getBreakpoints().begin(), settings.getBreakpoints().end());
1436  myRunThread->getBreakpointLock().unlock();
1437  }
1438  if (!OptionsCont::getOptions().isDefault("breakpoints")) {
1439  std::vector<SUMOTime> breakpoints;
1440  for (const std::string& val : OptionsCont::getOptions().getStringVector("breakpoints")) {
1441  breakpoints.push_back(string2time(val));
1442  }
1443  std::sort(breakpoints.begin(), breakpoints.end());
1444  myRunThread->getBreakpointLock().lock();
1445  myRunThread->getBreakpoints().assign(breakpoints.begin(), breakpoints.end());
1446  myRunThread->getBreakpointLock().unlock();
1447  }
1448  myJamSounds = settings.getEventDistribution("jam");
1449  myCollisionSounds = settings.getEventDistribution("collision");
1450  if (settings.getJamSoundTime() > 0) {
1451  myJamSoundTime = settings.getJamSoundTime();
1452  }
1453  }
1454  } else {
1455  openNewView(defaultType);
1456  }
1457  if (!OptionsCont::getOptions().isDefault("breakpoints")) {
1458  std::vector<SUMOTime> breakpoints;
1459  for (const std::string& val : OptionsCont::getOptions().getStringVector("breakpoints")) {
1460  breakpoints.push_back(string2time(val));
1461  }
1462  std::sort(breakpoints.begin(), breakpoints.end());
1463  myRunThread->getBreakpointLock().lock();
1464  myRunThread->getBreakpoints().assign(breakpoints.begin(), breakpoints.end());
1465  myRunThread->getBreakpointLock().unlock();
1466  }
1467 
1468  if (OptionsCont::getOptions().getBool("game")) {
1469  if (OptionsCont::getOptions().getString("game.mode") == "tls") {
1470  myTLSGame = true;
1471  setTitle("SUMO Interactive Traffic Light");
1472  } else {
1473  myTLSGame = false;
1474  setTitle("SUMO Interactive Demand-Responsive-Transport");
1475  }
1476  onCmdGaming(nullptr, 0, nullptr);
1477  } else {
1478  // set simulation name on the caption
1479  setTitle(MFXUtils::getTitleText("SUMO " VERSION_STRING, ec->myFile.c_str()));
1480  }
1481  if (ec->myViewportFromRegistry) {
1482  Position off;
1483  off.set(getApp()->reg().readRealEntry("viewport", "x"),
1484  getApp()->reg().readRealEntry("viewport", "y"),
1485  getApp()->reg().readRealEntry("viewport", "z"));
1486  Position p(off.x(), off.y(), 0);
1487  GUISUMOAbstractView* view = myGLWindows[0]->getView();
1488  view->setViewportFromToRot(off, p, 0);
1489  }
1490  // set simulation step begin information
1491  myLCDLabel->setText("----------------");
1492  for (std::vector<FXButton*>::const_iterator it = myStatButtons.begin(); it != myStatButtons.end(); ++it) {
1493  (*it)->setText("-");
1494  }
1495  // initialize scale from options
1496  myDemandScaleSpinner->setValue(OptionsCont::getOptions().getFloat("scale"));
1497  }
1498  }
1499  getApp()->endWaitCursor();
1500  // start if wished
1501  if (GUIGlobals::gRunAfterLoad && ec->myNet != nullptr && myRunThread->simulationIsStartable()) {
1502  onCmdStart(nullptr, 0, nullptr);
1503  }
1504  update();
1505 }
1506 
1507 
1508 void
1511  const int running = myRunThread->getNet().getVehicleControl().getRunningVehicleNo();
1512  const int backlog = myRunThread->getNet().getInsertionControl().getWaitingVehicleNo();
1513  if (backlog > running) {
1514  if (myStatButtons.front()->getIcon() == GUIIconSubSys::getIcon(ICON_GREENVEHICLE)) {
1516  }
1517  } else {
1518  if (myStatButtons.front()->getIcon() == GUIIconSubSys::getIcon(ICON_YELLOWVEHICLE)) {
1520  }
1521  }
1522  myStatButtons.front()->setText(toString(running).c_str());
1523  if (myRunThread->getNet().hasPersons()) {
1524  if (!myStatButtons[1]->shown()) {
1525  myStatButtons[1]->show();
1526  }
1528  }
1529  if (myRunThread->getNet().hasContainers()) {
1530  if (!myStatButtons[2]->shown()) {
1531  myStatButtons[2]->show();
1532  }
1534  }
1535  if (myAmGaming) {
1536  if (myTLSGame) {
1538  } else {
1540  }
1541  }
1543  getApp()->forceRefresh(); // restores keyboard focus
1544  }
1545  updateChildren();
1546  update();
1547 }
1548 
1549 
1550 void
1552  GUIEvent_Message* ec = static_cast<GUIEvent_Message*>(e);
1553  if (ec->getOwnType() == EVENT_STATUS_OCCURRED) {
1554  setStatusBarText(ec->getMsg());
1555  } else {
1556  myMessageWindow->appendMsg(ec->getOwnType(), ec->getMsg());
1557  }
1558 }
1559 
1560 
1561 void
1563  GUIEvent_SimulationEnded* ec = static_cast<GUIEvent_SimulationEnded*>(e);
1564  onCmdStop(nullptr, 0, nullptr);
1565  if (ec->getReason() == MSNet::SIMSTATE_LOADING) {
1566  onCmdReload(nullptr, 0, nullptr);
1567  } else if (GUIGlobals::gQuitOnEnd) {
1568  closeAllWindows();
1569  getApp()->exit(ec->getReason() == MSNet::SIMSTATE_ERROR_IN_SIM);
1570  } else if (GUIGlobals::gDemoAutoReload) {
1571  onCmdReload(nullptr, 0, nullptr);
1572  } else if (!myHaveNotifiedAboutSimEnd) {
1573  // build the text
1574  const std::string text = "Simulation ended at time: " + time2string(ec->getTimeStep()) +
1575  ".\nReason: " + MSNet::getStateMessage(ec->getReason()) +
1576  "\nDo you want to close all open files and views?";
1577  FXuint answer = FXMessageBox::question(this, MBOX_YES_NO, "Simulation ended", "%s", text.c_str());
1578  if (answer == 1) { //1:yes, 2:no, 4:esc
1579  closeAllWindows();
1580  }
1582  }
1583 }
1584 
1585 
1586 void
1591 #ifdef HAVE_DANGEROUS_SOUNDS // disable user-configurable command execution for public build
1592  if (myJamSounds.getOverallProb() > 0) {
1593  // play honking sound if some vehicle is waiting too long
1594  for (; it != end; ++it) {
1595  // XXX use impatience instead of waiting time ?
1596  if (it->second->getWaitingTime() > TIME2STEPS(myJamSoundTime)) {
1597  const std::string cmd = myJamSounds.get(&myGamingRNG);
1598  if (cmd != "") {
1599  // yay! fun with dangerous commands... Never use this over the internet
1601  // one sound per simulation step is enough
1602  break;
1603  }
1604  }
1605  }
1606  }
1607  if (myCollisionSounds.getOverallProb() > 0) {
1608  int collisions = MSNet::getInstance()->getVehicleControl().getCollisionCount();
1609  if (myPreviousCollisionNumber != collisions) {
1610  const std::string cmd = myCollisionSounds.get(&myGamingRNG);
1611  if (cmd != "") {
1612  // yay! fun with dangerous commands... Never use this over the internet
1614  }
1615  myPreviousCollisionNumber = collisions;
1616  }
1617  }
1618 #endif
1619 
1620  // update performance indicators
1621  for (it = vc.loadedVehBegin(); it != end; ++it) {
1622  const MSVehicle* veh = dynamic_cast<MSVehicle*>(it->second);
1623  assert(veh != 0);
1624  if (veh->isOnRoad() && !veh->isStopped()) {
1625  const double vmax = MIN2(veh->getVehicleType().getMaxSpeed(), veh->getEdge()->getSpeedLimit());
1626  if (veh->getSpeed() < SUMO_const_haltingSpeed) {
1628  if (veh->getID().rfind("emergency", 0) == 0) {
1630  }
1631  }
1632  myTimeLoss += TIME2STEPS(TS * (vmax - veh->getSpeed()) / vmax); // may be negative with speedFactor > 1
1633  }
1634 
1635  }
1639 }
1640 
1641 void
1643  // update performance indicators
1647 
1650  for (auto it = vc.loadedVehBegin(); it != end; ++it) {
1651  const MSVehicle* veh = dynamic_cast<MSVehicle*>(it->second);
1652  assert(veh != 0);
1653  if (veh->isOnRoad() && !veh->isStopped()) {
1654  myTotalDistance += SPEED2DIST(veh->getSpeed());
1655  }
1656  }
1658 }
1659 
1660 void
1661 GUIApplicationWindow::loadConfigOrNet(const std::string& file, bool isNet) {
1663  getApp()->beginWaitCursor();
1664  myAmLoading = true;
1665  closeAllWindows();
1666  gSchemeStorage.saveViewport(0, 0, -1, 0); // recenter view
1667  myLoadThread->loadConfigOrNet(file, isNet);
1668  setStatusBarText("Loading '" + file + "'.");
1669  update();
1670 }
1671 
1672 
1675  if (!myRunThread->simulationAvailable()) {
1676  myStatusbar->getStatusLine()->setText("No simulation loaded!");
1677  return nullptr;
1678  }
1679  GUISUMOAbstractView* oldView = nullptr;
1680  if (myMDIClient->numChildren() > 0) {
1681  GUISUMOViewParent* w = dynamic_cast<GUISUMOViewParent*>(myMDIClient->getActiveChild());
1682  if (w != nullptr) {
1683  oldView = w->getView();
1684  }
1685  }
1686  std::string caption = "View #" + toString(myViewNumber++);
1687  FXuint opts = MDI_TRACKING;
1688  GUISUMOViewParent* w = new GUISUMOViewParent(myMDIClient, myMDIMenu, FXString(caption.c_str()),
1689  this, GUIIconSubSys::getIcon(ICON_SUMO_MINI), opts, 10, 10, 300, 200);
1691  if (oldView != nullptr) {
1692  // copy viewport
1693  oldView->copyViewportTo(v);
1694  }
1695  w->create();
1696  if (myMDIClient->numChildren() == 1) {
1697  w->maximize();
1698  } else {
1699  myMDIClient->vertical(true);
1700  }
1701  myMDIClient->setActiveChild(w);
1702 
1703  return v;
1704 }
1705 
1706 
1707 FXGLCanvas*
1709  if (myMDIClient->numChildren() == 0) {
1710  return nullptr;
1711  }
1712  GUISUMOViewParent* share_tmp1 =
1713  static_cast<GUISUMOViewParent*>(myMDIClient->childAtIndex(0));
1714  return share_tmp1->getBuildGLCanvas();
1715 }
1716 
1717 
1718 void
1720  myTrackerLock.lock();
1721  myLCDLabel->setText("----------------");
1722  for (std::vector<FXButton*>::const_iterator it = myStatButtons.begin(); it != myStatButtons.end(); ++it) {
1723  (*it)->setText("-");
1724  if (it != myStatButtons.begin()) {
1725  (*it)->hide();
1726  }
1727  }
1728  // delete the simulation
1730  // reset the caption
1731  setTitle(MFXUtils::getTitleText("SUMO " VERSION_STRING));
1732  // remove trackers and other external windows (must be delayed until deleteSim)
1733  while (!myGLWindows.empty()) {
1734  delete myGLWindows.front();
1735  }
1736  for (FXMainWindow* const window : myTrackerWindows) {
1737  delete window;
1738  }
1739  myTrackerWindows.clear();
1740  // clear selected items
1741  gSelected.clear();
1742  // add a separator to the log
1744  myTrackerLock.unlock();
1745  // remove coordinate information
1746  myGeoCoordinate->setText("N/A");
1747  myCartesianCoordinate->setText("N/A");
1748  //
1751  update();
1752 }
1753 
1754 
1755 FXCursor*
1757  return getApp()->getDefaultCursor(DEF_ARROW_CURSOR);
1758 }
1759 
1760 
1761 SUMOTime
1764 }
1765 
1766 
1767 double
1770 }
1771 
1772 
1773 void
1775  loadConfigOrNet("", false);
1776 }
1777 
1778 
1779 void
1780 GUIApplicationWindow::setStatusBarText(const std::string& text) {
1781  myStatusbar->getStatusLine()->setText(text.c_str());
1782 
1783  myStatusbar->getStatusLine()->setNormalText(text.c_str());
1784 }
1785 
1786 
1787 void
1788 GUIApplicationWindow::addRecentFile(const FX::FXString& f, const bool isNet) {
1789  if (isNet) {
1790  myRecentNets.appendFile(f);
1791  } else {
1792  myRecentConfigs.appendFile(f);
1793  }
1794 }
1795 
1796 
1797 void
1799  time -= DELTA_T; // synchronize displayed time with netstate output
1800  if (time < 0) {
1801  myLCDLabel->setText("----------------");
1802  return;
1803  }
1804  if (myAmGaming) {
1805  // show time counting backwards
1806  time = myRunThread->getSimEndTime() - time;
1807  }
1808  std::ostringstream str;
1809  str << std::setfill('0');
1810  const bool hideFraction = myAmGaming || DELTA_T % 1000 == 0;
1811  if (myShowTimeAsHMS) {
1812  SUMOTime day = time / 86400000;
1813  if (day > 0) {
1814  str << day << '-';
1815  time %= 86400000;
1816  }
1817  str << std::setw(2);
1818  str << time / 3600000 << '-';
1819  time %= 3600000;
1820  str << std::setw(2) << time / 60000 << '-';
1821  time %= 60000;
1822  }
1823  str << std::setw(2) << time / 1000;
1824  if (!hideFraction) {
1825  str << '.' << std::setw(3) << time % 1000;
1826  }
1827  myLCDLabel->setText(str.str().c_str());
1828 }
1829 
1830 
1831 long
1832 GUIApplicationWindow::onKeyPress(FXObject* o, FXSelector sel, void* data) {
1833  const long handled = FXMainWindow::onKeyPress(o, sel, data);
1834  if (handled == 0 && myMDIClient->numChildren() > 0) {
1835  GUISUMOViewParent* w = dynamic_cast<GUISUMOViewParent*>(myMDIClient->getActiveChild());
1836  if (w != nullptr) {
1837  w->onKeyPress(nullptr, sel, data);
1838  }
1839  }
1840  return 0;
1841 }
1842 
1843 
1844 long
1845 GUIApplicationWindow::onKeyRelease(FXObject* o, FXSelector sel, void* data) {
1846  const long handled = FXMainWindow::onKeyRelease(o, sel, data);
1847  if (handled == 0 && myMDIClient->numChildren() > 0) {
1848  GUISUMOViewParent* w = dynamic_cast<GUISUMOViewParent*>(myMDIClient->getActiveChild());
1849  if (w != nullptr) {
1850  w->onKeyRelease(nullptr, sel, data);
1851  }
1852  }
1853  return 0;
1854 }
1855 
1856 
1857 void
1859  myEventMutex.lock();
1860  myEvents.push_back(event);
1863  myEventMutex.unlock();
1864 }
1865 
1866 void
1867 GUIApplicationWindow::setBreakpoints(const std::vector<SUMOTime>& breakpoints) {
1868  if (myRunThread != nullptr) {
1869  myRunThread->getBreakpointLock().lock();
1870  myRunThread->getBreakpoints().assign(breakpoints.begin(), breakpoints.end());
1871  myRunThread->getBreakpointLock().unlock();
1872  }
1873 }
1874 
1875 const std::vector<SUMOTime>
1877  myRunThread->getBreakpointLock().lock();
1878  std::vector<SUMOTime> result = myRunThread->getBreakpoints();
1879  myRunThread->getBreakpointLock().unlock();
1880  return result;
1881 }
1882 
1883 /****************************************************************************/
MID_LOCATEPOI
Locate poi - button.
Definition: GUIAppEnum.h:323
GUICompleteSchemeStorage.h
GUIPerspectiveChanger::getYPos
virtual double getYPos() const =0
Returns the y-offset of the field to show stored in this changer.
GUIApplicationWindow::myLCDLabel
FXEX::FXLCDLabel * myLCDLabel
the simulation step display
Definition: GUIApplicationWindow.h:393
GUISUMOViewParent::setToolBarVisibility
void setToolBarVisibility(const bool value)
@notify about toggled gaming status
Definition: GUISUMOViewParent.cpp:129
MID_LOCATETLS
Locate TLS - button.
Definition: GUIAppEnum.h:319
GUIApplicationWindow::myToolBar3
FXToolBar * myToolBar3
Definition: GUIApplicationWindow.h:390
SysUtils::runHiddenCommand
static unsigned long runHiddenCommand(const std::string &cmd)
run a shell command without popping up any windows (particuarly on win32)
Definition: SysUtils.cpp:64
ICON_YELLOWVEHICLE
Definition: GUIIcons.h:94
GUIApplicationWindow::handleEvent_SimulationStep
void handleEvent_SimulationStep(GUIEvent *e)
Definition: GUIApplicationWindow.cpp:1509
SUMOVehicleClass
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
Definition: SUMOVehicleClass.h:134
FXEX::SEL_THREAD
Definition: fxexdefs.h:166
SPEED2DIST
#define SPEED2DIST(x)
Definition: SUMOTime.h:47
GUIMainWindow::listParking
bool listParking() const
return whether to list parking vehicles
Definition: GUIMainWindow.h:93
ICON_OSGVIEW
Definition: GUIIcons.h:64
ToString.h
XMLSubSys::runParser
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.
Definition: XMLSubSys.cpp:113
GUIApplicationWindow::myAlternateSimDelay
double myAlternateSimDelay
The alternate simulation delay in milliseconds for toggling.
Definition: GUIApplicationWindow.h:378
GUIMainWindow::myAmFullScreen
bool myAmFullScreen
whether to show the window in full screen mode
Definition: GUIMainWindow.h:145
FXDEFMAP
FXDEFMAP(GUIApplicationWindow) GUIApplicationWindowMap[]
GUIDesignSpinDial
#define GUIDesignSpinDial
Definition: GUIDesigns.h:357
GUISUMOAbstractView::copyViewportTo
virtual void copyViewportTo(GUISUMOAbstractView *view)
copy the viewport to the given view
Definition: GUISUMOAbstractView.cpp:1336
MIN2
T MIN2(T a, T b)
Definition: StdDefs.h:74
GUIDesignToolBarGrip
#define GUIDesignToolBarGrip
design for toolbar grip (used to change the position of toolbar with mouse)
Definition: GUIDesigns.h:323
GUIApplicationWindow::onCmdEditChosen
long onCmdEditChosen(FXObject *, FXSelector, void *)
Called on menu Edit->Edit Chosen.
Definition: GUIApplicationWindow.cpp:733
GUIMainWindow::myCartesianFrame
FXHorizontalFrame * myCartesianFrame
Definition: GUIMainWindow.h:163
GUIMainWindow::myGeoFrame
FXHorizontalFrame * myGeoFrame
Definition: GUIMainWindow.h:163
GUICursorSubSys.h
ICON_OPEN_SHAPES
Definition: GUIIcons.h:45
GUIApplicationWindow::myTLSGame
bool myTLSGame
current game mode
Definition: GUIApplicationWindow.h:434
GUIApplicationWindow::onUpdOpen
long onUpdOpen(FXObject *, FXSelector, void *)
Determines whether opening is enabled.
Definition: GUIApplicationWindow.cpp:965
GUIRunThread::simulationIsStopable
virtual bool simulationIsStopable() const
Definition: GUIRunThread.cpp:329
NLShapeHandler
The XML-Handler for shapes loading network loading.
Definition: NLHandler.h:57
MSVehicleControl::setScale
void setScale(double scale)
sets the demand scaling factor
Definition: MSVehicleControl.h:515
MSEdge::getSpeedLimit
double getSpeedLimit() const
Returns the speed limit of the edge @caution The speed limit of the first lane is retured; should pro...
Definition: MSEdge.cpp:916
GUIMainWindow::storeWindowSizeAndPos
void storeWindowSizeAndPos()
record window position and size in registry
Definition: GUIMainWindow.cpp:242
MID_LOCATEEDGE
Locate edge - button.
Definition: GUIAppEnum.h:309
EVENT_MESSAGE_OCCURRED
send when a message occured
Definition: GUIEvent.h:43
GUIEvent_SimulationLoaded
Definition: GUIEvent_SimulationLoaded.h:50
GUIApplicationWindow::onUpdStop
long onUpdStop(FXObject *, FXSelector, void *)
Determines whether "stop" is enabled.
Definition: GUIApplicationWindow.cpp:1113
MSNet::hasContainers
bool hasContainers() const
Returns whether containers are simulated.
Definition: MSNet.h:370
GUIRunThread::singleStep
void singleStep()
Definition: GUIRunThread.cpp:252
MID_HOTKEY_CTRL_P
Load additional file with poi and polygons.
Definition: GUIAppEnum.h:226
GUISUMOAbstractView
Definition: GUISUMOAbstractView.h:73
GUIApplicationWindow::myToolBarDrag4
FXToolBarShell * myToolBarDrag4
Definition: GUIApplicationWindow.h:364
GUIApplicationWindow::hadDependentBuild
bool hadDependentBuild
Definition: GUIApplicationWindow.h:410
GUIApplicationWindow::myJamSounds
RandomDistributor< std::string > myJamSounds
Definition: GUIApplicationWindow.h:426
MSVehicle::isStopped
bool isStopped() const
Returns whether the vehicle is at a stop.
Definition: MSVehicle.cpp:1751
GUIMainWindow::myMDIClient
FXMDIClient * myMDIClient
The multi view panel.
Definition: GUIMainWindow.h:156
GUIApplicationWindow::onCmdOpenNetwork
long onCmdOpenNetwork(FXObject *, FXSelector, void *)
Called on menu File->Open Network.
Definition: GUIApplicationWindow.cpp:856
GUISUMOViewParent
A single child window which contains a view of the simulation area.
Definition: GUISUMOViewParent.h:59
GUIApplicationWindow::mySimDelaySlider
FXSlider * mySimDelaySlider
Definition: GUIApplicationWindow.h:372
FXEX::FXLCDLabel::setFgColor
void setFgColor(FXColor clr)
set/get forground color
Definition: FXLCDLabel.cpp:120
GUIDialog_Breakpoints::show
void show()
sets the focus after the window is created
Definition: GUIDialog_Breakpoints.cpp:110
GUIMainWindow::myTopDock
FXDockSite * myTopDock
Definition: GUIMainWindow.h:168
GUIShortcutsSubSys::buildSUMOAccelerators
static void buildSUMOAccelerators(GUIApplicationWindow *GUIApp)
build SUMO Accelerators
Definition: GUIShortcutsSubSys.cpp:36
GUIMainWindow::myStatusbar
FXStatusBar * myStatusbar
The status bar.
Definition: GUIMainWindow.h:159
GUIApplicationWindow::myWaitingTime
SUMOTime myWaitingTime
Definition: GUIApplicationWindow.h:441
GUIParameterTableWindow.h
MSVehicle::isOnRoad
bool isOnRoad() const
Returns the information whether the vehicle is on a road (is simulated)
Definition: MSVehicle.h:583
GUICursorSubSys::initCursors
static void initCursors(FXApp *a)
Initiate GUICursorSubSys.
Definition: GUICursorSubSys.cpp:69
GUIApplicationWindow::onCmdSaveState
long onCmdSaveState(FXObject *, FXSelector, void *)
Called on "save state".
Definition: GUIApplicationWindow.cpp:1046
GUINet::getContainerControl
MSTransportableControl & getContainerControl() override
Returns the container control.
Definition: GUINet.cpp:129
GUIDialog_AboutSUMO
The application's "About" - dialog.
Definition: GUIDialog_AboutSUMO.h:37
GUIMessageWindow
A logging window for the gui.
Definition: GUIMessageWindow.h:54
DELTA_T
SUMOTime DELTA_T
Definition: SUMOTime.cpp:35
GUIPerspectiveChanger::getZPos
virtual double getZPos() const =0
Returns the camera height corresponding to the current zoom factor.
MSNet::getShapeContainer
ShapeContainer & getShapeContainer()
Returns the shapes container.
Definition: MSNet.h:460
GUIApplicationWindow::onCmdDemandScale
long onCmdDemandScale(FXObject *, FXSelector, void *)
Called on "demand scale".
Definition: GUIApplicationWindow.cpp:1087
GUINet::getGUIInstance
static GUINet * getGUIInstance()
Returns the pointer to the unique instance of GUINet (singleton).
Definition: GUINet.cpp:516
GUIGlChildWindow::getBuildGLCanvas
virtual FXGLCanvas * getBuildGLCanvas() const
get build GL Canvas
Definition: GUIGlChildWindow.cpp:166
OptionsCont.h
GUIApplicationWindow::onUpdNeedsSimulation
long onUpdNeedsSimulation(FXObject *, FXSelector, void *)
Determines whether some buttons which require an active simulation may be shown.
Definition: GUIApplicationWindow.cpp:1133
GUIRunThread::begin
virtual void begin()
Definition: GUIRunThread.cpp:259
GUIApplicationWindow::onCmdClearMsgWindow
long onCmdClearMsgWindow(FXObject *, FXSelector, void *)
Called if the message window shall be cleared.
Definition: GUIApplicationWindow.cpp:1096
GUIApplicationWindow::myLocatorMenu
FXMenuPane * myLocatorMenu
Definition: GUIApplicationWindow.h:347
FXEX::FXBaseObject::setTarget
void setTarget(FXObject *tgt)
set the target
Definition: FXBaseObject.h:130
GUIDesignSplitterMDI
#define GUIDesignSplitterMDI
MDI Splitter.
Definition: GUIDesigns.h:350
GUIDialog_AboutSUMO::create
void create()
Creates the widget.
Definition: GUIDialog_AboutSUMO.cpp:75
MID_TRACI_STATUS
update traci status
Definition: GUIAppEnum.h:297
GUIApplicationWindow::myWasStarted
bool myWasStarted
the information whether the simulation was started before
Definition: GUIApplicationWindow.h:338
ICON_EMPTY
Definition: GUIIcons.h:42
GUIApplicationWindow::onCmdNetedit
long onCmdNetedit(FXObject *, FXSelector, void *)
Called on menu Edit->Netedit.
Definition: GUIApplicationWindow.cpp:801
GUIApplicationWindow::myWindowsMenu
FXMenuPane * myWindowsMenu
Definition: GUIApplicationWindow.h:347
GUISettingsHandler::getDecals
const std::vector< GUISUMOAbstractView::Decal > & getDecals() const
Returns the parsed decals.
Definition: GUISettingsHandler.cpp:412
GUIApplicationWindow::onKeyPress
long onKeyPress(FXObject *o, FXSelector sel, void *data)
handle keys
Definition: GUIApplicationWindow.cpp:1832
ICON_SAVE
Definition: GUIIcons.h:49
GUIDesignStatusBar
#define GUIDesignStatusBar
design used in status bar
Definition: GUIDesigns.h:320
GUIApplicationWindow::myDemandScaleSpinner
FXRealSpinner * myDemandScaleSpinner
the demand scale
Definition: GUIApplicationWindow.h:375
GUIApplicationWindow::updateTimeLCD
void updateTimeLCD(SUMOTime time)
updates the simulation time display
Definition: GUIApplicationWindow.cpp:1798
GUIGlChildWindow::create
virtual void create()
create GUIGlChildWindow
Definition: GUIGlChildWindow.cpp:86
GUISettingsHandler::setSnapshots
void setSnapshots(GUISUMOAbstractView *view) const
Makes a snapshot if it has been parsed.
Definition: GUISettingsHandler.cpp:394
GUIGlobalSelection.h
MID_HOTKEY_F1_ONLINEDOCUMENTATION
hot key <F1> open online documentation
Definition: GUIAppEnum.h:158
MSNet::getInsertionControl
MSInsertionControl & getInsertionControl()
Returns the insertion control.
Definition: MSNet.h:390
OptionsCont::getString
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
Definition: OptionsCont.cpp:202
GUIApplicationWindow::onCmdTimeToggle
long onCmdTimeToggle(FXObject *, FXSelector, void *)
Called on "time toggle".
Definition: GUIApplicationWindow.cpp:1068
GUIApplicationWindow::myStatButtons
std::vector< FXButton * > myStatButtons
Buttons showing and running values and triggering statistic windows.
Definition: GUIApplicationWindow.h:355
ID_RUNTHREAD_EVENT
The Simulation execution thread.
Definition: GUIAppEnum.h:258
MID_NEW_MICROVIEW
Open a new microscopic view.
Definition: GUIAppEnum.h:246
GUIMainWindow::myGLWindows
std::vector< GUIGlChildWindow * > myGLWindows
Definition: GUIMainWindow.h:147
MSLane::getPermissions
SVCPermissions getPermissions() const
Returns the vehicle class permissions for this lane.
Definition: MSLane.h:549
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:35
GUIApplicationWindow::loadConfigOrNet
void loadConfigOrNet(const std::string &file, bool isNet)
Definition: GUIApplicationWindow.cpp:1661
ICON_OPEN_NET
Definition: GUIIcons.h:44
MSTransportableControl::getWaitingForVehicleNumber
int getWaitingForVehicleNumber() const
Returns the number of vehicles waiting for a ride.
Definition: MSTransportableControl.h:202
GUIRunThread::getBreakpoints
std::vector< SUMOTime > & getBreakpoints()
Definition: GUIRunThread.h:109
GUIEvent_SimulationLoaded::myBegin
const SUMOTime myBegin
the time the simulation shall start with
Definition: GUIEvent_SimulationLoaded.h:74
GLHelper::resetFont
static void resetFont()
to be called when the font context is invalidated
Definition: GLHelper.cpp:633
GUIRunThread
Definition: GUIRunThread.h:57
MID_CLEARMESSAGEWINDOW
Clear simulation output.
Definition: GUIAppEnum.h:289
GUIMainWindow::myListTeleporting
bool myListTeleporting
information whether the locator should list teleporting vehicles
Definition: GUIMainWindow.h:180
MID_HOTKEY_CTRL_R_RELOAD
Reload the previously loaded simulation.
Definition: GUIAppEnum.h:100
GUIApplicationWindow::myPreviousCollisionNumber
int myPreviousCollisionNumber
Definition: GUIApplicationWindow.h:432
MFXUtils::getTitleText
static FXString getTitleText(const FXString &appname, FXString filename="")
Returns the title text in dependance to an optional file name.
Definition: MFXUtils.cpp:62
GUIApplicationWindow::myEmergencyVehicleLabel
FXEX::FXLCDLabel * myEmergencyVehicleLabel
Definition: GUIApplicationWindow.h:440
OptionsCont::getOptions
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:58
GUIIconSubSys::close
static void close()
close GUIIconSubSys
Definition: GUIIconSubSys.cpp:608
ICON_LOCATEEDGE
Definition: GUIIcons.h:77
MSNet::hasPersons
bool hasPersons() const
Returns whether persons are simulated.
Definition: MSNet.h:354
MSGlobals::gUseMesoSim
static bool gUseMesoSim
Definition: MSGlobals.h:91
MID_DELAY_TOOGLE
toogle delay between alternative value
Definition: GUIAppEnum.h:339
MID_SHOWPERSONSTATS
Show person statistics.
Definition: GUIAppEnum.h:295
GUIEvent_Message::getMsg
const std::string & getMsg() const
Returns the message.
Definition: GUIEvent_Message.h:74
GUIEvent_Message.h
ICON_OPEN_CONFIG
Definition: GUIIcons.h:43
ICON_SUMO_MINI
Definition: GUIIcons.h:40
GUIEvent_SimulationEnded.h
GUIApplicationWindow::myEmergencyVehicleCount
SUMOTime myEmergencyVehicleCount
Definition: GUIApplicationWindow.h:443
MID_LOCATEPERSON
Locate person - button.
Definition: GUIAppEnum.h:317
MID_HOTKEY_F2_ABOUT
hot key <F2> open about dialog
Definition: GUIAppEnum.h:160
EVENT_STATUS_OCCURRED
send when a status change occured
Definition: GUIEvent.h:58
MSEdge.h
GLHelper.h
GUIDesignSplitter
#define GUIDesignSplitter
Definition: GUIDesigns.h:347
GUIRunThread::simulationIsStartable
virtual bool simulationIsStartable() const
Definition: GUIRunThread.cpp:323
GUIDesigns.h
ICON_STEP
Definition: GUIIcons.h:58
GUIApplicationWindow::onUpdAddView
long onUpdAddView(FXObject *, FXSelector, void *)
Determines whether adding a view is enabled.
Definition: GUIApplicationWindow.cpp:993
MSInsertionControl.h
ICON_LOCATETLS
Definition: GUIIcons.h:82
GUIRunThread.h
GUINet.h
MSInsertionControl::getWaitingVehicleNo
int getWaitingVehicleNo() const
Returns the number of waiting vehicles.
Definition: MSInsertionControl.cpp:260
GUISettingsHandler.h
FXEX::FXBaseObject::setSelector
void setSelector(FXSelector sel)
set the selector
Definition: FXBaseObject.h:140
GUIApplicationWindow::setBreakpoints
virtual void setBreakpoints(const std::vector< SUMOTime > &breakpoints)
Sets the breakpoints of the parent application.
Definition: GUIApplicationWindow.cpp:1867
GUIApplicationWindow::getDefaultCursor
FXCursor * getDefaultCursor()
Definition: GUIApplicationWindow.cpp:1756
GUIIconSubSys::getIcon
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
Definition: GUIIconSubSys.cpp:602
GUIApplicationWindow::~GUIApplicationWindow
virtual ~GUIApplicationWindow()
Destructor.
Definition: GUIApplicationWindow.cpp:331
MID_HOTKEY_CTRL_G_GAMINGMODE_TOOGLEGRID
Toogle Gaming mode in SUMO and grid in NETEDIT.
Definition: GUIAppEnum.h:84
GUIApplicationWindow::onClipboardRequest
long onClipboardRequest(FXObject *sender, FXSelector sel, void *ptr)
Somebody wants our clipped text.
Definition: GUIApplicationWindow.cpp:1324
EVENT_SIMULATION_ENDED
Send when the simulation is over;.
Definition: GUIEvent.h:63
GUILoadThread::getFileName
const std::string & getFileName() const
Definition: GUILoadThread.cpp:273
GUIIconSubSys::initIcons
static void initIcons(FXApp *a)
Initiate GUIIconSubSys.
Definition: GUIIconSubSys.cpp:595
GUIApplicationWindow::onKeyRelease
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
Definition: GUIApplicationWindow.cpp:1845
GUIApplicationWindow::myToolBar8
FXToolBar * myToolBar8
Definition: GUIApplicationWindow.h:390
GUIEvent_SimulationStep.h
GUIEvent_SimulationEnded
Event sent when the the simulation is over.
Definition: GUIEvent_SimulationEnded.h:41
MSStateHandler::saveState
static void saveState(const std::string &file, SUMOTime step)
Saves the current state.
Definition: MSStateHandler.cpp:75
MID_NETEDIT
Open in netedit.
Definition: GUIAppEnum.h:270
GUIApplicationWindow::detach
virtual void detach()
Detaches the tool/menu bar.
Definition: GUIApplicationWindow.cpp:363
GUIApplicationWindow::onCmdOpenRecent
long onCmdOpenRecent(FXObject *, FXSelector, void *)
Called on opening a recent file.
Definition: GUIApplicationWindow.cpp:946
MSVehicleControl::constVehIt
std::map< std::string, SUMOVehicle * >::const_iterator constVehIt
Definition of the internal vehicles map iterator.
Definition: MSVehicleControl.h:75
GUIApplicationWindow::onCmdShowStats
long onCmdShowStats(FXObject *, FXSelector, void *)
Called on commands from the statistic buttons.
Definition: GUIApplicationWindow.cpp:1165
GUIApplicationWindow::onCmdStop
long onCmdStop(FXObject *, FXSelector, void *)
Called on "stop".
Definition: GUIApplicationWindow.cpp:1021
MID_LISTINTERNAL
Locator configuration - menu entry.
Definition: GUIAppEnum.h:280
GUIDesignButtonToolbar
#define GUIDesignButtonToolbar
little button with icon placed in navigation toolbar
Definition: GUIDesigns.h:95
SUMO_const_haltingSpeed
const double SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
Definition: StdDefs.h:61
MSVehicle.h
SumoVehicleClassStrings
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
GUIGlObjectStorage.h
FXEX::FXThreadEvent::signal
void signal()
Definition: FXThreadEvent.cpp:100
MID_HOTKEY_ALT_F4_CLOSE
Main window closes.
Definition: GUIAppEnum.h:136
GUIAppEnum.h
GUISUMOViewParent::VIEW_3D_OSG
plain 3D OSG view (
Definition: GUISUMOViewParent.h:69
GUIApplicationWindow::myToolBar6
FXToolBar * myToolBar6
Definition: GUIApplicationWindow.h:445
GUIEvent_SimulationLoaded::myFile
const std::string myFile
the name of the loaded file
Definition: GUIEvent_SimulationLoaded.h:80
EVENT_DEBUG_OCCURRED
send when a debug occured
Definition: GUIEvent.h:52
MSBaseVehicle::getEdge
const MSEdge * getEdge() const
Returns the edge the vehicle is currently at.
Definition: MSBaseVehicle.cpp:170
GUIApplicationWindow::myHaveNotifiedAboutSimEnd
bool myHaveNotifiedAboutSimEnd
whether the simulation end was already announced
Definition: GUIApplicationWindow.h:416
ICON_LOCATEADD
Definition: GUIIcons.h:83
GUIMainWindow::myTrackerLock
FXMutex myTrackerLock
A lock to make the removal and addition of trackers secure.
Definition: GUIMainWindow.h:150
MSTransportableControl
Definition: MSTransportableControl.h:52
GUIApplicationWindow::myConfigPattern
std::string myConfigPattern
Input file pattern.
Definition: GUIApplicationWindow.h:408
MSVehicleControl::getRunningVehicleNo
int getRunningVehicleNo() const
Returns the number of build and inserted, but not yet deleted vehicles.
Definition: MSVehicleControl.h:258
GUIApplicationWindow::GUIApplicationWindow
GUIApplicationWindow()
FOX needs this for static members.
Definition: GUIApplicationWindow.h:318
FXEX::FXLCDLabel::setGroove
void setGroove(const FXint width)
set/get groove width - must be less than segment width
Definition: FXLCDLabel.cpp:215
MID_HOTKEY_CTRL_B_EDITBREAKPOINT
Edit simulation breakpoints.
Definition: GUIAppEnum.h:80
NLHandler.h
GUIDesignHorizontalFrameStatusBar
#define GUIDesignHorizontalFrameStatusBar
Horizontal frame used in status bar.
Definition: GUIDesigns.h:249
GUISUMOAbstractView.h
GUIApplicationWindow::myWaitingTimeLabel
FXEX::FXLCDLabel * myWaitingTimeLabel
performance indicators
Definition: GUIApplicationWindow.h:437
GUIUserIO::clipped
static std::string clipped
Definition: GUIUserIO.h:61
GUIApplicationWindow::onUpdOpenRecent
long onUpdOpenRecent(FXObject *, FXSelector, void *)
Determines whether opening a recent file is enabled.
Definition: GUIApplicationWindow.cpp:984
GUIApplicationWindow::retrieveBreakpoints
const std::vector< SUMOTime > retrieveBreakpoints() const
retrieve breakpoints if provided by the application
Definition: GUIApplicationWindow.cpp:1876
EVENT_WARNING_OCCURRED
send when a warning occured
Definition: GUIEvent.h:46
GUIApplicationWindow::myMenuBar
FXMenuBar * myMenuBar
The application menu bar.
Definition: GUIApplicationWindow.h:387
RandomDistributor::get
T get(std::mt19937 *which=0) const
Draw a sample of the distribution.
Definition: RandomDistributor.h:111
GUIRunThread::getBreakpointLock
FXMutex & getBreakpointLock()
Definition: GUIRunThread.h:113
GUIMainWindow::myCartesianCoordinate
FXLabel * myCartesianCoordinate
Labels for the current cartesian and geo-coordinate.
Definition: GUIMainWindow.h:162
ICON_RELOAD
Definition: GUIIcons.h:48
GUIRunThread::simulationAvailable
bool simulationAvailable() const
Definition: GUIRunThread.cpp:274
GUIShortcutsSubSys.h
GUIApplicationWindow::myToolBarDrag7
FXToolBarShell * myToolBarDrag7
Definition: GUIApplicationWindow.h:446
GUILoadThread
Definition: GUILoadThread.h:50
ICON_WINDOWS_TILE_HORI
Definition: GUIIcons.h:135
ICON_MICROVIEW
Definition: GUIIcons.h:63
GUIApplicationWindow::myGamingRNG
static std::mt19937 myGamingRNG
A random number generator used to choose a gaming sound.
Definition: GUIApplicationWindow.h:431
GUIApplicationWindow::onCmdListParking
long onCmdListParking(FXObject *, FXSelector, void *)
Toggle listing of parking vehicles.
Definition: GUIApplicationWindow.cpp:1287
GUIApplicationWindow::myMenuBarDrag
FXToolBarShell * myMenuBarDrag
Definition: GUIApplicationWindow.h:364
GUIApplicationWindow::buildToolBars
virtual void buildToolBars()
Builds the tool bar.
Definition: GUIApplicationWindow.cpp:585
MID_OPEN_NETWORK
Open network - ID.
Definition: GUIAppEnum.h:224
GUIMessageWindow::addSeparator
void addSeparator()
Adds a a separator to this log window.
Definition: GUIMessageWindow.cpp:218
GUIApplicationWindow::onCmdFullScreen
long onCmdFullScreen(FXObject *, FXSelector, void *)
Toggle full screen mode.
Definition: GUIApplicationWindow.cpp:1235
GUIDesignMDIButtonLeft
#define GUIDesignMDIButtonLeft
Definition: GUIDesigns.h:145
ICON_LOCATEJUNCTION
Definition: GUIIcons.h:76
GUIMessageWindow::clear
void clear()
Clears the window.
Definition: GUIMessageWindow.cpp:231
GUIApplicationWindow::myToolBarDrag3
FXToolBarShell * myToolBarDrag3
Definition: GUIApplicationWindow.h:364
GUIApplicationWindow::onCmdListInternal
long onCmdListInternal(FXObject *, FXSelector, void *)
Toggle listing of internal structures.
Definition: GUIApplicationWindow.cpp:1280
GUISelectedStorage::select
void select(GUIGlID id, bool update=true)
Adds the object with the given id.
Definition: GUISelectedStorage.cpp:114
GUIEvent_SimulationEnded::getReason
MSNet::SimulationState getReason() const
Returns the reason the simulation has ended due.
Definition: GUIEvent_SimulationEnded.h:66
GUIMainWindow::setWindowSizeAndPos
void setWindowSizeAndPos()
perform initial window positioning and sizing according to user options / previous call
Definition: GUIMainWindow.cpp:202
ICON_WINDOWS_CASCADE
Definition: GUIIcons.h:133
GUIMainWindow::myTrackerWindows
std::vector< FXMainWindow * > myTrackerWindows
Definition: GUIMainWindow.h:148
GUIApplicationWindow::eventOccurred
virtual void eventOccurred()
Definition: GUIApplicationWindow.cpp:1347
MSTransportableControl.h
GUIRunThread::getNet
GUINet & getNet() const
Definition: GUIRunThread.cpp:302
TIME2STEPS
#define TIME2STEPS(x)
Definition: SUMOTime.h:59
GUIPerspectiveChanger.h
GUIApplicationWindow::myToolBarDrag6
FXToolBarShell * myToolBarDrag6
Definition: GUIApplicationWindow.h:446
ID_LOADTHREAD_EVENT
The loading thread.
Definition: GUIAppEnum.h:256
GUIApplicationWindow::addToWindowsMenu
virtual void addToWindowsMenu(FXMenuPane *)
Definition: GUIApplicationWindow.h:297
MID_HOTKEY_CTRL_F_FULSCREENMODE
Fullscreen mode - menu entry.
Definition: GUIAppEnum.h:86
GUISUMOAbstractView::getVisualisationSettings
GUIVisualizationSettings * getVisualisationSettings() const
get visualitation settings
Definition: GUISUMOAbstractView.cpp:1357
TS
#define TS
Definition: SUMOTime.h:44
GUIApplicationWindow::myControlMenu
FXMenuPane * myControlMenu
Definition: GUIApplicationWindow.h:347
GUIMainWindow::myListParking
bool myListParking
information whether the locator should list parking vehicles
Definition: GUIMainWindow.h:177
GUIApplicationWindow::checkGamingEvents
void checkGamingEvents()
handles additional game-related events
Definition: GUIApplicationWindow.cpp:1587
MID_APPSETTINGS
Application settings - menu entry.
Definition: GUIAppEnum.h:278
GUINet::getPersonControl
MSTransportableControl & getPersonControl() override
Returns the person control.
Definition: GUINet.cpp:120
GUILane.h
GUIEvent_SimulationEnded::getTimeStep
SUMOTime getTimeStep() const
Returns the time step the simulation has ended at.
Definition: GUIEvent_SimulationEnded.h:58
Position::set
void set(double x, double y)
set positions x and y
Definition: Position.h:87
GUIApplicationWindow::onCmdAbout
long onCmdAbout(FXObject *, FXSelector, void *)
Shows the about dialog.
Definition: GUIApplicationWindow.cpp:1316
GUIApplicationWindow::myToolBarDrag8
FXToolBarShell * myToolBarDrag8
Definition: GUIApplicationWindow.h:364
MSNet::getCurrentTimeStep
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
Definition: MSNet.h:284
GUITexturesHelper.h
GUIApplicationWindow::myRecentNets
FXRecentFiles myRecentNets
List of recent nets.
Definition: GUIApplicationWindow.h:405
GUIShapeContainer.h
GUIApplicationWindow::mySimDelayTarget
FXDataTarget * mySimDelayTarget
Definition: GUIApplicationWindow.h:370
GUIApplicationWindow::onCmdEditViewport
long onCmdEditViewport(FXObject *, FXSelector, void *)
Called on menu Edit->Viewport.
Definition: GUIApplicationWindow.cpp:776
GUIGlobals.h
GUISUMOViewParent::onKeyPress
long onKeyPress(FXObject *o, FXSelector sel, void *data)
handle keys
Definition: GUISUMOViewParent.cpp:279
MSVehicleControl::loadedVehEnd
constVehIt loadedVehEnd() const
Returns the end of the internal vehicle map.
Definition: MSVehicleControl.h:186
GUIApplicationWindow::onCmdLocate
long onCmdLocate(FXObject *, FXSelector, void *)
Called on menu commands from the Locator menu.
Definition: GUIApplicationWindow.cpp:1153
ICON_LOCATEPOI
Definition: GUIIcons.h:84
GUIGlObject::getGlID
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GUIGlObject.cpp:150
update
GUIEvent_SimulationLoaded::mySettingsFiles
const std::vector< std::string > mySettingsFiles
the name of the settings file to load
Definition: GUIEvent_SimulationLoaded.h:83
MSNet::SIMSTATE_ERROR_IN_SIM
An error occurred during the simulation step.
Definition: MSNet.h:109
GUISUMOViewParent::ViewType
ViewType
Available view types.
Definition: GUISUMOViewParent.h:65
GUIRunThread::simulationIsStepable
virtual bool simulationIsStepable() const
Definition: GUIRunThread.cpp:335
GUIApplicationWindow::loadOnStartup
void loadOnStartup()
Definition: GUIApplicationWindow.cpp:1774
GUIDesignToolBar
#define GUIDesignToolBar
design for default toolbar
Definition: GUIDesigns.h:311
GUIApplicationWindow::myToolBarDrag1
FXToolBarShell * myToolBarDrag1
for some menu detaching fun
Definition: GUIApplicationWindow.h:364
GUIApplicationWindow
The main window of the SUMO-gui.
Definition: GUIApplicationWindow.h:66
GUIRunThread::resume
void resume()
Definition: GUIRunThread.cpp:245
GUIApplicationWindow::myHelpMenu
FXMenuPane * myHelpMenu
Definition: GUIApplicationWindow.h:347
GUIApplicationWindow::myRunThreadEvent
FXEX::FXThreadEvent myRunThreadEvent
io-event with the run-thread
Definition: GUIApplicationWindow.h:399
GUIApplicationWindow::myTimeLoss
SUMOTime myTimeLoss
Definition: GUIApplicationWindow.h:442
GUIDialog_AppSettings.h
GUIDialog_GLChosenEditor.h
GUIApplicationWindow::closeAllWindows
void closeAllWindows()
Definition: GUIApplicationWindow.cpp:1719
ICON_LOCATEPOLY
Definition: GUIIcons.h:85
GUIApplicationWindow.h
GUISUMOViewParent.h
GUIApplicationWindow::myTotalDistance
double myTotalDistance
Definition: GUIApplicationWindow.h:444
EVENT_SIMULATION_LOADED
send when a simulation has been loaded
Definition: GUIEvent.h:37
GUISettingsHandler::getViewType
const std::string & getViewType() const
Returns the parsed view type.
Definition: GUISettingsHandler.h:124
GUIApplicationWindow::myShowTimeAsHMS
bool myShowTimeAsHMS
whether to show time as hour:minute:second
Definition: GUIApplicationWindow.h:413
MID_WINDOW
Main window-ID.
Definition: GUIAppEnum.h:205
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
gSchemeStorage
GUICompleteSchemeStorage gSchemeStorage
Definition: GUICompleteSchemeStorage.cpp:39
GUIEvent_SimulationLoaded::myOsgView
const bool myOsgView
whether to load the OpenSceneGraph view
Definition: GUIEvent_SimulationLoaded.h:86
FXEX::FXLCDLabel::setText
void setText(FXString lbl)
manipulate text in LCD label
Definition: FXLCDLabel.cpp:146
Position::x
double x() const
Returns the x-position.
Definition: Position.h:57
GUISettingsHandler
An XML-handler for visualisation schemes.
Definition: GUISettingsHandler.h:45
FXLCDLabel.h
GUIMainWindow::updateChildren
void updateChildren()
Definition: GUIMainWindow.cpp:152
time2string
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:65
MSNet::SIMSTATE_LOADING
The simulation is loading.
Definition: MSNet.h:99
GUIMainWindow::myAmGaming
bool myAmGaming
information whether the gui is currently in gaming mode
Definition: GUIMainWindow.h:171
GUIApplicationWindow::mySimDelaySpinner
FXRealSpinner * mySimDelaySpinner
Definition: GUIApplicationWindow.h:371
MFXUtils::assureExtension
static FXString assureExtension(const FXString &filename, const FXString &defaultExtension)
Corrects missing extension.
Definition: MFXUtils.cpp:71
MID_EDITVIEWPORT
Open viewport editor - button.
Definition: GUIAppEnum.h:327
MSGlobals.h
GUIDialog_AppSettings
The dialog to change the application (gui) settings.
Definition: GUIDialog_AppSettings.h:37
GUIIOGlobals.h
GUIRunThread::stop
void stop()
Definition: GUIRunThread.cpp:267
RGBColor::RED
static const RGBColor RED
named colors
Definition: RGBColor.h:190
GUIApplicationWindow::myEvents
FXSynchQue< GUIEvent * > myEvents
List of got requests.
Definition: GUIApplicationWindow.h:381
GUIApplicationWindow::onCmdStart
long onCmdStart(FXObject *, FXSelector, void *)
Called on "play".
Definition: GUIApplicationWindow.cpp:1003
GUIGlobals::gQuitOnEnd
static bool gQuitOnEnd
the window shall be closed when the simulation has ended
Definition: GUIGlobals.h:48
GUIApplicationWindow::myEventCondition
FXCondition myEventCondition
the semaphore when waiting for event completion
Definition: GUIApplicationWindow.h:422
MID_SIMSAVE
Save state to file.
Definition: GUIAppEnum.h:238
MSBaseVehicle::getVehicleType
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
Definition: MSBaseVehicle.h:118
GUIApplicationWindow::myMainSplitter
FXSplitter * myMainSplitter
The splitter that divides the main window into vies and the log window.
Definition: GUIApplicationWindow.h:361
FXSynchQue::pop
void pop()
Definition: FXSynchQue.h:54
GUIApplicationWindow::onCmdAppSettings
long onCmdAppSettings(FXObject *, FXSelector, void *)
Opens the application settings menu (Settings->Application Settings...)
Definition: GUIApplicationWindow.cpp:1175
GUIApplicationWindow::mySettingsMenu
FXMenuPane * mySettingsMenu
Definition: GUIApplicationWindow.h:347
GUISettingsHandler::applyViewport
void applyViewport(GUISUMOAbstractView *view) const
Sets the viewport which has been parsed.
Definition: GUISettingsHandler.cpp:384
EVENT_GLDEBUG_OCCURRED
send when a gldebug occured
Definition: GUIEvent.h:55
gCurrentFolder
FXString gCurrentFolder
The folder used as last.
Definition: GUIIOGlobals.cpp:33
GUIApplicationWindow::mySelectLanesMenuCascade
FXMenuCascade * mySelectLanesMenuCascade
the menu cascades
Definition: GUIApplicationWindow.h:352
GUIApplicationWindow::onCmdGaming
long onCmdGaming(FXObject *, FXSelector, void *)
Toggle gaming mode.
Definition: GUIApplicationWindow.cpp:1184
GUIApplicationWindow::dependentBuild
void dependentBuild()
Definition: GUIApplicationWindow.cpp:229
string2time
SUMOTime string2time(const std::string &r)
Definition: SUMOTime.cpp:42
MSVehicleControl::getCollisionCount
int getCollisionCount() const
return the number of collisions
Definition: MSVehicleControl.h:290
GUIGlobals::gTrackerInterval
static double gTrackerInterval
the aggregation period for tracker windows in seconds
Definition: GUIGlobals.h:54
GUIApplicationWindow::onCmdNewView
long onCmdNewView(FXObject *, FXSelector, void *)
Called if a new view shall be opened (2D view)
Definition: GUIApplicationWindow.cpp:1300
GUIApplicationWindow::myToolBarDrag5
FXToolBarShell * myToolBarDrag5
Definition: GUIApplicationWindow.h:364
ICON_GREENEDGE
Definition: GUIIcons.h:90
GUIApplicationWindow::myMessageWindow
GUIMessageWindow * myMessageWindow
A window to display messages, warnings and error in.
Definition: GUIApplicationWindow.h:358
GUIApplicationWindow::myToolBar10
FXToolBar * myToolBar10
Definition: GUIApplicationWindow.h:445
GUIMainWindow::myGLVisual
FXGLVisual * myGLVisual
The gl-visual used.
Definition: GUIMainWindow.h:166
ICON_LOCATEPERSON
Definition: GUIIcons.h:81
MID_OPEN_CONFIG
Open configuration - ID.
Definition: GUIAppEnum.h:222
MID_NEW_OSGVIEW
Open a new microscopic 3D view.
Definition: GUIAppEnum.h:248
GUIApplicationWindow::onUpdReload
long onUpdReload(FXObject *, FXSelector, void *)
Determines whether reloading is enabled.
Definition: GUIApplicationWindow.cpp:974
GUIMainWindow::myGeoCoordinate
FXLabel * myGeoCoordinate
Definition: GUIMainWindow.h:162
EVENT_SIMULATION_STEP
send when a simulation step has been performed
Definition: GUIEvent.h:40
GUIDialog_Breakpoints
Editor for simulation breakpoints.
Definition: GUIDialog_Breakpoints.h:43
GUIMessageWindow.h
ICON_SUMO
Definition: GUIIcons.h:39
FXSynchQue::top
T top()
Definition: FXSynchQue.h:38
GUISelectedStorage::clear
void clear()
Clears the list of selected objects.
Definition: GUISelectedStorage.cpp:177
GUIDialog_Breakpoints.h
GUIIconSubSys.h
MID_HOTKEY_CTRL_Q_CLOSE
Main window closes.
Definition: GUIAppEnum.h:96
GUIApplicationWindow::myFileMenu
FXMenuPane * myFileMenu
the submenus
Definition: GUIApplicationWindow.h:347
GUIMessageWindow::appendMsg
void appendMsg(GUIEventType eType, const std::string &msg)
Adds new text to the window.
Definition: GUIMessageWindow.cpp:158
MSEdgeControl.h
ICON_LOCATEVEHICLE
Definition: GUIIcons.h:78
FXSynchQue::empty
bool empty()
Definition: FXSynchQue.h:105
MID_DEMAND_SCALE
scale traffic
Definition: GUIAppEnum.h:341
GUIApplicationWindow::myEditMenu
FXMenuPane * myEditMenu
Definition: GUIApplicationWindow.h:347
EVENT_ERROR_OCCURRED
send when a error occured
Definition: GUIEvent.h:49
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:48
GUILane
Representation of a lane in the micro simulation (gui-version)
Definition: GUILane.h:62
GUIApplicationWindow::onCmdOpenEdgeData
long onCmdOpenEdgeData(FXObject *, FXSelector, void *)
Called on menu File->Load EdgeData.
Definition: GUIApplicationWindow.cpp:906
GUIDesignToolBarRaisedNextTop
#define GUIDesignToolBarRaisedNextTop
design for first toolbar shell positioned in the next-top position of dock
Definition: GUIDesigns.h:326
ICON_WINDOWS_TILE_VERT
Definition: GUIIcons.h:134
GUIApplicationWindow::handleEvent_Message
void handleEvent_Message(GUIEvent *e)
Definition: GUIApplicationWindow.cpp:1551
GUIApplicationWindow::onCmdClose
long onCmdClose(FXObject *, FXSelector, void *)
Called on menu File->Close.
Definition: GUIApplicationWindow.cpp:958
MID_HOTKEY_CTRL_W_CLOSESIMULATION
Close simulation - ID.
Definition: GUIAppEnum.h:104
MSNet::getInstance
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:168
GUIMainWindow
Definition: GUIMainWindow.h:47
Position::y
double y() const
Returns the y-position.
Definition: Position.h:62
GUISUMOAbstractView::getChanger
GUIPerspectiveChanger & getChanger() const
get changer
Definition: GUISUMOAbstractView.cpp:173
GUIApplicationWindow::myToolBar5
FXToolBar * myToolBar5
Definition: GUIApplicationWindow.h:390
GUIApplicationWindow::myRecentConfigs
FXRecentFiles myRecentConfigs
List of recent config files.
Definition: GUIApplicationWindow.h:402
GUIApplicationWindow::onUpdStart
long onUpdStart(FXObject *sender, FXSelector, void *ptr)
Determines whether "play" is enabled.
Definition: GUIApplicationWindow.cpp:1103
MID_LISTPARKING
Definition: GUIAppEnum.h:281
FXEX::SEL_THREAD_EVENT
Definition: fxexdefs.h:184
GUISUMOViewParent::onCmdLocate
long onCmdLocate(FXObject *, FXSelector, void *)
locator-callback
Definition: GUISUMOViewParent.cpp:184
FXEX::FXLCDLabel
Definition: FXLCDLabel.h:49
MID_LOCATEJUNCTION
Locate junction - button.
Definition: GUIAppEnum.h:307
GUIEvent::getOwnType
GUIEventType getOwnType() const
returns the event type
Definition: GUIEvent.h:80
ICON_GREENPERSON
Definition: GUIIcons.h:92
GUIApplicationWindow::mySimDelay
double mySimDelay
the simulation delay in milliseconds
Definition: GUIApplicationWindow.h:369
GUIUserIO.h
GUIDialog_AboutSUMO.h
MSStateHandler.h
GUIApplicationWindow::onCmdOpenShapes
long onCmdOpenShapes(FXObject *, FXSelector, void *)
Called on menu File->Load Shapes.
Definition: GUIApplicationWindow.cpp:876
GUILoadThread.h
GUIEvent
Definition: GUIEvent.h:77
GUIApplicationWindow::myJamSoundTime
double myJamSoundTime
waiting time after which vehicles trigger jam sounds
Definition: GUIApplicationWindow.h:429
GUISettingsHandler::getEventDistribution
RandomDistributor< std::string > getEventDistribution(const std::string &id)
Definition: GUISettingsHandler.cpp:448
GUIApplicationWindow::fillMenuBar
virtual void fillMenuBar()
Builds the menu bar.
Definition: GUIApplicationWindow.cpp:371
GUISUMOViewParent::onKeyRelease
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
Definition: GUISUMOViewParent.cpp:286
GUIApplicationWindow::myLoadThreadEvent
FXEX::FXThreadEvent myLoadThreadEvent
io-event with the load-thread
Definition: GUIApplicationWindow.h:396
GUIApplicationWindow::myToolBarDrag9
FXToolBarShell * myToolBarDrag9
Definition: GUIApplicationWindow.h:446
GUIApplicationWindow::myViewNumber
int myViewNumber
The current view number.
Definition: GUIApplicationWindow.h:341
GUIDesignMDIButtonRight
#define GUIDesignMDIButtonRight
MDIButton oriented to right.
Definition: GUIDesigns.h:148
GUIEvent_SimulationLoaded::myEnd
const SUMOTime myEnd
the time the simulation shall end with
Definition: GUIEvent_SimulationLoaded.h:77
GUIMainWindow::myListInternal
bool myListInternal
information whether the locator should list internal structures
Definition: GUIMainWindow.h:174
MFXUtils.h
GUIApplicationWindow::mySelectByPermissions
FXMenuPane * mySelectByPermissions
Definition: GUIApplicationWindow.h:347
ICON_CLOSE
Definition: GUIIcons.h:50
GUIApplicationWindow::onCmdEditBreakpoints
long onCmdEditBreakpoints(FXObject *, FXSelector, void *)
Called on menu Edit->Edit Breakpoints.
Definition: GUIApplicationWindow.cpp:768
MSTransportableControl::getRunningNumber
int getRunningNumber() const
Returns the number of build and inserted, but not yet deleted transportables.
Definition: MSTransportableControl.h:189
GUICompleteSchemeStorage::saveViewport
void saveViewport(const double x, const double y, const double z, const double rot)
Makes the given viewport the default.
Definition: GUICompleteSchemeStorage.cpp:228
MID_TIME_TOOGLE
toogle time display mode
Definition: GUIAppEnum.h:337
GUIApplicationWindow::onCmdReload
long onCmdReload(FXObject *, FXSelector, void *)
Called on reload.
Definition: GUIApplicationWindow.cpp:933
GUIRunThread::getSimEndTime
SUMOTime getSimEndTime() const
Definition: GUIRunThread.h:105
ICON_FLAG
Definition: GUIIcons.h:126
gSelected
GUISelectedStorage gSelected
A global holder of selected objects.
Definition: GUIGlobalSelection.cpp:34
GUIApplicationWindow::onCmdOpenConfiguration
long onCmdOpenConfiguration(FXObject *, FXSelector, void *)
Called on menu File->Open Configuration.
Definition: GUIApplicationWindow.cpp:836
GUIApplicationWindow::myMDIMenu
FXMDIMenu * myMDIMenu
The menu used for the MDI-windows.
Definition: GUIApplicationWindow.h:384
MSBaseVehicle::getID
const std::string & getID() const
Returns the name of the vehicle.
Definition: MSBaseVehicle.cpp:137
GUIApplicationWindow::onCmdStep
long onCmdStep(FXObject *, FXSelector, void *)
Called on "step".
Definition: GUIApplicationWindow.cpp:1029
GUIApplicationWindow::myToolBar4
FXToolBar * myToolBar4
Definition: GUIApplicationWindow.h:390
GUIGlobals::gDemoAutoReload
static bool gDemoAutoReload
the simulation shall reload when it has ended (demo)
Definition: GUIGlobals.h:51
GUIDesignToolBarRaisedSameTop
#define GUIDesignToolBarRaisedSameTop
design for first toolbar shell positioned in the same position of dock
Definition: GUIDesigns.h:329
MID_LOCATEVEHICLE
Locate vehicle - button.
Definition: GUIAppEnum.h:311
GUIApplicationWindow::sendBlockingEvent
virtual void sendBlockingEvent(GUIEvent *event)
Sends an event from the application thread to the GUI and waits until it is handled.
Definition: GUIApplicationWindow.cpp:1858
GUIApplicationWindow::onLoadThreadEvent
long onLoadThreadEvent(FXObject *, FXSelector, void *)
Called on an event from the loading thread.
Definition: GUIApplicationWindow.cpp:1333
GUIApplicationWindow::onCmdEditViewScheme
long onCmdEditViewScheme(FXObject *, FXSelector, void *)
Called on menu Edit->Visualization.
Definition: GUIApplicationWindow.cpp:785
GUIApplicationWindow::onRunThreadEvent
long onRunThreadEvent(FXObject *, FXSelector, void *)
Called on an event from the simulation thread.
Definition: GUIApplicationWindow.cpp:1340
TraCIServer.h
GUIApplicationWindow::onCmdListTeleporting
long onCmdListTeleporting(FXObject *, FXSelector, void *)
Toggle listing of teleporting vehicles.
Definition: GUIApplicationWindow.cpp:1293
MSVehicleType::getMaxSpeed
double getMaxSpeed() const
Get vehicle's maximum speed [m/s].
Definition: MSVehicleType.h:162
MID_LISTTELEPORTING
Definition: GUIAppEnum.h:282
GUIApplicationWindow::myToolBar7
FXToolBar * myToolBar7
Definition: GUIApplicationWindow.h:445
FXSynchQue::push_back
void push_back(T what)
Definition: FXSynchQue.h:91
GUILoadThread::loadConfigOrNet
void loadConfigOrNet(const std::string &file, bool isNet)
begins the loading of the given file
Definition: GUILoadThread.cpp:254
GUISUMOAbstractView::addDecals
void addDecals(const std::vector< Decal > &decals)
add decals
Definition: GUISUMOAbstractView.cpp:228
GUIApplicationWindow::myAmLoading
bool myAmLoading
information whether the gui is currently loading and the load-options shall be greyed out
Definition: GUIApplicationWindow.h:344
FileHelpers::isReadable
static bool isReadable(std::string path)
Checks whether the given file is readable.
Definition: FileHelpers.cpp:49
FXThreadEvent.h
ICON_START
Definition: GUIIcons.h:56
GUIApplicationWindow::onCmdDelayToggle
long onCmdDelayToggle(FXObject *, FXSelector, void *)
Called on "delay toggle".
Definition: GUIApplicationWindow.cpp:1078
MID_RECENTFILE
Loads a file previously loaded.
Definition: GUIAppEnum.h:230
config.h
GUIEvent_SimulationLoaded::myViewportFromRegistry
const bool myViewportFromRegistry
whether loading viewport from registry
Definition: GUIEvent_SimulationLoaded.h:89
GUIApplicationWindow::myCollisionSounds
RandomDistributor< std::string > myCollisionSounds
Definition: GUIApplicationWindow.h:427
MSVehicleControl
The class responsible for building and deletion of vehicles.
Definition: MSVehicleControl.h:72
GUITexturesHelper::clearTextures
static void clearTextures()
clears loaded textures
Definition: GUITexturesHelper.cpp:137
GUIApplicationWindow::myRunThread
GUIRunThread * myRunThread
the thread that runs simulations
Definition: GUIApplicationWindow.h:335
MID_SHOWNETSTATS
Show network statistics.
Definition: GUIAppEnum.h:291
MID_EDITVIEWSCHEME
Open view editor - button.
Definition: GUIAppEnum.h:329
GUIVisualizationSettings::laneColorer
GUIColorer laneColorer
The lane colorer.
Definition: GUIVisualizationSettings.h:438
TraCIServer::getInstance
static TraCIServer * getInstance()
Definition: TraCIServer.h:71
MSVehicle::getSpeed
double getSpeed() const
Returns the vehicle's current speed.
Definition: MSVehicle.h:477
RandHelper.h
GUIDesignToolbarMenuBar
#define GUIDesignToolbarMenuBar
Definition: GUIDesigns.h:305
GUIParameterTracker.h
GUIApplicationWindow::getBuildGLCanvas
FXGLCanvas * getBuildGLCanvas() const
Definition: GUIApplicationWindow.cpp:1708
GUIApplicationWindow::onCmdHelp
long onCmdHelp(FXObject *sender, FXSelector sel, void *ptr)
called if the user selects help->Documentation
Definition: GUIApplicationWindow.cpp:794
GUIApplicationWindow::create
virtual void create()
Creates the main window (required by FOX)
Definition: GUIApplicationWindow.cpp:295
GUIEvent_SimulationLoaded::myNet
GUINet * myNet
the loaded net
Definition: GUIEvent_SimulationLoaded.h:71
MID_EDITCHOSEN
Open editor for selections.
Definition: GUIAppEnum.h:268
FXEX::FXLCDLabel::setHorizontal
void setHorizontal(const FXint len)
set/get segment horizontal length - must be more than twice the segment width
Definition: FXLCDLabel.cpp:161
MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMAND
Perform a single simulation step in SUMO and open Demand Elements in NETEDIT.
Definition: GUIAppEnum.h:82
GUINet::getParameterWindow
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own parameter window.
Definition: GUINet.cpp:423
RGBColor::GREEN
static const RGBColor GREEN
Definition: RGBColor.h:191
MID_HOTKEY_CTRL_A_STARTSIMULATION_OPENADDITIONALS
Start the simulation in SUMO and open Additionals Elemements in NETEDIT.
Definition: GUIAppEnum.h:78
GUIPerspectiveChanger::getXPos
virtual double getXPos() const =0
Returns the x-offset of the field to show stored in this changer.
GUIApplicationWindow::myToolBarDrag2
FXToolBarShell * myToolBarDrag2
Definition: GUIApplicationWindow.h:364
GUIGlobals::gRunAfterLoad
static bool gRunAfterLoad
the simulation shall start direct after loading
Definition: GUIGlobals.h:45
GUIApplicationWindow::onCmdQuit
long onCmdQuit(FXObject *, FXSelector, void *)
Called by FOX if the application shall be closed.
Definition: GUIApplicationWindow.cpp:721
MFXUtils::getFXColor
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:114
MSVehicleControl::loadedVehBegin
constVehIt loadedVehBegin() const
Returns the begin of the internal vehicle map.
Definition: MSVehicleControl.h:178
GUIApplicationWindow::myTimeLossLabel
FXEX::FXLCDLabel * myTimeLossLabel
Definition: GUIApplicationWindow.h:438
GUIApplicationWindow::onUpdStep
long onUpdStep(FXObject *, FXSelector, void *)
Determines whether "step" is enabled.
Definition: GUIApplicationWindow.cpp:1123
FXEX::FXLCDLabel::setVertical
void setVertical(const FXint len)
set/get segment vertical length - must be more than twice the segment width
Definition: FXLCDLabel.cpp:179
GUIApplicationWindow::getTrackerInterval
double getTrackerInterval() const
Definition: GUIApplicationWindow.cpp:1768
GUIApplicationWindow::setStatusBarText
void setStatusBarText(const std::string &text)
Definition: GUIApplicationWindow.cpp:1780
GUIApplicationWindow::checkGamingEventsDRT
void checkGamingEventsDRT()
Definition: GUIApplicationWindow.cpp:1642
MSNet::getStateMessage
static std::string getStateMessage(SimulationState state)
Returns the message to show if a certain state occurs.
Definition: MSNet.cpp:614
GUISettingsHandler::getJamSoundTime
double getJamSoundTime()
Definition: GUISettingsHandler.h:129
GUIApplicationWindow::onUpdTraCIStatus
long onUpdTraCIStatus(FXObject *, FXSelector, void *)
Determines whether traci is active.
Definition: GUIApplicationWindow.cpp:1146
GUIApplicationWindow::myToolBar9
FXToolBar * myToolBar9
Definition: GUIApplicationWindow.h:445
GUIApplicationWindow::myToolBar1
FXToolBar * myToolBar1
The application tool bar.
Definition: GUIApplicationWindow.h:390
MID_SHOWVEHSTATS
Show vehicle statistics.
Definition: GUIAppEnum.h:293
MID_LOCATEPOLY
Locate polygons - button.
Definition: GUIAppEnum.h:325
GUIDesignButtonToolbarText
#define GUIDesignButtonToolbarText
Definition: GUIDesigns.h:92
GUIApplicationWindow::addRecentFile
void addRecentFile(const FX::FXString &f, const bool isNet)
Definition: GUIApplicationWindow.cpp:1788
GUIApplicationWindow::getCurrentSimTime
SUMOTime getCurrentSimTime() const
Definition: GUIApplicationWindow.cpp:1762
ICON_STOP
Definition: GUIIcons.h:57
GUISettingsHandler::addSettings
std::string addSettings(GUISUMOAbstractView *view=0) const
Adds the parsed settings to the global list of settings.
Definition: GUISettingsHandler.cpp:370
RandomDistributor::getOverallProb
double getOverallProb() const
Return the sum of the probabilites assigned to the members.
Definition: RandomDistributor.h:131
MID_HOTKEY_CTRL_S_STOPSIMULATION_SAVENETWORK
Stop the simulation in SUMO and save network in NETEDIT.
Definition: GUIAppEnum.h:98
GUISettingsHandler::getDelay
double getDelay() const
Returns the parsed delay.
Definition: GUISettingsHandler.cpp:418
VERSION_STRING
#define VERSION_STRING
Definition: config.h:207
MSEdge::getAllEdges
static const MSEdgeVector & getAllEdges()
Returns all edges with a numerical id.
Definition: MSEdge.cpp:837
MID_LOCATEADD
Locate addtional structure - button.
Definition: GUIAppEnum.h:321
MSVehicleControl.h
GUISettingsHandler::getBreakpoints
const std::vector< SUMOTime > & getBreakpoints() const
Returns the parsed breakpoints.
Definition: GUISettingsHandler.h:112
GUIPropertySchemeStorage::setActive
void setActive(int scheme)
Definition: GUIPropertySchemeStorage.h:70
MFXUtils::userPermitsOverwritingWhenFileExists
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.
Definition: MFXUtils.cpp:41
GUIApplicationWindow::myToolBarDrag10
FXToolBarShell * myToolBarDrag10
Definition: GUIApplicationWindow.h:446
GUIEvent_SimulationLoaded.h
ICON_GREENVEHICLE
Definition: GUIIcons.h:91
MID_OPEN_EDGEDATA
Load edge data for visualization.
Definition: GUIAppEnum.h:228
GUIEvent_Message
Definition: GUIEvent_Message.h:39
GUIRunThread::deleteSim
virtual void deleteSim()
Definition: GUIRunThread.cpp:280
WRITE_MESSAGE
#define WRITE_MESSAGE(msg)
Definition: MsgHandler.h:240
GUIApplicationWindow::openNewView
GUISUMOAbstractView * openNewView(GUISUMOViewParent::ViewType vt=GUISUMOViewParent::VIEW_2D_OPENGL)
Definition: GUIApplicationWindow.cpp:1674
GUISUMOViewParent::VIEW_2D_OPENGL
plain 2D openGL view (
Definition: GUISUMOViewParent.h:67
GUIApplicationWindow::myLoadThread
GUILoadThread * myLoadThread
the thread that loads simulations
Definition: GUIApplicationWindow.h:332
GUIRunThread::init
virtual bool init(GUINet *net, SUMOTime start, SUMOTime end)
initialises the thread with the new simulation
Definition: GUIRunThread.cpp:78
GUIApplicationWindow::myTotalDistanceLabel
FXEX::FXLCDLabel * myTotalDistanceLabel
Definition: GUIApplicationWindow.h:439
MSNet::getVehicleControl
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
Definition: MSNet.h:337
GUIApplicationWindow::myEventMutex
FXMutex myEventMutex
the mutex for the waiting semaphore
Definition: GUIApplicationWindow.h:419
GUISUMOViewParent::init
virtual GUISUMOAbstractView * init(FXGLCanvas *share, GUINet &net, ViewType type)
"Initialises" this window by building the contents
Definition: GUISUMOViewParent.cpp:103
GUIApplicationWindow::myToolBar2
FXToolBar * myToolBar2
Definition: GUIApplicationWindow.h:390
GUIGlChildWindow::getView
GUISUMOAbstractView * getView() const
return GUISUMOAbstractView
Definition: GUIGlChildWindow.cpp:100
GUIApplicationWindow::handleEvent_SimulationLoaded
void handleEvent_SimulationLoaded(GUIEvent *e)
Definition: GUIApplicationWindow.cpp:1384
GUIRunThread::prepareDestruction
void prepareDestruction()
Definition: GUIRunThread.cpp:308
XMLSubSys.h
FXEX::FXLCDLabel::setThickness
void setThickness(const FXint width)
set/get segment width - must be less than half the segment length
Definition: FXLCDLabel.cpp:197
GUIDialog_GLChosenEditor
Editor for the list of chosen objects.
Definition: GUIDialog_GLChosenEditor.h:50
GUIApplicationWindow::handleEvent_SimulationEnded
void handleEvent_SimulationEnded(GUIEvent *e)
Definition: GUIApplicationWindow.cpp:1562
MSVehicle
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:80