Commit 3375f8c1 authored by Advanced Instrumentation's avatar Advanced Instrumentation
Browse files

changed data stored in measurement (config for all devices)

parent 4a56f411
......@@ -110,14 +110,18 @@ def get_config(devices):
config[device_name] = device.get_config()
return config
def measure(devices):
def measure(devices, devices2measure = 'all'):
time = str(datetime.datetime.now()).replace(':','-').replace(' ','_')
data = {'time': time}
data['config'] = get_config(devices)
data['measure'] = {}
for device in devices:
if devices2measure == 'all':
devices2measure = devices
for device in devices2measure:
device_name = type(device).__name__
if hasattr(device, 'measure'):
data['measure'][device_name] = device.measure()
......
......@@ -333,7 +333,10 @@ def main(devices, io, parallel = False):
import time
t = time.time()
measurement = dm.measure(devices2measure)
#getting data from devices
measurement = dm.measure(devices, devices2measure = devices2measure)
#save data
if save_check.value:
if name == None:
io.save(measurement,
......@@ -343,10 +346,12 @@ def main(devices, io, parallel = False):
kind = 'measure', comment = comment, name = name+'_'+str(i))
if parallel:
connec.send(measurement)
elif output_check.value:
dm.plot_measure(measurement, devices2measure,plot_config, 0.01)
plt.pause(0.001)
plt.draw_all(force = True)
print ('maximal possible rate: ',np.round(1/(time.time() -t),1))
if (1/rate_text.value - (time.time() -t) < 0):
print ('set rate cannot be reached.')
......
......@@ -746,7 +746,9 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
"collapsed": true,
"deletable": true,
"editable": true
},
"outputs": [],
"source": []
......@@ -952,7 +954,7 @@
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python [default]",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
......@@ -966,7 +968,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.3"
"version": "3.6.0"
},
"widgets": {
"state": {
......
Markdown is supported
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