![]() |
SUMO - Simulation of Urban MObility
|
#include <GNELoadThread.h>
Public Types | |
enum | { ID_THREAD_EVENT } |
Public Member Functions | |
GNELoadThread (FXApp *app, MFXInterThreadEventClient *mw, MFXEventQue< GUIEvent *> &eq, FXEX::FXThreadEvent &ev) | |
constructor More... | |
void | loadConfigOrNet (const std::string &file, bool isNet, bool useStartupOptions, 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 std::string &guiSettingsFile="", const bool viewportFromRegistry=false) |
Closes the loading process. More... | |
Protected Attributes | |
OutputDevice * | myErrorRetriever |
The instances of message retriever encapsulations Needed to be deleted from the handler later on. More... | |
MFXEventQue< GUIEvent * > & | myEventQue |
event Queue More... | |
FXEX::FXThreadEvent & | myEventThrow |
event throw More... | |
std::string | myFile |
the path to load the simulation from More... | |
bool | myLoadNet |
Information whether only the network shall be loaded. More... | |
OutputDevice * | myMessageRetriever |
bool | myNewNet |
if true, a new net is created More... | |
MFXInterThreadEventClient * | myParent |
the parent window to inform about the loading More... | |
OutputDevice * | myWarningRetriever |
Definition at line 54 of file GNELoadThread.h.
|
inherited |
Enumerator | |
---|---|
ID_THREAD_EVENT |
Definition at line 52 of file FXSingleEventThread.h.
GNELoadThread::GNELoadThread | ( | FXApp * | app, |
MFXInterThreadEventClient * | mw, | ||
MFXEventQue< GUIEvent *> & | eq, | ||
FXEX::FXThreadEvent & | ev | ||
) |
constructor
Definition at line 61 of file GNELoadThread.cpp.
References MsgHandler::addRetriever(), MsgHandler::getErrorInstance(), MsgHandler::MT_ERROR, MsgHandler::MT_MESSAGE, MsgHandler::MT_WARNING, myErrorRetriever, myMessageRetriever, myWarningRetriever, and retrieveMessage().
|
virtual |
destructor
Definition at line 71 of file GNELoadThread.cpp.
References myErrorRetriever, myMessageRetriever, and myWarningRetriever.
|
static |
clears and initializes the OptionsCont
Definition at line 192 of file GNELoadThread.cpp.
References OptionsCont::addCallExample(), SystemFrame::addConfigurationOptions(), OptionsCont::addDescription(), OptionsCont::addOptionSubTopic(), GeoConvHelper::addProjectionOptions(), SystemFrame::addReportOptions(), OptionsCont::clear(), OptionsCont::doRegister(), NIFrame::fillOptions(), NWFrame::fillOptions(), NBFrame::fillOptions(), and RandHelper::insertRandOptions().
Referenced by initOptions(), main(), GNEApplicationWindow::onCmdNewNetwork(), and GNEApplicationWindow::onCmdOpenForeign().
|
protected |
init options
Definition at line 265 of file GNELoadThread.cpp.
References fillOptions(), OptionsIO::getOptions(), OptionsCont::getOptions(), OptionsCont::getString(), OptionsCont::isSet(), myFile, myLoadNet, OptionsCont::set(), setDefaultOptions(), and WRITE_ERROR.
Referenced by run().
void GNELoadThread::loadConfigOrNet | ( | const std::string & | file, |
bool | isNet, | ||
bool | useStartupOptions, | ||
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 293 of file GNELoadThread.cpp.
References myFile, myLoadNet, myNewNet, and OptionsIO::setArgs().
Referenced by GNEApplicationWindow::loadConfigOrNet().
|
inherited |
Definition at line 131 of file FXSingleEventThread.cpp.
|
inherited |
Definition at line 116 of file FXSingleEventThread.cpp.
References PIPE_READ, FXEX::SEL_THREAD, and UNUSED_PARAMETER.
void GNELoadThread::retrieveMessage | ( | const MsgHandler::MsgType | type, |
const std::string & | msg | ||
) |
Retrieves messages from the loading module.
Definition at line 305 of file GNELoadThread.cpp.
References MFXEventQue< T >::add(), myEventQue, myEventThrow, and FXEX::FXThreadEvent::signal().
Referenced by GNELoadThread().
|
virtual |
starts the thread. The thread ends after the net has been loaded
Reimplemented from FXSingleEventThread.
Definition at line 79 of file GNELoadThread.cpp.
References MsgHandler::addRetriever(), NIFrame::checkOptions(), NWFrame::checkOptions(), NBFrame::checkOptions(), SystemFrame::checkOptions(), MsgHandler::clear(), OptionsCont::clear(), GNENet::computeAndUpdate(), GeoConvHelper::computeFinal(), OptionsCont::getBool(), MsgHandler::getErrorInstance(), MsgHandler::getMessageInstance(), OptionsCont::getOptions(), OptionsCont::getString(), MsgHandler::getWarningInstance(), GeoConvHelper::init(), initOptions(), MsgHandler::initOutputOptions(), RandHelper::initRandGlobal(), NILoader::load(), myErrorRetriever, myLoadNet, myMessageRetriever, myNewNet, myWarningRetriever, XMLSubSys::setValidation(), submitEndAndCleanup(), WRITE_ERROR, and WRITE_MESSAGE.
|
static |
sets required options for proper functioning
Definition at line 258 of file GNELoadThread.cpp.
References OptionsCont::set().
Referenced by initOptions(), and GNEApplicationWindow::onCmdNewNetwork().
|
inherited |
Definition at line 92 of file FXSingleEventThread.cpp.
References PIPE_WRITE, FXEX::SEL_THREAD, and UNUSED_PARAMETER.
|
inherited |
Definition at line 104 of file FXSingleEventThread.cpp.
References PIPE_WRITE, and UNUSED_PARAMETER.
|
staticinherited |
Definition at line 145 of file FXSingleEventThread.cpp.
Referenced by GUISUMOAbstractView::makeSnapshot(), FXSingleEventThread::run(), GUIRunThread::run(), and GUIRunThread::waitForSnapshots().
|
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 179 of file GNELoadThread.cpp.
References MFXEventQue< T >::add(), MsgHandler::getErrorInstance(), MsgHandler::getMessageInstance(), MsgHandler::getWarningInstance(), myErrorRetriever, myEventQue, myEventThrow, myFile, myMessageRetriever, myWarningRetriever, MsgHandler::removeRetriever(), and FXEX::FXThreadEvent::signal().
Referenced by run().
|
protected |
The instances of message retriever encapsulations Needed to be deleted from the handler later on.
Definition at line 101 of file GNELoadThread.h.
Referenced by GNELoadThread(), run(), submitEndAndCleanup(), and ~GNELoadThread().
|
protected |
event Queue
Definition at line 104 of file GNELoadThread.h.
Referenced by retrieveMessage(), and submitEndAndCleanup().
|
protected |
event throw
Definition at line 107 of file GNELoadThread.h.
Referenced by retrieveMessage(), and submitEndAndCleanup().
|
protected |
the path to load the simulation from
Definition at line 98 of file GNELoadThread.h.
Referenced by initOptions(), loadConfigOrNet(), and submitEndAndCleanup().
|
protected |
Information whether only the network shall be loaded.
Definition at line 110 of file GNELoadThread.h.
Referenced by initOptions(), loadConfigOrNet(), and run().
|
protected |
Definition at line 101 of file GNELoadThread.h.
Referenced by GNELoadThread(), run(), submitEndAndCleanup(), and ~GNELoadThread().
|
protected |
if true, a new net is created
Definition at line 113 of file GNELoadThread.h.
Referenced by loadConfigOrNet(), and run().
|
protected |
the parent window to inform about the loading
Definition at line 95 of file GNELoadThread.h.
|
protected |
Definition at line 101 of file GNELoadThread.h.
Referenced by GNELoadThread(), run(), submitEndAndCleanup(), and ~GNELoadThread().