|
DynExp
Highly flexible laboratory automation for dynamically changing experiments.
|
#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 |
Definition at line 16 of file GraphUtil.h.
| 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.
| void DynExpModule::Graph::LineGraphPlotInfo::AdjustAxesLimits | ( | ) |
Adjusts MinValues and MaxValues to best display all data series.
Definition at line 194 of file GraphUtil.cpp.
|
inlineprivate |
Definition at line 188 of file GraphUtil.h.
|
inlineprivate |
Definition at line 189 of file GraphUtil.h.
| 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).
| X | x value of the sample. |
| Y | y value of the sample. |
| SeriesIndex | Index of the data series the sample belongs to. |
Definition at line 231 of file GraphUtil.cpp.
| 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.
| BasicSamplesSeries | Vector 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.
| QString DynExpModule::Graph::LineGraphPlotInfo::GetMultiplierLabel | ( | ) | const |
Returns the multiplier prefix associated with Multiplier.
Definition at line 7 of file GraphUtil.cpp.
| 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.
| BasicSamples | Vector of BasicSamples to convert. Move to this parameter to avoid copying. |
| Samples | Destiny to store the processed samples in. |
| SeriesIndex | Index of the data series that is to be processed. |
Definition at line 123 of file GraphUtil.cpp.
| 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.
| RawSamples | List of QPointF samples to convert. |
| Samples | Destiny to store the processed samples in. |
| SeriesIndex | Index of the data series that is to be processed. |
Definition at line 90 of file GraphUtil.cpp.
| 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.
| Spectrum | Spectrum to convert. Move to this parameter to avoid copying. |
| Samples | Destiny to store the processed samples in. |
| SeriesIndex | Index of the data series that is to be processed. |
Definition at line 157 of file GraphUtil.cpp.
| 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.
| Samples | Processed samples to reprocess. |
| SeriesIndex | Index of the data series that is to be processed. |
Definition at line 218 of file GraphUtil.cpp.
| void DynExpModule::Graph::LineGraphPlotInfo::Reset | ( | ) |
Resets the instance to generate information from new sample series.
Definition at line 20 of file GraphUtil.cpp.
| void DynExpModule::Graph::LineGraphPlotInfo::ResetHoveredSample | ( | ) |
Removes the stored hovered sample.
Definition at line 251 of file GraphUtil.cpp.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| QPointF DynExpModule::Graph::LineGraphPlotInfo::MaxValues |
Current upper axes limits of x and y axes.
Definition at line 150 of file GraphUtil.h.
| QPointF DynExpModule::Graph::LineGraphPlotInfo::MinValues |
Current lower axes limits of x and y axes.
Definition at line 145 of file GraphUtil.h.
| 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.
| bool DynExpModule::Graph::LineGraphPlotInfo::XIsLogarithmic = false |
Determines whether x axis is logarithmic.
Definition at line 114 of file GraphUtil.h.
| 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.
| 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.
| bool DynExpModule::Graph::LineGraphPlotInfo::YIsLogarithmic = false |
Determines whether y axis is logarithmic.
Definition at line 119 of file GraphUtil.h.
| 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.
| 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.