pyccapt.control.devices package

Submodules

pyccapt.control.devices.camera module

class pyccapt.control.devices.camera.CameraWorker(*args: Any, **kwargs: Any)[source]

Bases: QObject

This class is used to control the BASLER Cameras.

Constructor function which initializes and setups all variables and parameters for the class.

Parameters:
  • variables – The class object of the Variables class.

  • emitter – The class object of the Emitter class.

Returns:

None

initialize_cameras()[source]

Initializes and sets up the cameras.

Parameters:

None

Returns:

None

light_switch()[source]

This class method sets the Exposure time based on a flag.

Parameters:

None

Returns:

None

set_auto_exposure_time()

This class method sets

Parameters:

None

Returns:

None

set_default_exposure_time()

This class method sets

Parameters:

None

Returns:

None

set_exposure_time_1(exposure_time)

This class method sets

Parameters:

exposure_time – The exposure time for the camera.

Returns:

None

set_exposure_time_2(exposure_time)

This class method sets

Parameters:

exposure_time – The exposure time for the camera.

Returns:

None

set_exposure_time_3(exposure_time)

This class method sets

Parameters:

exposure_time – The exposure time for the camera.

Returns:

None

start_capturing()[source]
stop_capturing()[source]
update_cameras()[source]

This class method sets up the cameras to capture the required images.

Parameters:

None

Returns:

None

pyccapt.control.devices.camera.check_camera_availability(required_cameras: int = 2) tuple[bool, str][source]

Return whether the Basler camera backend has enough connected devices.

pyccapt.control.devices.edwards_tic module

class pyccapt.control.devices.edwards_tic.EdwardsAGC(port, variables)[source]

Bases: object

Primitive driver for Edwards Active Gauge Controller. Complete manual found at http://www.idealvac.com/files/brochures/Edwards_AGC_D386-52-880_IssueM.pdf

The constructor function to initialize serial lib parameters.

Parameters:
  • port (str) – Port on which serial communication is established.

  • variables – Variable container for shared variables.

Returns:

None

comm(command)[source]

This class method implements serial communication using the serial library. Reads the raw data through the serial line and returns it.

Parameters:

command (str) – Command to be written on the serial line.

Returns:

String read through the serial.

Return type:

str

pyccapt.control.devices.email_send module

pyccapt.control.devices.email_send.send_email(email, subject, message)[source]

This function sends an email notification via the SMTP server.

Parameters:
  • email (str) – Recipient’s email address.

  • subject (str) – Subject of the email.

  • message (str) – Main body of the email.

Returns:

None

pyccapt.control.devices.initialize_devices module

class pyccapt.control.devices.initialize_devices.bcolors[source]

Bases: object

BOLD = '\x1b[1m'
ENDC = '\x1b[0m'
FAIL = '\x1b[91m'
HEADER = '\x1b[95m'
OKBLUE = '\x1b[94m'
OKCYAN = '\x1b[96m'
OKGREEN = '\x1b[92m'
UNDERLINE = '\x1b[4m'
WARNING = '\x1b[93m'
pyccapt.control.devices.initialize_devices.command_cryovac(cmd, com_port_cryovac)[source]

Execute a command on Cryovac through serial communication.

Parameters:
  • cmd – Command to be executed.

  • com_port_cryovac – Serial communication object.

Returns:

Response code after executing the command.

pyccapt.control.devices.initialize_devices.command_edwards(conf, variables, cmd, E_AGC, status=None)[source]

Execute commands and set flags based on parameters.

Parameters:
  • conf – Configuration parameters.

  • variables – Variables instance.

  • cmd – Command to be executed.

  • E_AGC – EdwardsAGC instance.

  • status – Status of the lock.

Returns:

Response code after executing the command.

pyccapt.control.devices.initialize_devices.initialize_cryovac(com_port_cryovac, variables)[source]

Initialize the communication port of Cryovac.

Parameters:
  • com_port_cryovac – Serial communication object.

  • variables – Variables instance.

Returns:

None

pyccapt.control.devices.initialize_devices.initialize_edwards_tic_buffer_chamber(conf, variables)[source]

Initialize TIC buffer chamber parameters.

Parameters:
  • conf – Configuration parameters.

  • variables – Variables instance.

Returns:

None

pyccapt.control.devices.initialize_devices.initialize_edwards_tic_cryo_load_lock(conf, variables)[source]

Initialize TIC cryo load lock parameters.

Parameters:
  • conf – Configuration parameters.

  • variables – Variables instance.

Returns:

None

pyccapt.control.devices.initialize_devices.initialize_edwards_tic_load_lock(conf, variables)[source]

Initialize TIC load lock parameters.

Parameters:
  • conf – Configuration parameters.

  • variables – Variables instance.

Returns:

None

pyccapt.control.devices.initialize_devices.initialize_pfeiffer_gauges(variables)[source]

Initialize Pfeiffer gauge parameters.

Parameters:

variables – Variables instance.

Returns:

None

pyccapt.control.devices.initialize_devices.log_vacuum_levels(main_chamber, buffer_chamber, buffer_chamber_pre, load_lock, load_lock_pre, cryo_load_lock, cryo_load_lock_pre)[source]

Log vacuum levels to a text file and a CSV file.

Parameters:
  • main_chamber (float) – Vacuum level of the main chamber.

  • buffer_chamber (float) – Vacuum level of the buffer chamber.

  • buffer_chamber_pre (float) – Vacuum level of the buffer chamber backing pump.

  • load_lock (float) – Vacuum level of the load lock.

  • load_lock_pre (float) – Vacuum level of the load lock backing pump.

  • cryo_load_lock (float) – Vacuum level of the cryo load lock.

  • cryo_load_lock_pre (float) – Vacuum level of the cryo load lock backing pump.

Returns:

None

pyccapt.control.devices.initialize_devices.state_update(conf, variables, emitter)[source]

Read gauge parameters and update variables.

Parameters:
  • conf – Configuration parameters.

  • variables – Variables instance.

  • emitter – Emitter instance.

Returns:

None

pyccapt.control.devices.pfeiffer_gauges module

class pyccapt.control.devices.pfeiffer_gauges.TPG26x(port='/dev/ttyUSB0', baudrate=9600)[source]

Bases: object

Abstract class that implements the common driver for the TPG 261 and TPG 262 dual channel measurement and control unit.

Initialize the TPG26x driver.

Parameters:
  • port (str or int) – The COM port to open.

  • baudrate (int) – Data transmission rate.

gauge_identification()[source]

Return the gauge identification.

Returns:

Identification codes and messages for both gauges.

Return type:

tuple

pressure_gauge(gauge=1)[source]

Return the pressure measured by gauge X.

Parameters:

gauge (int) – The gauge number, 1 or 2.

Returns:

The value of pressure along with status code and message.

Return type:

tuple

pressure_gauges()[source]

Return the pressures measured by the gauges.

Returns:

The values of both gauges along with their status codes and messages.

Return type:

tuple

pressure_unit()[source]

Return the pressure unit.

Returns:

The pressure unit.

Return type:

str

program_number()[source]

Return the firmware version.

Returns:

The firmware version.

Return type:

str

rs232_communication_test()[source]

Test the RS232 communication.

Returns:

The status of the communication test.

Return type:

bool

ACK = '\x06'
CR = '\r'
ENQ = '\x05'
ETX = '\x03'
LF = '\n'
NAK = '\x15'
class pyccapt.control.devices.pfeiffer_gauges.TPG362(port='/dev/ttyUSB0', baudrate=9600)[source]

Bases: TPG26x

Driver for the TPG 261 dual channel measurement and control unit. Inherits from TPG26x.

Initialize the TPG362 driver.

Parameters:
  • port (str or int) – The COM port to open.

  • baudrate (int) – Data transmission rate.

pyccapt.control.devices.signal_generator module

pyccapt.control.devices.signal_generator.change_frequency_signal_generator(variables, freq)[source]

Change the frequency of the signal generator.

Parameters:
  • variables – Instance of variables class.

  • freq – Frequency at which signal needs to be generated.

Returns:

None

pyccapt.control.devices.signal_generator.initialize_signal_generator(variables, freq)[source]

Initialize the signal generator.

Parameters:
  • variables – Instance of variables class.

  • freq – Frequency at which signal needs to be generated.

Returns:

None

pyccapt.control.devices.signal_generator.turn_off_signal_generator()[source]

Turn off the signal generator.

Returns:

None

Module contents