1717from qcodes import validators as vals
1818from qcodes .instrument import (
1919 ChannelList ,
20- Instrument ,
2120 InstrumentBaseKWArgs ,
2221 InstrumentChannel ,
2322 VisaInstrument ,
@@ -157,14 +156,14 @@ def validate(self, value: float, context: str = "") -> None:
157156 validator .validate (value )
158157
159158
160- class Tektronix70000AWGChannel (InstrumentChannel ):
159+ class Tektronix70000AWGChannel (InstrumentChannel [ "TektronixAWG70000Base" ] ):
161160 """
162161 Class to hold a channel of the AWG.
163162 """
164163
165164 def __init__ (
166165 self ,
167- parent : Instrument ,
166+ parent : TektronixAWG70000Base ,
168167 name : str ,
169168 channel : int ,
170169 ** kwargs : Unpack [InstrumentBaseKWArgs ],
@@ -183,8 +182,8 @@ def __init__(
183182
184183 self .channel = channel
185184
186- num_channels = self .root_instrument .num_channels
187- self .model = self .root_instrument .model
185+ num_channels = self .parent .num_channels
186+ self .model = self .parent .model
188187
189188 fg = "function generator"
190189
@@ -264,7 +263,7 @@ def __init__(
264263 label = f"Channel { channel } { fg } signal path" ,
265264 set_cmd = f"FGEN:CHANnel{ channel } :PATH {{}}" ,
266265 get_cmd = f"FGEN:CHANnel{ channel } :PATH?" ,
267- val_mapping = _fg_path_val_map [self .root_instrument .model ],
266+ val_mapping = _fg_path_val_map [self .parent .model ],
268267 )
269268 """Parameter fgen_signalpath"""
270269
@@ -441,7 +440,7 @@ def _set_fgfreq(self, channel: int, frequency: float) -> None:
441440 "Hz, minimum is 1 Hz"
442441 )
443442 else :
444- self .root_instrument .write (f"FGEN:CHANnel{ channel } :FREQuency { frequency } " )
443+ self .parent .write (f"FGEN:CHANnel{ channel } :FREQuency { frequency } " )
445444
446445 def setWaveform (self , name : str ) -> None :
447446 """
@@ -451,10 +450,10 @@ def setWaveform(self, name: str) -> None:
451450 name: The name of the waveform
452451
453452 """
454- if name not in self .root_instrument .waveformList :
453+ if name not in self .parent .waveformList :
455454 raise ValueError ("No such waveform in the waveform list" )
456455
457- self .root_instrument .write (f'SOURce{ self .channel } :CASSet:WAVeform "{ name } "' )
456+ self .parent .write (f'SOURce{ self .channel } :CASSet:WAVeform "{ name } "' )
458457
459458 def setSequenceTrack (self , seqname : str , tracknr : int ) -> None :
460459 """
@@ -465,8 +464,7 @@ def setSequenceTrack(self, seqname: str, tracknr: int) -> None:
465464 tracknr: Which track to use (1 or 2)
466465
467466 """
468-
469- self .root_instrument .write (
467+ self .parent .write (
470468 f'SOURCE{ self .channel } :CASSet:SEQuence "{ seqname } ", { tracknr } '
471469 )
472470
@@ -475,7 +473,7 @@ def clear_asset(self) -> None:
475473 Clear assigned assets on this channel
476474 """
477475
478- self .root_instrument .write (f"SOURce{ self .channel } :CASSet:CLEAR" )
476+ self .parent .write (f"SOURce{ self .channel } :CASSet:CLEAR" )
479477
480478
481479AWGChannel = Tektronix70000AWGChannel
0 commit comments