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