QtPdWidgets
2.3.1
|
#include <Bar.h>
Public Types | |
enum | Orientation { Vertical, Horizontal } |
Orientation of the bar widget. More... | |
enum | Style { ColorBar, Arrow, MultiColorBar } |
Style of the bar widget. More... | |
enum | Origin { OriginZero, OriginMinimum, OriginMaximum } |
Bar origin mode. More... | |
Public Member Functions | |
Bar (QWidget *parent=0) | |
virtual | ~Bar () |
Destructor. More... | |
Orientation | getOrientation () const |
void | setOrientation (Orientation) |
Sets the orientation. More... | |
void | resetOrientation () |
Resets the orientation. More... | |
Style | getStyle () const |
void | setStyle (Style) |
Sets the style. More... | |
void | resetStyle () |
Resets the style. More... | |
bool | getShowScale () const |
void | setShowScale (bool) |
Sets, if the value scale shall be shown. More... | |
void | resetShowScale () |
Resets showScale. More... | |
double | getScaleMin () const |
void | setScaleMin (double) |
Sets the value scale minimum. More... | |
void | resetScaleMin () |
Resets the value scale minimum. More... | |
double | getScaleMax () const |
void | setScaleMax (double) |
Sets the value scale maximum. More... | |
void | resetScaleMax () |
Resets the value scale maximum. More... | |
Origin | getOrigin () const |
void | setOrigin (Origin) |
Sets the bar origin. More... | |
void | resetOrigin () |
Resets the bar origin mode. More... | |
int | getBorderWidth () const |
void | setBorderWidth (int) |
Sets the width of the border around the bar rect. More... | |
void | resetBorderWidth () |
Resets the borderWidth. More... | |
QColor | getBackgroundColor () const |
void | setBackgroundColor (QColor) |
Sets the background color of the widget. More... | |
void | resetBackgroundColor () |
Resets the backgroundColor. More... | |
bool | getAutoBarWidth () const |
void | setAutoBarWidth (bool) |
Sets the autoBarWidth flag of the widget. More... | |
void | resetAutoBarWidth () |
Resets the autoBarWidth. More... | |
QSize | sizeHint () const override |
Gives a hint aboute the optimal size. More... | |
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) |
Connect to a process variable using a new bar stack. More... | |
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 | addStackedVariable (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) |
Connect to a process variable using the last stack. More... | |
void | addStackedVariable (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 () |
Clear all stacks and sections. 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) |
Clear all stacks and sections and add a single 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 | clearData () |
void | setGradientStops (const QGradientStops &) |
const QPair< double, double > | getGradientLimits () const |
Protected Member Functions | |
bool | event (QEvent *) override |
Event handler. More... | |
void | resizeEvent (QResizeEvent *) override |
Processes a resize event. More... | |
void | paintEvent (QPaintEvent *event) override |
Paint function. More... | |
Properties | |
Orientation | orientation |
Style | style |
bool | showScale |
double | scaleMin |
double | scaleMax |
Origin | origin |
int | borderWidth |
QColor | backgroundColor |
bool | autoBarWidth |
Private Attributes | |
QScopedPointer< BarPrivate > const | d_ptr |
Bar graph widget.
enum Pd::Bar::Orientation |
enum Pd::Bar::Origin |
Bar origin mode.
This determines, from where bars are drawn.
Enumerator | |
---|---|
OriginZero | Draw bars originating from zero. |
OriginMinimum | Draw bars originating from the scale minimum. If orientation is set to Vertical, this is the bottom of the bar area, while with orientation set to Horizontal, this is the left side of the bar area. |
OriginMaximum | Draw bars originating from the scale maximum. If orientation is set to Vertical, this is the top of the bar area, while with orientation set to Horizontal, this is the right side of the bar area. |
enum Pd::Bar::Style |
Bar::Bar | ( | QWidget * | parent = 0 | ) |
References Pd::Widget::getTimer().
|
virtual |
Destructor.
References clearVariables().
void Bar::addStackedVariable | ( | 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 |
||
) |
Connect to a process variable using the last stack.
The variable is placed as upper element of the last stack. If no stacks exist, the forst one is created.
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 | Bar color. |
References addVariable().
Referenced by addVariable().
void Bar::addStackedVariable | ( | 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 | Bar color. |
References addVariable().
void Bar::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 |
||
) |
Connect to a process variable using a new bar stack.
A new stack (horizontal division for veritcal bar orientation) is created. A stack can display multiple sections on top of each other (speaking for vertical bar orientation). To add a new section to an existing stack, use addStackedVariable().
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 | Bar color. |
References addStackedVariable().
Referenced by addStackedVariable(), and setVariable().
void Bar::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 | Bar color. |
References addStackedVariable().
void Bar::clearData | ( | ) |
void Bar::clearVariables | ( | ) |
Clear all stacks and sections.
Referenced by setVariable(), and ~Bar().
|
overrideprotected |
bool Bar::getAutoBarWidth | ( | ) | const |
QColor Bar::getBackgroundColor | ( | ) | const |
int Bar::getBorderWidth | ( | ) | const |
const QPair< double, double > Bar::getGradientLimits | ( | ) | const |
Referenced by Pd::BarPrivate::Stack::findMultiColor().
Bar::Orientation Bar::getOrientation | ( | ) | const |
Bar::Origin Bar::getOrigin | ( | ) | const |
double Bar::getScaleMax | ( | ) | const |
double Bar::getScaleMin | ( | ) | const |
bool Bar::getShowScale | ( | ) | const |
References showScale.
Bar::Style Bar::getStyle | ( | ) | const |
|
overrideprotected |
void Bar::resetAutoBarWidth | ( | ) |
Resets the autoBarWidth.
References DEFAULT_AUTOBARWIDTH, and setAutoBarWidth().
void Bar::resetBackgroundColor | ( | ) |
Resets the backgroundColor.
References DEFAULT_BACKGROUNDCOLOR, and setBackgroundColor().
void Bar::resetBorderWidth | ( | ) |
Resets the borderWidth.
References DEFAULT_BORDERWIDTH, and setBorderWidth().
void Bar::resetOrientation | ( | ) |
Resets the orientation.
References DEFAULT_ORIENTATION, and setOrientation().
void Bar::resetOrigin | ( | ) |
Resets the bar origin mode.
References DEFAULT_ORIGIN, and setOrigin().
void Bar::resetScaleMax | ( | ) |
Resets the value scale maximum.
References DEFAULT_SCALEMAX, and setScaleMax().
void Bar::resetScaleMin | ( | ) |
Resets the value scale minimum.
References DEFAULT_SCALEMIN, and setScaleMin().
void Bar::resetShowScale | ( | ) |
Resets showScale.
References DEFAULT_SHOWSCALE, and setShowScale().
void Bar::resetStyle | ( | ) |
Resets the style.
References DEFAULT_STYLE, and setStyle().
|
overrideprotected |
Processes a resize event.
void Bar::setAutoBarWidth | ( | bool | a | ) |
Sets the autoBarWidth flag of the widget.
Referenced by resetAutoBarWidth().
void Bar::setBackgroundColor | ( | QColor | c | ) |
Sets the background color of the widget.
Referenced by resetBackgroundColor().
void Bar::setBorderWidth | ( | int | width | ) |
Sets the width of the border around the bar rect.
Referenced by resetBorderWidth().
void Bar::setGradientStops | ( | const QGradientStops & | g | ) |
void Bar::setOrientation | ( | Orientation | orientation | ) |
Sets the orientation.
References Pd::Scale::Horizontal, Horizontal, orientation, Pd::Scale::Vertical, and Vertical.
Referenced by resetOrientation().
void Bar::setOrigin | ( | Origin | o | ) |
void Bar::setScaleMax | ( | double | val | ) |
Sets the value scale maximum.
Referenced by resetScaleMax().
void Bar::setScaleMin | ( | double | val | ) |
Sets the value scale minimum.
Referenced by resetScaleMin().
void Bar::setShowScale | ( | bool | showScale | ) |
void Bar::setStyle | ( | Style | s | ) |
Sets the style.
Referenced by resetStyle().
void Bar::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 |
||
) |
Clear all stacks and sections and add a single 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 | Bar color. |
References addVariable(), and clearVariables().
void Bar::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 | Bar color. |
References addVariable(), and clearVariables().
|
override |
Gives a hint aboute the optimal size.
References Vertical.
|
private |
Referenced by Pd::BarPrivate::updateLayout().
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
Referenced by setOrientation().
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
Referenced by getShowScale(), and setShowScale().
|
readwrite |