forked from collin80/SavvyCAN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scriptingwindow.h
63 lines (51 loc) · 1.42 KB
/
scriptingwindow.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
57
58
59
60
61
62
63
#ifndef SCRIPTINGWINDOW_H
#define SCRIPTINGWINDOW_H
#include "scriptcontainer.h"
#include "can_structs.h"
#include "connections/canconnection.h"
#include "jsedit.h"
#include <QDialog>
#include <QJSEngine>
class ScriptContainer;
namespace Ui {
class ScriptingWindow;
}
class ScriptingWindow : public QDialog
{
Q_OBJECT
public:
explicit ScriptingWindow(const QVector<CANFrame> *frames, QWidget *parent = 0);
void showEvent(QShowEvent*);
~ScriptingWindow();
public slots:
void log(QString text);
signals:
void updateValueTable(QTableWidget *widget);
void updatedParameter(QString name, QString value);
private slots:
void loadNewScript();
void createNewScript();
void deleteCurrentScript();
void refreshSourceWindow();
void saveScript();
void revertScript();
void recompileScript();
void changeCurrentScript();
void newFrames(const CANConnection*, const QVector<CANFrame>&);
void clickedLogClear();
void valuesTimerElapsed();
void updatedValue(int row, int col);
private:
void closeEvent(QCloseEvent *event);
void readSettings();
void writeSettings();
bool eventFilter(QObject *obj, QEvent *event);
Ui::ScriptingWindow *ui;
JSEdit *editor;
QList<ScriptContainer *> scripts;
ScriptContainer *currentScript;
const QVector<CANFrame> *modelFrames;
QElapsedTimer elapsedTime;
QTimer valuesTimer;
};
#endif // SCRIPTINGWINDOW_H