mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix several deprecation warnings (#8657)
* Use constructor instead of nullptr for WindowFlags * Use constructor instead of nullptr for Alignment * Disable deprecation warning for QProcess * Add string split method to RaTextStringTools * Add caf.cpp used to manage Qt function deprecations * Use position()
This commit is contained in:
parent
72fc47e003
commit
806a149809
@ -23,6 +23,10 @@
|
|||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
|
|
||||||
|
// Disable deprecation warning for QProcess::start()
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning( disable : 4996 )
|
||||||
|
#endif
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -19,6 +19,11 @@
|
|||||||
#include "RiaImageFileCompare.h"
|
#include "RiaImageFileCompare.h"
|
||||||
#include <QtCore/QProcess>
|
#include <QtCore/QProcess>
|
||||||
|
|
||||||
|
// Disable deprecation warning for QProcess::start()
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning( disable : 4996 )
|
||||||
|
#endif
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
@ -210,6 +210,18 @@ QDateTime RiaQDateTimeTools::subtractPeriod( const QDateTime& dt, RiaQDateTimeTo
|
|||||||
return subtractSpan( dt, timeSpan( period ) );
|
return subtractSpan( dt, timeSpan( period ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QDateTime RiaQDateTimeTools::createDateTime( const QDate& date )
|
||||||
|
{
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK( 5, 14, 0 )
|
||||||
|
return date.startOfDay();
|
||||||
|
#else
|
||||||
|
return QDateTime( date, QTime( 0, 0 ) );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -239,7 +251,7 @@ QDateTime RiaQDateTimeTools::createUtcDateTime()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QDateTime RiaQDateTimeTools::createUtcDateTime( const QDate& date )
|
QDateTime RiaQDateTimeTools::createUtcDateTime( const QDate& date )
|
||||||
{
|
{
|
||||||
auto qdt = QDateTime( date );
|
auto qdt = createDateTime( date );
|
||||||
qdt.setTimeSpec( currentTimeSpec() );
|
qdt.setTimeSpec( currentTimeSpec() );
|
||||||
return qdt;
|
return qdt;
|
||||||
}
|
}
|
||||||
|
@ -97,6 +97,8 @@ public:
|
|||||||
static QDateTime addPeriod( const QDateTime& dt, RiaQDateTimeTools::DateTimePeriod period );
|
static QDateTime addPeriod( const QDateTime& dt, RiaQDateTimeTools::DateTimePeriod period );
|
||||||
static QDateTime subtractPeriod( const QDateTime& dt, RiaQDateTimeTools::DateTimePeriod period );
|
static QDateTime subtractPeriod( const QDateTime& dt, RiaQDateTimeTools::DateTimePeriod period );
|
||||||
|
|
||||||
|
static QDateTime createDateTime( const QDate& date );
|
||||||
|
|
||||||
static QDateTime epoch();
|
static QDateTime epoch();
|
||||||
|
|
||||||
static QDateTime createUtcDateTime();
|
static QDateTime createUtcDateTime();
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include "RiaProjectModifier.h"
|
#include "RiaProjectModifier.h"
|
||||||
#include "RiaRegressionTest.h"
|
#include "RiaRegressionTest.h"
|
||||||
#include "RiaTextFileCompare.h"
|
#include "RiaTextFileCompare.h"
|
||||||
|
#include "RiaTextStringTools.h"
|
||||||
|
|
||||||
#include "RicfCommandFileExecutor.h"
|
#include "RicfCommandFileExecutor.h"
|
||||||
|
|
||||||
@ -538,7 +539,7 @@ QString RiaRegressionTestRunner::diff2htmlHeaderText( const QString& testRootPat
|
|||||||
QString html;
|
QString html;
|
||||||
|
|
||||||
QString oldProjPath = QDir::fromNativeSeparators( testRootPath );
|
QString oldProjPath = QDir::fromNativeSeparators( testRootPath );
|
||||||
QStringList pathFolders = oldProjPath.split( "/", QString::KeepEmptyParts );
|
QStringList pathFolders = oldProjPath.split( "/" );
|
||||||
|
|
||||||
QString path;
|
QString path;
|
||||||
for ( const auto& f : pathFolders )
|
for ( const auto& f : pathFolders )
|
||||||
@ -611,7 +612,7 @@ void RiaRegressionTestRunner::executeRegressionTests()
|
|||||||
testConfig.readSettingsFromApplicationStore();
|
testConfig.readSettingsFromApplicationStore();
|
||||||
|
|
||||||
QString testPath = testConfig.regressionTestFolder();
|
QString testPath = testConfig.regressionTestFolder();
|
||||||
QStringList testFilter = testConfig.testFilter().split( ";", QString::SkipEmptyParts );
|
QStringList testFilter = RiaTextStringTools::splitSkipEmptyParts( testConfig.testFilter(), ";" );
|
||||||
|
|
||||||
if ( testConfig.appendTestsAfterTestFilter )
|
if ( testConfig.appendTestsAfterTestFilter )
|
||||||
{
|
{
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include "RiaLogging.h"
|
#include "RiaLogging.h"
|
||||||
#include "RiaStdStringTools.h"
|
#include "RiaStdStringTools.h"
|
||||||
#include "RiaSummaryTools.h"
|
#include "RiaSummaryTools.h"
|
||||||
|
#include "RiaTextStringTools.h"
|
||||||
|
|
||||||
#include "RifEclipseSummaryAddress.h"
|
#include "RifEclipseSummaryAddress.h"
|
||||||
#include "RifReaderEclipseSummary.h"
|
#include "RifReaderEclipseSummary.h"
|
||||||
@ -217,9 +218,7 @@ std::pair<std::vector<RimSummaryCase*>, std::vector<RimSummaryCaseCollection*>>
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QStringList RiaSummaryStringTools::splitIntoWords( const QString& text )
|
QStringList RiaSummaryStringTools::splitIntoWords( const QString& text )
|
||||||
{
|
{
|
||||||
QStringList words = text.split( QRegExp( "\\s+" ), QString::SkipEmptyParts );
|
return RiaTextStringTools::splitSkipEmptyParts( text, QRegExp( "\\s+" ) );
|
||||||
|
|
||||||
return words;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -22,6 +22,11 @@
|
|||||||
|
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
|
|
||||||
|
// Disable deprecation warning for QProcess::start()
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning( disable : 4996 )
|
||||||
|
#endif
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -127,3 +127,27 @@ QString RiaTextStringTools::trimNonAlphaNumericCharacters( const QString& s )
|
|||||||
trimmedString.replace( trimRe, "" );
|
trimmedString.replace( trimRe, "" );
|
||||||
return trimmedString;
|
return trimmedString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QStringList RiaTextStringTools::splitSkipEmptyParts( const QString& text, const QString& sep /*= " " */ )
|
||||||
|
{
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK( 5, 14, 0 )
|
||||||
|
return text.split( sep, Qt::SkipEmptyParts, Qt::CaseInsensitive );
|
||||||
|
#else
|
||||||
|
return text.split( sep, QString::SkipEmptyParts, Qt::CaseInsensitive );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QStringList RiaTextStringTools::splitSkipEmptyParts( const QString& text, const QRegExp& regExp )
|
||||||
|
{
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK( 5, 14, 0 )
|
||||||
|
return text.split( regExp, Qt::SkipEmptyParts );
|
||||||
|
#else
|
||||||
|
return text.split( regExp, QString::SkipEmptyParts );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
@ -18,7 +18,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
class QString;
|
#include <QString>
|
||||||
|
|
||||||
class QStringList;
|
class QStringList;
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -31,4 +32,8 @@ QString trimAndRemoveDoubleSpaces( const QString& s );
|
|||||||
QString commonRoot( const QStringList& stringList );
|
QString commonRoot( const QStringList& stringList );
|
||||||
QString commonSuffix( const QStringList& stringList );
|
QString commonSuffix( const QStringList& stringList );
|
||||||
QString trimNonAlphaNumericCharacters( const QString& s );
|
QString trimNonAlphaNumericCharacters( const QString& s );
|
||||||
|
|
||||||
|
QStringList splitSkipEmptyParts( const QString& text, const QString& sep = " " );
|
||||||
|
QStringList splitSkipEmptyParts( const QString& text, const QRegExp& regExp );
|
||||||
|
|
||||||
} // namespace RiaTextStringTools
|
} // namespace RiaTextStringTools
|
||||||
|
@ -85,7 +85,7 @@ std::vector<RimStimPlanFractureTemplate*> RicNewStimPlanFractureTemplateFeature:
|
|||||||
defaultDir,
|
defaultDir,
|
||||||
"StimPlan XML File (*.xml);;All files(*.*)" );
|
"StimPlan XML File (*.xml);;All files(*.*)" );
|
||||||
|
|
||||||
auto templates = createNewTemplatesFromFiles( fileNames.toVector().toStdVector() );
|
auto templates = createNewTemplatesFromFiles( std::vector<QString>( fileNames.begin(), fileNames.end() ) );
|
||||||
|
|
||||||
if ( !fileNames.isEmpty() )
|
if ( !fileNames.isEmpty() )
|
||||||
{
|
{
|
||||||
|
@ -84,7 +84,8 @@ void RicCreateEnsembleSurfaceFeature::openDialogAndExecuteCommand()
|
|||||||
|
|
||||||
if ( propertyDialog.exec() == QDialog::Accepted )
|
if ( propertyDialog.exec() == QDialog::Accepted )
|
||||||
{
|
{
|
||||||
executeCommand( *ui, result.files.toVector().toStdVector() );
|
auto stdVector = std::vector<QString>( result.files.begin(), result.files.end() );
|
||||||
|
executeCommand( *ui, stdVector );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,7 +106,8 @@ void RicCreateEnsembleWellLogFeature::openDialogAndExecuteCommand()
|
|||||||
|
|
||||||
if ( propertyDialog.exec() == QDialog::Accepted && !ui->properties().empty() )
|
if ( propertyDialog.exec() == QDialog::Accepted && !ui->properties().empty() )
|
||||||
{
|
{
|
||||||
executeCommand( *ui, result.files.toStdList() );
|
auto stdList = std::list<QString>( result.files.begin(), result.files.end() );
|
||||||
|
executeCommand( *ui, stdList );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include "RiaColorTables.h"
|
#include "RiaColorTables.h"
|
||||||
#include "RiaGuiApplication.h"
|
#include "RiaGuiApplication.h"
|
||||||
#include "RiaPreferencesSummary.h"
|
#include "RiaPreferencesSummary.h"
|
||||||
|
#include "RiaTextStringTools.h"
|
||||||
|
|
||||||
#include "RiaSummaryTools.h"
|
#include "RiaSummaryTools.h"
|
||||||
#include "RimEnsembleCurveFilter.h"
|
#include "RimEnsembleCurveFilter.h"
|
||||||
@ -62,7 +63,7 @@ std::vector<RimEnsembleCurveSet*>
|
|||||||
RiaPreferencesSummary* prefs = RiaPreferencesSummary::current();
|
RiaPreferencesSummary* prefs = RiaPreferencesSummary::current();
|
||||||
|
|
||||||
QString curvesTextFilter = prefs->defaultSummaryCurvesTextFilter();
|
QString curvesTextFilter = prefs->defaultSummaryCurvesTextFilter();
|
||||||
QStringList curveFilters = curvesTextFilter.split( ";", QString::SkipEmptyParts );
|
QStringList curveFilters = RiaTextStringTools::splitSkipEmptyParts( curvesTextFilter, ";" );
|
||||||
|
|
||||||
std::set<RifEclipseSummaryAddress> addrs = ensemble->ensembleSummaryAddresses();
|
std::set<RifEclipseSummaryAddress> addrs = ensemble->ensembleSummaryAddresses();
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include "RicPasteAsciiDataToSummaryPlotFeatureUi.h"
|
#include "RicPasteAsciiDataToSummaryPlotFeatureUi.h"
|
||||||
|
|
||||||
|
#include "RiaTextStringTools.h"
|
||||||
#include "RifCsvUserDataParser.h"
|
#include "RifCsvUserDataParser.h"
|
||||||
|
|
||||||
#include "cafPdmUiItem.h"
|
#include "cafPdmUiItem.h"
|
||||||
@ -329,7 +330,7 @@ RicPasteAsciiDataToSummaryPlotFeatureUi::DateFormat
|
|||||||
std::vector<int> values;
|
std::vector<int> values;
|
||||||
|
|
||||||
{
|
{
|
||||||
QStringList split = dateString.split( ".", QString::SkipEmptyParts );
|
QStringList split = RiaTextStringTools::splitSkipEmptyParts( dateString, "." );
|
||||||
if ( split.size() == 3 )
|
if ( split.size() == 3 )
|
||||||
{
|
{
|
||||||
values.push_back( split.at( 0 ).toInt() );
|
values.push_back( split.at( 0 ).toInt() );
|
||||||
@ -342,7 +343,7 @@ RicPasteAsciiDataToSummaryPlotFeatureUi::DateFormat
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
QStringList split = dateString.split( "-", QString::SkipEmptyParts );
|
QStringList split = RiaTextStringTools::splitSkipEmptyParts( dateString, "-" );
|
||||||
if ( split.size() == 3 )
|
if ( split.size() == 3 )
|
||||||
{
|
{
|
||||||
values.push_back( split.at( 0 ).toInt() );
|
values.push_back( split.at( 0 ).toInt() );
|
||||||
@ -355,7 +356,7 @@ RicPasteAsciiDataToSummaryPlotFeatureUi::DateFormat
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
QStringList split = dateString.split( "/", QString::SkipEmptyParts );
|
QStringList split = RiaTextStringTools::splitSkipEmptyParts( dateString, "/" );
|
||||||
if ( split.size() == 3 )
|
if ( split.size() == 3 )
|
||||||
{
|
{
|
||||||
values.push_back( split.at( 0 ).toInt() );
|
values.push_back( split.at( 0 ).toInt() );
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include "RiaLogging.h"
|
#include "RiaLogging.h"
|
||||||
#include "RiaPreferencesSummary.h"
|
#include "RiaPreferencesSummary.h"
|
||||||
#include "RiaSummaryStringTools.h"
|
#include "RiaSummaryStringTools.h"
|
||||||
|
#include "RiaTextStringTools.h"
|
||||||
|
|
||||||
#include "RicCreateSummaryCaseCollectionFeature.h"
|
#include "RicCreateSummaryCaseCollectionFeature.h"
|
||||||
#include "RicImportGeneralDataFeature.h"
|
#include "RicImportGeneralDataFeature.h"
|
||||||
@ -70,7 +71,7 @@ std::vector<RimSummaryCurve*> RicSummaryPlotFeatureImpl::addDefaultCurvesToPlot(
|
|||||||
RiaPreferencesSummary* prefs = RiaPreferencesSummary::current();
|
RiaPreferencesSummary* prefs = RiaPreferencesSummary::current();
|
||||||
|
|
||||||
QString curvesTextFilter = prefs->defaultSummaryCurvesTextFilter();
|
QString curvesTextFilter = prefs->defaultSummaryCurvesTextFilter();
|
||||||
QStringList curveFilters = curvesTextFilter.split( ";", QString::SkipEmptyParts );
|
QStringList curveFilters = RiaTextStringTools::splitSkipEmptyParts( curvesTextFilter, ";" );
|
||||||
|
|
||||||
bool addHistoryCurve = false;
|
bool addHistoryCurve = false;
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
#include "RicAppendPointsToPolygonFilterFeature.h"
|
#include "RicAppendPointsToPolygonFilterFeature.h"
|
||||||
|
|
||||||
CAF_CMD_SOURCE_INIT( RicAppendPointsToPolygonFilterFeature, "RicAppendPointsToPolygonFilterFeature" );
|
#include "RiaTextStringTools.h"
|
||||||
|
|
||||||
#include "RimPolygonFilter.h"
|
#include "RimPolygonFilter.h"
|
||||||
#include "RimPolylineTarget.h"
|
#include "RimPolylineTarget.h"
|
||||||
@ -30,6 +30,8 @@ CAF_CMD_SOURCE_INIT( RicAppendPointsToPolygonFilterFeature, "RicAppendPointsToPo
|
|||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
|
|
||||||
|
CAF_CMD_SOURCE_INIT( RicAppendPointsToPolygonFilterFeature, "RicAppendPointsToPolygonFilterFeature" );
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -62,7 +64,7 @@ void RicAppendPointsToPolygonFilterFeature::onActionTriggered( bool isChecked )
|
|||||||
if ( clipboard )
|
if ( clipboard )
|
||||||
{
|
{
|
||||||
QString content = clipboard->text();
|
QString content = clipboard->text();
|
||||||
listOfThreeDoubles = content.split( "\n", QString::SkipEmptyParts );
|
listOfThreeDoubles = RiaTextStringTools::splitSkipEmptyParts( content, "\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<cvf::Vec3d> points;
|
std::vector<cvf::Vec3d> points;
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include "RifColorLegendData.h"
|
#include "RifColorLegendData.h"
|
||||||
|
|
||||||
|
#include "RiaTextStringTools.h"
|
||||||
#include "RigFormationNames.h"
|
#include "RigFormationNames.h"
|
||||||
|
|
||||||
#include "cafAssert.h"
|
#include "cafAssert.h"
|
||||||
@ -66,7 +67,7 @@ cvf::ref<RigFormationNames> RifColorLegendData::readLyrFormationNameFile( const
|
|||||||
while ( !stream.atEnd() )
|
while ( !stream.atEnd() )
|
||||||
{
|
{
|
||||||
QString line = stream.readLine();
|
QString line = stream.readLine();
|
||||||
QStringList lineSegs = line.split( "'", QString::KeepEmptyParts );
|
QStringList lineSegs = line.split( "'" );
|
||||||
|
|
||||||
if ( lineSegs.size() == 0 ) continue; // Empty line
|
if ( lineSegs.size() == 0 ) continue; // Empty line
|
||||||
if ( lineSegs.size() == 1 ) continue; // No name present. Comment line ?
|
if ( lineSegs.size() == 1 ) continue; // No name present. Comment line ?
|
||||||
@ -84,16 +85,14 @@ cvf::ref<RigFormationNames> RifColorLegendData::readLyrFormationNameFile( const
|
|||||||
QString numberString = lineSegs[2];
|
QString numberString = lineSegs[2];
|
||||||
if ( commentMarkPos >= 0 ) numberString.truncate( commentMarkPos );
|
if ( commentMarkPos >= 0 ) numberString.truncate( commentMarkPos );
|
||||||
|
|
||||||
QString colorWord = numberString.split( " ", QString::SkipEmptyParts ).last(); // extract last word which may
|
// extract last word which may contain formation color
|
||||||
// contain formation color
|
QString colorWord = RiaTextStringTools::splitSkipEmptyParts( numberString ).last();
|
||||||
|
|
||||||
if ( QColor::isValidColor( colorWord ) )
|
if ( QColor::isValidColor( colorWord ) )
|
||||||
numberString.remove( colorWord ); // remove color if present as last word on line
|
numberString.remove( colorWord ); // remove color if present as last word on line
|
||||||
|
|
||||||
QStringList numberWords = numberString.split( QRegExp( "-" ), QString::SkipEmptyParts ); // extract words
|
// extract words containing formation number(s)
|
||||||
// containing
|
QStringList numberWords = RiaTextStringTools::splitSkipEmptyParts( numberString, QRegExp( "-" ) );
|
||||||
// formation
|
|
||||||
// number(s)
|
|
||||||
|
|
||||||
if ( numberWords.size() == 2 ) // formation range with or without color at end of line
|
if ( numberWords.size() == 2 ) // formation range with or without color at end of line
|
||||||
{
|
{
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
#include "RiaDateStringParser.h"
|
#include "RiaDateStringParser.h"
|
||||||
#include "RiaLogging.h"
|
#include "RiaLogging.h"
|
||||||
|
#include "RiaTextStringTools.h"
|
||||||
|
|
||||||
#include "cvfAssert.h"
|
#include "cvfAssert.h"
|
||||||
|
|
||||||
@ -116,7 +117,7 @@ void RifColumnBasedUserDataParser::parseTableData( const QString& data )
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
QString qLine = QString::fromStdString( line );
|
QString qLine = QString::fromStdString( line );
|
||||||
QStringList entries = qLine.split( " ", QString::SkipEmptyParts );
|
QStringList entries = RiaTextStringTools::splitSkipEmptyParts( qLine );
|
||||||
|
|
||||||
if ( stepTypeIndex > -1 && (unsigned int)entries.size() < columnInfos.size() )
|
if ( stepTypeIndex > -1 && (unsigned int)entries.size() < columnInfos.size() )
|
||||||
{
|
{
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
#include "SummaryPlotCommands/RicPasteAsciiDataToSummaryPlotFeatureUi.h"
|
#include "SummaryPlotCommands/RicPasteAsciiDataToSummaryPlotFeatureUi.h"
|
||||||
|
|
||||||
|
#include "caf.h"
|
||||||
#include "cvfAssert.h"
|
#include "cvfAssert.h"
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
@ -733,7 +734,7 @@ QLocale RifCsvUserDataParser::localeFromDecimalSeparator( const QString& decimal
|
|||||||
{
|
{
|
||||||
if ( decimalSeparator == "," )
|
if ( decimalSeparator == "," )
|
||||||
{
|
{
|
||||||
return QLocale::Norwegian;
|
return caf::norwegianLocale();
|
||||||
}
|
}
|
||||||
return QLocale::c();
|
return QLocale::c();
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
|
||||||
|
#include "RiaTextStringTools.h"
|
||||||
#include "ert/ecl/ecl_box.hpp"
|
#include "ert/ecl/ecl_box.hpp"
|
||||||
#include "ert/ecl/ecl_grid.hpp"
|
#include "ert/ecl/ecl_grid.hpp"
|
||||||
#include "ert/ecl/ecl_kw.h"
|
#include "ert/ecl/ecl_kw.h"
|
||||||
@ -813,7 +814,7 @@ void RifEclipseInputFileTools::parseAndReadPathAliasKeyword( const QString&
|
|||||||
// definition; 'I+'
|
// definition; 'I+'
|
||||||
line.remove( "'" );
|
line.remove( "'" );
|
||||||
|
|
||||||
QStringList entries = line.split( " ", QString::SkipEmptyParts );
|
QStringList entries = RiaTextStringTools::splitSkipEmptyParts( line );
|
||||||
if ( entries.size() < 2 )
|
if ( entries.size() < 2 )
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
@ -673,7 +673,7 @@ void RifEclipseOutputFileTools::createReportStepsMetaData( std::vector<ecl_file_
|
|||||||
|
|
||||||
// Set Date
|
// Set Date
|
||||||
{
|
{
|
||||||
QDateTime reportDateTime(
|
QDateTime reportDateTime = RiaQDateTimeTools::createDateTime(
|
||||||
QDate( restart_header->year, restart_header->month, restart_header->day ) );
|
QDate( restart_header->year, restart_header->month, restart_header->day ) );
|
||||||
reportStep.dateTime = reportDateTime;
|
reportStep.dateTime = reportDateTime;
|
||||||
}
|
}
|
||||||
|
@ -18,11 +18,10 @@
|
|||||||
|
|
||||||
#include "RifEnsembleFractureStatisticsExporter.h"
|
#include "RifEnsembleFractureStatisticsExporter.h"
|
||||||
|
|
||||||
// #include "RiaEclipseUnitTools.h"
|
|
||||||
|
|
||||||
// #include "RimStimPlanModel.h"
|
|
||||||
#include "RiaDefines.h"
|
#include "RiaDefines.h"
|
||||||
#include "RigSlice2D.h"
|
#include "RigSlice2D.h"
|
||||||
|
|
||||||
|
#include "caf.h"
|
||||||
#include "cafAssert.h"
|
#include "cafAssert.h"
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
@ -61,7 +60,7 @@ bool RifEnsembleFractureStatisticsExporter::writeAsStimPlanXml( const std::vecto
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RifEnsembleFractureStatisticsExporter::appendHeaderToStream( QTextStream& stream )
|
void RifEnsembleFractureStatisticsExporter::appendHeaderToStream( QTextStream& stream )
|
||||||
{
|
{
|
||||||
stream << "<?xml version=\"1.0\" ?>" << endl << "<contours>" << endl;
|
stream << "<?xml version=\"1.0\" ?>" << caf::endl << "<contours>" << caf::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -76,15 +75,15 @@ void RifEnsembleFractureStatisticsExporter::appendPropertiesToStream(
|
|||||||
{
|
{
|
||||||
CAF_ASSERT( statistics.size() == properties.size() );
|
CAF_ASSERT( statistics.size() == properties.size() );
|
||||||
|
|
||||||
stream << "<properties>" << endl;
|
stream << "<properties>" << caf::endl;
|
||||||
|
|
||||||
for ( size_t s = 0; s < statistics.size(); s++ )
|
for ( size_t s = 0; s < statistics.size(); s++ )
|
||||||
{
|
{
|
||||||
QString propertyName = properties[s].first;
|
QString propertyName = properties[s].first;
|
||||||
QString propertyUnit = properties[s].second;
|
QString propertyUnit = properties[s].second;
|
||||||
|
|
||||||
stream << QString( "<property name=\"%1\" uom=\"%2\">" ).arg( propertyName ).arg( propertyUnit ) << endl;
|
stream << QString( "<property name=\"%1\" uom=\"%2\">" ).arg( propertyName ).arg( propertyUnit ) << caf::endl;
|
||||||
stream << QString( "<time value=\"%1\">" ).arg( time ) << endl;
|
stream << QString( "<time value=\"%1\">" ).arg( time ) << caf::endl;
|
||||||
|
|
||||||
CAF_ASSERT( statistics[s]->ny() == gridYs.size() );
|
CAF_ASSERT( statistics[s]->ny() == gridYs.size() );
|
||||||
|
|
||||||
@ -92,19 +91,19 @@ void RifEnsembleFractureStatisticsExporter::appendPropertiesToStream(
|
|||||||
// in the reader (depths from <grid><ys> are used).
|
// in the reader (depths from <grid><ys> are used).
|
||||||
for ( int i = static_cast<int>( gridYs.size() ) - 1; i >= 0; i-- )
|
for ( int i = static_cast<int>( gridYs.size() ) - 1; i >= 0; i-- )
|
||||||
{
|
{
|
||||||
stream << "<depth>" << gridYs[i] << "</depth>" << endl;
|
stream << "<depth>" << gridYs[i] << "</depth>" << caf::endl;
|
||||||
stream << "<data>[";
|
stream << "<data>[";
|
||||||
for ( size_t x = 0; x < statistics[s]->nx(); x++ )
|
for ( size_t x = 0; x < statistics[s]->nx(); x++ )
|
||||||
{
|
{
|
||||||
stream << statistics[s]->getValue( x, i ) << " ";
|
stream << statistics[s]->getValue( x, i ) << " ";
|
||||||
}
|
}
|
||||||
stream << "]</data>" << endl;
|
stream << "]</data>" << caf::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
stream << "</time>" << endl;
|
stream << "</time>" << caf::endl;
|
||||||
stream << "</property>" << endl;
|
stream << "</property>" << caf::endl;
|
||||||
}
|
}
|
||||||
stream << "</properties>" << endl;
|
stream << "</properties>" << caf::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -116,7 +115,7 @@ void RifEnsembleFractureStatisticsExporter::appendOrientationToStream( QTextStre
|
|||||||
if ( orientation != RigStimPlanFractureDefinition::Orientation::UNDEFINED )
|
if ( orientation != RigStimPlanFractureDefinition::Orientation::UNDEFINED )
|
||||||
{
|
{
|
||||||
QString orientationString = getStringForOrientation( orientation );
|
QString orientationString = getStringForOrientation( orientation );
|
||||||
stream << QString( "<orientation>%1</orientation>" ).arg( orientationString ) << endl;
|
stream << QString( "<orientation>%1</orientation>" ).arg( orientationString ) << caf::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,19 +129,19 @@ void RifEnsembleFractureStatisticsExporter::appendGridDimensionsToStream( QTextS
|
|||||||
{
|
{
|
||||||
QString unitString = getStringForUnitSystem( unitSystem );
|
QString unitString = getStringForUnitSystem( unitSystem );
|
||||||
stream << QString( "<grid xCount=\"%1\" yCount=\"%2\" uom=\"%3\">" ).arg( gridXs.size() ).arg( gridYs.size() ).arg( unitString )
|
stream << QString( "<grid xCount=\"%1\" yCount=\"%2\" uom=\"%3\">" ).arg( gridXs.size() ).arg( gridYs.size() ).arg( unitString )
|
||||||
<< endl;
|
<< caf::endl;
|
||||||
|
|
||||||
stream << "<xs>[";
|
stream << "<xs>[";
|
||||||
for ( auto x : gridXs )
|
for ( auto x : gridXs )
|
||||||
stream << x << " ";
|
stream << x << " ";
|
||||||
stream << "]</xs>" << endl;
|
stream << "]</xs>" << caf::endl;
|
||||||
|
|
||||||
stream << "<ys>[";
|
stream << "<ys>[";
|
||||||
for ( auto y : gridYs )
|
for ( auto y : gridYs )
|
||||||
stream << y << " ";
|
stream << y << " ";
|
||||||
stream << "]</ys>" << endl;
|
stream << "]</ys>" << caf::endl;
|
||||||
|
|
||||||
stream << "</grid>" << endl;
|
stream << "</grid>" << caf::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -150,7 +149,7 @@ void RifEnsembleFractureStatisticsExporter::appendGridDimensionsToStream( QTextS
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RifEnsembleFractureStatisticsExporter::appendFooterToStream( QTextStream& stream )
|
void RifEnsembleFractureStatisticsExporter::appendFooterToStream( QTextStream& stream )
|
||||||
{
|
{
|
||||||
stream << "</contours>" << endl;
|
stream << "</contours>" << caf::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
#include "RimGenericParameter.h"
|
#include "RimGenericParameter.h"
|
||||||
#include "RimParameterGroup.h"
|
#include "RimParameterGroup.h"
|
||||||
|
|
||||||
|
#include "caf.h"
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
|
||||||
@ -40,12 +42,12 @@ bool RifFaultRAJSonWriter::writeToPreprocFile( RimFaultRAPreprocSettings& settin
|
|||||||
{
|
{
|
||||||
QTextStream stream( &file );
|
QTextStream stream( &file );
|
||||||
|
|
||||||
stream << "{" << endl;
|
stream << "{" << caf::endl;
|
||||||
stream << "\"odb_path\": \"" + settings.geomechCaseFilename() + "\"," << endl;
|
stream << "\"odb_path\": \"" + settings.geomechCaseFilename() + "\"," << caf::endl;
|
||||||
stream << "\"time_start\": \"" + settings.startTimeStepGeoMech() + "\"," << endl;
|
stream << "\"time_start\": \"" + settings.startTimeStepGeoMech() + "\"," << caf::endl;
|
||||||
stream << "\"time_end\": \"" + settings.endTimeStepGeoMech() + "\"," << endl;
|
stream << "\"time_end\": \"" + settings.endTimeStepGeoMech() + "\"," << caf::endl;
|
||||||
stream << "\"out_path\": \"" + settings.outputAbaqusDirectory() + "\"" << endl;
|
stream << "\"out_path\": \"" + settings.outputAbaqusDirectory() + "\"" << caf::endl;
|
||||||
stream << "}" << endl;
|
stream << "}" << caf::endl;
|
||||||
|
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
@ -73,26 +75,26 @@ bool RifFaultRAJSonWriter::writeToPostprocFile( int faultID, RimFaultRAPostprocS
|
|||||||
{
|
{
|
||||||
QTextStream stream( &file );
|
QTextStream stream( &file );
|
||||||
|
|
||||||
stream << "{" << endl;
|
stream << "{" << caf::endl;
|
||||||
|
|
||||||
if ( settings->geomechEnabled() )
|
if ( settings->geomechEnabled() )
|
||||||
{
|
{
|
||||||
if ( QFile::exists( settings->advancedMacrisDatabase() ) )
|
if ( QFile::exists( settings->advancedMacrisDatabase() ) )
|
||||||
stream << "\"MacrisCalcCalibration_path\": \"" + settings->advancedMacrisDatabase() + "\"," << endl;
|
stream << "\"MacrisCalcCalibration_path\": \"" + settings->advancedMacrisDatabase() + "\"," << caf::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( QFile::exists( settings->basicMacrisDatabase() ) )
|
if ( QFile::exists( settings->basicMacrisDatabase() ) )
|
||||||
stream << "\"MacrisCalc_path\": \"" + settings->basicMacrisDatabase() + "\"," << endl;
|
stream << "\"MacrisCalc_path\": \"" + settings->basicMacrisDatabase() + "\"," << caf::endl;
|
||||||
|
|
||||||
stream << "\"base_directory_path\": \"" + settings->outputBaseDirectory() + "\"," << endl;
|
stream << "\"base_directory_path\": \"" + settings->outputBaseDirectory() + "\"," << caf::endl;
|
||||||
|
|
||||||
for ( auto p : settings->parameters()->parameters() )
|
for ( auto p : settings->parameters()->parameters() )
|
||||||
{
|
{
|
||||||
stream << "\"" + p->name() + "\" : " + p->stringValue() + "," << endl;
|
stream << "\"" + p->name() + "\" : " + p->stringValue() + "," << caf::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
stream << "\"tsurf_loadsteps\": [ " + settings->stepsToLoad().join( ',' ) + " ]" << endl;
|
stream << "\"tsurf_loadsteps\": [ " + settings->stepsToLoad().join( ',' ) + " ]" << caf::endl;
|
||||||
stream << "}" << endl;
|
stream << "}" << caf::endl;
|
||||||
|
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,8 @@
|
|||||||
#include "RimFaultRASettings.h"
|
#include "RimFaultRASettings.h"
|
||||||
#include "RimGenericParameter.h"
|
#include "RimGenericParameter.h"
|
||||||
|
|
||||||
|
#include "caf.h"
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QXmlStreamReader>
|
#include <QXmlStreamReader>
|
||||||
|
|
||||||
@ -56,15 +58,15 @@ bool RifFaultRAXmlWriter::writeParametersToXML( QString filename, std::list<RimG
|
|||||||
{
|
{
|
||||||
QTextStream stream( &file );
|
QTextStream stream( &file );
|
||||||
|
|
||||||
stream << "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" << endl;
|
stream << "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" << caf::endl;
|
||||||
stream << "<project type_id=\"0\">" << endl;
|
stream << "<project type_id=\"0\">" << caf::endl;
|
||||||
|
|
||||||
for ( auto& p : params )
|
for ( auto& p : params )
|
||||||
{
|
{
|
||||||
QString tmpStr = QString( "<%1>%2</%1>" ).arg( p->name(), p->stringValue() );
|
QString tmpStr = QString( "<%1>%2</%1>" ).arg( p->name(), p->stringValue() );
|
||||||
stream << tmpStr << endl;
|
stream << tmpStr << caf::endl;
|
||||||
}
|
}
|
||||||
stream << "</project>" << endl;
|
stream << "</project>" << caf::endl;
|
||||||
|
|
||||||
bResult = true;
|
bResult = true;
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,10 @@
|
|||||||
|
|
||||||
#include "RifFileParseTools.h"
|
#include "RifFileParseTools.h"
|
||||||
|
|
||||||
|
// Disable deprecation warning for QString::SkipEmptyParts
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning( disable : 4996 )
|
||||||
|
#endif
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
#include "RifPerforationIntervalReader.h"
|
#include "RifPerforationIntervalReader.h"
|
||||||
|
|
||||||
|
#include "RiaTextStringTools.h"
|
||||||
|
|
||||||
#include <QDate>
|
#include <QDate>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
||||||
@ -79,7 +81,7 @@ void RifPerforationIntervalReader::readFileIntoMap( const QString&
|
|||||||
|
|
||||||
// Replace any tabs with spaces to enable splitting on spaces
|
// Replace any tabs with spaces to enable splitting on spaces
|
||||||
line.replace( "\t", " " );
|
line.replace( "\t", " " );
|
||||||
QStringList parts = line.split( " ", QString::SkipEmptyParts );
|
QStringList parts = RiaTextStringTools::splitSkipEmptyParts( line );
|
||||||
|
|
||||||
if ( line.startsWith( "WELLNAME" ) )
|
if ( line.startsWith( "WELLNAME" ) )
|
||||||
{
|
{
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
#include "RifReaderFmuRft.h"
|
#include "RifReaderFmuRft.h"
|
||||||
|
|
||||||
#include "RiaLogging.h"
|
#include "RiaLogging.h"
|
||||||
|
#include "RiaQDateTimeTools.h"
|
||||||
|
|
||||||
#include "cafAssert.h"
|
#include "cafAssert.h"
|
||||||
|
|
||||||
@ -438,7 +439,7 @@ RifReaderFmuRft::WellObservationMap RifReaderFmuRft::loadWellDates( QDir& dir, Q
|
|||||||
return WellObservationMap();
|
return WellObservationMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
QDateTime dateTime( QDate( year, month, day ) );
|
QDateTime dateTime = RiaQDateTimeTools::createDateTime( QDate( year, month, day ) );
|
||||||
dateTime.setTimeSpec( Qt::UTC );
|
dateTime.setTimeSpec( Qt::UTC );
|
||||||
WellObservationSet observationSet( dateTime, measurementIndex );
|
WellObservationSet observationSet( dateTime, measurementIndex );
|
||||||
validObservations.insert( std::make_pair( wellName, observationSet ) );
|
validObservations.insert( std::make_pair( wellName, observationSet ) );
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
#include "RifReaderMockModel.h"
|
#include "RifReaderMockModel.h"
|
||||||
|
|
||||||
|
#include "RiaQDateTimeTools.h"
|
||||||
|
|
||||||
#include "RigCaseCellResultsData.h"
|
#include "RigCaseCellResultsData.h"
|
||||||
#include "RigEclipseCaseData.h"
|
#include "RigEclipseCaseData.h"
|
||||||
#include "RigEclipseResultInfo.h"
|
#include "RigEclipseResultInfo.h"
|
||||||
@ -43,7 +45,7 @@ bool RifReaderMockModel::open( const QString& fileName, RigEclipseCaseData* ecli
|
|||||||
|
|
||||||
for ( int i = 0; i < static_cast<int>( m_reservoirBuilder.timeStepCount() ); i++ )
|
for ( int i = 0; i < static_cast<int>( m_reservoirBuilder.timeStepCount() ); i++ )
|
||||||
{
|
{
|
||||||
dates.push_back( QDateTime( QDate( 2012 + i, 6, 1 ) ) );
|
dates.push_back( RiaQDateTimeTools::createDateTime( QDate( 2012 + i, 6, 1 ) ) );
|
||||||
days.push_back( i );
|
days.push_back( i );
|
||||||
repNumbers.push_back( i );
|
repNumbers.push_back( i );
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
#include "RifReaderObservedData.h"
|
#include "RifReaderObservedData.h"
|
||||||
|
|
||||||
|
#include "caf.h"
|
||||||
|
|
||||||
#include "RifCsvUserDataParser.h"
|
#include "RifCsvUserDataParser.h"
|
||||||
#include "RifEclipseSummaryAddress.h"
|
#include "RifEclipseSummaryAddress.h"
|
||||||
|
|
||||||
@ -50,7 +52,7 @@ bool RifReaderObservedData::open( const QString& h
|
|||||||
AsciiDataParseOptions parseOptions;
|
AsciiDataParseOptions parseOptions;
|
||||||
parseOptions.dateFormat = "yyyy-MM-dd";
|
parseOptions.dateFormat = "yyyy-MM-dd";
|
||||||
parseOptions.cellSeparator = "\t";
|
parseOptions.cellSeparator = "\t";
|
||||||
parseOptions.locale = QLocale::Norwegian;
|
parseOptions.locale = caf::norwegianLocale();
|
||||||
|
|
||||||
QString data;
|
QString data;
|
||||||
QTextStream out( &data );
|
QTextStream out( &data );
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
#include "RimStimPlanModel.h"
|
#include "RimStimPlanModel.h"
|
||||||
#include "RimStimPlanModelCalculator.h"
|
#include "RimStimPlanModelCalculator.h"
|
||||||
|
|
||||||
|
#include "caf.h"
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
@ -273,7 +275,7 @@ bool RifStimPlanModelGeologicalFrkExporter::writeToCsvFile( const QString&
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RifStimPlanModelGeologicalFrkExporter::appendHeaderToStream( QTextStream& stream )
|
void RifStimPlanModelGeologicalFrkExporter::appendHeaderToStream( QTextStream& stream )
|
||||||
{
|
{
|
||||||
stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << '\n' << "<geologic>" << endl;
|
stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << '\n' << "<geologic>" << caf::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -283,23 +285,23 @@ void RifStimPlanModelGeologicalFrkExporter::appendToStream( QTextStream&
|
|||||||
const QString& label,
|
const QString& label,
|
||||||
const std::vector<double>& values )
|
const std::vector<double>& values )
|
||||||
{
|
{
|
||||||
stream << "<cNamedSet>" << endl
|
stream << "<cNamedSet>" << caf::endl
|
||||||
<< "<name>" << endl
|
<< "<name>" << caf::endl
|
||||||
<< label << endl
|
<< label << caf::endl
|
||||||
<< "</name>" << endl
|
<< "</name>" << caf::endl
|
||||||
<< "<dimCount>" << endl
|
<< "<dimCount>" << caf::endl
|
||||||
<< 1 << endl
|
<< 1 << caf::endl
|
||||||
<< "</dimCount>" << endl
|
<< "</dimCount>" << caf::endl
|
||||||
<< "<sizes>" << endl
|
<< "<sizes>" << caf::endl
|
||||||
<< values.size() << endl
|
<< values.size() << caf::endl
|
||||||
<< "</sizes>" << endl
|
<< "</sizes>" << caf::endl
|
||||||
<< "<data>" << endl;
|
<< "<data>" << caf::endl;
|
||||||
for ( auto val : values )
|
for ( auto val : values )
|
||||||
{
|
{
|
||||||
stream << val << endl;
|
stream << val << caf::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
stream << "</data>" << '\n' << "</cNamedSet>" << endl;
|
stream << "</data>" << '\n' << "</cNamedSet>" << caf::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -307,7 +309,7 @@ void RifStimPlanModelGeologicalFrkExporter::appendToStream( QTextStream&
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RifStimPlanModelGeologicalFrkExporter::appendFooterToStream( QTextStream& stream )
|
void RifStimPlanModelGeologicalFrkExporter::appendFooterToStream( QTextStream& stream )
|
||||||
{
|
{
|
||||||
stream << "</geologic>" << endl;
|
stream << "</geologic>" << caf::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -27,6 +27,8 @@
|
|||||||
#include "RigWellPath.h"
|
#include "RigWellPath.h"
|
||||||
#include "RigWellPathGeometryTools.h"
|
#include "RigWellPathGeometryTools.h"
|
||||||
|
|
||||||
|
#include "caf.h"
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
|
||||||
@ -75,7 +77,7 @@ bool RifStimPlanModelPerfsFrkExporter::writeToFile( RimStimPlanModel* stimPlanMo
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RifStimPlanModelPerfsFrkExporter::appendHeaderToStream( QTextStream& stream )
|
void RifStimPlanModelPerfsFrkExporter::appendHeaderToStream( QTextStream& stream )
|
||||||
{
|
{
|
||||||
stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << '\n' << "<perfs>" << endl;
|
stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << '\n' << "<perfs>" << caf::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -83,7 +85,7 @@ void RifStimPlanModelPerfsFrkExporter::appendHeaderToStream( QTextStream& stream
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RifStimPlanModelPerfsFrkExporter::appendFractureOrientationToStream( QTextStream& stream, bool isTransverse )
|
void RifStimPlanModelPerfsFrkExporter::appendFractureOrientationToStream( QTextStream& stream, bool isTransverse )
|
||||||
{
|
{
|
||||||
stream << "<transverse>" << '\n' << static_cast<int>( isTransverse ) << '\n' << "</transverse>" << endl;
|
stream << "<transverse>" << '\n' << static_cast<int>( isTransverse ) << '\n' << "</transverse>" << caf::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -91,14 +93,14 @@ void RifStimPlanModelPerfsFrkExporter::appendFractureOrientationToStream( QTextS
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RifStimPlanModelPerfsFrkExporter::appendPerforationToStream( QTextStream& stream, int index, double topMD, double bottomMD )
|
void RifStimPlanModelPerfsFrkExporter::appendPerforationToStream( QTextStream& stream, int index, double topMD, double bottomMD )
|
||||||
{
|
{
|
||||||
stream << "<perf frac=\"" << index << "\">" << endl
|
stream << "<perf frac=\"" << index << "\">" << caf::endl
|
||||||
<< "<topMD>" << endl
|
<< "<topMD>" << caf::endl
|
||||||
<< topMD << endl
|
<< topMD << caf::endl
|
||||||
<< "</topMD>" << endl
|
<< "</topMD>" << caf::endl
|
||||||
<< "<bottomMD>" << endl
|
<< "<bottomMD>" << caf::endl
|
||||||
<< bottomMD << endl
|
<< bottomMD << caf::endl
|
||||||
<< "</bottomMD>" << endl
|
<< "</bottomMD>" << caf::endl
|
||||||
<< "</perf>" << endl;
|
<< "</perf>" << caf::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -106,7 +108,7 @@ void RifStimPlanModelPerfsFrkExporter::appendPerforationToStream( QTextStream& s
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RifStimPlanModelPerfsFrkExporter::appendFooterToStream( QTextStream& stream )
|
void RifStimPlanModelPerfsFrkExporter::appendFooterToStream( QTextStream& stream )
|
||||||
{
|
{
|
||||||
stream << "</perfs>" << endl;
|
stream << "</perfs>" << caf::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -22,6 +22,8 @@
|
|||||||
#include "RiaEclipseUnitTools.h"
|
#include "RiaEclipseUnitTools.h"
|
||||||
#include "RiaFractureDefines.h"
|
#include "RiaFractureDefines.h"
|
||||||
#include "RiaLogging.h"
|
#include "RiaLogging.h"
|
||||||
|
#include "RiaTextStringTools.h"
|
||||||
|
|
||||||
#include "RigStimPlanFractureDefinition.h"
|
#include "RigStimPlanFractureDefinition.h"
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
@ -474,7 +476,7 @@ void RifStimPlanXmlReader::getGriddingValues( QXmlStreamReader& xmlStream,
|
|||||||
QString gridValuesString = xmlStream.readElementText().replace( '\n', ' ' );
|
QString gridValuesString = xmlStream.readElementText().replace( '\n', ' ' );
|
||||||
gridValuesString = gridValuesString.replace( '[', ' ' ).replace( ']', ' ' );
|
gridValuesString = gridValuesString.replace( '[', ' ' ).replace( ']', ' ' );
|
||||||
|
|
||||||
for ( const QString& value : gridValuesString.split( ' ', QString::SkipEmptyParts ) )
|
for ( const QString& value : RiaTextStringTools::splitSkipEmptyParts( gridValuesString ) )
|
||||||
{
|
{
|
||||||
if ( value.size() > 0 )
|
if ( value.size() > 0 )
|
||||||
{
|
{
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
#include "RimWellIAModelData.h"
|
#include "RimWellIAModelData.h"
|
||||||
#include "RimWellIASettings.h"
|
#include "RimWellIASettings.h"
|
||||||
|
|
||||||
|
#include "caf.h"
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
|
||||||
@ -41,11 +43,11 @@ bool RifWellIAFileWriter::writeToJsonFile( RimWellIASettings& settings, QString&
|
|||||||
{
|
{
|
||||||
QTextStream stream( &file );
|
QTextStream stream( &file );
|
||||||
|
|
||||||
stream << "{" << endl;
|
stream << "{" << caf::endl;
|
||||||
stream << "\"comments\": \"All units are SI unless mentioned otherwise; temperature is in Celcius; use forward "
|
stream << "\"comments\": \"All units are SI unless mentioned otherwise; temperature is in Celcius; use forward "
|
||||||
"slash (/) in 'directory' definition\","
|
"slash (/) in 'directory' definition\","
|
||||||
<< endl;
|
<< caf::endl;
|
||||||
stream << "\"directory\": \"" + settings.outputBaseDirectory() + "\"," << endl;
|
stream << "\"directory\": \"" + settings.outputBaseDirectory() + "\"," << caf::endl;
|
||||||
stream << "\"output_name\": \"" + settings.name() + "\"";
|
stream << "\"output_name\": \"" + settings.name() + "\"";
|
||||||
|
|
||||||
RimParameterGroups mergedGroups;
|
RimParameterGroups mergedGroups;
|
||||||
@ -63,9 +65,9 @@ bool RifWellIAFileWriter::writeToJsonFile( RimWellIASettings& settings, QString&
|
|||||||
|
|
||||||
for ( auto& group : mergedGroups.groups() )
|
for ( auto& group : mergedGroups.groups() )
|
||||||
{
|
{
|
||||||
stream << "," << endl;
|
stream << "," << caf::endl;
|
||||||
|
|
||||||
stream << "\"" + group->name() + "\": {" << endl;
|
stream << "\"" + group->name() + "\": {" << caf::endl;
|
||||||
|
|
||||||
const auto& parameters = group->parameters();
|
const auto& parameters = group->parameters();
|
||||||
|
|
||||||
@ -78,13 +80,13 @@ bool RifWellIAFileWriter::writeToJsonFile( RimWellIASettings& settings, QString&
|
|||||||
{
|
{
|
||||||
stream << ",";
|
stream << ",";
|
||||||
}
|
}
|
||||||
stream << endl;
|
stream << caf::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
stream << " }";
|
stream << " }";
|
||||||
}
|
}
|
||||||
|
|
||||||
stream << endl << "}" << endl;
|
stream << caf::endl << "}" << caf::endl;
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -114,7 +116,7 @@ bool RifWellIAFileWriter::writeToCSVFile( RimWellIASettings& settings, QString&
|
|||||||
stream << "Time_days, Pcasing_Pa, P_form_Pa, Temp_C,"
|
stream << "Time_days, Pcasing_Pa, P_form_Pa, Temp_C,"
|
||||||
"U1-1,U2,U3,U1-2,U2,U3,U1-3,U2,U3,U1-4,U2,U3,U1-5,U2,U3,U1-6,U2,U3,U1-7,U2,U3,U1-8,U2,U3,"
|
"U1-1,U2,U3,U1-2,U2,U3,U1-3,U2,U3,U1-4,U2,U3,U1-5,U2,U3,U1-6,U2,U3,U1-7,U2,U3,U1-8,U2,U3,"
|
||||||
"X,Y,Z,X2,Y,Z,X3,Y,Z,X4,Y,Z,X5,Y,Z,X6,Y,Z,X7,Y,Z,X8,Y,Z";
|
"X,Y,Z,X2,Y,Z,X3,Y,Z,X4,Y,Z,X5,Y,Z,X6,Y,Z,X7,Y,Z,X8,Y,Z";
|
||||||
stream << endl;
|
stream << caf::endl;
|
||||||
|
|
||||||
for ( auto& modeldata : settings.modelData() )
|
for ( auto& modeldata : settings.modelData() )
|
||||||
{
|
{
|
||||||
@ -145,7 +147,7 @@ bool RifWellIAFileWriter::writeToCSVFile( RimWellIASettings& settings, QString&
|
|||||||
stream << ",";
|
stream << ",";
|
||||||
stream << pos.z();
|
stream << pos.z();
|
||||||
}
|
}
|
||||||
stream << endl;
|
stream << caf::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -155,7 +155,7 @@ void RifWellPathFormationReader::readFile( const QString& filePath,
|
|||||||
QString line = data.readLine().toLower();
|
QString line = data.readLine().toLower();
|
||||||
removeWhiteSpaces( &line );
|
removeWhiteSpaces( &line );
|
||||||
|
|
||||||
header = line.split( ';', QString::KeepEmptyParts );
|
header = line.split( ';' );
|
||||||
}
|
}
|
||||||
|
|
||||||
static const QString wellNameText = "wellname";
|
static const QString wellNameText = "wellname";
|
||||||
@ -172,7 +172,7 @@ void RifWellPathFormationReader::readFile( const QString& filePath,
|
|||||||
{
|
{
|
||||||
QString line = data.readLine();
|
QString line = data.readLine();
|
||||||
|
|
||||||
QStringList dataLine = line.split( ';', QString::KeepEmptyParts );
|
QStringList dataLine = line.split( ';' );
|
||||||
if ( dataLine.size() != header.size() ) continue;
|
if ( dataLine.size() != header.size() ) continue;
|
||||||
|
|
||||||
bool conversionOk;
|
bool conversionOk;
|
||||||
@ -224,7 +224,7 @@ void RifWellPathFormationReader::readFile( const QString& filePath,
|
|||||||
{
|
{
|
||||||
QString line = data.readLine();
|
QString line = data.readLine();
|
||||||
|
|
||||||
QStringList dataLine = line.split( ';', QString::KeepEmptyParts );
|
QStringList dataLine = line.split( ';' );
|
||||||
if ( dataLine.size() != header.size() ) continue;
|
if ( dataLine.size() != header.size() ) continue;
|
||||||
|
|
||||||
QString wellName = dataLine[wellNameIndex];
|
QString wellName = dataLine[wellNameIndex];
|
||||||
|
@ -19,7 +19,9 @@
|
|||||||
#include "RimPolylinesFromFileAnnotation.h"
|
#include "RimPolylinesFromFileAnnotation.h"
|
||||||
|
|
||||||
#include "RiaLogging.h"
|
#include "RiaLogging.h"
|
||||||
|
#include "RiaTextStringTools.h"
|
||||||
#include "RigPolyLinesData.h"
|
#include "RigPolyLinesData.h"
|
||||||
|
|
||||||
#include "RimAnnotationCollection.h"
|
#include "RimAnnotationCollection.h"
|
||||||
#include "RimAnnotationLineAppearance.h"
|
#include "RimAnnotationLineAppearance.h"
|
||||||
|
|
||||||
@ -86,10 +88,10 @@ void RimPolylinesFromFileAnnotation::readPolyLinesFile( QString* errorMessage )
|
|||||||
while ( !stream.atEnd() )
|
while ( !stream.atEnd() )
|
||||||
{
|
{
|
||||||
QString line = stream.readLine();
|
QString line = stream.readLine();
|
||||||
QStringList commentLineSegs = line.split( "#", QString::KeepEmptyParts );
|
QStringList commentLineSegs = line.split( "#" );
|
||||||
if ( commentLineSegs.empty() ) continue; // Empty line
|
if ( commentLineSegs.empty() ) continue; // Empty line
|
||||||
|
|
||||||
QStringList lineSegs = commentLineSegs[0].split( QRegExp( "\\s+" ), QString::SkipEmptyParts );
|
QStringList lineSegs = RiaTextStringTools::splitSkipEmptyParts( commentLineSegs[0], QRegExp( "\\s+" ) );
|
||||||
|
|
||||||
if ( lineSegs.empty() ) continue; // No data
|
if ( lineSegs.empty() ) continue; // No data
|
||||||
|
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
#include "RimCellFilterIntervalTool.h"
|
#include "RimCellFilterIntervalTool.h"
|
||||||
|
|
||||||
|
#include "RiaTextStringTools.h"
|
||||||
|
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -104,11 +106,11 @@ void RimCellFilterIntervalTool::setInterval( bool enabled, QString intervalText
|
|||||||
|
|
||||||
if ( !enabled ) return;
|
if ( !enabled ) return;
|
||||||
|
|
||||||
QStringList parts = intervalText.split( ',', QString::SkipEmptyParts );
|
QStringList parts = RiaTextStringTools::splitSkipEmptyParts( intervalText, "," );
|
||||||
|
|
||||||
for ( auto& part : parts )
|
for ( auto& part : parts )
|
||||||
{
|
{
|
||||||
QStringList minmax = part.split( '-', QString::SkipEmptyParts );
|
QStringList minmax = RiaTextStringTools::splitSkipEmptyParts( part, "-" );
|
||||||
switch ( minmax.size() )
|
switch ( minmax.size() )
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
#include "RiaColorTables.h"
|
#include "RiaColorTables.h"
|
||||||
#include "RiaEclipseUnitTools.h"
|
#include "RiaEclipseUnitTools.h"
|
||||||
|
#include "RiaQDateTimeTools.h"
|
||||||
|
|
||||||
#include "RigCaseCellResultsData.h"
|
#include "RigCaseCellResultsData.h"
|
||||||
#include "RigWellPath.h"
|
#include "RigWellPath.h"
|
||||||
@ -99,7 +100,7 @@ void RimPerforationInterval::setCustomStartDate( const QDate& date )
|
|||||||
{
|
{
|
||||||
if ( date.isValid() )
|
if ( date.isValid() )
|
||||||
{
|
{
|
||||||
m_startDate = QDateTime( date );
|
m_startDate = RiaQDateTimeTools::createDateTime( date );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,7 +111,7 @@ void RimPerforationInterval::setCustomEndDate( const QDate& date )
|
|||||||
{
|
{
|
||||||
if ( date.isValid() )
|
if ( date.isValid() )
|
||||||
{
|
{
|
||||||
m_endDate = QDateTime( date );
|
m_endDate = RiaQDateTimeTools::createDateTime( date );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,6 +25,11 @@
|
|||||||
|
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
|
|
||||||
|
// Disable deprecation warning for QProcess::start()
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning( disable : 4996 )
|
||||||
|
#endif
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RimProcess, "RimProcess" );
|
CAF_PDM_SOURCE_INIT( RimProcess, "RimProcess" );
|
||||||
|
|
||||||
int RimProcess::m_nextProcessId = 1;
|
int RimProcess::m_nextProcessId = 1;
|
||||||
|
@ -29,14 +29,10 @@
|
|||||||
#include "RigActiveCellInfo.h"
|
#include "RigActiveCellInfo.h"
|
||||||
#include "RigCaseCellResultsData.h"
|
#include "RigCaseCellResultsData.h"
|
||||||
#include "RigEclipseCaseData.h"
|
#include "RigEclipseCaseData.h"
|
||||||
// #include "RigEclipseMultiPropertyStatCalc.h"
|
|
||||||
// #include "RigEclipseNativeVisibleCellsStatCalc.h"
|
|
||||||
// #include "RigFemNativeVisibleCellsStatCalc.h"
|
|
||||||
#include "RigFemPartCollection.h"
|
#include "RigFemPartCollection.h"
|
||||||
#include "RigFemPartResultsCollection.h"
|
#include "RigFemPartResultsCollection.h"
|
||||||
#include "RigFemResultAddress.h"
|
#include "RigFemResultAddress.h"
|
||||||
#include "RigFlowDiagResults.h"
|
#include "RigFlowDiagResults.h"
|
||||||
// #include "RigFlowDiagVisibleCellsStatCalc.h"
|
|
||||||
#include "RigGeoMechCaseData.h"
|
#include "RigGeoMechCaseData.h"
|
||||||
#include "RigMainGrid.h"
|
#include "RigMainGrid.h"
|
||||||
|
|
||||||
@ -64,6 +60,8 @@
|
|||||||
|
|
||||||
#include "RiuViewer.h"
|
#include "RiuViewer.h"
|
||||||
|
|
||||||
|
#include "caf.h"
|
||||||
|
|
||||||
#include <QLocale>
|
#include <QLocale>
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( Rim3dOverlayInfoConfig, "View3dOverlayInfoConfig" );
|
CAF_PDM_SOURCE_INIT( Rim3dOverlayInfoConfig, "View3dOverlayInfoConfig" );
|
||||||
@ -289,7 +287,7 @@ QString Rim3dOverlayInfoConfig::caseInfoText( RimEclipseView* eclipseView )
|
|||||||
{
|
{
|
||||||
QString caseName = eclipseView->eclipseCase()->caseUserDescription();
|
QString caseName = eclipseView->eclipseCase()->caseUserDescription();
|
||||||
|
|
||||||
QLocale localeWithSpaceAsGroupSeparator( QLocale::Norwegian );
|
QLocale localeWithSpaceAsGroupSeparator( caf::norwegianLocale() );
|
||||||
|
|
||||||
RimEclipseContourMapView* contourMap = dynamic_cast<RimEclipseContourMapView*>( eclipseView );
|
RimEclipseContourMapView* contourMap = dynamic_cast<RimEclipseContourMapView*>( eclipseView );
|
||||||
if ( contourMap && contourMap->contourMapProjection() )
|
if ( contourMap && contourMap->contourMapProjection() )
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "RiaFilePathTools.h"
|
#include "RiaFilePathTools.h"
|
||||||
#include "RiaGuiApplication.h"
|
#include "RiaGuiApplication.h"
|
||||||
#include "RiaProjectFileVersionTools.h"
|
#include "RiaProjectFileVersionTools.h"
|
||||||
|
#include "RiaTextStringTools.h"
|
||||||
#include "RiaVersionInfo.h"
|
#include "RiaVersionInfo.h"
|
||||||
|
|
||||||
#include "RicfCommandObject.h"
|
#include "RicfCommandObject.h"
|
||||||
@ -1517,7 +1518,7 @@ public:
|
|||||||
GlobalPathListMapper( const QString& globalPathListTable )
|
GlobalPathListMapper( const QString& globalPathListTable )
|
||||||
{
|
{
|
||||||
m_maxUsedIdNumber = 0;
|
m_maxUsedIdNumber = 0;
|
||||||
QStringList pathPairs = globalPathListTable.split( ";", QString::SkipEmptyParts );
|
QStringList pathPairs = RiaTextStringTools::splitSkipEmptyParts( globalPathListTable, ";" );
|
||||||
|
|
||||||
for ( const QString& pathIdPathPair : pathPairs )
|
for ( const QString& pathIdPathPair : pathPairs )
|
||||||
{
|
{
|
||||||
|
@ -125,13 +125,13 @@ QString RimTools::relocateFile( const QString& originalFileName,
|
|||||||
QFileInfo fileNameFileInfo( QDir::fromNativeSeparators( fileName ) );
|
QFileInfo fileNameFileInfo( QDir::fromNativeSeparators( fileName ) );
|
||||||
QString fileNamePath = fileNameFileInfo.path();
|
QString fileNamePath = fileNameFileInfo.path();
|
||||||
QString fileNameWithoutPath = fileNameFileInfo.fileName();
|
QString fileNameWithoutPath = fileNameFileInfo.fileName();
|
||||||
QStringList fileNamePathElements = fileNamePath.split( "/", QString::KeepEmptyParts );
|
QStringList fileNamePathElements = fileNamePath.split( "/" );
|
||||||
|
|
||||||
QString oldProjPath = QDir::fromNativeSeparators( oldProjectPath );
|
QString oldProjPath = QDir::fromNativeSeparators( oldProjectPath );
|
||||||
QStringList oldProjPathElements = oldProjPath.split( "/", QString::KeepEmptyParts );
|
QStringList oldProjPathElements = oldProjPath.split( "/" );
|
||||||
|
|
||||||
QString newProjPath = QDir::fromNativeSeparators( newProjectPath );
|
QString newProjPath = QDir::fromNativeSeparators( newProjectPath );
|
||||||
QStringList newProjPathElements = newProjPath.split( "/", QString::KeepEmptyParts );
|
QStringList newProjPathElements = newProjPath.split( "/" );
|
||||||
|
|
||||||
// Find the possible equal start of the old project path, and the referenced file
|
// Find the possible equal start of the old project path, and the referenced file
|
||||||
|
|
||||||
|
@ -739,8 +739,8 @@ void RimEnsembleCurveSet::fieldChangedByUi( const caf::PdmFieldHandle* changedFi
|
|||||||
}
|
}
|
||||||
else if ( changedField == &m_minDateRange || changedField == &m_maxDateRange )
|
else if ( changedField == &m_minDateRange || changedField == &m_maxDateRange )
|
||||||
{
|
{
|
||||||
m_minTimeStep = RiaTimeTTools::fromQDateTime( QDateTime( m_minDateRange() ) );
|
m_minTimeStep = RiaTimeTTools::fromQDateTime( RiaQDateTimeTools::createDateTime( m_minDateRange() ) );
|
||||||
m_maxTimeStep = RiaTimeTTools::fromQDateTime( QDateTime( m_maxDateRange() ) );
|
m_maxTimeStep = RiaTimeTTools::fromQDateTime( RiaQDateTimeTools::createDateTime( m_maxDateRange() ) );
|
||||||
updateCurveColors();
|
updateCurveColors();
|
||||||
updateTimeAnnotations();
|
updateTimeAnnotations();
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include "RiaStdStringTools.h"
|
#include "RiaStdStringTools.h"
|
||||||
#include "RiaStringListSerializer.h"
|
#include "RiaStringListSerializer.h"
|
||||||
#include "RiaSummaryCurveDefinition.h"
|
#include "RiaSummaryCurveDefinition.h"
|
||||||
|
#include "RiaTextStringTools.h"
|
||||||
|
|
||||||
#include "RifReaderEclipseSummary.h"
|
#include "RifReaderEclipseSummary.h"
|
||||||
#include "RifSummaryReaderInterface.h"
|
#include "RifSummaryReaderInterface.h"
|
||||||
@ -183,7 +184,7 @@ void RimSummaryPlotFilterTextCurveSetEditor::updateTextFilter()
|
|||||||
// Todo: possibly check grid time history curves also
|
// Todo: possibly check grid time history curves also
|
||||||
|
|
||||||
QStringList allCurveAddressFilters =
|
QStringList allCurveAddressFilters =
|
||||||
curveFilterTextWithoutOutdatedLabel().split( QRegExp( "\\s+" ), QString::SkipEmptyParts );
|
RiaTextStringTools::splitSkipEmptyParts( curveFilterTextWithoutOutdatedLabel(), QRegExp( "\\s+" ) );
|
||||||
|
|
||||||
std::vector<bool> usedFilters;
|
std::vector<bool> usedFilters;
|
||||||
std::set<RifEclipseSummaryAddress> filteredAddressesFromSource;
|
std::set<RifEclipseSummaryAddress> filteredAddressesFromSource;
|
||||||
@ -440,7 +441,7 @@ void RimSummaryPlotFilterTextCurveSetEditor::updateParentPlot()
|
|||||||
std::set<RiaSummaryCurveDefinition> curveDefinitions;
|
std::set<RiaSummaryCurveDefinition> curveDefinitions;
|
||||||
|
|
||||||
QStringList allCurveAddressFilters =
|
QStringList allCurveAddressFilters =
|
||||||
curveFilterTextWithoutOutdatedLabel().split( QRegExp( "\\s+" ), QString::SkipEmptyParts );
|
RiaTextStringTools::splitSkipEmptyParts( curveFilterTextWithoutOutdatedLabel(), QRegExp( "\\s+" ) );
|
||||||
std::vector<bool> accumulatedUsedFilters( allCurveAddressFilters.size(), false );
|
std::vector<bool> accumulatedUsedFilters( allCurveAddressFilters.size(), false );
|
||||||
|
|
||||||
for ( SummarySource* currSource : selectedSummarySources() )
|
for ( SummarySource* currSource : selectedSummarySources() )
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include "RiaStringListSerializer.h"
|
#include "RiaStringListSerializer.h"
|
||||||
#include "RiaSummaryStringTools.h"
|
#include "RiaSummaryStringTools.h"
|
||||||
#include "RiaSummaryTools.h"
|
#include "RiaSummaryTools.h"
|
||||||
|
#include "RiaTextStringTools.h"
|
||||||
|
|
||||||
#include "RifReaderEclipseSummary.h"
|
#include "RifReaderEclipseSummary.h"
|
||||||
#include "RifSummaryReaderInterface.h"
|
#include "RifSummaryReaderInterface.h"
|
||||||
@ -507,7 +508,7 @@ std::set<RifEclipseSummaryAddress> RimSummaryPlotManager::filteredAddresses()
|
|||||||
|
|
||||||
if ( nativeAddresses.empty() ) return {};
|
if ( nativeAddresses.empty() ) return {};
|
||||||
|
|
||||||
QStringList allCurveAddressFilters = m_filterText().split( QRegExp( "\\s+" ), QString::SkipEmptyParts );
|
QStringList allCurveAddressFilters = RiaTextStringTools::splitSkipEmptyParts( m_filterText(), QRegExp( "\\s+" ) );
|
||||||
|
|
||||||
return RiaSummaryStringTools::computeFilteredAddresses( allCurveAddressFilters, nativeAddresses, m_includeDiffCurves );
|
return RiaSummaryStringTools::computeFilteredAddresses( allCurveAddressFilters, nativeAddresses, m_includeDiffCurves );
|
||||||
}
|
}
|
||||||
|
@ -92,6 +92,7 @@
|
|||||||
#include "cafPdmUiSliderEditor.h"
|
#include "cafPdmUiSliderEditor.h"
|
||||||
#include "cafSelectionManager.h"
|
#include "cafSelectionManager.h"
|
||||||
|
|
||||||
|
#include "caf.h"
|
||||||
#include "cvfAssert.h"
|
#include "cvfAssert.h"
|
||||||
|
|
||||||
#include <QWheelEvent>
|
#include <QWheelEvent>
|
||||||
@ -2108,29 +2109,30 @@ RimDepthTrackPlot* RimWellLogTrack::parentWellLogPlot() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimWellLogTrack::handleWheelEvent( QWheelEvent* event )
|
void RimWellLogTrack::handleWheelEvent( QWheelEvent* wheelEvent )
|
||||||
{
|
{
|
||||||
RimDepthTrackPlot* wellLogPlot = nullptr;
|
RimDepthTrackPlot* wellLogPlot = nullptr;
|
||||||
this->firstAncestorOrThisOfType( wellLogPlot );
|
this->firstAncestorOrThisOfType( wellLogPlot );
|
||||||
|
|
||||||
if ( wellLogPlot )
|
if ( wellLogPlot )
|
||||||
{
|
{
|
||||||
if ( event->modifiers() & Qt::ControlModifier )
|
if ( wheelEvent->modifiers() & Qt::ControlModifier )
|
||||||
{
|
{
|
||||||
double zoomCenter = 0.0;
|
double zoomCenter = 0.0;
|
||||||
|
auto position = caf::position( wheelEvent );
|
||||||
|
|
||||||
if ( wellLogPlot->depthOrientation() == RimDepthTrackPlot::DepthOrientation::VERTICAL )
|
if ( wellLogPlot->depthOrientation() == RimDepthTrackPlot::DepthOrientation::VERTICAL )
|
||||||
{
|
{
|
||||||
QwtScaleMap scaleMap = m_plotWidget->qwtPlot()->canvasMap( QwtPlot::yLeft );
|
QwtScaleMap scaleMap = m_plotWidget->qwtPlot()->canvasMap( QwtPlot::yLeft );
|
||||||
zoomCenter = scaleMap.invTransform( event->pos().y() );
|
zoomCenter = scaleMap.invTransform( position.y() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QwtScaleMap scaleMap = m_plotWidget->qwtPlot()->canvasMap( QwtPlot::xTop );
|
QwtScaleMap scaleMap = m_plotWidget->qwtPlot()->canvasMap( QwtPlot::xTop );
|
||||||
zoomCenter = scaleMap.invTransform( event->pos().x() );
|
zoomCenter = scaleMap.invTransform( position.x() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( event->delta() > 0 )
|
if ( wheelEvent->angleDelta().y() > 0 )
|
||||||
{
|
{
|
||||||
wellLogPlot->setDepthAxisRangeByFactorAndCenter( RI_SCROLLWHEEL_ZOOMFACTOR, zoomCenter );
|
wellLogPlot->setDepthAxisRangeByFactorAndCenter( RI_SCROLLWHEEL_ZOOMFACTOR, zoomCenter );
|
||||||
}
|
}
|
||||||
@ -2141,7 +2143,7 @@ void RimWellLogTrack::handleWheelEvent( QWheelEvent* event )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wellLogPlot->setDepthAxisRangeByPanDepth( event->delta() < 0 ? RI_SCROLLWHEEL_PANFACTOR
|
wellLogPlot->setDepthAxisRangeByPanDepth( wheelEvent->angleDelta().y() < 0 ? RI_SCROLLWHEEL_PANFACTOR
|
||||||
: -RI_SCROLLWHEEL_PANFACTOR );
|
: -RI_SCROLLWHEEL_PANFACTOR );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
#include "SummaryPlotCommands/RicNewSummaryPlotFeature.h"
|
#include "SummaryPlotCommands/RicNewSummaryPlotFeature.h"
|
||||||
#include "SummaryPlotCommands/RicSummaryPlotFeatureImpl.h"
|
#include "SummaryPlotCommands/RicSummaryPlotFeatureImpl.h"
|
||||||
|
|
||||||
|
#include "RiaTextStringTools.h"
|
||||||
|
|
||||||
#include "RimSummaryCase.h"
|
#include "RimSummaryCase.h"
|
||||||
#include "RimSummaryPlot.h"
|
#include "RimSummaryPlot.h"
|
||||||
#include "RimSummaryPlotCollection.h"
|
#include "RimSummaryPlotCollection.h"
|
||||||
@ -56,7 +58,7 @@ RimcSummaryPlotCollection_newSummaryPlot::RimcSummaryPlotCollection_newSummaryPl
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
caf::PdmObjectHandle* RimcSummaryPlotCollection_newSummaryPlot::execute()
|
caf::PdmObjectHandle* RimcSummaryPlotCollection_newSummaryPlot::execute()
|
||||||
{
|
{
|
||||||
QStringList addressStrings = m_addressString().split( ";", QString::SkipEmptyParts );
|
QStringList addressStrings = RiaTextStringTools::splitSkipEmptyParts( m_addressString(), ";" );
|
||||||
|
|
||||||
RimSummaryPlot* newPlot = nullptr;
|
RimSummaryPlot* newPlot = nullptr;
|
||||||
if ( m_ensemble )
|
if ( m_ensemble )
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
#include "RigEquil.h"
|
#include "RigEquil.h"
|
||||||
|
|
||||||
|
#include "RiaTextStringTools.h"
|
||||||
|
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -133,7 +135,7 @@ RigEquil RigEquil::parseString( const QString& keywordData )
|
|||||||
QString line( keywordData );
|
QString line( keywordData );
|
||||||
line.replace( "\t", " " );
|
line.replace( "\t", " " );
|
||||||
|
|
||||||
QStringList items = line.split( " ", QString::SkipEmptyParts );
|
QStringList items = RiaTextStringTools::splitSkipEmptyParts( line );
|
||||||
if ( items.size() > 0 )
|
if ( items.size() > 0 )
|
||||||
{
|
{
|
||||||
datumDepth = items.at( 0 ).toDouble();
|
datumDepth = items.at( 0 ).toDouble();
|
||||||
|
@ -1,16 +1,19 @@
|
|||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
#include "RiaQDateTimeTools.h"
|
||||||
#include "RifColumnBasedUserData.h"
|
#include "RifColumnBasedUserData.h"
|
||||||
#include "RifColumnBasedUserDataParser.h"
|
#include "RifColumnBasedUserDataParser.h"
|
||||||
#include "RifCsvUserDataParser.h"
|
#include "RifCsvUserDataParser.h"
|
||||||
|
#include "RifEclipseUserDataKeywordTools.h"
|
||||||
#include "RifEclipseUserDataParserTools.h"
|
#include "RifEclipseUserDataParserTools.h"
|
||||||
#include "RifKeywordVectorParser.h"
|
#include "RifKeywordVectorParser.h"
|
||||||
#include "SummaryPlotCommands/RicPasteAsciiDataToSummaryPlotFeatureUi.h"
|
#include "SummaryPlotCommands/RicPasteAsciiDataToSummaryPlotFeatureUi.h"
|
||||||
|
|
||||||
#include "RiaQDateTimeTools.h"
|
|
||||||
#include "RifEclipseUserDataKeywordTools.h"
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
|
||||||
|
#include "caf.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -21,7 +24,7 @@ TEST( RifColumnBasedAsciiParserTest, TestDateFormatYyyymmddWithDash )
|
|||||||
AsciiDataParseOptions parseOptions;
|
AsciiDataParseOptions parseOptions;
|
||||||
parseOptions.dateFormat = "yyyy-MM-dd";
|
parseOptions.dateFormat = "yyyy-MM-dd";
|
||||||
parseOptions.cellSeparator = "\t";
|
parseOptions.cellSeparator = "\t";
|
||||||
parseOptions.locale = QLocale::Norwegian;
|
parseOptions.locale = caf::norwegianLocale();
|
||||||
parseOptions.timeSeriesColumnName = "Date";
|
parseOptions.timeSeriesColumnName = "Date";
|
||||||
|
|
||||||
QString data;
|
QString data;
|
||||||
@ -78,7 +81,7 @@ TEST( RifColumnBasedAsciiParserTest, TestDateFormatYymmddWithDot )
|
|||||||
AsciiDataParseOptions parseOptions;
|
AsciiDataParseOptions parseOptions;
|
||||||
parseOptions.dateFormat = "yy.MM.dd";
|
parseOptions.dateFormat = "yy.MM.dd";
|
||||||
parseOptions.cellSeparator = "\t";
|
parseOptions.cellSeparator = "\t";
|
||||||
parseOptions.locale = QLocale::Norwegian;
|
parseOptions.locale = caf::norwegianLocale();
|
||||||
parseOptions.timeSeriesColumnName = "Date";
|
parseOptions.timeSeriesColumnName = "Date";
|
||||||
|
|
||||||
QString data;
|
QString data;
|
||||||
@ -133,7 +136,7 @@ TEST( RifColumnBasedAsciiParserTest, TestDateFormatDdmmyyWithDot )
|
|||||||
AsciiDataParseOptions parseOptions;
|
AsciiDataParseOptions parseOptions;
|
||||||
parseOptions.dateFormat = "dd.MM.yy";
|
parseOptions.dateFormat = "dd.MM.yy";
|
||||||
parseOptions.cellSeparator = "\t";
|
parseOptions.cellSeparator = "\t";
|
||||||
parseOptions.locale = QLocale::Norwegian;
|
parseOptions.locale = caf::norwegianLocale();
|
||||||
parseOptions.timeSeriesColumnName = "Date";
|
parseOptions.timeSeriesColumnName = "Date";
|
||||||
|
|
||||||
QString data;
|
QString data;
|
||||||
@ -188,7 +191,7 @@ TEST( RifColumnBasedAsciiParserTest, TestDecimalLocaleNorwegian )
|
|||||||
parseOptions.dateFormat = "yy.MM.dd";
|
parseOptions.dateFormat = "yy.MM.dd";
|
||||||
parseOptions.cellSeparator = "\t";
|
parseOptions.cellSeparator = "\t";
|
||||||
parseOptions.decimalSeparator = ",";
|
parseOptions.decimalSeparator = ",";
|
||||||
parseOptions.locale = QLocale::Norwegian;
|
parseOptions.locale = caf::norwegianLocale();
|
||||||
parseOptions.timeSeriesColumnName = "Date";
|
parseOptions.timeSeriesColumnName = "Date";
|
||||||
|
|
||||||
QString data;
|
QString data;
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
TEST( RiaDateStringParserTest, ParseYearFirstWithSeparators )
|
TEST( RiaDateStringParserTest, ParseYearFirstWithSeparators )
|
||||||
{
|
{
|
||||||
QDateTime may2ndDT = QDateTime( QDate( 2011, 05, 02 ) );
|
QDateTime may2ndDT = RiaQDateTimeTools::createDateTime( QDate( 2011, 05, 02 ) );
|
||||||
may2ndDT.setTimeSpec( RiaQDateTimeTools::currentTimeSpec() );
|
may2ndDT.setTimeSpec( RiaQDateTimeTools::currentTimeSpec() );
|
||||||
|
|
||||||
std::vector<std::string> may2ndStrings = { "2011 05 02",
|
std::vector<std::string> may2ndStrings = { "2011 05 02",
|
||||||
@ -33,7 +33,7 @@ TEST( RiaDateStringParserTest, ParseYearFirstWithSeparators )
|
|||||||
EXPECT_TRUE( may2ndDT == parsedDate );
|
EXPECT_TRUE( may2ndDT == parsedDate );
|
||||||
}
|
}
|
||||||
|
|
||||||
QDateTime nov24thDT = QDateTime( QDate( 1992, 11, 24 ) );
|
QDateTime nov24thDT = RiaQDateTimeTools::createDateTime( QDate( 1992, 11, 24 ) );
|
||||||
nov24thDT.setTimeSpec( RiaQDateTimeTools::currentTimeSpec() );
|
nov24thDT.setTimeSpec( RiaQDateTimeTools::currentTimeSpec() );
|
||||||
|
|
||||||
std::vector<std::string> nov24thStrings = { "1992-11-24", "1992-Nov-24", "1992-nov-24", "1992.11.24" };
|
std::vector<std::string> nov24thStrings = { "1992-11-24", "1992-Nov-24", "1992-nov-24", "1992.11.24" };
|
||||||
@ -48,7 +48,7 @@ TEST( RiaDateStringParserTest, ParseYearFirstWithSeparators )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
TEST( RiaDateStringParserTest, ParseDayFirstWithSeparators )
|
TEST( RiaDateStringParserTest, ParseDayFirstWithSeparators )
|
||||||
{
|
{
|
||||||
QDateTime may2ndDT = QDateTime( QDate( 2011, 05, 02 ) );
|
QDateTime may2ndDT = RiaQDateTimeTools::createDateTime( QDate( 2011, 05, 02 ) );
|
||||||
may2ndDT.setTimeSpec( RiaQDateTimeTools::currentTimeSpec() );
|
may2ndDT.setTimeSpec( RiaQDateTimeTools::currentTimeSpec() );
|
||||||
|
|
||||||
std::vector<std::string> may2ndStrings = { "02 05 2011",
|
std::vector<std::string> may2ndStrings = { "02 05 2011",
|
||||||
@ -66,7 +66,7 @@ TEST( RiaDateStringParserTest, ParseDayFirstWithSeparators )
|
|||||||
EXPECT_TRUE( may2ndDT == parsedDate );
|
EXPECT_TRUE( may2ndDT == parsedDate );
|
||||||
}
|
}
|
||||||
|
|
||||||
QDateTime nov24thDT = QDateTime( QDate( 1992, 11, 24 ) );
|
QDateTime nov24thDT = RiaQDateTimeTools::createDateTime( QDate( 1992, 11, 24 ) );
|
||||||
nov24thDT.setTimeSpec( RiaQDateTimeTools::currentTimeSpec() );
|
nov24thDT.setTimeSpec( RiaQDateTimeTools::currentTimeSpec() );
|
||||||
|
|
||||||
std::vector<std::string> nov24thStrings = { "24-11-1992", "24-Nov-1992", "24.Nov 1992", "24.11.1992" };
|
std::vector<std::string> nov24thStrings = { "24-11-1992", "24-Nov-1992", "24.Nov 1992", "24.11.1992" };
|
||||||
@ -81,7 +81,7 @@ TEST( RiaDateStringParserTest, ParseDayFirstWithSeparators )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
TEST( RiaDateStringParserTest, ParseMonthFirstWithSeparators )
|
TEST( RiaDateStringParserTest, ParseMonthFirstWithSeparators )
|
||||||
{
|
{
|
||||||
QDateTime may2ndDT = QDateTime( QDate( 2011, 05, 02 ) );
|
QDateTime may2ndDT = RiaQDateTimeTools::createDateTime( QDate( 2011, 05, 02 ) );
|
||||||
may2ndDT.setTimeSpec( RiaQDateTimeTools::currentTimeSpec() );
|
may2ndDT.setTimeSpec( RiaQDateTimeTools::currentTimeSpec() );
|
||||||
|
|
||||||
std::vector<std::string> may2ndStrings = { "May 02 2011", "may 02 2011", "May_02_2011", "May.02.2011", "May 02. 2011" };
|
std::vector<std::string> may2ndStrings = { "May 02 2011", "may 02 2011", "May_02_2011", "May.02.2011", "May 02. 2011" };
|
||||||
@ -91,7 +91,7 @@ TEST( RiaDateStringParserTest, ParseMonthFirstWithSeparators )
|
|||||||
EXPECT_TRUE( may2ndDT == parsedDate );
|
EXPECT_TRUE( may2ndDT == parsedDate );
|
||||||
}
|
}
|
||||||
|
|
||||||
QDateTime nov24thDT = QDateTime( QDate( 1992, 11, 24 ) );
|
QDateTime nov24thDT = RiaQDateTimeTools::createDateTime( QDate( 1992, 11, 24 ) );
|
||||||
nov24thDT.setTimeSpec( RiaQDateTimeTools::currentTimeSpec() );
|
nov24thDT.setTimeSpec( RiaQDateTimeTools::currentTimeSpec() );
|
||||||
|
|
||||||
std::vector<std::string> nov24thStrings = { "11-24-1992", "Nov-24-1992", "Nov 24. 1992", "11.24.1992", "11 24 1992" };
|
std::vector<std::string> nov24thStrings = { "11-24-1992", "Nov-24-1992", "Nov 24. 1992", "11.24.1992", "11 24 1992" };
|
||||||
@ -106,8 +106,8 @@ TEST( RiaDateStringParserTest, ParseMonthFirstWithSeparators )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
TEST( RiaDateStringParserTest, ParseWithoutSeparators )
|
TEST( RiaDateStringParserTest, ParseWithoutSeparators )
|
||||||
{
|
{
|
||||||
QDateTime may2ndDT = QDateTime( QDate( 2011, 05, 02 ) );
|
QDateTime may2ndDT = RiaQDateTimeTools::createDateTime( QDate( 2011, 05, 02 ) );
|
||||||
QDateTime feb5thDT = QDateTime( QDate( 2011, 02, 05 ) );
|
QDateTime feb5thDT = RiaQDateTimeTools::createDateTime( QDate( 2011, 02, 05 ) );
|
||||||
may2ndDT.setTimeSpec( RiaQDateTimeTools::currentTimeSpec() );
|
may2ndDT.setTimeSpec( RiaQDateTimeTools::currentTimeSpec() );
|
||||||
feb5thDT.setTimeSpec( RiaQDateTimeTools::currentTimeSpec() );
|
feb5thDT.setTimeSpec( RiaQDateTimeTools::currentTimeSpec() );
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ TEST( RiaDateStringParserTest, ParseWithoutSeparators )
|
|||||||
EXPECT_FALSE( may2ndDT == RiaDateStringParser::parseDateString( may2ndMonthFirstString ) );
|
EXPECT_FALSE( may2ndDT == RiaDateStringParser::parseDateString( may2ndMonthFirstString ) );
|
||||||
EXPECT_TRUE( feb5thDT == RiaDateStringParser::parseDateString( may2ndMonthFirstString ) );
|
EXPECT_TRUE( feb5thDT == RiaDateStringParser::parseDateString( may2ndMonthFirstString ) );
|
||||||
|
|
||||||
QDateTime nov24thDT = QDateTime( QDate( 1992, 11, 24 ) );
|
QDateTime nov24thDT = RiaQDateTimeTools::createDateTime( QDate( 1992, 11, 24 ) );
|
||||||
nov24thDT.setTimeSpec( RiaQDateTimeTools::currentTimeSpec() );
|
nov24thDT.setTimeSpec( RiaQDateTimeTools::currentTimeSpec() );
|
||||||
|
|
||||||
std::vector<std::string> nov24thStrings = { "19921124", "24111992", "921124", "241192", "11241992", "112492" };
|
std::vector<std::string> nov24thStrings = { "19921124", "24111992", "921124", "241192", "11241992", "112492" };
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
#include "RiaTextStringTools.h"
|
||||||
|
|
||||||
#include "RifTextDataTableFormatter.h"
|
#include "RifTextDataTableFormatter.h"
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
@ -106,7 +108,7 @@ TEST( RifTextDataTableFormatter, LongLine )
|
|||||||
formatter.rowCompleted();
|
formatter.rowCompleted();
|
||||||
formatter.tableCompleted();
|
formatter.tableCompleted();
|
||||||
|
|
||||||
QStringList tableLines = tableText.split( QRegExp( "[\r\n]" ), QString::SkipEmptyParts );
|
QStringList tableLines = RiaTextStringTools::splitSkipEmptyParts( tableText, QRegExp( "[\r\n]" ) );
|
||||||
for ( QString line : tableLines )
|
for ( QString line : tableLines )
|
||||||
{
|
{
|
||||||
std::cout << QString( "Line: \"%1\"" ).arg( line ).toStdString() << std::endl;
|
std::cout << QString( "Line: \"%1\"" ).arg( line ).toStdString() << std::endl;
|
||||||
@ -153,7 +155,7 @@ TEST( RifTextDataTableFormatter, LongLine132 )
|
|||||||
formatter.rowCompleted();
|
formatter.rowCompleted();
|
||||||
formatter.tableCompleted();
|
formatter.tableCompleted();
|
||||||
|
|
||||||
QStringList tableLines = tableText.split( QRegExp( "[\r\n]" ), QString::SkipEmptyParts );
|
QStringList tableLines = RiaTextStringTools::splitSkipEmptyParts( tableText, QRegExp( "[\r\n]" ) );
|
||||||
for ( QString line : tableLines )
|
for ( QString line : tableLines )
|
||||||
{
|
{
|
||||||
std::cout << QString( "Line: \"%1\"" ).arg( line ).toStdString() << std::endl;
|
std::cout << QString( "Line: \"%1\"" ).arg( line ).toStdString() << std::endl;
|
||||||
@ -200,7 +202,7 @@ TEST( RifTextDataTableFormatter, LongLine133 )
|
|||||||
formatter.rowCompleted();
|
formatter.rowCompleted();
|
||||||
formatter.tableCompleted();
|
formatter.tableCompleted();
|
||||||
|
|
||||||
QStringList tableLines = tableText.split( QRegExp( "[\r\n]" ), QString::SkipEmptyParts );
|
QStringList tableLines = RiaTextStringTools::splitSkipEmptyParts( tableText, QRegExp( "[\r\n]" ) );
|
||||||
for ( QString line : tableLines )
|
for ( QString line : tableLines )
|
||||||
{
|
{
|
||||||
std::cout << QString( "Line: \"%1\"" ).arg( line ).toStdString() << std::endl;
|
std::cout << QString( "Line: \"%1\"" ).arg( line ).toStdString() << std::endl;
|
||||||
|
@ -18,8 +18,10 @@
|
|||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
#include "QDateTime"
|
#include <QDateTime>
|
||||||
#include "QDebug"
|
#include <QDebug>
|
||||||
|
#include <QElapsedTimer>
|
||||||
|
|
||||||
#include "RigHexIntersectionTools.h"
|
#include "RigHexIntersectionTools.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -74,12 +76,12 @@ TEST( RigHexIntersectionTools, DISABLED_planeHexCellIntersectionPerformanceTest
|
|||||||
fracturePlaneNotIntersecting.setFromPointAndNormal( cvf::Vec3d( 1.5, 1.5, 1.5 ), cvf::Vec3d( 1, 0, 0 ) );
|
fracturePlaneNotIntersecting.setFromPointAndNormal( cvf::Vec3d( 1.5, 1.5, 1.5 ), cvf::Vec3d( 1, 0, 0 ) );
|
||||||
fracturePlaneIntersecting.setFromPointAndNormal( cvf::Vec3d( 0.5, 0.5, 0.5 ), cvf::Vec3d( 1, 0, 0 ) );
|
fracturePlaneIntersecting.setFromPointAndNormal( cvf::Vec3d( 0.5, 0.5, 0.5 ), cvf::Vec3d( 1, 0, 0 ) );
|
||||||
|
|
||||||
QTime timeTotal;
|
QElapsedTimer timeTotal;
|
||||||
timeTotal.start();
|
timeTotal.start();
|
||||||
|
|
||||||
for ( int run = 0; run < 5; run++ )
|
for ( int run = 0; run < 5; run++ )
|
||||||
{
|
{
|
||||||
QTime timeLocal;
|
QElapsedTimer timeLocal;
|
||||||
timeLocal.start();
|
timeLocal.start();
|
||||||
|
|
||||||
for ( int i = 0; i < 2000000; i++ )
|
for ( int i = 0; i < 2000000; i++ )
|
||||||
|
@ -18,7 +18,10 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "RiuCadNavigation.h"
|
#include "RiuCadNavigation.h"
|
||||||
|
|
||||||
|
#include "caf.h"
|
||||||
#include "cafViewer.h"
|
#include "cafViewer.h"
|
||||||
|
|
||||||
#include "cvfCamera.h"
|
#include "cvfCamera.h"
|
||||||
#include "cvfHitItemCollection.h"
|
#include "cvfHitItemCollection.h"
|
||||||
#include "cvfManipulatorTrackball.h"
|
#include "cvfManipulatorTrackball.h"
|
||||||
@ -122,17 +125,18 @@ bool RiuCadNavigation::handleInputEvent( QInputEvent* inputEvent )
|
|||||||
if ( inputEvent->modifiers() == Qt::NoModifier )
|
if ( inputEvent->modifiers() == Qt::NoModifier )
|
||||||
{
|
{
|
||||||
QWheelEvent* we = static_cast<QWheelEvent*>( inputEvent );
|
QWheelEvent* we = static_cast<QWheelEvent*>( inputEvent );
|
||||||
|
auto position = caf::position( we );
|
||||||
|
|
||||||
updatePointOfInterestDuringZoomIfNecessary( we->x(), we->y() );
|
updatePointOfInterestDuringZoomIfNecessary( position.x(), position.y() );
|
||||||
|
|
||||||
if ( m_isRotCenterInitialized )
|
if ( m_isRotCenterInitialized )
|
||||||
{
|
{
|
||||||
int translatedMousePosX, translatedMousePosY;
|
int translatedMousePosX, translatedMousePosY;
|
||||||
cvfEventPos( we->x(), we->y(), &translatedMousePosX, &translatedMousePosY );
|
cvfEventPos( position.x(), position.y(), &translatedMousePosX, &translatedMousePosY );
|
||||||
|
|
||||||
cvf::ref<cvf::Ray> ray = createZoomRay( translatedMousePosX, translatedMousePosY );
|
cvf::ref<cvf::Ray> ray = createZoomRay( translatedMousePosX, translatedMousePosY );
|
||||||
|
|
||||||
zoomAlongRay( ray.p(), -we->delta() );
|
zoomAlongRay( ray.p(), -we->angleDelta().y() );
|
||||||
}
|
}
|
||||||
isEventHandled = true;
|
isEventHandled = true;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#include "RiuCategoryLegendFrame.h"
|
#include "RiuCategoryLegendFrame.h"
|
||||||
|
|
||||||
|
#include "RiaTextStringTools.h"
|
||||||
|
|
||||||
#include "cafCategoryLegend.h"
|
#include "cafCategoryLegend.h"
|
||||||
|
|
||||||
#include "cvfqtUtils.h"
|
#include "cvfqtUtils.h"
|
||||||
@ -29,7 +31,7 @@ RiuCategoryLegendFrame::~RiuCategoryLegendFrame()
|
|||||||
void RiuCategoryLegendFrame::layoutInfo( LayoutInfo* layout ) const
|
void RiuCategoryLegendFrame::layoutInfo( LayoutInfo* layout ) const
|
||||||
{
|
{
|
||||||
QFontMetrics fontMetrics( this->font() );
|
QFontMetrics fontMetrics( this->font() );
|
||||||
QStringList titleLines = m_title.split( "\n", QString::SkipEmptyParts );
|
QStringList titleLines = RiaTextStringTools::splitSkipEmptyParts( m_title, "\n" );
|
||||||
|
|
||||||
layout->charHeight = fontMetrics.height();
|
layout->charHeight = fontMetrics.height();
|
||||||
layout->charAscent = fontMetrics.ascent();
|
layout->charAscent = fontMetrics.ascent();
|
||||||
|
@ -235,7 +235,7 @@ Qt::DropActions RiuDragDrop::supportedDropActions() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
Qt::ItemFlags RiuDragDrop::flags( const QModelIndex& index ) const
|
Qt::ItemFlags RiuDragDrop::flags( const QModelIndex& index ) const
|
||||||
{
|
{
|
||||||
Qt::ItemFlags itemflags = nullptr;
|
Qt::ItemFlags itemflags;
|
||||||
|
|
||||||
if ( index.isValid() && RiaGuiApplication::activeMainWindow() )
|
if ( index.isValid() && RiaGuiApplication::activeMainWindow() )
|
||||||
{
|
{
|
||||||
|
@ -19,6 +19,8 @@
|
|||||||
|
|
||||||
#include "RiuFemTimeHistoryResultAccessor.h"
|
#include "RiuFemTimeHistoryResultAccessor.h"
|
||||||
|
|
||||||
|
#include "RiaNumberFormat.h"
|
||||||
|
|
||||||
#include "RigFemClosestResultIndexCalculator.h"
|
#include "RigFemClosestResultIndexCalculator.h"
|
||||||
#include "RigFemPart.h"
|
#include "RigFemPart.h"
|
||||||
#include "RigFemPartCollection.h"
|
#include "RigFemPartCollection.h"
|
||||||
@ -26,6 +28,7 @@
|
|||||||
#include "RigFemPartResultsCollection.h"
|
#include "RigFemPartResultsCollection.h"
|
||||||
#include "RigFemTypes.h"
|
#include "RigFemTypes.h"
|
||||||
#include "RigGeoMechCaseData.h"
|
#include "RigGeoMechCaseData.h"
|
||||||
|
|
||||||
#include "RiuGeoMechXfTensorResultAccessor.h"
|
#include "RiuGeoMechXfTensorResultAccessor.h"
|
||||||
|
|
||||||
#include <cmath> // Needed for HUGE_VAL on Linux
|
#include <cmath> // Needed for HUGE_VAL on Linux
|
||||||
@ -101,11 +104,12 @@ QString RiuFemTimeHistoryResultAccessor::geometrySelectionText() const
|
|||||||
cvf::Vec3d domainCoord = m_intersectionPointInDomain;
|
cvf::Vec3d domainCoord = m_intersectionPointInDomain;
|
||||||
text += QString( ", ijk[%1, %2, %3] " ).arg( i ).arg( j ).arg( k );
|
text += QString( ", ijk[%1, %2, %3] " ).arg( i ).arg( j ).arg( k );
|
||||||
|
|
||||||
QString formattedText;
|
auto xTxt = RiaNumberFormat::valueToText( domainCoord.x(), RiaNumberFormat::NumberFormatType::FIXED, 2 );
|
||||||
formattedText.sprintf( "Intersection point : [E: %.2f, N: %.2f, Depth: %.2f]",
|
auto yTxt = RiaNumberFormat::valueToText( domainCoord.y(), RiaNumberFormat::NumberFormatType::FIXED, 2 );
|
||||||
domainCoord.x(),
|
auto zTxt = RiaNumberFormat::valueToText( -domainCoord.z(), RiaNumberFormat::NumberFormatType::FIXED, 2 );
|
||||||
domainCoord.y(),
|
|
||||||
-domainCoord.z() );
|
QString formattedText =
|
||||||
|
QString( "Intersection point : [E: %1, N: %2, Depth: %3]" ).arg( xTxt ).arg( yTxt ).arg( zTxt );
|
||||||
|
|
||||||
text += formattedText;
|
text += formattedText;
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,10 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "RiuGeoQuestNavigation.h"
|
#include "RiuGeoQuestNavigation.h"
|
||||||
|
|
||||||
|
#include "caf.h"
|
||||||
#include "cafViewer.h"
|
#include "cafViewer.h"
|
||||||
|
|
||||||
#include "cvfCamera.h"
|
#include "cvfCamera.h"
|
||||||
#include "cvfHitItemCollection.h"
|
#include "cvfHitItemCollection.h"
|
||||||
#include "cvfManipulatorTrackball.h"
|
#include "cvfManipulatorTrackball.h"
|
||||||
@ -133,17 +136,18 @@ bool RiuGeoQuestNavigation::handleInputEvent( QInputEvent* inputEvent )
|
|||||||
if ( inputEvent->modifiers() == Qt::NoModifier )
|
if ( inputEvent->modifiers() == Qt::NoModifier )
|
||||||
{
|
{
|
||||||
QWheelEvent* we = static_cast<QWheelEvent*>( inputEvent );
|
QWheelEvent* we = static_cast<QWheelEvent*>( inputEvent );
|
||||||
|
auto position = caf::position( we );
|
||||||
|
|
||||||
updatePointOfInterestDuringZoomIfNecessary( we->x(), we->y() );
|
updatePointOfInterestDuringZoomIfNecessary( position.x(), position.y() );
|
||||||
|
|
||||||
if ( m_isRotCenterInitialized )
|
if ( m_isRotCenterInitialized )
|
||||||
{
|
{
|
||||||
int translatedMousePosX, translatedMousePosY;
|
int translatedMousePosX, translatedMousePosY;
|
||||||
cvfEventPos( we->x(), we->y(), &translatedMousePosX, &translatedMousePosY );
|
cvfEventPos( position.x(), position.y(), &translatedMousePosX, &translatedMousePosY );
|
||||||
|
|
||||||
cvf::ref<cvf::Ray> ray = createZoomRay( translatedMousePosX, translatedMousePosY );
|
cvf::ref<cvf::Ray> ray = createZoomRay( translatedMousePosX, translatedMousePosY );
|
||||||
|
|
||||||
zoomAlongRay( ray.p(), -we->delta() );
|
zoomAlongRay( ray.p(), -we->angleDelta().y() );
|
||||||
}
|
}
|
||||||
isEventHandled = true;
|
isEventHandled = true;
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ class QStringList;
|
|||||||
class RiuGridStatisticsHistogramWidget : public QWidget
|
class RiuGridStatisticsHistogramWidget : public QWidget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RiuGridStatisticsHistogramWidget( QWidget* parent = nullptr, Qt::WindowFlags f = nullptr );
|
RiuGridStatisticsHistogramWidget( QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags() );
|
||||||
|
|
||||||
void setHistogramData( double min, double max, const std::vector<size_t>& histogram );
|
void setHistogramData( double min, double max, const std::vector<size_t>& histogram );
|
||||||
void setPercentiles( double pmin, double pmax );
|
void setPercentiles( double pmin, double pmax );
|
||||||
|
@ -627,17 +627,12 @@ void RiuMultiPlotPage::reinsertPlotWidgets()
|
|||||||
plotWidgets[visibleIndex]->setAxesFontsAndAlignment( m_axisTitleFontSize, m_axisValueFontSize );
|
plotWidgets[visibleIndex]->setAxesFontsAndAlignment( m_axisTitleFontSize, m_axisValueFontSize );
|
||||||
|
|
||||||
{
|
{
|
||||||
int left = 0;
|
auto margins = plotWidgets[visibleIndex]->contentsMargins();
|
||||||
int top = 0;
|
margins.setBottom( 40 );
|
||||||
int right = 0;
|
|
||||||
int bot = 0;
|
|
||||||
|
|
||||||
plotWidgets[visibleIndex]->getContentsMargins( &left, &top, &right, &bot );
|
|
||||||
bot = 40;
|
|
||||||
|
|
||||||
// Adjust the space below a graph to make sure the heading of the row below is closest to the
|
// Adjust the space below a graph to make sure the heading of the row below is closest to the
|
||||||
// corresponding graph
|
// corresponding graph
|
||||||
plotWidgets[visibleIndex]->setContentsMargins( left, top, right, bot );
|
plotWidgets[visibleIndex]->setContentsMargins( margins );
|
||||||
}
|
}
|
||||||
|
|
||||||
plotWidgets[visibleIndex]->show();
|
plotWidgets[visibleIndex]->show();
|
||||||
|
@ -129,7 +129,7 @@ QRect RiuPlotCurveSymbol::labelBoundingRect( const QPainter* painter, const QRec
|
|||||||
int symbolWidth = symbolRect.width();
|
int symbolWidth = symbolRect.width();
|
||||||
int symbolHeight = symbolRect.height();
|
int symbolHeight = symbolRect.height();
|
||||||
|
|
||||||
int labelWidth = painter->fontMetrics().width( label );
|
int labelWidth = painter->fontMetrics().horizontalAdvance( label );
|
||||||
int labelHeight = painter->fontMetrics().height();
|
int labelHeight = painter->fontMetrics().height();
|
||||||
|
|
||||||
QPoint labelPosition;
|
QPoint labelPosition;
|
||||||
|
@ -33,7 +33,7 @@ class PdmObjectHandle;
|
|||||||
class RiuProjectAndPropertyView : public QWidget
|
class RiuProjectAndPropertyView : public QWidget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RiuProjectAndPropertyView( QWidget* parent = nullptr, Qt::WindowFlags f = nullptr );
|
RiuProjectAndPropertyView( QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags() );
|
||||||
|
|
||||||
void setPdmItem( caf::PdmUiItem* object );
|
void setPdmItem( caf::PdmUiItem* object );
|
||||||
void showProperties( caf::PdmObjectHandle* object );
|
void showProperties( caf::PdmObjectHandle* object );
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include "RiuQtChartsPlotCurve.h"
|
#include "RiuQtChartsPlotCurve.h"
|
||||||
#include "RiuQwtDateScaleWrapper.h"
|
#include "RiuQwtDateScaleWrapper.h"
|
||||||
|
|
||||||
|
#include "caf.h"
|
||||||
#include "cafAssert.h"
|
#include "cafAssert.h"
|
||||||
|
|
||||||
#include "cvfTrace.h"
|
#include "cvfTrace.h"
|
||||||
@ -1160,9 +1161,9 @@ void RiuQtChartsPlotWidget::dropEvent( QDropEvent* event )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuQtChartsPlotWidget::wheelEvent( QWheelEvent* event )
|
void RiuQtChartsPlotWidget::wheelEvent( QWheelEvent* wheelEvent )
|
||||||
{
|
{
|
||||||
float factor = event->angleDelta().y() > 0 ? 0.9 : 1.1;
|
float factor = wheelEvent->angleDelta().y() > 0 ? 0.9 : 1.1;
|
||||||
|
|
||||||
QRectF plotAreaRect = m_viewer->chart()->plotArea();
|
QRectF plotAreaRect = m_viewer->chart()->plotArea();
|
||||||
QPointF centerPoint = plotAreaRect.center();
|
QPointF centerPoint = plotAreaRect.center();
|
||||||
@ -1171,14 +1172,16 @@ void RiuQtChartsPlotWidget::wheelEvent( QWheelEvent* event )
|
|||||||
plotAreaRect.setWidth( plotAreaRect.width() * factor );
|
plotAreaRect.setWidth( plotAreaRect.width() * factor );
|
||||||
plotAreaRect.setHeight( plotAreaRect.height() * factor );
|
plotAreaRect.setHeight( plotAreaRect.height() * factor );
|
||||||
|
|
||||||
|
auto position = caf::position( wheelEvent );
|
||||||
|
|
||||||
// Find new center which keeps the mouse location in the same place in the plot
|
// Find new center which keeps the mouse location in the same place in the plot
|
||||||
QPointF newCenterPoint( ( 2 * centerPoint - event->pos() ) - ( centerPoint - event->pos() ) / factor );
|
QPointF newCenterPoint( ( 2 * centerPoint - position ) - ( centerPoint - position ) / factor );
|
||||||
plotAreaRect.moveCenter( newCenterPoint );
|
plotAreaRect.moveCenter( newCenterPoint );
|
||||||
|
|
||||||
// Zoom in on the adjusted plot area
|
// Zoom in on the adjusted plot area
|
||||||
m_viewer->chart()->zoomIn( plotAreaRect );
|
m_viewer->chart()->zoomIn( plotAreaRect );
|
||||||
|
|
||||||
event->accept();
|
wheelEvent->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
#include "RiuQwtPlotWheelZoomer.h"
|
#include "RiuQwtPlotWheelZoomer.h"
|
||||||
|
|
||||||
|
#include "caf.h"
|
||||||
|
|
||||||
#include "qwt_plot.h"
|
#include "qwt_plot.h"
|
||||||
#include "qwt_scale_div.h"
|
#include "qwt_scale_div.h"
|
||||||
|
|
||||||
@ -86,15 +88,16 @@ bool RiuQwtPlotWheelZoomer::eventFilter( QObject* watched, QEvent* event )
|
|||||||
if ( wheelEvent )
|
if ( wheelEvent )
|
||||||
{
|
{
|
||||||
double zoomFactor = 1.0 / RIU_SCROLLWHEEL_ZOOMFACTOR;
|
double zoomFactor = 1.0 / RIU_SCROLLWHEEL_ZOOMFACTOR;
|
||||||
if ( wheelEvent->delta() > 0 )
|
if ( wheelEvent->angleDelta().y() > 0 )
|
||||||
{
|
{
|
||||||
zoomFactor = RIU_SCROLLWHEEL_ZOOMFACTOR;
|
zoomFactor = RIU_SCROLLWHEEL_ZOOMFACTOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
zoomOnAxis( m_plot, QwtPlot::xBottom, zoomFactor, wheelEvent->pos().x() );
|
auto position = caf::position( wheelEvent );
|
||||||
zoomOnAxis( m_plot, QwtPlot::xTop, zoomFactor, wheelEvent->pos().x() );
|
zoomOnAxis( m_plot, QwtPlot::xBottom, zoomFactor, position.x() );
|
||||||
zoomOnAxis( m_plot, QwtPlot::yLeft, zoomFactor, wheelEvent->pos().y() );
|
zoomOnAxis( m_plot, QwtPlot::xTop, zoomFactor, position.x() );
|
||||||
zoomOnAxis( m_plot, QwtPlot::yRight, zoomFactor, wheelEvent->pos().y() );
|
zoomOnAxis( m_plot, QwtPlot::yLeft, zoomFactor, position.y() );
|
||||||
|
zoomOnAxis( m_plot, QwtPlot::yRight, zoomFactor, position.y() );
|
||||||
|
|
||||||
m_plot->replot();
|
m_plot->replot();
|
||||||
emit zoomUpdated();
|
emit zoomUpdated();
|
||||||
|
@ -18,7 +18,10 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "RiuRmsNavigation.h"
|
#include "RiuRmsNavigation.h"
|
||||||
|
|
||||||
|
#include "caf.h"
|
||||||
#include "cafViewer.h"
|
#include "cafViewer.h"
|
||||||
|
|
||||||
#include "cvfCamera.h"
|
#include "cvfCamera.h"
|
||||||
#include "cvfHitItemCollection.h"
|
#include "cvfHitItemCollection.h"
|
||||||
#include "cvfManipulatorTrackball.h"
|
#include "cvfManipulatorTrackball.h"
|
||||||
@ -158,17 +161,18 @@ bool RiuRmsNavigation::handleInputEvent( QInputEvent* inputEvent )
|
|||||||
if ( inputEvent->modifiers() == Qt::NoModifier )
|
if ( inputEvent->modifiers() == Qt::NoModifier )
|
||||||
{
|
{
|
||||||
QWheelEvent* we = static_cast<QWheelEvent*>( inputEvent );
|
QWheelEvent* we = static_cast<QWheelEvent*>( inputEvent );
|
||||||
|
auto position = caf::position( we );
|
||||||
|
|
||||||
updatePointOfInterestDuringZoomIfNecessary( we->x(), we->y() );
|
updatePointOfInterestDuringZoomIfNecessary( position.x(), position.y() );
|
||||||
|
|
||||||
if ( m_isRotCenterInitialized )
|
if ( m_isRotCenterInitialized )
|
||||||
{
|
{
|
||||||
int translatedMousePosX, translatedMousePosY;
|
int translatedMousePosX, translatedMousePosY;
|
||||||
cvfEventPos( we->x(), we->y(), &translatedMousePosX, &translatedMousePosY );
|
cvfEventPos( position.x(), position.y(), &translatedMousePosX, &translatedMousePosY );
|
||||||
|
|
||||||
cvf::ref<cvf::Ray> ray = createZoomRay( translatedMousePosX, translatedMousePosY );
|
cvf::ref<cvf::Ray> ray = createZoomRay( translatedMousePosX, translatedMousePosY );
|
||||||
|
|
||||||
zoomAlongRay( ray.p(), -we->delta() );
|
zoomAlongRay( ray.p(), -we->angleDelta().y() );
|
||||||
}
|
}
|
||||||
isEventHandled = true;
|
isEventHandled = true;
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,8 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
#include "RiuScalarMapperLegendFrame.h"
|
#include "RiuScalarMapperLegendFrame.h"
|
||||||
|
|
||||||
|
#include "RiaTextStringTools.h"
|
||||||
|
|
||||||
#include "cvfScalarMapperDiscreteLinear.h"
|
#include "cvfScalarMapperDiscreteLinear.h"
|
||||||
#include "cvfScalarMapperDiscreteLog.h"
|
#include "cvfScalarMapperDiscreteLog.h"
|
||||||
#include "cvfString.h"
|
#include "cvfString.h"
|
||||||
@ -72,7 +74,7 @@ void RiuScalarMapperLegendFrame::setTickFormat( NumberFormat format )
|
|||||||
void RiuScalarMapperLegendFrame::layoutInfo( LayoutInfo* layout ) const
|
void RiuScalarMapperLegendFrame::layoutInfo( LayoutInfo* layout ) const
|
||||||
{
|
{
|
||||||
QFontMetrics fontMetrics( this->font() );
|
QFontMetrics fontMetrics( this->font() );
|
||||||
QStringList titleLines = m_title.split( "\n", QString::SkipEmptyParts );
|
QStringList titleLines = RiaTextStringTools::splitSkipEmptyParts( m_title, "\n" );
|
||||||
|
|
||||||
layout->charHeight = fontMetrics.height();
|
layout->charHeight = fontMetrics.height();
|
||||||
layout->charAscent = fontMetrics.ascent();
|
layout->charAscent = fontMetrics.ascent();
|
||||||
|
@ -29,7 +29,7 @@ class QStringList;
|
|||||||
class RiuSimpleHistogramWidget : public QWidget
|
class RiuSimpleHistogramWidget : public QWidget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RiuSimpleHistogramWidget( const QString& objectName, QWidget* parent = nullptr, Qt::WindowFlags f = nullptr );
|
RiuSimpleHistogramWidget( const QString& objectName, QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags() );
|
||||||
|
|
||||||
void setHistogramData( double min, double max, const std::vector<size_t>& histogram );
|
void setHistogramData( double min, double max, const std::vector<size_t>& histogram );
|
||||||
void setPercentiles( double pmin, double pmax );
|
void setPercentiles( double pmin, double pmax );
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
#include "RiuTextContentFrame.h"
|
#include "RiuTextContentFrame.h"
|
||||||
|
|
||||||
|
#include "RiaTextStringTools.h"
|
||||||
|
|
||||||
#include "RiaFontCache.h"
|
#include "RiaFontCache.h"
|
||||||
#include "RiaPreferences.h"
|
#include "RiaPreferences.h"
|
||||||
|
|
||||||
@ -168,7 +170,7 @@ void RiuTextContentFrame::paintEvent( QPaintEvent* e )
|
|||||||
void RiuTextContentFrame::layoutInfo( LayoutInfo* layout ) const
|
void RiuTextContentFrame::layoutInfo( LayoutInfo* layout ) const
|
||||||
{
|
{
|
||||||
QFontMetrics fontMetrics( this->font() );
|
QFontMetrics fontMetrics( this->font() );
|
||||||
QStringList titleLines = m_text.split( "\n", QString::SkipEmptyParts );
|
QStringList titleLines = RiaTextStringTools::splitSkipEmptyParts( m_text, "\n" );
|
||||||
|
|
||||||
layout->charHeight = fontMetrics.height();
|
layout->charHeight = fontMetrics.height();
|
||||||
layout->charAscent = fontMetrics.ascent();
|
layout->charAscent = fontMetrics.ascent();
|
||||||
|
@ -16,6 +16,8 @@ find_package(
|
|||||||
set(QT_LIBRARIES Qt5::Core)
|
set(QT_LIBRARIES Qt5::Core)
|
||||||
|
|
||||||
set(PROJECT_FILES
|
set(PROJECT_FILES
|
||||||
|
caf.h
|
||||||
|
caf.cpp
|
||||||
cafAssert.h
|
cafAssert.h
|
||||||
cafAppEnum.h
|
cafAppEnum.h
|
||||||
cafClassTypeName.h
|
cafClassTypeName.h
|
||||||
|
81
Fwk/AppFwk/cafProjectDataModel/cafPdmCore/caf.cpp
Normal file
81
Fwk/AppFwk/cafProjectDataModel/cafPdmCore/caf.cpp
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
//##################################################################################################
|
||||||
|
//
|
||||||
|
// Custom Visualization Core library
|
||||||
|
// Copyright (C) 2020- Ceetron Solutions AS
|
||||||
|
//
|
||||||
|
// This library may be used under the terms of either the GNU General Public License or
|
||||||
|
// the GNU Lesser General Public License as follows:
|
||||||
|
//
|
||||||
|
// GNU General Public License Usage
|
||||||
|
// This library is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
//
|
||||||
|
// See the GNU General Public License at <<http://www.gnu.org/licenses/gpl.html>>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
// GNU Lesser General Public License Usage
|
||||||
|
// This library is free software; you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
// the Free Software Foundation; either version 2.1 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
//
|
||||||
|
// See the GNU Lesser General Public License at <<http://www.gnu.org/licenses/lgpl-2.1.html>>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
//##################################################################################################
|
||||||
|
#include "caf.h"
|
||||||
|
|
||||||
|
#include "QtGui/qevent.h"
|
||||||
|
#include <QLocale>
|
||||||
|
#include <QTextStream>
|
||||||
|
|
||||||
|
namespace caf
|
||||||
|
{
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QLocale norwegianLocale()
|
||||||
|
{
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK( 5, 15, 0 )
|
||||||
|
return QLocale::NorwegianBokmal;
|
||||||
|
#else
|
||||||
|
return QLocale::Norwegian;
|
||||||
|
#endif
|
||||||
|
} // namespace caf::norwegianLocale()
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QTextStream& endl( QTextStream& s )
|
||||||
|
{
|
||||||
|
// https: // github.com/qt/qtbase/blob/dev/src/corelib/serialization/qtextstream.cpp#L2845
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK( 5, 15, 0 )
|
||||||
|
return s << QLatin1Char( '\n' ) << Qt::flush;
|
||||||
|
#else
|
||||||
|
return s << QLatin1Char( '\n' ) << flush;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QPointF position( QWheelEvent* wheelEvent )
|
||||||
|
{
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK( 5, 15, 0 )
|
||||||
|
return wheelEvent->position();
|
||||||
|
#else
|
||||||
|
return wheelEvent->pos();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace caf
|
48
Fwk/AppFwk/cafProjectDataModel/cafPdmCore/caf.h
Normal file
48
Fwk/AppFwk/cafProjectDataModel/cafPdmCore/caf.h
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
//##################################################################################################
|
||||||
|
//
|
||||||
|
// Custom Visualization Core library
|
||||||
|
// Copyright (C) 2020- Ceetron Solutions AS
|
||||||
|
//
|
||||||
|
// This library may be used under the terms of either the GNU General Public License or
|
||||||
|
// the GNU Lesser General Public License as follows:
|
||||||
|
//
|
||||||
|
// GNU General Public License Usage
|
||||||
|
// This library is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
//
|
||||||
|
// See the GNU General Public License at <<http://www.gnu.org/licenses/gpl.html>>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
// GNU Lesser General Public License Usage
|
||||||
|
// This library is free software; you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
// the Free Software Foundation; either version 2.1 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
//
|
||||||
|
// See the GNU Lesser General Public License at <<http://www.gnu.org/licenses/lgpl-2.1.html>>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
//##################################################################################################
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
class QLocale;
|
||||||
|
class QTextStream;
|
||||||
|
class QPointF;
|
||||||
|
class QWheelEvent;
|
||||||
|
|
||||||
|
namespace caf
|
||||||
|
{
|
||||||
|
QLocale norwegianLocale();
|
||||||
|
QTextStream& endl( QTextStream& s );
|
||||||
|
QPointF position( QWheelEvent* wheelEvent );
|
||||||
|
}; // namespace caf
|
@ -69,7 +69,7 @@ public:
|
|||||||
void defineGridLayout(int rowCount, int columnCount);
|
void defineGridLayout(int rowCount, int columnCount);
|
||||||
|
|
||||||
// See QGridLayout::addWidget
|
// See QGridLayout::addWidget
|
||||||
void addWidget(QWidget* widget, int row, int column, int rowSpan, int columnSpan, Qt::Alignment alignment = nullptr);
|
void addWidget(QWidget* widget, int row, int column, int rowSpan, int columnSpan, Qt::Alignment alignment = Qt::Alignment());
|
||||||
void removeWidget(QWidget* widget);
|
void removeWidget(QWidget* widget);
|
||||||
|
|
||||||
void addBlankCell(int row, int column);
|
void addBlankCell(int row, int column);
|
||||||
|
@ -10,7 +10,7 @@ class WidgetLayoutTest : public QWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
WidgetLayoutTest(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
|
WidgetLayoutTest(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
|
||||||
~WidgetLayoutTest() override;
|
~WidgetLayoutTest() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -52,7 +52,7 @@ class PdmUiListView : public QWidget
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
PdmUiListView( QWidget* parent = nullptr, Qt::WindowFlags f = nullptr );
|
PdmUiListView( QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags() );
|
||||||
~PdmUiListView() override;
|
~PdmUiListView() override;
|
||||||
|
|
||||||
void setPdmObject( caf::PdmObjectCollection* object );
|
void setPdmObject( caf::PdmObjectCollection* object );
|
||||||
|
@ -59,7 +59,7 @@ class PdmUiTableView : public QWidget
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
PdmUiTableView( QWidget* parent = nullptr, Qt::WindowFlags f = nullptr );
|
PdmUiTableView( QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags() );
|
||||||
~PdmUiTableView() override;
|
~PdmUiTableView() override;
|
||||||
|
|
||||||
void setChildArrayField( PdmChildArrayFieldHandle* childArrayField );
|
void setChildArrayField( PdmChildArrayFieldHandle* childArrayField );
|
||||||
|
@ -64,7 +64,7 @@ class PdmUiTreeView : public QWidget
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
PdmUiTreeView( QWidget* parent = nullptr, Qt::WindowFlags f = nullptr );
|
PdmUiTreeView( QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags() );
|
||||||
~PdmUiTreeView() override;
|
~PdmUiTreeView() override;
|
||||||
|
|
||||||
void enableDefaultContextMenu( bool enable );
|
void enableDefaultContextMenu( bool enable );
|
||||||
|
@ -59,7 +59,7 @@ public:
|
|||||||
QWidget* parent,
|
QWidget* parent,
|
||||||
OpenGLWidget* shareWidget = nullptr,
|
OpenGLWidget* shareWidget = nullptr,
|
||||||
Qt::WindowFlags f = nullptr );
|
Qt::WindowFlags f = nullptr );
|
||||||
OpenGLWidget( OpenGLWidget* shareWidget, QWidget* parent, Qt::WindowFlags f = nullptr );
|
OpenGLWidget( OpenGLWidget* shareWidget, QWidget* parent, Qt::WindowFlags f = Qt::WindowFlags() );
|
||||||
|
|
||||||
cvf::OpenGLContext* cvfOpenGLContext() const;
|
cvf::OpenGLContext* cvfOpenGLContext() const;
|
||||||
void cvfShutdownOpenGLContext();
|
void cvfShutdownOpenGLContext();
|
||||||
|
Loading…
Reference in New Issue
Block a user