-
Notifications
You must be signed in to change notification settings - Fork 2
/
scriptengine.h
56 lines (49 loc) · 1.61 KB
/
scriptengine.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef SCRIPTENGINE_H
#define SCRIPTENGINE_H
#include <QObject>
#include <QThread>
#include <QJsonObject>
#include <QJsonArray>
#include "scriptengineevaluation.h"
class ScriptEngine : public QObject
{
Q_OBJECT
public:
// enum ScriptEngineMode {
// ScriptEngineLocalMode,
// ScriptEngineRemoteMode
// };
explicit ScriptEngine(QObject *parent = nullptr);
~ScriptEngine();
QStringList getAllScripts();
QString getScript(QString scriptName);
QString addNewScript();
void setScript(QString scriptName, QString content);
void removeScript(QString scriptName);
void runScript(QString content);
void stopScript();
bool renameScript(QString oldScriptName, QString newScriptName);
// void setScriptEngineMode(ScriptEngineMode scriptEngineMode, QJsonArray filesJson = QJsonArray());
// ScriptEngineMode getScriptEngineMode();
// QJsonObject getAllScriptsIntoJson();
void messageBoxReturn(bool result);
public slots:
void cameraCaptured(QImage *videoFrame);
private:
QThread scriptEngineEvaluationThread;
ScriptEngineEvaluation scriptEngineEvaluation;
// ScriptEngineMode scriptEngineMode = ScriptEngineLocalMode;
// QJsonArray filesJson;
signals:
void evaluate(QString script);
void sendData(QString data);
// void stop();
void runScriptFinish();
void hasException(QString ex);
void messageBoxShow(QString title, QString content);
void runScriptStart();
void needCaptureCamera();
void setStatusText(QString text);
void cvShow(QString sourcePath, QString templatePath, cv::Point point);
};
#endif // SCRIPTENGINE_H