sivicncdriver.serial package

Submodules

sivicncdriver.serial.serial_list module

sivicncdriver.serial.serial_list.serial_ports()[source]

Lists serial ports

Raises:EnvironmentError – On unsupported or unknown platforms
Returns:A list of available serial ports

sivicncdriver.serial.serial_manager module

The serial_manager module

Provides a class to handle the CNC machine through a serial object.

class sivicncdriver.serial.serial_manager.SerialManager(serial, fake_mode=False)[source]

Bases: PyQt5.QtCore.QObject

A class to manage the serial port.

It will try to send what it receive and send via the send_print signal. When it receive a ‘ok’ from the serial it will send the send_confirm signal.

close()[source]

Closes the serial port.

open(baudrate, serial_port, timeout)[source]

Opens the serial port with the given parameters.

Parameters:
  • baudrate – The baudrate.
  • serial_port – The port to be used.
  • timeout – Timeout for reading and writing.
readMsg()[source]

Reads a line from the serial port. And emit the send_print or send_confirm signals if necessary.

sendMsg(msg)[source]

Sends a message using the serial port if fake_mode is False.

Parameters:msg – The message to be sent.
Returns:True if no error occurred, else False.
send_confirm
send_print
serial_fatal_error

sivicncdriver.serial.thread_read module

class sivicncdriver.serial.thread_read.ReadThread[source]

Bases: PyQt5.QtCore.QThread

A thread to read the serial link.

run()[source]

Runs the thread.

The commands are sent using the serial manager. If an error occurs or if the thread is stopped by the user, then it quits.

set_read_allowed(st)[source]

Allows or not the thread to read.

Parameters:st – Is it allowed ?
stop()[source]

A simple slot to tell the thread to stop.

read

sivicncdriver.serial.thread_send module

class sivicncdriver.serial.thread_send.SendThread(serial_manager, gcode)[source]

Bases: PyQt5.QtCore.QThread

A thread to send a list of instructions without blocking the main thread.

confirm(st)[source]

Receive confirmation from the readThread.

Parameters:st – Everything ok ?
run()[source]

Runs the thread.

The commands are sent using the serial manager. If an error occurs or if the thread is stopped by the user, then it quits.

stop()[source]

A simple slot to tell the thread to stop.

read_allowed
update_progress

Module contents