-
Notifications
You must be signed in to change notification settings - Fork 1
/
simulatorwindow.h
73 lines (63 loc) · 1.71 KB
/
simulatorwindow.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
64
65
66
67
68
69
70
71
72
73
#ifndef SIMULATORWINDOW_H
#define SIMULATORWINDOW_H
#include <QWidget>
#include <QMessageBox>
#include <QFileDialog>
#include <QFile>
#include <QMenu>
#include <QList>
#include <QModelIndexList>
#include <QString>
#include <QTimer>
#include <QAction>
#include "ledmatrix.h"
#define FRAMES_PER_SECOND 20
#define FRAME_TIMER_INTERVAL 1000/FRAMES_PER_SECOND
namespace Ui {
class SimulatorWindow;
}
class SimulatorWindow : public QWidget
{
Q_OBJECT
QString m_exportFilename;
QString m_importFilename;
QList<SimFrame> m_animation;
QList<SimFrame> m_clipboard;
QTimer m_updateFrameTimer;
int m_currentPlayingFrame;
public:
explicit SimulatorWindow(QWidget *parent = 0);
~SimulatorWindow();
private slots:
void removeFrame(void);
void insertFrameAppend(void);
void insertFramePrepend(void);
void switchFrame(int dummy, int v_frameNumber);
void loadFrameToEditor(void);
void storeFrame(void);
void orWithFrame(void);
void andWithFrame(void);
void mergeFrames(void);
void rotateFrameLeft(void);
void rotateFrameRight(void);
void rotateFrameUp(void);
void rotateFrameDown(void);
void importAnimation(void);
void exportAnimation(void);
void importFrame(void);
void exportFrame(void);
void quickStore(void);
void quickLoad(void);
void copyToClipboard(void);
void cutToClipboard(void);
void pasteToAnimationAppend(void);
void pasteToAnimationPrepend(void);
void loadNextFrame(void);
void playPause(void);
private:
void writeFrameToFile(const SimFrame v_frame, QFile &v_outFile);
void readFrameFromFile(SimFrame &v_frame, QFile &v_inFile);
private:
Ui::SimulatorWindow *ui;
};
#endif // SIMULATORWINDOW_H