|
13 | 13 |
|
14 | 14 | from blacs.tab_base_classes import Worker |
15 | 15 | import labscript_utils.h5_lock, h5py |
| 16 | +import numpy as np |
16 | 17 |
|
17 | 18 |
|
18 | 19 | class WindfreakSynthWorker(Worker): |
@@ -79,28 +80,31 @@ def program_manual(self, front_panel_values): |
79 | 80 |
|
80 | 81 | return self.check_remote_values() |
81 | 82 |
|
82 | | - def check_remote_value(self,channel,type): |
| 83 | + def check_remote_value(self,channel,typ): |
83 | 84 |
|
84 | | - if type == 'freq': |
| 85 | + if typ == 'freq': |
85 | 86 | return self.synth[channel].frequency |
86 | | - elif type == 'amp': |
| 87 | + elif typ == 'amp': |
87 | 88 | return self.synth[channel].power |
88 | | - elif type == 'phase': |
| 89 | + elif typ == 'phase': |
89 | 90 | return self.synth[channel].phase |
90 | | - elif type == 'gate': |
| 91 | + elif typ == 'gate': |
91 | 92 | return self.synth[channel].rf_enable and self.synth[channel].pll_enable |
92 | 93 | else: |
93 | 94 | raise ValueError(type) |
94 | 95 |
|
95 | | - def program_static_value(self,channel,type,value): |
| 96 | + def program_static_value(self,channel,typ,value): |
96 | 97 |
|
97 | | - if type == 'freq': |
| 98 | + if typ == 'freq': |
98 | 99 | self.synth[channel].frequency = value |
99 | | - elif type == 'amp': |
| 100 | + elif typ == 'amp': |
100 | 101 | self.synth[channel].power = value |
101 | | - elif type == 'phase': |
| 102 | + elif typ == 'phase': |
102 | 103 | self.synth[channel].phase = value |
103 | | - elif type == 'gate': |
| 104 | + elif typ == 'gate': |
| 105 | + # windfreak API does not like np.bool_ |
| 106 | + # convert to native python bool |
| 107 | + if isinstance(value, np.bool_): value = value.item() |
104 | 108 | self.synth[channel].rf_enable = value |
105 | 109 | self.synth[channel].pll_enable = value |
106 | 110 | else: |
|
0 commit comments