17 #include <QtCore/QString> 18 #include <QtCore/QThread> 24 #include "PythonQt_QtAll.h" 25 #include "PyTrikControl0.h" 63 void completed(
const QString &error,
int scriptId);
113 void onScriptRequestingToQuit();
119 void doRun(
const QString &script);
122 void doRunDirect(
const QString &command);
125 void updateErrorMessage(
const QString &err);
144 void startScriptEvaluation(
int scriptId);
149 State mState = State::ready;
153 QMutex mScriptStateMutex;
155 PythonQtObjectPtr mMainContext;
157 PyThreadState * mPyInterpreter {
nullptr };
159 QString mErrorMessage;
161 wchar_t *mProgramName {
nullptr };
162 wchar_t *mPythonPath {
nullptr };
164 static QAtomicInt initCounter;
void sendMessage(const QString &)
Some message to send, for example, from stdout.
bool recreateContext()
Recreates Main Context made by init, returns true when were errors.
Definition: pythonEngineWorker.cpp:135
void resetBrick()
Clears execution state and stops robot.
Definition: pythonEngineWorker.cpp:171
~PythonEngineWorker()
Definition: pythonEngineWorker.cpp:54
Definition: trikCommunicator.h:23
void inited()
When engine was inited.
void startedDirectScript(int scriptId)
Emitted when new direct script is started.
void run(const QString &script)
Starts script evaluation, emits startedScript() signal and returns.
Definition: pythonEngineWorker.cpp:241
void PythonQt_init_PyTrikControl(PyObject *module)
void startedScript(const QString &fileName, int scriptId)
Emitted when new script is started.
void sendStdOutMessage(const QString &text)
Sends message to listeners.
Definition: pythonEngineWorker.cpp:188
void stopScript()
Stops script execution and resets script engine.
Definition: pythonEngineWorker.cpp:193
QStringList knownNames() const
Report known objects and methods for autocompletion.
Definition: pythonEngineWorker.cpp:228
void completed(const QString &error, int scriptId)
Emitted when current script execution is completed or is aborted by reset() call. ...
void runDirect(const QString &command)
Runs a command in a current context.
Definition: pythonEngineWorker.cpp:274
void init()
Initializes PythonQt and creates new main module, which will be used by user Must be invoked (called ...
Definition: pythonEngineWorker.cpp:80
Worker object to be run in a separate thread for Python execution.
Definition: pythonEngineWorker.h:33
Allows communication between robots.
Definition: mailboxInterface.h:31
void brickBeep()
Plays "beep" sound.
Definition: pythonEngineWorker.cpp:183
script
Definition: system.py:83
PythonEngineWorker(trikControl::BrickInterface &brick, trikNetwork::MailboxInterface *mailbox)
Constructor.
Definition: pythonEngineWorker.cpp:46
Interface representing TRIK controller board and devices installed on it, also provides access to per...
Definition: brickInterface.h:46