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 }
 

Public Member Functions

const std::string & getFileName () const
 
 GUILoadThread (FXApp *app, GUIApplicationWindow *mw, FXSynchQue< GUIEvent * > &eq, FXEX::FXThreadEvent &ev)
 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

OutputDevicemyErrorRetriever
 The instances of message retriever encapsulations Needed to be deleted from the handler later on. More...
 
FXSynchQue< GUIEvent * > & myEventQue
 
FXEX::FXThreadEventmyEventThrow
 
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::FXThreadEventHandle event
 
FXApp * myApp
 
MFXInterThreadEventClientmyClient
 

Detailed Description

Definition at line 47 of file GUILoadThread.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited
Enumerator
ID_THREAD_EVENT 

Definition at line 44 of file FXSingleEventThread.h.

Constructor & Destructor Documentation

◆ GUILoadThread()

◆ ~GUILoadThread()

GUILoadThread::~GUILoadThread ( )
virtual

destructor

Definition at line 76 of file GUILoadThread.cpp.

References myErrorRetriever, myMessageRetriever, and myWarningRetriever.

Member Function Documentation

◆ getFileName()

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

Definition at line 265 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 247 of file GUILoadThread.cpp.

References myFile, and OptionsIO::setArgs().

Referenced by GUIApplicationWindow::loadConfigOrNet().

Here is the caller graph for this function:

◆ onThreadEvent()

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

Definition at line 130 of file FXSingleEventThread.cpp.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onThreadSignal()

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

Definition at line 115 of file FXSingleEventThread.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 257 of file GUILoadThread.cpp.

References myEventQue, myEventThrow, FXSynchQue< T, Container >::push_back(), and FXEX::FXThreadEvent::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 FXSingleEventThread.

Definition at line 84 of file GUILoadThread.cpp.

References GUIApplicationWindow::addRecentFile(), 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(), OptionsCont::getFloat(), 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(), myErrorRetriever, myEventQue, myEventThrow, myFile, myMessageRetriever, myParent, myTitle, myWarningRetriever, TraCIServer::openSocket(), TraCIServerAPI_GUI::processGet(), TraCIServerAPI_GUI::processSet(), FXSynchQue< T, Container >::push_back(), MsgHandler::removeRetriever(), OptionsCont::resetWritable(), OptionsCont::set(), OptionsCont::setByRootElement(), NLTriggerBuilder::setHandler(), MSFrame::setMSGlobals(), XMLSubSys::setValidation(), FXEX::FXThreadEvent::signal(), string2time(), submitEndAndCleanup(), GUIVisualizationSettings::UseMesoSim, and WRITE_ERROR.

◆ signal() [1/2]

void FXSingleEventThread::signal ( )
inherited

Definition at line 91 of file FXSingleEventThread.cpp.

References PIPE_WRITE, FXEX::SEL_THREAD, and UNUSED_PARAMETER.

◆ signal() [2/2]

void FXSingleEventThread::signal ( FXuint  seltype)
inherited

Definition at line 103 of file FXSingleEventThread.cpp.

References PIPE_WRITE, and UNUSED_PARAMETER.

◆ sleep()

void FXSingleEventThread::sleep ( long  ms)
staticinherited

Definition at line 144 of file FXSingleEventThread.cpp.

Referenced by GUISUMOAbstractView::makeSnapshot(), and GUIRunThread::run().

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 229 of file GUILoadThread.cpp.

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

Referenced by run().

Here is the caller graph for this function:

Field Documentation

◆ event

FXEX::FXThreadEventHandle FXSingleEventThread::event
privateinherited

Definition at line 37 of file FXSingleEventThread.h.

◆ myApp

FXApp* FXSingleEventThread::myApp
privateinherited

Definition at line 68 of file FXSingleEventThread.h.

◆ myClient

MFXInterThreadEventClient* FXSingleEventThread::myClient
privateinherited

Definition at line 69 of file FXSingleEventThread.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

FXSynchQue<GUIEvent*>& GUILoadThread::myEventQue
protected

Definition at line 93 of file GUILoadThread.h.

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

◆ myEventThrow

FXEX::FXThreadEvent& 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: