DynExp
Highly flexible laboratory automation for dynamically changing experiments.
Loading...
Searching...
No Matches
DynExpModule::Graph::LineGraphPlotInfo Struct Reference

#include <GraphUtil.h>

Public Types

using QPointFValueType = decltype(std::declval< QPointF >().x())
 Data type of sample values for plotting.
 

Public Member Functions

QString GetMultiplierLabel () const
 Returns the multiplier prefix associated with Multiplier.
 
void Reset ()
 Resets the instance to generate information from new sample series.
 
void GenerateSampleTimingInfo (std::vector< DynExpInstr::DataStreamBase::BasicSampleListType > &BasicSamplesSeries)
 Extracts sample timing information for x axis scaling from BasicSamples and stores the results in this DynExpLineGraphPlotInfo instance.
 
bool ProcessSamples (QList< QPointF > RawSamples, QList< QPointF > &Samples, const size_t SeriesIndex)
 Converts RawSamples to displayable format and stores their minimal and maximal values in this DynExpLineGraphPlotInfo instance.
 
bool ProcessBasicSamples (DynExpInstr::DataStreamBase::BasicSampleListType BasicSamples, QList< QPointF > &Samples, const size_t SeriesIndex)
 Converts BasicSamples to displayable format and stores their minimal and maximal values in this DynExpLineGraphPlotInfo instance.
 
bool ProcessSpectrum (DynExpInstr::SpectrometerData::SpectrumType Spectrum, QList< QPointF > &Samples, const size_t SeriesIndex)
 Converts Spectrum to displayable format and stores its minimal and maximal values in this DynExpLineGraphPlotInfo instance.
 
void AdjustAxesLimits ()
 Adjusts MinValues and MaxValues to best display all data series.
 
void ReprocessSamples (const QList< QPointF > &Samples, const size_t SeriesIndex)
 If data plotting is not enabled (running), the available and already plotted samples have to be reprocessed, e.g. for data sample hovering detection.
 
void CheckSampleHovered (const QPointFValueType X, const QPointFValueType Y, const size_t SeriesIndex)
 Checks whether the given sample is close to the mouse cursor (hovered).
 
void ResetHoveredSample ()
 Removes the stored hovered sample.
 

Public Attributes

DynExp::Units::UnitType XUnit = DynExp::Units::UnitType::Index
 Joint unit of the plot's x axis.
 
DynExp::Units::UnitType YUnit = DynExp::Units::UnitType::Arbitrary
 Joint unit of the plot's y axis.
 
bool XIsLogarithmic = false
 Determines whether x axis is logarithmic.
 
bool YIsLogarithmic = false
 Determines whether y axis is logarithmic.
 
QString XLabel
 If empty, the x label is constructed from XUnit. Otherwise, XLabel is used.
 
QString YLabel
 If empty, the y label is constructed from YUnit. Otherwise, YLabel is used.
 
unsigned int Multiplier = 0
 Best order of magnitude to scale the plot's joint time axis with.
 
size_t MaxSampleCountPerSeries = 0
 Indicates the number of samples contained in the longest data series to plot. A value of 0 indicates that no samples are available for plotting.
 
QPointF MinValues
 Current lower axes limits of x and y axes.
 
QPointF MaxValues
 Current upper axes limits of x and y axes.
 
QPointF LastMinValues
 Lower axes limits of x and y axes from previous graph update.
 
QPointF LastMaxValues
 Upper axes limits of x and y axes from previous graph update.
 
QPointF CursorPosition
 Relative position of the mouse cursor inside the coordinate system (between 0. and 1.).
 
QPointF HoveredPoint
 Hovered point belonging to any series in normalized coordinate system coordinates (between 0. and 1.).
 
QPointF HoveredSample
 Hovered sample belonging to any series in the graphs's real coordinate system.
 
size_t HoveredSeries = 0
 Index of the data series the hovered point belongs to.
 
QPointFValueType HoveredDistance = std::numeric_limits<QPointFValueType>::max()
 Distance between the mouse cursor and the hovered point.
 

Private Member Functions

double ApplyXLog (double Value) const
 
double ApplyYLog (double Value) const
 

Detailed Description

Definition at line 16 of file GraphUtil.h.

Member Typedef Documentation

◆ QPointFValueType

using DynExpModule::Graph::LineGraphPlotInfo::QPointFValueType = decltype(std::declval<QPointF>().x())

Data type of sample values for plotting.

Definition at line 21 of file GraphUtil.h.

Member Function Documentation

◆ AdjustAxesLimits()

void DynExpModule::Graph::LineGraphPlotInfo::AdjustAxesLimits ( )

Adjusts MinValues and MaxValues to best display all data series.

Definition at line 194 of file GraphUtil.cpp.

◆ ApplyXLog()

double DynExpModule::Graph::LineGraphPlotInfo::ApplyXLog ( double  Value) const
inlineprivate

Definition at line 188 of file GraphUtil.h.

◆ ApplyYLog()

double DynExpModule::Graph::LineGraphPlotInfo::ApplyYLog ( double  Value) const
inlineprivate

Definition at line 189 of file GraphUtil.h.

◆ CheckSampleHovered()

void DynExpModule::Graph::LineGraphPlotInfo::CheckSampleHovered ( const QPointFValueType  X,
const QPointFValueType  Y,
const size_t  SeriesIndex 
)

Checks whether the given sample is close to the mouse cursor (hovered).

Parameters
Xx value of the sample.
Yy value of the sample.
SeriesIndexIndex of the data series the sample belongs to.

Definition at line 231 of file GraphUtil.cpp.

◆ GenerateSampleTimingInfo()

void DynExpModule::Graph::LineGraphPlotInfo::GenerateSampleTimingInfo ( std::vector< DynExpInstr::DataStreamBase::BasicSampleListType > &  BasicSamplesSeries)

Extracts sample timing information for x axis scaling from BasicSamples and stores the results in this DynExpLineGraphPlotInfo instance.

Parameters
BasicSamplesSeriesVector of vectors of BasicSamples to investigate. The outer vector represents a list of data series. The funcion may sort the entries of BasicSamples according to their x values in ascending order.

Definition at line 38 of file GraphUtil.cpp.

◆ GetMultiplierLabel()

QString DynExpModule::Graph::LineGraphPlotInfo::GetMultiplierLabel ( ) const

Returns the multiplier prefix associated with Multiplier.

Returns
Prefix of the axis multiplier, like 'n' for nano.

Definition at line 7 of file GraphUtil.cpp.

◆ ProcessBasicSamples()

bool DynExpModule::Graph::LineGraphPlotInfo::ProcessBasicSamples ( DynExpInstr::DataStreamBase::BasicSampleListType  BasicSamples,
QList< QPointF > &  Samples,
const size_t  SeriesIndex 
)

Converts BasicSamples to displayable format and stores their minimal and maximal values in this DynExpLineGraphPlotInfo instance.

Parameters
BasicSamplesVector of BasicSamples to convert. Move to this parameter to avoid copying.
SamplesDestiny to store the processed samples in.
SeriesIndexIndex of the data series that is to be processed.
Returns
Returns true if at least one sample has been processed, false otherwise.

Definition at line 123 of file GraphUtil.cpp.

◆ ProcessSamples()

bool DynExpModule::Graph::LineGraphPlotInfo::ProcessSamples ( QList< QPointF >  RawSamples,
QList< QPointF > &  Samples,
const size_t  SeriesIndex 
)

Converts RawSamples to displayable format and stores their minimal and maximal values in this DynExpLineGraphPlotInfo instance.

Parameters
RawSamplesList of QPointF samples to convert.
SamplesDestiny to store the processed samples in.
SeriesIndexIndex of the data series that is to be processed.
Returns
Returns true if at least one sample has been processed, false otherwise.

Definition at line 90 of file GraphUtil.cpp.

◆ ProcessSpectrum()

bool DynExpModule::Graph::LineGraphPlotInfo::ProcessSpectrum ( DynExpInstr::SpectrometerData::SpectrumType  Spectrum,
QList< QPointF > &  Samples,
const size_t  SeriesIndex 
)

Converts Spectrum to displayable format and stores its minimal and maximal values in this DynExpLineGraphPlotInfo instance.

Parameters
SpectrumSpectrum to convert. Move to this parameter to avoid copying.
SamplesDestiny to store the processed samples in.
SeriesIndexIndex of the data series that is to be processed.
Returns
Returns true if at least one sample has been processed, false otherwise.

Definition at line 157 of file GraphUtil.cpp.

◆ ReprocessSamples()

void DynExpModule::Graph::LineGraphPlotInfo::ReprocessSamples ( const QList< QPointF > &  Samples,
const size_t  SeriesIndex 
)

If data plotting is not enabled (running), the available and already plotted samples have to be reprocessed, e.g. for data sample hovering detection.

Parameters
SamplesProcessed samples to reprocess.
SeriesIndexIndex of the data series that is to be processed.

Definition at line 218 of file GraphUtil.cpp.

◆ Reset()

void DynExpModule::Graph::LineGraphPlotInfo::Reset ( )

Resets the instance to generate information from new sample series.

Definition at line 20 of file GraphUtil.cpp.

◆ ResetHoveredSample()

void DynExpModule::Graph::LineGraphPlotInfo::ResetHoveredSample ( )

Removes the stored hovered sample.

Definition at line 251 of file GraphUtil.cpp.

Member Data Documentation

◆ CursorPosition

QPointF DynExpModule::Graph::LineGraphPlotInfo::CursorPosition

Relative position of the mouse cursor inside the coordinate system (between 0. and 1.).

Definition at line 165 of file GraphUtil.h.

◆ HoveredDistance

QPointFValueType DynExpModule::Graph::LineGraphPlotInfo::HoveredDistance = std::numeric_limits<QPointFValueType>::max()

Distance between the mouse cursor and the hovered point.

Definition at line 185 of file GraphUtil.h.

◆ HoveredPoint

QPointF DynExpModule::Graph::LineGraphPlotInfo::HoveredPoint

Hovered point belonging to any series in normalized coordinate system coordinates (between 0. and 1.).

Definition at line 170 of file GraphUtil.h.

◆ HoveredSample

QPointF DynExpModule::Graph::LineGraphPlotInfo::HoveredSample

Hovered sample belonging to any series in the graphs's real coordinate system.

Definition at line 175 of file GraphUtil.h.

◆ HoveredSeries

size_t DynExpModule::Graph::LineGraphPlotInfo::HoveredSeries = 0

Index of the data series the hovered point belongs to.

Definition at line 180 of file GraphUtil.h.

◆ LastMaxValues

QPointF DynExpModule::Graph::LineGraphPlotInfo::LastMaxValues

Upper axes limits of x and y axes from previous graph update.

Definition at line 160 of file GraphUtil.h.

◆ LastMinValues

QPointF DynExpModule::Graph::LineGraphPlotInfo::LastMinValues

Lower axes limits of x and y axes from previous graph update.

Definition at line 155 of file GraphUtil.h.

◆ MaxSampleCountPerSeries

size_t DynExpModule::Graph::LineGraphPlotInfo::MaxSampleCountPerSeries = 0

Indicates the number of samples contained in the longest data series to plot. A value of 0 indicates that no samples are available for plotting.

Definition at line 140 of file GraphUtil.h.

◆ MaxValues

QPointF DynExpModule::Graph::LineGraphPlotInfo::MaxValues

Current upper axes limits of x and y axes.

Definition at line 150 of file GraphUtil.h.

◆ MinValues

QPointF DynExpModule::Graph::LineGraphPlotInfo::MinValues

Current lower axes limits of x and y axes.

Definition at line 145 of file GraphUtil.h.

◆ Multiplier

unsigned int DynExpModule::Graph::LineGraphPlotInfo::Multiplier = 0

Best order of magnitude to scale the plot's joint time axis with.

Definition at line 134 of file GraphUtil.h.

◆ XIsLogarithmic

bool DynExpModule::Graph::LineGraphPlotInfo::XIsLogarithmic = false

Determines whether x axis is logarithmic.

Definition at line 114 of file GraphUtil.h.

◆ XLabel

QString DynExpModule::Graph::LineGraphPlotInfo::XLabel

If empty, the x label is constructed from XUnit. Otherwise, XLabel is used.

Definition at line 124 of file GraphUtil.h.

◆ XUnit

DynExp::Units::UnitType DynExpModule::Graph::LineGraphPlotInfo::XUnit = DynExp::Units::UnitType::Index

Joint unit of the plot's x axis.

Definition at line 104 of file GraphUtil.h.

◆ YIsLogarithmic

bool DynExpModule::Graph::LineGraphPlotInfo::YIsLogarithmic = false

Determines whether y axis is logarithmic.

Definition at line 119 of file GraphUtil.h.

◆ YLabel

QString DynExpModule::Graph::LineGraphPlotInfo::YLabel

If empty, the y label is constructed from YUnit. Otherwise, YLabel is used.

Definition at line 129 of file GraphUtil.h.

◆ YUnit

DynExp::Units::UnitType DynExpModule::Graph::LineGraphPlotInfo::YUnit = DynExp::Units::UnitType::Arbitrary

Joint unit of the plot's y axis.

Definition at line 109 of file GraphUtil.h.


The documentation for this struct was generated from the following files: