Frontend to the famous GRBL.

outputdevicegrbl.h 1.4KB

    /* Part of x2grbl * * Copyright Johann Wilhelm <> 2015 * * see for detailed license and usage information! */ #ifndef OUTPUTDEVICEGRBL_H #define OUTPUTDEVICEGRBL_H #include <gcodeoutputdevice.h> #include <QObject> #include <qextserialport.h> #include <QHash> #include <QQueue> #include <QTimer> class OutputDeviceGrbl : public GCodeOutputDevice { Q_OBJECT public: OutputDeviceGrbl(QObject *parent=0); virtual bool supported(GCode &Cmd); virtual bool Run(GCode &Cmd); virtual QString name(); void tryConnect(QString PortName); bool isConnected(); virtual void Reset(); virtual void goHome(); protected: void parseResponse(QString Response); public slots: void Disconnect(); signals: void Connecting(); void Connected(); void Disconnected(); void Error(QString Error); void Failed(); void Finished(); void ProgressUpdate(float Progress); protected: void sendCommand(GCode Cmd); public slots: void dataAvailable(); void requestStatusUpdate(); protected: QHash<int, QString> GrblConfig; QString VersionString; QByteArray Buffer; QextSerialPort SerialPort; QQueue<GCode> SendQueue; bool isSending; bool isConnecting; int sentCmds; QTimer statusUpdateTimer; }; #endif // OUTPUTDEVICEGRBL_H