C# Class OctoprintClient.OctoprintPosTracker

Octoprint position tracker. tracks the Position and guesses the position if needed.
Inheritance: OctoprintClient.OctoprintTracker
Datei anzeigen Open project: FabLabSiegen/Printerface Class Usage Examples

Private Properties

Property Type Description
AutoSync void
GetGCode void
ReadLine float[]
ReadLineBackwards void
ReadLineForwards void
ReadLineToBuffer void
Sync void

Public Methods

Method Description
GetCurrentPosSync ( ) : float[]

Gets the current position Synchroniously at this exact time, should not be used many times per seconds though, that's why GetPosAsync exists.

GetPosAsync ( ) : float[]

Gets the position asynchroniously, guesses between Sync intervals, starts thread if it isn't allready running.

Home ( ) : string
Home ( Array axes ) : string

Home the specified axes.

IsReady ( ) : Boolean

Checks if the GCode allready exists

Move ( float? x = null, float? y = null, float? z = null ) : void

Moves the internal representation of the Printhead-Position, doesn't post to octoprint though

MoveTo ( float? x = null, float? y = null, float? z = null, bool absolute = false, int? speed = null ) : string

Moves the actual printhead to a position.

OctoprintPosTracker ( OctoprintClient.OctoprintConnection con ) : System

Initializes a Positiontracker, this shouldn't be done directly and is part of the Connection it needs anyway

SetPos ( float? x = null, float? y = null, float? z = null ) : void

Sets the internal representation of the Printhead-Position, doesn't post to octoprint though

StartThread ( ) : void

Starts the thread.

StopThread ( ) : void

Stops the thread.

Syncpos ( ) : void

Syncronizes the position with a Thread

Private Methods

Method Description
AutoSync ( ) : void

The thread function.

GetGCode ( string location ) : void

Gets the gcode from the given location

ReadLine ( string currline ) : float[]

Reads one line of the GCode, only G1 and M203 return something

ReadLineBackwards ( string currline ) : void

Sets the position by reading what happened in the past before the GCodePos and adding things that are not set.

ReadLineForwards ( string currline ) : void

Reads the line and sets the Positions.

ReadLineToBuffer ( string currline ) : void

Reads the line and adds it to the buffer for guessing later.

Sync ( ) : void

Sync the position.

Method Details

GetCurrentPosSync() public method

Gets the current position Synchroniously at this exact time, should not be used many times per seconds though, that's why GetPosAsync exists.
public GetCurrentPosSync ( ) : float[]
return float[]

GetPosAsync() public method

Gets the position asynchroniously, guesses between Sync intervals, starts thread if it isn't allready running.
public GetPosAsync ( ) : float[]
return float[]

Home() public method

public Home ( ) : string
return string

Home() public method

Home the specified axes.
public Home ( Array axes ) : string
axes Array Axes. in string "x", "y" or "z"
return string

IsReady() public method

Checks if the GCode allready exists
public IsReady ( ) : Boolean
return Boolean

Move() public method

Moves the internal representation of the Printhead-Position, doesn't post to octoprint though
public Move ( float? x = null, float? y = null, float? z = null ) : void
x float? The x coordinate.
y float? The y coordinate.
z float? The z coordinate.
return void

MoveTo() public method

Moves the actual printhead to a position.
public MoveTo ( float? x = null, float? y = null, float? z = null, bool absolute = false, int? speed = null ) : string
x float? The x coordinate.
y float? The y coordinate.
z float? The z coordinate.
absolute bool If set to true The position is set to absolute.
speed int? Speed.
return string

OctoprintPosTracker() public method

Initializes a Positiontracker, this shouldn't be done directly and is part of the Connection it needs anyway
public OctoprintPosTracker ( OctoprintClient.OctoprintConnection con ) : System
con OctoprintClient.OctoprintConnection The Octoprint connection it connects to.
return System

SetPos() public method

Sets the internal representation of the Printhead-Position, doesn't post to octoprint though
public SetPos ( float? x = null, float? y = null, float? z = null ) : void
x float? The x coordinate.
y float? The y coordinate.
z float? The z coordinate.
return void

StartThread() public method

Starts the thread.
public StartThread ( ) : void
return void

StopThread() public method

Stops the thread.
public StopThread ( ) : void
return void

Syncpos() public method

Syncronizes the position with a Thread
public Syncpos ( ) : void
return void