Eclipse SUMO - Simulation of Urban MObility
GUILoadThread Class Reference

#include <GUILoadThread.h>

Inheritance diagram for GUILoadThread:
[legend]
Collaboration diagram for GUILoadThread:
[legend]

Public Types

enum  { ID_THREAD_EVENT }
 FOX declaration. More...
 

Public Member Functions

const std::string & getFileName () const
 
 GUILoadThread (FXApp *app, GUIApplicationWindow *mw, MFXSynchQue< GUIEvent * > &eq, FXEX::MFXThreadEvent &ev, const bool isLibsumo)
 constructor More...
 
void loadConfigOrNet (const std::string &file)
 begins the loading of the given file More...
 
long onThreadEvent (FXObject *, FXSelector, void *)
 
long onThreadSignal (FXObject *, FXSelector, void *)
 
void retrieveMessage (const MsgHandler::MsgType type, const std::string &msg)
 Retrieves messages from the loading module. More...
 
FXint run ()
 
void signal ()
 
void signal (FXuint seltype)
 
virtual ~GUILoadThread ()
 destructor More...
 

Static Public Member Functions

static void sleep (long ms)
 

Protected Member Functions

void submitEndAndCleanup (GUINet *net, const SUMOTime simStartTime, const SUMOTime simEndTime, const std::vector< std::string > &guiSettingsFiles=std::vector< std::string >(), const bool osgView=false, const bool viewportFromRegistry=false)
 Closes the loading process. More...
 

Protected Attributes

const bool myAmLibsumo
 whether we are running in libsumo More...
 
FXApp * myApp = nullptr
 pointer to APP More...
 
MFXInterThreadEventClientmyClient = nullptr
 thread client More...
 
OutputDevicemyErrorRetriever
 The instances of message retriever encapsulations Needed to be deleted from the handler later on. More...
 
MFXSynchQue< GUIEvent * > & myEventQue
 
FXEX::MFXThreadEventmyEventThrow
 
std::string myFile
 the path to load the simulation from More...
 
OutputDevicemyMessageRetriever
 
GUIApplicationWindowmyParent
 the parent window to inform about the loading More...
 
std::string myTitle
 the title string for the application More...
 
OutputDevicemyWarningRetriever
 

Private Attributes

FXEX::MFXThreadEventHandle event
 event More...
 

Detailed Description

Definition at line 47 of file GUILoadThread.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited

FOX declaration.

Enumerator
ID_THREAD_EVENT 

Definition at line 37 of file MFXSingleEventThread.h.

Constructor & Destructor Documentation

◆ GUILoadThread()

GUILoadThread::GUILoadThread ( FXApp *  app,
GUIApplicationWindow mw,
MFXSynchQue< GUIEvent * > &  eq,
FXEX::MFXThreadEvent ev,
const bool  isLibsumo 
)

◆ ~GUILoadThread()

GUILoadThread::~GUILoadThread ( )
virtual

destructor

Definition at line 77 of file GUILoadThread.cpp.

References myErrorRetriever, myMessageRetriever, and myWarningRetriever.

Member Function Documentation

◆ getFileName()

const std::string & GUILoadThread::getFileName ( ) const

Definition at line 275 of file GUILoadThread.cpp.

References myFile.

Referenced by GUIApplicationWindow::onUpdReload().

Here is the caller graph for this function:

◆ loadConfigOrNet()

void GUILoadThread::loadConfigOrNet ( const std::string &  file)

begins the loading of the given file

Definition at line 257 of file GUILoadThread.cpp.

References myFile, and OptionsIO::setArgs().

Referenced by GUIApplicationWindow::loadConfigOrNet().

Here is the caller graph for this function:

◆ onThreadEvent()

long MFXSingleEventThread::onThreadEvent ( FXObject *  ,
FXSelector  ,
void *   
)
inherited

Definition at line 128 of file MFXSingleEventThread.cpp.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onThreadSignal()

long MFXSingleEventThread::onThreadSignal ( FXObject *  ,
FXSelector  ,
void *   
)
inherited

Definition at line 113 of file MFXSingleEventThread.cpp.

References PIPE_READ, FXEX::SEL_THREAD, and UNUSED_PARAMETER.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ retrieveMessage()

void GUILoadThread::retrieveMessage ( const MsgHandler::MsgType  type,
const std::string &  msg 
)

Retrieves messages from the loading module.

Definition at line 267 of file GUILoadThread.cpp.

References myEventQue, myEventThrow, MFXSynchQue< T, Container >::push_back(), and FXEX::MFXThreadEvent::signal().

Referenced by GUILoadThread().

Here is the caller graph for this function:

◆ run()

FXint GUILoadThread::run ( )
virtual

starts the thread the thread ends after the net has been loaded

Reimplemented from MFXSingleEventThread.

Definition at line 85 of file GUILoadThread.cpp.

References GUIApplicationWindow::addRecentConfig(), GUIApplicationWindow::addRecentNetwork(), MsgHandler::addRetriever(), GUITexturesHelper::allowTextures(), NLBuilder::build(), MSFrame::checkOptions(), OptionsCont::clear(), MsgHandler::clear(), MSNet::clearAll(), libsumo::CMD_GET_GUI_VARIABLE, libsumo::CMD_SET_GUI_VARIABLE, MSFrame::fillOptions(), GUIGlobals::gDemoAutoReload, OptionsCont::getBool(), OutputDevice::getDevice(), MsgHandler::getErrorInstance(), MsgHandler::getMessageInstance(), OptionsCont::getOptions(), OptionsIO::getOptions(), OptionsIO::getRoot(), OptionsCont::getString(), OptionsCont::getStringVector(), MsgHandler::getWarningInstance(), GUIGlobals::gQuitOnEnd, GUIGlobals::gRunAfterLoad, GUIGlobals::gTrackerInterval, MSGlobals::gUseMesoSim, MsgHandler::inform(), GUINet::initGUIStructures(), MsgHandler::initOutputOptions(), NLBuilder::initRandomness(), OptionsCont::isDefault(), OptionsCont::isSet(), OptionsCont::isUsableFileList(), OptionsIO::loadConfiguration(), GUINet::loadEdgeData(), myAmLibsumo, myErrorRetriever, myEventQue, myEventThrow, myFile, myMessageRetriever, myParent, myTitle, myWarningRetriever, TraCIServer::openSocket(), TraCIServerAPI_GUI::processGet(), TraCIServerAPI_GUI::processSet(), MFXSynchQue< T, Container >::push_back(), libsumo::Helper::registerStateListener(), MsgHandler::removeRetriever(), OptionsCont::resetWritable(), OptionsCont::setByRootElement(), OptionsCont::setDefault(), NLTriggerBuilder::setHandler(), MSFrame::setMSGlobals(), XMLSubSys::setValidation(), FXEX::MFXThreadEvent::signal(), STEPS2TIME, string2time(), submitEndAndCleanup(), TL, GUIVisualizationSettings::UseMesoSim, WRITE_ERROR, and WRITE_ERRORF.

◆ signal() [1/2]

void MFXSingleEventThread::signal ( )
inherited

Definition at line 89 of file MFXSingleEventThread.cpp.

References PIPE_WRITE, FXEX::SEL_THREAD, and UNUSED_PARAMETER.

◆ signal() [2/2]

void MFXSingleEventThread::signal ( FXuint  seltype)
inherited

Definition at line 101 of file MFXSingleEventThread.cpp.

References PIPE_WRITE, and UNUSED_PARAMETER.

◆ sleep()

void MFXSingleEventThread::sleep ( long  ms)
staticinherited

Definition at line 142 of file MFXSingleEventThread.cpp.

Referenced by GUIRunThread::deleteSim(), GUIApplicationWindow::loadOnStartup(), GUISUMOAbstractView::makeSnapshot(), and GUIRunThread::tryStep().

Here is the caller graph for this function:

◆ submitEndAndCleanup()

void GUILoadThread::submitEndAndCleanup ( GUINet net,
const SUMOTime  simStartTime,
const SUMOTime  simEndTime,
const std::vector< std::string > &  guiSettingsFiles = std::vector<std::string>(),
const bool  osgView = false,
const bool  viewportFromRegistry = false 
)
protected

Closes the loading process.

This method is called both on success and failure. All message callbacks to this instance are removed and the parent application is informed about the loading

Definition at line 239 of file GUILoadThread.cpp.

References MsgHandler::getErrorInstance(), MsgHandler::getMessageInstance(), MsgHandler::getWarningInstance(), myErrorRetriever, myEventQue, myEventThrow, myMessageRetriever, myTitle, myWarningRetriever, MFXSynchQue< T, Container >::push_back(), MsgHandler::removeRetriever(), and FXEX::MFXThreadEvent::signal().

Referenced by run().

Here is the caller graph for this function:

Field Documentation

◆ event

FXEX::MFXThreadEventHandle MFXSingleEventThread::event
privateinherited

event

Definition at line 72 of file MFXSingleEventThread.h.

◆ myAmLibsumo

const bool GUILoadThread::myAmLibsumo
protected

whether we are running in libsumo

Definition at line 98 of file GUILoadThread.h.

Referenced by run().

◆ myApp

FXApp* MFXSingleEventThread::myApp = nullptr
protectedinherited

pointer to APP

Definition at line 65 of file MFXSingleEventThread.h.

Referenced by GUIRunThread::run().

◆ myClient

MFXInterThreadEventClient* MFXSingleEventThread::myClient = nullptr
protectedinherited

thread client

Definition at line 68 of file MFXSingleEventThread.h.

◆ myErrorRetriever

OutputDevice* GUILoadThread::myErrorRetriever
protected

The instances of message retriever encapsulations Needed to be deleted from the handler later on.

Definition at line 91 of file GUILoadThread.h.

Referenced by GUILoadThread(), run(), submitEndAndCleanup(), and ~GUILoadThread().

◆ myEventQue

MFXSynchQue<GUIEvent*>& GUILoadThread::myEventQue
protected

Definition at line 93 of file GUILoadThread.h.

Referenced by retrieveMessage(), run(), and submitEndAndCleanup().

◆ myEventThrow

FXEX::MFXThreadEvent& GUILoadThread::myEventThrow
protected

Definition at line 95 of file GUILoadThread.h.

Referenced by retrieveMessage(), run(), and submitEndAndCleanup().

◆ myFile

std::string GUILoadThread::myFile
protected

the path to load the simulation from

Definition at line 84 of file GUILoadThread.h.

Referenced by getFileName(), loadConfigOrNet(), and run().

◆ myMessageRetriever

OutputDevice * GUILoadThread::myMessageRetriever
protected

Definition at line 91 of file GUILoadThread.h.

Referenced by GUILoadThread(), run(), submitEndAndCleanup(), and ~GUILoadThread().

◆ myParent

GUIApplicationWindow* GUILoadThread::myParent
protected

the parent window to inform about the loading

Definition at line 81 of file GUILoadThread.h.

Referenced by run().

◆ myTitle

std::string GUILoadThread::myTitle
protected

the title string for the application

Definition at line 87 of file GUILoadThread.h.

Referenced by run(), and submitEndAndCleanup().

◆ myWarningRetriever

OutputDevice * GUILoadThread::myWarningRetriever
protected

Definition at line 91 of file GUILoadThread.h.

Referenced by GUILoadThread(), run(), submitEndAndCleanup(), and ~GUILoadThread().


The documentation for this class was generated from the following files: