mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#1018) Updated filenames to include timestep-index and added default value for range filter based on active cells.
This commit is contained in:
@@ -116,8 +116,9 @@ void RicExportMultipleSnapshotsFeature::exportMultipleSnapshots(const QString& f
|
|||||||
|
|
||||||
for (int i=msd->timeStepStart(); i <= msd->timeStepEnd(); i++)
|
for (int i=msd->timeStepStart(); i <= msd->timeStepEnd(); i++)
|
||||||
{
|
{
|
||||||
//TODO: This naming will not give images in the correct order when sorted on name..
|
QString timeStepIndexString = QString("%1").arg(i, 2, 10, QLatin1Char('0'));
|
||||||
timeStepString = timeSteps[i].replace(".", "-");
|
|
||||||
|
timeStepString = timeStepIndexString + "_" + timeSteps[i].replace(".", "-");
|
||||||
|
|
||||||
viewer->setCurrentFrame(i);
|
viewer->setCurrentFrame(i);
|
||||||
viewer->animationControl()->setCurrentFrameOnly(i);
|
viewer->animationControl()->setCurrentFrameOnly(i);
|
||||||
@@ -139,7 +140,7 @@ void RicExportMultipleSnapshotsFeature::exportMultipleSnapshots(const QString& f
|
|||||||
|
|
||||||
for (int i = msd->startSliceIndex(); i <= msd->endSliceIndex(); i++)
|
for (int i = msd->startSliceIndex(); i <= msd->endSliceIndex(); i++)
|
||||||
{
|
{
|
||||||
rangeFilterString = msd->sliceDirection().text() + QString::number(i);
|
rangeFilterString = msd->sliceDirection().text() + "-" + QString::number(i);
|
||||||
QString fileName = activeCase->caseUserDescription() + "_" + activeView->name() + "_" + timeStepString + "_" + rangeFilterString;
|
QString fileName = activeCase->caseUserDescription() + "_" + activeView->name() + "_" + timeStepString + "_" + rangeFilterString;
|
||||||
fileName.replace(" ", "-");
|
fileName.replace(" ", "-");
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
#include "RimView.h"
|
#include "RimView.h"
|
||||||
|
|
||||||
#include "cafPdmPointer.h"
|
#include "cafPdmPointer.h"
|
||||||
|
#include "RimCellRangeFilterCollection.h"
|
||||||
|
#include "RigActiveCellInfo.h"
|
||||||
|
|
||||||
namespace caf
|
namespace caf
|
||||||
{
|
{
|
||||||
@@ -135,3 +137,59 @@ void RimMultiSnapshotDefinition::getTimeStepStrings(QList<caf::PdmOptionItemInfo
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimMultiSnapshotDefinition::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||||
|
{
|
||||||
|
if (changedField == &sliceDirection)
|
||||||
|
{
|
||||||
|
if (viewObject())
|
||||||
|
{
|
||||||
|
const cvf::StructGridInterface* mainGrid = viewObject()->rangeFilterCollection()->gridByIndex(0);
|
||||||
|
|
||||||
|
RigActiveCellInfo* actCellInfo = viewObject()->rangeFilterCollection()->activeCellInfo();
|
||||||
|
if (mainGrid && actCellInfo)
|
||||||
|
{
|
||||||
|
cvf::Vec3st min, max;
|
||||||
|
actCellInfo->IJKBoundingBox(min, max);
|
||||||
|
|
||||||
|
// Adjust to Eclipse indexing
|
||||||
|
min.x() = min.x() + 1;
|
||||||
|
min.y() = min.y() + 1;
|
||||||
|
min.z() = min.z() + 1;
|
||||||
|
|
||||||
|
max.x() = max.x() + 1;
|
||||||
|
max.y() = max.y() + 1;
|
||||||
|
max.z() = max.z() + 1;
|
||||||
|
|
||||||
|
int maxInt = 0;
|
||||||
|
int minInt = 0;
|
||||||
|
|
||||||
|
if (newValue == RimMultiSnapshotDefinition::RANGEFILTER_I)
|
||||||
|
{
|
||||||
|
maxInt = static_cast<int>(max.x());
|
||||||
|
minInt = static_cast<int>(min.x());
|
||||||
|
}
|
||||||
|
else if (newValue == RimMultiSnapshotDefinition::RANGEFILTER_J)
|
||||||
|
{
|
||||||
|
maxInt = static_cast<int>(max.y());
|
||||||
|
minInt = static_cast<int>(min.y());
|
||||||
|
}
|
||||||
|
else if (newValue == RimMultiSnapshotDefinition::RANGEFILTER_K)
|
||||||
|
{
|
||||||
|
maxInt = static_cast<int>(max.z());
|
||||||
|
minInt = static_cast<int>(min.z());
|
||||||
|
}
|
||||||
|
|
||||||
|
startSliceIndex = minInt;
|
||||||
|
endSliceIndex = maxInt;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
startSliceIndex.uiCapability()->updateConnectedEditors();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,9 +55,11 @@ public:
|
|||||||
caf::PdmField<int> startSliceIndex;
|
caf::PdmField<int> startSliceIndex;
|
||||||
caf::PdmField<int> endSliceIndex;
|
caf::PdmField<int> endSliceIndex;
|
||||||
|
|
||||||
|
|
||||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
|
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
|
||||||
|
|
||||||
void getTimeStepStrings(QList<caf::PdmOptionItemInfo> &options);
|
void getTimeStepStrings(QList<caf::PdmOptionItemInfo> &options);
|
||||||
|
|
||||||
|
|
||||||
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user