Commit 912066d8 authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Activates POpen on interface + fixes typos

Showing with 4 additions and 5 deletions
+4 -5
...@@ -122,7 +122,6 @@ class OhmPi(object): ...@@ -122,7 +122,6 @@ class OhmPi(object):
self.cmd_thread = threading.Thread(target=self.process_commands) self.cmd_thread = threading.Thread(target=self.process_commands)
self.cmd_thread.start() self.cmd_thread.start()
def _update_acquisition_settings(self, config): def _update_acquisition_settings(self, config):
"""Update acquisition settings from a json file or dictionary. """Update acquisition settings from a json file or dictionary.
Parameters can be: Parameters can be:
...@@ -587,7 +586,8 @@ class OhmPi(object): ...@@ -587,7 +586,8 @@ class OhmPi(object):
voltage = -AnalogIn(self.ads_voltage, ads.P0, ads.P1).voltage * 2.5 voltage = -AnalogIn(self.ads_voltage, ads.P0, ads.P1).voltage * 2.5
# compute resistance measured (= contact resistance) # compute resistance measured (= contact resistance)
resistance = np.abs(voltage / current) resistance = np.abs(voltage / current)
msg = f'Contact resistance {str(quad):s}: I: {current * 1000.:>10.3f} mA, V: {voltage * 1000.:>10.3f} mV, ' \ msg = f'Contact resistance {str(quad):s}: I: {current * 1000.:>10.3f} mA, ' \
f'V: {voltage * 1000.:>10.3f} mV, ' \
f'R: {resistance /1000.:>10.3f} kOhm' f'R: {resistance /1000.:>10.3f} kOhm'
self.exec_logger.debug(msg) self.exec_logger.debug(msg)
...@@ -698,7 +698,7 @@ class OhmPi(object): ...@@ -698,7 +698,7 @@ class OhmPi(object):
print('error====', e) print('error====', e)
self.exec_logger.warning(f'Unable to run rs-check: {e}') self.exec_logger.warning(f'Unable to run rs-check: {e}')
else: else:
self.exec_logger.warning(f'Unkown command {cmd} - cmd_id: {cmd_id}') self.exec_logger.warning(f'Unknown command {cmd} - cmd_id: {cmd_id}')
except Exception as e: except Exception as e:
self.exec_logger.warning(f'Unable to decode command {message}: {e}') self.exec_logger.warning(f'Unable to decode command {message}: {e}')
status = False status = False
...@@ -794,7 +794,6 @@ class OhmPi(object): ...@@ -794,7 +794,6 @@ class OhmPi(object):
self.cmd_thread.join() self.cmd_thread.join()
self.exec_logger.debug(f'Stopped listening to tcp port.') self.exec_logger.debug(f'Stopped listening to tcp port.')
exit() exit()
VERSION = '2.1.0' VERSION = '2.1.0'
...@@ -824,7 +823,7 @@ print(current_time.strftime("%Y-%m-%d %H:%M:%S")) ...@@ -824,7 +823,7 @@ print(current_time.strftime("%Y-%m-%d %H:%M:%S"))
# for testing # for testing
if __name__ == "__main__": if __name__ == "__main__":
# start interface # start interface
#Popen(['python', CONTROL_CONFIG['interface']]) Popen(['python', CONTROL_CONFIG['interface']])
ohmpi = OhmPi(settings=OHMPI_CONFIG['settings']) ohmpi = OhmPi(settings=OHMPI_CONFIG['settings'])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment