##// END OF EJS Templates
Disables TestVariableSync
Disables TestVariableSync

File last commit:

r660:e4c0228e8d67
r890:447f2dd17d69
Show More
SqpRange.h
58 lines | 1.5 KiB | text/x-c | CLexer
Remplacement de SqpDateTime part SqpRange
r511 #ifndef SCIQLOP_SQPRANGE_H
#define SCIQLOP_SQPRANGE_H
Add SqpDateTime struct
r191
SqpDateTime is now declared as meta type
r234 #include <QObject>
Add qdebug operator for SqpDateTime to enable its display in a log
r296
#include <QDebug>
Alexandre Leroux
Uses DateUtils
r488 #include <Common/DateUtils.h>
Alexandre Leroux
Centralization of qregistermetatype management
r308 #include <Common/MetaTypes.h>
Alexandre Leroux
Fixes Linux compilation
r660 #include <cmath>
Add SqpDateTime struct
r191 /**
Remplacement de SqpDateTime part SqpRange
r511 * @brief The SqpRange struct holds the information of time parameters
Add SqpDateTime struct
r191 */
Remplacement de SqpDateTime part SqpRange
r511 struct SqpRange {
Alexandre Leroux
Some fixes...
r491 /// Start time (UTC)
Add SqpDateTime struct
r191 double m_TStart;
Alexandre Leroux
Some fixes...
r491 /// End time (UTC)
Add SqpDateTime struct
r191 double m_TEnd;
A variable is now created with its dateTime too....
r228
Remplacement de SqpDateTime part SqpRange
r511 bool contains(const SqpRange &dateTime) const noexcept
A variable is now created with its dateTime too....
r228 {
return (m_TStart <= dateTime.m_TStart && m_TEnd >= dateTime.m_TEnd);
}
Add intersect méthode on variable and sqpDateTime...
r258
Remplacement de SqpDateTime part SqpRange
r511 bool intersect(const SqpRange &dateTime) const noexcept
Add intersect méthode on variable and sqpDateTime...
r258 {
return (m_TEnd >= dateTime.m_TStart && m_TStart <= dateTime.m_TEnd);
}
Alexandre Leroux
Fixed untimely update of the range to be displayed in the variable widget
r654
bool operator==(const SqpRange &other) const
{
auto equals = [](const auto &v1, const auto &v2) {
return (std::isnan(v1) && std::isnan(v2)) || v1 == v2;
};
return equals(m_TStart, other.m_TStart) && equals(m_TEnd, other.m_TEnd);
}
bool operator!=(const SqpRange &other) const { return !(*this == other); }
Add SqpDateTime struct
r191 };
Alexandre Leroux
Fixed untimely update of the range to be displayed in the variable widget
r654 const auto INVALID_RANGE
= SqpRange{std::numeric_limits<double>::quiet_NaN(), std::numeric_limits<double>::quiet_NaN()};
Remplacement de SqpDateTime part SqpRange
r511 inline QDebug operator<<(QDebug d, SqpRange obj)
Add qdebug operator for SqpDateTime to enable its display in a log
r296 {
Alexandre Leroux
Uses DateUtils
r488 auto tendDateTimeStart = DateUtils::dateTime(obj.m_TStart);
auto tendDateTimeEnd = DateUtils::dateTime(obj.m_TEnd);
Add qdebug operator for SqpDateTime to enable its display in a log
r296
d << "ts: " << tendDateTimeStart << " te: " << tendDateTimeEnd;
return d;
}
SqpDateTime is now declared as meta type
r234 // Required for using shared_ptr in signals/slots
Remplacement de SqpDateTime part SqpRange
r511 SCIQLOP_REGISTER_META_TYPE(SQPRANGE_REGISTRY, SqpRange)
SqpDateTime is now declared as meta type
r234
Remplacement de SqpDateTime part SqpRange
r511 #endif // SCIQLOP_SQPRANGE_H