summaryrefslogtreecommitdiff
path: root/src/printerclient.h
diff options
context:
space:
mode:
authorNikita Kostovsky <nikita@kostovsky.me>2026-03-06 20:40:29 +0100
committerNikita Kostovsky <nikita@kostovsky.me>2026-03-06 20:40:29 +0100
commit05f0938a65c4f8c330791097680e1e094260bb60 (patch)
treed11e48c96eed6de03c51b793081310d96dee8618 /src/printerclient.h
parent051cb23a807a6914e2cda7e3b08d69ed29f347dd (diff)
refactoring
Diffstat (limited to 'src/printerclient.h')
-rw-r--r--src/printerclient.h16
1 files changed, 14 insertions, 2 deletions
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