SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GUIApplicationWindow.cpp
Go to the documentation of this file.
1 /****************************************************************************/
10 // The main window of the SUMO-gui.
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
13 // Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #ifdef HAVE_VERSION_H
35 #include <version.h>
36 #endif
37 
38 #include <string>
39 #include <sstream>
40 #include <algorithm>
41 
42 #include <guisim/GUINet.h>
43 #include <guisim/GUILane.h>
44 #include <netload/NLHandler.h>
45 #include <microsim/MSGlobals.h>
46 #include <microsim/MSEdge.h>
47 #include <microsim/MSVehicle.h>
48 
49 #include "GUISUMOViewParent.h"
50 #include "GUILoadThread.h"
51 #include "GUIRunThread.h"
52 #include "GUIApplicationWindow.h"
55 
56 #include <utils/common/ToString.h>
62 
63 #include <utils/xml/XMLSubSys.h>
79 #include "GUIGlobals.h"
83 
84 #ifdef CHECK_MEMORY_LEAKS
85 #include <foreign/nvwa/debug_new.h>
86 #endif
87 
88 
89 // ===========================================================================
90 // FOX-declarations
91 // ===========================================================================
92 FXDEFMAP(GUIApplicationWindow) GUIApplicationWindowMap[] = {
93  FXMAPFUNC(SEL_COMMAND, MID_QUIT, GUIApplicationWindow::onCmdQuit),
94  FXMAPFUNC(SEL_SIGNAL, MID_QUIT, GUIApplicationWindow::onCmdQuit),
95  FXMAPFUNC(SEL_CLOSE, MID_WINDOW, GUIApplicationWindow::onCmdQuit),
96 
100  FXMAPFUNC(SEL_COMMAND, MID_RECENTFILE, GUIApplicationWindow::onCmdOpenRecent),
101  FXMAPFUNC(SEL_COMMAND, MID_RELOAD, GUIApplicationWindow::onCmdReload),
102  FXMAPFUNC(SEL_COMMAND, MID_CLOSE, GUIApplicationWindow::onCmdClose),
103  FXMAPFUNC(SEL_COMMAND, MID_EDITCHOSEN, GUIApplicationWindow::onCmdEditChosen),
105 
107  FXMAPFUNC(SEL_COMMAND, MID_GAMING, GUIApplicationWindow::onCmdGaming),
108  FXMAPFUNC(SEL_COMMAND, MID_FULLSCREEN, GUIApplicationWindow::onCmdFullScreen),
110  FXMAPFUNC(SEL_COMMAND, MID_ABOUT, GUIApplicationWindow::onCmdAbout),
111  FXMAPFUNC(SEL_COMMAND, MID_NEW_MICROVIEW, GUIApplicationWindow::onCmdNewView),
112 #ifdef HAVE_OSG
113  FXMAPFUNC(SEL_COMMAND, MID_NEW_OSGVIEW, GUIApplicationWindow::onCmdNewOSG),
114 #endif
115  FXMAPFUNC(SEL_COMMAND, MID_START, GUIApplicationWindow::onCmdStart),
116  FXMAPFUNC(SEL_COMMAND, MID_STOP, GUIApplicationWindow::onCmdStop),
117  FXMAPFUNC(SEL_COMMAND, MID_STEP, GUIApplicationWindow::onCmdStep),
121 
122  FXMAPFUNC(SEL_UPDATE, MID_OPEN_CONFIG, GUIApplicationWindow::onUpdOpen),
123  FXMAPFUNC(SEL_UPDATE, MID_OPEN_NETWORK, GUIApplicationWindow::onUpdOpen),
124  FXMAPFUNC(SEL_UPDATE, MID_OPEN_NETWORK, GUIApplicationWindow::onUpdOpen),
125  FXMAPFUNC(SEL_UPDATE, MID_OPEN_SHAPES, GUIApplicationWindow::onUpdReload),
126  FXMAPFUNC(SEL_UPDATE, MID_RELOAD, GUIApplicationWindow::onUpdReload),
129 #ifdef HAVE_OSG
130  FXMAPFUNC(SEL_COMMAND, MID_NEW_OSGVIEW, GUIApplicationWindow::onUpdAddView),
131 #endif
132  FXMAPFUNC(SEL_UPDATE, MID_START, GUIApplicationWindow::onUpdStart),
133  FXMAPFUNC(SEL_UPDATE, MID_STOP, GUIApplicationWindow::onUpdStop),
134  FXMAPFUNC(SEL_UPDATE, MID_STEP, GUIApplicationWindow::onUpdStep),
137 
138  // forward requests to the active view
139  FXMAPFUNC(SEL_COMMAND, MID_LOCATEJUNCTION, GUIApplicationWindow::onCmdLocate),
140  FXMAPFUNC(SEL_COMMAND, MID_LOCATEEDGE, GUIApplicationWindow::onCmdLocate),
141  FXMAPFUNC(SEL_COMMAND, MID_LOCATEVEHICLE, GUIApplicationWindow::onCmdLocate),
142  FXMAPFUNC(SEL_COMMAND, MID_LOCATEPERSON, GUIApplicationWindow::onCmdLocate),
143  FXMAPFUNC(SEL_COMMAND, MID_LOCATETLS, GUIApplicationWindow::onCmdLocate),
144  FXMAPFUNC(SEL_COMMAND, MID_LOCATEADD, GUIApplicationWindow::onCmdLocate),
145  FXMAPFUNC(SEL_COMMAND, MID_LOCATEPOI, GUIApplicationWindow::onCmdLocate),
146  FXMAPFUNC(SEL_COMMAND, MID_LOCATEPOLY, GUIApplicationWindow::onCmdLocate),
155 
156  FXMAPFUNC(SEL_CLIPBOARD_REQUEST, 0, GUIApplicationWindow::onClipboardRequest),
157 
162 };
163 
164 // Object implementation
165 FXIMPLEMENT(GUIApplicationWindow, FXMainWindow, GUIApplicationWindowMap, ARRAYNUMBER(GUIApplicationWindowMap))
166 
167 // ===========================================================================
168 // static members
169 // ===========================================================================
170 MTRand GUIApplicationWindow::myGamingRNG;
171 
172 // ===========================================================================
173 // member method definitions
174 // ===========================================================================
176  const std::string& configPattern)
177  : GUIMainWindow(a),
178  myLoadThread(0), myRunThread(0),
179  myAmLoading(false),
180  myAlternateSimDelay(0),
181  myRecentNets(a, "nets"), myConfigPattern(configPattern),
182  hadDependentBuild(false),
183  myShowTimeAsHMS(false),
184  myAmFullScreen(false),
185  myHaveNotifiedAboutSimEnd(false),
186  // game specific
187  myJamSoundTime(60),
188  myWaitingTime(0),
189  myTimeLoss(0) {
191 }
192 
193 
194 void
196  // do this not twice
197  if (hadDependentBuild) {
198  return;
199  }
200  hadDependentBuild = true;
201 
202  setTarget(this);
203  setSelector(MID_WINDOW);
204 
205  // build menu bar
206  myMenuBarDrag = new FXToolBarShell(this, FRAME_NORMAL);
207  myMenuBar = new FXMenuBar(myTopDock, myMenuBarDrag,
208  LAYOUT_SIDE_TOP | LAYOUT_FILL_X | FRAME_RAISED);
209  new FXToolBarGrip(myMenuBar, myMenuBar, FXMenuBar::ID_TOOLBARGRIP,
210  TOOLBARGRIP_DOUBLE);
211  buildToolBars();
212  // build the thread - io
217 
218  // build the status bar
219  myStatusbar = new FXStatusBar(this, LAYOUT_SIDE_BOTTOM | LAYOUT_FILL_X | FRAME_RAISED);
220  {
221  myGeoFrame =
222  new FXHorizontalFrame(myStatusbar, LAYOUT_FIX_WIDTH | LAYOUT_FILL_Y | LAYOUT_RIGHT | FRAME_SUNKEN,
223  0, 0, 20, 0, 0, 0, 0, 0, 0, 0);
224  myGeoCoordinate = new FXLabel(myGeoFrame, "N/A", 0, LAYOUT_CENTER_Y);
226  new FXHorizontalFrame(myStatusbar, LAYOUT_FIX_WIDTH | LAYOUT_FILL_Y | LAYOUT_RIGHT | FRAME_SUNKEN,
227  0, 0, 20, 0, 0, 0, 0, 0, 0, 0);
228  myCartesianCoordinate = new FXLabel(myCartesianFrame, "N/A", 0, LAYOUT_CENTER_Y);
229  }
230 
231  // make the window a mdi-window
232  myMainSplitter = new FXSplitter(this,
233  SPLITTER_REVERSED | SPLITTER_VERTICAL | LAYOUT_FILL_X | LAYOUT_FILL_Y | SPLITTER_TRACKING | FRAME_RAISED | FRAME_THICK);
234  myMDIClient = new FXMDIClient(myMainSplitter,
235  LAYOUT_FILL_X | LAYOUT_FILL_Y | FRAME_SUNKEN | FRAME_THICK);
236  myMDIMenu = new FXMDIMenu(this, myMDIClient);
237  new FXMDIWindowButton(myMenuBar, myMDIMenu, myMDIClient,
238  FXMDIClient::ID_MDI_MENUWINDOW, LAYOUT_LEFT);
239  new FXMDIDeleteButton(myMenuBar, myMDIClient,
240  FXMDIClient::ID_MDI_MENUCLOSE, FRAME_RAISED | LAYOUT_RIGHT);
241  new FXMDIRestoreButton(myMenuBar, myMDIClient,
242  FXMDIClient::ID_MDI_MENURESTORE, FRAME_RAISED | LAYOUT_RIGHT);
243  new FXMDIMinimizeButton(myMenuBar, myMDIClient,
244  FXMDIClient::ID_MDI_MENUMINIMIZE, FRAME_RAISED | LAYOUT_RIGHT);
245 
246  // build the message window
248  // fill menu and tool bar
249  fillMenuBar();
250  if (game) {
251  onCmdGaming(0, 0, 0);
252  } else {
253  myToolBar6->hide();
254  myToolBar7->hide();
255  }
256  // build additional threads
257  myLoadThread = new GUILoadThread(getApp(), this, myEvents, myLoadThreadEvent);
258  myRunThread = new GUIRunThread(getApp(), this, *mySimDelayTarget, myEvents,
260  // set the status bar
261  myStatusbar->getStatusLine()->setText("Ready.");
262  // set the caption
263  setTitle(MFXUtils::getTitleText(("SUMO " + getBuildName(VERSION_STRING)).c_str()));
264 
265  // start the simulation-thread (it will loop until the application ends deciding by itself whether to perform a step or not)
266  myRunThread->start();
268 }
269 
270 
271 void
273  if (getApp()->reg().readIntEntry("SETTINGS", "maximized", 0) == 0) {
274  setX(getApp()->reg().readIntEntry("SETTINGS", "x", 150));
275  setY(getApp()->reg().readIntEntry("SETTINGS", "y", 150));
276  setWidth(getApp()->reg().readIntEntry("SETTINGS", "width", 600));
277  setHeight(getApp()->reg().readIntEntry("SETTINGS", "height", 400));
278  }
279  gCurrentFolder = getApp()->reg().readStringEntry("SETTINGS", "basedir", "");
280  FXMainWindow::create();
281  myMenuBarDrag->create();
282  myToolBarDrag1->create();
283  myToolBarDrag2->create();
284  myToolBarDrag3->create();
285  myToolBarDrag4->create();
286  myToolBarDrag5->create();
287  myToolBarDrag6->create();
288  myToolBarDrag7->create();
289  myFileMenu->create();
290  mySelectByPermissions->create();
291  myEditMenu->create();
292  mySettingsMenu->create();
293  myLocatorMenu->create();
294  myControlMenu->create();
295  myWindowsMenu->create();
296  myHelpMenu->create();
297 
298  FXint width = getApp()->getNormalFont()->getTextWidth("8", 1) * 24;
299  myCartesianFrame->setWidth(width);
300  myGeoFrame->setWidth(width);
301 
302  show(PLACEMENT_SCREEN);
303  if (getApp()->reg().readIntEntry("SETTINGS", "maximized", 0) == 1) {
304  maximize();
305  }
306  myShowTimeAsHMS = (getApp()->reg().readIntEntry("gui", "timeasHMS", 0) == 1);
307  myAlternateSimDelay = getApp()->reg().readIntEntry("gui", "alternateSimDelay", 100);
308 }
309 
310 
313  myRunThread->join();
314  closeAllWindows();
315  //
317  delete myGLVisual;
318  // delete some non-parented windows
319  delete myToolBarDrag1;
320  //
321  delete myRunThread;
322  delete myFileMenu;
323  delete myEditMenu;
324  delete mySelectByPermissions;
325  delete mySettingsMenu;
326  delete myLocatorMenu;
327  delete myControlMenu;
328  delete myWindowsMenu;
329  delete myHelpMenu;
330 
331  delete myLoadThread;
332 
333  while (!myEvents.empty()) {
334  // get the next event
335  GUIEvent* e = myEvents.top();
336  myEvents.pop();
337  delete e;
338  }
339 }
340 
341 
342 void
344  FXMainWindow::detach();
345  myMenuBarDrag->detach();
346  myToolBarDrag1->detach();
347 }
348 
349 
350 void
352  // build file menu
353  myFileMenu = new FXMenuPane(this);
354  new FXMenuTitle(myMenuBar, "&File", NULL, myFileMenu);
356  "&Open Simulation...\tCtl-O\tOpen a simulation (Configuration file).",
359  "Open &Network...\tCtl-N\tOpen a network.",
362  "Open Shapes \tCtl-P\tLoad POIs and Polygons for visualization.",
365  "&Reload\tCtl-R\tReloads the simulation / the network.",
367  new FXMenuSeparator(myFileMenu);
369  "&Close\tCtl-W\tClose the simulation.",
371  // Recent files
372  FXMenuSeparator* sep1 = new FXMenuSeparator(myFileMenu);
373  sep1->setTarget(&myRecentConfigs);
374  sep1->setSelector(FXRecentFiles::ID_ANYFILES);
375  new FXMenuCommand(myFileMenu, "", 0, &myRecentConfigs, FXRecentFiles::ID_FILE_1);
376  new FXMenuCommand(myFileMenu, "", 0, &myRecentConfigs, FXRecentFiles::ID_FILE_2);
377  new FXMenuCommand(myFileMenu, "", 0, &myRecentConfigs, FXRecentFiles::ID_FILE_3);
378  new FXMenuCommand(myFileMenu, "", 0, &myRecentConfigs, FXRecentFiles::ID_FILE_4);
379  new FXMenuCommand(myFileMenu, "", 0, &myRecentConfigs, FXRecentFiles::ID_FILE_5);
380  new FXMenuCommand(myFileMenu, "", 0, &myRecentConfigs, FXRecentFiles::ID_FILE_6);
381  new FXMenuCommand(myFileMenu, "", 0, &myRecentConfigs, FXRecentFiles::ID_FILE_7);
382  new FXMenuCommand(myFileMenu, "", 0, &myRecentConfigs, FXRecentFiles::ID_FILE_8);
383  new FXMenuCommand(myFileMenu, "", 0, &myRecentConfigs, FXRecentFiles::ID_FILE_9);
384  new FXMenuCommand(myFileMenu, "", 0, &myRecentConfigs, FXRecentFiles::ID_FILE_10);
385  new FXMenuCommand(myFileMenu, "C&lear Recent Configurations", NULL, &myRecentConfigs, FXRecentFiles::ID_CLEAR);
386  myRecentConfigs.setTarget(this);
387  myRecentConfigs.setSelector(MID_RECENTFILE);
388  FXMenuSeparator* sep2 = new FXMenuSeparator(myFileMenu);
389  sep2->setTarget(&myRecentNets);
390  sep2->setSelector(FXRecentFiles::ID_ANYFILES);
391  new FXMenuCommand(myFileMenu, "", 0, &myRecentNets, FXRecentFiles::ID_FILE_1);
392  new FXMenuCommand(myFileMenu, "", 0, &myRecentNets, FXRecentFiles::ID_FILE_2);
393  new FXMenuCommand(myFileMenu, "", 0, &myRecentNets, FXRecentFiles::ID_FILE_3);
394  new FXMenuCommand(myFileMenu, "", 0, &myRecentNets, FXRecentFiles::ID_FILE_4);
395  new FXMenuCommand(myFileMenu, "", 0, &myRecentNets, FXRecentFiles::ID_FILE_5);
396  new FXMenuCommand(myFileMenu, "", 0, &myRecentNets, FXRecentFiles::ID_FILE_6);
397  new FXMenuCommand(myFileMenu, "", 0, &myRecentNets, FXRecentFiles::ID_FILE_7);
398  new FXMenuCommand(myFileMenu, "", 0, &myRecentNets, FXRecentFiles::ID_FILE_8);
399  new FXMenuCommand(myFileMenu, "", 0, &myRecentNets, FXRecentFiles::ID_FILE_9);
400  new FXMenuCommand(myFileMenu, "", 0, &myRecentNets, FXRecentFiles::ID_FILE_10);
401  new FXMenuCommand(myFileMenu, "Cl&ear Recent Networks", NULL, &myRecentNets, FXRecentFiles::ID_CLEAR);
402  myRecentNets.setTarget(this);
403  myRecentNets.setSelector(MID_RECENTFILE);
404  new FXMenuSeparator(myFileMenu);
406  "&Quit\tCtl-Q\tQuit the Application.",
407  0, this, MID_QUIT, 0);
408 
409  // build edit menu
410  mySelectByPermissions = new FXMenuPane(this);
411  std::vector<std::string> vehicleClasses = SumoVehicleClassStrings.getStrings();
412  for (std::vector<std::string>::iterator it = vehicleClasses.begin(); it != vehicleClasses.end(); ++it) {
414  (*it).c_str(), NULL, this, MID_EDITCHOSEN);
415  }
416 
417  myEditMenu = new FXMenuPane(this);
418  new FXMenuTitle(myMenuBar, "&Edit", NULL, myEditMenu);
420  "Edit Selected...\tCtl-E\tOpens a Dialog for editing the List of Selected Items.",
422  new FXMenuCascade(myEditMenu,
423  "Select lanes which allow...\t\tOpens a menu for selecting a vehicle class by which to selected lanes.",
425  new FXMenuSeparator(myEditMenu);
427  "Edit Breakpoints...\tCtl-B\tOpens a Dialog for editing breakpoints.",
428  0, this, MID_EDIT_BREAKPOINTS);
429 
430  // build settings menu
431  mySettingsMenu = new FXMenuPane(this);
432  new FXMenuTitle(myMenuBar, "&Settings", NULL, mySettingsMenu);
434  "Application Settings...\t\tOpen a Dialog for Application Settings editing.",
435  NULL, this, MID_APPSETTINGS);
436  new FXMenuCheck(mySettingsMenu,
437  "Gaming Mode\tCtl-G\tToggle gaming mode on/off.",
438  this, MID_GAMING);
439  new FXMenuCheck(mySettingsMenu,
440  "Full Screen Mode\tCtl-F\tToggle full screen mode on/off.",
441  this, MID_FULLSCREEN);
442  // build Locate menu
443  myLocatorMenu = new FXMenuPane(this);
444  new FXMenuTitle(myMenuBar, "&Locate", NULL, myLocatorMenu);
446  "Locate &Junctions\t\tOpen a Dialog for Locating a Junction.",
449  "Locate &Edges\t\tOpen a Dialog for Locating an Edge.",
451  if (!MSGlobals::gUseMesoSim) { // there are no gui-vehicles in mesosim
453  "Locate &Vehicles\t\tOpen a Dialog for Locating a Vehicle.",
455  }
457  "Locate &Persons\t\tOpen a Dialog for Locating a Person.",
460  "Locate &TLS\t\tOpen a Dialog for Locating a Traffic Light.",
463  "Locate &Additional\t\tOpen a Dialog for Locating an Additional Structure.",
466  "Locate P&oI\t\tOpen a Dialog for Locating a Point of Intereset.",
469  "Locate Po&lygon\t\tOpen a Dialog for Locating a Polygon.",
471  new FXMenuSeparator(myLocatorMenu);
472  new FXMenuCheck(myLocatorMenu,
473  "Show Internal Structures\t\tShow internal junctions and streets in locator Dialog.",
474  this, MID_LISTINTERNAL);
475  // build control menu
476  myControlMenu = new FXMenuPane(this);
477  new FXMenuTitle(myMenuBar, "Simulation", NULL, myControlMenu);
479  "Run\tCtl-A\tStart running the simulation.",
480  NULL, this, MID_START);
482  "Stop\tCtl-S\tStop running the simulation.",
483  NULL, this, MID_STOP);
485  "Step\tCtl-D\tPerform one simulation step.",
486  NULL, this, MID_STEP);
487 
488  // build windows menu
489  myWindowsMenu = new FXMenuPane(this);
490  new FXMenuTitle(myMenuBar, "&Windows", NULL, myWindowsMenu);
491  new FXMenuCheck(myWindowsMenu,
492  "Show Status Line\t\tToggle the Status Bar on/off.",
493  myStatusbar, FXWindow::ID_TOGGLESHOWN);
494  new FXMenuCheck(myWindowsMenu,
495  "Show Message Window\t\tToggle the Message Window on/off.",
496  myMessageWindow, FXWindow::ID_TOGGLESHOWN);
497  new FXMenuCheck(myWindowsMenu,
498  "Show Simulation Time\t\tToggle the Simulation Time on/off.",
499  myToolBar3, FXWindow::ID_TOGGLESHOWN);
500  new FXMenuCheck(myWindowsMenu,
501  "Show Simulation Delay\t\tToggle the Simulation Delay Entry on/off.",
502  myToolBar4, FXWindow::ID_TOGGLESHOWN);
504  new FXMenuSeparator(myWindowsMenu);
505  new FXMenuCommand(myWindowsMenu, "Tile &Horizontally",
507  myMDIClient, FXMDIClient::ID_MDI_TILEHORIZONTAL);
508  new FXMenuCommand(myWindowsMenu, "Tile &Vertically",
510  myMDIClient, FXMDIClient::ID_MDI_TILEVERTICAL);
511  new FXMenuCommand(myWindowsMenu, "Cascade",
513  myMDIClient, FXMDIClient::ID_MDI_CASCADE);
514  new FXMenuCommand(myWindowsMenu, "&Close", NULL,
515  myMDIClient, FXMDIClient::ID_MDI_CLOSE);
516  sep1 = new FXMenuSeparator(myWindowsMenu);
517  sep1->setTarget(myMDIClient);
518  sep1->setSelector(FXMDIClient::ID_MDI_ANY);
519  new FXMenuCommand(myWindowsMenu, "", 0, myMDIClient, FXMDIClient::ID_MDI_1);
520  new FXMenuCommand(myWindowsMenu, "", 0, myMDIClient, FXMDIClient::ID_MDI_2);
521  new FXMenuCommand(myWindowsMenu, "", 0, myMDIClient, FXMDIClient::ID_MDI_3);
522  new FXMenuCommand(myWindowsMenu, "", 0, myMDIClient, FXMDIClient::ID_MDI_4);
523  new FXMenuCommand(myWindowsMenu, "&Others...", 0, myMDIClient, FXMDIClient::ID_MDI_OVER_5);
524  new FXMenuSeparator(myWindowsMenu);
526  "Clear Message Window\t\tClear the message window.",
527  0, this, MID_CLEARMESSAGEWINDOW);
528 
529  // build help menu
530  myHelpMenu = new FXMenuPane(this);
531  new FXMenuTitle(myMenuBar, "&Help", NULL, myHelpMenu);
533  this, MID_ABOUT);
534 }
535 
536 
537 void
539  // build tool bars
540  {
541  // file and simulation tool bar
542  myToolBarDrag1 = new FXToolBarShell(this, FRAME_NORMAL);
543  myToolBar1 = new FXToolBar(myTopDock, myToolBarDrag1,
544  LAYOUT_DOCK_NEXT | LAYOUT_SIDE_TOP | FRAME_RAISED);
545  new FXToolBarGrip(myToolBar1, myToolBar1, FXToolBar::ID_TOOLBARGRIP,
546  TOOLBARGRIP_DOUBLE);
547  // build file tools
548  new FXButton(myToolBar1, "\t\tOpen a simulation (Configuration file).",
550  ICON_ABOVE_TEXT | BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
551  new FXButton(myToolBar1, "\t\tOpen a network.",
553  ICON_ABOVE_TEXT | BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
554  new FXButton(myToolBar1, "\t\tReloads the simulation / the network.",
556  ICON_ABOVE_TEXT | BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
557  }
558  {
559  // build simulation tools
560  myToolBarDrag2 = new FXToolBarShell(this, FRAME_NORMAL);
561  myToolBar2 = new FXToolBar(myTopDock, myToolBarDrag2,
562  LAYOUT_DOCK_SAME | LAYOUT_SIDE_TOP | FRAME_RAISED);
563  new FXToolBarGrip(myToolBar2, myToolBar2, FXToolBar::ID_TOOLBARGRIP,
564  TOOLBARGRIP_DOUBLE);
565  new FXButton(myToolBar2, "\t\tStart the loaded simulation.",
567  ICON_ABOVE_TEXT | BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
568  new FXButton(myToolBar2, "\t\tStop the running simulation.",
570  ICON_ABOVE_TEXT | BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
571  new FXButton(myToolBar2, "\t\tPerform a single simulation step.",
573  ICON_ABOVE_TEXT | BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
574  }
575  {
576  // Simulation Step Display
577  myToolBarDrag3 = new FXToolBarShell(this, FRAME_NORMAL);
578  myToolBar3 = new FXToolBar(myTopDock, myToolBarDrag3,
579  LAYOUT_DOCK_SAME | LAYOUT_SIDE_TOP | FRAME_RAISED);
580  new FXToolBarGrip(myToolBar3, myToolBar3, FXToolBar::ID_TOOLBARGRIP,
581  TOOLBARGRIP_DOUBLE);
582  new FXButton(myToolBar3, "Time:\t\tToggle between seconds and hour:minute:seconds display", 0, this, MID_TIME_TOOGLE,
583  BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
584  myLCDLabel = new FXEX::FXLCDLabel(myToolBar3, 13, 0, 0, JUSTIFY_RIGHT);
588  myLCDLabel->setGroove(2);
589  myLCDLabel->setText("-------------");
590  }
591  {
592  // Simulation Delay
593  myToolBarDrag4 = new FXToolBarShell(this, FRAME_NORMAL);
594  myToolBar4 = new FXToolBar(myTopDock, myToolBarDrag4,
595  LAYOUT_DOCK_SAME | LAYOUT_SIDE_TOP | FRAME_RAISED | LAYOUT_FILL_Y);
596  new FXToolBarGrip(myToolBar4, myToolBar4, FXToolBar::ID_TOOLBARGRIP,
597  TOOLBARGRIP_DOUBLE);
598  new FXButton(myToolBar4, "Delay (ms):\t\tToggle between alternative delay values", 0, this, MID_DELAY_TOOGLE,
599  BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
602  LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK | LAYOUT_FILL_Y);
604  mySimDelayTarget->setIncrements(1, 10, 10);
605  mySimDelayTarget->setRange(0, 1000);
607  }
608  {
609  // Views
610  myToolBarDrag5 = new FXToolBarShell(this, FRAME_NORMAL);
611  myToolBar5 = new FXToolBar(myTopDock, myToolBarDrag5,
612  LAYOUT_DOCK_SAME | LAYOUT_SIDE_TOP | FRAME_RAISED);
613  new FXToolBarGrip(myToolBar5, myToolBar5, FXToolBar::ID_TOOLBARGRIP,
614  TOOLBARGRIP_DOUBLE);
615  // build view tools
616  new FXButton(myToolBar5, "\t\tOpen a new microscopic view.",
618  ICON_ABOVE_TEXT | BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
619 #ifdef HAVE_OSG
620  new FXButton(myToolBar5, "\t\tOpen a new 3D view.",
622  ICON_ABOVE_TEXT | BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
623 #endif
624  }
625  {
627  // total waitingTime
628  myToolBarDrag6 = new FXToolBarShell(this, FRAME_NORMAL);
629  myToolBar6 = new FXToolBar(myTopDock, myToolBarDrag6, LAYOUT_DOCK_SAME | LAYOUT_SIDE_TOP | FRAME_RAISED);
630  new FXToolBarGrip(myToolBar6, myToolBar6, FXToolBar::ID_TOOLBARGRIP, TOOLBARGRIP_DOUBLE);
631  new FXLabel(myToolBar6, "Waiting Time:\t\tTime spent waiting accumulated for all vehicles", 0, LAYOUT_TOP | LAYOUT_LEFT);
632  myWaitingTimeLabel = new FXEX::FXLCDLabel(myToolBar6, 13, 0, 0, JUSTIFY_RIGHT);
637  myWaitingTimeLabel->setText("-------------");
638 
639  // idealistic time loss
640  myToolBarDrag7 = new FXToolBarShell(this, FRAME_NORMAL);
641  myToolBar7 = new FXToolBar(myTopDock, myToolBarDrag7, LAYOUT_DOCK_SAME | LAYOUT_SIDE_TOP | FRAME_RAISED);
642  new FXToolBarGrip(myToolBar7, myToolBar7, FXToolBar::ID_TOOLBARGRIP, TOOLBARGRIP_DOUBLE);
643  new FXLabel(myToolBar7, "Time Loss:\t\tTime lost due to being unable to drive with maximum speed for all vehicles", 0, LAYOUT_TOP | LAYOUT_LEFT);
644  myTimeLossLabel = new FXEX::FXLCDLabel(myToolBar7, 13, 0, 0, JUSTIFY_RIGHT);
649  myTimeLossLabel->setText("-------------");
650  }
651 }
652 
653 
654 long
656  if (!myAmFullScreen) {
657  getApp()->reg().writeIntEntry("SETTINGS", "x", getX());
658  getApp()->reg().writeIntEntry("SETTINGS", "y", getY());
659  getApp()->reg().writeIntEntry("SETTINGS", "width", getWidth());
660  getApp()->reg().writeIntEntry("SETTINGS", "height", getHeight());
661  }
662  getApp()->reg().writeStringEntry("SETTINGS", "basedir", gCurrentFolder.text());
663  getApp()->reg().writeIntEntry("SETTINGS", "maximized", isMaximized() ? 1 : 0);
664  getApp()->reg().writeIntEntry("gui", "timeasHMS", myShowTimeAsHMS ? 1 : 0);
665  getApp()->reg().writeIntEntry("gui", "alternateSimDelay", myAlternateSimDelay);
666  getApp()->exit(0);
667  return 1;
668 }
669 
670 
671 long
673  FXMenuCommand* mc = dynamic_cast<FXMenuCommand*>(menu);
674  if (mc->getText() == "Edit Selected...") {
675  GUIDialog_GLChosenEditor* chooser =
677  chooser->create();
678  chooser->show();
679  } else {
681  const SUMOVehicleClass svc = SumoVehicleClassStrings.get(mc->getText().text());
682  for (size_t i = 0; i < MSEdge::dictSize(); ++i) {
683  const std::vector<MSLane*>& lanes = MSEdge::dictionary(i)->getLanes();
684  for (std::vector<MSLane*>::const_iterator it = lanes.begin(); it != lanes.end(); ++it) {
685  GUILane* lane = dynamic_cast<GUILane*>(*it);
686  assert(lane != 0);
687  if ((lane->getPermissions() & svc) != 0) {
688  gSelected.select(lane->getGlID());
689  }
690  }
691  }
692  if (myMDIClient->numChildren() > 0) {
693  GUISUMOViewParent* w = dynamic_cast<GUISUMOViewParent*>(myMDIClient->getActiveChild());
694  if (w != 0) {
695  // color by selection
697  }
698  }
699  }
700  updateChildren();
701  }
702  return 1;
703 }
704 
705 
706 long
709  chooser->create();
710  chooser->show();
711  return 1;
712 }
713 
714 
715 long
717  // get the new file name
718  FXFileDialog opendialog(this, "Open Simulation Configuration");
719  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY));
720  opendialog.setSelectMode(SELECTFILE_EXISTING);
721  opendialog.setPatternList(myConfigPattern.c_str());
722  if (gCurrentFolder.length() != 0) {
723  opendialog.setDirectory(gCurrentFolder);
724  }
725  if (opendialog.execute()) {
726  gCurrentFolder = opendialog.getDirectory();
727  std::string file = opendialog.getFilename().text();
728  loadConfigOrNet(file, false);
729  myRecentConfigs.appendFile(file.c_str());
730  }
731  return 1;
732 }
733 
734 
735 long
737  // get the new file name
738  FXFileDialog opendialog(this, "Open Network");
739  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY));
740  opendialog.setSelectMode(SELECTFILE_EXISTING);
741  opendialog.setPatternList("SUMO nets (*.net.xml)\nAll files (*)");
742  if (gCurrentFolder.length() != 0) {
743  opendialog.setDirectory(gCurrentFolder);
744  }
745  if (opendialog.execute()) {
746  gCurrentFolder = opendialog.getDirectory();
747  std::string file = opendialog.getFilename().text();
748  loadConfigOrNet(file, true);
749  myRecentNets.appendFile(file.c_str());
750  }
751  return 1;
752 }
753 
754 
755 long
757  // get the shape file name
758  FXFileDialog opendialog(this, "Open Shapes");
759  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY));
760  opendialog.setSelectMode(SELECTFILE_EXISTING);
761  opendialog.setPatternList("Additional files (*.xml)\nAll files (*)");
762  if (gCurrentFolder.length() != 0) {
763  opendialog.setDirectory(gCurrentFolder);
764  }
765  if (opendialog.execute()) {
766  gCurrentFolder = opendialog.getDirectory();
767  std::string file = opendialog.getFilename().text();
768 
770  if (!XMLSubSys::runParser(handler, file, false)) {
771  WRITE_MESSAGE("Loading of " + file + " failed.");
772  }
773  }
774  return 1;
775 }
776 
777 
778 long
780  loadConfigOrNet("", false, true);
781  return 1;
782 }
783 
784 
785 long
786 GUIApplicationWindow::onCmdOpenRecent(FXObject* sender, FXSelector, void* data) {
787  if (myAmLoading) {
788  myStatusbar->getStatusLine()->setText("Already loading!");
789  return 1;
790  }
791  std::string file((const char*)data);
792  loadConfigOrNet(file, sender == &myRecentNets);
793  return 1;
794 }
795 
796 
797 long
799  closeAllWindows();
800  return 1;
801 }
802 
803 
804 long
805 GUIApplicationWindow::onUpdOpen(FXObject* sender, FXSelector, void* ptr) {
806  sender->handle(this,
807  myAmLoading ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
808  ptr);
809  return 1;
810 }
811 
812 
813 long
814 GUIApplicationWindow::onUpdReload(FXObject* sender, FXSelector, void* ptr) {
815  sender->handle(this,
817  ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
818  ptr);
819  return 1;
820 }
821 
822 
823 long
824 GUIApplicationWindow::onUpdOpenRecent(FXObject* sender, FXSelector, void* ptr) {
825  sender->handle(this,
826  myAmLoading ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
827  ptr);
828  return 1;
829 }
830 
831 
832 long
833 GUIApplicationWindow::onUpdAddView(FXObject* sender, FXSelector, void* ptr) {
834  sender->handle(this,
836  ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
837  ptr);
838  return 1;
839 }
840 
841 
842 long
844  // check whether a net was loaded successfully
846  myStatusbar->getStatusLine()->setText("No simulation loaded!");
847  return 1;
848  }
849  // check whether it was started before and paused;
850  if (!myWasStarted) {
851  myRunThread->begin();
852  myWasStarted = true;
853  }
854  myRunThread->resume();
855  return 1;
856 }
857 
858 
859 long
861  myRunThread->stop();
862  return 1;
863 }
864 
865 
866 long
868  // check whether a net was loaded successfully
870  myStatusbar->getStatusLine()->setText("No simulation loaded!");
871  return 1;
872  }
873  // check whether it was started before and paused;
874  if (!myWasStarted) {
875  myRunThread->begin();
876  myWasStarted = true;
877  }
879  return 1;
880 }
881 
882 
883 long
888  }
889  return 1;
890 }
891 
892 
893 long
895  const SUMOTime tmp = myAlternateSimDelay;
898  return 1;
899 }
900 
901 
902 long
905  return 1;
906 }
907 
908 
909 long
910 GUIApplicationWindow::onUpdStart(FXObject* sender, FXSelector, void* ptr) {
911  sender->handle(this,
913  ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
914  ptr);
915  return 1;
916 }
917 
918 
919 long
920 GUIApplicationWindow::onUpdStop(FXObject* sender, FXSelector, void* ptr) {
921  sender->handle(this,
923  ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
924  ptr);
925  return 1;
926 }
927 
928 
929 long
930 GUIApplicationWindow::onUpdStep(FXObject* sender, FXSelector, void* ptr) {
931  sender->handle(this,
933  ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
934  ptr);
935  return 1;
936 }
937 
938 
939 long
940 GUIApplicationWindow::onUpdNeedsSimulation(FXObject* sender, FXSelector, void* ptr) {
941  sender->handle(this,
943  ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
944  ptr);
945  return 1;
946 }
947 
948 
949 long
950 GUIApplicationWindow::onCmdLocate(FXObject*, FXSelector sel, void*) {
951  if (myMDIClient->numChildren() > 0) {
952  GUISUMOViewParent* w = dynamic_cast<GUISUMOViewParent*>(myMDIClient->getActiveChild());
953  if (w != 0) {
954  w->onCmdLocate(0, sel, 0);
955  }
956  }
957  return 1;
958 }
959 
960 long
963  d->create();
964  d->show(PLACEMENT_OWNER);
965  return 1;
966 }
967 
968 
969 long
972  if (myAmGaming) {
973  myMenuBar->hide();
974  myStatusbar->hide();
975  myToolBar1->hide();
976  myToolBar2->hide();
977  myToolBar4->hide();
978  myToolBar5->hide();
979  myToolBar6->show();
980  myToolBar7->show();
981  myMessageWindow->hide();
986  } else {
987  myMenuBar->show();
988  myStatusbar->show();
989  myToolBar1->show();
990  myToolBar2->show();
991  myToolBar4->show();
992  myToolBar5->show();
993  myToolBar6->hide();
994  myToolBar7->hide();
995  myMessageWindow->show();
997  gSchemeStorage.getDefault().gaming = false;
998  }
999  if (myMDIClient->numChildren() > 0) {
1000  GUISUMOViewParent* w = dynamic_cast<GUISUMOViewParent*>(myMDIClient->getActiveChild());
1001  if (w != 0) {
1003  }
1004  }
1005  update();
1006  return 1;
1007 }
1008 
1009 
1010 long
1013  if (myAmFullScreen) {
1014  getApp()->reg().writeIntEntry("SETTINGS", "x", getX());
1015  getApp()->reg().writeIntEntry("SETTINGS", "y", getY());
1016  getApp()->reg().writeIntEntry("SETTINGS", "width", getWidth());
1017  getApp()->reg().writeIntEntry("SETTINGS", "height", getHeight());
1018  maximize();
1019  setDecorations(DECOR_NONE);
1020  place(PLACEMENT_MAXIMIZED);
1021  myMenuBar->hide();
1022  myStatusbar->hide();
1023  myToolBar1->hide();
1024  myToolBar2->hide();
1025  myToolBar3->hide();
1026  myToolBar4->hide();
1027  myToolBar5->hide();
1028  myToolBar6->hide();
1029  myToolBar7->hide();
1030  myMessageWindow->hide();
1031  if (myMDIClient->numChildren() > 0) {
1032  GUISUMOViewParent* w = dynamic_cast<GUISUMOViewParent*>(myMDIClient->getActiveChild());
1033  if (w != 0) {
1034  w->setToolBarVisibility(false);
1035  }
1036  }
1037  update();
1038  } else {
1039  place(PLACEMENT_VISIBLE);
1040  setDecorations(DECOR_ALL);
1041  restore();
1042  myToolBar3->show();
1044  onCmdGaming(0, 0, 0);
1045  setWidth(getApp()->reg().readIntEntry("SETTINGS", "width", 600));
1046  setHeight(getApp()->reg().readIntEntry("SETTINGS", "height", 400));
1047  setX(getApp()->reg().readIntEntry("SETTINGS", "x", 150));
1048  setY(getApp()->reg().readIntEntry("SETTINGS", "y", 150));
1049  }
1050  return 1;
1051 }
1052 
1053 
1054 long
1057  return 1;
1058 }
1059 
1060 
1061 long
1064  return 1;
1065 }
1066 
1067 
1068 #ifdef HAVE_OSG
1069 long
1070 GUIApplicationWindow::onCmdNewOSG(FXObject*, FXSelector, void*) {
1072  return 1;
1073 }
1074 #endif
1075 
1076 
1077 long
1079  GUIDialog_AboutSUMO* about =
1080  new GUIDialog_AboutSUMO(this, "About SUMO", 0, 0);
1081  about->create();
1082  about->show(PLACEMENT_OWNER);
1083  return 1;
1084 }
1085 
1086 
1087 long GUIApplicationWindow::onClipboardRequest(FXObject* /* sender */, FXSelector /* sel */, void* ptr) {
1088  FXEvent* event = (FXEvent*)ptr;
1089  FXString string = GUIUserIO::clipped.c_str();
1090  setDNDData(FROM_CLIPBOARD, event->target, string);
1091  return 1;
1092 }
1093 
1094 
1095 long
1097  eventOccured();
1098  return 1;
1099 }
1100 
1101 
1102 long
1104  eventOccured();
1105  return 1;
1106 }
1107 
1108 
1109 void
1111  while (!myEvents.empty()) {
1112  // get the next event
1113  GUIEvent* e = myEvents.top();
1114  myEvents.pop();
1115  // process
1116  switch (e->getOwnType()) {
1119  break;
1120  case EVENT_SIMULATION_STEP:
1121  if (myRunThread->simulationAvailable()) { // avoid race-condition related crash if reload was pressed
1123  }
1124  break;
1125  case EVENT_MESSAGE_OCCURED:
1126  case EVENT_WARNING_OCCURED:
1127  case EVENT_ERROR_OCCURED:
1129  break;
1132  break;
1133  default:
1134  break;
1135  }
1136  delete e;
1137  }
1138  myToolBar2->forceRefresh();
1139  myToolBar3->forceRefresh();
1140 }
1141 
1142 
1143 void
1145  myAmLoading = false;
1147  // check whether the loading was successfull
1148  if (ec->myNet == 0) {
1149  // report failure
1150  setStatusBarText("Loading of '" + ec->myFile + "' failed!");
1151  if (GUIGlobals::gQuitOnEnd) {
1152  closeAllWindows();
1153  getApp()->exit(1);
1154  }
1155  } else {
1156  // initialise simulation thread
1157  if (!myRunThread->init(ec->myNet, ec->myBegin, ec->myEnd)) {
1158  if (GUIGlobals::gQuitOnEnd) {
1159  closeAllWindows();
1160  getApp()->exit(1);
1161  }
1162  } else {
1163  // report success
1164  setStatusBarText("'" + ec->myFile + "' loaded.");
1165  myWasStarted = false;
1166  myHaveNotifiedAboutSimEnd = false;
1167  // initialise views
1168  myViewNumber = 0;
1170  if (ec->mySettingsFiles.size() > 0) {
1171  // open a view for each file and apply settings
1172  for (std::vector<std::string>::const_iterator it = ec->mySettingsFiles.begin(); it != ec->mySettingsFiles.end(); ++it) {
1173  GUISettingsHandler settings(*it);
1174  GUISUMOViewParent::ViewType vt = defaultType;
1175  if (settings.getViewType() == "osg" || settings.getViewType() == "3d") {
1177  }
1178  if (settings.getViewType() == "opengl" || settings.getViewType() == "2d") {
1180  }
1181  GUISUMOAbstractView* view = openNewView(vt);
1182  if (view == 0) {
1183  break;
1184  }
1185  std::string settingsName = settings.addSettings(view);
1186  view->addDecals(settings.getDecals());
1187  settings.setViewport(view);
1188  settings.setSnapshots(view);
1189  if (settings.getDelay() > 0) {
1190  mySimDelayTarget->setValue(settings.getDelay());
1191  }
1192  if (settings.getBreakpoints().size() > 0) {
1194  myRunThread->getBreakpoints().assign(settings.getBreakpoints().begin(), settings.getBreakpoints().end());
1196  }
1197  myJamSounds = settings.getEventDistribution("jam");
1198  if (settings.getJamSoundTime() > 0) {
1199  myJamSoundTime = settings.getJamSoundTime();
1200  }
1201  }
1202  } else {
1203  openNewView(defaultType);
1204  }
1205 
1206  if (isGaming()) {
1207  setTitle("SUMO Interactive Traffic Light");
1208  } else {
1209  // set simulation name on the caption
1210  std::string caption = "SUMO " + getBuildName(VERSION_STRING);
1211  setTitle(MFXUtils::getTitleText(caption.c_str(), ec->myFile.c_str()));
1212  }
1213  // set simulation step begin information
1214  myLCDLabel->setText("-------------");
1215  }
1216  }
1217  getApp()->endWaitCursor();
1218  // start if wished
1220  onCmdStart(0, 0, 0);
1221  }
1222  update();
1223 }
1224 
1225 
1226 void
1228  updateChildren();
1230  if (myAmGaming) {
1232  }
1233  update();
1234 }
1235 
1236 
1237 void
1239  GUIEvent_Message* ec = static_cast<GUIEvent_Message*>(e);
1240  myMessageWindow->appendMsg(ec->getOwnType(), ec->getMsg());
1241 }
1242 
1243 
1244 void
1246  GUIEvent_SimulationEnded* ec = static_cast<GUIEvent_SimulationEnded*>(e);
1247  onCmdStop(0, 0, 0);
1248  if (GUIGlobals::gQuitOnEnd) {
1249  closeAllWindows();
1250  getApp()->exit(ec->getReason() == MSNet::SIMSTATE_ERROR_IN_SIM);
1251  } else if (!myHaveNotifiedAboutSimEnd) {
1252  // build the text
1253  const std::string text = "Simulation ended at time: " + time2string(ec->getTimeStep()) +
1254  ".\nReason: " + MSNet::getStateMessage(ec->getReason());
1255  FXMessageBox::warning(this, MBOX_OK, "Simulation ended", "%s", text.c_str());
1257  }
1258 }
1259 
1260 
1261 void
1266 #ifdef HAVE_INTERNAL
1267  if (myJamSounds.getOverallProb() > 0) {
1268  // play honking sound if some vehicle is waiting too long
1269  for (; it != end; ++it) {
1270  // XXX use impatience instead of waiting time ?
1271  if (it->second->getWaitingTime() > TIME2STEPS(myJamSoundTime)) {
1272  const std::string cmd = myJamSounds.get(&myGamingRNG);
1273  if (cmd != "") {
1274  // yay! fun with dangerous commands... Never use this over the internet
1276  // one sound per simulation step is enough
1277  break;
1278  }
1279  }
1280  }
1281  }
1282 #endif
1283  // updated peformance indicators
1284 
1285  for (it = vc.loadedVehBegin(); it != end; ++it) {
1286  const MSVehicle* veh = dynamic_cast<MSVehicle*>(it->second);
1287  assert(veh != 0);
1288  const SUMOReal vmax = MIN2(veh->getVehicleType().getMaxSpeed(), veh->getEdge()->getSpeedLimit());
1289  if (veh->isOnRoad() && veh->getSpeed() < SUMO_const_haltingSpeed) {
1291  }
1292  myTimeLoss += TS * TIME2STEPS(vmax - veh->getSpeed()) / vmax; // may be negative with speedFactor > 1
1295  }
1296 
1297 }
1298 
1299 
1300 void
1301 GUIApplicationWindow::loadConfigOrNet(const std::string& file, bool isNet, bool isReload) {
1302  getApp()->beginWaitCursor();
1303  myAmLoading = true;
1304  closeAllWindows();
1305  if (isReload) {
1307  setStatusBarText("Reloading.");
1308  } else {
1309  gSchemeStorage.saveViewport(0, 0, -1); // recenter view
1310  myLoadThread->loadConfigOrNet(file, isNet);
1311  setStatusBarText("Loading '" + file + "'.");
1312  }
1313  update();
1314 }
1315 
1316 
1319  if (!myRunThread->simulationAvailable()) {
1320  myStatusbar->getStatusLine()->setText("No simulation loaded!");
1321  return 0;
1322  }
1323  std::string caption = "View #" + toString(myViewNumber++);
1324  FXuint opts = MDI_TRACKING;
1325  GUISUMOViewParent* w = new GUISUMOViewParent(myMDIClient, myMDIMenu, FXString(caption.c_str()),
1326  this, GUIIconSubSys::getIcon(ICON_APP), opts, 10, 10, 300, 200);
1328  w->create();
1329  if (myMDIClient->numChildren() == 1) {
1330  w->maximize();
1331  } else {
1332  myMDIClient->vertical(true);
1333  }
1334  myMDIClient->setActiveChild(w);
1335  return v;
1336 }
1337 
1338 
1339 FXGLCanvas*
1341  if (myMDIClient->numChildren() == 0) {
1342  return 0;
1343  }
1344  GUISUMOViewParent* share_tmp1 =
1345  static_cast<GUISUMOViewParent*>(myMDIClient->childAtIndex(0));
1346  return share_tmp1->getBuildGLCanvas();
1347 }
1348 
1349 
1350 void
1352  myTrackerLock.lock();
1353  myLCDLabel->setText("-------------");
1354  // remove trackers and other external windows
1355  size_t i;
1356  for (i = 0; i < mySubWindows.size(); ++i) {
1357  mySubWindows[i]->destroy();
1358  }
1359  for (i = 0; i < myTrackerWindows.size(); ++i) {
1360  myTrackerWindows[i]->destroy();
1361  }
1362  // delete the simulation
1364  // reset the caption
1365  setTitle(MFXUtils::getTitleText(("SUMO " + getBuildName(VERSION_STRING)).c_str()));
1366  // delete other children
1367  while (myTrackerWindows.size() != 0) {
1368  delete myTrackerWindows[0];
1369  }
1370  while (mySubWindows.size() != 0) {
1371  delete mySubWindows[0];
1372  }
1373  mySubWindows.clear();
1374  // clear selected items
1375  gSelected.clear();
1376  // add a separator to the log
1379  // remove coordinate information
1380  myGeoCoordinate->setText("N/A");
1381  myCartesianCoordinate->setText("N/A");
1382  //
1384  update();
1385 }
1386 
1387 
1388 FXCursor*
1390  return getApp()->getDefaultCursor(DEF_ARROW_CURSOR);
1391 }
1392 
1393 
1394 SUMOTime
1397 }
1398 
1399 
1400 void
1402  loadConfigOrNet("", false);
1403 }
1404 
1405 
1406 void
1407 GUIApplicationWindow::setStatusBarText(const std::string& text) {
1408  myStatusbar->getStatusLine()->setText(text.c_str());
1409  myStatusbar->getStatusLine()->setNormalText(text.c_str());
1410 }
1411 
1412 
1413 void
1415  time -= DELTA_T; // synchronize displayed time with netstate output
1416  if (myAmGaming) {
1417  // show time counting backwards
1418  time = myRunThread->getSimEndTime() - time;
1419  }
1420  SUMOReal fracSeconds = STEPS2TIME(time);
1421  const bool hideFraction = myAmGaming || fmod(TS, 1.) == 0.;
1422  const int BuffSize = 100;
1423  char buffer[BuffSize];
1424  if (myShowTimeAsHMS) {
1425  const int hours = (int)fracSeconds / 3600;
1426  const int minutes = ((int)fracSeconds % 3600) / 60;
1427  fracSeconds = fracSeconds - 3600 * hours - 60 * minutes;
1428  const std::string format = (hideFraction ?
1429  "%02d-%02d-%02.0f" : "%02d-%02d-%06.3f");
1430  snprintf(buffer, BuffSize, format.c_str(), hours, minutes, fracSeconds);
1431  } else {
1432  const std::string format = (hideFraction ?
1433  "%13.0f" : "%13.3f");
1434  snprintf(buffer, BuffSize, format.c_str(), fracSeconds);
1435  }
1436  myLCDLabel->setText(buffer);
1437 }
1438 
1439 /****************************************************************************/
1440 
std::vector< FXMainWindow * > myTrackerWindows
Definition: GUIMainWindow.h:97
Event sent when the the simulation is over.
MFXMutex & getBreakpointLock()
Definition: GUIRunThread.h:119
RandomDistributor< std::string > myJamSounds
FXLabel * myGeoCoordinate
GUISUMOAbstractView * getView() const
virtual ~GUIApplicationWindow()
Destructor.
GUILoadThread * myLoadThread
Locate vehicle - button.
Definition: GUIAppEnum.h:165
GUICompleteSchemeStorage gSchemeStorage
Main window closes.
Definition: GUIAppEnum.h:55
void pop()
Definition: MFXEventQue.h:53
long onCmdStep(FXObject *, FXSelector, void *)
Called on "step".
static std::string clipped
Definition: GUIUserIO.h:64
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:80
void handleEvent_SimulationLoaded(GUIEvent *e)
SUMOReal getMaxSpeed() const
Get vehicle's maximum speed [m/s].
long onCmdReload(FXObject *, FXSelector, void *)
Called on reload.
Locate person - button.
Definition: GUIAppEnum.h:167
virtual bool simulationIsStepable() const
void appendMsg(GUIEventType eType, const std::string &msg)
Adds new text to the window.
std::string addSettings(GUISUMOAbstractView *view=0) const
Adds the parsed settings to the global list of settings.
MSNet::SimulationState getReason() const
Returns the reason the simulation has ended due.
SUMOTime myAlternateSimDelay
The alternate simulation delay for toggling.
GUIVisualizationSettings * getVisualisationSettings()
send when a message occured
Definition: GUIEvent.h:50
bool empty()
Definition: MFXEventQue.h:72
virtual void deleteSim()
FXSplitter * myMainSplitter
The splitter that divides the main window into vies and the log window.
virtual bool init(GUINet *net, SUMOTime start, SUMOTime end)
initialises the thread with the new simulation
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
long onUpdOpenRecent(FXObject *, FXSelector, void *)
Determines whether opening a recent file is enabled.
const std::string & getViewType() const
Returns the parsed view type.
long onCmdEditChosen(FXObject *, FXSelector, void *)
Called on menu Edit->Edit Chosen.
static MTRand myGamingRNG
A random number generator used to choose a gaming sound.
Locate TLS - button.
Definition: GUIAppEnum.h:169
constVehIt loadedVehBegin() const
Returns the begin of the internal vehicle map.
bool gaming
whether the application is in gaming mode or not
Gaming mode - menu entry.
Definition: GUIAppEnum.h:139
const bool myOsgView
whether to load the OpenSceneGraph view
Loads a file previously loaded.
Definition: GUIAppEnum.h:81
const std::string & getMsg() const
Returns the message.
GUIColorer laneColorer
The lane colorer.
void select(GUIGlID id, bool update=true)
Adds the object with the given id.
FXToolBarShell * myToolBarDrag4
long onUpdStop(FXObject *, FXSelector, void *)
Determines whether "stop" is enabled.
long onClipboardRequest(FXObject *sender, FXSelector sel, void *ptr)
Somebody wants our clipped text.
virtual void setValue(FXdouble value)
Change current value.
Locate poi - button.
Definition: GUIAppEnum.h:173
void setNumberFormat(FXint prec, FXbool bExp=FALSE)
virtual bool simulationIsStartable() const
static bool gRunAfterLoad
the simulation shall start direct after loading
Definition: GUIGlobals.h:52
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:61
void setToolBarVisibility(const bool value)
about toggled gaming status
Start the simulation.
Definition: GUIAppEnum.h:93
Edit simulation breakpoints.
Definition: GUIAppEnum.h:129
virtual void detach()
Detaches the tool/menu bar.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:159
Editor for the list of chosen objects.
void setThickness(const FXint width)
set/get segment width - must be less than half the segment length
Definition: FXLCDLabel.cpp:205
FXGLVisual * myGLVisual
The gl-visual used.
GUISUMOAbstractView * openNewView(GUISUMOViewParent::ViewType vt=GUISUMOViewParent::VIEW_2D_OPENGL)
long onCmdLocate(FXObject *, FXSelector, void *)
locator-callback
long onCmdStop(FXObject *, FXSelector, void *)
Called on "stop".
const std::vector< SUMOTime > & getBreakpoints() const
Returns the parsed breakpoints.
Main window-ID.
Definition: GUIAppEnum.h:53
static bool dictionary(const std::string &id, MSEdge *edge)
Inserts edge into the static dictionary Returns true if the key id isn't already in the dictionary...
Definition: MSEdge.cpp:531
toogle delay between alternative value
Definition: GUIAppEnum.h:189
Stop the simulation.
Definition: GUIAppEnum.h:95
FXString gCurrentFolder
The folder used as last.
#define TIME2STEPS(x)
Definition: SUMOTime.h:66
#define TS
Definition: SUMOTime.h:52
Open a new microscopic 3D view.
Definition: GUIAppEnum.h:107
Reload the previously loaded simulation.
Definition: GUIAppEnum.h:79
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
Definition: MSNet.h:235
bool isGaming() const
return whether the gui is in gaming mode
Definition: GUIMainWindow.h:77
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:114
const SUMOTime myBegin
the time the simulation shall start with
long onCmdNewView(FXObject *, FXSelector, void *)
Called if a new view shall be opened (2D view)
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GUIGlObject.h:115
long onUpdOpen(FXObject *, FXSelector, void *)
Determines whether opening is enabled.
Open network - ID.
Definition: GUIAppEnum.h:75
virtual FXGLCanvas * getBuildGLCanvas() const
const std::vector< GUISUMOAbstractView::Decal > & getDecals() const
Returns the parsed decals.
void addDecals(const std::vector< Decal > &decals)
FXToolBarShell * myToolBarDrag2
void setViewport(GUISUMOAbstractView *view) const
Sets the viewport which has been parsed.
void setFgColor(FXColor clr)
set/get forground color
Definition: FXLCDLabel.cpp:128
void checkGamingEvents()
handles additional game-related events
FXMenuPane * myFileMenu
the submenus
void addSeparator()
Adds a a separator to this log window.
std::vector< SUMOTime > & getBreakpoints()
Definition: GUIRunThread.h:115
Open configuration - ID.
Definition: GUIAppEnum.h:73
virtual void create()
Creates the main window (required by FOX)
Representation of a lane in the micro simulation (gui-version)
Definition: GUILane.h:70
FXHorizontalFrame * myCartesianFrame
SUMOReal getDelay() const
Returns the parsed delay.
FXRecentFiles myRecentNets
List of recent nets.
const std::vector< std::string > mySettingsFiles
the name of the settings file to load
void loadConfigOrNet(const std::string &file, bool isNet)
begins the loading of the given file
RandomDistributor< std::string > getEventDistribution(const std::string &id)
Editor for simulation breakpoints.
Locate addtional structure - button.
Definition: GUIAppEnum.h:171
bool myAmGaming
information whether the gui is currently in gaming mode
bool myShowTimeAsHMS
whether to show time as hour:minute:second
void handleEvent_Message(GUIEvent *e)
std::vector< FXMDIChild * > mySubWindows
Definition: GUIMainWindow.h:96
static void clearTextures()
clears loaded textures
GUIEventType getOwnType() const
returns the event type
Definition: GUIEvent.h:77
long onCmdOpenRecent(FXObject *, FXSelector, void *)
Called on opening a recent file.
static const RGBColor GREEN
Definition: RGBColor.h:190
An error occured during the simulation step.
Definition: MSNet.h:109
Locator configuration - menu entry.
Definition: GUIAppEnum.h:143
void updateTimeLCD(SUMOTime time)
updates the simulation time display
void setRange(FXdouble lo, FXdouble hi)
Change the spinner's range.
void handleEvent_SimulationEnded(GUIEvent *e)
FXdouble getValue() const
Return current value.
bool myHaveNotifiedAboutSimEnd
whether the simulation end was already announced
std::string myConfigPattern
Input file pattern.
static unsigned long runHiddenCommand(const std::string &cmd)
run a shell command without popping up any windows (particuarly on win32)
Definition: SysUtils.cpp:75
long onCmdEditBreakpoints(FXObject *, FXSelector, void *)
Called on menu Edit->Edit Breakpoints.
#define snprintf
SUMOReal myJamSoundTime
waiting time after which vehicles trigger jam sounds
long onCmdStart(FXObject *, FXSelector, void *)
Called on "play".
ShapeContainer & getShapeContainer()
Returns the shapes container.
Definition: MSNet.h:399
long onCmdAppSettings(FXObject *, FXSelector, void *)
Opens the application settings menu (Settings->Application Settings...)
virtual void buildToolBars()
Builds the tool bar.
void setHorizontal(const FXint len)
set/get segment horizontal length - must be more than twice the segment width
Definition: FXLCDLabel.cpp:169
Locate edge - button.
Definition: GUIAppEnum.h:163
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
Definition: MSNet.h:288
The Simulation delay control.
Definition: GUIAppEnum.h:145
The Simulation execution thread.
Definition: GUIAppEnum.h:117
static void init(FXApp *a)
size_t myViewNumber
The current view number.
T get(MTRand *which=0) const
Draw a sample of the distribution.
FXMDIMenu * myMDIMenu
The menu used for the MDI-windows.
void setSnapshots(GUISUMOAbstractView *view) const
Makes a snapshot if it has been parsed.
void setVertical(const FXint len)
set/get segment vertical length - must be more than twice the segment width
Definition: FXLCDLabel.cpp:187
FXToolBarShell * myMenuBarDrag
const std::string getBuildName(const std::string &version)
attach some build flags to the version string
Definition: StdDefs.cpp:88
SUMOTime getCurrentSimTime() const
ViewType
Available view types.
long onCmdListInternal(FXObject *, FXSelector, void *)
Toggle listing of internal structures.
long onUpdReload(FXObject *, FXSelector, void *)
Determines whether reloading is enabled.
void reloadConfigOrNet()
reloads according to the given input options
long onCmdDelayToggle(FXObject *, FXSelector, void *)
Called on "delay toggle".
#define STEPS2TIME(x)
Definition: SUMOTime.h:65
const std::string myFile
the name of the loaded file
FXToolBarShell * myToolBarDrag3
T MIN2(T a, T b)
Definition: StdDefs.h:68
The application's "About" - dialog.
void setStatusBarText(const std::string &)
bool myAmFullScreen
whether to show the window in full screen mode
Locate junction - button.
Definition: GUIAppEnum.h:161
long onCmdAbout(FXObject *, FXSelector, void *)
Shows the about dialog.
long onCmdClose(FXObject *, FXSelector, void *)
Called on menu File->Close.
void saveViewport(const SUMOReal x, const SUMOReal y, const SUMOReal zoom)
Makes the given viewport the default.
send when a error occured
Definition: GUIEvent.h:56
SVCPermissions getPermissions() const
Returns the vehicle class permissions for this lane.
Definition: MSLane.h:378
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
Load additional file with poi and polygons.
Definition: GUIAppEnum.h:77
void setTarget(FXObject *tgt)
set the target
Definition: FXBaseObject.h:137
bool myListInternal
information whether the locator should list internal structures
long onCmdOpenShapes(FXObject *, FXSelector, void *)
Called on menu File->Load Shapes.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
Definition: ToString.h:53
virtual bool simulationIsStopable() const
The dialog to change the application (gui) settings.
SUMOReal getSpeedLimit() const
Returns the speed limit of the edge The speed limit of the first lane is retured; should probably be...
Definition: MSEdge.cpp:634
Send when the simulation is over; The reason and the time step are stored within the event...
Definition: GUIEvent.h:60
long onCmdClearMsgWindow(FXObject *, FXSelector, void *)
Called if the message window shall be cleared.
FXMenuPane * mySelectByPermissions
GUINet & getNet() const
toogle time display mode
Definition: GUIAppEnum.h:187
virtual void fillMenuBar()
Builds the menu bar.
Application settings - menu entry.
Definition: GUIAppEnum.h:137
#define VERSION_STRING
Definition: config.h:230
A single child window which contains a view of the simulation area.
FXEX::FXLCDLabel * myWaitingTimeLabel
performance indicators
static bool gQuitOnEnd
the window shall be closed when the simulation has ended
Definition: GUIGlobals.h:55
long onCmdGaming(FXObject *, FXSelector, void *)
Toggle gaming mode.
FXStatusBar * myStatusbar
The status bar.
void unlock()
release mutex lock
Definition: MFXMutex.cpp:96
FXMenuBar * myMenuBar
The application menu bar.
FXToolBarShell * myToolBarDrag5
SUMOReal getOverallProb() const
Return the sum of the probabilites assigned to the members.
FXGLCanvas * getBuildGLCanvas() const
FXToolBarShell * myToolBarDrag7
long onCmdFullScreen(FXObject *, FXSelector, void *)
Toggle full screen mode.
GUIVisualizationSettings & getDefault()
Returns the default scheme.
FXToolBarShell * myToolBarDrag6
static const RGBColor RED
Definition: RGBColor.h:189
long onCmdOpenConfiguration(FXObject *, FXSelector, void *)
Called on menu File->Open Configuration.
long onRunThreadEvent(FXObject *, FXSelector, void *)
Called on an event from the simulation thread.
The XML-Handler for shapes loading network loading.
Definition: NLHandler.h:73
void setGroove(const FXint width)
set/get groove width - must be less than segment width
Definition: FXLCDLabel.cpp:223
FXLabel * myCartesianCoordinate
Labels for the current cartesian and geo-coordinate.
About SUMO - ID.
Definition: GUIAppEnum.h:85
void prepareDestruction()
FXDEFMAP(GUIApplicationWindow) GUIApplicationWindowMap[]
MFXMutex myTrackerLock
A lock to make the removal and addition of trackers secure.
Definition: GUIMainWindow.h:99
void setSelector(FXSelector sel)
set the selector
Definition: FXBaseObject.h:147
The loading thread.
Definition: GUIAppEnum.h:115
MFXEventQue< GUIEvent * > myEvents
List of got requests.
void loadConfigOrNet(const std::string &file, bool isNet, bool isReload=false)
static void close()
Fullscreen mode - menu entry.
Definition: GUIAppEnum.h:141
long onUpdAddView(FXObject *, FXSelector, void *)
Determines whether adding a view is enabled.
SUMOTime getSimEndTime() const
Definition: GUIRunThread.h:111
long onCmdLocate(FXObject *, FXSelector, void *)
Called on menu commands from the Locator menu.
FXEX::FXLCDLabel * myTimeLossLabel
FXRealSpinDial * mySimDelayTarget
FXHorizontalFrame * myGeoFrame
static size_t dictSize()
Returns the number of edges.
Definition: MSEdge.cpp:565
Open a new microscopic view.
Definition: GUIAppEnum.h:105
FXDockSite * myTopDock
Locate polygons - button.
Definition: GUIAppEnum.h:175
FXRecentFiles myRecentConfigs
List of recent config files.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
Definition: MSBaseVehicle.h:90
Open chosen editor - ID.
Definition: GUIAppEnum.h:127
const SUMOReal SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
Definition: StdDefs.h:54
void create()
Creates the widget (and the icons)
void clear()
Clears the list of selected objects.
FXToolBarShell * myToolBarDrag1
for some menu detaching fun
SUMOReal getSpeed() const
Returns the vehicle's current speed.
Definition: MSVehicle.h:294
int SUMOTime
Definition: SUMOTime.h:43
FXEX::FXThreadEvent myLoadThreadEvent
io-event with the load-thread
std::map< std::string, SUMOVehicle * >::const_iterator constVehIt
Definition of the internal vehicles map iterator.
void lock()
lock mutex
Definition: MFXMutex.cpp:86
FXEX::FXThreadEvent myRunThreadEvent
io-event with the run-thread
FXMDIClient * myMDIClient
The multi view panel.
send when a simulation has been loaded
Definition: GUIEvent.h:44
bool simulationAvailable() const
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:125
send when a warning occured
Definition: GUIEvent.h:53
FXToolBar * myToolBar1
The application tool bar.
long onCmdOpenNetwork(FXObject *, FXSelector, void *)
Called on menu File->Open Network.
long onUpdNeedsSimulation(FXObject *, FXSelector, void *)
Determines whether some buttons which require an active simulation may be shown.
SUMOTime getTimeStep() const
Returns the time step the simulation has ended at.
void setIncrements(FXdouble fine, FXdouble norm, FXdouble coarse)
Change all spinner increment.
#define SUMOReal
Definition: config.h:218
static const bool gUseMesoSim
Definition: MSGlobals.h:102
An XML-handler for visualisation schemes.
static std::string getStateMessage(SimulationState state)
Returns the message to show if a certain state occurs.
Definition: MSNet.cpp:520
constVehIt loadedVehEnd() const
Returns the end of the internal vehicle map.
static FXString getTitleText(const FXString &appname, FXString filename="")
Returns the title text in dependance to an optional file name.
Definition: MFXUtils.cpp:73
long onLoadThreadEvent(FXObject *, FXSelector, void *)
Called on an event from the loading thread.
virtual GUISUMOAbstractView * init(FXGLCanvas *share, GUINet &net, ViewType type)
"Initialises" this window by building the contents
#define DELTA_T
Definition: SUMOTime.h:50
Close simulation - ID.
Definition: GUIAppEnum.h:83
const MSEdge * getEdge() const
Returns the edge the vehicle is currently at.
The class responsible for building and deletion of vehicles.
void setText(FXString lbl)
manipulate text in LCD label
Definition: FXLCDLabel.cpp:154
GUIMessageWindow * myMessageWindow
A window to display messages, warnings and error in.
const SUMOTime myEnd
the time the simulation shall end with
virtual void begin()
void clear()
Clears the window.
bool myAmLoading
information whether the gui is currently loading and the load-options shall be greyed out ...
long onCmdTimeToggle(FXObject *, FXSelector, void *)
Called on "time toggle".
bool isOnRoad() const
Returns the information whether the vehicle is on a road (is simulated)
Definition: MSVehicle.h:339
void handleEvent_SimulationStep(GUIEvent *e)
Spinner control.
#define WRITE_MESSAGE(msg)
Definition: MsgHandler.h:201
FXEX::FXLCDLabel * myLCDLabel
the simulation step display
virtual void create()
GUISelectedStorage gSelected
A global holder of selected objects.
A logging window for the gui.
send when a simulation step has been performed
Definition: GUIEvent.h:47
long onUpdStep(FXObject *, FXSelector, void *)
Determines whether "step" is enabled.
static FXIcon * getIcon(GUIIcon which)
long onCmdQuit(FXObject *, FXSelector, void *)
Called by FOX if the application shall be closed.
Perform a single simulation step.
Definition: GUIAppEnum.h:97
virtual void addToWindowsMenu(FXMenuPane *)
long onUpdStart(FXObject *sender, FXSelector, void *ptr)
Determines whether "play" is enabled.
The main window of the SUMO-gui.