Skip to content

ftsw500_interface_base

frog.hardware.plugins.spectrometer.ftsw500_interface_base ¤

Provides a base class for interfacing with the FTSW500 program.

Classes¤

FTSW500Error ¤

Bases: Exception

Indicates that an error occurred with an FTSW500 device.

FTSW500InterfaceBase() ¤

Bases: SpectrometerBase

Base class providing an interface to the FTSW500 program.

Source code in frog/hardware/plugins/spectrometer/spectrometer_base.py
13
14
15
16
17
18
19
20
21
22
def __init__(self) -> None:
    """Create a new SpectrometerBase."""
    super().__init__()

    for command in (
        "connect",
        "start_measuring",
        "stop_measuring",
    ):
        self.subscribe(getattr(self, command), command)
Functions¤
connect() ¤

Connect to the spectrometer.

Source code in frog/hardware/plugins/spectrometer/ftsw500_interface_base.py
17
18
19
def connect(self) -> None:
    """Connect to the spectrometer."""
    self.request_command("clickConnectButton")
request_command(command) abstractmethod ¤

Request that FTSW500 run the specified command.

Parameters:

Name Type Description Default
command str

Name of command to run

required
Source code in frog/hardware/plugins/spectrometer/ftsw500_interface_base.py
29
30
31
32
33
34
35
@abstractmethod
def request_command(self, command: str) -> None:
    """Request that FTSW500 run the specified command.

    Args:
        command: Name of command to run
    """
start_measuring() ¤

Start a new measurement.

Source code in frog/hardware/plugins/spectrometer/ftsw500_interface_base.py
21
22
23
def start_measuring(self) -> None:
    """Start a new measurement."""
    self.request_command("clickStartAcquisitionButton")
stop_measuring() ¤

Stop the current measurement.

Source code in frog/hardware/plugins/spectrometer/ftsw500_interface_base.py
25
26
27
def stop_measuring(self) -> None:
    """Stop the current measurement."""
    self.request_command("clickStopAcquisitionButton")