GUI Components API¶
PyQt6-based graphical user interface for oscilloscope control
Main Window¶
scpi_control.gui.main_window
¶
Main window for Siglent oscilloscope control GUI.
MainWindow
¶
Bases: QMainWindow
Main application window for oscilloscope control.
Initialize main window.
Source code in scpi_control/gui/main_window.py
closeEvent
¶
Handle window close event.
Source code in scpi_control/gui/main_window.py
options: show_root_heading: false show_source: true heading_level: 3 members_order: source group_by_category: true show_signature_annotations: true separate_signature: true merge_init_into_class: true filters: - "!^*" # Exclude private members
Connection Manager¶
scpi_control.gui.connection_manager
¶
Connection manager for storing and retrieving recent oscilloscope connections.
ConnectionManager
¶
Manages recent oscilloscope connections using QSettings.
Stores connection history persistently across application sessions, including IP addresses, ports, model information, and timestamps.
Initialize connection manager with QSettings.
Source code in scpi_control/gui/connection_manager.py
add_connection
¶
Add a connection to the recent connections list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
host
|
str
|
IP address or hostname |
required |
port
|
int
|
TCP port (default: 5024) |
5024
|
model_name
|
Optional[str]
|
Optional model name (e.g., "SDS824X HD") |
None
|
Source code in scpi_control/gui/connection_manager.py
get_recent_connections
¶
Get list of recent connections.
Returns:
| Type | Description |
|---|---|
List[Dict[str, any]]
|
List of connection dictionaries with keys: host, port, model_name, timestamp |
List[Dict[str, any]]
|
Sorted by most recent first |
Source code in scpi_control/gui/connection_manager.py
clear_recent_connections
¶
remove_connection
¶
Remove a specific connection from recent list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
host
|
str
|
IP address or hostname |
required |
port
|
int
|
TCP port |
5024
|
Source code in scpi_control/gui/connection_manager.py
get_last_connection
¶
Get the most recent connection.
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, any]]
|
Connection dictionary or None if no recent connections |
Source code in scpi_control/gui/connection_manager.py
save_connection_profile
¶
save_connection_profile(name: str, host: str, port: int = 5024, model_name: Optional[str] = None, notes: Optional[str] = None) -> None
Save a named connection profile.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Profile name |
required |
host
|
str
|
IP address or hostname |
required |
port
|
int
|
TCP port |
5024
|
model_name
|
Optional[str]
|
Optional model name |
None
|
notes
|
Optional[str]
|
Optional notes about this connection |
None
|
Source code in scpi_control/gui/connection_manager.py
get_connection_profiles
¶
Get all saved connection profiles.
Returns:
| Type | Description |
|---|---|
Dict[str, Dict[str, any]]
|
Dictionary of profile_name -> profile_data |
Source code in scpi_control/gui/connection_manager.py
get_connection_profile
¶
Get a specific connection profile by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Profile name |
required |
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, any]]
|
Profile dictionary or None if not found |
Source code in scpi_control/gui/connection_manager.py
delete_connection_profile
¶
Delete a connection profile.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Profile name to delete |
required |
Source code in scpi_control/gui/connection_manager.py
format_connection_display
¶
Format a connection for display in UI.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
connection
|
Dict[str, any]
|
Connection dictionary |
required |
Returns:
| Type | Description |
|---|---|
str
|
Formatted string for display |
Source code in scpi_control/gui/connection_manager.py
options: show_root_heading: false show_source: true heading_level: 3 members_order: source group_by_category: true show_signature_annotations: true separate_signature: true merge_init_into_class: true filters: - "!^*"
Widgets¶
Waveform Display¶
scpi_control.gui.widgets.waveform_display
¶
Waveform display widget using matplotlib.
WaveformDisplay
¶
Bases: QWidget
Widget for displaying oscilloscope waveforms using matplotlib.
Features: - Multiple channel display with different colors - Grid toggle - Autoscale - Zoom and pan (via matplotlib toolbar) - Export to image
Initialize waveform display widget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
Parent widget |
None
|
Source code in scpi_control/gui/widgets/waveform_display.py
plot_waveform
¶
Plot a waveform on the display.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
waveform
|
WaveformData
|
WaveformData object to plot |
required |
clear_others
|
bool
|
If True, clear other channels before plotting |
False
|
Source code in scpi_control/gui/widgets/waveform_display.py
plot_multiple_waveforms
¶
Plot multiple waveforms.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
waveforms
|
List[WaveformData]
|
List of WaveformData objects to plot |
required |
fast_update
|
bool
|
If True, use fast update for live view (doesn't clear axes) |
False
|
Source code in scpi_control/gui/widgets/waveform_display.py
update_waveform
¶
Update existing waveform or add new one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
waveform
|
WaveformData
|
WaveformData object to update/add |
required |
clear_channel
¶
Clear waveform for a specific channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel
|
int
|
Channel number to clear (1-4) |
required |
Source code in scpi_control/gui/widgets/waveform_display.py
clear_all
¶
set_theme
¶
Set display theme.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dark
|
bool
|
True for dark theme, False for light theme |
True
|
Source code in scpi_control/gui/widgets/waveform_display.py
toggle_grid
¶
Toggle grid display (callable from external sources like keyboard shortcuts).
Source code in scpi_control/gui/widgets/waveform_display.py
reset_zoom
¶
Reset zoom to default view (callable from external sources).
Source code in scpi_control/gui/widgets/waveform_display.py
set_cursor_mode
¶
Set cursor mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
str
|
Cursor mode ('off', 'vertical', 'horizontal', 'both') |
required |
Source code in scpi_control/gui/widgets/waveform_display.py
get_cursor_values
¶
Get current cursor position values.
Returns:
| Type | Description |
|---|---|
dict
|
Dictionary with cursor positions |
Source code in scpi_control/gui/widgets/waveform_display.py
set_reference
¶
Set reference waveform for overlay.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reference_data
|
dict
|
Reference data dictionary with 'time' and 'voltage' keys |
required |
Source code in scpi_control/gui/widgets/waveform_display.py
clear_reference
¶
Clear reference waveform.
toggle_reference_visibility
¶
Toggle reference waveform visibility.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visible
|
bool
|
Whether reference should be visible |
required |
toggle_difference_mode
¶
Toggle difference mode (show waveform - reference).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
enabled
|
bool
|
Whether to show difference |
required |
get_reference_data
¶
Get current reference data.
Returns:
| Type | Description |
|---|---|
|
Reference data dictionary or None |
add_measurement_marker
¶
Add a measurement marker to display.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
marker
|
MeasurementMarker object to add |
required |
Source code in scpi_control/gui/widgets/waveform_display.py
remove_measurement_marker
¶
Remove a measurement marker from display.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
marker
|
MeasurementMarker object to remove |
required |
Source code in scpi_control/gui/widgets/waveform_display.py
clear_all_markers
¶
Clear all measurement markers.
Source code in scpi_control/gui/widgets/waveform_display.py
set_marker_mode
¶
Set interaction mode for markers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
str
|
Marker mode ('off', 'add', 'edit') |
required |
marker_type
|
str
|
Type of marker to add (required if mode='add') |
None
|
channel
|
int
|
Channel for marker (required if mode='add') |
None
|
Source code in scpi_control/gui/widgets/waveform_display.py
get_marker_measurements
¶
Get all measurement results from markers.
Returns:
| Type | Description |
|---|---|
Dict
|
Dictionary mapping marker IDs to results |
Source code in scpi_control/gui/widgets/waveform_display.py
update_all_markers
¶
Update all enabled markers with current waveform data.
Source code in scpi_control/gui/widgets/waveform_display.py
options: show_root_heading: false show_source: true heading_level: 4 members_order: source show_signature_annotations: true filters: - "!^*"
scpi_control.gui.widgets.waveform_display_pg
¶
PyQtGraph-based waveform display widget for high-performance real-time plotting.
This module provides a drop-in replacement for the matplotlib-based waveform display, offering 100x performance improvement for real-time live view updates.
Performance Characteristics
- 1000+ fps capability (vs 5-10 fps with matplotlib)
- Updates existing plot items instead of clearing/redrawing
- Typical update time: <1ms per frame
- Non-blocking updates for smooth GUI interaction
Features
- Real-time multi-channel waveform display (up to 4 channels)
- Interactive zoom, pan, and autoscaling
- Oscilloscope-style color scheme and grid
- Channel enable/disable controls
- Cursor support for measurements
- Measurement marker overlay support
- Export to PNG/JPEG
Architecture
Uses PyQtGraph's PlotWidget for hardware-accelerated rendering. Plot items are created once and updated with setData() for minimal overhead. Designed for threaded live view with LiveViewWorker.
Example
display = WaveformDisplayPG() display.plot_multiple_waveforms([waveform1, waveform2]) display.toggle_grid() display.autoscale()
WaveformDisplayPG
¶
Bases: QWidget
High-performance waveform display using PyQtGraph.
Features: - Real-time plotting at 1000+ fps - Multiple channel display with different colors - Interactive cursors - Measurement markers - Grid toggle - Autoscale - Export to image
Initialize PyQtGraph waveform display widget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
Parent widget |
None
|
Source code in scpi_control/gui/widgets/waveform_display_pg.py
plot_waveform
¶
Plot a waveform on the display.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
waveform
|
WaveformData
|
WaveformData object to plot |
required |
clear_others
|
bool
|
If True, clear other channels before plotting |
False
|
Source code in scpi_control/gui/widgets/waveform_display_pg.py
plot_multiple_waveforms
¶
Plot multiple waveforms.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
waveforms
|
List[WaveformData]
|
List of WaveformData objects to plot |
required |
fast_update
|
bool
|
If True, use fast update for live view (PyQtGraph is always fast) |
False
|
Source code in scpi_control/gui/widgets/waveform_display_pg.py
update_waveform
¶
Update existing waveform or add new one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
waveform
|
WaveformData
|
WaveformData object to update/add |
required |
Source code in scpi_control/gui/widgets/waveform_display_pg.py
clear_channel
¶
Clear waveform for a specific channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel
|
int
|
Channel number to clear (1-4) |
required |
Source code in scpi_control/gui/widgets/waveform_display_pg.py
clear_all
¶
Clear all waveforms.
Source code in scpi_control/gui/widgets/waveform_display_pg.py
toggle_grid
¶
Toggle grid display.
Source code in scpi_control/gui/widgets/waveform_display_pg.py
reset_zoom
¶
set_cursor_mode
¶
Set cursor mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
str
|
Cursor mode ('off', 'vertical', 'horizontal', 'both') |
required |
Source code in scpi_control/gui/widgets/waveform_display_pg.py
get_cursor_values
¶
Get current cursor position values.
Returns:
| Type | Description |
|---|---|
dict
|
Dictionary with cursor positions |
Source code in scpi_control/gui/widgets/waveform_display_pg.py
add_measurement_marker
¶
Add a measurement marker to display.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
marker
|
MeasurementMarker object to add |
required |
Source code in scpi_control/gui/widgets/waveform_display_pg.py
remove_measurement_marker
¶
Remove a measurement marker from display.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
marker
|
MeasurementMarker object to remove |
required |
Source code in scpi_control/gui/widgets/waveform_display_pg.py
clear_all_markers
¶
Clear all measurement markers.
Source code in scpi_control/gui/widgets/waveform_display_pg.py
set_marker_mode
¶
Set interaction mode for markers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
str
|
Marker mode ('off', 'add', 'edit') |
required |
marker_type
|
str
|
Type of marker to add (required if mode='add') |
None
|
channel
|
int
|
Channel for marker (required if mode='add') |
None
|
Source code in scpi_control/gui/widgets/waveform_display_pg.py
get_marker_measurements
¶
Get all measurement results from markers.
Returns:
| Type | Description |
|---|---|
Dict
|
Dictionary mapping marker IDs to results |
Source code in scpi_control/gui/widgets/waveform_display_pg.py
update_all_markers
¶
Update all enabled markers with current waveform data.
Source code in scpi_control/gui/widgets/waveform_display_pg.py
set_reference
¶
Set reference waveform for overlay.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reference_data
|
dict
|
Reference data dictionary with 'time' and 'voltage' keys |
required |
Source code in scpi_control/gui/widgets/waveform_display_pg.py
clear_reference
¶
Clear reference waveform.
Source code in scpi_control/gui/widgets/waveform_display_pg.py
toggle_reference_visibility
¶
Toggle reference waveform visibility.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visible
|
bool
|
Whether reference should be visible |
required |
Source code in scpi_control/gui/widgets/waveform_display_pg.py
toggle_difference_mode
¶
Toggle difference mode (show waveform - reference).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
enabled
|
bool
|
Whether to show difference |
required |
Source code in scpi_control/gui/widgets/waveform_display_pg.py
get_reference_data
¶
Get current reference data.
Returns:
| Type | Description |
|---|---|
|
Reference data dictionary or None |
get_plot_item
¶
Get the PyQtGraph PlotItem for advanced customization.
Returns:
| Type | Description |
|---|---|
|
PyQtGraph PlotItem |
options: show_root_heading: false show_source: true heading_level: 4 members_order: source show_signature_annotations: true filters: - "!^*"
Channel Control¶
scpi_control.gui.widgets.channel_control
¶
Channel control widget for oscilloscope GUI.
ChannelControl
¶
Bases: QWidget
Widget for controlling oscilloscope channels.
Initialize channel control widget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
Optional[QWidget]
|
Parent widget |
None
|
Source code in scpi_control/gui/widgets/channel_control.py
set_scope
¶
Set the oscilloscope instance.
Updates channel visibility based on model capability and refreshes controls.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scope
|
Optional[Oscilloscope]
|
Oscilloscope instance |
required |
Source code in scpi_control/gui/widgets/channel_control.py
options: show_root_heading: false show_source: true heading_level: 4 members_order: source show_signature_annotations: true filters: - "!^*"
Trigger Control¶
scpi_control.gui.widgets.trigger_control
¶
Trigger control widget for oscilloscope GUI.
TriggerControl
¶
Bases: QWidget
Widget for controlling oscilloscope trigger settings.
Initialize trigger control widget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
Optional[QWidget]
|
Parent widget |
None
|
Source code in scpi_control/gui/widgets/trigger_control.py
set_scope
¶
Set the oscilloscope instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scope
|
Optional[Oscilloscope]
|
Oscilloscope instance |
required |
options: show_root_heading: false show_source: true heading_level: 4 members_order: source show_signature_annotations: true filters: - "!^*"
Timebase Control¶
scpi_control.gui.widgets.timebase_control
¶
Timebase control widget for oscilloscope GUI.
TimebaseControl
¶
Bases: QWidget
Widget for controlling oscilloscope timebase (horizontal) settings.
Initialize timebase control widget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
Optional[QWidget]
|
Parent widget |
None
|
Source code in scpi_control/gui/widgets/timebase_control.py
set_scope
¶
Set the oscilloscope instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scope
|
Optional[Oscilloscope]
|
Oscilloscope instance |
required |
options: show_root_heading: false show_source: true heading_level: 4 members_order: source show_signature_annotations: true filters: - "!^*"
Measurement Panel¶
scpi_control.gui.widgets.measurement_panel
¶
Measurement panel widget for oscilloscope GUI.
MeasurementPanel
¶
Bases: QWidget
Widget for displaying and controlling measurements.
Initialize measurement panel widget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
Optional[QWidget]
|
Parent widget |
None
|
Source code in scpi_control/gui/widgets/measurement_panel.py
set_scope
¶
Set the oscilloscope instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scope
|
Optional[Oscilloscope]
|
Oscilloscope instance |
required |
options: show_root_heading: false show_source: true heading_level: 4 members_order: source show_signature_annotations: true filters: - "!^*"
Cursor Panel¶
scpi_control.gui.widgets.cursor_panel
¶
Cursor control panel for waveform measurements.
CursorPanel
¶
Bases: QWidget
Widget for controlling measurement cursors and displaying cursor values.
Provides controls for cursor mode selection and displays cursor measurements including time, voltage, and delta values.
Signals
cursor_mode_changed: Emitted when cursor mode changes (mode: str) clear_cursors: Emitted when clear cursors button is clicked
Initialize cursor panel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
Optional[QWidget]
|
Parent widget |
None
|
Source code in scpi_control/gui/widgets/cursor_panel.py
set_mode
¶
Set cursor mode programmatically.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
str
|
Cursor mode ('off', 'vertical', 'horizontal', 'both') |
required |
Source code in scpi_control/gui/widgets/cursor_panel.py
update_cursor_values
¶
update_cursor_values(x1: Optional[float] = None, y1: Optional[float] = None, x2: Optional[float] = None, y2: Optional[float] = None)
Update cursor value displays.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x1
|
Optional[float]
|
Cursor 1 X position (time) |
None
|
y1
|
Optional[float]
|
Cursor 1 Y position (voltage) |
None
|
x2
|
Optional[float]
|
Cursor 2 X position (time) |
None
|
y2
|
Optional[float]
|
Cursor 2 Y position (voltage) |
None
|
Source code in scpi_control/gui/widgets/cursor_panel.py
clear_values
¶
Clear all cursor value displays.
Source code in scpi_control/gui/widgets/cursor_panel.py
options: show_root_heading: false show_source: true heading_level: 4 members_order: source show_signature_annotations: true filters: - "!^*"
Math Panel¶
scpi_control.gui.widgets.math_panel
¶
Math channel control panel for waveform operations.
MathPanel
¶
Bases: QWidget
Widget for controlling math channels.
Provides expression builder, enable/disable toggles, and quick access buttons for common operations.
Signals
math1_expression_changed: Emitted when Math1 expression changes (expression: str) math2_expression_changed: Emitted when Math2 expression changes (expression: str) math1_enabled_changed: Emitted when Math1 enable state changes (enabled: bool) math2_enabled_changed: Emitted when Math2 enable state changes (enabled: bool)
Initialize math panel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
Optional[QWidget]
|
Parent widget |
None
|
Source code in scpi_control/gui/widgets/math_panel.py
set_math1_enabled
¶
Set Math1 enable state programmatically.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
enabled
|
bool
|
Enable state |
required |
set_math2_enabled
¶
Set Math2 enable state programmatically.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
enabled
|
bool
|
Enable state |
required |
set_math1_expression
¶
Set Math1 expression programmatically.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
expression
|
str
|
Expression string |
required |
set_math2_expression
¶
Set Math2 expression programmatically.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
expression
|
str
|
Expression string |
required |
get_math1_expression
¶
get_math2_expression
¶
is_math1_enabled
¶
is_math2_enabled
¶
update_available_channels
¶
Update available channels in channel selector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num_channels
|
int
|
Number of available channels (2 or 4) |
required |
Source code in scpi_control/gui/widgets/math_panel.py
options: show_root_heading: false show_source: true heading_level: 4 members_order: source show_signature_annotations: true filters: - "!^*"
Reference Panel¶
scpi_control.gui.widgets.reference_panel
¶
Reference waveform panel for managing and comparing reference waveforms.
ReferencePanel
¶
Bases: QWidget
Widget for managing reference waveforms.
Provides a browser for saved reference waveforms with options to load, delete, and view information about each reference.
Signals
load_reference: Emitted when user requests to load a reference (filepath: str) save_reference: Emitted when user requests to save current waveform as reference delete_reference: Emitted when user deletes a reference (filepath: str) show_difference: Emitted when user wants to show difference with reference
Initialize reference panel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
Optional[QWidget]
|
Parent widget |
None
|
Source code in scpi_control/gui/widgets/reference_panel.py
update_reference_list
¶
Update the reference list display.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
references
|
list
|
List of reference info dictionaries |
required |
Source code in scpi_control/gui/widgets/reference_panel.py
set_loaded_reference
¶
Update display when a reference is loaded.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reference_data
|
Dict[str, Any]
|
Loaded reference data |
required |
Source code in scpi_control/gui/widgets/reference_panel.py
update_comparison_stats
¶
Update comparison statistics display.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
correlation
|
Optional[float]
|
Correlation coefficient (0.0 to 1.0) |
required |
rms_diff
|
Optional[float]
|
RMS difference value |
required |
Source code in scpi_control/gui/widgets/reference_panel.py
clear_comparison_stats
¶
options: show_root_heading: false show_source: true heading_level: 4 members_order: source show_signature_annotations: true filters: - "!^*"
Protocol Decode Panel¶
scpi_control.gui.widgets.protocol_decode_panel
¶
Protocol decode panel for analyzing digital communication protocols.
ProtocolDecodePanel
¶
Bases: QWidget
Widget for protocol decode configuration and display.
Provides protocol selection, parameter configuration, and decoded event display in a table format.
Signals
decode_requested: Emitted when user requests decode (protocol: str, params: dict, channel_map: dict) export_requested: Emitted when user wants to export events
Initialize protocol decode panel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
Optional[QWidget]
|
Parent widget |
None
|
Source code in scpi_control/gui/widgets/protocol_decode_panel.py
display_events
¶
Display decoded events in table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
events
|
list
|
List of DecodedEvent objects |
required |
Source code in scpi_control/gui/widgets/protocol_decode_panel.py
get_events
¶
options: show_root_heading: false show_source: true heading_level: 4 members_order: source show_signature_annotations: true filters: - "!^*"
FFT Display¶
scpi_control.gui.widgets.fft_display
¶
FFT display widget for frequency domain analysis.
FFTDisplay
¶
Bases: QWidget
Widget for displaying FFT analysis results.
Provides frequency domain plot with controls for window function, scale selection, and peak detection.
Signals
fft_compute_requested: Emitted when FFT computation is requested (channel: str, window: str)
Initialize FFT display.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
Optional[QWidget]
|
Parent widget |
None
|
Source code in scpi_control/gui/widgets/fft_display.py
set_fft_result
¶
Set and display FFT result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fft_result
|
FFTResult object |
required |
clear_display
¶
Clear the FFT display.
Source code in scpi_control/gui/widgets/fft_display.py
update_available_channels
¶
Update available channels in channel selector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num_channels
|
int
|
Number of available channels (2 or 4) |
required |
Source code in scpi_control/gui/widgets/fft_display.py
options: show_root_heading: false show_source: true heading_level: 4 members_order: source show_signature_annotations: true filters: - "!^*"
Visual Measurement Panel¶
scpi_control.gui.widgets.visual_measurement_panel
¶
Visual measurement panel for interactive waveform measurements.
This module provides the UI panel for managing visual measurement markers on waveforms. Users can add measurement markers of different types, adjust their positions, and see real-time measurement results.
Features
- 15+ measurement types (frequency, voltage, timing)
- Interactive marker placement and adjustment
- Save/load measurement configurations
- Export results to CSV/JSON
- Auto-update mode with configurable refresh rate
- Batch measurement support
Supported Measurement Types
- Frequency/Period: FREQ, PER
- Voltage: PKPK, AMPL, MAX, MIN, RMS, MEAN, TOP, BASE
- Timing: RISE, FALL, WID, NWID, DUTY
Architecture
The panel acts as a controller for visual markers on the waveform display. It creates marker objects and adds them to the display widget, managing their lifecycle and updating their measurements.
Example
panel = VisualMeasurementPanel(waveform_display) panel.marker_added.connect(on_marker_added)
User clicks "Add Marker" button¶
Marker appears on waveform with live measurements¶
VisualMeasurementPanel
¶
Bases: QWidget
Panel for controlling visual measurement markers.
Provides UI for: - Adding/removing markers - Enabling/disabling markers - Updating measurements - Saving/loading configurations - Exporting results
Signals
marker_added: Emitted when a marker is added marker_removed: Emitted when a marker is removed measurements_updated: Emitted when measurements are updated
Initialize visual measurement panel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
waveform_display
|
WaveformDisplay
|
WaveformDisplay widget to control |
required |
parent
|
Optional[QWidget]
|
Parent widget |
None
|
Source code in scpi_control/gui/widgets/visual_measurement_panel.py
options: show_root_heading: false show_source: true heading_level: 4 members_order: source show_signature_annotations: true filters: - "!^*"
Vector Graphics Panel¶
scpi_control.gui.widgets.vector_graphics_panel
¶
Vector graphics panel for XY mode drawing on oscilloscope.
This panel provides UI controls for generating vector graphics waveforms that can be displayed in XY mode on the oscilloscope.
Features
- Multiple shape types (circle, rectangle, star, etc.)
- Parameter controls for each shape
- Live preview of generated paths
- Waveform generation and export
- Animation frame generation
Requires 'fun' extras installation: pip install "Siglent-Oscilloscope[fun]"
VectorGraphicsPanel
¶
Bases: QWidget
Panel for vector graphics generation and XY mode control.
This panel allows users to generate waveforms for drawing shapes on the oscilloscope in XY mode.
Initialize vector graphics panel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
Optional[QWidget]
|
Parent widget |
None
|
Source code in scpi_control/gui/widgets/vector_graphics_panel.py
set_scope
¶
Set the oscilloscope instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scope
|
Oscilloscope instance or None |
required |
Source code in scpi_control/gui/widgets/vector_graphics_panel.py
options: show_root_heading: false show_source: true heading_level: 4 members_order: source show_signature_annotations: true filters: - "!^*"
Terminal Widget¶
scpi_control.gui.widgets.terminal_widget
¶
Terminal widget for sending custom SCPI commands to the oscilloscope.
TerminalWidget
¶
Bases: QWidget
Terminal widget for sending custom SCPI commands.
Provides a console-like interface for sending raw SCPI commands to the oscilloscope and viewing responses.
Initialize terminal widget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
Parent widget |
None
|
Source code in scpi_control/gui/widgets/terminal_widget.py
set_oscilloscope
¶
Set the oscilloscope instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scope
|
Oscilloscope instance |
required |
Source code in scpi_control/gui/widgets/terminal_widget.py
send_command
¶
Programmatically send a command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
command
|
str
|
SCPI command to send |
required |
options: show_root_heading: false show_source: true heading_level: 4 members_order: source show_signature_annotations: true filters: - "!^*"
Error Dialog¶
scpi_control.gui.widgets.error_dialog
¶
Detailed error dialog widget for displaying user-friendly error messages.
This module provides an error dialog that shows both user-friendly summaries and expandable technical details for debugging.
DetailedErrorDialog
¶
Bases: QDialog
Shows user-friendly error messages with expandable technical details.
This dialog provides two levels of information: 1. User-friendly summary for non-technical users 2. Technical details (stack trace, context) for debugging
Example
error_info = { ... 'type': 'TimeoutError', ... 'message': 'Timeout acquiring waveform from CH1', ... 'details': 'Socket timeout after 5.0 seconds', ... 'context': {'channel': 1, 'operation': 'get_waveform'}, ... 'traceback': '...' ... } dialog = DetailedErrorDialog(error_info, parent=main_window) dialog.exec()
Initialize the error dialog.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
error_info
|
dict
|
Dictionary containing error details: - type: Error type name (e.g., 'TimeoutError') - message: User-friendly error message - details: Additional error details (optional) - context: Dictionary of context info (optional) - traceback: Stack trace string (optional) - timestamp: Error timestamp (optional, defaults to now) |
required |
parent
|
Parent widget |
None
|
Source code in scpi_control/gui/widgets/error_dialog.py
show_error_dialog
¶
Convenience function to show an error dialog.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
error_info
|
dict
|
Dictionary containing error details (see DetailedErrorDialog) |
required |
parent
|
Parent widget |
None
|
Returns:
| Type | Description |
|---|---|
int
|
Dialog result code (typically QDialog.DialogCode.Accepted) |
Example
show_error_dialog({ ... 'type': 'ConnectionError', ... 'message': 'Failed to connect to oscilloscope', ... 'details': 'Connection refused on port 5024' ... })
Source code in scpi_control/gui/widgets/error_dialog.py
options: show_root_heading: false show_source: true heading_level: 4 members_order: source show_signature_annotations: true filters: - "!^*"
Workers¶
Live View Worker¶
scpi_control.gui.live_view_worker
¶
Background worker for live view waveform acquisition.
This module provides a QThread-based worker that continuously acquires waveforms from the oscilloscope without blocking the GUI thread.
The worker solves a critical performance issue: SCPI queries take 100-500ms each, and querying multiple channels every 200ms would freeze the GUI. By running acquisition in a background thread, the GUI remains responsive while waveforms are continuously updated.
Thread Safety
- Uses Qt signals/slots for thread-safe communication
- Worker runs in separate thread via QThread
- GUI thread only handles display updates (<1ms)
- No shared mutable state between threads
Signals
waveforms_ready(list): Emitted when new waveforms are acquired error_occurred(dict): Emitted on acquisition errors with structured error info status_update(str): Emitted for status updates during acquisition
Example
worker = LiveViewWorker(scope) worker.waveforms_ready.connect(display.plot_multiple_waveforms) worker.error_occurred.connect(handle_error) worker.start()
... later ...¶
worker.stop()
LiveViewWorker
¶
Bases: QThread
Background thread worker for acquiring waveforms without blocking GUI.
Signals
waveforms_ready: Emitted when waveforms are acquired (List[WaveformData]) error_occurred: Emitted when an error occurs (dict with error details) status_update: Emitted for status messages (str)
Initialize live view worker.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scope
|
Oscilloscope instance |
required | |
parent
|
Parent QObject |
None
|
Source code in scpi_control/gui/live_view_worker.py
run
¶
Thread run method - continuously acquires waveforms.
Source code in scpi_control/gui/live_view_worker.py
options: show_root_heading: false show_source: true heading_level: 3 members_order: source show_signature_annotations: true filters: - "!^*"
Waveform Capture Worker¶
scpi_control.gui.waveform_capture_worker
¶
Background worker for single waveform capture.
This module provides a QThread-based worker that acquires waveforms from the oscilloscope without blocking the GUI thread.
The worker solves the GUI freeze issue: SCPI queries take 100-500ms per channel, and with network timeouts up to 5 seconds, the GUI would completely freeze during capture. By running acquisition in a background thread, the GUI remains responsive and can show progress updates and allow cancellation.
Thread Safety
- Uses Qt signals/slots for thread-safe communication
- Worker runs in separate thread via QThread
- GUI thread only handles display updates
- No shared mutable state between threads
Signals
progress_update(str, int): Emitted for progress updates (message, percentage) waveforms_ready(list): Emitted when waveforms are acquired capture_complete(int): Emitted when capture completes (number of waveforms) error_occurred(str): Emitted on acquisition errors
WaveformCaptureWorker
¶
Bases: QThread
Background thread worker for capturing waveforms without blocking GUI.
Signals
progress_update: Emitted for progress (message: str, percentage: int) waveforms_ready: Emitted when waveforms are acquired (List[WaveformData]) capture_complete: Emitted when capture completes (waveform_count: int) error_occurred: Emitted when an error occurs (str)
Initialize waveform capture worker.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scope
|
Oscilloscope instance |
required | |
enabled_channels
|
List[int]
|
List of channel numbers to capture from |
required |
parent
|
Parent QObject |
None
|
Source code in scpi_control/gui/waveform_capture_worker.py
run
¶
Thread run method - captures waveforms from enabled channels.
Source code in scpi_control/gui/waveform_capture_worker.py
options: show_root_heading: false show_source: true heading_level: 3 members_order: source show_signature_annotations: true filters: - "!^*"
VNC Window¶
scpi_control.gui.vnc_window
¶
Separate window for VNC oscilloscope display.
VNCWindow
¶
Bases: QMainWindow
Separate window for displaying VNC oscilloscope interface.
Initialize VNC window.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
Optional[QWidget]
|
Parent widget |
None
|
Source code in scpi_control/gui/vnc_window.py
set_scope_ip
¶
Set the oscilloscope IP address and load interface.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ip
|
str
|
Oscilloscope IP address |
required |
keyPressEvent
¶
Handle key press events.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
Key event |
required |
Source code in scpi_control/gui/vnc_window.py
options: show_root_heading: false show_source: true heading_level: 3 members_order: source show_signature_annotations: true filters: - "!^*"
See Also¶
- GUI Overview - GUI features and installation
- Interface Guide - Complete UI tour
- Live View - Real-time waveform display
- Visual Measurements - Interactive markers
- Main Oscilloscope API - Core library API