CdpSignalGraphWidget Class
(CDP::GraphWidgets::CdpSignalGraphWidget)The Signal Graph widget is used to plot CDPSignals in real-time. More...
Header: | #include <cdp/graphwidgets/cdpsignalgraphwidget.h> |
Public Types
enum | PlottingMode { Scrolling, Wrapping } |
Properties
|
|
Public Functions
CdpSignalGraphWidget(QWidget *parent = 0) | |
~CdpSignalGraphWidget() | |
QColor | activeCursorColor() const |
QStringList | cdpSignals() |
GraphExportFormat | exportFormat() const |
QString | exportPath() const |
const QColor & | graphBackgroundColorEnd() const |
const QColor & | graphBackgroundColorStart() const |
QColor | gridPenColorX() const |
QColor | gridPenColorY() const |
Qt::PenStyle | gridPenStyleX() const |
Qt::PenStyle | gridPenStyleY() const |
QColor | hoverCursorColor() const |
bool | isLegendVisible() const |
const QFont & | legendFont() const |
const QColor & | legendTextColor() const |
int | paintIntervalMs() const |
QColor | pausedCursorColor() const |
PlottingMode | plottingMode() const |
void | setActiveCursorColor(const QColor &color) |
void | setExportFormat(GraphExportFormat format) |
void | setExportPath(const QString &path) |
void | setGraphBackgroundColorEnd(const QColor &color) |
void | setGraphBackgroundColorStart(const QColor &color) |
void | setGridPenColorX(const QColor &color) |
void | setGridPenColorY(const QColor &color) |
void | setGridPenStyleX(Qt::PenStyle style) |
void | setGridPenStyleY(Qt::PenStyle style) |
void | setHoverCursorColor(const QColor &color) |
void | setLegendFont(const QFont &font) |
void | setLegendTextColor(const QColor &color) |
void | setPaintIntervalMs(int interval) |
void | setPausedCursorColor(const QColor &color) |
void | setPlottingMode(PlottingMode mode) |
void | setXAxisFont(const QFont &font) |
void | setXAxisMajorTickCount(uint count) |
void | setXAxisMinorTickCount(uint count) |
void | setXAxisPenColor(const QColor &color) |
void | setXAxisTextColor(const QColor &color) |
void | setXAxisTextSelectedColor(const QColor &color) |
void | setYAxisFont(const QFont &font) |
void | setYAxisMajorTickCount(uint count) |
void | setYAxisMinorTickCount(uint count) |
void | setYAxisPenColor(const QColor &color) |
void | setYAxisTextColor(const QColor &color) |
void | setYAxisTextSelectedColor(const QColor &color) |
const QFont & | xAxisFont() const |
qint64 | xAxisIntervalMSecs() const |
uint | xAxisMajorTickCount() const |
uint | xAxisMinorTickCount() const |
QColor | xAxisPenColor() const |
const QColor & | xAxisTextColor() const |
const QColor & | xAxisTextSelectedColor() const |
const QFont & | yAxisFont() const |
uint | yAxisMajorTickCount() const |
double | yAxisMaxValue() const |
double | yAxisMinValue() const |
uint | yAxisMinorTickCount() const |
QColor | yAxisPenColor() const |
const QColor & | yAxisTextColor() const |
const QColor & | yAxisTextSelectedColor() const |
int | yAxisValueMinPrecision() const |
Public Slots
void | autoScale() |
void | exportData() |
void | hideWidget() |
void | pause() |
void | resume() |
void | scaleXAxis() |
void | scaleYAxis() |
void | setCdpSignals(const QStringList &signalList) |
void | setInCommand(bool cmd) |
void | setLegendVisible(bool visible) |
void | setPauseEnabled(bool enabled) |
void | setSmoothPixmap(bool smooth) |
void | setWidgetFont(const QString &font) |
void | setWidgetStyle(int style) |
void | setWidgetTheme(const QString &theme) |
void | setXAxisIntervalMSecs(qint64 msecs) |
void | setYAxisMaxValue(double value) |
void | setYAxisMinValue(double value) |
void | setYAxisValueMinPrecision(int precision) |
void | showWidget() |
Signals
void | exportFailed() |
void | exportFinished(bool success) |
void | exportProgressChanged(int progress) |
void | exportStarted() |
Detailed Description
The Signal Graph widget is used to plot CDPSignals in real-time.
Modes
It has two different plotting modes: wrapping and scrolling.
Wrapping mode has steady x-axis where data is changing along with updated beam. The beam indicates current time, while in pause it shows the time the graph was paused.
Scrolling mode has moving x-axis on the graph where current time is always on the right side of the plotting area.
Configuring
CdpSignals is the property which can be used to configure which CDPSignals to plot. Insert full signal routing here. Alias text (that will be shown instead of full routing in graph legend) can be concatenated to routing after equal (=) sign (like comp.signal.value=Alias).
Member Type Documentation
enum CdpSignalGraphWidget::PlottingMode
This enum type specifies the plotting mode.
Constant | Value | Description |
---|---|---|
CDP::GraphWidgets::CdpSignalGraphWidget::Scrolling | 0 | The scrolling mode. |
CDP::GraphWidgets::CdpSignalGraphWidget::Wrapping | 1 | The wrapping mode. |
Property Documentation
activeCursorColor : QColor
Access functions:
QColor | activeCursorColor() const |
void | setActiveCursorColor(const QColor &color) |
cdpSignals : QStringList
This property holds the routings of CDPSignals which are plotted on the graph.
Access functions:
QStringList | cdpSignals() |
void | setCdpSignals(const QStringList &signalList) |
cssFile : const QString
This property holds the css file to style the widget.
exportFormat : CDP::GraphWidgets::GraphExport::Format
This property specifies the file format used in export data.
- CSV for comma-seperated values to be used by third party tools.
- DB for CDP Compact Datastore that can be opened with Database Graph Widget and CDP Studio Analyze mode.
Access functions:
GraphExportFormat | exportFormat() const |
void | setExportFormat(GraphExportFormat format) |
exportPath : QString
This property holds directory path where the plot data is exported. For each export a new file is created in that directory. If left empty, application directory is used.
Access functions:
QString | exportPath() const |
void | setExportPath(const QString &path) |
graphBackgroundColorEnd : QColor
Graph's plotting area background is drawn as gradient from upper-left to lower-right corner. This is the gradient's ending color.
Access functions:
const QColor & | graphBackgroundColorEnd() const |
void | setGraphBackgroundColorEnd(const QColor &color) |
See also graphBackgroundColorStart.
graphBackgroundColorStart : QColor
Graph's plotting area background is drawn as gradient from upper-left to lower-right corner. This is the gradient's starting color.
Access functions:
const QColor & | graphBackgroundColorStart() const |
void | setGraphBackgroundColorStart(const QColor &color) |
See also graphBackgroundColorEnd.
gridPenColorX : QColor
This property holds the color of vertical grid lines.
Access functions:
QColor | gridPenColorX() const |
void | setGridPenColorX(const QColor &color) |
gridPenColorY : QColor
This property holds the color of horizontal grid lines.
Access functions:
QColor | gridPenColorY() const |
void | setGridPenColorY(const QColor &color) |
gridPenStyleX : Qt::PenStyle
This property holds the style of vertical grid lines.
Access functions:
Qt::PenStyle | gridPenStyleX() const |
void | setGridPenStyleX(Qt::PenStyle style) |
gridPenStyleY : Qt::PenStyle
This property holds the style of horizontal grid lines.
Access functions:
Qt::PenStyle | gridPenStyleY() const |
void | setGridPenStyleY(Qt::PenStyle style) |
hoverCursorColor : QColor
Access functions:
QColor | hoverCursorColor() const |
void | setHoverCursorColor(const QColor &color) |
legendFont : QFont
This property holds the font of signal names in legend.
Access functions:
const QFont & | legendFont() const |
void | setLegendFont(const QFont &font) |
legendTextColor : QColor
This property holds the color of signal names in legend.
Access functions:
const QColor & | legendTextColor() const |
void | setLegendTextColor(const QColor &color) |
legendVisible : bool
This property holds the visibility of legend.
Access functions:
bool | isLegendVisible() const |
void | setLegendVisible(bool visible) |
paintIntervalMs : int
This property specifies how often the graph should get painted. Increase the number to reduce the load on slow hardware. When the x-axis range is large, the graph will update just as smooth.
Access functions:
int | paintIntervalMs() const |
void | setPaintIntervalMs(int interval) |
pausedCursorColor : QColor
Access functions:
QColor | pausedCursorColor() const |
void | setPausedCursorColor(const QColor &color) |
plottingMode : PlottingMode
This property holds the plotting mode.
Access functions:
PlottingMode | plottingMode() const |
void | setPlottingMode(PlottingMode mode) |
xAxisFont : QFont
This property holds the font of x-axis labels.
Access functions:
const QFont & | xAxisFont() const |
void | setXAxisFont(const QFont &font) |
xAxisIntervalMSecs : qint64
This property holds the x-axis interval in milliseconds.
Access functions:
qint64 | xAxisIntervalMSecs() const |
void | setXAxisIntervalMSecs(qint64 msecs) |
xAxisMajorTickCount : uint
This property holds the number of x-axis major ticks which determine vertical grid line and labels count.
Note: The count is taken as a hint. The actual number of ticks may be different.
Access functions:
uint | xAxisMajorTickCount() const |
void | setXAxisMajorTickCount(uint count) |
xAxisMinorTickCount : uint
This property holds the number of ticks between x-axis major ticks (both edges included).
Note: The count is taken as a hint. The actual number of ticks may be different.
Access functions:
uint | xAxisMinorTickCount() const |
void | setXAxisMinorTickCount(uint count) |
See also xAxisMajorTickCount.
xAxisPenColor : QColor
This property holds the color of x-axis line and ticks.
Access functions:
QColor | xAxisPenColor() const |
void | setXAxisPenColor(const QColor &color) |
xAxisTextColor : QColor
This property holds the color of x-axis label text.
Access functions:
const QColor & | xAxisTextColor() const |
void | setXAxisTextColor(const QColor &color) |
xAxisTextSelectedColor : QColor
This property holds the color of x-axis label text when the axis is selected.
Access functions:
const QColor & | xAxisTextSelectedColor() const |
void | setXAxisTextSelectedColor(const QColor &color) |
yAxisFont : QFont
This property holds the font of y-axis labels.
Access functions:
const QFont & | yAxisFont() const |
void | setYAxisFont(const QFont &font) |
yAxisMajorTickCount : uint
This property holds the number of y-axis major ticks, which determine vertical grid line and labels count.
Note: The count is taken as a hint. The actual number of ticks may be different.
Access functions:
uint | yAxisMajorTickCount() const |
void | setYAxisMajorTickCount(uint count) |
yAxisMaxValue : double
This property holds the y-axis maximum value.
Access functions:
double | yAxisMaxValue() const |
void | setYAxisMaxValue(double value) |
yAxisMinValue : double
This property holds the y-axis minimum value.
Access functions:
double | yAxisMinValue() const |
void | setYAxisMinValue(double value) |
yAxisMinorTickCount : uint
This property holds the number of ticks between y-axis major ticks (both edges included).
Note: The count is taken as a hint. The actual number of ticks may be different.
Access functions:
uint | yAxisMinorTickCount() const |
void | setYAxisMinorTickCount(uint count) |
See also yAxisMajorTickCount.
yAxisPenColor : QColor
This property holds the color of y-axis line and ticks.
Access functions:
QColor | yAxisPenColor() const |
void | setYAxisPenColor(const QColor &color) |
yAxisTextColor : QColor
This property holds the color of y-axis label text.
Access functions:
const QColor & | yAxisTextColor() const |
void | setYAxisTextColor(const QColor &color) |
yAxisTextSelectedColor : QColor
This property holds the color of y-axis label text when the axis is selected.
Access functions:
const QColor & | yAxisTextSelectedColor() const |
void | setYAxisTextSelectedColor(const QColor &color) |
yAxisValueMinPrecision : int
This property holds the minimim precision for y-axis value labels.
Access functions:
int | yAxisValueMinPrecision() const |
void | setYAxisValueMinPrecision(int precision) |
Member Function Documentation
CdpSignalGraphWidget::CdpSignalGraphWidget(QWidget *parent = 0)
Constructs an instance of CdpSignalGraphWidget with parent
CdpSignalGraphWidget::~CdpSignalGraphWidget()
Destroys the widget.
[slot]
void CdpSignalGraphWidget::autoScale()
Fits signals data in plotting area. Functionality is dependant on axis selection.
[slot]
void CdpSignalGraphWidget::exportData()
Exports visible data to CSV file. See exportDir for location of files.
[signal]
void CdpSignalGraphWidget::exportFailed()
Emitted when export has failed.
[signal]
void CdpSignalGraphWidget::exportFinished(bool success)
Emitted when export is finished. True when successsul, otherwise false. Argument success is True when export succeeds, otherwise false.
[signal]
void CdpSignalGraphWidget::exportProgressChanged(int progress)
Emitted when export progress is changed. Argument progress value ranges between 0 and 100.
[signal]
void CdpSignalGraphWidget::exportStarted()
Emitted when export is started.
[slot]
void CdpSignalGraphWidget::hideWidget()
[slot]
void CdpSignalGraphWidget::pause()
Enables pause. This convenience function is equivalent to calling setPauseEnabled(false)
.
See also setPauseEnabled() and resume().
[slot]
void CdpSignalGraphWidget::resume()
Disables pause. This convenience function is equivalent to calling setPauseEnabled(true)
.
See also setPauseEnabled() and pause().
[slot]
void CdpSignalGraphWidget::scaleXAxis()
Scales the x-axis to fit signals data in the plotting area.
[slot]
void CdpSignalGraphWidget::scaleYAxis()
Scales the y-axis to fit signals data in the plotting area.
[slot]
void CdpSignalGraphWidget::setInCommand(bool cmd)
[slot]
void CdpSignalGraphWidget::setPauseEnabled(bool enabled)
Enables pause if enabled is true. Otherwise disables pause. When pause is enabled, y-axis range and plots are not updated.
See also pause() and resume().
[slot]
void CdpSignalGraphWidget::setSmoothPixmap(bool smooth)
[slot]
void CdpSignalGraphWidget::setWidgetFont(const QString &font)
[slot]
void CdpSignalGraphWidget::setWidgetStyle(int style)
[slot]
void CdpSignalGraphWidget::setWidgetTheme(const QString &theme)
[slot]
void CdpSignalGraphWidget::showWidget()
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.