|
Qucs-S S-parameter Viewer & RF Synthesis Tools
|
Widget for displaying rectangular (Cartesian) plots with dual y-axes It provides a rectangular plot visualization with support for multiple traces, frequency-based markers, limit lines, and independent left/right y-axes. More...
#include <rectangularplotwidget.h>


Classes | |
| struct | AxisSettings |
| Settings for plot axes and display options. More... | |
| struct | Limit |
| Data structure representing a limit line segment. More... | |
| struct | Marker |
| Data structure for the frequency marker. More... | |
| struct | Trace |
| Data structure representing a trace on the plot. More... | |
Public Member Functions | |
| RectangularPlotWidget (QWidget *parent=nullptr) | |
| Class constructor. | |
| ~RectangularPlotWidget () | |
| Destructor. | |
| void | addTrace (const QString &name, const Trace &trace) |
| Add or update a trace on the plot. | |
| void | removeTrace (const QString &name) |
| Remove a trace from the plot. | |
| void | clearTraces () |
| Remove all traces from the plot. | |
| double | calculateNiceStep (double range) |
| Calculate an aesthetically pleasing step size for axis divisions. | |
| QPen | getTracePen (const QString &traceName) const |
| Get the pen style for a specific trace. | |
| void | setTracePen (const QString &traceName, const QPen &pen) |
| Set the pen style for a specific trace. | |
| QMap< QString, QPen > | getTracesInfo () const |
| Get information about all traces. | |
| double | getYmax () |
| Get maximum left Y-axis value. | |
| double | getYmin () |
| Get minimum left Y-axis value. | |
| double | getYdiv () |
| Get left Y-axis division interval. | |
| void | setYdiv (double val) |
| Set left Y-axis division interval. | |
| void | setYmax (double val) |
| Set maximum left Y-axis value. | |
| void | setYmin (double val) |
| Set minimum left Y-axis value. | |
| double | getY2max () |
| Get maximum right Y-axis value. | |
| double | getY2min () |
| Get minimum right Y-axis value. | |
| double | getY2div () |
| Get right Y-axis division interval. | |
| double | getXmax () |
| Get maximum X-axis value. | |
| double | getXmin () |
| Get minimum X-axis value. | |
| double | getXdiv () |
| Get X-axis division interval. | |
| double | getXscale () |
| Get frequency scale factor for current units. | |
| QString | getXunits () |
| Get current frequency unit string. | |
| int | getFreqIndex () |
| Get frequency unit combo box index. | |
| void | updatePlot () |
| Redraw the entire plot with current data. | |
| void | set_y_autoscale (bool value) |
| Enable or disable automatic Y-axis scaling. | |
| bool | areAxisSettingsLocked () const |
| Check if axis settings are locked. | |
| void | setRightYAxisEnabled (bool enabled) |
| Enable or disable the right Y-axis. | |
| bool | isRightYAxisEnabled () const |
| Check if right Y-axis is enabled. | |
| void | change_Y_axis_title (QString title) |
| Set left Y-axis title. | |
| void | change_Y_axis_units (QString units) |
| Set left Y-axis unit label. | |
| void | change_Y2_axis_title (QString title) |
| Set right Y-axis title. | |
| void | change_Y2_axis_units (QString units) |
| Set right Y-axis unit label. | |
| void | change_X_axis_title (QString title) |
| Set X-axis title. | |
| bool | addMarker (const QString &markerId, double frequency, const QPen &pen=QPen(Qt::red, 2)) |
| Add a vertical marker at a specific frequency. | |
| bool | removeMarker (const QString &markerId) |
| Remove a marker from the plot. | |
| 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. | |
| bool | addLimit (const QString &LimitId, const Limit &limit) |
| Add a limit line to the plot. | |
| void | removeLimit (const QString &LimitID) |
| Remove a limit line from the plot. | |
| void | clearLimits () |
| Remove all limit lines from the plot. | |
| QMap< QString, Limit > | getLimits () const |
| Get all defined limits. | |
| bool | updateLimit (const QString &limitId, const Limit &limit) |
| Update an existing limit line. | |
| QCustomPlot * | customPlot () const |
| Access the underlying QCustomPlot widget. | |
| AxisSettings | getSettings () const |
| Get current axis settings. | |
| void | setSettings (const AxisSettings &settings) |
| Apply axis settings to the plot. | |
Public Attributes | |
| QLabel * | xAxisLabel |
| x-axis label | |
Widget for displaying rectangular (Cartesian) plots with dual y-axes It provides a rectangular plot visualization with support for multiple traces, frequency-based markers, limit lines, and independent left/right y-axes.
|
explicit |
Class constructor.
| parent | Parent widget |
| bool RectangularPlotWidget::addLimit | ( | const QString & | LimitId, |
| const Limit & | limit | ||
| ) |
| bool RectangularPlotWidget::addMarker | ( | const QString & | markerId, |
| double | frequency, | ||
| const QPen & | pen = QPen(Qt::red, 2) |
||
| ) |
Add a vertical marker at a specific frequency.
| markerId | Unique marker identifier |
| frequency | Frequency in Hz |
| pen | Marker line style (default: red, width 2) |
| void RectangularPlotWidget::addTrace | ( | const QString & | name, |
| const Trace & | trace | ||
| ) |
Add or update a trace on the plot.
| name | Unique trace identifier |
| trace | Trace data structure |
|
inline |
Check if axis settings are locked.
| double RectangularPlotWidget::calculateNiceStep | ( | double | range | ) |
Calculate an aesthetically pleasing step size for axis divisions.
| range | The range to divide |
|
inline |
Set X-axis title.
| title | New title text |
|
inline |
Set right Y-axis title.
| title | New title text |
|
inline |
Set right Y-axis unit label.
| units | New unit text |
|
inline |
Set left Y-axis title.
| title | New title text |
|
inline |
Set left Y-axis unit label.
| units | New unit text |
|
inline |
Access the underlying QCustomPlot widget.
|
inline |
Get frequency unit combo box index.
|
inline |
Get all defined limits.
| QMap< QString, double > RectangularPlotWidget::getMarkers | ( | ) | const |
Get all markers and their frequencies.
| RectangularPlotWidget::AxisSettings RectangularPlotWidget::getSettings | ( | ) | const |
Get current axis settings.
| QPen RectangularPlotWidget::getTracePen | ( | const QString & | traceName | ) | const |
Get the pen style for a specific trace.
| traceName | Name of the trace |
| QMap< QString, QPen > RectangularPlotWidget::getTracesInfo | ( | ) | const |
Get information about all traces.
| double RectangularPlotWidget::getXscale | ( | ) |
Get frequency scale factor for current units.
|
inline |
Get current frequency unit string.
|
inline |
Check if right Y-axis is enabled.
| void RectangularPlotWidget::removeLimit | ( | const QString & | LimitID | ) |
Remove a limit line from the plot.
| LimitID | Limit identifier |
| bool RectangularPlotWidget::removeMarker | ( | const QString & | markerId | ) |
Remove a marker from the plot.
| markerId | Marker identifier |
|
inline |
Remove a trace from the plot.
| name | Trace identifier |
|
inline |
Enable or disable automatic Y-axis scaling.
| value | true to enable auto-scaling, false to disable |
| void RectangularPlotWidget::setRightYAxisEnabled | ( | bool | enabled | ) |
Enable or disable the right Y-axis.
| enabled | true to show right Y-axis |
| void RectangularPlotWidget::setSettings | ( | const AxisSettings & | settings | ) |
Apply axis settings to the plot.
| settings | Settings structure to apply |
| void RectangularPlotWidget::setTracePen | ( | const QString & | traceName, |
| const QPen & | pen | ||
| ) |
Set the pen style for a specific trace.
| traceName | Name of the trace |
| pen | New pen style |
|
inline |
Set left Y-axis division interval.
| val | New division value |
|
inline |
Set maximum left Y-axis value.
| val | New maximum value |
|
inline |
Set minimum left Y-axis value.
| val | New minimum value |
| bool RectangularPlotWidget::updateLimit | ( | const QString & | limitId, |
| const Limit & | limit | ||
| ) |
Update an existing limit line.
| limitId | Limit identifier |
| limit | New limit properties |
| bool RectangularPlotWidget::updateMarkerFrequency | ( | const QString & | markerId, |
| double | newFrequency | ||
| ) |
Update the frequency of an existing marker.
| markerId | Marker identifier |
| newFrequency | New frequency in Hz |