-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotebook_app.hpp
84 lines (58 loc) · 1.71 KB
/
notebook_app.hpp
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#ifndef NOTEBOOKAPP_H
#define NOTEBOOKAPP_H
#include <string>
#include <sstream>
#include <iostream>
#include <fstream>
#include <thread>
#include "input_widget.hpp"
#include "output_widget.hpp"
#include "interpreter.hpp"
#include "semantic_error.hpp"
#include "startup_config.hpp" // for the file for make-point,line,text
class NotebookApp : public QWidget {
Q_OBJECT
public:
NotebookApp(QWidget * parent = nullptr);
~NotebookApp();
signals:
void dataReady(QString data);
void makePointReady(std::vector<double> parameters);
void makeLineReady(std::vector<double> parameters);
void makeTextReady(QString text, double x, double y, double scale, double phi);
void makeLabelReady(QString text, double x, double y, double scale, double phi);
void initializeScreen();
public slots:
void handle_PlotScript(QString input);
private slots:
void start();
void stop();
void reset();
void interrupt();
private:
QWidget * inputWidget;
QWidget * outputWidget;
QPushButton * startButton;
QPushButton * stopButton;
QPushButton * resetButton;
QPushButton * interruptButton;
Interpreter interp;
Interpreter resetInterp;
//Graphics parameters
double x = 0;
double y = 0;
double size = 0;
double thickness = 0;
double scale = 0; //scale factor
double phi = 0; //text angle
std::vector<double> plotParameters;
std::thread *guiThread;
//bool twoThreadsRunning;
void connectSlots();
// functions to run plotscript before emitting the signal
void error(const std::string & err_str);
void eval_from_stream(std::istream & stream);
void eval_from_file(std::string filename);
void whichSignal(Expression exp);
};
#endif