Skip to content

dummy_temperature_monitor

frog.hardware.plugins.temperature.dummy_temperature_monitor ¤

This module provides an interface to dummy DP9800 temperature readers.

Attributes¤

Classes¤

DummyTemperatureMonitor(temperature_params=_DEFAULT_TEMP_PARAMS) ¤

Bases: TemperatureMonitorBase

A dummy temperature monitor for GUI testing.

Create a new DummyTemperatureMonitor.

Source code in frog/hardware/plugins/temperature/dummy_temperature_monitor.py
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
def __init__(
    self, temperature_params: Sequence[NoiseParameters] = _DEFAULT_TEMP_PARAMS
) -> None:
    """Create a new DummyTemperatureMonitor."""
    if len(temperature_params) != NUM_TEMPERATURE_MONITOR_CHANNELS:
        raise ValueError(
            f"Must provide {NUM_TEMPERATURE_MONITOR_CHANNELS} parameters"
        )

    self._temperature_producers = [
        NoiseProducer.from_parameters(params, type=Decimal)
        for params in temperature_params
    ]

    super().__init__()
Functions¤
get_temperatures() ¤

Get current temperatures.

Source code in frog/hardware/plugins/temperature/dummy_temperature_monitor.py
45
46
47
def get_temperatures(self) -> Sequence:
    """Get current temperatures."""
    return [producer() for producer in self._temperature_producers]