diff --git a/Python_script/VNA_dummy.py b/Python_script/VNA_dummy.py index ab85c3c204b0b430090bab7fd5ef7f08f5a002d2..11a259fdbe97f2258c16ed0b237435a080c2a546 100644 --- a/Python_script/VNA_dummy.py +++ b/Python_script/VNA_dummy.py @@ -35,6 +35,7 @@ class VnaDummy: self.reference_temp = 25 self.magnitude_slope = 0.2 self.phase_slope = 0.1 + self.communication_delay = 0.2 def run_simulation(self): self.simulate_magnitude() @@ -104,6 +105,8 @@ class VnaDummy: measurment_string = ' ' for i in range(50): measurment_string += str(real_val) + ',' + str(imaginary_val) + ',' + # doing the measurement and reading out some time + self.simulated_state.simulated_time += self.communication_delay # removed last comma by adding slicing([:-1]) return measurment_string[:-1] diff --git a/Python_script/climate_chamber_dummy.py b/Python_script/climate_chamber_dummy.py index 457a30472b0b7e9fb122ea80f43f64b3f9a1facb..b6741d5cb6a52f1c59656a7cf3faecfb48a65e36 100644 --- a/Python_script/climate_chamber_dummy.py +++ b/Python_script/climate_chamber_dummy.py @@ -28,6 +28,7 @@ class ClimateChamberDummy: self.target_humidity = 35 self.temperature_slope = 0.1 # 0.1 degrees/second self.humidity_slope = 0.5 # degrees/second + self.communication_delay = 0.3 def run_simulation(self): self.simulate_temp() @@ -72,11 +73,13 @@ class ClimateChamberDummy: def read_temperature(self): + self.simulated_state.simulated_time += self.communication_delay # data format: [current temp, set temp, upper limit, lower limit] return [self.simulated_state.simulated_temperature, self.target_temperature, 0., 100.] def read_humidity(self): + self.simulated_state.simulated_time += self.communication_delay # data format: [current temp, set temp, upper limit, lower limit] return [self.simulated_state.simulated_humidity, self.target_humidity, 0., 100.] @@ -86,6 +89,7 @@ class ClimateChamberDummy: self.target_temperature = temperature print('ChamberDummy: target temperature now is ' + str(self.target_temperature)) response = 'OK: TEMP, S30\r\n' + self.simulated_state.simulated_time += self.communication_delay return response def set_humidity(self, humidity): @@ -95,6 +99,7 @@ class ClimateChamberDummy: self.target_humidity = humidity print('ChamberDummy: target humidity now is ' + str(self.target_humidity)) response = 'OK: HUMI, S30\r\n' + self.simulated_state.simulated_time += self.communication_delay return response def close(self): @@ -105,6 +110,7 @@ class ClimateChamberDummy: def set_mode(self, mode): self.simulated_mode = mode response = 'FIXME!!!' + self.simulated_state.simulated_time += self.communication_delay return response def get_const(self): @@ -133,6 +139,7 @@ class ClimateChamberDummy: self.set_humidity(setPoint[1]) def read_mode(self): + self.simulated_state.simulated_time += self.communication_delay return self.simulated_mode # deprecated. Use read_humidity etc. instead