| name | scopy-decision-frameworks |
| description | Decision trees for common Scopy architectural choices - plugin vs core, tool vs section, widget type selection, sync vs async, GNU Radio vs direct, package organization, and API exposure. Loaded when making design decisions. |
Scopy Decision Frameworks
Plugin vs Core Library
Is this feature device-specific?
āāā YES ā Plugin (in the device's package)
āāā NO
āāā Is it used by 3+ plugins?
ā āāā YES ā Core library (common, gui, iioutil, or pluginbase)
ā āāā NO
ā āāā Is it optional/removable?
ā ā āāā YES ā Plugin (in generic-plugins package)
ā ā āāā NO ā Core library
ā āāā Is it UI-only?
ā āāā YES ā gui library
ā āāā NO ā common or iioutil
Guidelines:
- If it touches IIO directly ā
iioutil or iio-widgets
- If it's a reusable Qt widget ā
gui
- If it's plugin infrastructure ā
pluginbase
- If it manages packages ā
pkg-manager
- If none of the above ā
common
New Package vs Extend Existing
Does this support a new device family?
āāā YES ā New package under packages/
āāā NO
āāā Does the target device already have a package?
ā āāā YES ā Add plugin to existing package
ā āāā NO
ā āāā Is it a reference design using existing devices?
ā ā āāā YES ā New package (like cn0511, daq2, fmcomms11)
ā ā āāā NO ā generic-plugins package
ā āāā Is it cross-device utility?
ā āāā YES ā generic-plugins package
Tool vs Section
Does this feature have its own independent workflow?
āāā YES ā New tool (new ToolMenuEntry in loadToolList())
ā User sees it as a separate menu item
āāā NO
āāā Is it part of an existing tool's workflow?
ā āāā YES ā New section in existing tool
ā ā (MenuSectionCollapseWidget or tab)
ā āāā NO
ā āāā Is it configuration/settings?
ā ā āāā YES ā Preferences page (loadPreferencesPage())
ā ā āāā NO ā New tool
ā āāā Is it a one-time action?
ā āāā YES ā Button or menu action in existing tool
ā āāā NO ā New tool
IIOWidget vs Custom Widget
Does it map to a single IIO attribute?
āāā YES
ā āāā Enumerated values? ā IIOWidgetBuilder::ComboUi
ā āāā Numeric range? ā IIOWidgetBuilder::RangeUi
ā āāā Boolean on/off? ā IIOWidgetBuilder::CheckBoxUi or SwitchUi
ā āāā Free-form text? ā IIOWidgetBuilder::EditableUi
ā āāā Temperature with thresholds? ā IIOWidgetBuilder::TemperatureUi
ā āāā Read-only status? ā IIOWidgetBuilder with read-only pattern + timer polling
āāā NO
āāā Multi-attribute interaction? ā Custom QWidget
ā (e.g., gain + frequency coupled control)
āāā Complex visualization? ā Custom QWidget with QWT plots
āāā File selection/dialog? ā Custom QWidget
āāā No IIO attribute at all? ā Standard Qt widget
IIOWidgetBuilder decision sub-tree:
Has available-attribute (enum options)?
āāā YES ā Use .optionsAttribute("attr_available") with ComboUi
āāā NO
āāā Has numeric range?
ā āāā Range from optionsAttribute ā .optionsAttribute() with RangeUi
ā āāā Hardcoded range ā .optionsValues("min max step") with RangeUi
āāā No constraints ā EditableUi (accepts any string)
Sync vs Async IIO Access
What's the access pattern?
āāā One-time read at startup ā Direct iio_*_attr_read() in onConnect()
āāā Periodic polling (device status) ā CyclicalTask
ā āāā Set period based on data rate needs (default 5000ms)
āāā Connection health monitoring ā PingTask subclass
ā āāā Implement ping() to check device alive
āāā User-triggered read/write ā IIOWidget with read()/writeAsync()
ā āāā Group with IIOWidgetGroup for batch operations
āāā Continuous data streaming ā GNU Radio pipeline (gr-util)
āāā Event-driven updates ā MessageBroker subscription
GNU Radio vs Direct Data Processing
Is this continuous data streaming?
āāā YES
ā āāā Needs signal processing (FFT, filtering, decimation)?
ā ā āāā YES ā GNU Radio pipeline with gr-util
ā ā āāā NO ā Direct IIO buffer reads
ā āāā Needs real-time plotting?
ā ā āāā YES ā GNU Radio ā QWT plot sink
ā ā āāā NO ā Direct IIO ā custom processing
ā āāā Multiple channels with different processing?
ā āāā YES ā GNU Radio flowgraph (natural multi-path support)
āāā NO
āāā Single attribute read/write ā IIOWidget or direct IIO call
āāā Batch attribute operations ā IIOWidgetGroup
āāā Register-level access ā Direct IIO device attribute read/write
API Exposure Decision
Does this feature need automated testing?
āāā YES ā Create *_api.h / *_api.cpp
ā āāā Inherit from ApiObject
ā āāā Q_INVOKABLE on all public methods
ā āāā friend class in plugin header
ā āāā Register with ScopyJS in onConnect()
ā āāā Delete at start of onDisconnect()
āāā NO
āāā Is it UI-only with no testable state?
ā āāā YES ā No API needed
āāā Might it need scripting access later?
ā āāā YES ā Create API now (cheaper than retrofitting)
āāā Is it infrastructure/internal?
āāā YES ā No API needed
Testing Strategy Decision
What type of feature is this?
āāā Core library change ā Qt unit tests in library's test/ dir
āāā Plugin with IIO attributes
ā āāā Unit tests ā Qt Test (mock IIO context if possible)
ā āāā Integration tests ā JS HITL tests (claude_scopy_dev_plugin branch)
ā āāā Manual tests ā RST test docs with UIDs and RBP levels
ā āāā API class ā Required for JS automation
āāā UI-only change
ā āāā Visual tests ā JS VisualTests.js with supervisedCheck()
ā āāā Manual tests ā RST test docs (Category C)
āāā Build/CI change ā CI pipeline validation
Communication Pattern Decision
Who needs to know about this event?
āāā Same plugin only ā Qt signals/slots (direct connection)
āāā Other plugins need to react
ā āāā Known recipients ā MessageBroker with specific topic
ā āāā Broadcast to all ā MessageBroker with "broadcast" topic
āāā Core needs to react ā Plugin signals (connectDevice, disconnectDevice, etc.)
āāā UI needs to update ā Qt signals/slots + property binding
āāā External tools need access ā ScopyJS API registration