#3182 Remove superfluous isUsingAutoName setting

This commit is contained in:
Gaute Lindkvist
2018-08-07 14:12:35 +02:00
parent a2c3c9d03f
commit 69e2ef83af
10 changed files with 121 additions and 129 deletions

View File

@@ -82,7 +82,7 @@ void RicNewWellBoreStabilityPlotFeature::onActionTriggered(bool isChecked)
Rim3dView* view = RiaApplication::instance()->activeReservoirView();
if (!view) return;
RimGeoMechView* geoMechView = dynamic_cast<RimGeoMechView*>(view);
if (!geoMechView) return;
@@ -90,7 +90,7 @@ void RicNewWellBoreStabilityPlotFeature::onActionTriggered(bool isChecked)
progInfo.setProgressDescription("Creating plot and formation track");
progInfo.setNextProgressIncrement(2);
RimGeoMechCase* geoMechCase = geoMechView->geoMechCase();
QString plotName("Well Bore Stability");
RimWellLogPlot* plot = RicNewWellLogPlotFeatureImpl::createWellLogPlot(false, plotName);
createFormationTrack(plot, selectedWellPath, geoMechCase);
@@ -101,19 +101,19 @@ void RicNewWellBoreStabilityPlotFeature::onActionTriggered(bool isChecked)
progInfo.incrementProgressAndUpdateNextStep(15, "Creating angles track");
createAnglesTrack(plot, selectedWellPath, geoMechView);
progInfo.incrementProgressAndUpdateNextStep(5, "Updating all tracks");
plot->enableAutoName(true);
plot->enableAllAutoNameTags(true);
plot->setPlotTitleVisible(true);
plot->setTrackLegendsVisible(true);
plot->setTrackLegendsHorizontal(true);
plot->setDepthType(RimWellLogPlot::TRUE_VERTICAL_DEPTH);
plot->setDepthAutoZoom(true);
plot->setDepthAutoZoom(true);
RicNewWellLogPlotFeatureImpl::updateAfterCreation(plot);
RicNewWellLogPlotFeatureImpl::updateAfterCreation(plot);
progInfo.incrementProgress();
RiuPlotMainWindowTools::selectAsCurrentItem(plot);
// Make sure the summary plot window is visible
// Make sure the summary plot window is visible
RiuPlotMainWindowTools::showPlotMainWindow();
}

View File

@@ -279,26 +279,33 @@ QString Rim3dWellLogExtractionCurve::createAutoName() const
RimGeoMechCase* geomCase = dynamic_cast<RimGeoMechCase*>(m_case.value());
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(m_case.value());
QStringList generatedCurveName;
QStringList autoName;
if (!m_nameConfig->customName().isEmpty())
{
autoName.push_back(m_nameConfig->customName());
}
QStringList generatedAutoTags;
if (m_nameConfig->addWellName())
{
RimWellPath* wellPath;
this->firstAncestorOrThisOfTypeAsserted(wellPath);
if (!wellPath->name().isEmpty())
{
generatedCurveName += wellPath->name();
generatedAutoTags += wellPath->name();
}
}
if (m_nameConfig->addCaseName() && m_case())
{
generatedCurveName.push_back(m_case->caseUserDescription());
generatedAutoTags.push_back(m_case->caseUserDescription());
}
if (m_nameConfig->addProperty() && !resultPropertyString().isEmpty())
{
generatedCurveName.push_back(resultPropertyString());
generatedAutoTags.push_back(resultPropertyString());
}
if (m_nameConfig->addTimeStep() || m_nameConfig->addDate())
@@ -329,17 +336,20 @@ QString Rim3dWellLogExtractionCurve::createAutoName() const
QString dateString = wellDate();
if (!dateString.isEmpty())
{
generatedCurveName.push_back(dateString);
generatedAutoTags.push_back(dateString);
}
}
if (addTimeStep)
{
generatedCurveName.push_back(QString("[%1/%2]").arg(m_timeStep() + 1).arg(maxTimeStep));
generatedAutoTags.push_back(QString("[%1/%2]").arg(m_timeStep() + 1).arg(maxTimeStep));
}
}
return generatedCurveName.join(", ");
if (!generatedAutoTags.empty())
{
autoName.push_back(generatedAutoTags.join(", "));
}
return autoName.join(": ");
}
//--------------------------------------------------------------------------------------------------

View File

@@ -36,9 +36,10 @@ RimNameConfig::RimNameConfig(const RimNameConfigHolderInterface* configHolder /*
{
CAF_PDM_InitObject("Curve Name Generator", "", "", "");
CAF_PDM_InitField(&m_isUsingAutoName, "IsUsingAutoName", true, "Add Automatic Name Tags", "", "", "");
CAF_PDM_InitField(&m_isUsingAutoName_OBSOLETE, "IsUsingAutoName", true, "Add Automatic Name Tags", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_customName, "CustomCurveName", "Custom Name Part", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_autoName, "AutoCurveName", "Full Curve Name", "", "", "");
m_isUsingAutoName_OBSOLETE.xmlCapability()->setIOWritable(false);
m_autoName.registerGetMethod(this, &RimNameConfig::autoName);
m_autoName.xmlCapability()->disableIO();
m_autoName.uiCapability()->setUiReadOnly(true);
@@ -51,22 +52,6 @@ RimNameConfig::~RimNameConfig()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimNameConfig::isUsingAutoName() const
{
return m_isUsingAutoName();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimNameConfig::setUsingAutoName(bool useAutoName)
{
m_isUsingAutoName = useAutoName;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -99,7 +84,6 @@ caf::PdmUiGroup* RimNameConfig::createUiGroup(QString uiConfigName, caf::PdmUiOr
caf::PdmUiGroup* nameGroup = uiOrdering.addNewGroup("Curve Name");
nameGroup->add(&m_customName);
nameGroup->add(&m_autoName);
nameGroup->add(&m_isUsingAutoName);
return nameGroup;
}
@@ -132,7 +116,6 @@ void RimNameConfig::setCustomName(const QString& name)
//--------------------------------------------------------------------------------------------------
void RimNameConfig::updateAllSettings()
{
m_isUsingAutoName.uiCapability()->updateConnectedEditors();
m_autoName.uiCapability()->updateConnectedEditors();
m_customName.uiCapability()->updateConnectedEditors();
@@ -151,5 +134,11 @@ void RimNameConfig::updateAllSettings()
//--------------------------------------------------------------------------------------------------
void RimNameConfig::initAfterRead()
{
// Now we just switch them all individually.
if (!m_isUsingAutoName_OBSOLETE())
{
enableAllAutoNameTags(false);
}
updateAllSettings();
}

View File

@@ -44,11 +44,10 @@ class RimNameConfig : public caf::PdmObject
public:
RimNameConfig(const RimNameConfigHolderInterface* configHolder = nullptr);
virtual ~RimNameConfig();
bool isUsingAutoName() const;
void setUsingAutoName(bool useAutoName);
QString customName() const;
void setCustomName(const QString& name);
void setCustomName(const QString& name);
virtual void enableAllAutoNameTags(bool enable) {}
caf::PdmFieldHandle* nameField();
QString name() const;
virtual caf::PdmUiGroup* createUiGroup(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
@@ -60,7 +59,7 @@ protected:
virtual void initAfterRead() override;
protected:
caf::PdmField<bool> m_isUsingAutoName;
caf::PdmField<bool> m_isUsingAutoName_OBSOLETE;
caf::PdmField<QString> m_customName;
caf::PdmProxyValueField<QString> m_autoName;

View File

@@ -34,12 +34,12 @@ RimWellLogExtractionCurveNameConfig::RimWellLogExtractionCurveNameConfig(const R
CAF_PDM_InitObject("Well Log Extraction Curve Name Generator", "", "", "");
CAF_PDM_InitField(&m_addCaseName, "AddCaseName", false, "Add Case Name", "", "", "");
CAF_PDM_InitField(&m_addProperty, "AddProperty", true, "Add Property Type", "", "", "");
CAF_PDM_InitField(&m_addWellName, "AddWellName", true, "Add Well Name", "", "", "");
CAF_PDM_InitField(&m_addTimestep, "AddTimeStep", true, "Add Time Step", "", "", "");
CAF_PDM_InitField(&m_addDate, "AddDate", true, "Add Date", "", "", "");
CAF_PDM_InitField(&m_addProperty, "AddProperty", false, "Add Property Type", "", "", "");
CAF_PDM_InitField(&m_addWellName, "AddWellName", false, "Add Well Name", "", "", "");
CAF_PDM_InitField(&m_addTimestep, "AddTimeStep", false, "Add Time Step", "", "", "");
CAF_PDM_InitField(&m_addDate, "AddDate", false, "Add Date", "", "", "");
m_customName = "Extraction Curve";
m_customName = "Log Extraction";
}
//--------------------------------------------------------------------------------------------------
@@ -97,17 +97,13 @@ bool RimWellLogExtractionCurveNameConfig::addDate() const
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RimWellLogExtractionCurveNameConfig::updateAllSettings()
void RimWellLogExtractionCurveNameConfig::enableAllAutoNameTags(bool enable)
{
m_addCaseName.uiCapability()->setUiReadOnly(!isUsingAutoName());
m_addProperty.uiCapability()->setUiReadOnly(!isUsingAutoName());
m_addWellName.uiCapability()->setUiReadOnly(!isUsingAutoName());
m_addTimestep.uiCapability()->setUiReadOnly(!isUsingAutoName());
m_addDate.uiCapability()->setUiReadOnly(!isUsingAutoName());
RimNameConfig::updateAllSettings();
m_addCaseName = enable;
m_addProperty = enable;
m_addWellName = enable;
m_addTimestep = enable;
m_addDate = enable;
}

View File

@@ -38,8 +38,7 @@ public:
bool addTimeStep() const;
bool addDate() const;
protected:
virtual void updateAllSettings();
virtual void enableAllAutoNameTags(bool enable) override;
private:
caf::PdmField<bool> m_addCaseName;

View File

@@ -82,7 +82,8 @@ RimWellLogPlot::RimWellLogPlot()
m_viewer = nullptr;
CAF_PDM_InitField(&m_userName_OBSOLETE, "PlotDescription", QString(""),"Name", "", "", "");
m_userName_OBSOLETE.xmlCapability()->setIOWritable(false);
CAF_PDM_InitFieldNoDefault(&m_commonDataSource, "CommonDataSource", "Common Data Source", "", "Change the Data Source of All Curves in the Plot", "");
m_commonDataSource = new RimWellLogCurveCommonDataSource;
m_commonDataSource.uiCapability()->setUiTreeHidden(true);
@@ -112,7 +113,6 @@ RimWellLogPlot::RimWellLogPlot()
m_nameConfig = new RimWellLogPlotNameConfig(this);
m_nameConfig.uiCapability()->setUiTreeHidden(true);
m_nameConfig.uiCapability()->setUiTreeChildrenHidden(true);
m_nameConfig->setUsingAutoName(false);
m_minAvailableDepth = HUGE_VAL;
m_maxAvailableDepth = -HUGE_VAL;
@@ -441,9 +441,9 @@ void RimWellLogPlot::setDepthAutoZoom(bool on)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPlot::enableAutoName(bool enableAutoName)
void RimWellLogPlot::enableAllAutoNameTags(bool enable)
{
m_nameConfig->setUsingAutoName(enableAutoName);
m_nameConfig->enableAllAutoNameTags(enable);
}
//--------------------------------------------------------------------------------------------------
@@ -622,74 +622,76 @@ QString RimWellLogPlot::createAutoName() const
{
QStringList generatedCurveName;
generatedCurveName.push_back(m_nameConfig->customName());
if (m_nameConfig->isUsingAutoName())
if (!m_nameConfig->customName().isEmpty())
{
RimCase* commonCase = m_commonDataSource->caseToApply();
RimGeoMechCase* geomCase = dynamic_cast<RimGeoMechCase*>(commonCase);
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(commonCase);
RimWellPath* commonWellPath = m_commonDataSource->wellPathToApply();
generatedCurveName.push_back(m_nameConfig->customName());
}
QStringList generatedProperties;
if (m_nameConfig->addCaseName() && commonCase)
RimCase* commonCase = m_commonDataSource->caseToApply();
RimGeoMechCase* geomCase = dynamic_cast<RimGeoMechCase*>(commonCase);
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(commonCase);
RimWellPath* commonWellPath = m_commonDataSource->wellPathToApply();
QStringList generatedAutoTags;
if (m_nameConfig->addCaseName() && commonCase)
{
generatedAutoTags.push_back(commonCase->caseUserDescription());
}
if (m_nameConfig->addWellName())
{
if (commonWellPath && !commonWellPath->name().isEmpty())
{
generatedProperties.push_back(commonCase->caseUserDescription());
generatedAutoTags.push_back(commonWellPath->name());
}
if (m_nameConfig->addWellName())
else if (!m_commonDataSource->simWellNameToApply().isEmpty())
{
generatedAutoTags.push_back(m_commonDataSource->simWellNameToApply());
}
}
if (commonWellPath && !commonWellPath->name().isEmpty())
if (m_nameConfig->addTimeStep())
{
if (commonCase && m_commonDataSource->timeStepToApply() != -1)
{
generatedAutoTags.push_back(commonCase->timeStepName(m_commonDataSource->timeStepToApply()));
}
}
if (m_nameConfig->addAirGap())
{
if (commonWellPath)
{
RigWellPath* wellPathGeometry = commonWellPath->wellPathGeometry();
if (wellPathGeometry)
{
generatedProperties.push_back(commonWellPath->name());
}
else if (!m_commonDataSource->simWellNameToApply().isEmpty())
{
generatedProperties.push_back(m_commonDataSource->simWellNameToApply());
double rkb = wellPathGeometry->rkbDiff();
generatedAutoTags.push_back(QString("Air Gap = %1 m").arg(rkb));
}
}
}
if (m_nameConfig->addTimeStep())
if (m_nameConfig->addWaterDepth())
{
if (commonWellPath)
{
if (commonCase && m_commonDataSource->timeStepToApply() != -1)
RigWellPath* wellPathGeometry = commonWellPath->wellPathGeometry();
if (wellPathGeometry)
{
generatedProperties.push_back(commonCase->timeStepName(m_commonDataSource->timeStepToApply()));
}
}
if (m_nameConfig->addAirGap())
{
if (commonWellPath)
{
RigWellPath* wellPathGeometry = commonWellPath->wellPathGeometry();
if (wellPathGeometry)
const std::vector<cvf::Vec3d>& wellPathPoints = wellPathGeometry->wellPathPoints();
if (!wellPathPoints.empty())
{
double rkb = wellPathGeometry->rkbDiff();
generatedProperties.push_back(QString("Air Gap = %1 m").arg(rkb));
double tvdmsl = std::abs(wellPathPoints.front()[2]);
generatedAutoTags.push_back(QString("Water Depth = %1 m").arg(tvdmsl));
}
}
}
}
if (m_nameConfig->addWaterDepth())
{
if (commonWellPath)
{
RigWellPath* wellPathGeometry = commonWellPath->wellPathGeometry();
if (wellPathGeometry)
{
const std::vector<cvf::Vec3d>& wellPathPoints = wellPathGeometry->wellPathPoints();
if (!wellPathPoints.empty())
{
double tvdmsl = std::abs(wellPathPoints.front()[2]);
generatedProperties.push_back(QString("Water Depth = %1 m").arg(tvdmsl));
}
}
}
}
if (!generatedProperties.empty())
{
generatedCurveName.push_back(generatedProperties.join(", "));
}
if (!generatedAutoTags.empty())
{
generatedCurveName.push_back(generatedAutoTags.join(", "));
}
return generatedCurveName.join(": ");
}

View File

@@ -110,7 +110,7 @@ public:
virtual void zoomAll() override;
void setDepthAutoZoom(bool on);
void enableAutoName(bool enableAutoName);
void enableAllAutoNameTags(bool enable);
QString asciiDataForPlotExport() const;

View File

@@ -33,11 +33,11 @@ RimWellLogPlotNameConfig::RimWellLogPlotNameConfig(const RimNameConfigHolderInte
{
CAF_PDM_InitObject("Well Log Plot Name Generator", "", "", "");
CAF_PDM_InitField(&m_addCaseName, "AddCaseName", true, "Add Case Name", "", "", "");
CAF_PDM_InitField(&m_addWellName, "AddWellName", true, "Add Well Name", "", "", "");
CAF_PDM_InitField(&m_addTimestep, "AddTimeStep", true, "Add Time Step", "", "", "");
CAF_PDM_InitField(&m_addAirGap, "AddAirGap", true, "Add Air Gap", "", "", "");
CAF_PDM_InitField(&m_addWaterDepth, "AddWaterDepth", true, "Add Water Depth To Auto Name", "", "", "");
CAF_PDM_InitField(&m_addCaseName, "AddCaseName", false, "Add Case Name", "", "", "");
CAF_PDM_InitField(&m_addWellName, "AddWellName", false, "Add Well Name", "", "", "");
CAF_PDM_InitField(&m_addTimestep, "AddTimeStep", false, "Add Time Step", "", "", "");
CAF_PDM_InitField(&m_addAirGap, "AddAirGap", false, "Add Air Gap", "", "", "");
CAF_PDM_InitField(&m_addWaterDepth, "AddWaterDepth", false, "Add Water Depth To Auto Name", "", "", "");
m_customName = "Well Log Plot";
}
@@ -97,15 +97,14 @@ bool RimWellLogPlotNameConfig::addWaterDepth() const
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPlotNameConfig::updateAllSettings()
void RimWellLogPlotNameConfig::enableAllAutoNameTags(bool enable)
{
m_addCaseName.uiCapability()->setUiReadOnly(!isUsingAutoName());
m_addWellName.uiCapability()->setUiReadOnly(!isUsingAutoName());
m_addTimestep.uiCapability()->setUiReadOnly(!isUsingAutoName());
m_addAirGap.uiCapability()->setUiReadOnly(!isUsingAutoName());
m_addWaterDepth.uiCapability()->setUiReadOnly(!isUsingAutoName());
RimNameConfig::updateAllSettings();
m_addCaseName = enable;
m_addWellName = enable;
m_addTimestep = enable;
m_addAirGap = enable;
m_addWaterDepth = enable;
}

View File

@@ -37,9 +37,7 @@ public:
bool addTimeStep() const;
bool addAirGap() const;
bool addWaterDepth() const;
protected:
virtual void updateAllSettings();
virtual void enableAllAutoNameTags(bool enable) override;
private:
caf::PdmField<bool> m_addCaseName;