From 05f0938a65c4f8c330791097680e1e094260bb60 Mon Sep 17 00:00:00 2001 From: Nikita Kostovsky Date: Fri, 6 Mar 2026 20:40:29 +0100 Subject: refactoring --- src/printerclient.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/printerclient.h') diff --git a/src/printerclient.h b/src/printerclient.h index 189bfb5..232dad8 100644 --- a/src/printerclient.h +++ b/src/printerclient.h @@ -7,12 +7,20 @@ class QSerialPort; -class IStand +class IStand : public QObject { + Q_OBJECT + public: virtual ~IStand() = default; +signals: + void moveFinished(); + public: + virtual bool resetPosSteps() = 0; + virtual int posSteps() = 0; + virtual double posMm() = 0; /*! * \warning be careful when rounding mm to steps */ @@ -21,13 +29,16 @@ public: }; // TODO: think if QObject is needed -class Esp32Stand : public QObject, public IStand +class Esp32Stand : public IStand { public: explicit Esp32Stand(const QHostAddress &address, const uint32_t port, const uint32_t stepsPerMm); ~Esp32Stand() override = default; public: + bool resetPosSteps() override; + int posSteps() override; + double posMm() override; bool moveMm(const double mm) override; bool moveSteps(const int steps) override; @@ -35,6 +46,7 @@ private: QString m_apiRoot; uint32_t m_stepsPerMm{0}; QNetworkAccessManager *m_manager{nullptr}; + int m_posSteps{0}; }; class PrinterClient : public QObject -- cgit v1.3