-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathcamexpert.h
More file actions
294 lines (272 loc) · 8.19 KB
/
camexpert.h
File metadata and controls
294 lines (272 loc) · 8.19 KB
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
#ifndef CAMEXPERT_H
#define CAMEXPERT_H
/*
************************************
*** @Xu Xu
*** @2017.05.10
*** @NanJing,China
*** @Hananiahhsu@live.cn
************************************
*/
#include <QMainWindow>
#include <QMdiArea>
#include <QSplitter>
#include <QTreeView>
#include "cam_importmat.h"
#include "cam_newmaterial.h"
#include "cam_newprt.h"
#include "cam_importprt.h"
#include <QStandardItem>
#include <QtGui>
#include <QWidget>
#include <QFileDialog>
#include <QVector>
#include <QDesktopWidget>
#include "CamDxf/camdxf.h"
#include "CamDxf/campart.h"
#include "CamDxf/camscene.h"
#include "StringOperation/stringoperation.h"
namespace Ui {
class CAMExpert;
}
//value of row
class RowData
{
public:
RowData(){}
~RowData(){}
public:
RowData(QString qs_0,QString qs_1,QString qs_2,QString qs_3,QString qs_4,QString qs_5,QString qs_6,QString qs_7)
{
row_v_0 = qs_0;
row_v_1 = qs_1;
row_v_2 = qs_2;
row_v_3 = qs_3;
row_v_4 = qs_4;
row_v_5 = qs_5;
row_v_6 = qs_6;
row_v_7 = qs_7;
}
public:
void RowData::operator=(const RowData& rd)
{
row_v_0 = rd.row_v_0;
row_v_1 = rd.row_v_1;
row_v_2 = rd.row_v_2;
row_v_3 = rd.row_v_3;
row_v_4 = rd.row_v_4;
row_v_5 = rd.row_v_5;
row_v_6 = rd.row_v_6;
row_v_7 = rd.row_v_7;
}
bool operator ==(const RowData& rd)
{
if(row_v_0 == rd.row_v_0 &&
row_v_1 == rd.row_v_1 &&
row_v_2 == rd.row_v_2 &&
row_v_3 == rd.row_v_3 &&
row_v_4 == rd.row_v_4 &&
row_v_5 == rd.row_v_5 &&
row_v_6 == rd.row_v_6 &&
row_v_7 == rd.row_v_7)
{
return true;
}
else
{
return false;
}
}
public:
QString row_v_0;
QString row_v_1;
QString row_v_2;
QString row_v_3;
QString row_v_4;
QString row_v_5;
QString row_v_6;
QString row_v_7;
};
//value of col
class ColData
{
QString col_v_0;
QString col_v_1;
QString col_v_2;
QString col_v_3;
QString col_v_4;
QString col_v_5;
QString col_v_6;
QString col_v_7;
};
class CAMExpert : public QMainWindow
{
Q_OBJECT
public:
explicit CAMExpert(QWidget *parent = 0);
~CAMExpert();
private:
Ui::CAMExpert *ui;
public:
//screen info params
int screen_w;
int screen_h;
//functions of scn
void GetScreenInfos();
//operation of strings
StringOperations st_op;
public:
QGraphicsView *plate_graphic_view;
QGraphicsView *plate_graphics_preview;
QGraphicsView *prt_view;//for preview of prt
Part *prt;
CamScene *plate_preView_scene;
CamScene *plate_scene;
CamScene *prt_preview_scene;
DL_Dxf *dl_dxf;
CamDxf cam_dxf;
public:
CAM_ImportMat *CAM_IMPORT_WIN;
CAM_NewMaterial *CAM_NEWMAT_WIN;
CAM_NewPrt *CAM_NEWPRT_WIN;
CAM_ImportPrt *CAM_IMPORTPRT_WIN;
QFileDialog *DXF_WIN;//USELESS
QList<WId> p_cam_impmat_win_list;
QList<WId> p_cam_newmat_win_list;
int cam_impmat_show_times=0;
int cam_newmat_show_times=0;
int cam_newprt_show_times = 0;
int cam_impprt_show_times = 0;
QString mat_name_from_NEWMAT;
QString mat_thick_from_NEWMAT;
QStandardItemModel * model_plate_tableView;
QStandardItemModel * model_prt_tableView;
public:
//All widgets and files
QIcon cam_newprt_win_icon;
QIcon cam_impprt_win_icon;
public:
//palette
QPalette errorText;
QPalette successText;
//Right menu for tableview of plate
QMenu *right_menu;
QAction *QA_del_row;
QAction *QA_copy_row;
QAction *QA_paste_row;
QAction *QA_cut_row;
QList<QModelIndex> TB_index_list;//store the indexes choosed by clicking
QList<QModelIndex> TB_cut_template;//for cut operation
QList<QModelIndex> TB_copy_template;//for copy
QList<RowData> TB_row_data_list;//set of clicked items
QList<RowData> TB_row_data_cut_list;//set of cutted items
QList<RowData> TB_row_data_cpy_list;//set of copied items
private:
// QSplitter *m_h_Spliter,*m_r_Splitter;
// QTreeView *m_left_treeView;
// QWidget *child_dialog_new_prt;
// QWidget *child_dialog_new_layout;
// QDialog *child_dialog_new_prt_01;
void CamSigSlotsManage();
void CamDockWinManage();
void CamEventMananger();
void CamListener();
void closeEvent(QCloseEvent *evnt);
void createRightMenu();
//delete,cut,copy and paste rows of tableView
void TableViewDelRow();
void TableViewCutRow();
void TableViewCopyRow();
void TableViewPasteRow();
//remove repeated index item of TB_index_list
void RemoveRepeatedIndex();
//Refresh the tableview of plate after editting
void RefreshTBIndex();
//create the scene
void CreateScene();
//layout the docks
void CamLayoutDocks();
public:
//Functions related
//open file with specific format such as Dxf...
void CamOpenDxfFile(QString qs_dxf);
private slots:
void on_new_order_triggered();
void on_quit_triggered();
void on_new_mat_triggered();
void on_new_layout_triggered();
void on_new_prt_triggered();
void on_save_order_triggered();
void on_history_order_triggered();
void on_import_2_triggered();
void on_export_2_triggered();
void on_run_triggered();
void on_send_triggered();
void on_print_preview_triggered();
void on_print_triggered();
void on_open_layout_triggered();
void on_print_layout_triggered();
void on_open_all_layout_triggered();
void on_equipments_triggered();
void on_materials_triggered();
void on_manufs_triggered();
void on_cost_triggered();
void on_calculator_triggered();
void on_about_triggered();
void on_help_files_triggered();
void on_Line_triggered();
void on_Arc_triggered();
void on_Text_triggered();
void on_Circle_triggered();
void on_Ellipse_triggered();
void on_Polygon_triggered();
void on_Copy_triggered();
void on_Dimension_triggered();
void on_Choose_triggered();
void on_Translation_triggered();
void on_Rotation_triggered();
void on_Delete_triggered();
void on_Offset_triggered();
void on_Line_Color_triggered();
void on_Line_Type_triggered();
void on_Line_Width_triggered();
//Dock of new material
void on_pushButton_NewMat_clicked();
void on_pushButton_importMat_clicked();
//Dock of new prt
void on_new_prt_btn_newprt_clicked();
void on_new_prt_btn_addprt_clicked();
//slot of Action for del,cut,copy and paste
void on_qa_del_row();
void on_qa_cut_row();
void on_qa_copy_row();
void on_qa_paste_row();
void on_tableView_item_clicked();
//self-defined slots
public slots:
//For Dock
void on_cam_importmat_win_destroy();
void on_cam_newmat_win_destroy();
void on_cam_newprt_win_destroyed();//6.6
void on_cam_impprt_win_destroyed();//6.6
//For TableView of plate
void on_cam_newmat_win_receiveData(QString qs_name,QString qs_thick);
//For opening dxf files
void on_cam_importmat_win_receiveData(QStringList dxf_list);
void on_cam_importmat_win_openfiles(QString file);
void on_cam_importprt_win_openfiles(QString file);
//For right menu of TableView of plate
void on_cam_right_menu_tableView(QPoint);
void on_cam_newprt_rev_params(QString name_mat,
QString len,
QString width,
QString mat,
QString thick_mat,
QString qty,
QString no,
bool is_rot);
protected:
//Event management
virtual void customEvent(QEvent * event,QObject * obj);
};
#endif // CAMEXPERT_H