Go to the documentation of this file.
36 #include <wx/thread.h>
53 wxThread(wxTHREAD_JOINABLE),
57 runtimeErrorHandler_(NULL) {
131 while (!TestDestroy()) {
133 std::string command =
"";
142 if (command ==
"quit") {
146 wxPostEvent(
gui_, eventCmd);
149 while (!TestDestroy()) {
158 wxPostEvent(
gui_, eventCmd);
165 wxPostEvent(
gui_, eventCmdDone);
172 wxPostEvent(
gui_, eventError);
181 wxPostEvent(
gui_, event);
196 wxPostEvent(
gui_, simEvent);
211 wxPostEvent(
gui_, simEvent);
263 wxPostEvent(
gui_, simEvent);
268 wxPostEvent(
gui_, simEvent);
273 wxPostEvent(
gui_, simEvent);
278 wxPostEvent(
gui_, simEvent);
283 wxPostEvent(
gui_, simEvent);
288 wxPostEvent(
gui_, simEvent);
293 wxPostEvent(
gui_, simEvent);
TracedSimulatorFrontend * simulation_
Simulator backend.
static const wxEventType EVT_SIMULATOR_STOP
Simulation stopped.
virtual std::string result()
@ SRE_USER_REQUESTED
User requested the simulation to stop explicitly, e.g., by pressing ctrl-c in the CLI.
virtual ~ProximSimulationThread()
bool isSimulationStopped() const
@ SIMULATOR_LOADING_PROGRAM
SimulatorInterpreter * interpreter()
ProximLineReader & lineReader()
SimulatorInterpreter * interpreter_
SimulatorInterpreter where the user input is passed to.
static const wxEventType EVT_SIMULATOR_OUTPUT
Textual output event from simulator interpreter.
@ SIMULATOR_MACHINE_LOADED
TracedSimulatorFrontend * frontend()
virtual void handleEvent()
#define assert(condition)
static const wxEventType EVT_SIMULATOR_LOADING_MACHINE
Machine loading started.
virtual bool error() const
static const wxEventType EVT_SIMULATOR_LOADING_PROGRAM
Program loading started.
virtual void initialize(std::string defPrompt="", FILE *in=stdin, FILE *out=stdout, FILE *err=stderr)
virtual bool interpret(const std::string &commandLine)
static const wxEventType EVT_SIMULATOR_PROGRAM_LOADED
Program loaded event.
SimulatorInterpreterContext * interpreterContext_
SimulatorInterpreterContext. ?
virtual std::string readLine(std::string prompt="")
bool isSimulationRunning() const
void initialize(ProximMainFrame *gui)
ProximLineReader * lineReader_
Linereader used for reading the user input.
@ SIMULATOR_LOADING_MACHINE
static const wxEventType EVT_SIMULATOR_TERMINATED
Simulator thread terminated.
static const wxEventType EVT_SIMULATOR_ERROR
Simulator error event.
static const wxEventType EVT_SIMULATOR_START
Simulation started.
@ SIMULATOR_PROGRAM_LOADED
static const wxEventType EVT_SIMULATOR_COMMAND
Command received from the GUI.
virtual void killSimulation()
static const wxEventType EVT_SIMULATOR_RUN
Simulation ran/resumed.
static const wxEventType EVT_SIMULATOR_MACHINE_LOADED
Machine loaded event.
ProximMainFrame * gui_
Proxim main frame where the simulator events are passed to.
static const wxEventType EVT_SIMULATOR_COMMAND_DONE
Command execution completed.
ProximRuntimeErrorHandler * runtimeErrorHandler_
Runtime error handler.
void prepareToStop(StopReason reason)