QtPdWidgets  2.3.1
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Pd::Graph::Layer Class Reference
Inheritance diagram for Pd::Graph::Layer:
Inheritance graph
[legend]
Collaboration diagram for Pd::Graph::Layer:
Collaboration graph
[legend]

Public Member Functions

 Layer (Graph *, QColor, Graph::State, std::chrono::nanoseconds)
 Constructor. More...
 
void clearData ()
 
const ValueRing< double > & getValues () const
 
void setState (Graph::State)
 
void setTimeRange (std::chrono::nanoseconds)
 
void paint (QPainter &, double, const Scale &, const QRect &)
 Paint the graph layer. More...
 
void resizeExtrema (unsigned int)
 Resizes the extrema ring buffer. More...
 
void prepareSample (std::chrono::nanoseconds)
 Copy current values into trigger buffer. More...
 
bool hasSampled () const
 

Private Types

typedef QPair< double, double > Extrema
 Extrema type with minimum and maximum. More...
 

Private Member Functions

void newValues (std::chrono::nanoseconds) override
 This virtual method is called by the ProcessVariable, if its value changes. More...
 
void fillExtrema ()
 Fills the extrema with the values from the ring. More...
 
bool appendToExtrema (std::chrono::nanoseconds, double)
 Appends a new data value to the extrema ring buffer. More...
 

Private Attributes

Graph *const graph
 Parent graph. More...
 
QColor color
 Graph color. More...
 
Graph::State state
 Layer state. More...
 
double value
 Current value. More...
 
bool dataPresent
 value contains a valid value. More...
 
ValueRing< double > values
 Ring buffer with time/value pairs. More...
 
ValueRing< double > savedValues
 Buffer for saved values. More...
 
std::chrono::nanoseconds timeToSample
 
QVector< Extremaextrema
 Vector containing the extrema to display. More...
 
int extremaOffset
 Current offset in the extrema buffer. More...
 
std::chrono::nanoseconds offsetTime
 Absolute time of the #offset. More...
 
unsigned int validExtrema
 Number of valid extrema. More...
 
double lastAppendedValue
 The last value appended by appendToExtrema(). More...
 

Member Typedef Documentation

◆ Extrema

typedef QPair<double, double> Pd::Graph::Layer::Extrema
private

Extrema type with minimum and maximum.

Constructor & Destructor Documentation

◆ Layer()

Pd::Graph::Layer::Layer ( Graph parent,
QColor  c,
Graph::State  state,
std::chrono::nanoseconds  timeRange 
)

Constructor.

References Pd::Graph::Layer::setTimeRange().

Member Function Documentation

◆ appendToExtrema()

bool Pd::Graph::Layer::appendToExtrema ( std::chrono::nanoseconds  time,
double  value 
)
private

Appends a new data value to the extrema ring buffer.

Returns
true, if the widget has to be redrawn.

◆ clearData()

void Pd::Graph::Layer::clearData ( )

◆ fillExtrema()

void Pd::Graph::Layer::fillExtrema ( )
private

Fills the extrema with the values from the ring.

References Pd::ValueRing< T >::getLength().

◆ getValues()

const ValueRing< double > & Pd::Graph::Layer::getValues ( ) const
Returns
The values currently displayed.

◆ hasSampled()

bool Pd::Graph::Layer::hasSampled ( ) const
inline

◆ newValues()

void Pd::Graph::Layer::newValues ( std::chrono::nanoseconds  ts)
overrideprivate

This virtual method is called by the ProcessVariable, if its value changes.

◆ paint()

void Pd::Graph::Layer::paint ( QPainter &  painter,
double  scaleFactor,
const Scale valueScale,
const QRect &  graphRect 
)

Paint the graph layer.

References Pd::Scale::getMax(), and Pd::Scale::getMin().

◆ prepareSample()

void Pd::Graph::Layer::prepareSample ( std::chrono::nanoseconds  t)

Copy current values into trigger buffer.

◆ resizeExtrema()

void Pd::Graph::Layer::resizeExtrema ( unsigned int  length)

Resizes the extrema ring buffer.

Referenced by Pd::Graph::addVariable().

◆ setState()

void Pd::Graph::Layer::setState ( Graph::State  s)

◆ setTimeRange()

void Pd::Graph::Layer::setTimeRange ( std::chrono::nanoseconds  range)

Referenced by Pd::Graph::Layer::Layer().

Member Data Documentation

◆ color

QColor Pd::Graph::Layer::color
private

Graph color.

◆ dataPresent

bool Pd::Graph::Layer::dataPresent
private

value contains a valid value.

◆ extrema

QVector<Extrema> Pd::Graph::Layer::extrema
private

Vector containing the extrema to display.

◆ extremaOffset

int Pd::Graph::Layer::extremaOffset
private

Current offset in the extrema buffer.

◆ graph

Graph* const Pd::Graph::Layer::graph
private

Parent graph.

◆ lastAppendedValue

double Pd::Graph::Layer::lastAppendedValue
private

The last value appended by appendToExtrema().

◆ offsetTime

std::chrono::nanoseconds Pd::Graph::Layer::offsetTime
private

Absolute time of the #offset.

◆ savedValues

ValueRing<double> Pd::Graph::Layer::savedValues
private

Buffer for saved values.

◆ state

Graph::State Pd::Graph::Layer::state
private

Layer state.

◆ timeToSample

std::chrono::nanoseconds Pd::Graph::Layer::timeToSample
private

◆ validExtrema

unsigned int Pd::Graph::Layer::validExtrema
private

Number of valid extrema.

◆ value

double Pd::Graph::Layer::value
private

Current value.

◆ values

ValueRing<double> Pd::Graph::Layer::values
private

Ring buffer with time/value pairs.


The documentation for this class was generated from the following file: