polychemprint3.tools.toolSpec module

Contains toolSpec Abstract Base Class.

First created on Sun Oct 20 00:03:21 2019
Revised: 10/17/2020
Author: Bijal Patel
class polychemprint3.tools.toolSpec.toolSpec(name, units, __verbose__, **kwargs)

Bases: polychemprint3.utility.loggerSpec.loggerSpec, abc.ABC

Abstract Base Class for all dispensing/writing tool drivers.

activate()

To be called in main.py to load as active tool. Makes required serial connections and returns status as True/False.

Returns:True if tool serial connection made and tool is ready to use False if error generated and tool is not ready for use
Return type:bool
deactivate()

To be called in main.py to unload as active tool. Closes serial communication and returns status as True/False.

Returns:True if tool serial connection destroyed and tool disabled. False if error generated and serial communication not suspended.
Return type:bool
disengage()

Turn tool primary action off (stops dispense/LASER beam off, etc).

Returns:status – First element (int) indicates whether disengage was successful (1), already off (0), or error (-1). Second element (String) provides text explanation.
Return type:two-element list
engage()

Turn tool primary action on (dispense/LASER beam on, etc).

Returns:status – First element (int) indicates whether engage was successful (1), already on (0) or error (-1) Second element (String) provides text explanation.
Return type:two-element list
getState()

Returns the current dispense/action state (on/off).

Returns:status – First element indicates whether tool is on(1), off(0) or error(-1). Second element provides text explanation.
Return type:two-element list
loadLogSelf(yamlString)

Loads yaml log back into __dict__.

Parameters:yamlString (String) – yaml string to be loaded back in
setValue(value)

Set the primary tool action value (e.g., Laser power, extruder pressure, etc.).

Parameters:value (String) – The new value of the parameter as a string, expressed at arbitrary precision/ without leading zeros. Conversion to hardware specific format occurs internally. e.g., (use 23.456 NOT 0234”)
Returns:status – First element (int) indicates whether value setting was successful (1) or error (-1). Second element provides text explanation.
Return type:two-element list
writeLogSelf()

Generates yaml string containing __dict__ to be written to log file.

Returns:log in yaml string format
Return type:String