diff options
| author | Nikita Kostovsky <nikita@kostovsky.me> | 2026-02-26 16:33:12 +0100 |
|---|---|---|
| committer | Nikita Kostovsky <nikita@kostovsky.me> | 2026-02-26 16:33:12 +0100 |
| commit | a688e436f03309d5813b68a375f694412018ca0b (patch) | |
| tree | 8a5cdbb170fbb8417de42a09832d2eaf527ff61e /src/printerclient.h | |
| parent | 1664027209ea3b8eb327b7755e4111577e66a2ee (diff) | |
add sync moveSteps
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 |
