@@ -1,5 +1,5 | |||||
1 |
#ifndef SCIQLOP_SQP |
|
1 | #ifndef SCIQLOP_SQPRANGE_H | |
2 |
#define SCIQLOP_SQP |
|
2 | #define SCIQLOP_SQPRANGE_H | |
3 |
|
3 | |||
4 | #include <QObject> |
|
4 | #include <QObject> | |
5 |
|
5 | |||
@@ -9,26 +9,26 | |||||
9 | #include <Common/MetaTypes.h> |
|
9 | #include <Common/MetaTypes.h> | |
10 |
|
10 | |||
11 | /** |
|
11 | /** | |
12 |
* @brief The Sqp |
|
12 | * @brief The SqpRange struct holds the information of time parameters | |
13 | */ |
|
13 | */ | |
14 |
struct Sqp |
|
14 | struct SqpRange { | |
15 | /// Start time (UTC) |
|
15 | /// Start time (UTC) | |
16 | double m_TStart; |
|
16 | double m_TStart; | |
17 | /// End time (UTC) |
|
17 | /// End time (UTC) | |
18 | double m_TEnd; |
|
18 | double m_TEnd; | |
19 |
|
19 | |||
20 |
bool contains(const Sqp |
|
20 | bool contains(const SqpRange &dateTime) const noexcept | |
21 | { |
|
21 | { | |
22 | return (m_TStart <= dateTime.m_TStart && m_TEnd >= dateTime.m_TEnd); |
|
22 | return (m_TStart <= dateTime.m_TStart && m_TEnd >= dateTime.m_TEnd); | |
23 | } |
|
23 | } | |
24 |
|
24 | |||
25 |
bool intersect(const Sqp |
|
25 | bool intersect(const SqpRange &dateTime) const noexcept | |
26 | { |
|
26 | { | |
27 | return (m_TEnd >= dateTime.m_TStart && m_TStart <= dateTime.m_TEnd); |
|
27 | return (m_TEnd >= dateTime.m_TStart && m_TStart <= dateTime.m_TEnd); | |
28 | } |
|
28 | } | |
29 | }; |
|
29 | }; | |
30 |
|
30 | |||
31 |
inline QDebug operator<<(QDebug d, Sqp |
|
31 | inline QDebug operator<<(QDebug d, SqpRange obj) | |
32 | { |
|
32 | { | |
33 | auto tendDateTimeStart = DateUtils::dateTime(obj.m_TStart); |
|
33 | auto tendDateTimeStart = DateUtils::dateTime(obj.m_TStart); | |
34 | auto tendDateTimeEnd = DateUtils::dateTime(obj.m_TEnd); |
|
34 | auto tendDateTimeEnd = DateUtils::dateTime(obj.m_TEnd); | |
@@ -38,6 +38,6 inline QDebug operator<<(QDebug d, SqpDateTime obj) | |||||
38 | } |
|
38 | } | |
39 |
|
39 | |||
40 | // Required for using shared_ptr in signals/slots |
|
40 | // Required for using shared_ptr in signals/slots | |
41 |
SCIQLOP_REGISTER_META_TYPE(SQP |
|
41 | SCIQLOP_REGISTER_META_TYPE(SQPRANGE_REGISTRY, SqpRange) | |
42 |
|
42 | |||
43 |
#endif // SCIQLOP_SQP |
|
43 | #endif // SCIQLOP_SQPRANGE_H |
General Comments 0
You need to be logged in to leave comments.
Login now