Smith chart visualization and interaction widget. Provides impedance/admittance Smith chart drawing, trace management and marker handling, with basic zoom, pan and frequency-range controls.
More...
#include <smithchartwidget.h>
|
| struct | AxisSettings |
| | Settings for plot axes and display options. More...
|
| |
| struct | Marker |
| | Data structure for the frequency marker Defines a marker at a specific frequency with its appearance. More...
|
| |
| struct | Trace |
| | Data structure representing a trace on the plot. More...
|
| |
|
| void | impedanceSelected (const std::complex< double > &impedance) |
| | Emitted when a point on the chart is clicked.
|
| |
|
| SmithChartWidget::AxisSettings | getSettings () const |
| | Returns the current axis settings.
|
| |
| void | setSettings (const AxisSettings &settings) |
| | Set the current axis settings.
|
| |
| | SmithChartWidget (QWidget *parent=nullptr) |
| | Class constructor.
|
| |
|
| ~SmithChartWidget () override |
| | Class destructor.
|
| |
| void | addTrace (const QString &name, const Trace &trace) |
| | Add or update a trace on the plot.
|
| |
| void | removeTrace (const QString &) |
| | Remove a trace from the plot.
|
| |
|
void | clearTraces () |
| | Remove all traces from the plot.
|
| |
| void | setCharacteristicImpedance (double z) |
| | Set the characteristic impedance of the diagram.
|
| |
| double | characteristicImpedance () const |
| | Get the characteristic impedance of the diagram.
|
| |
| QPen | getTracePen (const QString &traceName) const |
| | Get the diagram QPen style of a trace (by name)
|
| |
| void | setTracePen (const QString &traceName, const QPen &pen) |
| | Sets the pen for an existing trace (given its name)
|
| |
| QMap< QString, QPen > | getTracesInfo () const |
| | Returns a map with trace names and their QPens.
|
| |
| bool | addMarker (const QString &markerId, double frequency, const QPen &pen=QPen(Qt::red, 2)) |
| | Adds a marker at a given frequency.
|
| |
| bool | removeMarker (const QString &markerId) |
| | Remove a trace from the plot, given its name.
|
| |
| bool | updateMarkerFrequency (const QString &markerId, double newFrequency) |
| | Update the frequency of an existing marker.
|
| |
|
void | clearMarkers () |
| | Remove all markers from the plot.
|
| |
| QMap< QString, double > | getMarkers () const |
| | Get all markers and their frequencies.
|
| |
|
|
void | paintEvent (QPaintEvent *event) override |
| | Reimplements paintEvent to draw the Smith chart and overlays.
|
| |
|
void | mousePressEvent (QMouseEvent *event) override |
| | Handles mouse clicks to pick impedances and emit impedanceSelected().
|
| |
Smith chart visualization and interaction widget. Provides impedance/admittance Smith chart drawing, trace management and marker handling, with basic zoom, pan and frequency-range controls.
◆ SmithChartWidget()
| SmithChartWidget::SmithChartWidget |
( |
QWidget * |
parent = nullptr | ) |
|
Class constructor.
- Parameters
-
◆ addMarker()
| bool SmithChartWidget::addMarker |
( |
const QString & |
markerId, |
|
|
double |
frequency, |
|
|
const QPen & |
pen = QPen(Qt::red, 2) |
|
) |
| |
Adds a marker at a given frequency.
- Parameters
-
| markerId | Unique marker identifier. |
| frequency | Marker frequency (Hz). |
| pen | Pen used to draw marker and label. |
- Note
- By default, the trace styling is red and its width = 2
- Returns
true on success, false if ID exists or no trace covers the frequency.
◆ addTrace()
| void SmithChartWidget::addTrace |
( |
const QString & |
name, |
|
|
const Trace & |
trace |
|
) |
| |
Add or update a trace on the plot.
- Parameters
-
| name | Unique trace identifier |
| trace | Trace data structure |
◆ characteristicImpedance()
| double SmithChartWidget::characteristicImpedance |
( |
| ) |
const |
|
inline |
Get the characteristic impedance of the diagram.
- Returns
- z0 Characteristic impedance of the diagram
◆ getMarkers()
| QMap< QString, double > SmithChartWidget::getMarkers |
( |
| ) |
const |
Get all markers and their frequencies.
- Returns
- Map of marker IDs to frequencies in Hz
◆ getSettings()
Returns the current axis settings.
- Returns
- AxisSettings of the diagram
◆ getTracePen()
| QPen SmithChartWidget::getTracePen |
( |
const QString & |
traceName | ) |
const |
Get the diagram QPen style of a trace (by name)
- Parameters
-
| traceName | Name of the trace |
- Returns
- Trace QPen style object
◆ getTracesInfo()
| QMap< QString, QPen > SmithChartWidget::getTracesInfo |
( |
| ) |
const |
Returns a map with trace names and their QPens.
- Returns
- QMap object relating the name of the trace with the QPen style object
◆ impedanceSelected
| void SmithChartWidget::impedanceSelected |
( |
const std::complex< double > & |
impedance | ) |
|
|
signal |
Emitted when a point on the chart is clicked.
- Parameters
-
| impedance | Impedance corresponding to the clicked position (Ohms). |
◆ removeMarker()
| bool SmithChartWidget::removeMarker |
( |
const QString & |
markerId | ) |
|
Remove a trace from the plot, given its name.
- Parameters
-
◆ removeTrace()
| void SmithChartWidget::removeTrace |
( |
const QString & |
traceName | ) |
|
Remove a trace from the plot.
- Parameters
-
◆ setCharacteristicImpedance()
| void SmithChartWidget::setCharacteristicImpedance |
( |
double |
z | ) |
|
|
inline |
Set the characteristic impedance of the diagram.
- Parameters
-
| z0 | Characteristic impedance (e.g. 50 Ohm, 75 Ohm) |
◆ setSettings()
| void SmithChartWidget::setSettings |
( |
const AxisSettings & |
settings | ) |
|
Set the current axis settings.
- Parameters
-
◆ setTracePen()
| void SmithChartWidget::setTracePen |
( |
const QString & |
traceName, |
|
|
const QPen & |
pen |
|
) |
| |
Sets the pen for an existing trace (given its name)
- Parameters
-
| traceName | Name of the trace. |
| pen | New pen to use. |
◆ updateMarkerFrequency()
| bool SmithChartWidget::updateMarkerFrequency |
( |
const QString & |
markerId, |
|
|
double |
newFrequency |
|
) |
| |
Update the frequency of an existing marker.
- Parameters
-
| markerId | Marker identifier |
| newFrequency | New frequency in Hz |
- Returns
- true if updated successfully, false if marker not found or frequency invali
The documentation for this class was generated from the following files: