QtPdWidgets
2.3.1
|
#include <Graph.h>
Classes | |
struct | Impl |
class | Layer |
class | TriggerDetector |
Public Types | |
enum | Mode { Roll, Trigger } |
Graph mode. More... | |
enum | TriggerLevelMode { AutoLevel, ManualLevel } |
Trigger level mode. More... | |
enum | State { Run, Stop } |
Graph state. More... | |
Public Member Functions | |
Graph (QWidget *parent=0) | |
Constructor. More... | |
virtual | ~Graph () |
Destructor. More... | |
void | setVariable (PdCom::Variable pv, const PdCom::Selector &selector={}, const QtPdCom::Transmission &=QtPdCom::event_mode, double scale=1.0, double offset=0.0, double tau=0.0, QColor color=Qt::blue) |
Subscribe to a process variable. More... | |
void | setVariable (PdCom::Process *process, const QString &path, const PdCom::Selector &selector={}, const QtPdCom::Transmission &=QtPdCom::event_mode, double scale=1.0, double offset=0.0, double tau=0.0, QColor color=Qt::blue) |
void | addVariable (PdCom::Variable pv, const PdCom::Selector &selector={}, const QtPdCom::Transmission &=QtPdCom::event_mode, double scale=1.0, double offset=0.0, double tau=0.0, QColor color=Qt::blue) |
void | addVariable (PdCom::Process *process, const QString &path, const PdCom::Selector &selector={}, const QtPdCom::Transmission &=QtPdCom::event_mode, double scale=1.0, double offset=0.0, double tau=0.0, QColor color=Qt::blue) |
void | clearVariables () |
void | clearData () |
void | setTriggerVariable (PdCom::Variable pv, const PdCom::Selector &selector={}, const QtPdCom::Transmission &=QtPdCom::event_mode, double scale=1.0, double offset=0.0, double tau=0.0) |
Subscribe to a process variable as trigger variable. More... | |
void | setTriggerVariable (PdCom::Process *process, const QString &path, const PdCom::Selector &selector={}, const QtPdCom::Transmission &=QtPdCom::event_mode, double scale=1.0, double offset=0.0, double tau=0.0) |
Subscribe to a process variable as trigger variable. More... | |
void | clearTriggerVariable () |
Mode | getMode () const |
void | setMode (Mode) |
Sets the widget's mode. More... | |
void | resetMode () |
Resets the widget's mode. More... | |
double | getTimeRange () const |
void | setTimeRange (double) |
Sets the time range. More... | |
void | resetTimeRange () |
Resets the time range. More... | |
double | getScaleMin () const |
void | setScaleMin (double) |
Sets the value scale's minimum value. More... | |
void | resetScaleMin () |
Resets the value scale's minimum value. More... | |
double | getScaleMax () const |
void | setScaleMax (double) |
Sets the value scale's maximum value. More... | |
void | resetScaleMax () |
Resets the value scale's maximum value. More... | |
TriggerLevelMode | getTriggerLevelMode () const |
void | setTriggerLevelMode (TriggerLevelMode) |
Sets the widget's triggerLevelMode. More... | |
void | resetTriggerLevelMode () |
Resets the widget's triggerLevelMode. More... | |
double | getManualTriggerLevel () const |
void | setManualTriggerLevel (double) |
Sets the manualTriggerLevel. More... | |
void | resetManualTriggerLevel () |
Resets the manualTriggerLevel. More... | |
double | getTriggerPosition () const |
void | setTriggerPosition (double) |
Sets the triggerPosition. More... | |
void | resetTriggerPosition () |
Resets the triggerPosition. More... | |
double | getTriggerTimeout () const |
void | setTriggerTimeout (double) |
Sets the triggerTimeout. More... | |
void | resetTriggerTimeout () |
Resets the triggerTimeout. More... | |
QString | getSuffix () const |
void | setSuffix (const QString &) |
Sets the suffix to display after the Y-axis values. More... | |
void | resetSuffix () |
Resets the suffix to display after the Y-axis values. More... | |
QColor | getGridColor () const |
void | setGridColor (const QColor &) |
Sets the gridColor. More... | |
void | resetGridColor () |
Resets the gridColor. More... | |
bool | getAutoScaleWidth () const |
void | setAutoScaleWidth (bool) |
Sets the autoScaleWidth flag. More... | |
void | resetAutoScaleWidth () |
Resets the gridColor. More... | |
Mode | getEffectiveMode () const |
virtual QSize | sizeHint () const |
Gives a hint aboute the optimal size. More... | |
bool | getState () const |
void | setState (State) |
Set the graph state. More... | |
void | toggleState () |
Toggle the graph state. More... | |
Protected Member Functions | |
bool | event (QEvent *) override |
Event handler. More... | |
void | resizeEvent (QResizeEvent *) override |
Handles the widget's resize event. More... | |
void | paintEvent (QPaintEvent *) override |
Paint function. More... | |
void | contextMenuEvent (QContextMenuEvent *) override |
Shows the context menu. More... | |
Properties | |
Mode | mode |
double | timeRange |
The time range to display. More... | |
double | scaleMin |
The minimum value on the value scale. More... | |
double | scaleMax |
The maximum value on the value scale. More... | |
TriggerLevelMode | triggerLevelMode |
double | manualTriggerLevel |
double | triggerPosition |
double | triggerTimeout |
QString | suffix |
QColor | gridColor |
bool | autoScaleWidth |
Private Slots | |
PD_PRIVATE void | redrawEvent () |
Redraw event slot, that is called by the redraw timer. More... | |
PD_PRIVATE void | run () |
Set the graph to Run state. More... | |
PD_PRIVATE void | stop () |
Set the graph to Stop state. More... | |
Private Member Functions | |
PD_PRIVATE void | setRedraw () |
Mark the graph widget for redrawing. More... | |
PD_PRIVATE void | notifySampled () |
Called by the layers if the data were sampled. More... | |
PD_PRIVATE void | triggerConditionDetected (std::chrono::nanoseconds) |
Called by the trgger detector, if the trigger condition was detected. More... | |
PD_PRIVATE void | triggerIdle () |
Called by the trigger detector, if no trigger condition is detected for a while. More... | |
Private Attributes | |
struct PD_PRIVATE | Impl |
std::unique_ptr< Impl > | impl |
class PD_PRIVATE | Layer |
class PD_PRIVATE | TriggerDetector |
Friends | |
class | Layer |
class | TriggerDetector |
Graph widget.
enum Pd::Graph::Mode |
Graph mode.
The general behaviour of the graph.
enum Pd::Graph::State |
Graph state.
Enumerator | |
---|---|
Run | Incoming data shall be displayed immediately. |
Stop | Incoming data shall be processed in background, but the display shall not be changed. |
Trigger level mode.
Determines, how the trigger level is generated.
Enumerator | |
---|---|
AutoLevel | Automatic trigger level calculation. |
ManualLevel | Use the manualTriggerLevel property. |
Graph::Graph | ( | QWidget * | parent = 0 | ) |
Constructor.
parent | parent widget |
References Pd::Widget::getTimer(), impl, redrawEvent(), run(), and stop().
|
virtual |
Destructor.
References clearTriggerVariable(), and clearVariables().
void Graph::addVariable | ( | PdCom::Variable | pv, |
const PdCom::Selector & | selector = {} , |
||
const QtPdCom::Transmission & | transmission = QtPdCom::event_mode , |
||
double | scale = 1.0 , |
||
double | offset = 0.0 , |
||
double | tau = 0.0 , |
||
QColor | color = Qt::blue |
||
) |
pv | Process variable. |
selector | Selector. |
transmission | Transmission. |
scale | Scale factor. |
offset | Offset (applied after scaling). |
tau | PT1 filter time constant. A value less or equal to 0.0 means, that no filter is applied. |
color | Graph color. |
References impl, Layer, and Pd::Graph::Layer::resizeExtrema().
Referenced by setVariable().
void Graph::addVariable | ( | PdCom::Process * | process, |
const QString & | path, | ||
const PdCom::Selector & | selector = {} , |
||
const QtPdCom::Transmission & | transmission = QtPdCom::event_mode , |
||
double | scale = 1.0 , |
||
double | offset = 0.0 , |
||
double | tau = 0.0 , |
||
QColor | color = Qt::blue |
||
) |
process | Process. |
path | Variable path. |
selector | Selector. |
transmission | Transmission. |
scale | Scale factor. |
offset | Offset (applied after scaling). |
tau | PT1 filter time constant. A value less or equal to 0.0 means, that no filter is applied. |
color | Graph color. |
References impl, Layer, and Pd::Graph::Layer::resizeExtrema().
void Graph::clearData | ( | ) |
References impl.
Referenced by setMode(), and setTriggerPosition().
void Graph::clearTriggerVariable | ( | ) |
References impl.
Referenced by setTriggerVariable(), and ~Graph().
void Graph::clearVariables | ( | ) |
References impl.
Referenced by setVariable(), and ~Graph().
|
overrideprotected |
|
overrideprotected |
Event handler.
event | Paint event flags. |
References impl, and toggleState().
Referenced by contextMenuEvent(), paintEvent(), and resizeEvent().
bool Graph::getAutoScaleWidth | ( | ) | const |
References impl.
Graph::Mode Graph::getEffectiveMode | ( | ) | const |
References impl.
QColor Graph::getGridColor | ( | ) | const |
References impl.
double Graph::getManualTriggerLevel | ( | ) | const |
References impl.
Graph::Mode Graph::getMode | ( | ) | const |
double Graph::getScaleMax | ( | ) | const |
References impl.
double Graph::getScaleMin | ( | ) | const |
References impl.
bool Graph::getState | ( | ) | const |
References impl.
QString Graph::getSuffix | ( | ) | const |
Graph::TriggerLevelMode Graph::getTriggerLevelMode | ( | ) | const |
References impl.
double Graph::getTriggerPosition | ( | ) | const |
References impl.
double Graph::getTriggerTimeout | ( | ) | const |
References impl.
|
private |
Called by the layers if the data were sampled.
References impl.
|
overrideprotected |
|
privateslot |
void Graph::resetAutoScaleWidth | ( | ) |
Resets the gridColor.
References DEFAULT_AUTO_SCALE_WIDTH, and setAutoScaleWidth().
void Graph::resetGridColor | ( | ) |
Resets the gridColor.
References DEFAULT_GRID_COLOR, and setGridColor().
void Graph::resetManualTriggerLevel | ( | ) |
Resets the manualTriggerLevel.
References DEFAULT_MANUAL_TRIGGER_LEVEL, and setManualTriggerLevel().
void Graph::resetMode | ( | ) |
Resets the widget's mode.
References DEFAULT_MODE, and setMode().
void Graph::resetScaleMax | ( | ) |
Resets the value scale's maximum value.
References DEFAULT_SCALEMAX, and setScaleMax().
void Graph::resetScaleMin | ( | ) |
Resets the value scale's minimum value.
References DEFAULT_SCALEMIN, and setScaleMin().
void Graph::resetTimeRange | ( | ) |
Resets the time range.
References DEFAULT_TIMERANGE, and setTimeRange().
void Graph::resetTriggerLevelMode | ( | ) |
Resets the widget's triggerLevelMode.
References DEFAULT_TRIGGER_LEVEL_MODE, and setTriggerLevelMode().
void Graph::resetTriggerPosition | ( | ) |
Resets the triggerPosition.
References DEFAULT_TRIGGER_POSITION, and setTriggerPosition().
void Graph::resetTriggerTimeout | ( | ) |
Resets the triggerTimeout.
References DEFAULT_TRIGGER_TIMEOUT, and setTriggerTimeout().
|
overrideprotected |
|
privateslot |
void Graph::setAutoScaleWidth | ( | bool | a | ) |
void Graph::setGridColor | ( | const QColor & | col | ) |
void Graph::setManualTriggerLevel | ( | double | l | ) |
Sets the manualTriggerLevel.
References impl, and ManualLevel.
Referenced by resetManualTriggerLevel().
void Graph::setMode | ( | Mode | mode | ) |
|
private |
Mark the graph widget for redrawing.
References impl.
void Graph::setScaleMax | ( | double | scale | ) |
void Graph::setScaleMin | ( | double | scale | ) |
void Graph::setState | ( | State | s | ) |
void Graph::setSuffix | ( | const QString & | suffix | ) |
Sets the suffix to display after the Y-axis values.
References getSuffix(), impl, and suffix.
void Graph::setTimeRange | ( | double | range | ) |
void Graph::setTriggerLevelMode | ( | TriggerLevelMode | m | ) |
Sets the widget's triggerLevelMode.
References impl, and ManualLevel.
Referenced by resetTriggerLevelMode().
void Graph::setTriggerPosition | ( | double | triggerPosition | ) |
Sets the triggerPosition.
References clearData(), impl, and triggerPosition.
Referenced by resetTriggerPosition().
void Graph::setTriggerTimeout | ( | double | triggerTimeout | ) |
void Graph::setTriggerVariable | ( | PdCom::Variable | pv, |
const PdCom::Selector & | selector = {} , |
||
const QtPdCom::Transmission & | transmission = QtPdCom::event_mode , |
||
double | scale = 1.0 , |
||
double | offset = 0.0 , |
||
double | tau = 0.0 |
||
) |
Subscribe to a process variable as trigger variable.
pv | Process variable. |
selector | Selector. |
transmission | Transmission. |
scale | Scale factor. |
offset | Offset (applied after scaling). |
tau | PT1 filter time constant. A value less or equal to 0.0 means, that no filter is applied. |
References clearTriggerVariable(), and impl.
void Graph::setTriggerVariable | ( | PdCom::Process * | process, |
const QString & | path, | ||
const PdCom::Selector & | selector = {} , |
||
const QtPdCom::Transmission & | transmission = QtPdCom::event_mode , |
||
double | scale = 1.0 , |
||
double | offset = 0.0 , |
||
double | tau = 0.0 |
||
) |
Subscribe to a process variable as trigger variable.
process | Process. |
path | Variable path. |
selector | Selector. |
transmission | Transmission. |
scale | Scale factor. |
offset | Offset (applied after scaling). |
tau | PT1 filter time constant. A value less or equal to 0.0 means, that no filter is applied. |
References clearTriggerVariable(), and impl.
void Graph::setVariable | ( | PdCom::Variable | pv, |
const PdCom::Selector & | selector = {} , |
||
const QtPdCom::Transmission & | transmission = QtPdCom::event_mode , |
||
double | scale = 1.0 , |
||
double | offset = 0.0 , |
||
double | tau = 0.0 , |
||
QColor | color = Qt::blue |
||
) |
Subscribe to a process variable.
pv | Process variable. |
selector | Selector. |
transmission | Transmission. |
scale | Scale factor. |
offset | Offset (applied after scaling). |
tau | PT1 filter time constant. A value less or equal to 0.0 means, that no filter is applied. |
color | Graph color. |
References addVariable(), and clearVariables().
void Graph::setVariable | ( | PdCom::Process * | process, |
const QString & | path, | ||
const PdCom::Selector & | selector = {} , |
||
const QtPdCom::Transmission & | transmission = QtPdCom::event_mode , |
||
double | scale = 1.0 , |
||
double | offset = 0.0 , |
||
double | tau = 0.0 , |
||
QColor | color = Qt::blue |
||
) |
process | Process. |
path | Variable path. |
selector | Selector. |
transmission | Transmission. |
scale | Scale factor. |
offset | Offset (applied after scaling). |
tau | PT1 filter time constant. A value less or equal to 0.0 means, that no filter is applied. |
color | Graph color. |
References addVariable(), and clearVariables().
|
virtual |
Gives a hint aboute the optimal size.
|
privateslot |
void Graph::toggleState | ( | ) |
|
private |
|
private |
|
friend |
|
friend |
|
private |
|
private |
Referenced by addVariable(), clearData(), clearTriggerVariable(), clearVariables(), contextMenuEvent(), event(), getAutoScaleWidth(), getEffectiveMode(), getGridColor(), getManualTriggerLevel(), getMode(), getScaleMax(), getScaleMin(), getState(), getSuffix(), getTimeRange(), getTriggerLevelMode(), getTriggerPosition(), getTriggerTimeout(), Graph(), notifySampled(), Pd::Graph::Impl::notifyScaleWidthChange(), paintEvent(), redrawEvent(), resetSuffix(), resizeEvent(), setAutoScaleWidth(), setGridColor(), setManualTriggerLevel(), setMode(), setRedraw(), setScaleMax(), setScaleMin(), setState(), setSuffix(), setTimeRange(), setTriggerLevelMode(), setTriggerPosition(), setTriggerTimeout(), setTriggerVariable(), toggleState(), triggerConditionDetected(), triggerIdle(), and Pd::Graph::Impl::updateBackground().
|
private |
Referenced by addVariable().
|
private |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
The maximum value on the value scale.
|
readwrite |
The minimum value on the value scale.
|
readwrite |
Referenced by setSuffix().
|
readwrite |
The time range to display.
|
readwrite |
|
readwrite |
Referenced by setTriggerPosition().
|
readwrite |
Referenced by setTriggerTimeout().