ad9552_qt

ClkChannel

The ClkChannel class implements the on screen user interface for a single channel of the AD9552 clock generator device. Figure 1 shows the on screen appearance of a ClkChannel instance.

_images/ClkChannel.png

Figure 1: The ClkChannel user interface component.

class qtrfblocks.ClkChannel(channel: AD9552Channel, has_ui: bool)[source]

Create an instance of ClkChannel.

Parameters:
  • channel (rfblocks.AD9552Channel) – AD9552 channel configuration.

  • has_ui (bool) – Display channel GUI controls.

build_ui() QGroupBox[source]

Build the on-screen UI components for a clock channel.

property chan: AD9552Channel

Returns a reference to the AD9552Channel instance.

configure_ui() None[source]

Configure the on screen channel user interface controls.

property drive: DriveStrength

The current channel drive strength (rfblocks.ad9552.DriveStrength).

property has_ui: bool

Return True if this channel have an on screen representation, False otherwise.

Under some circumstances, it may not be desirable to have a user interface component associated with a clock channel. An example of this situation is where one of the two clock channels in a clock module is used as an internal reference. In these circumstances the channel will have a fixed configuration.

initialize_ui() None[source]

Configure the on screen channel user interface controls to their initial values.

property mode: OutputMode

The current channel output mode (rfblocks.ad9552.OutputMode).

property polarity: CmosPolarity

The current channel CMOS polarity (rfblocks.ad9552.CmosPolarity).

set_drive(drive: DriveStrength) None[source]

Set the channel drive strength.

Parameters:

drive (rfblocks.ad9552.DriveStrength) – The new value for the drive strength.

Note that this will set the value of the drive property only. Updating the clock channel hardware should be done separately. See, for example, ClkModule.configure_hw().

set_mode(mode: OutputMode) None[source]

Set the channel output mode.

Parameters:

mode (rfblocks.ad9552.OutputMode) – The new value for the output mode.

Note that this will set the value of the mode property only. Updating the clock channel hardware should be done separately. See, for example, ClkModule.configure_hw().

set_polarity(polarity: CmosPolarity) None[source]

Set the channel CMOS polarity.

Parameters:

polarity (rfblocks.ad9552.CmosPolarity) – The new value for the CMOS polarity.

Note that this will set the value of the polarity property only. Updating the clock channel hardware should be done separately. See, for example, ClkModule.configure_hw().

property source: SourceControl

The current channel source control setting (rfblocks.ad9552.SourceControl)

update_chan_drive(chan_id: int, drive: DriveStrength) None[source]

Update the Drive radio button group.

update_chan_mode(chan_id: int, mode: OutputMode) None[source]

Update the Mode radio button group.

update_chan_polarity(chan_id: int, polarity: CmosPolarity) None[source]

Update the CMOS Pol. radio button group.

update_chan_state(chan_id: int, state: OutputState) None[source]

Update the Active checkbox.

ClkModule

The ClkModule class implements the on screen user interface for the AD9552 clock generator device. The AD9552 is a dual channel device and the module UI therefore includes two ClkChannel instances. Figure 2 shows the on screen appearance of a ClkModule instance.

_images/ClkModule.png

Figure 2: The ClkModule user interface component.

class qtrfblocks.ClkModule(app: QWidget, module_id: str, controller: AD9552Controller, ch1_ui_enable: bool = True, ch2_ui_enable: bool = True)[source]

Create an instance of ClkModule.

Parameters:
  • app (QWidget) – The parent application for the clock module display.

  • module_id (str) – Clock module identifier (for example: ‘clkmod1’).

  • controller (rfblocks.AD9552Controller) – AD9552 clock generator controller.

  • ch1_ui_enable (bool) – Display channel 1 GUI controls.

  • ch2_ui_enable (bool) – Display channel 2 GUI controls.

build_ui() QGroupBox[source]

Build on-screen UI components for a clock module.

configure() None[source]

Update the clock module hardware using the currently set configuration.

configure_hw(ser: Serial) bool[source]

Update the clock module hardware using the currently set configuration.

Parameters:

ser – Device update commands will be sent via this serial device.

configure_ui() None[source]

Configure the on screen clock module user interface controls.

property ctl: AD9552Controller

Return a reference to the AD9552Controller.

dump_config() Dict[source]

Return the current configuration for this clock module.

Returns:

A dictionary containing the current clock modules configuration:

freq:

The currently set output frequency (in MHz).

channels:

A dictionary containing the channel configurations keyed using the channel id.

property enabled: bool

Enable/disable the on screen clock module UI components.

property freq: float

Returns the current output frequency (in MHz)

load_config(config: Dict) None[source]

Set the current configuration for this clock module.

Parameters:

config (Dict) – A dictionary containing the module configuration to be set.

set_freq(f: float) None[source]

Set the current output frequency.

Parameters:

f (float) – The new output frequency (in MHz)

Note that this will set the value of the freq property only. Updating the clock module hardware should be done separately. See, for example, configure_freq().

update_module_freq(f: float) None[source]

Update the displayed clock generator frequency.