cpp
#ifndef AEROTECHCONTROLLER_H
#define AEROTECHCONTROLLER_H
#include <QObject>
#include "A3200.h"
class AerotechController : public QObject
{
Q_OBJECT
public:
explicit AerotechController(QObject *parent = nullptr);
void connectController();
void disconnectController();
void enableX();
void disableX();
void homeX();
void enableY();
void disableY();
void homeY();
void enableZ();
void disableZ();
void homeZ();
signals:
private:
A3200Handle handle;
};
#endif // AEROTECHCONTROLLER_H
cpp
#include "aerotechcontroller.h"
AerotechController::AerotechController(QObject *parent)
: QObject{parent}
{
}
void AerotechController::connectController()
{
A3200Connect(&handle);
}
void AerotechController::disconnectController()
{
A3200Disconnect(handle);
}
//X轴相关操作
void AerotechController::enableX()
{
A3200MotionEnable(handle, TASKID_01, (AXISMASK)(AXISMASK_00));
}
void AerotechController::disableX()
{
A3200MotionDisable(handle, TASKID_01, (AXISMASK)(AXISMASK_00));
}
void AerotechController::homeX()
{
A3200MotionHome(handle, TASKID_01, (AXISMASK)(AXISMASK_00));
}
//Y轴相关操作
void AerotechController::enableY()
{
A3200MotionEnable(handle, TASKID_01, (AXISMASK)(AXISMASK_01));
}
void AerotechController::disableY()
{
A3200MotionDisable(handle, TASKID_01, (AXISMASK)(AXISMASK_01));
}
void AerotechController::homeY()
{
A3200MotionHome(handle, TASKID_01, (AXISMASK)(AXISMASK_01));
}
//Z轴相关操作
void AerotechController::enableZ()
{
A3200MotionEnable(handle, TASKID_01, (AXISMASK)(AXISMASK_02));
}
void AerotechController::disableZ()
{
A3200MotionDisable(handle, TASKID_01, (AXISMASK)(AXISMASK_02));
}
void AerotechController::homeZ()
{
A3200MotionHome(handle, TASKID_01, (AXISMASK)(AXISMASK_02));
}
工程文件:
cpp
HEADERS += \
$$PWD/aerotechcontroller.h
SOURCES += \
$$PWD/aerotechcontroller.cpp
LIBS += -L$$PWD/SDK/Aerotech/Lib64/ -lA3200C64
LIBS += -L$$PWD/SDK/Aerotech/Bin64 -lA3200C64
INCLUDEPATH += $$PWD/SDK/Aerotech/Include
INCLUDEPATH += $$PWD/SDK/Aerotech/Bin64
DEPENDPATH += $$PWD/SDK/Aerotech/Include