1#ifndef LIBS_DIAGRAMS_CTENDENCYCURVE_HPP_
2#define LIBS_DIAGRAMS_CTENDENCYCURVE_HPP_
8#include <bits/stdint-uintn.h>
31#pragma GCC diagnostic push
32#pragma GCC diagnostic ignored "-Wfloat-equal"
37#pragma GCC diagnostic pop
47 double yMax, uint64_t step)
76 static std::shared_ptr<CTendencyCurve>
79 uint64_t step,
double yMin,
double yMax,
double multiplier, uint16_t numDecimalsY,
80 std::string_view strUnit,
bool isDigital =
false);
82 std::string_view descriptionChannel,
85 uint64_t step,
bool isDigital =
true);
93 void drawAxis(
IGraphics *graphics,
bool withAxisX,
bool withAxisY,
bool withVerticalGrid,
bool withHorizontalGrid,
95 bool isPrinting =
false)
const;
100 [[nodiscard]] std::shared_ptr<std::vector<std::shared_ptr<std::vector<iv::math::geometry::Point2d>>>>
103 std::string
strValue(
double valueX,
double valueY,
unsigned char *justify)
const;
104 std::vector<std::string>
strClickedTime(
double clickedPointX)
const;
106 bool multipleCurves,
double sizeHeight)
const;
113 [[nodiscard]]
double getMinY()
const;
114 [[nodiscard]]
double getMaxY()
const;
118 static std::shared_ptr<std::vector<std::shared_ptr<std::vector<iv::math::geometry::Point2d>>>>
124 double yMax,
double multiplier, uint16_t numDecimalsY, std::string_view strUnit,
bool isDigital);
ETendencyCurveType
Definition CTendencyCurve.hpp:16
Definition AbstractLog.hpp:9
Definition CTendencyCurve.hpp:71
std::string m_tagChannel
Definition CTendencyCurve.hpp:127
std::string getStrUnit() const
Definition CTendencyCurve.cpp:359
std::string strValue(double valueX, double valueY, unsigned char *justify) const
Definition CTendencyCurve.cpp:241
std::string m_descriptionChannel
Definition CTendencyCurve.hpp:128
uint16_t m_numDecimalsY
Definition CTendencyCurve.hpp:134
void drawAxis(IGraphics *graphics, bool withAxisX, bool withAxisY, bool withVerticalGrid, bool withHorizontalGrid, iv::types::height textHeight, iv::types::color colorRGBAxisY, uint64_t indCurve, bool multipleCurves, bool isPrinting=false) const
Definition CTendencyCurve.cpp:93
bool m_isDigital
Definition CTendencyCurve.hpp:135
double m_yMaxAnalog
Definition CTendencyCurve.hpp:132
static std::shared_ptr< CTendencyCurve > createTendencyCurveAnalog(std::string_view tagChannel, std::string_view descriptionChannel, const iv::time::Timestamp &initInterval, const iv::time::Timestamp &endInterval, uint64_t step, double yMin, double yMax, double multiplier, uint16_t numDecimalsY, std::string_view strUnit, bool isDigital=false)
Definition CTendencyCurve.cpp:13
CTendencyCurve(CTendencyCurve &&other)=delete
void sortPoints() const
Definition CTendencyCurve.cpp:176
void printValues(AbstractLog *logger) const
Definition CTendencyCurve.cpp:230
void addPoint(iv::types::timestamp timeSeconds, double value) const
Definition CTendencyCurve.cpp:55
void drawAxisReference(double valueX, IGraphics *graphics, double maxY, double minY, bool multipleCurves) const
Definition CTendencyCurve.cpp:159
double moveValuePositionX(double actualPositionX, double percentage) const
Definition CTendencyCurve.cpp:334
static std::shared_ptr< CTendencyCurve > createTendencyCurveDigital(std::string_view tagChannel, std::string_view descriptionChannel, const iv::time::Timestamp &initInterval, const iv::time::Timestamp &endInterval, uint64_t step, bool isDigital=true)
Definition CTendencyCurve.cpp:27
double m_yMinAnalog
Definition CTendencyCurve.hpp:131
ETendencyCurveType getCurveType() const
Definition CTendencyCurve.cpp:374
CTendencyCurve & operator=(const CTendencyCurve &other)=delete
iv::time::Timestamp getStartTime() const
Definition CTendencyCurve.cpp:344
ETendencyCurveType m_typeTendencyCurve
Definition CTendencyCurve.hpp:126
CTendencyCurve & operator=(CTendencyCurve &&other)=delete
iv::time::Timestamp getEndTime() const
Definition CTendencyCurve.cpp:349
double m_multiplier
Definition CTendencyCurve.hpp:133
std::shared_ptr< std::vector< std::shared_ptr< std::vector< iv::math::geometry::Point2d > > > > generatePlotLines() const
Definition CTendencyCurve.cpp:203
std::string getDescriptionChannel() const
Definition CTendencyCurve.cpp:354
std::string m_strUnit
Definition CTendencyCurve.hpp:136
double getMaxY() const
Definition CTendencyCurve.cpp:369
bool operator==(const CTendencyCurve &b) const
Definition CTendencyCurve.cpp:47
double getMinY() const
Definition CTendencyCurve.cpp:364
void writeClickedTime(IGraphics *graphics, double maxY, double minY, double clickedTime, unsigned char justify, bool multipleCurves, double sizeHeight) const
Definition CTendencyCurve.cpp:287
static std::shared_ptr< std::vector< std::shared_ptr< std::vector< iv::math::geometry::Point2d > > > > prvGenerateSegmentLines(const std::shared_ptr< std::vector< STendencyPoint > > &tendencyPoints, iv::types::timestamp startTime, iv::types::timestamp endTime, double yMin, double yMax)
Definition CTendencyCurve.cpp:380
~CTendencyCurve()
Definition CTendencyCurve.cpp:41
std::vector< std::string > strClickedTime(double clickedPointX) const
Definition CTendencyCurve.cpp:273
CTendencyCurve(const CTendencyCurve &other)=delete
STendencyChannelData * m_tendencyChannelData
Definition CTendencyCurve.hpp:129
Definition IGraphics.hpp:20
Definition Timestamp.hpp:17
static constexpr iv::types::timestamp MillisecondsInSeconds
Definition constants.hpp:35
uint64_t timestamp
Definition types.hpp:21
double height
Definition types.hpp:14
uint32_t color
Definition types.hpp:12
double coord
Definition types.hpp:13
Definition CTendencyCurve.hpp:139
static constexpr iv::types::coord textPrintingVerticalSeparation
Definition CTendencyCurve.hpp:143
static constexpr iv::types::height textSize
Definition CTendencyCurve.hpp:141
static constexpr iv::types::coord textVerticalSeparation
Definition CTendencyCurve.hpp:142
static constexpr iv::types::coord numberSeparation
Definition CTendencyCurve.hpp:144
static constexpr iv::types::timestamp maxTimeBetweenPoints
Definition CTendencyCurve.hpp:140
Definition CTendencyCurve.hpp:43
double m_yMax
Definition CTendencyCurve.hpp:66
STendencyChannelData()=delete
uint64_t m_step
Definition CTendencyCurve.hpp:67
STendencyChannelData(const iv::time::Timestamp &initInterval, const iv::time::Timestamp &endInterval, double yMin, double yMax, uint64_t step)
Definition CTendencyCurve.hpp:46
double m_yMin
Definition CTendencyCurve.hpp:65
~STendencyChannelData()=default
STendencyChannelData(STendencyChannelData &&)=delete
iv::time::Timestamp m_endInterval
Definition CTendencyCurve.hpp:64
std::shared_ptr< std::vector< STendencyPoint > > m_tendencyCurve
Definition CTendencyCurve.hpp:62
STendencyChannelData(const STendencyChannelData &)=delete
iv::time::Timestamp m_initInterval
Definition CTendencyCurve.hpp:63
Definition CTendencyCurve.hpp:22
STendencyPoint(iv::types::timestamp time, double value)
Definition CTendencyCurve.hpp:24
iv::types::timestamp m_time
Definition CTendencyCurve.hpp:38
~STendencyPoint()=default
bool operator==(const STendencyPoint &b) const
Definition CTendencyCurve.hpp:33
double m_value
Definition CTendencyCurve.hpp:39