1111from qcodes import validators as vals
1212from qcodes .instrument import (
1313 ChannelList ,
14- Instrument ,
14+ ChannelTuple ,
1515 InstrumentBaseKWArgs ,
1616 InstrumentChannel ,
1717 VisaInstrument ,
2929log = logging .getLogger (__name__ )
3030
3131
32- class QDevQDacChannel (InstrumentChannel ):
32+ class QDevQDacChannel (InstrumentChannel [ "QDevQDac" ] ):
3333 """
3434 A single output channel of the QDac.
3535
@@ -40,7 +40,7 @@ class QDevQDacChannel(InstrumentChannel):
4040
4141 def __init__ (
4242 self ,
43- parent : Instrument ,
43+ parent : "QDevQDac" ,
4444 name : str ,
4545 channum : int ,
4646 ** kwargs : "Unpack[InstrumentBaseKWArgs]" ,
@@ -143,9 +143,20 @@ def snapshot_base(
143143 update : bool | None = False ,
144144 params_to_skip_update : "Sequence[str] | None" = None ,
145145 ) -> dict [Any , Any ]:
146- update_currents = self ._parent ._update_currents and update
147- if update and not self ._parent ._get_status_performed :
148- self ._parent ._update_cache (readcurrents = update_currents )
146+ # setting update not None will override parent setting
147+ # otherwise we use parent setting
148+ # parent._update | update | do update
149+ # True | True | True
150+ # True | None | True
151+ # True | False | False
152+ # False | True | True
153+ # False | None | False
154+ # False | False | False
155+ update_currents = (
156+ self .parent ._update_currents and update is not False
157+ ) or update is True
158+ if update and not self .parent ._get_status_performed :
159+ self .parent ._update_cache (readcurrents = update_currents )
149160 # call get_status rather than getting the status individually for
150161 # each parameter. This is only done if _get_status_performed is False
151162 # this is used to signal that the parent has already called it and
@@ -287,7 +298,10 @@ def __init__(
287298 channels .append (channel )
288299 # Should raise valueerror if name is invalid (silently fails now)
289300 self .add_submodule (f"ch{ i :02} " , channel )
290- self .add_submodule ("channels" , channels .to_channel_tuple ())
301+ self .channels : ChannelTuple [QDevQDacChannel ] = self .add_submodule (
302+ "channels" , channels .to_channel_tuple ()
303+ )
304+ """ChannelTuple containing all QDevQDacChannel instances"""
291305
292306 for board in range (6 ):
293307 for sensor in range (3 ):
0 commit comments