92 #ifdef CHECK_MEMORY_LEAKS 123 FXMAPFUNC(SEL_COMMAND,
MID_NEW_OSGVIEW, GUIApplicationWindow::onCmdNewOSG),
183 FXIMPLEMENT(
GUIApplicationWindow, FXMainWindow, GUIApplicationWindowMap, ARRAYNUMBER(GUIApplicationWindowMap))
194 const std::
string& configPattern)
196 myLoadThread(0), myRunThread(0),
198 myAlternateSimDelay(0),
199 myRecentNets(a, "nets"), myConfigPattern(configPattern),
200 hadDependentBuild(false),
201 myShowTimeAsHMS(false),
202 myAmFullScreen(false),
203 myHaveNotifiedAboutSimEnd(false),
206 myPreviousCollisionNumber(0),
227 LAYOUT_SIDE_TOP | LAYOUT_FILL_X | FRAME_RAISED);
238 myStatusbar =
new FXStatusBar(
this, LAYOUT_SIDE_BOTTOM | LAYOUT_FILL_X | FRAME_RAISED);
241 new FXHorizontalFrame(
myStatusbar, LAYOUT_FIX_WIDTH | LAYOUT_FILL_Y | LAYOUT_RIGHT | FRAME_SUNKEN,
242 0, 0, 20, 0, 0, 0, 0, 0, 0, 0);
243 myGeoCoordinate =
new FXLabel(
myGeoFrame,
"N/A\t\tOriginal coordinate (before coordinate transformation in NETCONVERT)", 0, LAYOUT_CENTER_Y);
245 new FXHorizontalFrame(
myStatusbar, LAYOUT_FIX_WIDTH | LAYOUT_FILL_Y | LAYOUT_RIGHT | FRAME_SUNKEN,
246 0, 0, 20, 0, 0, 0, 0, 0, 0, 0);
257 SPLITTER_REVERSED | SPLITTER_VERTICAL | LAYOUT_FILL_X | LAYOUT_FILL_Y | SPLITTER_TRACKING | FRAME_RAISED | FRAME_THICK);
259 LAYOUT_FILL_X | LAYOUT_FILL_Y | FRAME_SUNKEN | FRAME_THICK);
262 FXMDIClient::ID_MDI_MENUWINDOW, LAYOUT_LEFT);
264 FXMDIClient::ID_MDI_MENUCLOSE, FRAME_RAISED | LAYOUT_RIGHT);
266 FXMDIClient::ID_MDI_MENURESTORE, FRAME_RAISED | LAYOUT_RIGHT);
268 FXMDIClient::ID_MDI_MENUMINIMIZE, FRAME_RAISED | LAYOUT_RIGHT);
293 if (getApp()->reg().readIntEntry(
"SETTINGS",
"maximized", 0) == 0) {
294 setX(getApp()->reg().readIntEntry(
"SETTINGS",
"x", 150));
295 setY(getApp()->reg().readIntEntry(
"SETTINGS",
"y", 150));
296 setWidth(getApp()->reg().readIntEntry(
"SETTINGS",
"width", 600));
297 setHeight(getApp()->reg().readIntEntry(
"SETTINGS",
"height", 400));
299 gCurrentFolder = getApp()->reg().readStringEntry(
"SETTINGS",
"basedir",
"");
300 FXMainWindow::create();
318 FXint width = getApp()->getNormalFont()->getTextWidth(
"8", 1) * 24;
322 show(PLACEMENT_SCREEN);
323 if (getApp()->reg().readIntEntry(
"SETTINGS",
"maximized", 0) == 1) {
326 myShowTimeAsHMS = (getApp()->reg().readIntEntry(
"gui",
"timeasHMS", 0) == 1);
364 FXMainWindow::detach();
376 "&Open Simulation...\tCtrl+O\tOpen a simulation (Configuration file).",
379 "Open &Network...\tCtrl+N\tOpen a network.",
382 "Open Shapes \tCtrl+P\tLoad POIs and Polygons for visualization.",
385 "&Reload\tCtrl+R\tReloads the simulation / the network.",
389 "Close\tCtrl+W\tClose the simulation.",
392 FXMenuSeparator* sep1 =
new FXMenuSeparator(
myFileMenu);
394 sep1->setSelector(FXRecentFiles::ID_ANYFILES);
408 FXMenuSeparator* sep2 =
new FXMenuSeparator(
myFileMenu);
410 sep2->setSelector(FXRecentFiles::ID_ANYFILES);
426 "&Quit\tCtrl+Q\tQuit the Application.",
432 for (std::vector<std::string>::iterator it = vehicleClasses.begin(); it != vehicleClasses.end(); ++it) {
438 new FXMenuTitle(
myMenuBar,
"&Edit", NULL, myEditMenu);
439 new FXMenuCommand(myEditMenu,
440 "Edit Selected...\tCtrl+E\tOpens a dialog for editing the list of selected items.",
442 new FXMenuCascade(myEditMenu,
443 "Select lanes which allow...\t\tOpens a menu for selecting a vehicle class by which to selected lanes.",
445 new FXMenuSeparator(myEditMenu);
446 new FXMenuCommand(myEditMenu,
447 "Edit Breakpoints...\tCtrl+B\tOpens a dialog for editing breakpoints.",
449 new FXMenuSeparator(myEditMenu);
450 new FXMenuCommand(myEditMenu,
451 "Open in Netedit...\tCtrl+T\tOpens the netedit application with the current network.",
458 "Application Settings...\t\tOpen a Dialog for Application Settings editing.",
461 "Gaming Mode\tCtrl+G\tToggle gaming mode on/off.",
464 "Full Screen Mode\tCtrl+F\tToggle full screen mode on/off.",
470 "Locate &Junctions\t\tOpen a Dialog for Locating a Junction.",
473 "Locate &Edges\t\tOpen a Dialog for Locating an Edge.",
477 "Locate &Vehicles\t\tOpen a Dialog for Locating a Vehicle.",
481 "Locate &Persons\t\tOpen a Dialog for Locating a Person.",
484 "Locate &TLS\t\tOpen a Dialog for Locating a Traffic Light.",
487 "Locate &Additional\t\tOpen a Dialog for Locating an Additional Structure.",
490 "Locate P&oI\t\tOpen a Dialog for Locating a Point of Intereset.",
493 "Locate Po&lygon\t\tOpen a Dialog for Locating a Polygon.",
497 "Show Internal Structures\t\tShow internal junctions and streets in locator dialog.",
503 "Run\tCtrl+A\tStart running the simulation.",
506 "Stop\tCtrl+S\tStop running the simulation.",
509 "Step\tCtrl+D\tPerform one simulation step.",
516 "Show Status Line\t\tToggle the Status Bar on/off.",
519 "Show Message Window\t\tToggle the Message Window on/off.",
522 "Show Simulation Time\t\tToggle the Simulation Time on/off.",
525 "Show Simulation Delay\t\tToggle the Simulation Delay Entry on/off.",
542 sep1->setSelector(FXMDIClient::ID_MDI_ANY);
550 "Clear Message Window\t\tClear the message window.",
569 LAYOUT_DOCK_NEXT | LAYOUT_SIDE_TOP | FRAME_RAISED);
573 new FXButton(
myToolBar1,
"\t\tOpen a simulation (Configuration file).",
575 ICON_ABOVE_TEXT | BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
576 new FXButton(
myToolBar1,
"\t\tOpen a network.",
578 ICON_ABOVE_TEXT | BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
579 new FXButton(
myToolBar1,
"\t\tReloads the simulation / the network.",
581 ICON_ABOVE_TEXT | BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
587 LAYOUT_DOCK_SAME | LAYOUT_SIDE_TOP | FRAME_RAISED);
590 new FXButton(
myToolBar2,
"\t\tStart the loaded simulation.",
592 ICON_ABOVE_TEXT | BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
593 new FXButton(
myToolBar2,
"\t\tStop the running simulation.",
595 ICON_ABOVE_TEXT | BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
596 new FXButton(
myToolBar2,
"\t\tPerform a single simulation step.",
598 ICON_ABOVE_TEXT | BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
604 LAYOUT_DOCK_SAME | LAYOUT_SIDE_TOP | FRAME_RAISED);
608 BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
620 LAYOUT_DOCK_SAME | LAYOUT_SIDE_TOP | FRAME_RAISED | LAYOUT_FILL_Y);
624 BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
627 LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK | LAYOUT_FILL_Y);
637 LAYOUT_DOCK_SAME | LAYOUT_SIDE_TOP | FRAME_RAISED);
641 new FXButton(
myToolBar5,
"\t\tOpen a new microscopic view.",
643 ICON_ABOVE_TEXT | BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
645 new FXButton(
myToolBar5,
"\t\tOpen a new 3D view.",
647 ICON_ABOVE_TEXT | BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT);
656 new FXLabel(
myToolBar6,
"Waiting Time:\t\tTime spent waiting accumulated for all vehicles", 0, LAYOUT_TOP | LAYOUT_LEFT);
668 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);
682 getApp()->reg().writeIntEntry(
"SETTINGS",
"x", getX());
683 getApp()->reg().writeIntEntry(
"SETTINGS",
"y", getY());
684 getApp()->reg().writeIntEntry(
"SETTINGS",
"width", getWidth());
685 getApp()->reg().writeIntEntry(
"SETTINGS",
"height", getHeight());
687 getApp()->reg().writeStringEntry(
"SETTINGS",
"basedir",
gCurrentFolder.text());
688 getApp()->reg().writeIntEntry(
"SETTINGS",
"maximized", isMaximized() ? 1 : 0);
689 getApp()->reg().writeIntEntry(
"gui",
"timeasHMS",
myShowTimeAsHMS ? 1 : 0);
698 FXMenuCommand* mc =
dynamic_cast<FXMenuCommand*
>(menu);
699 if (mc->getText() ==
"Edit Selected...") {
708 const std::vector<MSLane*>& lanes = (*i)->getLanes();
709 for (std::vector<MSLane*>::const_iterator it = lanes.begin(); it != lanes.end(); ++it) {
752 FXRegistry reg(
"Netedit",
"DLR");
759 std::string netedit =
"netedit";
760 const char* sumoPath = getenv(
"SUMO_HOME");
762 std::string newPath = std::string(sumoPath) +
"/bin/netedit";
764 netedit =
"\"" + newPath +
"\"";
773 cmd =
"start /B \"\" " + cmd;
785 FXFileDialog opendialog(
this,
"Open Simulation Configuration");
787 opendialog.setSelectMode(SELECTFILE_EXISTING);
792 if (opendialog.execute()) {
794 std::string file = opendialog.getFilename().text();
805 FXFileDialog opendialog(
this,
"Open Network");
807 opendialog.setSelectMode(SELECTFILE_EXISTING);
808 opendialog.setPatternList(
"SUMO nets (*.net.xml)\nAll files (*)");
812 if (opendialog.execute()) {
814 std::string file = opendialog.getFilename().text();
825 FXFileDialog opendialog(
this,
"Open Shapes");
827 opendialog.setSelectMode(SELECTFILE_EXISTING);
828 opendialog.setPatternList(
"Additional files (*.xml)\nAll files (*)");
832 if (opendialog.execute()) {
834 std::string file = opendialog.getFilename().text();
847 getApp()->beginWaitCursor();
860 myStatusbar->getStatusLine()->setText(
"Already loading!");
863 std::string file((
const char*)data);
879 myAmLoading ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
889 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
898 myAmLoading ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
908 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
918 myStatusbar->getStatusLine()->setText(
"No simulation loaded!");
927 getApp()->forceRefresh();
935 getApp()->forceRefresh();
944 myStatusbar->getStatusLine()->setText(
"No simulation loaded!");
987 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
997 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1005 sender->handle(
this,
1007 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1015 sender->handle(
this,
1017 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
1049 d->show(PLACEMENT_OWNER);
1099 getApp()->reg().writeIntEntry(
"SETTINGS",
"x", getX());
1100 getApp()->reg().writeIntEntry(
"SETTINGS",
"y", getY());
1101 getApp()->reg().writeIntEntry(
"SETTINGS",
"width", getWidth());
1102 getApp()->reg().writeIntEntry(
"SETTINGS",
"height", getHeight());
1104 setDecorations(DECOR_NONE);
1105 place(PLACEMENT_MAXIMIZED);
1124 place(PLACEMENT_VISIBLE);
1125 setDecorations(DECOR_ALL);
1130 setWidth(getApp()->reg().readIntEntry(
"SETTINGS",
"width", 600));
1131 setHeight(getApp()->reg().readIntEntry(
"SETTINGS",
"height", 400));
1132 setX(getApp()->reg().readIntEntry(
"SETTINGS",
"x", 150));
1133 setY(getApp()->reg().readIntEntry(
"SETTINGS",
"y", 150));
1155 GUIApplicationWindow::onCmdNewOSG(FXObject*, FXSelector,
void*) {
1167 about->show(PLACEMENT_OWNER);
1173 FXEvent*
event = (FXEvent*)ptr;
1175 setDNDData(FROM_CLIPBOARD, event->target,
string);
1237 if (ec->
myNet == 0) {
1274 std::string settingsName = settings.
addSettings(view);
1297 setTitle(
"SUMO Interactive Traffic Light");
1305 (*it)->setText(
"-");
1309 getApp()->endWaitCursor();
1324 if (backlog > running) {
1350 getApp()->forceRefresh();
1380 "\nDo you want to close all open files and views?";
1381 FXuint answer = FXMessageBox::question(
this, MBOX_YES_NO,
"Simulation ended",
"%s", text.c_str());
1408 #ifdef HAVE_DANGEROUS_SOUNDS // disable user-configurable command execution for public build 1411 for (; it != end; ++it) {
1456 getApp()->beginWaitCursor();
1469 myStatusbar->getStatusLine()->setText(
"No simulation loaded!");
1480 FXuint opts = MDI_TRACKING;
1516 (*it)->setText(
"-");
1557 return getApp()->getDefaultCursor(DEF_ARROW_CURSOR);
1575 myStatusbar->getStatusLine()->setText(text.c_str());
1576 myStatusbar->getStatusLine()->setNormalText(text.c_str());
1602 const bool hideFraction =
myAmGaming || fmod(
TS, 1.) == 0.;
1603 const int BuffSize = 100;
1604 char buffer[BuffSize];
1606 const int hours = (int)fracSeconds / 3600;
1607 const int minutes = ((int)fracSeconds % 3600) / 60;
1608 fracSeconds = fracSeconds - 3600 * hours - 60 * minutes;
1609 const std::string format = (hideFraction ?
1610 "%02d-%02d-%02.0f" :
"%02d-%02d-%06.3f");
1611 snprintf(buffer, BuffSize, format.c_str(), hours, minutes, fracSeconds);
1613 const std::string format = (hideFraction ?
1614 "%13.0f" :
"%13.3f");
1615 snprintf(buffer, BuffSize, format.c_str(), fracSeconds);
1623 const long handled = FXMainWindow::onKeyPress(o, sel, data);
1624 if (handled == 0 &&
myMDIClient->numChildren() > 0) {
1636 const long handled = FXMainWindow::onKeyRelease(o, sel, data);
1637 if (handled == 0 &&
myMDIClient->numChildren() > 0) {
std::vector< FXMainWindow * > myTrackerWindows
Event sent when the the simulation is over.
RandomDistributor< std::string > myJamSounds
FXLabel * myGeoCoordinate
GUISUMOAbstractView * getView() const
long onCmdShowStats(FXObject *, FXSelector, void *)
Called on commands from the statistic buttons.
virtual ~GUIApplicationWindow()
Destructor.
GUILoadThread * myLoadThread
GUICompleteSchemeStorage gSchemeStorage
int getRunningNumber() const
Returns the number of build and inserted, but not yet deleted transportables.
long onCmdStep(FXObject *, FXSelector, void *)
Called on "step".
static std::string clipped
Representation of a vehicle in the micro simulation.
void handleEvent_SimulationLoaded(GUIEvent *e)
SUMOReal getMaxSpeed() const
Get vehicle's maximum speed [m/s].
long onCmdReload(FXObject *, FXSelector, void *)
Called on reload.
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.
send when a message occured
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...
static bool isReadable(std::string path)
Checks whether the given file is readable.
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.
constVehIt loadedVehBegin() const
Returns the begin of the internal vehicle map.
bool gaming
whether the application is in gaming mode or not
bool hasPersons() const
Returns whether persons are simulated.
Gaming mode - menu entry.
const bool myOsgView
whether to load the OpenSceneGraph view
Loads a file previously loaded.
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.
void addRecentFile(const FX::FXString &f, const bool isNet)
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.
void setNumberFormat(FXint prec, FXbool bExp=FALSE)
virtual bool simulationIsStartable() const
static bool gRunAfterLoad
the simulation shall start direct after loading
std::string time2string(SUMOTime t)
void setToolBarVisibility(const bool value)
about toggled gaming status
int myViewNumber
The current view number.
Edit simulation breakpoints.
virtual void detach()
Detaches the tool/menu bar.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Editor for the list of chosen objects.
int getCollisionCount() const
return the number of collisions
void setThickness(const FXint width)
set/get segment width - must be less than half the segment length
FXMenuPane * myLocatorMenu
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".
FXMutex myEventMutex
the mutex for the waiting semaphore
const std::vector< SUMOTime > & getBreakpoints() const
Returns the parsed breakpoints.
toogle delay between alternative value
long onCmdNetedit(FXObject *, FXSelector, void *)
Called on menu Edit->Netedit.
FXString gCurrentFolder
The folder used as last.
void handleEvent_Screenshot(GUIEvent *e)
virtual void copyViewportTo(GUISUMOAbstractView *view)
copy the viewport to the given view
void loadConfigOrNet(const std::string &file, bool isNet)
Open a new microscopic 3D view.
void show()
sets the focus after the window is created
Reload the previously loaded simulation.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
bool isGaming() const
return whether the gui is in gaming mode
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.
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)
static bool gDemoAutoReload
the simulation shall reload when it has ended (demo)
GUIGlID getGlID() const
Returns the numerical id of the object.
long onUpdOpen(FXObject *, FXSelector, void *)
Determines whether opening is enabled.
long onCmdHelp(FXObject *sender, FXSelector sel, void *ptr)
called if the user selects help->Documentation
int getWaitingVehicleNo() const
Returns the number of waiting vehicles.
virtual FXGLCanvas * getBuildGLCanvas() const
const std::vector< GUISUMOAbstractView::Decal > & getDecals() const
Returns the parsed decals.
void addDecals(const std::vector< Decal > &decals)
add decals
#define WRITE_WARNING(msg)
FXToolBarShell * myToolBarDrag2
void setFgColor(FXColor clr)
set/get forground color
static OptionsCont & getOptions()
Retrieves the options.
void checkGamingEvents()
handles additional game-related events
FXMenuPane * myFileMenu
the submenus
void setActive(int scheme)
void addSeparator()
Adds a a separator to this log window.
std::vector< SUMOTime > & getBreakpoints()
virtual void create()
Creates the main window (required by FOX)
Representation of a lane in the micro simulation (gui-version)
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
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)
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
Editor for simulation breakpoints.
const std::string myFile
the name of the file to save to
Locate addtional structure - button.
bool myAmGaming
information whether the gui is currently in gaming mode
static FXint fxexecute(FXString link)
bool myShowTimeAsHMS
whether to show time as hour:minute:second
void handleEvent_Message(GUIEvent *e)
std::vector< FXMDIChild * > mySubWindows
static void clearTextures()
clears loaded textures
GUIEventType getOwnType() const
returns the event type
long onCmdOpenRecent(FXObject *, FXSelector, void *)
Called on opening a recent file.
static const RGBColor GREEN
An error occured during the simulation step.
long onKeyPress(FXObject *o, FXSelector sel, void *data)
handle keys
Locator configuration - menu entry.
void updateTimeLCD(SUMOTime time)
updates the simulation time display
void setRange(FXdouble lo, FXdouble hi)
Change the spinner's range.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
FXCondition myEventCondition
the semaphore when waiting for event completion
void handleEvent_SimulationEnded(GUIEvent *e)
FXdouble getValue() const
Return current value.
bool myHaveNotifiedAboutSimEnd
whether the simulation end was already announced
virtual SUMOReal getXPos() const =0
Returns the x-offset of the field to show stored in this changer.
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)
long onCmdEditBreakpoints(FXObject *, FXSelector, void *)
Called on menu Edit->Edit Breakpoints.
void applyViewport(GUISUMOAbstractView *view) const
Sets the viewport which has been parsed.
static GUINet * getGUIInstance()
Returns the pointer to the unique instance of GUINet (singleton).
SUMOReal getJamSoundTime()
SUMOReal myJamSoundTime
waiting time after which vehicles trigger jam sounds
std::vector< FXButton * > myStatButtons
Buttons showing and running values and triggering statistic windows.
long onCmdStart(FXObject *, FXSelector, void *)
Called on "play".
ShapeContainer & getShapeContainer()
Returns the shapes container.
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
int myPreviousCollisionNumber
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
The Simulation delay control.
FXMenuPane * mySettingsMenu
The Simulation execution thread.
static void init(FXApp *a)
Initiate GUIIconSubSys.
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
FXToolBarShell * myMenuBarDrag
SUMOTime getCurrentSimTime() const
ViewType
Available view types.
virtual void eventOccured()
GUIRunThread * myRunThread
long onCmdListInternal(FXObject *, FXSelector, void *)
Toggle listing of internal structures.
long onUpdReload(FXObject *, FXSelector, void *)
Determines whether reloading is enabled.
long onCmdDelayToggle(FXObject *, FXSelector, void *)
Called on "delay toggle".
const std::string myFile
the name of the loaded file
FXToolBarShell * myToolBarDrag3
int getRunningVehicleNo() const
Returns the number of build and inserted, but not yet deleted vehicles.
The application's "About" - dialog.
bool myAmFullScreen
whether to show the window in full screen mode
Locate junction - button.
long onCmdAbout(FXObject *, FXSelector, void *)
Shows the about dialog.
const std::string & getFileName() const
FXCursor * getDefaultCursor()
long onCmdClose(FXObject *, FXSelector, void *)
Called on menu File->Close.
send when a error occured
Send when a screenshot is requested; View and file name are stored within the event.
bool hasContainers() const
Returns whether containers are simulated.
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
SVCPermissions getPermissions() const
Returns the vehicle class permissions for this lane.
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
Load additional file with poi and polygons.
void setTarget(FXObject *tgt)
set the target
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)
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...
Send when the simulation is over; The reason and the time step are stored within the event...
long onCmdClearMsgWindow(FXObject *, FXSelector, void *)
Called if the message window shall be cleared.
std::string makeSnapshot(const std::string &destFile)
Takes a snapshots and writes it into the given file.
FXMenuPane * mySelectByPermissions
FXMutex & getBreakpointLock()
MSTransportableControl & getPersonControl()
Returns the person control.
virtual void fillMenuBar()
Builds the menu bar.
virtual SUMOReal getZPos() const =0
Returns the camera height corresponding to the current zoom factor.
Application settings - menu entry.
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
long onCmdGaming(FXObject *, FXSelector, void *)
Toggle gaming mode.
FXStatusBar * myStatusbar
The status bar.
void unlock()
release mutex lock
FXMenuBar * myMenuBar
The application menu bar.
FXMenuPane * myWindowsMenu
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.
GUISUMOAbstractView *const myView
the view to save
FXToolBarShell * myToolBarDrag6
static const RGBColor RED
RandomDistributor< std::string > myCollisionSounds
void saveViewport(const SUMOReal x, const SUMOReal y, const SUMOReal z)
Makes the given viewport the default.
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.
void setGroove(const FXint width)
set/get groove width - must be less than segment width
FXLabel * myCartesianCoordinate
Labels for the current cartesian and geo-coordinate.
void prepareDestruction()
FXDEFMAP(GUIApplicationWindow) GUIApplicationWindowMap[]
MFXMutex myTrackerLock
A lock to make the removal and addition of trackers secure.
virtual void sendBlockingEvent(GUIEvent *event)
Sends an event from the application thread to the GUI and waits until it is handled.
void setSelector(FXSelector sel)
set the selector
MSInsertionControl & getInsertionControl()
Returns the insertion control.
MFXEventQue< GUIEvent * > myEvents
List of got requests.
static const MSEdgeVector & getAllEdges()
Returns all edges with a numerical id.
static void close()
close GUIIconSubSys
Fullscreen mode - menu entry.
long onUpdAddView(FXObject *, FXSelector, void *)
Determines whether adding a view is enabled.
SUMOTime getSimEndTime() const
long onCmdLocate(FXObject *, FXSelector, void *)
Called on menu commands from the Locator menu.
FXEX::FXLCDLabel * myTimeLossLabel
FXRealSpinDial * mySimDelayTarget
FXHorizontalFrame * myGeoFrame
Open a new microscopic view.
void setStatusBarText(const std::string &text)
Locate polygons - button.
FXRecentFiles myRecentConfigs
List of recent config files.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
Open editor for selections.
const SUMOReal SUMO_const_haltingSpeed
the speed threshold at which vehicles are considered as halting
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.
FXEX::FXThreadEvent myLoadThreadEvent
io-event with the load-thread
std::map< std::string, SUMOVehicle * >::const_iterator constVehIt
Definition of the internal vehicles map iterator.
FXEX::FXThreadEvent myRunThreadEvent
io-event with the run-thread
FXMDIClient * myMDIClient
The multi view panel.
send when a simulation has been loaded
bool simulationAvailable() const
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
GUIPerspectiveChanger & getChanger() const
get changer
send when a warning occured
FXToolBar * myToolBar1
The application tool bar.
long onCmdOpenNetwork(FXObject *, FXSelector, void *)
Called on menu File->Open Network.
GUIVisualizationSettings * getVisualisationSettings() const
get visualitation settings
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.
An XML-handler for visualisation schemes.
static std::string getStateMessage(SimulationState state)
Returns the message to show if a certain state occurs.
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.
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
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
GUIMessageWindow * myMessageWindow
A window to display messages, warnings and error in.
const SUMOTime myEnd
the time the simulation shall end with
void clear()
Clears the window.
virtual SUMOReal getYPos() const =0
Returns the y-offset of the field to show stored in this changer.
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)
long onKeyPress(FXObject *o, FXSelector sel, void *data)
handle keys
void handleEvent_SimulationStep(GUIEvent *e)
#define WRITE_MESSAGE(msg)
FXEX::FXLCDLabel * myLCDLabel
the simulation step display
FXMenuPane * myControlMenu
GUISelectedStorage gSelected
A global holder of selected objects.
A logging window for the gui.
send when a simulation step has been performed
long onUpdStep(FXObject *, FXSelector, void *)
Determines whether "step" is enabled.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
long onCmdQuit(FXObject *, FXSelector, void *)
Called by FOX if the application shall be closed.
GUINet * myNet
the loaded net
Perform a single simulation step.
send when a status change occured
virtual void addToWindowsMenu(FXMenuPane *)
long onUpdStart(FXObject *sender, FXSelector, void *ptr)
Determines whether "play" is enabled.
MSTransportableControl & getContainerControl()
Returns the container control.
The main window of the SUMO-gui.