Skip to content
Snippets Groups Projects
Commit 7cb88688 authored by Martin Killenberg's avatar Martin Killenberg
Browse files

feat: introduce extenal sensors dummy

parent 2341bc2c
No related branches found
No related tags found
1 merge request!4chore: code cleanup
......@@ -2,6 +2,32 @@ from almemo710 import almemo710
from almemo2490 import almemo2490
import pandas as pd
import climate_chamber_dummy
class ExternalSensorsDummy:
def __init__(self):
self.climate_chamber_dummy = climate_chamber_dummy.get_climate_chamber_dummy([0.2, 0.1])
def get_sensor_values(self):
# FIXME: Do we have to run the simulation here or do we piggy-back on the chamber probably also being dummy?
temp = self.climate_chamber_dummy.read_temperature()[0]
humidity = self.climate_chamber_dummy.read_humidity()[0]
# half a degree thermal cycle of 10 minutes from the room's air conditioning
room_temp = 22.97 + abs((self.climate_chamber_dummy.last_simulation_time % 600)-300)/600
# Use the same DUT chamber values as the simulation, but constant measurement instrument chamber and room
# temp_dut, temp_room, temp_meas_instr, hum_dut, hum_room, hum_meas_instr, air_press_room
return temp, room_temp, 23.0, humidity, 62.2, 45.0, 1013
def close(self):
pass
def create_sensors(logger_model, logger_address, ext_sensor_channels):
if logger_address == 'localhost':
return ExternalSensorsDummy()
else:
return ExternalSensors(logger_model, logger_address, ext_sensor_channels)
class ExternalSensors:
......
......@@ -75,8 +75,8 @@ class Measurements:
self.vna = VNA.create_vna(vna_address, target_accuracy)
# data logger for external sensors
self.ext_sensors = external_sensors.ExternalSensors(config_data['logger_model'], logger_address,
ext_sensor_channels)
self.ext_sensors = external_sensors.create_sensors(config_data['logger_model'], logger_address,
ext_sensor_channels)
self.standby = standby
self.output_basename = output_basename
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment