From dbae8a89423a8c600f20edcba94c0adc99e21de1 2017-06-29 07:12:48 From: mperrinel Date: 2017-06-29 07:12:48 Subject: [PATCH] Add correction for delta T --- diff --git a/app/src/Main.cpp b/app/src/Main.cpp index d8daf09..a27b59a 100644 --- a/app/src/Main.cpp +++ b/app/src/Main.cpp @@ -36,14 +36,6 @@ namespace { const auto PLUGIN_DIRECTORY_NAME = QStringLiteral("plugins"); #endif - -#if __GNUC__ -#if __x86_64__ || __ppc64__ -#define ENVIRONMENT64 -#else -#define ENVIRONMENT32 -#endif -#endif } // namespace int main(int argc, char *argv[]) @@ -70,7 +62,7 @@ int main(int argc, char *argv[]) } #else __x86_64__ || __ppc64__ if (!pluginDir.cd("../lib/SciQlop")) { pluginDir.cd("../lib/sciqlop"); } - #endif +#endif #endif qCDebug(LOG_PluginManager()) << QObject::tr("Plugin directory: %1").arg(pluginDir.absolutePath()); diff --git a/gui/src/Visualization/VisualizationGraphWidget.cpp b/gui/src/Visualization/VisualizationGraphWidget.cpp index e9be9e5..edd5cd3 100644 --- a/gui/src/Visualization/VisualizationGraphWidget.cpp +++ b/gui/src/Visualization/VisualizationGraphWidget.cpp @@ -124,15 +124,18 @@ void VisualizationGraphWidget::onRangeChanged(const QCPRange &t1, const QCPRange if (variable->intersect(dateTime)) { auto variableDateTime = variable->dateTime(); if (variableDateTime.m_TStart < dateTime.m_TStart) { - dateTime.m_TStart = variableDateTime.m_TStart; - // START is set to the old one. tolerance have to be added to the right + + auto diffEndToKeepDelta = dateTime.m_TEnd - variableDateTime.m_TEnd; + dateTime.m_TStart = variableDateTime.m_TStart + diffEndToKeepDelta; + // Tolerance have to be added to the right // add 10% tolerance for right (end) side auto tolerance = 0.1 * (dateTime.m_TEnd - dateTime.m_TStart); variableDateTimeWithTolerance.m_TEnd += tolerance; } if (variableDateTime.m_TEnd > dateTime.m_TEnd) { - dateTime.m_TEnd = variableDateTime.m_TEnd; - // END is set to the old one. tolerance have to be added to the left + auto diffStartToKeepDelta = dateTime.m_TStart - dateTime.m_TStart; + dateTime.m_TEnd = variableDateTime.m_TEnd - diffStartToKeepDelta; + // Tolerance have to be added to the left // add 10% tolerance for left (start) side auto tolerance = 0.1 * (dateTime.m_TEnd - dateTime.m_TStart); variableDateTimeWithTolerance.m_TStart -= tolerance;