taurus.cli.alt

This module provides several taurus CLI subcommands (plot, trend, image,…) that show a widget which may have more than one alternative implementation. The available registered implementations for each command can be listed with the –ls-alt option. Specific implementations can be selected with the –use-alt option.

These commands also honour the default implementation selection configured in taurus.tauruscustomsettings via the *_ALT variables

The alternative implementations can be registered using the following entry-point group names:

  • taurus.plot.alt: the loaded object is expected to be a TaurusPlot implementation

  • taurus.trend.alt: the loaded object is expected to be a TaurusTrend implementation

  • taurus.trend2d.alt: the loaded object is expected to be a TaurusTrend2dDialog implementation

  • taurus.image.alt: the loaded object is expected to be a TaurusImageDialog implementation

Expected API for alternative implementations

When registering a widget class to be used for these commands, the classes need to provide the following minimum API:

  • For all the classes: - must be a Qt.QWidget - must implement setModel() and getModel() equivalent to those in taurus.qt.qtgui.base.TaurusBaseComponent

  • For TaurusPlot: - should implement setXAxisMode(mode) where mode is one of “n” or “t” - should implement loadConfigFile(name) equivalent to taurus.qt.qtcore.configuration.BaseConfigurableClass.loadConfigFile()

  • For TaurusTrend: - should implement setXAxisMode(mode) where mode is one of “n” or “t” - should implement loadConfigFile(name) equivalent to taurus.qt.qtcore.configuration.BaseConfigurableClass.loadConfigFile() - should implement setMaxDataBufferSize(n) where n is an integer - should implement setForcedReadingPeriod(period) where period is an integer

  • For TaurusTrend2D: - should accept the following keyword arguments in its constructor:

    • stackMode=x_axis_mode where mode is one of “d” or “n” or “t”

    • wintitle=window_name,

    • buffersize=max_buffer_size

  • For TaurusImage: - should accept the following keyword arguments in its constructor:

    • wintitle=window_name,

    • should implement setRGBmode(mode) where mode is one of “gray”, “rgb”

Functions

max_buffer_option(default)[source]
x_axis_mode_option(choices=('t', 'n'))[source]