diff options
Diffstat (limited to 'src/printerclient.h')
| -rw-r--r-- | src/printerclient.h | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/src/printerclient.h b/src/printerclient.h index d1266dd..189bfb5 100644 --- a/src/printerclient.h +++ b/src/printerclient.h @@ -1,11 +1,42 @@ #pragma once +#include <QHostAddress> +#include <QNetworkAccessManager> #include <QObject> - #include <QSerialPort> class QSerialPort; +class IStand +{ +public: + virtual ~IStand() = default; + +public: + /*! + * \warning be careful when rounding mm to steps + */ + virtual bool moveMm(const double mm) = 0; + virtual bool moveSteps(const int steps) = 0; +}; + +// TODO: think if QObject is needed +class Esp32Stand : public QObject, public IStand +{ +public: + explicit Esp32Stand(const QHostAddress &address, const uint32_t port, const uint32_t stepsPerMm); + ~Esp32Stand() override = default; + +public: + bool moveMm(const double mm) override; + bool moveSteps(const int steps) override; + +private: + QString m_apiRoot; + uint32_t m_stepsPerMm{0}; + QNetworkAccessManager *m_manager{nullptr}; +}; + class PrinterClient : public QObject { // Q_OBJECT |
