#12927 Add optional time threshold before creating ESMRY

When checking timestamp for ESMRY vs SMSPEC, allow ESMRY to be written before SMSPEC within a given limit in time difference.
This commit is contained in:
Magne Sjaastad committed 2025-10-13 14:35:42 +02:00
1 parent 31088c0ec7
commit 24ca039790
6 files changed
+47 -10

No files matched your search

@@ -20,6 +20,7 @@
#include "RiaFilePathTools.h"
#include "RiaLogging.h"
#include "RiaPreferencesSummary.h"
#ifdef _MSC_VER
// Disable warning from external library to make sure treat warnings as error works
@@ -28,9 +29,9 @@
#include "opm/io/eclipse/ESmry.hpp"
#include "opm/io/eclipse/ExtESmry.hpp"
#include "QRegularExpression"
#include <QFile>
#include <QFileInfo>
#include <QRegularExpression>
//--------------------------------------------------------------------------------------------------
///
@@ -181,7 +182,8 @@ bool RifOpmSummaryTools::isEsmryConversionRequired( const QString& fileName )
return true;
}
if ( RiaFilePathTools::isFirstOlderThanSecond( candidateEsmryFileName.toStdString(), smspecFileName.toStdString() ) )
const int timeThresholdInSeconds = RiaPreferencesSummary::current()->esmryTimeThreshold();
if ( RiaFilePathTools::isFirstOlderThanSecond( candidateEsmryFileName.toStdString(), smspecFileName.toStdString(), timeThresholdInSeconds ) )
{
QString root = QFileInfo( smspecFileName ).canonicalPath();