-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow_0.h
152 lines (104 loc) · 2.91 KB
/
mainwindow_0.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include "zmotion.h"
#include "zmcaux.h"
#include <QComboBox>
#include <QObject>
#include <QButtonGroup>
#include <QTimerEvent>
#include <QtSerialPort/QSerialPort>
#include <QtSerialPort/QSerialPortInfo>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
float m_acc = 0.0f;
float m_creep = 0.0f;
int m_datumin = -1;
float m_dec = 0.0f;
float m_lspeed = 0.0f;
int m_nAxis = 0;
float m_speed = 0.0f;
float m_units = 0.0f;
int m_datummode = 0;
ZMC_HANDLE g_handle;
int id1=0;
~MainWindow();
void setLimitedPos();
void backZero(); //Zero
void xMoveTO(float distance); //Move to distance...
void yMoveTo(float distance);
void zMoveTo(float distance);
//单双切换阀
void switchChannal(int number);
void injector(char* command, int length);
void initFgtUi();
void initPorts(); //open com port to commuinicate with switch and injector
void loadSpeed();
protected:
//这是一个虚函数,从QEvent继承而来.
void timerEvent(QTimerEvent*event);
private slots:
void on_open_clicked();
void on_close_clicked();
void on_Start_clicked();
void on_Stop_clicked();
void on_Clear_clicked();
void on_btnClear_clicked(); //clear all alarm.
void on_radio_X_clicked();
void on_radio_Y_clicked();
void on_radi_Z_clicked();
void on_radio_R_clicked();
void on_btnOriginX_clicked();
void on_btnOriginY_clicked();
void on_btnOriginZ_clicked();
void on_btnXAdd_clicked();
void on_btnYAdd_clicked();
void on_btnZAdd_clicked();
void on_btnXSub_clicked();
void on_btnYSub_clicked();
void on_btnZSub_clicked();
void on_btnIO1_clicked();
void on_btnIO2_clicked();
void on_btnIO3_clicked();
//functions
void on_btnReset_clicked();
void on_btnRun_clicked();
void on_btnCamera_clicked();
void on_btnChannal_clicked();
void on_btnXGo_clicked();
void on_btnYGo_clicked();
void on_btnZGo_clicked();
void on_btnTestGo_clicked();
void on_btnOrigin_clicked();
void on_btnFgtInit_clicked();
void on_btnFgtSet_clicked();
void on_btnSw1_clicked();
void on_btnSw2_clicked();
void on_btnA6000_clicked();
void on_btnA0_clicked();
void on_btn1IR_clicked();
void on_btn1OR_clicked();
void on_btnExit_clicked();
void on_btnStop_clicked();
void on_btnSpeedSet_clicked();
private:
Ui::MainWindow *ui;
QButtonGroup *bt;
bool bfgt = false;
bool io1 = true;
bool io2 = true;
bool io3 = true;
float m_xLimit = 1000;
float m_yLimit = 1000;
float m_zLimit = 1000;
QSerialPort* m_port1; //切换阀
QSerialPort* m_port2; //注射泵
void Update_Para();
};
#endif // MAINWINDOW_H