polychemprint3.tools.nullTool module¶
Implements the Tool base class for a null Tool [no action, returns true].
-
class
polychemprint3.tools.nullTool.
nullTool
(name='nullTool', units='null', devAddress='unset', baudRate='unset', commsTimeOut=0.5, __verbose__=0, **kwargs)¶ Bases:
polychemprint3.tools.toolSpec.toolSpec
Implements the toolSpec abstract base class for a null tool, a virtual hardware device that only writes to the terminal.
-
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 is succesfully disabled. False if error generated and serial communication could not be 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) or off(0) or error(-1). Second element provides text explanation.
Return type: two-element list
-
loadLogSelf
(yamlString)¶ loads json 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: logyaml – log in yaml string format Return type: String
-