Subversion Repositories Code-Repo

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
363 Kevin 1
#ifndef PASTECONTROLLER_H
2
#define PASTECONTROLLER_H
3
 
4
#include "GlobalDefines.h"
5
 
6
#define BTN_ICON_SIZE 32
372 Kevin 7
#define X_MIN 0
8
#define X_MAX 290
9
#define Y_MIN 0
10
#define Y_MAX 270
11
#define Z_MIN 0
12
#define Z_MAX 240
363 Kevin 13
 
372 Kevin 14
#define SLOW_MULTIPLIER 4
15
 
363 Kevin 16
class PasteController : public QWidget
17
{
18
        Q_OBJECT
19
    public:
20
        PasteController(QWidget *parent = 0);
21
        ~PasteController();
22
 
23
    signals:
24
        void EnableControls(void);
25
        void DisableControls(void);
364 Kevin 26
        void TransmitData(QByteArray);
372 Kevin 27
        void UpdateStatus(QString);
363 Kevin 28
 
29
    public slots:
364 Kevin 30
        void EnableTransmit(bool);
372 Kevin 31
        void InitializePrinter(void);
364 Kevin 32
        void ToggleHotkeys(void);
372 Kevin 33
        void MoveToolhead(void);
34
        void MoveToolheadSingle(void);
364 Kevin 35
        void UpdatePosition(void);
372 Kevin 36
        void ExtrudeSingle(void);
364 Kevin 37
        void ResetPosition(void);
372 Kevin 38
        void ProcessData(QByteArray);
39
        void SetBaseHeight(void);
363 Kevin 40
 
364 Kevin 41
        void QSliderToQDoubleSpinBox(int);
42
        void QDoubleSpinBoxToQSlider(double);
43
 
44
    protected:
45
        bool eventFilter(QObject *, QEvent *);
46
 
363 Kevin 47
    private:
364 Kevin 48
        bool connected;
49
        bool hotkeysEnabled;
50
        double xPos,yPos,zPos;
51
        bool X_Incr, X_Decr, Y_Incr, Y_Decr, Z_Incr, Z_Decr, E_Incr;
372 Kevin 52
        bool transmittingData;
364 Kevin 53
 
54
        void IncrementToolhead(double x, double y, double z);
55
        void SingleExtrude(void);
56
 
372 Kevin 57
        QQueue<QString> *queueCmds;
364 Kevin 58
        QTimer *tmrUpdate;
59
 
363 Kevin 60
        QLabel *labelHelp;
61
 
62
        QPushButton *btnEnableHotkeys;
63
        QPushButton *btnInit;
64
        QPushButton *btnHome;
65
 
364 Kevin 66
        // Printer control buttons
363 Kevin 67
        QToolButton *btnForward;
68
        QToolButton *btnBackward;
69
        QToolButton *btnLeft;
70
        QToolButton *btnRight;
71
        QToolButton *btnUp;
72
        QToolButton *btnDown;
73
        QToolButton *btnExtrude;
74
 
364 Kevin 75
        // Toolhead position elements
363 Kevin 76
        QLabel *labelXPos;
77
        QLineEdit *textXValue;
78
        QLabel *labelYPos;
79
        QLineEdit *textYValue;
80
        QLabel *labelZPos;
81
        QLineEdit *textZValue;
82
 
364 Kevin 83
        // Movement setting elements
84
        QLabel *labelXYSteps;
85
        QSlider *sliderXYSteps;
86
        QDoubleSpinBox *textXYSteps;
87
 
363 Kevin 88
        QLabel *labelXYSpeed;
89
        QSlider *sliderXYSpeed;
90
        QSpinBox *textXYSpeed;
91
 
364 Kevin 92
        QLabel *labelZSteps;
93
        QSlider *sliderZSteps;
94
        QDoubleSpinBox *textZSteps;
363 Kevin 95
 
96
        QLabel *labelZSpeed;
97
        QSlider *sliderZSpeed;
98
        QSpinBox *textZSpeed;
99
 
100
        QLabel *labelRepeatDelay;
101
        QSlider *sliderRepeatDelay;
102
        QSpinBox *textRepeatDelay;
103
 
364 Kevin 104
        // Extruder setting elements
105
        QLabel *labelEForwardSteps;
106
        QSlider *sliderEForwardSteps;
372 Kevin 107
        QDoubleSpinBox *textEForwardSteps;
364 Kevin 108
 
363 Kevin 109
        QLabel *labelEForwardSpeed;
110
        QSlider *sliderEForwardSpeed;
111
        QSpinBox *textEForwardSpeed;
112
 
364 Kevin 113
        QLabel *labelEBackwardSteps;
114
        QSlider *sliderEBackwardSteps;
372 Kevin 115
        QDoubleSpinBox *textEBackwardSteps;
364 Kevin 116
 
363 Kevin 117
        QLabel *labelEBackwardSpeed;
118
        QSlider *sliderEBackwardSpeed;
119
        QSpinBox *textEBackwardSpeed;
120
 
372 Kevin 121
        QLabel *labelExtrusionHeight;
122
        QSlider *sliderExtrusionHeight;
123
        QDoubleSpinBox *textExtrusionHeight;
124
 
364 Kevin 125
        QLabel *labelEZSteps;
126
        QSlider *sliderEZSteps;
127
        QDoubleSpinBox *textEZSteps;
363 Kevin 128
 
129
};
130
 
131
#endif // PASTECONTROLLER_H