Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEExternalRunner Class Reference

#include <GNEExternalRunner.h>

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

Public Member Functions

void abort ()
 abort running
 
bool errorOccurred () const
 check if during execution an error was Occurred
 
 GNEExternalRunner (GNEApplicationWindow *applicationWindow)
 Constructor.
 
bool isRunning () const
 check if is running
 
void runTool (GNERunDialog *runDialog)
 run tool called from dialog
 
 ~GNEExternalRunner ()
 destructor
 

Protected Types

enum  { ID_THREAD_EVENT }
 FOX declaration. More...
 

Protected Member Functions

long onThreadEvent (FXObject *, FXSelector, void *)
 
long onThreadSignal (FXObject *, FXSelector, void *)
 
void signal ()
 
void signal (FXuint seltype)
 

Static Protected Member Functions

static void sleep (long ms)
 

Protected Attributes

FXApp * myApp = nullptr
 pointer to APP
 
MFXInterThreadEventClientmyClient = nullptr
 thread client
 
bool myErrorOccurred = false
 flag for check if during execution an error was Occurred
 
GNERunDialogmyRunDialog = nullptr
 pointer to current run dialog
 
bool myRunning = false
 flag for check if we have a running process
 

Private Member Functions

 GNEExternalRunner (const GNEExternalRunner &)=delete
 Invalidated copy constructor.
 
GNEExternalRunneroperator= (const GNEExternalRunner &)=delete
 Invalidated assignment operator.
 
FXint run ()
 starts the thread. The thread ends after the tool is finished
 

Private Attributes

FXEX::MFXThreadEventHandle event
 event
 
FILE * myPipe = nullptr
 pipe file
 

Detailed Description

Definition at line 35 of file GNEExternalRunner.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

◆ GNEExternalRunner() [1/2]

GNEExternalRunner::GNEExternalRunner ( GNEApplicationWindow applicationWindow)

Constructor.

Definition at line 31 of file GNEExternalRunner.cpp.

References GNEApplicationWindow::setExternalRunner().

◆ ~GNEExternalRunner()

GNEExternalRunner::~GNEExternalRunner ( )

destructor

Definition at line 38 of file GNEExternalRunner.cpp.

◆ GNEExternalRunner() [2/2]

GNEExternalRunner::GNEExternalRunner ( const GNEExternalRunner )
privatedelete

Invalidated copy constructor.

Member Function Documentation

◆ abort()

void GNEExternalRunner::abort ( )

abort running

Definition at line 56 of file GNEExternalRunner.cpp.

References GNERunDialog::addEvent(), ERROR_OCCURRED, myErrorOccurred, myRunDialog, myRunning, and TL.

Referenced by GNERunDialog::onCmdAbort(), GNERunNetgenerateDialog::onCmdAccept(), GNERunDialog::onCmdRun(), and runTool().

Here is the caller graph for this function:

◆ errorOccurred()

bool GNEExternalRunner::errorOccurred ( ) const

check if during execution an error was Occurred

Definition at line 76 of file GNEExternalRunner.cpp.

References myErrorOccurred.

◆ isRunning()

bool GNEExternalRunner::isRunning ( ) const

check if is running

Definition at line 70 of file GNEExternalRunner.cpp.

References myRunning.

Referenced by GNERunDialog::onCmdRun(), and GNERunDialog::updateDialogButtons().

Here is the caller graph for this function:

◆ onThreadEvent()

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

Definition at line 128 of file MFXSingleEventThread.cpp.

References MFXInterThreadEventClient::eventOccurred(), and MFXSingleEventThread::myClient.

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 MFXSingleEventThread::event, PIPE_READ, FXEX::SEL_THREAD, and UNUSED_PARAMETER.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ operator=()

GNEExternalRunner & GNEExternalRunner::operator= ( const GNEExternalRunner )
privatedelete

Invalidated assignment operator.

◆ run()

FXint GNEExternalRunner::run ( )
privatevirtual

starts the thread. The thread ends after the tool is finished

Reimplemented from MFXSingleEventThread.

Definition at line 82 of file GNEExternalRunner.cpp.

References GNERunDialog::addEvent(), ERROR_OCCURRED, GNERunDialog::getRunCommand(), MESSAGE_OCCURRED, myErrorOccurred, myPipe, myRunDialog, myRunning, OUTPUT_OCCURRED, TL, TOOL_ENDED, and StringUtils::transcodeToLocal().

◆ runTool()

void GNEExternalRunner::runTool ( GNERunDialog runDialog)

run tool called from dialog

Definition at line 42 of file GNEExternalRunner.cpp.

References abort(), myErrorOccurred, myRunDialog, and myRunning.

Referenced by GNERunNetgenerateDialog::GNERunNetgenerateDialog(), GNERunPythonToolDialog::GNERunPythonToolDialog(), and GNERunDialog::onCmdRun().

Here is the caller graph for this function:

◆ signal() [1/2]

void MFXSingleEventThread::signal ( )
inherited

◆ signal() [2/2]

void MFXSingleEventThread::signal ( FXuint  seltype)
inherited

◆ 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:

Field Documentation

◆ event

◆ myApp

FXApp* MFXSingleEventThread::myApp = nullptr
protectedinherited

pointer to APP

Definition at line 65 of file MFXSingleEventThread.h.

Referenced by GUIRunThread::run(), and MFXSingleEventThread::~MFXSingleEventThread().

◆ myClient

MFXInterThreadEventClient* MFXSingleEventThread::myClient = nullptr
protectedinherited

thread client

Definition at line 68 of file MFXSingleEventThread.h.

Referenced by MFXSingleEventThread::onThreadEvent().

◆ myErrorOccurred

bool GNEExternalRunner::myErrorOccurred = false
protected

flag for check if during execution an error was Occurred

Definition at line 64 of file GNEExternalRunner.h.

Referenced by abort(), errorOccurred(), run(), and runTool().

◆ myPipe

FILE* GNEExternalRunner::myPipe = nullptr
private

pipe file

Definition at line 68 of file GNEExternalRunner.h.

Referenced by run().

◆ myRunDialog

GNERunDialog* GNEExternalRunner::myRunDialog = nullptr
protected

pointer to current run dialog

Definition at line 58 of file GNEExternalRunner.h.

Referenced by abort(), run(), and runTool().

◆ myRunning

bool GNEExternalRunner::myRunning = false
protected

flag for check if we have a running process

Definition at line 61 of file GNEExternalRunner.h.

Referenced by abort(), isRunning(), run(), and runTool().


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