polychemprint3.utility.serialDeviceSpec module

Interface for all Serial Device objects (extruders/lasers/axes/etc).

First created on Sun Oct 20 00:03:21 2019
Revised: 20/10/2019 00:34:27
Author: Bijal Patel
class polychemprint3.utility.serialDeviceSpec.serialDeviceSpec(devAddress, baudRate, commsTimeOut, **kwargs)

Bases: abc.ABC

Abstract Base Class for all objects using serial device.

checkIfSerialConnectParamsSet()

Goes through connection parameters and sees if all are set.

Returns:True if all parameters are set, false if any unset
Return type:bool
handShakeSerial()

Perform communications handshake with serial device.

Returns:
  • [1, “Handshake Successful”] – success occured
  • [0, ‘Handshake Failed, Rcvd + message received’] – failure occured
  • [-1, “Error (Handshake with Tool Failed + error text”]) – Error received
readTime()

Reads in from serial device until timeout.

Returns:All text read in, empty string if nothing
Return type:String
startSerial()

Creates pySerial device.

Returns:
  • [1, “Terminated successfully”] – started succesfully
  • [-1, “Error (error text”]) – could not start
stopSerial()

Terminates communication.

Returns:
  • [1, “Terminated successfully”] – started succesfully
  • [-1, “Error (Serial Device could not be stopped + error text”]) – could not start