1+ #####################################################################
2+ # #
3+ # /labscript_devices/DummyPseudoclock/DummyPseudoclock.py #
4+ # #
5+ # Copyright 2017, Christopher Billington #
6+ # #
7+ # This file is part of labscript_devices, in the labscript suite #
8+ # (see http://labscriptsuite.org), and is licensed under the #
9+ # Simplified BSD License. See the license.txt file in the root of #
10+ # the project for the full license. #
11+ # #
12+ #####################################################################
13+ from __future__ import division , unicode_literals , print_function , absolute_import
14+ from labscript_utils import PY2
15+ if PY2 :
16+ str = unicode
17+
18+ # This file represents a dummy labscript device for purposes of testing BLACS
19+ # and labscript. The device is a PseudoclockDevice, and can be the sole device
20+ # in a connection table or experiment.
21+
22+ import labscript_utils .h5_lock
23+ import h5py
24+ from labscript import PseudoclockDevice , Pseudoclock , ClockLine
25+
26+
27+ class DummyPseudoclock (PseudoclockDevice ):
28+
29+ description = 'Dummy pseudoclock'
30+ clock_limit = 1e6
31+ clock_resolution = 1e-6
32+
33+ def __init__ (self , name = 'dummy_pseudoclock' , BLACS_connection = 'dummy_connection' , ** kwargs ):
34+ self .BLACS_connection = BLACS_connection
35+ PseudoclockDevice .__init__ (self , name , None , None , ** kwargs )
36+ self .pseudoclock = Pseudoclock (self .name + '_pseudoclock' , self , 'pseudoclock' )
37+ self .clockline = ClockLine (name = 'clockline' , pseudoclock = self .pseudoclock , connection = 'dummy' )
38+
39+ def generate_code (self , hdf5_file ):
40+ group = self .init_device_group (hdf5_file )
41+ self .set_property ('stop_time' , self .stop_time , location = 'device_properties' )
0 commit comments