![]() |
AtCore 1.0.72
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. | |
Q_INVOKABLE void | updateFWPlugins () |
updateFWPlugins Check for new Firmware plugins. | |
Q_INVOKABLE void | pushCommand (const QString &comm) |
Push a command into the command queue. | |
Q_INVOKABLE void | print (const QString &fileName, bool sdPrint=false) |
Public Interface for printing a file. | |
Q_INVOKABLE void | stop () |
Stop the Printer by empting the queue and aborting the print job (if running) | |
Q_INVOKABLE void | emergencyStop () |
stop the printer via the emergency stop Command (M112) | |
void | pause (const QString &pauseActions) |
pause an in process print job | |
Q_INVOKABLE void | resume () |
resume a paused print job. After returning to location pause was triggered. | |
Q_INVOKABLE void | home (uchar axis) |
Send home axis command. | |
Q_INVOKABLE void | home () |
Send home all command. | |
Q_INVOKABLE void | setExtruderTemp (uint temp=0, uint extruder=0, bool andWait=false) |
Set extruder temperature. | |
Q_INVOKABLE void | move (AtCore::AXES axis, double arg) |
move an axis of the printer | |
Q_INVOKABLE void | move (QLatin1Char axis, double arg) |
move an axis of the printer | |
Q_INVOKABLE void | setBedTemp (uint temp=0, bool andWait=false) |
Set the bed temperature. | |
Q_INVOKABLE void | setFanSpeed (uint speed=0, uint fanNumber=0) |
setFanSpeed set the fan speed | |
Q_INVOKABLE void | setAbsolutePosition () |
Set printer to absolute position mode. | |
Q_INVOKABLE void | setRelativePosition () |
Set printer to relative position mode. | |
Q_INVOKABLE void | disableMotors (uint delay=0) |
Disable motors after a delay. | |
Q_INVOKABLE void | setPrinterSpeed (uint speed=100) |
set the Printers speed | |
Q_INVOKABLE void | setFlowRate (uint rate=100) |
set extruder Flow rate | |
Q_INVOKABLE void | close () |
close any open items. You should call this on close events to force any stuck jobs to close | |
Q_INVOKABLE void | showMessage (const QString &message) |
showMessage push a message to the printers LCD | |
Q_INVOKABLE void | setUnits (AtCore::UNITS units) |
setUnits sets the measurement units do be used | |
void | setSerialTimerInterval (int newTime) |
Set the time between checks for new serialPorts (0 is default) | |
void | setTemperatureTimerInterval (int newTime) |
Set the time between checks for new Temperature (5000 is default on new connections) | |
void | setAutoTemperatureReport (bool autoReport) |
Set if atcore should Enable auto temperature reporting. Temperature timer will also be stopped. | |
Q_INVOKABLE void | setAutoCheckTemperatureInterval (int newTime) |
Tell the machine to start reporting its temperature automaticly. | |
Q_INVOKABLE void | sdDelete (const QString &fileName) |
delete file from sd card | |
void | sdCardPrintStatus () |
Queue the Printer for status of sd card print. | |
Signals | |
void | atcoreMessage (const QString &msg) |
Message emit from atcore these should be displayed to the user for debug. | |
void | extruderCountChanged (const int newCount) |
New number of extruders. | |
void | printProgressChanged (const float newProgress) |
Print job's precentage changed. | |
void | receivedMessage (const QByteArray &message) |
New message was received from the printer. | |
void | serialTimerIntervalChanged (const int newTime) |
New interval for serial timer. | |
void | temperatureTimerIntervalChanged (const int newTime) |
New interval for temperature timer. | |
void | autoTemperatureReportChanged (bool autoReport) |
use of automatic temperature reporting has changed | |
void | autoCheckTemperatureIntervalChanged (const int newTime) |
New interval for automatic temperature report. | |
void | stateChanged (AtCore::STATES newState) |
The Printer's State Changed. | |
void | portsChanged (const QStringList &portList) |
Available serialports Changed. | |
void | sdMountChanged (bool newState) |
Sd Card Mount Changed. | |
void | sdCardFileListChanged (const QStringList &fileList) |
The files on the sd card have changed. | |
void | pushedCommand (const QByteArray &comm) |
pushedCommand via serialLayer connect this to your log to see send commands | |
void | availableFirmwarePluginsChanged () |
availableFirmwarePluginsChanged notify about the new plugins available | |
Public Member Functions | |
AtCore (QObject *parent=nullptr) | |
AtCore create a new instance of AtCore. | |
~AtCore () | |
QString | version () const |
version | |
QStringList | serialPorts () const |
Returns a List of detected serial ports. | |
QString | connectedPort () const |
connectedPort | |
Q_INVOKABLE bool | newConnection (const QString &port, int baud, const QString &fwName, bool disableROC=false) |
Connect to a device. | |
QStringList | portSpeeds () const |
Returns a list of valid baud speeds. | |
Q_INVOKABLE void | closeConnection () |
Close the current serial connection. | |
Q_INVOKABLE IFirmware * | firmwarePlugin () const |
Main access to the loaded firmware plugin. | |
QStringList | availableFirmwarePlugins () const |
List of available firmware plugins. | |
AtCore::STATES | state () |
Get Printer state. | |
int | extruderCount () const |
extruderCount | |
float | percentagePrinted () const |
Return printed percentage. | |
std::shared_ptr< BedDeform > | bedDeform () |
The Bed Deform data as told by the Firmware. | |
Temperature * | temperature () |
The temperature of the current hotend as told by the Firmware. | |
int | serialTimerInterval () const |
Return the amount of miliseconds the serialTimer is set to. 0 = Disabled. | |
int | temperatureTimerInterval () const |
Return the amount of miliseconds the temperatureTimer is set to. 0 = Disabled. | |
Q_INVOKABLE void | mountSd (uint slot=0) |
Attempt to Mount an sd card. | |
Q_INVOKABLE void | umountSd (uint slot=0) |
Attempt to Unmount an sd card. | |
QStringList | sdFileList () |
sdFileList | |
bool | isSdMounted () const |
Check if an sd card is mounted on the printer. | |
bool | autoTemperatureReport () const |
Check if using automatic Temperature reporting to monitor temperatures. | |
Protected Member Functions | |
void | setExtruderCount (int newCount) |
Set the number of extruders on the machine. | |
void | appendSdCardFileList (const QString &fileName) |
Append a file to AtCorePrivate::sdCardFileList. | |
void | clearSdCardFileList () |
Clear AtCorePrivate::sdCardFileList. | |
void | setSdMounted (const bool mounted) |
Set if the sd card is mounted by the printer. | |
void | setReadingSdCardList (bool readingList) |
set AtCorePrivate::sdCardReadingFileList | |
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. | |
void | checkTemperature () |
Send M105 to the printer if one is not in the Queue. | |
void | newMessage (const QByteArray &message) |
Connect to SerialLayer::receivedCommand. | |
void | newCommand (const QByteArray &command) |
Connect to SerialLayer::pushedCommand. | |
void | findFirmware (const QByteArray &message) |
Search for firmware string in message. A Helper function for Firmware detection. | |
void | locateSerialPort () |
Search for new serial ports. | |
void | disableResetOnConnect (const QString &port) |
Attempts to disableResetOnConnect for the selected port. | |
void | getSDFileList () |
Send request to the printer for the sd card file list. | |
void | handleSerialError (QSerialPort::SerialPortError error) |
Handle serial Errors. | |
Private Member Functions | |
Q_INVOKABLE void | loadFirmwarePlugin (const QString &fwName) |
Load A firmware plugin. | |
bool | firmwarePluginLoaded () const |
True if a firmware plugin is loaded. | |
bool | serialInitialized () const |
True if a serial port is initialized. | |
void | requestFirmware () |
send firmware request to the printer | |
bool | isReadingSdCardList () const |
returns AtCorePrivate::sdCardReadingFileList | |
void | stopSdPrint () |
stops print just for sd prints used internally | |
void | waitForPrinterReboot (const QByteArray &message, const QString &fwName) |
New connections need to wait for the machine to be ready if it needs reboot. | |
Private Attributes | |
std::unique_ptr< 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 |
AtCore::~AtCore | ( | ) |
|
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 |
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 |
Send home all command.
|
slot |
|
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) |
|
slot |
updateFWPlugins Check for new Firmware plugins.
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 |