![]() |
AtCore
1.0.70
AtCore is a API to manage the serial connection between the computer and 3D Printers.
|
The AtCore class aims to provides a high level interface for serial based gcode devices
More...
#include <atcore.h>
Classes | |
| struct | AtCorePrivate |
| The AtCorePrivate struct Provides a private data set for atcore. More... | |
Public Types | |
| enum | STATES { DISCONNECTED, CONNECTING, IDLE, BUSY, PAUSE, ERRORSTATE, STOP, STARTPRINT, FINISHEDPRINT } |
| STATES enum Possible states the printer can be in. More... | |
| enum | AXES { X = 1 << 0, Y = 1 << 1, Z = 1 << 2, E = 1 << 3 } |
| The AXES enum - Printer Axes. More... | |
| enum | UNITS { METRIC, IMPERIAL } |
| The UNITS enum - Possible Mesurment Units. More... | |
Public Slots | |
| void | setState (AtCore::STATES state) |
| Set the printers state. More... | |
| Q_INVOKABLE void | pushCommand (const QString &comm) |
| Push a command into the command queue. More... | |
| Q_INVOKABLE void | print (const QString &fileName, bool sdPrint=false) |
| Public Interface for printing a file. More... | |
| Q_INVOKABLE void | stop () |
| Stop the Printer by empting the queue and aborting the print job (if running) More... | |
| Q_INVOKABLE void | emergencyStop () |
| stop the printer via the emergency stop Command (M112) More... | |
| void | pause (const QString &pauseActions) |
| pause an in process print job More... | |
| Q_INVOKABLE void | resume () |
| resume a paused print job. After returning to location pause was triggered. More... | |
| Q_INVOKABLE void | home (uchar axis) |
Send home axis command. More... | |
| Q_INVOKABLE void | home () |
| Send home all command. More... | |
| Q_INVOKABLE void | setExtruderTemp (uint temp=0, uint extruder=0, bool andWait=false) |
| Set extruder temperature. More... | |
| Q_INVOKABLE void | move (AtCore::AXES axis, double arg) |
| move an axis of the printer More... | |
| Q_INVOKABLE void | move (QLatin1Char axis, double arg) |
| move an axis of the printer More... | |
| Q_INVOKABLE void | setBedTemp (uint temp=0, bool andWait=false) |
| Set the bed temperature. More... | |
| Q_INVOKABLE void | setFanSpeed (uint speed=0, uint fanNumber=0) |
| setFanSpeed set the fan speed More... | |
| Q_INVOKABLE void | setAbsolutePosition () |
| Set printer to absolute position mode. More... | |
| Q_INVOKABLE void | setRelativePosition () |
| Set printer to relative position mode. More... | |
| Q_INVOKABLE void | disableMotors (uint delay=0) |
| Disable motors after a delay. More... | |
| Q_INVOKABLE void | setPrinterSpeed (uint speed=100) |
| set the Printers speed More... | |
| Q_INVOKABLE void | setFlowRate (uint rate=100) |
| set extruder Flow rate More... | |
| Q_INVOKABLE void | close () |
| close any open items. You should call this on close events to force any stuck jobs to close More... | |
| Q_INVOKABLE void | showMessage (const QString &message) |
| showMessage push a message to the printers LCD More... | |
| Q_INVOKABLE void | setUnits (AtCore::UNITS units) |
| setUnits sets the measurement units do be used More... | |
| void | setSerialTimerInterval (int newTime) |
| Set the time between checks for new serialPorts (0 is default) More... | |
| void | setTemperatureTimerInterval (int newTime) |
| Set the time between checks for new Temperature (5000 is default on new connections) More... | |
| void | setAutoTemperatureReport (bool autoReport) |
| Set if atcore should Enable auto temperature reporting. Temperature timer will also be stopped. More... | |
| Q_INVOKABLE void | setAutoCheckTemperatureInterval (int newTime) |
| Tell the machine to start reporting its temperature automaticly. More... | |
| Q_INVOKABLE void | sdDelete (const QString &fileName) |
| delete file from sd card More... | |
| void | sdCardPrintStatus () |
| Queue the Printer for status of sd card print. More... | |
Signals | |
| void | atcoreMessage (const QString &msg) |
| Message emit from atcore these should be displayed to the user for debug. More... | |
| void | extruderCountChanged (const int newCount) |
| New number of extruders. More... | |
| void | printProgressChanged (const float newProgress) |
| Print job's precentage changed. More... | |
| void | receivedMessage (const QByteArray &message) |
| New message was received from the printer. More... | |
| void | serialTimerIntervalChanged (const int newTime) |
| New interval for serial timer. More... | |
| void | temperatureTimerIntervalChanged (const int newTime) |
| New interval for temperature timer. More... | |
| void | autoTemperatureReportChanged (bool autoReport) |
| use of automatic temperature reporting has changed More... | |
| void | autoCheckTemperatureIntervalChanged (const int newTime) |
| New interval for automatic temperature report. More... | |
| void | stateChanged (AtCore::STATES newState) |
| The Printer's State Changed. More... | |
| void | portsChanged (const QStringList &portList) |
| Available serialports Changed. More... | |
| void | sdMountChanged (bool newState) |
| Sd Card Mount Changed. More... | |
| void | sdCardFileListChanged (const QStringList &fileList) |
| The files on the sd card have changed. More... | |
| void | pushedCommand (const QByteArray &comm) |
| pushedCommand via serialLayer connect this to your log to see send commands More... | |
| void | availableFirmwarePluginsChanged () |
| availableFirmwarePluginsChanged notify about the new plugins available More... | |
Public Member Functions | |
| AtCore (QObject *parent=nullptr) | |
| AtCore create a new instance of AtCore. More... | |
| ~AtCore ()=default | |
| QString | version () const |
| version More... | |
| QStringList | serialPorts () const |
| Returns a List of detected serial ports. More... | |
| QString | connectedPort () const |
| connectedPort More... | |
| Q_INVOKABLE bool | newConnection (const QString &port, int baud, const QString &fwName, bool disableROC=false) |
| Connect to a device. More... | |
| QStringList | portSpeeds () const |
| Returns a list of valid baud speeds. More... | |
| Q_INVOKABLE void | closeConnection () |
| Close the current serial connection. More... | |
| Q_INVOKABLE IFirmware * | firmwarePlugin () const |
| Main access to the loaded firmware plugin. More... | |
| QStringList | availableFirmwarePlugins () const |
| List of available firmware plugins. More... | |
| AtCore::STATES | state () |
| Get Printer state. More... | |
| int | extruderCount () const |
| extruderCount More... | |
| float | percentagePrinted () const |
| Return printed percentage. More... | |
| std::shared_ptr< BedDeform > | bedDeform () |
| The Bed Deform data as told by the Firmware. More... | |
| Temperature * | temperature () |
| The temperature of the current hotend as told by the Firmware. More... | |
| int | serialTimerInterval () const |
| Return the amount of miliseconds the serialTimer is set to. 0 = Disabled. More... | |
| int | temperatureTimerInterval () const |
| Return the amount of miliseconds the temperatureTimer is set to. 0 = Disabled. More... | |
| Q_INVOKABLE void | mountSd (uint slot=0) |
| Attempt to Mount an sd card. More... | |
| Q_INVOKABLE void | umountSd (uint slot=0) |
| Attempt to Unmount an sd card. More... | |
| QStringList | sdFileList () |
| sdFileList More... | |
| bool | isSdMounted () const |
| Check if an sd card is mounted on the printer. More... | |
| bool | autoTemperatureReport () const |
| Check if using automatic Temperature reporting to monitor temperatures. More... | |
Protected Member Functions | |
| void | setExtruderCount (int newCount) |
| Set the number of extruders on the machine. More... | |
| void | appendSdCardFileList (const QString &fileName) |
| Append a file to AtCorePrivate::sdCardFileList. More... | |
| void | clearSdCardFileList () |
| Clear AtCorePrivate::sdCardFileList. More... | |
| void | setSdMounted (const bool mounted) |
| Set if the sd card is mounted by the printer. More... | |
| void | setReadingSdCardList (bool readingList) |
| set AtCorePrivate::sdCardReadingFileList More... | |
Properties | |
| QString | version |
| QStringList | availableFirmwarePlugins |
| int | extruderCount |
| int | temperatureTimerInterval |
| int | serialTimerInterval |
| QStringList | serialPorts |
| float | percentagePrinted |
| QStringList | portSpeeds |
| QString | connectedPort |
| AtCore::STATES | state |
| bool | sdMount |
| QStringList | sdFileList |
| bool | autoTemperatureReport |
| Temperature | temperature |
Private Slots | |
| void | processQueue () |
| processQueue send commands from the queue. More... | |
| void | checkTemperature () |
| Send M105 to the printer if one is not in the Queue. More... | |
| void | newMessage (const QByteArray &message) |
| Connect to SerialLayer::receivedCommand. More... | |
| void | newCommand (const QByteArray &command) |
| Connect to SerialLayer::pushedCommand. More... | |
| void | findFirmware (const QByteArray &message) |
| Search for firmware string in message. A Helper function for Firmware detection. More... | |
| void | locateSerialPort () |
| Search for new serial ports. More... | |
| void | disableResetOnConnect (const QString &port) |
| Attempts to disableResetOnConnect for the selected port. More... | |
| void | getSDFileList () |
| Send request to the printer for the sd card file list. More... | |
| void | handleSerialError (QSerialPort::SerialPortError error) |
| Handle serial Errors. More... | |
Private Member Functions | |
| Q_INVOKABLE void | loadFirmwarePlugin (const QString &fwName) |
| Load A firmware plugin. More... | |
| bool | firmwarePluginLoaded () const |
| True if a firmware plugin is loaded. More... | |
| bool | serialInitialized () const |
| True if a serial port is initialized. More... | |
| void | requestFirmware () |
| send firmware request to the printer More... | |
| QMap< QString, QString > | findFirmwarePlugins (const QString &path) |
| Search for atcore firmware plugins. More... | |
| bool | isReadingSdCardList () const |
| returns AtCorePrivate::sdCardReadingFileList More... | |
| void | stopSdPrint () |
| stops print just for sd prints used internally More... | |
| void | waitForPrinterReboot (const QByteArray &message, const QString &fwName) |
| New connections need to wait for the machine to be ready if it needs reboot. More... | |
Private Attributes | |
| AtCorePrivate * | d |
Friends | |
| class | AtCoreTests |
| class | RepetierPlugin |
| class | MarlinPlugin |
The AtCore class aims to provides a high level interface for serial based gcode devices
AtCore will check each directory below for plugins.
| enum AtCore::AXES |
| enum AtCore::STATES |
STATES enum Possible states the printer can be in.
| enum AtCore::UNITS |
|
explicit |
|
default |
|
protected |
Append a file to AtCorePrivate::sdCardFileList.
| fileName | new FileName |
|
signal |
Message emit from atcore these should be displayed to the user for debug.
Possable Messages Are:
| msg | the message. |
|
signal |
New interval for automatic temperature report.
| bool AtCore::autoTemperatureReport | ( | ) | const |
Check if using automatic Temperature reporting to monitor temperatures.
|
signal |
use of automatic temperature reporting has changed
| autoReport | True if using automatic Reporting mode. |
| QStringList AtCore::availableFirmwarePlugins | ( | ) | const |
List of available firmware plugins.
|
signal |
availableFirmwarePluginsChanged notify about the new plugins available
| std::shared_ptr< BedDeform > AtCore::bedDeform | ( | ) |
The Bed Deform data as told by the Firmware.
|
privateslot |
Send M105 to the printer if one is not in the Queue.
|
protected |
|
slot |
close any open items. You should call this on close events to force any stuck jobs to close
| void AtCore::closeConnection | ( | ) |
Close the current serial connection.
| QString AtCore::connectedPort | ( | ) | const |
connectedPort
|
slot |
Disable motors after a delay.
| delay | Seconds until motors are disabled. 0= No delay |
|
privateslot |
Attempts to disableResetOnConnect for the selected port.
| port | the port. |
|
slot |
| int AtCore::extruderCount | ( | ) | const |
extruderCount
|
signal |
New number of extruders.
|
privateslot |
Search for firmware string in message. A Helper function for Firmware detection.
| message |
|
private |
Search for atcore firmware plugins.
| path | the path to check |
| IFirmware * AtCore::firmwarePlugin | ( | ) | const |
Main access to the loaded firmware plugin.
|
private |
True if a firmware plugin is loaded.
|
privateslot |
Send request to the printer for the sd card file list.
|
privateslot |
Handle serial Errors.
|
slot |
|
slot |
Send home all command.
|
private |
returns AtCorePrivate::sdCardReadingFileList
| bool AtCore::isSdMounted | ( | ) | const |
Check if an sd card is mounted on the printer.
|
private |
Load A firmware plugin.
| fwName | : name of the firmware |
|
privateslot |
Search for new serial ports.
| void AtCore::mountSd | ( | uint | slot = 0 | ) |
Attempt to Mount an sd card.
| slot | Sd card Slot on machine (0 is default) |
|
slot |
move an axis of the printer
| axis | the axis to move AXES (X Y Z E ) |
| arg | the distance to move the axis or the place to move to depending on printer mode |
|
slot |
move an axis of the printer
| axis | the axis to move AXES (X Y Z E ) |
| arg | the distance to move the axis or the place to move to depending on printer mode |
|
privateslot |
Connect to SerialLayer::pushedCommand.
| command | newCommand. |
| bool AtCore::newConnection | ( | const QString & | port, |
| int | baud, | ||
| const QString & | fwName, | ||
| bool | disableROC = false |
||
| ) |
Connect to a device.
| port | the port to initialize |
| baud | the baud of the port |
| fwName | Firmware name of plugin to use (will try to autodetect if fwName is unknown) |
| disableROC | atcore will attempt to disable reset on connect for this device. |
|
privateslot |
Connect to SerialLayer::receivedCommand.
| message | new message. |
|
slot |
pause an in process print job
Sends M114 on pause to store the location where the head stoped. This is known to cause problems on fake printers
| pauseActions | Gcode to run after pausing commands are ',' separated |
| float AtCore::percentagePrinted | ( | ) | const |
Return printed percentage.
|
signal |
Available serialports Changed.
| QStringList AtCore::portSpeeds | ( | ) | const |
Returns a list of valid baud speeds.
|
slot |
Public Interface for printing a file.
| fileName | the gcode file to print. |
| sdPrint | set true to print fileName from Sd card |
|
signal |
|
privateslot |
processQueue send commands from the queue.
|
slot |
Push a command into the command queue.
| comm | : Command |
|
signal |
pushedCommand via serialLayer connect this to your log to see send commands
| comm | the command sent. |
|
signal |
New message was received from the printer.
| message | Message that was received |
|
private |
send firmware request to the printer
|
slot |
resume a paused print job. After returning to location pause was triggered.
|
signal |
The files on the sd card have changed.
|
slot |
Queue the Printer for status of sd card print.
|
slot |
delete file from sd card
| QStringList AtCore::sdFileList | ( | ) |
sdFileList
|
signal |
Sd Card Mount Changed.
|
private |
True if a serial port is initialized.
| QStringList AtCore::serialPorts | ( | ) | const |
Returns a List of detected serial ports.
| int AtCore::serialTimerInterval | ( | ) | const |
Return the amount of miliseconds the serialTimer is set to. 0 = Disabled.
|
signal |
New interval for serial timer.
|
slot |
Set printer to absolute position mode.
|
slot |
Tell the machine to start reporting its temperature automaticly.
| newTime | Time in seconds between reports (0: disabled) |
|
slot |
Set if atcore should Enable auto temperature reporting. Temperature timer will also be stopped.
| autoReport | True to enable automatic reporting of temperatures. |
|
slot |
Set the bed temperature.
| temp | : new temperature |
| andWait | True for heat and ignore commands until temperature is reached |
|
protected |
Set the number of extruders on the machine.
| newCount |
|
slot |
Set extruder temperature.
| temp | : new temperature |
| extruder | : extruder number |
| andWait | True for heat and ignore commands until temperature is reached |
|
slot |
setFanSpeed set the fan speed
| fanNumber | fan number |
| speed | new speed of the fan 0-100 |
|
slot |
set extruder Flow rate
| rate | flow rate in % (default is 100) |
|
slot |
set the Printers speed
| speed | speed in % (default is 100); |
|
protected |
set AtCorePrivate::sdCardReadingFileList
| readingList | set true if reading file list |
|
slot |
Set printer to relative position mode.
|
protected |
Set if the sd card is mounted by the printer.
| mounted | True is mounted |
|
slot |
Set the time between checks for new serialPorts (0 is default)
| newTime | Milliseconds between checks. values <= 0 will Disable Checks. |
|
slot |
Set the printers state.
| state | : printer state. |
|
slot |
Set the time between checks for new Temperature (5000 is default on new connections)
| newTime | Milliseconds between checks. values <= 0 will Disable Checks. |
|
slot |
setUnits sets the measurement units do be used
| units | : the measurement units to use(METRIC / IMPERIAL) |
|
slot |
showMessage push a message to the printers LCD
| message | message to show on the LCD |
| AtCore::STATES AtCore::state | ( | ) |
|
signal |
The Printer's State Changed.
| newState | : the new state of the printer |
|
slot |
Stop the Printer by empting the queue and aborting the print job (if running)
|
private |
stops print just for sd prints used internally
| Temperature* AtCore::temperature | ( | ) |
The temperature of the current hotend as told by the Firmware.
| int AtCore::temperatureTimerInterval | ( | ) | const |
Return the amount of miliseconds the temperatureTimer is set to. 0 = Disabled.
|
signal |
New interval for temperature timer.
| void AtCore::umountSd | ( | uint | slot = 0 | ) |
Attempt to Unmount an sd card.
| slot | Sd card Slot on machine (0 is default) |
| QString AtCore::version | ( | ) | const |
version
|
private |
New connections need to wait for the machine to be ready if it needs reboot.
| message | message from the firmware |
| fwName | fwName to load |
|
friend |
|
friend |
|
friend |
|
private |
|
readwrite |
|
read |
|
read |
|
readwrite |
|
read |
|
read |
|
read |
|
readwrite |
|
read |
|
readwrite |
|
readwrite |
|
read |
|
readwrite |
|
read |
1.8.13