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

Abstract dialog for tools. More...

#include <GNERunPythonTool.h>

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

Public Member Functions

void abortTool ()
 abort tool running
 
bool errorOccurred () const
 check if during execution an error was Occurred
 
 GNERunPythonTool (GNERunPythonToolDialog *runToolDialog, MFXSynchQue< GUIEvent * > &eq, FXEX::MFXThreadEvent &ev)
 Constructor.
 
bool isRunning () const
 check if tool is running
 
void runTool (const GNEPythonTool *tool)
 run tool
 
 ~GNERunPythonTool ()
 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
 

Private Member Functions

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

Private Attributes

FXEX::MFXThreadEventHandle event
 event
 
bool myErrorOccurred = false
 flag for check if during execution an error was Occurred
 
MFXSynchQue< GUIEvent * > & myEventQueue
 event Queue
 
FXEX::MFXThreadEventmyEventThrow
 event throw
 
FILE * myPipe = nullptr
 pipe file
 
const GNEPythonToolmyPythonTool = nullptr
 tool
 
bool myRunning = false
 flag for check if tool is running
 

Detailed Description

Abstract dialog for tools.

Definition at line 39 of file GNERunPythonTool.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

◆ GNERunPythonTool() [1/2]

GNERunPythonTool::GNERunPythonTool ( GNERunPythonToolDialog runToolDialog,
MFXSynchQue< GUIEvent * > &  eq,
FXEX::MFXThreadEvent ev 
)

Constructor.

Definition at line 33 of file GNERunPythonTool.cpp.

◆ ~GNERunPythonTool()

GNERunPythonTool::~GNERunPythonTool ( )

destructor

Definition at line 40 of file GNERunPythonTool.cpp.

◆ GNERunPythonTool() [2/2]

GNERunPythonTool::GNERunPythonTool ( const GNERunPythonTool )
privatedelete

Invalidated copy constructor.

Member Function Documentation

◆ abortTool()

void GNERunPythonTool::abortTool ( )

abort tool running

Definition at line 54 of file GNERunPythonTool.cpp.

References ERROR_OCCURRED, myErrorOccurred, myEventQueue, myEventThrow, myRunning, MFXSynchQue< T, Container >::push_back(), FXEX::MFXThreadEvent::signal(), and TL.

Referenced by GNERunPythonToolDialog::onCmdAbort(), and GNERunPythonToolDialog::onCmdClose().

Here is the caller graph for this function:

◆ errorOccurred()

bool GNERunPythonTool::errorOccurred ( ) const

check if during execution an error was Occurred

Definition at line 75 of file GNERunPythonTool.cpp.

References myErrorOccurred.

◆ isRunning()

bool GNERunPythonTool::isRunning ( ) const

check if tool is running

Definition at line 69 of file GNERunPythonTool.cpp.

References myRunning.

Referenced by GNERunPythonToolDialog::updateDialog().

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=()

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

Invalidated assignment operator.

◆ run()

FXint GNERunPythonTool::run ( )
privatevirtual

◆ runTool()

void GNERunPythonTool::runTool ( const GNEPythonTool tool)

run tool

Definition at line 44 of file GNERunPythonTool.cpp.

References myErrorOccurred, myPythonTool, and myRunning.

Referenced by GNERunPythonToolDialog::onCmdRerun(), and GNERunPythonToolDialog::runTool().

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 GNERunPythonTool::myErrorOccurred = false
private

flag for check if during execution an error was Occurred

Definition at line 68 of file GNERunPythonTool.h.

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

◆ myEventQueue

MFXSynchQue<GUIEvent*>& GNERunPythonTool::myEventQueue
private

event Queue

Definition at line 74 of file GNERunPythonTool.h.

Referenced by abortTool(), and run().

◆ myEventThrow

FXEX::MFXThreadEvent& GNERunPythonTool::myEventThrow
private

event throw

Definition at line 77 of file GNERunPythonTool.h.

Referenced by abortTool(), and run().

◆ myPipe

FILE* GNERunPythonTool::myPipe = nullptr
private

pipe file

Definition at line 71 of file GNERunPythonTool.h.

Referenced by run().

◆ myPythonTool

const GNEPythonTool* GNERunPythonTool::myPythonTool = nullptr
private

tool

Definition at line 62 of file GNERunPythonTool.h.

Referenced by run(), and runTool().

◆ myRunning

bool GNERunPythonTool::myRunning = false
private

flag for check if tool is running

Definition at line 65 of file GNERunPythonTool.h.

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


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