summaryrefslogtreecommitdiff
path: root/src/printerclient.h
diff options
context:
space:
mode:
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