##// END OF EJS Templates
Wait for the end of an acquisition to validate an operation (3)...
Wait for the end of an acquisition to validate an operation (3) If an operation is to validate, waits the end of the acquisition

File last commit:

r1223:767abfa514f1
r1248:7541b71e5b78
Show More
SqpRange.h
66 lines | 1.9 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
Completes fuzzing test structure by setting initial range for the time controller
r1209 /// Creates SqpRange from dates and times
static SqpRange fromDateTime(const QDate &startDate, const QTime &startTime,
const QDate &endDate, const QTime &endTime)
{
Alexandre Leroux
Some fixes...
r1223 return {DateUtils::secondsSinceEpoch(QDateTime{startDate, startTime, Qt::UTC}),
DateUtils::secondsSinceEpoch(QDateTime{endDate, endTime, Qt::UTC})};
Alexandre Leroux
Completes fuzzing test structure by setting initial range for the time controller
r1209 }
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