forked from mai4567/CNC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWidget.h
134 lines (117 loc) · 2.97 KB
/
Widget.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#ifndef WIDGET_H
#define WIDGET_H
#include <QMainWindow>
#include<iostream>
#include <QPushButton>
#include <QApplication>
#include <QFileDialog>
#include <QMessageBox>
#include <QLabel>
#include <QMovie>
#include <QLineEdit>
#include <QPainter>
#include <cnc_code.h>
#include <QTextStream>
namespace Ui { class startWidget; }
class loadWidget;
class workWidget;
class paintWidget;
class startWidget : public QWidget{
public:
startWidget(QWidget *mainwindow);
~startWidget();
void loadProcess(QWidget *mainwindow);
private:
Ui::startWidget *ui;
QPushButton *start;
QLabel *Label;
QMovie *movie;
loadWidget *load_widget_;
workWidget *work_widget_;
public slots:
void pushQuitButton();
private slots:
void pushButtonClicked(QWidget *mianwindow);
};
class workWidget : public startWidget{
public:
workWidget(QWidget *mainwindow);
~workWidget();
int left_status_ = 0;
int radius_ = 0;
int files_status_ = 0;
QPushButton *img_;
QPushButton *left_;
QPushButton *right_;
dxfReader *reader_;
DL_Dxf *dxf_;
QString path_ = "NULL";
QString previous_path_ = "NULL";
std::vector<DL_LineData> offset_lines_;
std::vector<DL_ArcData> offset_arcs_;
std::vector<std::vector<QPoint>> insert_points_;
std::vector<std::vector<QPoint>> insert_offset_points_;
void mainProcess(void);
private:
QLabel *Label;
QMovie *movie;
QPushButton *quit_;
QPushButton *upload_;
QPushButton *download_;
QPushButton *sure_radius_;
QPushButton *output_;
QLabel *now_path_;
QLineEdit *now_radius_;
paintWidget *paint_widget_ = NULL;
Insertion *insertion_ = NULL;
void setBaseButton(QWidget *mainwindow);
void setCNCButton(QWidget *mainwindow);
void setAllLabel(QWidget *mainwindow);
void outoutInit();
private slots:
void pushUploadButton();
void pushDownloadButton();
void pushSureRadiusButton();
void pushImgButton();
void pushLeftButton();
void pushRightButton();
void pushOutPutButton();
};
class loadWidget : public startWidget{
public:
loadWidget(QWidget *mainwindow);
~loadWidget();
private:
QLabel *Label;
QMovie *movie;
};
class paintWidget : public QMainWindow{
public:
int width_,height_;
workWidget *parent_;
QPainter *painter_;
paintWidget(workWidget *parent);
~paintWidget();
virtual void paintEvent(QPaintEvent *event);
private:
int src_x_ = 0;
int src_y_ = 0;
int scale_ = 1;
std::vector<DL_LineData> lines_{};
std::vector<DL_ArcData> arcs_{};
std::vector<DL_ArcData> draw_arcs_{};
std::vector<DL_PointData> points_{};
std::vector<DL_CircleData> circles_{};
void adjustScale();
};
class paintPath : public paintWidget{
public:
paintPath(workWidget *parent);
void paintEvent(QPaintEvent *event) override;
};
class paintOffset : public paintWidget{
public:
paintOffset(workWidget *parent);
void paintEvent(QPaintEvent *event) override;
};
#endif // WIDGET_H