-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_window.h
83 lines (56 loc) · 1.41 KB
/
main_window.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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include "IMCnet.h"
#include "IMC_Def.h"
#include "IMC_Pkg.h"
#include "ParamDef.h"
#define m_Naxis 4
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
void init();
protected:
void initAxis(int axis);
bool openIMC();
bool isOpen() const;
bool closeIMC();
bool MoveAbs(int pos, int axis);
bool WaitMoved(int axis);
bool StopPos2Pos(int axis);
bool PosEmstop(int axis);
bool SetHomeVel(int highvel, int lowvel, FIFO_SEL fifo);
IMC_STATUS FindHome(IMC16 direction, IMC16 RiseEdge, IMC16 stop, IMC16 useIndex, IMC32 axis);
void timerEvent(QTimerEvent* event) override;
void setConnectMotorFlag(bool flag);
void dispalyAngles();
private:
Ui::MainWindow *ui;
IMC_HANDLE m_Handle;
int m_netid;
int m_imcid;
int m_axis;
int m_pos;
int m_timeID;
int g_naxis;
int m_encp[m_Naxis];
int m_curpos[m_Naxis];
IMCU16 m_error[m_Naxis];
IMCU16 m_gin[2];
IMCU16 m_gout[2];
WR_MUL_DES m_encpDes[m_Naxis];
WR_MUL_DES m_curposDes[m_Naxis];
WR_MUL_DES m_errorDes[m_Naxis];
WR_MUL_DES m_ginDes[2];
WR_MUL_DES m_goutDes[2];
int m_angles[5];
int m_first;
int m_velocity;
};
#endif // MAINWINDOW_H