示例#1
0
 def _init_sweeper_params(self):
     self.oscillator_gain = Parameter(
         self,
         self._device._get_node_dict(f"qachannels/{self._index}/oscs/0/gain"),
         device=self._device,
         set_parser=[
             lambda v: Parse.smaller_equal(v, 1.0),
             lambda v: Parse.greater_equal(v, 0.0),
         ],
     )
     self.oscillator_freq = Parameter(
         self,
         self._device._get_node_dict(f"qachannels/{self._index}/oscs/0/freq"),
         device=self._device,
         set_parser=[
             lambda v: Parse.smaller_equal(v, 1e9),
             lambda v: Parse.greater_equal(v, 0.0),
         ],
     )
     self.integration_time = Parameter(
         self,
         dict(
             Node=f"{self._device.serial}/qachannels/{self._index}/spectroscopy/length".upper(),
             Description="Sets the integration length in Spectroscopy mode in unit "
             "of seconds. Up to 16.7 ms can be recorded, which "
             "corresponds to 33.5 MSa (2^25 samples).",
             Type="Double",
             Properties="Read, Write, Setting",
             Unit="s",
         ),
         device=self._device,
         set_parser=Parse.shfqa_time2samples,
         get_parser=Parse.shfqa_samples2time,
     )
     self.integration_length = Parameter(
         self,
         self._device._get_node_dict(
             f"qachannels/{self._index}/spectroscopy/length"
         ),
         device=self._device,
         set_parser=[
             lambda v: Parse.greater_equal(v, 4),
             lambda v: Parse.smaller_equal(v, ((2 ** 23) - 1) * 4),
             lambda v: Parse.multiple_of(v, 4, "down"),
         ],
     )
     self.integration_delay = Parameter(
         self,
         self._device._get_node_dict(f"qachannels/{self._index}/spectroscopy/delay"),
         device=self._device,
         set_parser=lambda v: Parse.multiple_of(v, 2e-9, "nearest"),
     )
     self.trigger_source = Parameter(
         self,
         self._device._get_node_dict(
             f"qachannels/{self._index}/spectroscopy/trigger/channel"
         ),
         device=self._device,
         auto_mapping=True,
     )
示例#2
0
 def _init_qachannel_params(self):
     self.input = Parameter(
         self,
         self._parent._get_node_dict(f"qachannels/{self._index}/input/on"),
         device=self._parent,
         set_parser=Parse.set_on_off,
         get_parser=Parse.get_on_off,
     )
     self.input_range = Parameter(
         self,
         self._parent._get_node_dict(
             f"qachannels/{self._index}/input/range"),
         device=self._parent,
         set_parser=[
             lambda v: Parse.greater_equal(v, -50),
             lambda v: Parse.smaller_equal(v, 10),
             lambda v: Parse.multiple_of(v, 5, "nearest"),
         ],
     )
     self.output = Parameter(
         self,
         self._parent._get_node_dict(f"qachannels/{self._index}/output/on"),
         device=self._parent,
         set_parser=Parse.set_on_off,
         get_parser=Parse.get_on_off,
     )
     self.output_range = Parameter(
         self,
         self._parent._get_node_dict(
             f"qachannels/{self._index}/output/range"),
         device=self._parent,
         set_parser=[
             lambda v: Parse.greater_equal(v, -50),
             lambda v: Parse.smaller_equal(v, 10),
             lambda v: Parse.multiple_of(v, 5, "nearest"),
         ],
     )
     self.center_freq = Parameter(
         self,
         self._parent._get_node_dict(
             f"qachannels/{self._index}/centerfreq"),
         device=self._parent,
         set_parser=[
             lambda v: Parse.greater_equal(v, 1e9),
             lambda v: Parse.smaller_equal(v, 8e9),
             lambda v: Parse.multiple_of(v, 100e6, "nearest"),
         ],
     )
     self.mode = Parameter(
         self,
         self._parent._get_node_dict(f"qachannels/{self._index}/mode"),
         device=self._parent,
         auto_mapping=True,
     )
示例#3
0
 def _init_scope_params(self):
     self._enable = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/enable"),
         device=self._parent,
         set_parser=Parse.set_true_false,
         get_parser=Parse.get_true_false,
     )
     self.single = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/single"),
         device=self._parent,
         set_parser=Parse.set_true_false,
         get_parser=Parse.get_true_false,
     )
     self.length = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/length"),
         device=self._parent,
         set_parser=[
             lambda v: Parse.greater_equal(v, 4096),
             lambda v: Parse.smaller_equal(v, 128000000),
             lambda v: Parse.multiple_of(v, 16, "down"),
         ],
     )
     self._channel = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/channel"),
         device=self._parent,
     )
     self.trigger_source = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/trigchannel"),
         device=self._parent,
         auto_mapping=True,
     )
     self.trigger_level = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/triglevel"),
         device=self._parent,
     )
     self.trigger_enable = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/trigenable"),
         device=self._parent,
         set_parser=Parse.set_true_false,
         get_parser=Parse.get_true_false,
     )
     self.trigger_reference = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/trigreference"),
         device=self._parent,
     )
     self.trigger_holdoff = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/trigholdoff"),
         device=self._parent,
     )
示例#4
0
 def _init_params(self):
     """Initialize parameters associated with device nodes."""
     super()._init_params()
     self.ref_clock = Parameter(
         self,
         self._get_node_dict(f"system/clocks/referenceclock/in/source"),
         device=self,
         auto_mapping=True,
     )
     self.ref_clock_actual = Parameter(
         self,
         self._get_node_dict(
             f"system/clocks/referenceclock/in/sourceactual"),
         device=self,
         auto_mapping=True,
     )
     self.ref_clock_status = Parameter(
         self,
         self._get_node_dict(f"system/clocks/referenceclock/in/status"),
         device=self,
         get_parser=Parse.get_locked_status,
     )
     self.progress = Parameter(
         self,
         self._get_node_dict(f"execution/progress"),
         device=self,
     )
     self._enable = Parameter(
         self,
         self._get_node_dict(f"execution/enable"),
         device=self,
         set_parser=Parse.set_true_false,
         get_parser=Parse.get_true_false,
     )
     self.repetitions = Parameter(
         self,
         self._get_node_dict(f"execution/repetitions"),
         device=self,
         set_parser=[
             lambda v: Parse.greater_equal(v, 1),
             lambda v: Parse.smaller_equal(v, 2**32 - 1),
         ],
     )
     self.holdoff = Parameter(
         self,
         self._get_node_dict(f"execution/holdoff"),
         device=self,
         set_parser=[
             lambda v: Parse.greater_equal(v, 100e-9),
             lambda v: Parse.multiple_of(v, 100e-9, "nearest"),
         ],
     )
示例#5
0
 def _init_params(self):
     """Initialize parameters associated with device nodes."""
     super()._init_params()
     self.integration_time = Parameter(
         self,
         dict(
             Node=f"{self.serial}/qas/0/integration/length".upper(),
             Description=
             "The integration time of all weighted integration units "
             "specified in seconds. In Standard mode, a maximum of 4096 "
             "samples can be integrated, which corresponds to 2.3 µs. "
             "In Spectroscopy mode, a maximum of 16.7 MSa can be "
             "integrated, which corresponds to ~10 ms.",
             Type="Double",
             Properties="Read, Write, Setting",
             Unit="s",
         ),
         device=self,
         set_parser=Parse.uhfqa_time2samples,
         get_parser=Parse.uhfqa_samples2time,
     )
     self.integration_length = Parameter(
         self,
         self._get_node_dict("qas/0/integration/length"),
         device=self,
         set_parser=[
             lambda v: Parse.greater_equal(v, 4),
             lambda v: Parse.multiple_of(v, 4, "down"),
         ],
     )
     self.result_source = Parameter(
         self,
         self._get_node_dict("qas/0/result/source"),
         device=self,
         mapping=MAPPINGS["result_source"],
     )
     self.averaging_mode = Parameter(
         self,
         self._get_node_dict("qas/0/result/mode"),
         device=self,
         mapping=MAPPINGS["averaging_mode"],
     )
     self.ref_clock = Parameter(
         self,
         self._get_node_dict(f"system/extclk"),
         device=self,
         auto_mapping=True,
     )
示例#6
0
 def _init_generator_params(self):
     self._enable = Parameter(
         self,
         self._device._get_node_dict(
             f"qachannels/{self._index}/generator/enable"),
         device=self._device,
         set_parser=Parse.set_true_false,
         get_parser=Parse.get_true_false,
     )
     self.dig_trigger1_source = Parameter(
         self,
         self._device._get_node_dict(
             f"qachannels/{self._index}/generator/auxtriggers/0/channel"),
         device=self._device,
         auto_mapping=True,
     )
     self.dig_trigger2_source = Parameter(
         self,
         self._device._get_node_dict(
             f"qachannels/{self._index}/generator/auxtriggers/1/channel"),
         device=self._device,
         auto_mapping=True,
     )
     self.playback_delay = Parameter(
         self,
         self._device._get_node_dict(
             f"qachannels/{self._index}/generator/delay"),
         device=self._device,
         set_parser=lambda v: Parse.multiple_of(v, 2e-9, "nearest"),
     )
     self._ready = Parameter(
         self,
         self._device._get_node_dict(
             f"qachannels/{self._index}/generator/ready"),
         device=self._device,
     )
     self.single = Parameter(
         self,
         self._device._get_node_dict(
             f"qachannels/{self._index}/generator/single"),
         device=self._device,
         set_parser=Parse.set_true_false,
         get_parser=Parse.get_true_false,
     )
示例#7
0
 def _init_scope_params(self):
     self._enable = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/enable"),
         device=self._parent,
         set_parser=Parse.set_true_false,
         get_parser=Parse.get_true_false,
     )
     self.channel1 = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/channels/0/enable"),
         device=self._parent,
         set_parser=Parse.set_on_off,
         get_parser=Parse.get_on_off,
     )
     self.channel2 = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/channels/1/enable"),
         device=self._parent,
         set_parser=Parse.set_on_off,
         get_parser=Parse.get_on_off,
     )
     self.channel3 = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/channels/2/enable"),
         device=self._parent,
         set_parser=Parse.set_on_off,
         get_parser=Parse.get_on_off,
     )
     self.channel4 = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/channels/3/enable"),
         device=self._parent,
         set_parser=Parse.set_on_off,
         get_parser=Parse.get_on_off,
     )
     self.input_select1 = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/channels/0/inputselect"),
         device=self._parent,
         auto_mapping=True,
     )
     self.input_select2 = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/channels/1/inputselect"),
         device=self._parent,
         auto_mapping=True,
     )
     self.input_select3 = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/channels/2/inputselect"),
         device=self._parent,
         auto_mapping=True,
     )
     self.input_select4 = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/channels/3/inputselect"),
         device=self._parent,
         auto_mapping=True,
     )
     self._wave1 = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/channels/0/wave"),
         device=self._parent,
     )
     self._wave2 = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/channels/1/wave"),
         device=self._parent,
     )
     self._wave3 = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/channels/2/wave"),
         device=self._parent,
     )
     self._wave4 = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/channels/3/wave"),
         device=self._parent,
     )
     self.trigger_source = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/trigger/channel"),
         device=self._parent,
         auto_mapping=True,
     )
     self.trigger_delay = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/trigger/delay"),
         device=self._parent,
         set_parser=lambda v: Parse.multiple_of(v, 2e-9, "nearest"),
     )
     self.length = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/length"),
         device=self._parent,
         set_parser=[
             lambda v: Parse.greater_equal(v, 16),
             lambda v: Parse.smaller_equal(v, 2 ** 18),
             lambda v: Parse.multiple_of(v, 16, "down"),
         ],
     )
     self.time = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/time"),
         device=self._parent,
         auto_mapping=True,
     )
     self._segments_enable = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/segments/enable"),
         device=self._parent,
         set_parser=Parse.set_true_false,
         get_parser=Parse.get_true_false,
     )
     self._segments_count = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/segments/count"),
         device=self._parent,
         set_parser=lambda v: Parse.greater(v, 0),
     )
     self._averaging_enable = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/averaging/enable"),
         device=self._parent,
         set_parser=Parse.set_true_false,
         get_parser=Parse.get_true_false,
     )
     self._averaging_count = Parameter(
         self,
         self._parent._get_node_dict(f"scopes/0/averaging/count"),
         device=self._parent,
         set_parser=lambda v: Parse.greater(v, 0),
     )