clang-format: Set column width to 140

* Set column width to 140
* Use c++20
* Remove redundant virtual
This commit is contained in:
Magne Sjaastad
2023-02-26 10:48:40 +01:00
committed by GitHub
parent 8768e186d8
commit f8c5cf389f
1535 changed files with 10456 additions and 19398 deletions
@@ -86,11 +86,9 @@ void RicAdvancedSnapshotExportFeature::onActionTriggered( bool isChecked )
}
{
QString fallbackFolderName =
RiaApplication::instance()->createAbsolutePathFromProjectRelativePath( "snapshots" );
QString fallbackFolderName = RiaApplication::instance()->createAbsolutePathFromProjectRelativePath( "snapshots" );
QString folderName =
RiaApplication::instance()->lastUsedDialogDirectoryWithFallback( "ADVANCED_SNAPSHOT_EXPORT",
fallbackFolderName );
RiaApplication::instance()->lastUsedDialogDirectoryWithFallback( "ADVANCED_SNAPSHOT_EXPORT", fallbackFolderName );
dlg.setExportFolder( folderName );
}
@@ -189,9 +187,7 @@ void RicAdvancedSnapshotExportFeature::exportMultipleSnapshots( const QString& f
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicAdvancedSnapshotExportFeature::exportViewVariations( Rim3dView* rimView,
RimAdvancedSnapshotExportDefinition* msd,
const QString& folder )
void RicAdvancedSnapshotExportFeature::exportViewVariations( Rim3dView* rimView, RimAdvancedSnapshotExportDefinition* msd, const QString& folder )
{
if ( !msd->selectedEclipseResults().empty() )
{
@@ -262,7 +258,7 @@ void RicAdvancedSnapshotExportFeature::exportViewVariationsToFolder( RimGridView
}
else
{
int gridIndex = 0;
int gridIndex = 0;
RimCellRangeFilter* rangeFilter = rimView->cellFilterCollection()->addNewCellRangeFilter( rimCase, gridIndex );
bool rangeFilterInitState = rimView->cellFilterCollection()->isActive();
@@ -43,8 +43,6 @@ public:
static void exportViewVariations( Rim3dView* rimView, RimAdvancedSnapshotExportDefinition* msd, const QString& folder );
private:
static void exportViewVariationsToFolder( RimGridView* rimView,
RimAdvancedSnapshotExportDefinition* msd,
const QString& folder );
static void exportViewVariationsToFolder( RimGridView* rimView, RimAdvancedSnapshotExportDefinition* msd, const QString& folder );
static QString resultName( Rim3dView* rimView );
};
@@ -105,9 +105,7 @@ QString RicCellRangeUi::gridName() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCellRangeUi::defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute )
void RicCellRangeUi::defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute )
{
caf::PdmUiSliderEditorAttribute* myAttr = dynamic_cast<caf::PdmUiSliderEditorAttribute*>( attribute );
if ( !myAttr )
@@ -168,9 +166,7 @@ QList<caf::PdmOptionItemInfo> RicCellRangeUi::calculateValueOptions( const caf::
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCellRangeUi::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
void RicCellRangeUi::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
clampValues();
@@ -43,12 +43,10 @@ public:
QString gridName() const;
private:
void defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute ) override;
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void clampValues();
void setDefaultValues();
@@ -90,19 +90,11 @@ void RicCreateDepthAdjustedLasFilesFeature::onActionTriggered( bool isChecked )
if ( eclipseCase != nullptr )
{
createDepthAdjustedWellLogFileFromEclipseCase( eclipseCase,
sourceWell,
destinationWells,
selectedResultProperties,
exportFolder );
createDepthAdjustedWellLogFileFromEclipseCase( eclipseCase, sourceWell, destinationWells, selectedResultProperties, exportFolder );
}
else if ( geomCase != nullptr )
{
createDepthAdjustedWellLogFileFromGeoMechCase( geomCase,
sourceWell,
destinationWells,
selectedResultProperties,
exportFolder );
createDepthAdjustedWellLogFileFromGeoMechCase( geomCase, sourceWell, destinationWells, selectedResultProperties, exportFolder );
}
}
}
@@ -119,18 +111,16 @@ void RicCreateDepthAdjustedLasFilesFeature::setupActionLook( QAction* actionToSe
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCreateDepthAdjustedLasFilesFeature::createDepthAdjustedWellLogFileFromEclipseCase(
RimEclipseCase* eclipseCase,
RimWellPath* sourceWell,
const std::vector<RimWellPath*> destinationWells,
const std::vector<QString>& selectedResultProperties,
const QString& exportFolder )
void RicCreateDepthAdjustedLasFilesFeature::createDepthAdjustedWellLogFileFromEclipseCase( RimEclipseCase* eclipseCase,
RimWellPath* sourceWell,
const std::vector<RimWellPath*> destinationWells,
const std::vector<QString>& selectedResultProperties,
const QString& exportFolder )
{
if ( sourceWell->wellLogFiles().empty() ) return;
RimWellLogPlotCollection* wellLogCollection = RimMainPlotCollection::current()->wellLogPlotCollection();
cvf::ref<RigEclipseWellLogExtractor> sourceWellExtractor =
wellLogCollection->findOrCreateExtractor( sourceWell, eclipseCase );
RimWellLogPlotCollection* wellLogCollection = RimMainPlotCollection::current()->wellLogPlotCollection();
cvf::ref<RigEclipseWellLogExtractor> sourceWellExtractor = wellLogCollection->findOrCreateExtractor( sourceWell, eclipseCase );
if ( sourceWellExtractor.isNull() )
{
RiaLogging::info( QString( "Could not create RigEclipseWellLogExtractor for %1" ).arg( sourceWell->name() ) );
@@ -148,19 +138,17 @@ void RicCreateDepthAdjustedLasFilesFeature::createDepthAdjustedWellLogFileFromEc
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCreateDepthAdjustedLasFilesFeature::createDepthAdjustedWellLogFileFromGeoMechCase(
RimGeoMechCase* geoMechCase,
RimWellPath* sourceWell,
const std::vector<RimWellPath*> destinationWells,
const std::vector<QString>& selectedResultProperties,
const QString& exportFolder )
void RicCreateDepthAdjustedLasFilesFeature::createDepthAdjustedWellLogFileFromGeoMechCase( RimGeoMechCase* geoMechCase,
RimWellPath* sourceWell,
const std::vector<RimWellPath*> destinationWells,
const std::vector<QString>& selectedResultProperties,
const QString& exportFolder )
{
if ( sourceWell->wellLogFiles().empty() ) return;
auto* wellLogFileData = sourceWell->wellLogFiles()[0]->wellLogFileData();
RimWellLogPlotCollection* wellLogCollection = RimMainPlotCollection::current()->wellLogPlotCollection();
cvf::ref<RigGeoMechWellLogExtractor> sourceWellExtractor =
wellLogCollection->findOrCreateExtractor( sourceWell, geoMechCase );
auto* wellLogFileData = sourceWell->wellLogFiles()[0]->wellLogFileData();
RimWellLogPlotCollection* wellLogCollection = RimMainPlotCollection::current()->wellLogPlotCollection();
cvf::ref<RigGeoMechWellLogExtractor> sourceWellExtractor = wellLogCollection->findOrCreateExtractor( sourceWell, geoMechCase );
if ( sourceWellExtractor.isNull() )
{
RiaLogging::info( QString( "Could not create RigGeoMechWellLogExtractor for %1" ).arg( sourceWell->name() ) );
@@ -84,9 +84,9 @@ cvf::ref<RigResultAccessor> RicCreateDepthAdjustedLasFilesImpl::createIndexKResu
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
LasDepthValueAndIndexPerKLayer RicCreateDepthAdjustedLasFilesImpl::createLasDepthIndexAndPercValuePerKLayerFromMap(
const std::vector<double>& lasWellDepths,
const std::map<int, IndexKDepthData>& indexKDepthDataMap )
LasDepthValueAndIndexPerKLayer
RicCreateDepthAdjustedLasFilesImpl::createLasDepthIndexAndPercValuePerKLayerFromMap( const std::vector<double>& lasWellDepths,
const std::map<int, IndexKDepthData>& indexKDepthDataMap )
{
// Create container of depth value (in percent) and its original index in a LAS file vector
// categorized by K-layer. Depth value as percentage value between MD top and MD bottom for K-layer.
@@ -115,9 +115,9 @@ LasDepthValueAndIndexPerKLayer RicCreateDepthAdjustedLasFilesImpl::createLasDept
void RicCreateDepthAdjustedLasFilesImpl::createDestinationWellsLasFiles( RimCase* selectedCase,
RimWellPath* sourceWell,
const std::vector<RimWellPath*> destinationWells,
const std::vector<QString>& selectedResultProperties,
const QString& exportFolder,
double rkbDiff )
const std::vector<QString>& selectedResultProperties,
const QString& exportFolder,
double rkbDiff )
{
auto* sourceWellLogData = sourceWell->wellLogFiles()[0]->wellLogFileData();
const auto defaultPropertyMap = createDefaultPropertyMap( selectedResultProperties, sourceWellLogData );
@@ -130,8 +130,7 @@ void RicCreateDepthAdjustedLasFilesImpl::createDestinationWellsLasFiles( RimCase
createIndexKDepthDataMapFromCase( selectedCase, sourceWell ) );
for ( RimWellPath* well : destinationWells )
{
const std::map<int, IndexKDepthData> destinationWellIndexKDepthsMap =
createIndexKDepthDataMapFromCase( selectedCase, well );
const std::map<int, IndexKDepthData> destinationWellIndexKDepthsMap = createIndexKDepthDataMapFromCase( selectedCase, well );
if ( destinationWellIndexKDepthsMap.empty() ) continue;
@@ -152,8 +151,7 @@ void RicCreateDepthAdjustedLasFilesImpl::createDestinationWellsLasFiles( RimCase
}
if ( sourceWellLogData->hasTvdRkbChannel() )
{
const double tvdRkbValue = depthPerc * ( depthData.tvdBottom - depthData.tvdTop ) +
depthData.tvdTop + rkbDiff;
const double tvdRkbValue = depthPerc * ( depthData.tvdBottom - depthData.tvdTop ) + depthData.tvdTop + rkbDiff;
tvdRkbValues.push_back( tvdRkbValue );
}
@@ -181,14 +179,14 @@ void RicCreateDepthAdjustedLasFilesImpl::createDestinationWellsLasFiles( RimCase
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCreateDepthAdjustedLasFilesImpl::createDestinationWellLasFile( const QString& wellName,
const QString& caseDescription,
const std::vector<double>& mdValues,
const std::vector<double>& tvdMslValues,
const std::vector<double>& tvdRkbValues,
void RicCreateDepthAdjustedLasFilesImpl::createDestinationWellLasFile( const QString& wellName,
const QString& caseDescription,
const std::vector<double>& mdValues,
const std::vector<double>& tvdMslValues,
const std::vector<double>& tvdRkbValues,
const std::map<QString, std::vector<double>>& propertyMap,
const RigWellLogFile* sourceWellLogData,
const QString& exportFolder )
const RigWellLogFile* sourceWellLogData,
const QString& exportFolder )
{
const auto depthUnitText = createDepthUnitText( sourceWellLogData->depthUnit() );
const auto depthUnitComment = createDepthUnitComment( sourceWellLogData->depthUnit() );
@@ -213,23 +211,15 @@ void RicCreateDepthAdjustedLasFilesImpl::createDestinationWellLasFile( const QSt
// Add tvd msl values if existing
if ( !tvdMslValues.empty() )
{
const auto unitText =
sourceWellLogData->wellLogChannelUnitString( RiaDefines::propertyNameTvdMslDepth(), deptUnit ).toStdString();
lasFile.AddLog( RiaDefines::propertyNameTvdMslDepth().toStdString(),
unitText,
"True vertical depth " + depthUnitComment,
tvdMslValues );
const auto unitText = sourceWellLogData->wellLogChannelUnitString( RiaDefines::propertyNameTvdMslDepth(), deptUnit ).toStdString();
lasFile.AddLog( RiaDefines::propertyNameTvdMslDepth().toStdString(), unitText, "True vertical depth " + depthUnitComment, tvdMslValues );
}
// Add tvd rkb values if existing
if ( !tvdRkbValues.empty() )
{
const auto unitText =
sourceWellLogData->wellLogChannelUnitString( RiaDefines::propertyNameTvdRkbDepth(), deptUnit ).toStdString();
lasFile.AddLog( RiaDefines::propertyNameTvdRkbDepth().toStdString(),
unitText,
"True vertical depth (Rotary Kelly Bushing)",
tvdRkbValues );
const auto unitText = sourceWellLogData->wellLogChannelUnitString( RiaDefines::propertyNameTvdRkbDepth(), deptUnit ).toStdString();
lasFile.AddLog( RiaDefines::propertyNameTvdRkbDepth().toStdString(), unitText, "True vertical depth (Rotary Kelly Bushing)", tvdRkbValues );
}
// Add property values
@@ -241,10 +231,7 @@ void RicCreateDepthAdjustedLasFilesImpl::createDestinationWellLasFile( const QSt
// Add comment to LAS file
const std::vector<std::string> commentHeader = {
QString( "Note: Generated depth adjusted LAS file for '%1', using '%2'" )
.arg( wellName )
.arg( sourceWellLogData->wellName() )
.toStdString() };
QString( "Note: Generated depth adjusted LAS file for '%1', using '%2'" ).arg( wellName ).arg( sourceWellLogData->wellName() ).toStdString() };
// Add property value to file name if single property
QString propertyNameStr;
@@ -260,8 +247,8 @@ void RicCreateDepthAdjustedLasFilesImpl::createDestinationWellLasFile( const QSt
destinationWell = destinationWell.replace( QRegExp( "[\\s]+" ), "_" );
// Create full file path name
QString fullPathName = exportFolder + "/" + destinationWell + "_Depth_Adjusted_Using_" + sourceWell + "_" +
caseDescription + propertyNameStr + "-" + sourceWellLogData->date() + ".las";
QString fullPathName = exportFolder + "/" + destinationWell + "_Depth_Adjusted_Using_" + sourceWell + "_" + caseDescription +
propertyNameStr + "-" + sourceWellLogData->date() + ".las";
lasFile.WriteToFile( fullPathName.toStdString(), commentHeader );
}
@@ -270,9 +257,7 @@ void RicCreateDepthAdjustedLasFilesImpl::createDestinationWellLasFile( const QSt
//--------------------------------------------------------------------------------------------------
std::string RicCreateDepthAdjustedLasFilesImpl::createDepthUnitText( RiaDefines::DepthUnitType depthUnitType )
{
return depthUnitType == RiaDefines::DepthUnitType::UNIT_METER
? "M"
: depthUnitType == RiaDefines::DepthUnitType::UNIT_FEET ? "FT" : "";
return depthUnitType == RiaDefines::DepthUnitType::UNIT_METER ? "M" : depthUnitType == RiaDefines::DepthUnitType::UNIT_FEET ? "FT" : "";
}
//--------------------------------------------------------------------------------------------------
@@ -297,8 +282,7 @@ std::map<int, RicCreateDepthAdjustedLasFilesImpl::IndexKDepthData>
RimWellLogPlotCollection* wellLogCollection = RimMainPlotCollection::current()->wellLogPlotCollection();
if ( eclipseCase != nullptr )
{
cvf::ref<RigEclipseWellLogExtractor> wellExtractor =
wellLogCollection->findOrCreateExtractor( wellPath, eclipseCase );
cvf::ref<RigEclipseWellLogExtractor> wellExtractor = wellLogCollection->findOrCreateExtractor( wellPath, eclipseCase );
if ( wellExtractor.isNull() )
{
RiaLogging::info( QString( "Could not create RigEclipseWellLogExtractor for %1" ).arg( wellPath->name() ) );
@@ -338,9 +322,7 @@ std::map<int, RicCreateDepthAdjustedLasFilesImpl::IndexKDepthData>
{
std::vector<double> wellIndexKValues;
wellExtractor->curveData( indexKResAcc.p(), &wellIndexKValues );
return createIndexKDepthDataMapFromVectors( wellExtractor->cellIntersectionMDs(),
wellExtractor->cellIntersectionTVDs(),
wellIndexKValues );
return createIndexKDepthDataMapFromVectors( wellExtractor->cellIntersectionMDs(), wellExtractor->cellIntersectionTVDs(), wellIndexKValues );
}
//--------------------------------------------------------------------------------------------------
@@ -354,9 +336,7 @@ std::map<int, RicCreateDepthAdjustedLasFilesImpl::IndexKDepthData>
RigFemResultAddress indexKResAdr( RigFemResultPosEnum::RIG_ELEMENT_NODAL, "INDEX", "INDEX_K" );
std::vector<double> wellIndexKValues;
wellExtractor->curveData( indexKResAdr, timeStepIdx, frameIdx, &wellIndexKValues );
return createIndexKDepthDataMapFromVectors( wellExtractor->cellIntersectionMDs(),
wellExtractor->cellIntersectionTVDs(),
wellIndexKValues );
return createIndexKDepthDataMapFromVectors( wellExtractor->cellIntersectionMDs(), wellExtractor->cellIntersectionTVDs(), wellIndexKValues );
}
//--------------------------------------------------------------------------------------------------
@@ -412,9 +392,8 @@ std::map<QString, std::vector<double>>
RicCreateDepthAdjustedLasFilesImpl::createDefaultPropertyMap( const std::vector<QString>& selectedProperties,
const RigWellLogFile* wellLogFile )
{
const QStringList lasDepthNames = QStringList( { RiaDefines::propertyNameMeasuredDepth(),
RiaDefines::propertyNameTvdMslDepth(),
RiaDefines::propertyNameTvdRkbDepth() } );
const QStringList lasDepthNames = QStringList(
{ RiaDefines::propertyNameMeasuredDepth(), RiaDefines::propertyNameTvdMslDepth(), RiaDefines::propertyNameTvdRkbDepth() } );
std::vector<QString> validPropertyNames;
for ( const auto& propertyName : selectedProperties )
{
@@ -81,8 +81,7 @@ void createDestinationWellLasFile( const QString&
std::string createDepthUnitText( RiaDefines::DepthUnitType depthUnitType );
std::string createDepthUnitComment( RiaDefines::DepthUnitType depthUnitType );
LasDepthValueAndIndexPerKLayer
createLasDepthIndexAndPercValuePerKLayerFromMap( const std::vector<double>& lasWellDepths,
LasDepthValueAndIndexPerKLayer createLasDepthIndexAndPercValuePerKLayerFromMap( const std::vector<double>& lasWellDepths,
const std::map<int, IndexKDepthData>& indexKDepthDataMap );
std::map<int, IndexKDepthData> createIndexKDepthDataMapFromCase( RimCase* selectedCase, RimWellPath* wellPath );
std::map<int, IndexKDepthData> createIndexKDepthDataMap( cvf::ref<RigEclipseWellLogExtractor> wellExtractor,
@@ -63,8 +63,7 @@ RicCreateDepthAdjustedLasFilesUi::~RicCreateDepthAdjustedLasFilesUi()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo>
RicCreateDepthAdjustedLasFilesUi::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
QList<caf::PdmOptionItemInfo> RicCreateDepthAdjustedLasFilesUi::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
{
QList<caf::PdmOptionItemInfo> options;
@@ -132,9 +131,7 @@ QList<caf::PdmOptionItemInfo>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCreateDepthAdjustedLasFilesUi::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
void RicCreateDepthAdjustedLasFilesUi::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
if ( changedField == &sourceWell )
{
@@ -175,9 +172,8 @@ void RicCreateDepthAdjustedLasFilesUi::defineEditorAttribute( const caf::PdmFiel
void RicCreateDepthAdjustedLasFilesUi::setDefaultValues()
{
// Default folder directory
QString defaultDir =
RiaApplication::instance()->lastUsedDialogDirectoryWithFallbackToProjectFolder( "WELL_LOGS_DIR" );
exportFolder = defaultDir;
QString defaultDir = RiaApplication::instance()->lastUsedDialogDirectoryWithFallbackToProjectFolder( "WELL_LOGS_DIR" );
exportFolder = defaultDir;
// Default selected case and source well
RimProject* proj = RimProject::current();
@@ -205,8 +201,8 @@ void RicCreateDepthAdjustedLasFilesUi::setDefaultValues()
//--------------------------------------------------------------------------------------------------
bool RicCreateDepthAdjustedLasFilesUi::hasValidSelections() const
{
return !exportFolder().isEmpty() && sourceWell() != nullptr && selectedCase() != nullptr &&
wellLogFile != nullptr && !selectedResultProperties().empty() && !destinationWells.empty();
return !exportFolder().isEmpty() && sourceWell() != nullptr && selectedCase() != nullptr && wellLogFile != nullptr &&
!selectedResultProperties().empty() && !destinationWells.empty();
}
//--------------------------------------------------------------------------------------------------
@@ -46,10 +46,8 @@ public:
~RicCreateDepthAdjustedLasFilesUi() override;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
void setDefaultValues();
bool hasValidSelections() const;
@@ -67,7 +65,6 @@ protected:
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
private:
const QStringList m_depthProperties = QStringList( { RiaDefines::propertyNameMeasuredDepth(),
RiaDefines::propertyNameTvdMslDepth(),
RiaDefines::propertyNameTvdRkbDepth() } );
const QStringList m_depthProperties = QStringList(
{ RiaDefines::propertyNameMeasuredDepth(), RiaDefines::propertyNameTvdMslDepth(), RiaDefines::propertyNameTvdRkbDepth() } );
};
@@ -46,12 +46,11 @@ bool RicEclipseCellResultToFileImpl::writePropertyToTextFile( const QString&
CVF_TIGHT_ASSERT( eclipseCase );
if ( !eclipseCase ) return false;
cvf::ref<RigResultAccessor> resultAccessor =
RigResultAccessorFactory::createFromResultAddress( eclipseCase,
0,
RiaDefines::PorosityModelType::MATRIX_MODEL,
timeStep,
RigEclipseResultAddress( resultName ) );
cvf::ref<RigResultAccessor> resultAccessor = RigResultAccessorFactory::createFromResultAddress( eclipseCase,
0,
RiaDefines::PorosityModelType::MATRIX_MODEL,
timeStep,
RigEclipseResultAddress( resultName ) );
if ( resultAccessor.isNull() )
{
return false;
@@ -89,14 +88,7 @@ bool RicEclipseCellResultToFileImpl::writeBinaryResultToTextFile( const QString&
return false;
}
return writeResultToTextFile( fileName,
eclipseCase,
resultAccessor.p(),
eclipseKeyword,
undefinedValue,
logPrefix,
writeEchoKeywords,
errorMsg );
return writeResultToTextFile( fileName, eclipseCase, resultAccessor.p(), eclipseKeyword, undefinedValue, logPrefix, writeEchoKeywords, errorMsg );
}
//--------------------------------------------------------------------------------------------------
@@ -62,8 +62,5 @@ public:
bool writeEchoKeywords,
QString* errorMsg );
static void writeDataToTextFile( QFile* file,
bool writeEchoKeywords,
const QString& eclipseKeyword,
const std::vector<double>& resultData );
static void writeDataToTextFile( QFile* file, bool writeEchoKeywords, const QString& eclipseKeyword, const std::vector<double>& resultData );
};
@@ -156,9 +156,7 @@ QList<caf::PdmOptionItemInfo> RicExportCarfinUi::calculateValueOptions( const ca
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportCarfinUi::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
void RicExportCarfinUi::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
if ( changedField == &m_caseToApply )
{
@@ -188,9 +186,7 @@ void RicExportCarfinUi::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderi
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportCarfinUi::defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute )
void RicExportCarfinUi::defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute )
{
if ( field == &m_exportFileName )
{
@@ -55,11 +55,9 @@ private:
void setDefaultValuesFromCase();
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
private:
caf::PdmField<QString> m_exportFileName;
@@ -96,18 +96,14 @@ void RicExportEclipseSectorModelFeature::executeCommand( RimEclipseView*
const RicExportEclipseSectorModelUi& exportSettings,
const QString& logPrefix )
{
int resultProgressPercentage =
exportSettings.exportParameters() ? std::min( (int)exportSettings.selectedKeywords().size(), 20 ) : 0;
int resultProgressPercentage = exportSettings.exportParameters() ? std::min( (int)exportSettings.selectedKeywords().size(), 20 ) : 0;
int faultsProgressPercentage = exportSettings.exportFaults() ? 10 : 0;
int gridProgressPercentage = 100 - resultProgressPercentage - faultsProgressPercentage;
caf::ProgressInfo progress( gridProgressPercentage + resultProgressPercentage + faultsProgressPercentage,
"Export Eclipse Sector Model" );
caf::ProgressInfo progress( gridProgressPercentage + resultProgressPercentage + faultsProgressPercentage, "Export Eclipse Sector Model" );
cvf::Vec3st refinement( exportSettings.refinementCountI(),
exportSettings.refinementCountJ(),
exportSettings.refinementCountK() );
cvf::Vec3st refinement( exportSettings.refinementCountI(), exportSettings.refinementCountJ(), exportSettings.refinementCountK() );
CVF_ASSERT( refinement.x() > 0u && refinement.y() > 0u && refinement.z() > 0u );
@@ -120,9 +116,8 @@ void RicExportEclipseSectorModelFeature::executeCommand( RimEclipseView*
if ( exportSettings.exportGrid() )
{
const cvf::UByteArray* cellVisibilityForActnum = exportSettings.makeInvisibleCellsInactive() ? &cellVisibility
: nullptr;
auto task = progress.task( "Export Grid", gridProgressPercentage );
const cvf::UByteArray* cellVisibilityForActnum = exportSettings.makeInvisibleCellsInactive() ? &cellVisibility : nullptr;
auto task = progress.task( "Export Grid", gridProgressPercentage );
bool worked = RifEclipseInputFileTools::exportGrid( exportSettings.exportGridFilename(),
view->eclipseCase()->eclipseCaseData(),
@@ -239,14 +234,12 @@ void RicExportEclipseSectorModelFeature::executeCommand( RimEclipseView*
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::pair<cvf::Vec3i, cvf::Vec3i>
RicExportEclipseSectorModelFeature::getVisibleCellRange( RimEclipseView* view, const cvf::UByteArray& cellVisibillity )
std::pair<cvf::Vec3i, cvf::Vec3i> RicExportEclipseSectorModelFeature::getVisibleCellRange( RimEclipseView* view,
const cvf::UByteArray& cellVisibillity )
{
const RigMainGrid* mainGrid = view->eclipseCase()->mainGrid();
cvf::Vec3i max = cvf::Vec3i::ZERO;
cvf::Vec3i min = cvf::Vec3i( int( mainGrid->cellCountI() - 1 ),
int( mainGrid->cellCountJ() - 1 ),
int( mainGrid->cellCountK() - 1 ) );
cvf::Vec3i min = cvf::Vec3i( int( mainGrid->cellCountI() - 1 ), int( mainGrid->cellCountJ() - 1 ), int( mainGrid->cellCountK() - 1 ) );
size_t cellCount = mainGrid->cellCount();
for ( size_t index = 0; index < cellCount; ++index )
@@ -35,12 +35,9 @@ class RicExportEclipseSectorModelFeature : public caf::CmdFeature
public:
static void openDialogAndExecuteCommand( RimEclipseView* view );
static void executeCommand( RimEclipseView* view,
const RicExportEclipseSectorModelUi& exportSettings,
const QString& logPrefix );
static void executeCommand( RimEclipseView* view, const RicExportEclipseSectorModelUi& exportSettings, const QString& logPrefix );
static std::pair<cvf::Vec3i, cvf::Vec3i> getVisibleCellRange( RimEclipseView* view,
const cvf::UByteArray& cellVisibility );
static std::pair<cvf::Vec3i, cvf::Vec3i> getVisibleCellRange( RimEclipseView* view, const cvf::UByteArray& cellVisibility );
protected:
bool isCommandEnabled() override;
@@ -80,13 +80,7 @@ RicExportEclipseSectorModelUi::RicExportEclipseSectorModelUi()
CAF_PDM_InitField( &exportGrid, "ExportGrid", true, "Export Grid Data", "", "Includes COORD, ZCORN and ACTNUM", "" );
CAF_PDM_InitField( &m_exportGridFilename, "ExportGridFilename", QString(), "Grid File Name" );
CAF_PDM_InitField( &exportInLocalCoordinates,
"ExportInLocalCoords",
false,
"Export in Local Coordinates",
"",
"Remove UTM location on export",
"" );
CAF_PDM_InitField( &exportInLocalCoordinates, "ExportInLocalCoords", false, "Export in Local Coordinates", "", "Remove UTM location on export", "" );
CAF_PDM_InitField( &makeInvisibleCellsInactive, "InvisibleCellActnum", false, "Make Invisible Cells Inactive" );
CAF_PDM_InitFieldNoDefault( &exportGridBox, "GridBoxSelection", "Cells to Export" );
@@ -173,9 +167,8 @@ void RicExportEclipseSectorModelUi::setCaseData( RigEclipseCaseData* caseData /*
{
for ( const QString& keyword : mainKeywords() )
{
if ( caseData &&
caseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL )
->hasResultEntry( RigEclipseResultAddress( RiaDefines::ResultCatType::STATIC_NATIVE, keyword ) ) )
if ( caseData && caseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL )
->hasResultEntry( RigEclipseResultAddress( RiaDefines::ResultCatType::STATIC_NATIVE, keyword ) ) )
{
selectedKeywords.v().push_back( keyword );
}
@@ -186,9 +179,8 @@ void RicExportEclipseSectorModelUi::setCaseData( RigEclipseCaseData* caseData /*
std::vector<QString> validSelectedKeywords;
for ( const QString& keyword : selectedKeywords() )
{
if ( caseData &&
caseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL )
->hasResultEntry( RigEclipseResultAddress( RiaDefines::ResultCatType::STATIC_NATIVE, keyword ) ) )
if ( caseData && caseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL )
->hasResultEntry( RigEclipseResultAddress( RiaDefines::ResultCatType::STATIC_NATIVE, keyword ) ) )
{
validSelectedKeywords.push_back( keyword );
}
@@ -243,7 +235,7 @@ void RicExportEclipseSectorModelUi::defineEditorAttribute( const caf::PdmFieldHa
if ( !m_caseData ) return;
const RigMainGrid* mainGrid = m_caseData->mainGrid();
cvf::Vec3i gridDimensions( int( mainGrid->cellCountI() ), int( mainGrid->cellCountJ() ), int( mainGrid->cellCountK() ) );
cvf::Vec3i gridDimensions( int( mainGrid->cellCountI() ), int( mainGrid->cellCountJ() ), int( mainGrid->cellCountK() ) );
auto* lineEditorAttr = dynamic_cast<caf::PdmUiLineEditorAttribute*>( attribute );
@@ -383,9 +375,7 @@ void RicExportEclipseSectorModelUi::defineUiOrdering( QString uiConfigName, caf:
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportEclipseSectorModelUi::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
void RicExportEclipseSectorModelUi::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
if ( changedField == &exportGrid )
{
@@ -412,24 +402,21 @@ void RicExportEclipseSectorModelUi::fieldChangedByUi( const caf::PdmFieldHandle*
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo>
RicExportEclipseSectorModelUi::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
QList<caf::PdmOptionItemInfo> RicExportEclipseSectorModelUi::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
{
QList<caf::PdmOptionItemInfo> options;
if ( fieldNeedingOptions == &selectedKeywords )
{
RigCaseCellResultsData* resultData = m_caseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL );
QList<caf::PdmOptionItemInfo> allOptions =
RimEclipseResultDefinition::calcOptionsForVariableUiFieldStandard( RiaDefines::ResultCatType::STATIC_NATIVE,
resultData );
RimEclipseResultDefinition::calcOptionsForVariableUiFieldStandard( RiaDefines::ResultCatType::STATIC_NATIVE, resultData );
std::set<QString> mainKeywords = this->mainKeywords();
for ( const caf::PdmOptionItemInfo& option : allOptions )
{
if ( mainKeywords.count( option.optionUiText() ) )
{
if ( resultData->hasResultEntry(
RigEclipseResultAddress( RiaDefines::ResultCatType::STATIC_NATIVE, option.optionUiText() ) ) )
if ( resultData->hasResultEntry( RigEclipseResultAddress( RiaDefines::ResultCatType::STATIC_NATIVE, option.optionUiText() ) ) )
{
options.push_back( option );
}
@@ -439,8 +426,7 @@ QList<caf::PdmOptionItemInfo>
{
if ( !mainKeywords.count( option.optionUiText() ) && option.optionUiText() != "None" )
{
if ( resultData->hasResultEntry(
RigEclipseResultAddress( RiaDefines::ResultCatType::STATIC_NATIVE, option.optionUiText() ) ) )
if ( resultData->hasResultEntry( RigEclipseResultAddress( RiaDefines::ResultCatType::STATIC_NATIVE, option.optionUiText() ) ) )
{
if ( option.optionUiText() == "ACTNUM" && exportGrid() )
{
@@ -457,9 +443,7 @@ QList<caf::PdmOptionItemInfo>
}
else if ( fieldNeedingOptions == &exportFaults )
{
std::set<ResultExportOptions> validFaultOptions = { EXPORT_NO_RESULTS,
EXPORT_TO_GRID_FILE,
EXPORT_TO_SINGLE_SEPARATE_FILE };
std::set<ResultExportOptions> validFaultOptions = { EXPORT_NO_RESULTS, EXPORT_TO_GRID_FILE, EXPORT_TO_SINGLE_SEPARATE_FILE };
if ( !exportGrid() ) validFaultOptions.erase( EXPORT_TO_GRID_FILE );
for ( ResultExportOptions option : validFaultOptions )
{
@@ -499,8 +483,7 @@ QString RicExportEclipseSectorModelUi::defaultFolder() const
if ( fallbackDirectory.isEmpty() )
{
QString generalFallback = RiaApplication::instance()->lastUsedDialogDirectory( "GENERAL_DATA" );
fallbackDirectory =
RiaApplication::instance()->lastUsedDialogDirectoryWithFallback( "BINARY_GRID", generalFallback );
fallbackDirectory = RiaApplication::instance()->lastUsedDialogDirectoryWithFallback( "BINARY_GRID", generalFallback );
}
return RiaApplication::instance()->lastUsedDialogDirectoryWithFallback( "EXPORT_INPUT_GRID", fallbackDirectory );
}
@@ -549,9 +532,7 @@ void RicExportEclipseSectorModelUi::applyBoundaryDefaults()
else if ( exportGridBox == FULL_GRID_BOX )
{
const RigMainGrid* mainGrid = m_caseData->mainGrid();
cvf::Vec3i gridDimensions( int( mainGrid->cellCountI() - 1 ),
int( mainGrid->cellCountJ() - 1 ),
int( mainGrid->cellCountK() - 1 ) );
cvf::Vec3i gridDimensions( int( mainGrid->cellCountI() - 1 ), int( mainGrid->cellCountJ() - 1 ), int( mainGrid->cellCountK() - 1 ) );
setMin( cvf::Vec3i( 0, 0, 0 ) );
setMax( gridDimensions );
@@ -103,11 +103,9 @@ protected:
caf::PdmField<int> minK;
caf::PdmField<int> maxK;
void defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
static std::set<QString> mainKeywords();
@@ -217,9 +217,8 @@ private:
//--------------------------------------------------------------------------------------------------
// Internal function
//--------------------------------------------------------------------------------------------------
std::vector<RigCompletionData>
filterCompletionsOnType( const std::vector<RigCompletionData>& completions,
const std::set<RigCompletionData::CompletionType>& includedCompletionTypes )
std::vector<RigCompletionData> filterCompletionsOnType( const std::vector<RigCompletionData>& completions,
const std::set<RigCompletionData::CompletionType>& includedCompletionTypes )
{
std::vector<RigCompletionData> filtered;
for ( const auto& completion : completions )
@@ -272,10 +271,8 @@ QString completionName( const caf::PdmObject* object )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicExportLgrUi* RicExportLgrFeature::openDialog( const QString& dialogTitle,
RimEclipseCase* defaultCase,
int defaultTimeStep,
bool hideExportFolderField )
RicExportLgrUi*
RicExportLgrFeature::openDialog( const QString& dialogTitle, RimEclipseCase* defaultCase, int defaultTimeStep, bool hideExportFolderField )
{
RiaApplication* app = RiaApplication::instance();
RimProject* proj = app->project();
@@ -311,11 +308,7 @@ RicExportLgrUi* RicExportLgrFeature::openDialog( const QString& dialogTitle,
featureUi->setTimeStep( defaultTimeStep );
featureUi->hideExportFolderField( hideExportFolderField );
caf::PdmUiPropertyViewDialog propertyDialog( nullptr,
featureUi,
dialogTitle,
"",
QDialogButtonBox::Ok | QDialogButtonBox::Cancel );
caf::PdmUiPropertyViewDialog propertyDialog( nullptr, featureUi, dialogTitle, "", QDialogButtonBox::Ok | QDialogButtonBox::Cancel );
propertyDialog.resize( QSize( 300, 320 ) );
if ( propertyDialog.exec() == QDialog::Accepted && !featureUi->exportFolder().isEmpty() )
@@ -403,17 +396,11 @@ void RicExportLgrFeature::exportLgrsForWellPaths( const QString&
caf::VecIjk lgrCellCounts,
Lgr::SplitType splitType,
const std::set<RigCompletionData::CompletionType>& completionTypes,
QStringList* wellsIntersectingOtherLgrs )
QStringList* wellsIntersectingOtherLgrs )
{
std::vector<LgrInfo> lgrs;
lgrs = buildLgrsForWellPaths( wellPaths,
eclipseCase,
timeStep,
lgrCellCounts,
splitType,
completionTypes,
wellsIntersectingOtherLgrs );
lgrs = buildLgrsForWellPaths( wellPaths, eclipseCase, timeStep, lgrCellCounts, splitType, completionTypes, wellsIntersectingOtherLgrs );
for ( const auto& wellPath : wellPaths )
{
@@ -452,14 +439,13 @@ void RicExportLgrFeature::exportLgrs( const QString& exportFolder, const QString
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<LgrInfo>
RicExportLgrFeature::buildLgrsForWellPaths( std::vector<RimWellPath*> wellPaths,
RimEclipseCase* eclipseCase,
size_t timeStep,
caf::VecIjk lgrCellCounts,
Lgr::SplitType splitType,
const std::set<RigCompletionData::CompletionType>& completionTypes,
QStringList* wellsIntersectingOtherLgrs )
std::vector<LgrInfo> RicExportLgrFeature::buildLgrsForWellPaths( std::vector<RimWellPath*> wellPaths,
RimEclipseCase* eclipseCase,
size_t timeStep,
caf::VecIjk lgrCellCounts,
Lgr::SplitType splitType,
const std::set<RigCompletionData::CompletionType>& completionTypes,
QStringList* wellsIntersectingOtherLgrs )
{
std::vector<LgrInfo> lgrs;
LgrNameFactory lgrNameFactory;
@@ -474,8 +460,7 @@ std::vector<LgrInfo>
{
for ( const auto& wellPath : wellPaths )
{
auto intersectingCells =
cellsIntersectingCompletions( eclipseCase, wellPath, timeStep, completionTypes, &isIntersectingOtherLgrs );
auto intersectingCells = cellsIntersectingCompletions( eclipseCase, wellPath, timeStep, completionTypes, &isIntersectingOtherLgrs );
if ( intersectingCells.empty() )
{
@@ -483,12 +468,8 @@ std::vector<LgrInfo>
intersectingCells = allIntersectedCells( eclipseCase, wellPath );
}
auto newLgrs = buildLgrsPerMainCell( firstLgrId + (int)lgrs.size(),
eclipseCase,
wellPath,
intersectingCells,
lgrCellCounts,
lgrNameFactory );
auto newLgrs =
buildLgrsPerMainCell( firstLgrId + (int)lgrs.size(), eclipseCase, wellPath, intersectingCells, lgrCellCounts, lgrNameFactory );
lgrs.insert( lgrs.end(), newLgrs.begin(), newLgrs.end() );
if ( isIntersectingOtherLgrs ) wellsIntersectingOtherLgrs->push_back( wellPath->name() );
@@ -496,18 +477,12 @@ std::vector<LgrInfo>
}
else if ( splitType == Lgr::LGR_PER_COMPLETION )
{
auto intersectingCells = cellsIntersectingCompletions_PerCompletion( eclipseCase,
wellPaths,
timeStep,
completionTypes,
wellsIntersectingOtherLgrs );
auto intersectingCells =
cellsIntersectingCompletions_PerCompletion( eclipseCase, wellPaths, timeStep, completionTypes, wellsIntersectingOtherLgrs );
if ( !intersectingCells.empty() )
{
auto newLgrs = buildLgrsPerCompletion( firstLgrId + (int)lgrs.size(),
eclipseCase,
intersectingCells,
lgrCellCounts,
lgrNameFactory );
auto newLgrs =
buildLgrsPerCompletion( firstLgrId + (int)lgrs.size(), eclipseCase, intersectingCells, lgrCellCounts, lgrNameFactory );
lgrs.insert( lgrs.end(), newLgrs.begin(), newLgrs.end() );
}
}
@@ -518,8 +493,7 @@ std::vector<LgrInfo>
int lgrId = firstLgrId + (int)lgrs.size();
auto lgrName = lgrNameFactory.newName( "WELL", lgrId );
auto intersectingCells =
cellsIntersectingCompletions( eclipseCase, wellPath, timeStep, completionTypes, &isIntersectingOtherLgrs );
auto intersectingCells = cellsIntersectingCompletions( eclipseCase, wellPath, timeStep, completionTypes, &isIntersectingOtherLgrs );
if ( intersectingCells.empty() )
{
@@ -529,8 +503,7 @@ std::vector<LgrInfo>
if ( !intersectingCells.empty() )
{
lgrs.push_back(
buildLgr( lgrId, lgrName, eclipseCase, wellPath->name(), intersectingCells, lgrCellCounts ) );
lgrs.push_back( buildLgr( lgrId, lgrName, eclipseCase, wellPath->name(), intersectingCells, lgrCellCounts ) );
}
if ( isIntersectingOtherLgrs ) wellsIntersectingOtherLgrs->push_back( wellPath->name() );
@@ -543,13 +516,12 @@ std::vector<LgrInfo>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<LgrInfo>
RicExportLgrFeature::buildLgrsPerMainCell( int firstLgrId,
RimEclipseCase* eclipseCase,
RimWellPath* wellPath,
const std::vector<RigCompletionDataGridCell>& intersectingCells,
const caf::VecIjk& lgrSizes,
LgrNameFactory& lgrNameFactory )
std::vector<LgrInfo> RicExportLgrFeature::buildLgrsPerMainCell( int firstLgrId,
RimEclipseCase* eclipseCase,
RimWellPath* wellPath,
const std::vector<RigCompletionDataGridCell>& intersectingCells,
const caf::VecIjk& lgrSizes,
LgrNameFactory& lgrNameFactory )
{
std::vector<LgrInfo> lgrs;
int lgrId = firstLgrId;
@@ -564,12 +536,12 @@ std::vector<LgrInfo>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<LgrInfo> RicExportLgrFeature::buildLgrsPerCompletion(
int firstLgrId,
RimEclipseCase* eclipseCase,
const std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>& completionInfo,
const caf::VecIjk& lgrSizesPerMainGridCell,
LgrNameFactory& lgrNameFactory )
std::vector<LgrInfo>
RicExportLgrFeature::buildLgrsPerCompletion( int firstLgrId,
RimEclipseCase* eclipseCase,
const std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>& completionInfo,
const caf::VecIjk& lgrSizesPerMainGridCell,
LgrNameFactory& lgrNameFactory )
{
std::vector<LgrInfo> lgrs;
@@ -622,8 +594,7 @@ std::vector<LgrInfo> RicExportLgrFeature::buildLgrsPerCompletion(
for ( auto complInfo : occupiedBbs )
{
auto lgrName = lgrNameFactory.newName( complInfo.first.type );
lgrs.push_back(
buildLgr( lgrId++, lgrName, eclipseCase, complInfo.first.wellPathName, complInfo.second, lgrSizesPerMainGridCell ) );
lgrs.push_back( buildLgr( lgrId++, lgrName, eclipseCase, complInfo.first.wellPathName, complInfo.second, lgrSizesPerMainGridCell ) );
}
return lgrs;
}
@@ -685,7 +656,7 @@ std::vector<RigCompletionDataGridCell>
const RimWellPath* wellPath,
size_t timeStep,
const std::set<RigCompletionData::CompletionType>& completionTypes,
bool* isIntersectingOtherLgrs )
bool* isIntersectingOtherLgrs )
{
std::vector<RigCompletionDataGridCell> cells;
@@ -721,9 +692,9 @@ std::vector<RigCompletionDataGridCell>
///
//--------------------------------------------------------------------------------------------------
std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>
RicExportLgrFeature::cellsIntersectingCompletions_PerCompletion( RimEclipseCase* eclipseCase,
const std::vector<RimWellPath*>& wellPaths,
size_t timeStep,
RicExportLgrFeature::cellsIntersectingCompletions_PerCompletion( RimEclipseCase* eclipseCase,
const std::vector<RimWellPath*>& wellPaths,
size_t timeStep,
const std::set<RigCompletionData::CompletionType>& completionTypes,
QStringList* wellsIntersectingOtherLgrs )
{
@@ -769,16 +740,14 @@ std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RigCompletionDataGridCell> RicExportLgrFeature::allIntersectedCells( RimEclipseCase* eclipseCase,
const RimWellPath* wellPath )
std::vector<RigCompletionDataGridCell> RicExportLgrFeature::allIntersectedCells( RimEclipseCase* eclipseCase, const RimWellPath* wellPath )
{
std::vector<RigCompletionDataGridCell> cells;
const RigMainGrid* mainGrid = eclipseCase->mainGrid();
auto globalCellIndices =
RigWellPathIntersectionTools::findIntersectedGlobalCellIndices( eclipseCase->eclipseCaseData(),
wellPath->wellPathGeometry()->wellPathPoints() );
auto globalCellIndices = RigWellPathIntersectionTools::findIntersectedGlobalCellIndices( eclipseCase->eclipseCaseData(),
wellPath->wellPathGeometry()->wellPathPoints() );
for ( const auto& globalCellIndex : globalCellIndices )
{
@@ -909,8 +878,7 @@ std::pair<caf::VecIjk, caf::VecIjk> mainGridCellBoundingBoxFromLgr( const RigGri
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::map<QString /*wellName*/, std::vector<LgrInfo>>
RicExportLgrFeature::createLgrInfoListForTemporaryLgrs( const RigMainGrid* mainGrid )
std::map<QString /*wellName*/, std::vector<LgrInfo>> RicExportLgrFeature::createLgrInfoListForTemporaryLgrs( const RigMainGrid* mainGrid )
{
std::map<QString, std::vector<LgrInfo>> lgrInfosPerWell;
@@ -110,18 +110,13 @@ public:
QString name;
QString wellPathName;
bool isValid() const
{
return type != RigCompletionData::CompletionType::CT_UNDEFINED && !name.isEmpty() && !wellPathName.isEmpty();
}
bool isValid() const { return type != RigCompletionData::CompletionType::CT_UNDEFINED && !name.isEmpty() && !wellPathName.isEmpty(); }
int priority() const
{
return type == RigCompletionData::CompletionType::FRACTURE
? 1
: type == RigCompletionData::CompletionType::FISHBONES
? 2
: type == RigCompletionData::CompletionType::PERFORATION ? 3 : 4;
: type == RigCompletionData::CompletionType::FISHBONES ? 2 : type == RigCompletionData::CompletionType::PERFORATION ? 3 : 4;
}
// Sort by priority, then name, then number
@@ -175,12 +170,11 @@ class RicExportLgrFeature : public caf::CmdFeature
caf::VecIjk lgrCellCounts,
Lgr::SplitType splitType,
const std::set<RigCompletionData::CompletionType>& completionTypes,
QStringList* wellsIntersectingOtherLgrs );
QStringList* wellsIntersectingOtherLgrs );
static std::vector<RimWellPath*> selectedWellPaths();
static std::map<QString /*wellName*/, std::vector<LgrInfo>>
createLgrInfoListForTemporaryLgrs( const RigMainGrid* mainGrid );
static std::map<QString /*wellName*/, std::vector<LgrInfo>> createLgrInfoListForTemporaryLgrs( const RigMainGrid* mainGrid );
protected:
bool isCommandEnabled() override;
@@ -196,18 +190,17 @@ private:
const std::vector<RigCompletionDataGridCell>& intersectingCells,
const caf::VecIjk& lgrSizes,
LgrNameFactory& lgrNameFactory );
static std::vector<LgrInfo>
buildLgrsPerCompletion( int firstLgrId,
RimEclipseCase* eclipseCase,
const std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>& completionInfo,
const caf::VecIjk& lgrSizesPerMainGridCell,
LgrNameFactory& lgrNameFactory );
static LgrInfo buildLgr( int lgrId,
const QString& lgrName,
RimEclipseCase* eclipseCase,
const QString& wellPathName,
const std::vector<RigCompletionDataGridCell>& intersectingCells,
const caf::VecIjk& lgrSizesPerMainGridCell );
static std::vector<LgrInfo> buildLgrsPerCompletion( int firstLgrId,
RimEclipseCase* eclipseCase,
const std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>& completionInfo,
const caf::VecIjk& lgrSizesPerMainGridCell,
LgrNameFactory& lgrNameFactory );
static LgrInfo buildLgr( int lgrId,
const QString& lgrName,
RimEclipseCase* eclipseCase,
const QString& wellPathName,
const std::vector<RigCompletionDataGridCell>& intersectingCells,
const caf::VecIjk& lgrSizesPerMainGridCell );
static LgrInfo buildLgr( int lgrId,
const QString& lgrName,
@@ -216,22 +209,20 @@ private:
const IjkBoundingBox& boundingBox,
const caf::VecIjk& lgrSizesPerMainGridCell );
static std::vector<RigCompletionDataGridCell>
cellsIntersectingCompletions( RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
size_t timeStep,
const std::set<RigCompletionData::CompletionType>& completionTypes,
bool* isIntersectingOtherLgrs );
static std::vector<RigCompletionDataGridCell> cellsIntersectingCompletions( RimEclipseCase* eclipseCase,
const RimWellPath* wellPath,
size_t timeStep,
const std::set<RigCompletionData::CompletionType>& completionTypes,
bool* isIntersectingOtherLgrs );
static std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>
cellsIntersectingCompletions_PerCompletion( RimEclipseCase* eclipseCase,
const std::vector<RimWellPath*>& wellPaths,
size_t timeStep,
const std::set<RigCompletionData::CompletionType>& completionTypes,
QStringList* wellsIntersectingOtherLgrs );
QStringList* wellsIntersectingOtherLgrs );
static std::vector<RigCompletionDataGridCell> allIntersectedCells( RimEclipseCase* eclipseCase,
const RimWellPath* wellPath );
static std::vector<RigCompletionDataGridCell> allIntersectedCells( RimEclipseCase* eclipseCase, const RimWellPath* wellPath );
static int firstAvailableLgrId( const RigMainGrid* mainGrid );
static const RigGridBase* hostGrid( const RigMainGrid* mainGrid, size_t reservoirCellIndex );
@@ -207,9 +207,7 @@ QList<caf::PdmOptionItemInfo> RicExportLgrUi::calculateValueOptions( const caf::
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportLgrUi::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
void RicExportLgrUi::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
if ( changedField == &m_caseToApply )
{
@@ -243,9 +241,7 @@ void RicExportLgrUi::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportLgrUi::defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute )
void RicExportLgrUi::defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute )
{
if ( field == &m_exportFolder )
{
@@ -67,11 +67,9 @@ private:
void setDefaultValuesFromCase();
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
private:
caf::PdmField<QString> m_exportFolder;
@@ -66,13 +66,7 @@ void RicExportSelectedWellPathsFeature::exportWellPath( gsl::not_null<const RimW
std::vector<double> mdValues;
bool showTextMdRkb = false;
RigWellPathGeometryExporter::computeWellPathDataForExport( wellPath,
mdStepSize,
xValues,
yValues,
tvdValues,
mdValues,
showTextMdRkb );
RigWellPathGeometryExporter::computeWellPathDataForExport( wellPath, mdStepSize, xValues, yValues, tvdValues, mdValues, showTextMdRkb );
writeWellPathGeometryToStream( *stream, wellPath->name(), xValues, yValues, tvdValues, mdValues, showTextMdRkb, writeProjectInfo );
filePtr->close();
@@ -96,13 +90,7 @@ void RicExportSelectedWellPathsFeature::writeWellPathGeometryToStream( QTextStre
std::vector<double> tvdValues;
std::vector<double> mdValues;
RigWellPathGeometryExporter::computeWellPathDataForExport( wellPathGeom,
mdStepSize,
rkbOffset,
xValues,
yValues,
tvdValues,
mdValues );
RigWellPathGeometryExporter::computeWellPathDataForExport( wellPathGeom, mdStepSize, rkbOffset, xValues, yValues, tvdValues, mdValues );
writeWellPathGeometryToStream( stream, exportName, xValues, yValues, tvdValues, mdValues, showTextMdRkb, writeProjectInfo );
}
@@ -261,11 +249,7 @@ RicExportWellPathsUi* RicExportSelectedWellPathsFeature::openDialog()
featureUi->setExportFolder( startPath );
}
caf::PdmUiPropertyViewDialog propertyDialog( nullptr,
featureUi,
"Export Well Paths",
"",
QDialogButtonBox::Ok | QDialogButtonBox::Cancel );
caf::PdmUiPropertyViewDialog propertyDialog( nullptr, featureUi, "Export Well Paths", "", QDialogButtonBox::Ok | QDialogButtonBox::Cancel );
propertyDialog.resize( QSize( 600, 60 ) );
if ( propertyDialog.exec() == QDialog::Accepted && !featureUi->exportFolder().isEmpty() )
@@ -46,10 +46,8 @@ class RicExportSelectedWellPathsFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT;
static void exportWellPathsToFile( const std::vector<RimWellPath*>& wellPaths );
static void exportWellPath( gsl::not_null<const RimWellPath*> wellPath,
double mdStepSize,
const QString& folder,
bool writeProjectInfo = true );
static void
exportWellPath( gsl::not_null<const RimWellPath*> wellPath, double mdStepSize, const QString& folder, bool writeProjectInfo = true );
static RicExportWellPathsUi* openDialog();
static QFilePtr openFileForExport( const QString& folderName, const QString& fileName );
@@ -108,8 +108,7 @@ std::vector<QString> RicExportToLasFileFeature::exportToLasFiles( const QString&
lasExporter.setRkbDiffs( wellNames, rkbDiffs );
}
writtenFiles =
lasExporter.writeToFolder( exportFolder, filePrefix, capitalizeFileNames, alwaysOverwrite, convertCurveUnits );
writtenFiles = lasExporter.writeToFolder( exportFolder, filePrefix, capitalizeFileNames, alwaysOverwrite, convertCurveUnits );
// Remember the path to next time
RiaApplication::instance()->setLastUsedDialogDirectory( "WELL_LOGS_DIR", exportFolder );
@@ -139,8 +138,7 @@ void RicExportToLasFileFeature::onActionTriggered( bool isChecked )
std::vector<RimWellLogCurve*> curves = RicWellLogPlotCurveFeatureImpl::selectedWellLogCurves();
if ( curves.size() == 0 ) return;
QString defaultDir =
RiaApplication::instance()->lastUsedDialogDirectoryWithFallbackToProjectFolder( "WELL_LOGS_DIR" );
QString defaultDir = RiaApplication::instance()->lastUsedDialogDirectoryWithFallbackToProjectFolder( "WELL_LOGS_DIR" );
RigLasFileExporter lasExporter( curves );
RicExportToLasFileResampleUi featureUi;
@@ -195,8 +193,7 @@ void RicExportToLasFileFeature::onActionTriggered( bool isChecked )
featureUi.capitalizeFileName,
false,
resampleInterval,
featureUi.curveUnitConversion() ==
RicExportToLasFileResampleUi::CurveUnitConversion::EXPORT_WITH_STANDARD_UNITS );
featureUi.curveUnitConversion() == RicExportToLasFileResampleUi::CurveUnitConversion::EXPORT_WITH_STANDARD_UNITS );
}
}
@@ -30,9 +30,7 @@ template <>
void RicExportToLasFileResampleUi::CurveUnitConversionEnum::setUp()
{
addItem( RicExportToLasFileResampleUi::CurveUnitConversion::EXPORT_NORMALIZED, "NORMALIZED", "Current Plot Units" );
addItem( RicExportToLasFileResampleUi::CurveUnitConversion::EXPORT_WITH_STANDARD_UNITS,
"STANDARD_UNITS",
"Convert to Standard Import Units" );
addItem( RicExportToLasFileResampleUi::CurveUnitConversion::EXPORT_WITH_STANDARD_UNITS, "STANDARD_UNITS", "Convert to Standard Import Units" );
setDefault( RicExportToLasFileResampleUi::CurveUnitConversion::EXPORT_WITH_STANDARD_UNITS );
}
@@ -136,9 +134,7 @@ void RicExportToLasFileResampleUi::setUnitConversionOptionEnabled( bool enabled
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportToLasFileResampleUi::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
void RicExportToLasFileResampleUi::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
updateFieldVisibility();
}
@@ -200,8 +196,7 @@ void RicExportToLasFileResampleUi::defineUiOrdering( QString uiConfigName, caf::
caf::PdmUiGroup* tvdrkbGroup = uiOrdering.addNewGroup( "TVDRKB" );
tvdrkbGroup->add( &exportTvdrkb );
caf::PdmUiGroup* group =
tvdrkbGroup->addNewGroup( "Difference between TVDRKB and TVDMSL, clear diff for no export" );
caf::PdmUiGroup* group = tvdrkbGroup->addNewGroup( "Difference between TVDRKB and TVDMSL, clear diff for no export" );
for ( auto& obj : m_tvdrkbOffsets )
{
group->add( &obj->tvdrkbOffset );
@@ -70,9 +70,7 @@ public:
void setUnitConversionOptionEnabled( bool enabled );
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute ) override;
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
protected:
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
@@ -69,9 +69,7 @@ double RicExportWellPathsUi::mdStepSize() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportWellPathsUi::defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute )
void RicExportWellPathsUi::defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute )
{
if ( field == &m_exportFolder )
{
@@ -40,9 +40,7 @@ public:
double mdStepSize() const;
private:
void defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute ) override;
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
private:
caf::PdmField<QString> m_exportFolder;
@@ -54,10 +54,7 @@ void RicSaveEclipseInputVisibleCellsFeature::openDialogAndExecuteCommand( RimEcl
if ( !view ) return;
RicSaveEclipseInputVisibleCellsUi exportSettings;
caf::PdmUiPropertyViewDialog propertyDialog( Riu3DMainWindowTools::mainWindowWidget(),
&exportSettings,
"Export FLUXNUM/MULTNUM/ACTNUM",
"" );
caf::PdmUiPropertyViewDialog propertyDialog( Riu3DMainWindowTools::mainWindowWidget(), &exportSettings, "Export FLUXNUM/MULTNUM/ACTNUM", "" );
RicExportFeatureImpl::configureForExport( propertyDialog.dialogButtonBox() );
if ( propertyDialog.exec() == QDialog::Accepted )
@@ -76,8 +73,7 @@ void RicSaveEclipseInputVisibleCellsFeature::executeCommand( RimEclipseView*
std::vector<double> values;
cvf::UByteArray visibleCells;
view->calculateCurrentTotalCellVisibility( &visibleCells, view->currentTimeStep() );
RigActiveCellInfo* activeCellInfo =
view->eclipseCase()->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
RigActiveCellInfo* activeCellInfo = view->eclipseCase()->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
values.resize( visibleCells.size() );
for ( size_t i = 0; i < visibleCells.size(); ++i )
{
@@ -100,8 +96,7 @@ void RicSaveEclipseInputVisibleCellsFeature::executeCommand( RimEclipseView*
QFile exportFile( exportSettings.exportFilename );
if ( !exportFile.open( QIODevice::WriteOnly | QIODevice::Text ) )
{
RiaLogging::error(
QString( "%1: Unable to open file '%2' for writing." ).arg( logPrefix ).arg( exportSettings.exportFilename ) );
RiaLogging::error( QString( "%1: Unable to open file '%2' for writing." ).arg( logPrefix ).arg( exportSettings.exportFilename ) );
return;
}
@@ -32,9 +32,7 @@ class RicSaveEclipseInputVisibleCellsFeature : public caf::CmdFeature
public:
static void openDialogAndExecuteCommand( RimEclipseView* view );
static void executeCommand( RimEclipseView* view,
const RicSaveEclipseInputVisibleCellsUi& exportSettings,
const QString& logPrefix );
static void executeCommand( RimEclipseView* view, const RicSaveEclipseInputVisibleCellsUi& exportSettings, const QString& logPrefix );
protected:
bool isCommandEnabled() override;
@@ -52,9 +52,7 @@ public:
caf::PdmField<bool> writeEchoInGrdeclFiles;
protected:
void defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute ) override;
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
@@ -83,8 +83,7 @@ void RicSaveEclipseResultAsInputPropertyExec::redo()
projectFolder = m_cellColors->reservoirView()->eclipseCase()->locationOnDisc();
}
QString outputFileName = projectFolder + "/" +
caf::Utils::makeValidFileBasename( m_cellColors->resultVariableUiShortName() ) +
QString outputFileName = projectFolder + "/" + caf::Utils::makeValidFileBasename( m_cellColors->resultVariableUiShortName() ) +
".GRDECL";
exportSettings.fileName = outputFileName;
@@ -101,17 +100,16 @@ void RicSaveEclipseResultAsInputPropertyExec::redo()
size_t timeStep = m_cellColors->reservoirView()->currentTimeStep();
QString errMsg;
bool isOk = RicEclipseCellResultToFileImpl::writeBinaryResultToTextFile( exportSettings.fileName,
m_cellColors->reservoirView()
->eclipseCase()
->eclipseCaseData(),
timeStep,
m_cellColors,
exportSettings.eclipseKeyword,
exportSettings.undefinedValue,
"saveEclipseResultAsInputPropertyExec",
exportSettings.writeEchoInGrdeclFiles,
&errMsg );
bool isOk =
RicEclipseCellResultToFileImpl::writeBinaryResultToTextFile( exportSettings.fileName,
m_cellColors->reservoirView()->eclipseCase()->eclipseCaseData(),
timeStep,
m_cellColors,
exportSettings.eclipseKeyword,
exportSettings.undefinedValue,
"saveEclipseResultAsInputPropertyExec",
exportSettings.writeEchoInGrdeclFiles,
&errMsg );
if ( !isOk )
{
QString fullError =
@@ -91,8 +91,7 @@ void RicSaveEclipseResultAsInputPropertyFeature::onActionTriggered( bool isCheck
if ( eclipseCellColors )
{
RicSaveEclipseResultAsInputPropertyExec* cellResultSaveExec =
new RicSaveEclipseResultAsInputPropertyExec( eclipseCellColors );
RicSaveEclipseResultAsInputPropertyExec* cellResultSaveExec = new RicSaveEclipseResultAsInputPropertyExec( eclipseCellColors );
caf::CmdExecCommandManager::instance()->processExecuteCommand( cellResultSaveExec );
}
}
@@ -136,9 +136,8 @@ void RicSnapshotAllViewsToFileFeature::exportSnapshotOfViewsIntoFolder( const QS
RimGridView* rigv = dynamic_cast<RimGridView*>( riv );
if ( rigv )
{
QImage img = rigv->overlayInfoConfig()->statisticsDialogScreenShotImage();
absoluteFileName =
caf::Utils::constructFullFileName( absSnapshotPath, fileName + "_Statistics", ".png" );
QImage img = rigv->overlayInfoConfig()->statisticsDialogScreenShotImage();
absoluteFileName = caf::Utils::constructFullFileName( absSnapshotPath, fileName + "_Statistics", ".png" );
RicSnapshotViewToFileFeature::saveSnapshotAs( absoluteFileName, img );
}
}
@@ -29,10 +29,8 @@ class RicSnapshotAllViewsToFileFeature : public caf::CmdFeature
public:
static void saveAllViews();
static void exportSnapshotOfViewsIntoFolder( const QString& snapshotFolderName,
const QString& prefix = "",
int caseId = -1,
int viewId = -1 );
static void
exportSnapshotOfViewsIntoFolder( const QString& snapshotFolderName, const QString& prefix = "", int caseId = -1, int viewId = -1 );
protected:
bool isCommandEnabled() override;
@@ -68,8 +68,7 @@ QString RicSnapshotFilenameGenerator::generateSnapshotFilenameForRimView( Rim3dV
QString fileName =
QString( "%1_%2_%3" ).arg( rimView->ownerCase()->caseUserDescription() ).arg( rimView->name() ).arg( resultName( rimView ) );
if ( !timeSteps.empty() )
fileName += QString( "_%1_%2" ).arg( timeStep, 2, 10, QChar( '0' ) ).arg( timeSteps[timeStep] );
if ( !timeSteps.empty() ) fileName += QString( "_%1_%2" ).arg( timeStep, 2, 10, QChar( '0' ) ).arg( timeSteps[timeStep] );
fileName = makeValidFileName( fileName );
@@ -128,8 +128,7 @@ void RicSnapshotViewToFileFeature::savePlotPdfReportAs( const QString& fileName,
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicSnapshotViewToFileFeature::saveViewWindowToFile( RimViewWindow* viewWindow,
const QString& defaultFileBaseName /*= "image" */ )
void RicSnapshotViewToFileFeature::saveViewWindowToFile( RimViewWindow* viewWindow, const QString& defaultFileBaseName /*= "image" */ )
{
auto* plotWindow = dynamic_cast<RimPlotWindow*>( viewWindow );
@@ -162,9 +161,7 @@ void RicSnapshotViewToFileFeature::saveImageToFile( const QImage& image, const Q
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RicSnapshotViewToFileFeature::generateSaveFileName( const QString& defaultFileBaseName,
bool supportPDF,
const QString& defaultExtension )
QString RicSnapshotViewToFileFeature::generateSaveFileName( const QString& defaultFileBaseName, bool supportPDF, const QString& defaultExtension )
{
RiaApplication* app = RiaApplication::instance();
RimProject* proj = app->project();
@@ -194,19 +191,15 @@ QString RicSnapshotViewToFileFeature::generateSaveFileName( const QString& defau
fileExtensionFilter += QString( ";;%1" ).arg( pdfFilter );
}
QString defaultAbsFileName =
caf::Utils::constructFullFileName( startPath, defaultFileBaseName, "." + defaultExtension );
QString defaultAbsFileName = caf::Utils::constructFullFileName( startPath, defaultFileBaseName, "." + defaultExtension );
QString selectedExtension;
if ( supportPDF && defaultExtension.compare( "pdf", Qt::CaseInsensitive ) == 0 )
{
selectedExtension = pdfFilter;
}
QString fileName = RiuFileDialogTools::getSaveFileName( nullptr,
tr( "Export to File" ),
defaultAbsFileName,
fileExtensionFilter,
&selectedExtension );
QString fileName =
RiuFileDialogTools::getSaveFileName( nullptr, tr( "Export to File" ), defaultAbsFileName, fileExtensionFilter, &selectedExtension );
if ( !fileName.isEmpty() )
{
// Remember the directory to next time
@@ -36,11 +36,10 @@ public:
static void saveSnapshotAs( const QString& fileName, const QImage& image );
static void savePlotPdfReportAs( const QString& fileName, RimPlotWindow* plotWindow );
static void saveViewWindowToFile( RimViewWindow* viewWindow, const QString& defaultFileBaseName = "image" );
static void saveImageToFile( const QImage& image, const QString& defaultFileBaseName = "image" );
static QString generateSaveFileName( const QString& defaultFileBaseName = "image",
bool supportPDF = false,
const QString& defaultExtension = "png" );
static void saveViewWindowToFile( RimViewWindow* viewWindow, const QString& defaultFileBaseName = "image" );
static void saveImageToFile( const QImage& image, const QString& defaultFileBaseName = "image" );
static QString
generateSaveFileName( const QString& defaultFileBaseName = "image", bool supportPDF = false, const QString& defaultExtension = "png" );
static QIcon icon();
static QString text();