Skip to content

temperature_monitor_base

frog.hardware.plugins.temperature.temperature_monitor_base ¤

Provides a base class for temperature monitor devices or mock devices.

Attributes¤

Classes¤

TemperatureMonitorBase(hot_bb_channel, cold_bb_channel) ¤

Bases: Device

The base class for temperature monitor devices or mock devices.

Create a new TemperatureMonitorBase.

Parameters:

Name Type Description Default
hot_bb_channel str

Channel name for hot black body

required
cold_bb_channel str

Channel name for cold black body

required
Source code in src/frog/hardware/plugins/temperature/temperature_monitor_base.py
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
def __init__(self, hot_bb_channel: str, cold_bb_channel: str) -> None:
    """Create a new TemperatureMonitorBase.

    Args:
        hot_bb_channel: Channel name for hot black body
        cold_bb_channel: Channel name for cold black body
    """
    super().__init__()

    hot_bb_idx = _parse_channel_idx(hot_bb_channel)
    cold_bb_idx = _parse_channel_idx(cold_bb_channel)
    if hot_bb_idx == cold_bb_idx:
        raise ValueError("Hot and cold black body channels cannot be the same")

    self._temperature_idx = {"hot_bb": hot_bb_idx, "cold_bb": cold_bb_idx}
Functions¤
get_temperatures() abstractmethod ¤

Get the current temperatures.

Source code in src/frog/hardware/plugins/temperature/temperature_monitor_base.py
78
79
80
@abstractmethod
def get_temperatures(self) -> Sequence:
    """Get the current temperatures."""
signal_is_opened() ¤

Signal that the device is now open.

Send a message to frontend indicating what channels correspond to the hot and cold black bodies.

Source code in src/frog/hardware/plugins/temperature/temperature_monitor_base.py
69
70
71
72
73
74
75
76
def signal_is_opened(self) -> None:
    """Signal that the device is now open.

    Send a message to frontend indicating what channels correspond to the hot and
    cold black bodies.
    """
    super().signal_is_opened()
    self.send_message("temperature_idx", temperature_idx=self._temperature_idx)