##// END OF EJS Templates
commit processRequest
commit processRequest

File last commit:

r682:d41b2e70981c
r682:d41b2e70981c
Show More
AcquisitionUtils.cpp
27 lines | 1018 B | text/x-c | CppLexer
/ core / src / Data / AcquisitionUtils.cpp
#include "Data/AcquisitionUtils.h"
#include "Data/SqpRange.h"
Q_LOGGING_CATEGORY(LOG_AcquisitionUtils, "AcquisitionUtils")
AcquisitionZoomType AcquisitionUtils::getZoomType(const SqpRange &range, const SqpRange &oldRange)
{
// t1.m_TStart <= t2.m_TStart && t2.m_TEnd <= t1.m_TEnd
auto zoomType = AcquisitionZoomType::Unknown;
if (range.m_TStart <= oldRange.m_TStart && oldRange.m_TEnd <= range.m_TEnd) {
zoomType = AcquisitionZoomType::ZoomOut;
}
else if (range.m_TStart > oldRange.m_TStart && range.m_TEnd > oldRange.m_TEnd) {
zoomType = AcquisitionZoomType::PanRight;
}
else if (range.m_TStart < oldRange.m_TStart && range.m_TEnd < oldRange.m_TEnd) {
zoomType = AcquisitionZoomType::PanLeft;
}
else if (range.m_TStart > oldRange.m_TStart && oldRange.m_TEnd > range.m_TEnd) {
zoomType = AcquisitionZoomType::ZoomIn;
}
else {
qCCritical(LOG_AcquisitionUtils()) << "getZoomType: Unknown type detected";
}
return zoomType;
}