28 #include <QSerialPort> 29 #include <QSerialPortInfo> 32 #include "atcore_export.h" 60 class ATCORE_EXPORT
AtCore :
public QObject
63 Q_PROPERTY(QString version READ version CONSTANT)
64 Q_PROPERTY(QStringList availableFirmwarePlugins READ availableFirmwarePlugins NOTIFY availableFirmwarePluginsChanged)
65 Q_PROPERTY(
int extruderCount READ extruderCount WRITE setExtruderCount NOTIFY extruderCountChanged)
66 Q_PROPERTY(
int temperatureTimerInterval READ temperatureTimerInterval WRITE setTemperatureTimerInterval NOTIFY temperatureTimerIntervalChanged);
67 Q_PROPERTY(
int serialTimerInterval READ serialTimerInterval WRITE setSerialTimerInterval NOTIFY serialTimerIntervalChanged)
68 Q_PROPERTY(QStringList serialPorts READ serialPorts NOTIFY portsChanged)
69 Q_PROPERTY(
float percentagePrinted READ percentagePrinted NOTIFY printProgressChanged)
70 Q_PROPERTY(QStringList portSpeeds READ portSpeeds CONSTANT)
71 Q_PROPERTY(QString connectedPort READ connectedPort CONSTANT)
72 Q_PROPERTY(
AtCore::
STATES state READ state WRITE setState NOTIFY stateChanged)
73 Q_PROPERTY(
bool sdMount READ isSdMounted WRITE setSdMounted NOTIFY sdMountChanged)
74 Q_PROPERTY(QStringList sdFileList READ sdFileList NOTIFY sdCardFileListChanged)
75 Q_PROPERTY(
bool autoTemperatureReport READ autoTemperatureReport WRITE setAutoTemperatureReport NOTIFY autoTemperatureReportChanged)
76 Q_PROPERTY(
Temperature *temperature READ temperature CONSTANT)
78 friend class AtCoreTests;
125 explicit AtCore(QObject *parent =
nullptr);
132 QString version()
const;
139 QStringList serialPorts()
const;
145 QString connectedPort()
const;
156 Q_INVOKABLE
bool newConnection(
const QString &port,
int baud,
const QString &fwName,
bool disableROC =
false);
161 QStringList portSpeeds()
const;
167 Q_INVOKABLE
void closeConnection();
174 Q_INVOKABLE
IFirmware *firmwarePlugin()
const;
180 QStringList availableFirmwarePlugins()
const;
194 int extruderCount()
const;
200 float percentagePrinted()
const;
205 std::shared_ptr<BedDeform> bedDeform();
215 int serialTimerInterval()
const;
220 int temperatureTimerInterval()
const;
226 Q_INVOKABLE
void mountSd(uint slot = 0);
232 Q_INVOKABLE
void umountSd(uint slot = 0);
238 QStringList sdFileList();
244 bool isSdMounted()
const;
250 bool autoTemperatureReport()
const;
264 void atcoreMessage(
const QString &msg);
270 void extruderCountChanged(
const int newCount);
277 void printProgressChanged(
const float newProgress);
283 void receivedMessage(
const QByteArray &message);
289 void serialTimerIntervalChanged(
const int newTime);
295 void temperatureTimerIntervalChanged(
const int newTime);
301 void autoTemperatureReportChanged(
bool autoReport);
307 void autoCheckTemperatureIntervalChanged(
const int newTime);
319 void portsChanged(
const QStringList &portList);
324 void sdMountChanged(
bool newState);
329 void sdCardFileListChanged(
const QStringList &fileList);
335 void pushedCommand(
const QByteArray &comm);
340 void availableFirmwarePluginsChanged();
356 Q_INVOKABLE
void pushCommand(
const QString &comm);
363 Q_INVOKABLE
void print(
const QString &fileName,
bool sdPrint =
false);
369 Q_INVOKABLE
void stop();
375 Q_INVOKABLE
void emergencyStop();
385 void pause(
const QString &pauseActions);
392 Q_INVOKABLE
void resume();
399 Q_INVOKABLE
void home(uchar axis);
405 Q_INVOKABLE
void home();
413 Q_INVOKABLE
void setExtruderTemp(uint temp = 0, uint extruder = 0,
bool andWait =
false);
429 Q_INVOKABLE
void move(QLatin1Char axis,
double arg);
437 Q_INVOKABLE
void setBedTemp(uint temp = 0,
bool andWait =
false);
444 Q_INVOKABLE
void setFanSpeed(uint speed = 0, uint fanNumber = 0);
450 Q_INVOKABLE
void setAbsolutePosition();
456 Q_INVOKABLE
void setRelativePosition();
462 Q_INVOKABLE
void disableMotors(uint delay = 0);
468 Q_INVOKABLE
void setPrinterSpeed(uint speed = 100);
474 Q_INVOKABLE
void setFlowRate(uint rate = 100);
481 Q_INVOKABLE
void close();
487 Q_INVOKABLE
void showMessage(
const QString &message);
500 void setSerialTimerInterval(
int newTime);
506 void setTemperatureTimerInterval(
int newTime);
512 void setAutoTemperatureReport(
bool autoReport);
518 Q_INVOKABLE
void setAutoCheckTemperatureInterval(
int newTime);
523 Q_INVOKABLE
void sdDelete(
const QString &fileName);
528 void sdCardPrintStatus();
539 void checkTemperature();
545 void newMessage(
const QByteArray &message);
551 void newCommand(
const QByteArray &command);
558 void findFirmware(
const QByteArray &message);
563 void locateSerialPort();
569 void disableResetOnConnect(
const QString &port);
574 void getSDFileList();
579 void handleSerialError(QSerialPort::SerialPortError error);
587 Q_INVOKABLE
void loadFirmwarePlugin(
const QString &fwName);
592 bool firmwarePluginLoaded()
const;
597 bool serialInitialized()
const;
602 void requestFirmware();
609 QMap<QString, QString> findFirmwarePlugins(
const QString &path);
615 bool isReadingSdCardList()
const;
628 void waitForPrinterReboot(
const QByteArray &message,
const QString &fwName);
642 void setExtruderCount(
int newCount);
647 void appendSdCardFileList(
const QString &fileName);
652 void clearSdCardFileList();
658 void setSdMounted(
const bool mounted);
664 void setReadingSdCardList(
bool readingList);
The Temperature class.
Definition: temperature.h:35
Just Finished print job.
Definition: atcore.h:100
The IFirmware class Base Class for Firmware Plugins.
Definition: ifirmware.h:39
The AtCore class aims to provides a high level interface for serial based gcode devices ...
Definition: atcore.h:60
Printer Returned Error.
Definition: atcore.h:97
Connected to printer and ready for commands.
Definition: atcore.h:94
The RepetierPlugin class Plugin for Repetier.
Definition: repetierplugin.h:34
Printer is paused.
Definition: atcore.h:96
The AtCorePrivate struct Provides a private data set for atcore.
Definition: atcore.cpp:50
The MarlinPlugin class Plugin for Marlin.
Definition: marlinplugin.h:34
AtCorePrivate * d
Definition: atcore.h:633
UNITS
The UNITS enum - Possible Mesurment Units.
Definition: atcore.h:116
AXES
The AXES enum - Printer Axes.
Definition: atcore.h:106
Stop Printing and Clean Queue.
Definition: atcore.h:98
Just Starting a print job.
Definition: atcore.h:99
The SerialLayer class. Provide the low level serial operations.
Definition: seriallayer.h:35
Not Connected to a printer, initial state.
Definition: atcore.h:92
Attempting to connect, Fw not probed.
Definition: atcore.h:93
Printer is Printing or working.
Definition: atcore.h:95
STATES
STATES enum Possible states the printer can be in.
Definition: atcore.h:91
Metric Units (Meters)
Definition: atcore.h:117