Aerotech系列文章(5)QT下Aerotech控制器类的设计

#ifndef AEROTECHCONTROLLER_H
#define AEROTECHCONTROLLER_H

#include 

#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
#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));
}

工程文件:

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

你可能感兴趣的:(qt,aerotech,a3200,c++)