diff --git a/src/atcore.h b/src/atcore.h --- a/src/atcore.h +++ b/src/atcore.h @@ -56,9 +56,8 @@ Q_PROPERTY(QStringList availableFirmwarePlugins READ availableFirmwarePlugins) Q_PROPERTY(quint16 serialTimerInterval READ serialTimerInterval WRITE setSerialTimerInterval) Q_PROPERTY(QStringList serialPorts READ serialPorts NOTIFY portsChanged) - Q_PROPERTY(QStringList portSpeeds READ portSpeeds) - Q_PROPERTY(QString connectedPort READ connectedPort) Q_PROPERTY(AtCore::STATES state READ state WRITE setState NOTIFY stateChanged) + Q_PROPERTY(float percentagePrinted READ percentagePrinted NOTIFY printProgressChanged) public: /** * @brief STATES enum Possible states the printer can be in @@ -116,7 +115,7 @@ * @brief connectedPort * @return the port atcore is connected to or empty string if none */ - QString connectedPort() const; + Q_INVOKABLE QString connectedPort() const; /** * @brief Initialize a connection to \p port at a speed of \p baud
@@ -130,7 +129,7 @@ /** * @brief Returns a list of valid baud speeds */ - QStringList portSpeeds() const; + Q_INVOKABLE QStringList portSpeeds() const; /** * @brief Main access to the serialLayer @@ -182,7 +181,7 @@ * @brief extruderCount * @return The number of detected Extruders Default is 1 */ - int extruderCount() const; + Q_INVOKABLE int extruderCount() const; /** * @brief Return printed percentage @@ -247,19 +246,19 @@ * @brief Public Interface for printing a file * @param fileName: the gcode file to print. */ - void print(const QString &fileName); + Q_INVOKABLE void print(const QString &fileName); /** * @brief Stop the Printer by empting the queue and aborting the print job (if running) * @sa emergencyStop(),pause(),resume() */ - void stop(); + Q_INVOKABLE void stop(); /** * @brief stop the printer via the emergency stop Command (M112) * @sa stop(),pause(),resume() */ - void emergencyStop(); + Q_INVOKABLE void emergencyStop(); /** * @brief pause an in process print job @@ -269,14 +268,14 @@ * @param pauseActions: Gcode to run after pausing commands are ',' separated * @sa resume(),stop(),emergencyStop() */ - void pause(const QString &pauseActions); + Q_INVOKABLE void pause(const QString &pauseActions); /** * @brief resume a paused print job. * After returning to location pause was triggered. * @sa pause(),stop(),emergencyStop() */ - void resume(); + Q_INVOKABLE void resume(); /** * @brief Send home \p axis command @@ -289,81 +288,81 @@ * @brief Send home all command * @sa home(uchar axis), move() */ - void home(); + Q_INVOKABLE void home(); /** * @brief Set extruder temperature * @param temp : new temperature * @param extruder : extruder number * @param andWait: True for heat and ignore commands until temperature is reached */ - void setExtruderTemp(uint temp = 0, uint extruder = 0, bool andWait = false); + Q_INVOKABLE void setExtruderTemp(uint temp = 0, uint extruder = 0, bool andWait = false); /** * @brief move an axis of the printer * @param axis the axis to move AXES (X Y Z E ) * @param arg the distance to move the axis or the place to move to depending on printer mode * @sa home(), home(uchar axis) */ - void move(AtCore::AXES axis, uint arg); + Q_INVOKABLE void move(AtCore::AXES axis, uint arg); /** * @brief Set the bed temperature * @param temp : new temperature * @param andWait: True for heat and ignore commands until temperature is reached * @sa setExtruderTemp() */ - void setBedTemp(uint temp = 0, bool andWait = false); + Q_INVOKABLE void setBedTemp(uint temp = 0, bool andWait = false); /** * @brief setFanSpeed set the fan speed * @param fanNumber: fan number * @param speed: new speed of the fan 0-100 */ - void setFanSpeed(uint speed = 0, uint fanNumber = 0); + Q_INVOKABLE void setFanSpeed(uint speed = 0, uint fanNumber = 0); /** * @brief Set printer to absolute position mode * @sa setRelativePosition() */ - void setAbsolutePosition(); + Q_INVOKABLE void setAbsolutePosition(); /** * @brief Set printer to relative position mode * @sa setAbsolutePosition() */ - void setRelativePosition(); + Q_INVOKABLE void setRelativePosition(); /** * @brief Disables idle hold of motors after a delay * @param delay: Seconds until idle hold is released. 0= No delay */ - void setIdleHold(uint delay = 0); + Q_INVOKABLE void setIdleHold(uint delay = 0); /** * @brief set the Printers speed * @param speed: speed in % (default is 100); */ - void setPrinterSpeed(uint speed = 100); + Q_INVOKABLE void setPrinterSpeed(uint speed = 100); /** * @brief set extruder Flow rate * @param rate: flow rate in % (default is 100) */ - void setFlowRate(uint rate = 100); + Q_INVOKABLE void setFlowRate(uint rate = 100); /** * @brief close any open items. * You should call this on close events to force any stuck jobs to close * @sa closeConnection() */ - void close(); + Q_INVOKABLE void close(); /** * @brief showMessage push a message to the printers LCD * @param message: message to show on the LCD */ - void showMessage(const QString &message); + Q_INVOKABLE void showMessage(const QString &message); /** * @brief setUnits sets the measurement units do be used