AtCore  1.0.72
AtCore is a API to manage the serial connection between the computer and 3D Printers.
Classes | Public Slots | Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
PrintThread Class Reference

The PrintThread class A Thread for running a print job. More...

#include <printthread.h>

Inheritance diagram for PrintThread:

Classes

class  PrintThreadPrivate
 The PrintThreadPrivate class. More...
 

Public Slots

void start ()
 start the print thread More...
 

Signals

void finished ()
 Print job has finished. More...
 
void error (QString err)
 A command has caused an error. More...
 
void printProgressChanged (const float)
 The print job's progress has changed. More...
 
void nextCommand (const QString &comm)
 the next command of the job More...
 
void stateChanged (const AtCore::STATES &state)
 Printer state was changed. More...
 

Public Member Functions

 PrintThread (AtCore *parent, const QString &fileName)
 Create a new Print Thread. More...
 
 ~PrintThread ()
 

Private Slots

void processJob ()
 process the current job More...
 
void setState (const AtCore::STATES &state)
 Set printer state. More...
 

Private Member Functions

void nextLine ()
 parse the next line More...
 
void endPrint ()
 end the print More...
 
void injectCommand (QString &command)
 injectCommand Attempt to inject a Command from the currently printing file. More...
 

Private Attributes

PrintThreadPrivated
 

Detailed Description

The PrintThread class A Thread for running a print job.

see AtCore::print() for example of how to create a print thread.

Constructor & Destructor Documentation

◆ PrintThread()

PrintThread::PrintThread ( AtCore parent,
const QString &  fileName 
)

Create a new Print Thread.

Parameters
parentParent of the tread
fileNamegcode File to print

◆ ~PrintThread()

PrintThread::~PrintThread ( )

Member Function Documentation

◆ endPrint()

void PrintThread::endPrint ( )
private

end the print

◆ error

void PrintThread::error ( QString  err)
signal

A command has caused an error.

Parameters
errthe offending command

◆ finished

void PrintThread::finished ( )
signal

Print job has finished.

◆ injectCommand()

void PrintThread::injectCommand ( QString &  command)
private

injectCommand Attempt to inject a Command from the currently printing file.

One of the following on a line that starts with ';-'
example line ;-Message: Hello

  • Pause: ppc
    Pause the print job and then run the comma-separated commands after pausing the job.
    • ppc: A comma-separated list of Commands to send after pause. ex(G91, G0 Z1, G90, G1 X0 Y195)

  • Extruder Temperature:newTemp,extnum,wait
    Set extruder temperature.
    • newTemp: new target temperature.
    • extnum: Extruder number you want to Heat. Starting at 0.
    • wait: ignore commands until the target is reached. [true | false]

  • Bed Temperature: newTemp,wait
    Set the bed temperature.
    • newTemp: new target temperature
    • wait: ignore commands until the target is reached. [true | false]

  • Fan Speed:newSpeed, fanNum
    Set the Fan speed.
    • newSpeed: new fan speed.
    • fanNum: Fan number. Starting at 0.

  • Print Speed:newSpeed
    Set the printer speed.
    • newSpeed: the print speed. 100= movement speed defined in file.

  • Flow Rate:newRate
    Set the flow rate
    • newRate: the flow rate. 100 = flow rate defined in file.

  • Message:message
    Show a message the printer's LCD
    • message: the message to print.

  • Command:command
    Inject your own command. Command are sent as is. Be sure your line is correct.
    • command: Commands to inject

◆ nextCommand

void PrintThread::nextCommand ( const QString &  comm)
signal

the next command of the job

Parameters
commCommand to be sent next

◆ nextLine()

void PrintThread::nextLine ( )
private

parse the next line

◆ printProgressChanged

void PrintThread::printProgressChanged ( const float  )
signal

The print job's progress has changed.

◆ processJob

void PrintThread::processJob ( )
privateslot

process the current job

◆ setState

void PrintThread::setState ( const AtCore::STATES state)
privateslot

Set printer state.

Parameters
statethe new printer state

◆ start

void PrintThread::start ( )
slot

start the print thread

◆ stateChanged

void PrintThread::stateChanged ( const AtCore::STATES state)
signal

Printer state was changed.

Parameters
statenew state

Member Data Documentation

◆ d

PrintThreadPrivate* PrintThread::d
private

The documentation for this class was generated from the following files: