![]() |
Eclipse SUMO - Simulation of Urban MObility
|
#include <GNELoadThread.h>
Public Types | |
enum | { ID_THREAD_EVENT } |
FOX declaration. More... | |
Public Member Functions | |
GNELoadThread (FXApp *app, MFXInterThreadEventClient *mw, MFXSynchQue< GUIEvent * > &eq, FXEX::MFXThreadEvent &ev) | |
constructor More... | |
void | loadConfigOrNet (const std::string &file, const bool isNet, const bool useStartupOptions, const bool newNet=false) |
begins the loading of a netconvert configuration or a a network 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 () |
starts the thread. The thread ends after the net has been loaded More... | |
void | signal () |
void | signal (FXuint seltype) |
virtual | ~GNELoadThread () |
destructor More... | |
Static Public Member Functions | |
static void | fillOptions (OptionsCont &oc) |
clears and initializes the OptionsCont More... | |
static void | setDefaultOptions (OptionsCont &oc) |
sets required options for proper functioning More... | |
static void | sleep (long ms) |
Protected Member Functions | |
bool | initOptions () |
init options More... | |
void | submitEndAndCleanup (GNENet *net, const bool newNet=false, const std::string &guiSettingsFile="", const bool viewportFromRegistry=false) |
Closes the loading process. More... | |
Protected Attributes | |
FXApp * | myApp = nullptr |
pointer to APP More... | |
MFXInterThreadEventClient * | myClient = nullptr |
thread client More... | |
OutputDevice * | myDebugRetriever |
OutputDevice * | myErrorRetriever |
The instances of message retriever encapsulations Needed to be deleted from the handler later on. More... | |
MFXSynchQue< GUIEvent * > & | myEventQue |
event Queue More... | |
FXEX::MFXThreadEvent & | myEventThrow |
event throw More... | |
std::string | myFile |
the path to load the network from More... | |
OutputDevice * | myGLDebugRetriever |
bool | myLoadNet = false |
Information whether only the network shall be loaded. More... | |
OutputDevice * | myMessageRetriever |
bool | myNewNet = false |
if true, a new net is created More... | |
MFXInterThreadEventClient * | myParent |
the parent window to inform about the loading More... | |
OutputDevice * | myWarningRetriever |
Private Attributes | |
FXEX::MFXThreadEventHandle | event |
event More... | |
Definition at line 43 of file GNELoadThread.h.
|
inherited |
GNELoadThread::GNELoadThread | ( | FXApp * | app, |
MFXInterThreadEventClient * | mw, | ||
MFXSynchQue< GUIEvent * > & | eq, | ||
FXEX::MFXThreadEvent & | ev | ||
) |
constructor
Definition at line 41 of file GNELoadThread.cpp.
References MsgHandler::addRetriever(), MsgHandler::getErrorInstance(), MsgHandler::MT_DEBUG, MsgHandler::MT_ERROR, MsgHandler::MT_GLDEBUG, MsgHandler::MT_MESSAGE, MsgHandler::MT_WARNING, myDebugRetriever, myErrorRetriever, myGLDebugRetriever, myMessageRetriever, myWarningRetriever, and retrieveMessage().
|
virtual |
destructor
Definition at line 53 of file GNELoadThread.cpp.
References myDebugRetriever, myErrorRetriever, myGLDebugRetriever, myMessageRetriever, and myWarningRetriever.
|
static |
clears and initializes the OptionsCont
Definition at line 201 of file GNELoadThread.cpp.
References OptionsCont::addCallExample(), SystemFrame::addConfigurationOptions(), OptionsCont::addDescription(), OptionsCont::addOptionSubTopic(), GeoConvHelper::addProjectionOptions(), OptionsCont::addSynonyme(), OptionsCont::clear(), OptionsCont::doRegister(), NIFrame::fillOptions(), NBFrame::fillOptions(), NWFrame::fillOptions(), and RandHelper::insertRandOptions().
Referenced by initOptions(), main(), GNEApplicationWindow::onCmdNewNetwork(), and GNEApplicationWindow::onCmdOpenForeign().
|
protected |
init options
Definition at line 417 of file GNELoadThread.cpp.
References fillOptions(), OptionsCont::getOptions(), OptionsIO::getOptions(), OptionsCont::getString(), OptionsCont::isSet(), myFile, myLoadNet, OptionsCont::resetWritable(), OptionsCont::set(), setDefaultOptions(), TL, and WRITE_ERROR.
Referenced by run().
void GNELoadThread::loadConfigOrNet | ( | const std::string & | file, |
const bool | isNet, | ||
const bool | useStartupOptions, | ||
const bool | newNet = false |
||
) |
begins the loading of a netconvert configuration or a a network
[in] | file | The network or configuration-file to be loaded |
[in] | isNet | whether file is a network file |
[in] | useStartupOptions | whether the initial startup options shall be used |
Definition at line 452 of file GNELoadThread.cpp.
References myFile, myLoadNet, myNewNet, and OptionsIO::setArgs().
Referenced by GNEApplicationWindow::loadConfigOrNet().
|
inherited |
Definition at line 128 of file MFXSingleEventThread.cpp.
References MFXInterThreadEventClient::eventOccurred(), and MFXSingleEventThread::myClient.
Referenced by FXDEFMAP().
|
inherited |
Definition at line 113 of file MFXSingleEventThread.cpp.
References MFXSingleEventThread::event, PIPE_READ, FXEX::SEL_THREAD, and UNUSED_PARAMETER.
Referenced by FXDEFMAP().
void GNELoadThread::retrieveMessage | ( | const MsgHandler::MsgType | type, |
const std::string & | msg | ||
) |
Retrieves messages from the loading module.
Definition at line 464 of file GNELoadThread.cpp.
References myEventQue, myEventThrow, MFXSynchQue< T, Container >::push_back(), and FXEX::MFXThreadEvent::signal().
Referenced by GNELoadThread().
|
virtual |
starts the thread. The thread ends after the net has been loaded
Reimplemented from MFXSingleEventThread.
Definition at line 63 of file GNELoadThread.cpp.
References MsgHandler::addRetriever(), NBNetBuilder::applyOptions(), NBFrame::checkOptions(), NIFrame::checkOptions(), NWFrame::checkOptions(), SystemFrame::checkOptions(), OptionsCont::clear(), MsgHandler::clear(), NBNetBuilder::compute(), GNENet::computeAndUpdate(), GeoConvHelper::computeFinal(), MsgHandler::enableDebugGLMessages(), MsgHandler::enableDebugMessages(), OptionsCont::getBool(), MsgHandler::getDebugInstance(), MsgHandler::getErrorInstance(), MsgHandler::getGLDebugInstance(), MsgHandler::getMessageInstance(), OptionsCont::getOptions(), OptionsCont::getString(), MsgHandler::getWarningInstance(), GeoConvHelper::init(), initOptions(), MsgHandler::initOutputOptions(), RandHelper::initRandGlobal(), OptionsCont::isDefault(), OptionsCont::isSet(), NILoader::load(), myDebugRetriever, myErrorRetriever, myFile, myGLDebugRetriever, myLoadNet, myMessageRetriever, myNewNet, myWarningRetriever, OptionsCont::setDefault(), XMLSubSys::setValidation(), submitEndAndCleanup(), TL, WRITE_ERROR, and WRITE_MESSAGE.
|
static |
sets required options for proper functioning
Definition at line 409 of file GNELoadThread.cpp.
References OptionsCont::resetWritable(), and OptionsCont::set().
Referenced by initOptions(), and GNEApplicationWindow::onCmdNewNetwork().
|
inherited |
Definition at line 89 of file MFXSingleEventThread.cpp.
References MFXSingleEventThread::event, PIPE_WRITE, FXEX::SEL_THREAD, and UNUSED_PARAMETER.
|
inherited |
Definition at line 101 of file MFXSingleEventThread.cpp.
References MFXSingleEventThread::event, PIPE_WRITE, and UNUSED_PARAMETER.
|
staticinherited |
Definition at line 142 of file MFXSingleEventThread.cpp.
Referenced by GUIRunThread::deleteSim(), GUIApplicationWindow::loadOnStartup(), GUISUMOAbstractView::makeSnapshot(), and GUIRunThread::tryStep().
|
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 186 of file GNELoadThread.cpp.
References MsgHandler::getDebugInstance(), MsgHandler::getErrorInstance(), MsgHandler::getGLDebugInstance(), MsgHandler::getMessageInstance(), MsgHandler::getWarningInstance(), myDebugRetriever, myErrorRetriever, myEventQue, myEventThrow, myFile, myGLDebugRetriever, myMessageRetriever, myWarningRetriever, MFXSynchQue< T, Container >::push_back(), MsgHandler::removeRetriever(), and FXEX::MFXThreadEvent::signal().
Referenced by run().
|
privateinherited |
event
Definition at line 73 of file MFXSingleEventThread.h.
Referenced by MFXSingleEventThread::onThreadSignal(), MFXSingleEventThread::signal(), and MFXSingleEventThread::~MFXSingleEventThread().
|
protectedinherited |
pointer to APP
Definition at line 66 of file MFXSingleEventThread.h.
Referenced by GUIRunThread::run(), and MFXSingleEventThread::~MFXSingleEventThread().
|
protectedinherited |
thread client
Definition at line 69 of file MFXSingleEventThread.h.
Referenced by MFXSingleEventThread::onThreadEvent().
|
protected |
Definition at line 90 of file GNELoadThread.h.
Referenced by GNELoadThread(), run(), submitEndAndCleanup(), and ~GNELoadThread().
|
protected |
The instances of message retriever encapsulations Needed to be deleted from the handler later on.
Definition at line 90 of file GNELoadThread.h.
Referenced by GNELoadThread(), run(), submitEndAndCleanup(), and ~GNELoadThread().
|
protected |
event Queue
Definition at line 93 of file GNELoadThread.h.
Referenced by retrieveMessage(), and submitEndAndCleanup().
|
protected |
event throw
Definition at line 96 of file GNELoadThread.h.
Referenced by retrieveMessage(), and submitEndAndCleanup().
|
protected |
the path to load the network from
Definition at line 87 of file GNELoadThread.h.
Referenced by initOptions(), loadConfigOrNet(), run(), and submitEndAndCleanup().
|
protected |
Definition at line 90 of file GNELoadThread.h.
Referenced by GNELoadThread(), run(), submitEndAndCleanup(), and ~GNELoadThread().
|
protected |
Information whether only the network shall be loaded.
Definition at line 99 of file GNELoadThread.h.
Referenced by initOptions(), loadConfigOrNet(), and run().
|
protected |
Definition at line 90 of file GNELoadThread.h.
Referenced by GNELoadThread(), run(), submitEndAndCleanup(), and ~GNELoadThread().
|
protected |
if true, a new net is created
Definition at line 102 of file GNELoadThread.h.
Referenced by loadConfigOrNet(), and run().
|
protected |
the parent window to inform about the loading
Definition at line 84 of file GNELoadThread.h.
|
protected |
Definition at line 90 of file GNELoadThread.h.
Referenced by GNELoadThread(), run(), submitEndAndCleanup(), and ~GNELoadThread().