Commit c8b952f4 authored by Guillaume Blanchy's avatar Guillaume Blanchy
Browse files

update small test

Showing with 8 additions and 7 deletions
+8 -7
...@@ -136,9 +136,9 @@ class OhmPi(object): ...@@ -136,9 +136,9 @@ class OhmPi(object):
if self.output == 'print': if self.output == 'print':
if level == 'error': if level == 'error':
print(colored(level.upper() + ' : ' + msg), 'red') print(colored(level.upper() + ' : ' + msg, 'red'))
elif level == 'warn': elif level == 'warn':
print(colored(level.upper() + ' : ' + msg), 'yellow') print(colored(level.upper() + ' : ' + msg, 'yellow'))
else: else:
print(level.upper() + ' : ' + msg) print(level.upper() + ' : ' + msg)
elif self.output == 'mqtt': elif self.output == 'mqtt':
...@@ -165,7 +165,8 @@ class OhmPi(object): ...@@ -165,7 +165,8 @@ class OhmPi(object):
if isinstance(config, dict): if isinstance(config, dict):
self.pardict.update(config) self.pardict.update(config)
else: else:
dic = json.loads(config) with open(config) as json_file:
dic = json.load(json_file)
self.pardict.update(dic) self.pardict.update(dic)
self.dump('Acquisition parameters updated: ' + str(self.pardict), level='debug') self.dump('Acquisition parameters updated: ' + str(self.pardict), level='debug')
...@@ -589,8 +590,8 @@ class OhmPi(object): ...@@ -589,8 +590,8 @@ class OhmPi(object):
self.dump('status = ' + self.status) self.dump('status = ' + self.status)
# test # test
#with open('ohmpi_param.json') as json_file: #ohmpi = OhmPi(config='ohmpi_param.json')
# pardict = json.load(json_file)
ohmpi = OhmPi()
#ohmpi.measure() #ohmpi.measure()
#time.sleep(4)
#ohmpi.stop()
1 2 3 4 1 2 3 4
1 3 5 7 1 1 5 7
1 4 7 10 1 4 7 10
1 5 9 13 1 5 9 13
1 6 11 16 1 6 11 16
......
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