@@ -9,7 +9,7 @@ class Transport(AutoContext):
9
9
"bd pmt repeats nbins "
10
10
"electrodes transport_data wait_at_stop speed"
11
11
)
12
-
12
+
13
13
def prepare (self , stop ):
14
14
t = self .transport_data ["t" ][:stop ]* self .speed
15
15
u = self .transport_data ["u" ][:stop ]
@@ -22,18 +22,20 @@ def prepare(self, stop):
22
22
# both (duration and segment triggering flag) to be retrieved during
23
23
# kernel compilation, see transport()
24
24
self .tf .append ("to_stop" ,
25
- t , u , trigger = True )
25
+ t , u , trigger = True )
26
26
# append the reverse transport (from stop to 0)
27
27
# both durations are the same in this case
28
28
self .tf .append ("from_stop" ,
29
- t [- 1 ] - t [::- 1 ], u [::- 1 ], trigger = True )
29
+ t [- 1 ] - t [::- 1 ], u [::- 1 ], trigger = True )
30
30
# closes the frame with a wait line before jumping back into
31
31
# the jump table so that frame signal can be set before the jump
32
32
# also mark the frame as closed and prevent further append()ing
33
33
self .tf .close ()
34
34
# user must pass all frames that are going to be used next
35
- # selects possible frame id based on rtio_frame assignments from coredev
36
- # distributes frames to the sub-devices in CompoundPDQ2 and uploads them
35
+ # selects possible frame id based on rtio_frame assignments
36
+ # from core device
37
+ # distributes frames to the sub-devices in CompoundPDQ2
38
+ # and uploads them
37
39
# uploading is ARM_DIS, writing, ARM_EN
38
40
self .electrodes .prepare (self .tf )
39
41
@@ -49,9 +51,7 @@ def transport(self):
49
51
# ensures no frame is currently being actively played
50
52
# set rtio frame select signal to frame id
51
53
# rtio trigger jump into transport frame
52
- # (it would be nice if this could be made zero-duration/not advancing the
53
- # timeline by smart scheduling of this frame-select + trigger + minimum wait
54
- # sequence)
54
+ # (does not advance the timeline)
55
55
self .tf .begin ()
56
56
# triggers pdqs to start transport frame segment
57
57
# plays the transport waveform from 0 to stop
@@ -109,9 +109,9 @@ def scan(self, stops):
109
109
if __name__ == "__main__" :
110
110
# data is usually precomputed offline
111
111
data = dict (
112
- t = np .linspace (0 , 10 , 101 ), # waveform time
113
- u = np .random .randn (101 , 4 * 3 * 3 ), # waveform data,
114
- # 4 devices, 3 board each, 3 dacs each
112
+ t = np .linspace (0 , 10 , 101 ), # waveform time
113
+ u = np .random .randn (101 , 4 * 3 * 3 ), # waveform data,
114
+ # 4 devices, 3 board each, 3 dacs each
115
115
)
116
116
117
117
with corecom_serial .CoreCom () as com :
@@ -125,10 +125,11 @@ def scan(self, stops):
125
125
pmt = rtio_core .RTIOIn (core = coredev , channel = 0 ),
126
126
# a compound pdq device that wraps multiple usb devices (looked up
127
127
# by usb "serial number"/id) into one
128
- electrodes = pdq2 .CompoundPDQ2 (core = coredev ,
128
+ electrodes = pdq2 .CompoundPDQ2 (
129
+ core = coredev ,
129
130
ids = ["qc_q1_{}" .format (i ) for i in range (4 )],
130
131
rtio_trigger = 3 , rtio_frame = (4 , 5 , 6 )),
131
- transport_data = data , # or: json.load
132
+ transport_data = data , # or: json.load
132
133
wait_at_stop = 100 * us ,
133
134
speed = 1.5 ,
134
135
repeats = 100 ,
0 commit comments