mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1923 Add no-plot-update versions of update methods in curve system. onLoadDataAndUpdate is improved for summary curve but not always called with the "no update" flag set
This commit is contained in:
parent
f9b26ce104
commit
0bb47cba88
@ -188,7 +188,7 @@ bool RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl(const QStr
|
||||
summaryCurve->firstAncestorOrThisOfType(parentCollection);
|
||||
if (parentCollection)
|
||||
{
|
||||
parentCollection->loadDataAndUpdate();
|
||||
parentCollection->loadDataAndUpdate(true);
|
||||
parentCollection->updateConnectedEditors();
|
||||
break;
|
||||
}
|
||||
|
@ -294,7 +294,7 @@ RimSummaryCurve* RicPlotProductionRateFeature::addSummaryCurve( RimSummaryPlot*
|
||||
}
|
||||
|
||||
RimSummaryCurve* newCurve = new RimSummaryCurve();
|
||||
plot->addCurve(newCurve);
|
||||
plot->addCurveAndUpdate(newCurve);
|
||||
|
||||
newCurve->setSummaryCase(gridSummaryCase);
|
||||
newCurve->setSummaryAddress(addr);
|
||||
|
@ -67,7 +67,7 @@ void RicNewGridTimeHistoryCurveFeature::createCurveFromSelectionItem(const RiuSe
|
||||
|
||||
plot->addGridTimeHistoryCurve(newCurve);
|
||||
|
||||
newCurve->loadDataAndUpdate();
|
||||
newCurve->loadDataAndUpdate(true);
|
||||
|
||||
plot->updateConnectedEditors();
|
||||
|
||||
|
@ -70,7 +70,7 @@ void RicNewSummaryCurveFeature::onActionTriggered(bool isChecked)
|
||||
cvf::Color3f curveColor = RicWellLogPlotCurveFeatureImpl::curveColorFromTable(plot->curveCount());
|
||||
newCurve->setColor(curveColor);
|
||||
|
||||
plot->addCurve(newCurve);
|
||||
plot->addCurveAndUpdate(newCurve);
|
||||
|
||||
RimSummaryCase* defaultCase = nullptr;
|
||||
if (project->activeOilField()->summaryCaseMainCollection()->summaryCaseCount() > 0)
|
||||
@ -80,7 +80,7 @@ void RicNewSummaryCurveFeature::onActionTriggered(bool isChecked)
|
||||
|
||||
newCurve->setSummaryAddress(RifEclipseSummaryAddress::fieldVarAddress("FOPT"));
|
||||
|
||||
newCurve->loadDataAndUpdate();
|
||||
newCurve->loadDataAndUpdate(true);
|
||||
}
|
||||
|
||||
plot->updateConnectedEditors();
|
||||
|
@ -90,7 +90,7 @@ void RicPasteAsciiDataCurveFeature::onActionTriggered(bool isChecked)
|
||||
|
||||
newObject->initAfterReadRecursively();
|
||||
|
||||
newObject->loadDataAndUpdate();
|
||||
newObject->loadDataAndUpdate(true);
|
||||
newObject->updateConnectedEditors();
|
||||
|
||||
summaryPlot->updateConnectedEditors();
|
||||
|
@ -74,7 +74,7 @@ void RicPasteSummaryCurveFeature::onActionTriggered(bool isChecked)
|
||||
RimSummaryCurve* newObject = dynamic_cast<RimSummaryCurve*>(sourceObjects[i]->xmlCapability()->copyByXmlSerialization(caf::PdmDefaultObjectFactory::instance()));
|
||||
CVF_ASSERT(newObject);
|
||||
|
||||
summaryPlot->addCurve(newObject);
|
||||
summaryPlot->addCurveAndUpdate(newObject);
|
||||
|
||||
// Resolve references after object has been inserted into the project data model
|
||||
newObject->resolveReferencesRecursively();
|
||||
@ -85,7 +85,7 @@ void RicPasteSummaryCurveFeature::onActionTriggered(bool isChecked)
|
||||
|
||||
newObject->initAfterReadRecursively();
|
||||
|
||||
newObject->loadDataAndUpdate();
|
||||
newObject->loadDataAndUpdate(true);
|
||||
newObject->updateConnectedEditors();
|
||||
|
||||
summaryPlot->updateConnectedEditors();
|
||||
|
@ -90,7 +90,7 @@ void RicPasteTimeHistoryCurveFeature::onActionTriggered(bool isChecked)
|
||||
|
||||
newObject->initAfterReadRecursively();
|
||||
|
||||
newObject->loadDataAndUpdate();
|
||||
newObject->loadDataAndUpdate(true);
|
||||
newObject->updateConnectedEditors();
|
||||
|
||||
summaryPlot->updateConnectedEditors();
|
||||
|
@ -51,6 +51,7 @@
|
||||
#include "RimSummaryCaseCollection.h"
|
||||
#include "RimSummaryCurveAutoName.h"
|
||||
#include "cafPdmUiComboBoxEditor.h"
|
||||
#include "RiuSummaryQwtPlot.h"
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RicSummaryCurveCreator, "RicSummaryCurveCreator");
|
||||
@ -934,7 +935,7 @@ void RicSummaryCurveCreator::updatePreviewCurvesFromCurveDefinitions(const std::
|
||||
curve->setSummaryCase(currentCase);
|
||||
curve->setSummaryAddress(curveDef.second);
|
||||
curve->applyCurveAutoNameSettings(*m_curveNameConfig());
|
||||
m_previewPlot->addCurve(curve);
|
||||
m_previewPlot->addCurveNoUpdate(curve);
|
||||
curveLookCalc.setupCurveLook(curve);
|
||||
}
|
||||
|
||||
@ -1142,8 +1143,11 @@ void RicSummaryCurveCreator::copyCurveAndAddToPlot(const RimSummaryCurve *curve,
|
||||
CVF_ASSERT(curveCopy);
|
||||
|
||||
if (forceVisible)
|
||||
{
|
||||
curveCopy->setCurveVisiblity(true);
|
||||
plot->addCurve(curveCopy);
|
||||
}
|
||||
|
||||
plot->addCurveNoUpdate(curveCopy);
|
||||
|
||||
// Resolve references after object has been inserted into the project data model
|
||||
curveCopy->resolveReferencesRecursively();
|
||||
@ -1151,7 +1155,7 @@ void RicSummaryCurveCreator::copyCurveAndAddToPlot(const RimSummaryCurve *curve,
|
||||
// The curve creator is not a descendant of the project, and need to be set manually
|
||||
curveCopy->setSummaryCase(curve->summaryCase());
|
||||
curveCopy->initAfterReadRecursively();
|
||||
curveCopy->loadDataAndUpdate();
|
||||
curveCopy->loadDataAndUpdate(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1306,6 +1310,8 @@ void RicSummaryCurveCreator::updateCurveNames()
|
||||
for (RimSummaryCurve* curve : m_previewPlot->summaryCurves())
|
||||
{
|
||||
curve->applyCurveAutoNameSettings(*m_curveNameConfig());
|
||||
curve->updateCurveName();
|
||||
curve->updateCurveNameNoLegendUpdate();
|
||||
}
|
||||
|
||||
if (m_previewPlot && m_previewPlot->qwtPlot()) m_previewPlot->qwtPlot()->updateLegend();
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ void RicAddWellLogToPlotFeature::onActionTriggered(bool isChecked)
|
||||
curve->setWellPath(wellPath);
|
||||
curve->setWellLogChannelName(wellLog->name());
|
||||
|
||||
curve->loadDataAndUpdate();
|
||||
curve->loadDataAndUpdate(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ void RicChangeDataSourceFeature::onActionTriggered(bool isChecked)
|
||||
extractionCurve->setWellPath(featureUi.wellPathToApply);
|
||||
extractionCurve->setCase(featureUi.caseToApply);
|
||||
|
||||
extractionCurve->loadDataAndUpdate();
|
||||
extractionCurve->loadDataAndUpdate(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ void RicNewWellLogCurveExtractionFeature::onActionTriggered(bool isChecked)
|
||||
RimWellLogTrack* wellLogPlotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack();
|
||||
RimWellLogExtractionCurve* plotCurve = addCurve(wellLogPlotTrack, RiaApplication::instance()->activeReservoirView(), wellPath, simWell, branchIndex);
|
||||
|
||||
plotCurve->loadDataAndUpdate();
|
||||
plotCurve->loadDataAndUpdate(true);
|
||||
|
||||
RimWellLogPlot* plot = NULL;
|
||||
wellLogPlotTrack->firstAncestorOrThisOfType(plot);
|
||||
|
@ -174,7 +174,7 @@ void RicNewWellLogFileCurveFeature::addWellLogChannelsToPlotTrack(RimWellLogTrac
|
||||
{
|
||||
plotCurve->setWellPath(wellPath);
|
||||
plotCurve->setWellLogChannelName(wellLogFileChannels[cIdx]->name());
|
||||
plotCurve->loadDataAndUpdate();
|
||||
plotCurve->loadDataAndUpdate(true);
|
||||
plotCurve->updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ void RicPasteWellLogCurveFeature::onActionTriggered(bool isChecked)
|
||||
newObject->resolveReferencesRecursively();
|
||||
newObject->initAfterReadRecursively();
|
||||
|
||||
newObject->loadDataAndUpdate();
|
||||
newObject->loadDataAndUpdate(true);
|
||||
|
||||
wellLogTrack->updateConnectedEditors();
|
||||
}
|
||||
@ -105,7 +105,7 @@ void RicPasteWellLogCurveFeature::onActionTriggered(bool isChecked)
|
||||
newObject->resolveReferencesRecursively();
|
||||
newObject->initAfterReadRecursively();
|
||||
|
||||
newObject->loadDataAndUpdate();
|
||||
newObject->loadDataAndUpdate(true);
|
||||
|
||||
wellLogTrack->updateConnectedEditors();
|
||||
}
|
||||
|
@ -433,7 +433,7 @@ void RimWellAllocationPlot::addStackedCurve(const QString& tracerName,
|
||||
|
||||
plotTrack->addCurve(curve);
|
||||
|
||||
curve->loadDataAndUpdate();
|
||||
curve->loadDataAndUpdate(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -98,7 +98,7 @@ QString RimWellFlowRateCurve::createCurveAutoName()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellFlowRateCurve::onLoadDataAndUpdate()
|
||||
void RimWellFlowRateCurve::onLoadDataAndUpdate(bool updateParentPlot)
|
||||
{
|
||||
RimWellLogCurve::updateCurvePresentation();
|
||||
|
||||
|
@ -46,7 +46,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual QString createCurveAutoName() override;
|
||||
virtual void onLoadDataAndUpdate() override;
|
||||
virtual void onLoadDataAndUpdate(bool updateParentPlot) override;
|
||||
virtual void updateCurveAppearance() override;
|
||||
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
|
@ -429,7 +429,7 @@ void RimEclipseResultDefinition::loadDataAndUpdate()
|
||||
this->firstAncestorOrThisOfType(curve);
|
||||
if (curve)
|
||||
{
|
||||
curve->loadDataAndUpdate();
|
||||
curve->loadDataAndUpdate(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -277,7 +277,7 @@ void RimGeoMechResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
|
||||
|
||||
if (curve)
|
||||
{
|
||||
curve->loadDataAndUpdate();
|
||||
curve->loadDataAndUpdate(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -291,7 +291,7 @@ void RimGridTimeHistoryCurve::updateZoomInParentPlot()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridTimeHistoryCurve::onLoadDataAndUpdate()
|
||||
void RimGridTimeHistoryCurve::onLoadDataAndUpdate(bool updateParentPlot)
|
||||
{
|
||||
this->RimPlotCurve::updateCurvePresentation();
|
||||
|
||||
|
@ -64,7 +64,7 @@ public:
|
||||
protected:
|
||||
virtual QString createCurveAutoName() override;
|
||||
virtual void updateZoomInParentPlot() override;
|
||||
virtual void onLoadDataAndUpdate() override;
|
||||
virtual void onLoadDataAndUpdate(bool updateParentPlot) override;
|
||||
|
||||
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
|
@ -136,12 +136,12 @@ void RimPlotCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField, con
|
||||
if (changedField == &m_showCurve)
|
||||
{
|
||||
this->updateCurveVisibility();
|
||||
if (m_showCurve()) loadDataAndUpdate();
|
||||
if (m_showCurve()) loadDataAndUpdate(true);
|
||||
}
|
||||
else if (changedField == &m_curveName)
|
||||
{
|
||||
m_customCurveName = m_curveName;
|
||||
updateCurveName();
|
||||
updateCurveNameAndUpdatePlotLegend();
|
||||
}
|
||||
else if (&m_curveColor == changedField
|
||||
|| &m_curveThickness == changedField
|
||||
@ -159,11 +159,11 @@ void RimPlotCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField, con
|
||||
m_customCurveName = createCurveAutoName();
|
||||
}
|
||||
|
||||
updateCurveName();
|
||||
updateCurveNameAndUpdatePlotLegend();
|
||||
}
|
||||
else if (changedField == &m_showLegend)
|
||||
{
|
||||
updateLegendVisibility();
|
||||
updateLegendEntryVisibilityAndPlotLegend();
|
||||
}
|
||||
|
||||
if (m_parentQwtPlot) m_parentQwtPlot->replot();
|
||||
@ -213,7 +213,7 @@ void RimPlotCurve::updateCurveVisibility()
|
||||
void RimPlotCurve::updateCurvePresentation()
|
||||
{
|
||||
this->updateCurveVisibility();
|
||||
this->updateCurveName();
|
||||
this->updateCurveNameAndUpdatePlotLegend();
|
||||
|
||||
updateCurveAppearance();
|
||||
// Todo: Rest of the curve setup controlled from this class
|
||||
@ -222,7 +222,7 @@ void RimPlotCurve::updateCurvePresentation()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotCurve::setParentQwtPlot(QwtPlot* plot)
|
||||
void RimPlotCurve::setParentQwtPlotAndReplot(QwtPlot* plot)
|
||||
{
|
||||
m_parentQwtPlot = plot;
|
||||
if (m_showCurve && m_parentQwtPlot)
|
||||
@ -232,6 +232,18 @@ void RimPlotCurve::setParentQwtPlot(QwtPlot* plot)
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotCurve::setParentQwtPlotNoReplot(QwtPlot* plot)
|
||||
{
|
||||
m_parentQwtPlot = plot;
|
||||
if (m_showCurve && m_parentQwtPlot)
|
||||
{
|
||||
m_qwtPlotCurve->attach(m_parentQwtPlot);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -283,7 +295,7 @@ void RimPlotCurve::setCurveVisiblity(bool visible)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotCurve::updateCurveName()
|
||||
void RimPlotCurve::updateCurveNameAndUpdatePlotLegend()
|
||||
{
|
||||
if (m_isUsingAutoName)
|
||||
{
|
||||
@ -295,7 +307,25 @@ void RimPlotCurve::updateCurveName()
|
||||
}
|
||||
|
||||
m_qwtPlotCurve->setTitle(m_curveName);
|
||||
updateLegendVisibility();
|
||||
updateLegendEntryVisibilityAndPlotLegend();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotCurve::updateCurveNameNoLegendUpdate()
|
||||
{
|
||||
if (m_isUsingAutoName)
|
||||
{
|
||||
m_curveName = this->createCurveAutoName();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_curveName = m_customCurveName;
|
||||
}
|
||||
|
||||
m_qwtPlotCurve->setTitle(m_curveName);
|
||||
updateLegendEntryVisibilityNoPlotUpdate();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -443,9 +473,9 @@ QList<caf::PdmOptionItemInfo> RimPlotCurve::calculateValueOptions(const caf::Pdm
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotCurve::loadDataAndUpdate()
|
||||
void RimPlotCurve::loadDataAndUpdate(bool updateParentPlot)
|
||||
{
|
||||
this->onLoadDataAndUpdate();
|
||||
this->onLoadDataAndUpdate(updateParentPlot);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -498,13 +528,13 @@ void RimPlotCurve::resetAppearance()
|
||||
void RimPlotCurve::showLegend(bool show)
|
||||
{
|
||||
m_showLegend = show;
|
||||
updateLegendVisibility();
|
||||
updateLegendEntryVisibilityNoPlotUpdate();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotCurve::updateLegendVisibility()
|
||||
void RimPlotCurve::updateLegendEntryVisibilityAndPlotLegend()
|
||||
{
|
||||
if (m_showLegend()) {
|
||||
if (m_curveName().isEmpty())
|
||||
@ -526,3 +556,24 @@ void RimPlotCurve::updateLegendVisibility()
|
||||
m_parentQwtPlot->updateLegend();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotCurve::updateLegendEntryVisibilityNoPlotUpdate()
|
||||
{
|
||||
if (m_showLegend()) {
|
||||
if (m_curveName().isEmpty())
|
||||
{
|
||||
m_qwtPlotCurve->setItemAttribute(QwtPlotItem::Legend, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_qwtPlotCurve->setItemAttribute(QwtPlotItem::Legend, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_qwtPlotCurve->setItemAttribute(QwtPlotItem::Legend, false);
|
||||
}
|
||||
}
|
@ -68,9 +68,10 @@ public:
|
||||
RimPlotCurve();
|
||||
virtual ~RimPlotCurve();
|
||||
|
||||
void loadDataAndUpdate();
|
||||
void loadDataAndUpdate(bool updateParentPlot);
|
||||
|
||||
void setParentQwtPlot(QwtPlot* plot);
|
||||
void setParentQwtPlotAndReplot(QwtPlot* plot);
|
||||
void setParentQwtPlotNoReplot(QwtPlot* plot);
|
||||
void detachQwtCurve();
|
||||
QwtPlotCurve* qwtPlotCurve() const;
|
||||
|
||||
@ -84,11 +85,14 @@ public:
|
||||
bool isCurveVisible() const;
|
||||
void setCurveVisiblity(bool visible);
|
||||
|
||||
void updateCurveName();
|
||||
void updateCurveNameAndUpdatePlotLegend();
|
||||
void updateCurveNameNoLegendUpdate();
|
||||
|
||||
QString curveName() const { return m_curveName; }
|
||||
|
||||
void updateCurveVisibility();
|
||||
void updateLegendVisibility();
|
||||
void updateLegendEntryVisibilityAndPlotLegend();
|
||||
void updateLegendEntryVisibilityNoPlotUpdate();
|
||||
|
||||
void showLegend(bool show);
|
||||
|
||||
@ -96,7 +100,7 @@ protected:
|
||||
|
||||
virtual QString createCurveAutoName() = 0;
|
||||
virtual void updateZoomInParentPlot() = 0;
|
||||
virtual void onLoadDataAndUpdate() = 0;
|
||||
virtual void onLoadDataAndUpdate(bool updateParentPlot) = 0;
|
||||
|
||||
void updateCurvePresentation();
|
||||
virtual void updateCurveAppearance();
|
||||
|
@ -254,26 +254,26 @@ void RimWellLogExtractionCurve::fieldChangedByUi(const caf::PdmFieldHandle* chan
|
||||
|
||||
clearGeneratedSimWellPaths();
|
||||
|
||||
this->loadDataAndUpdate();
|
||||
this->loadDataAndUpdate(true);
|
||||
}
|
||||
else if (changedField == &m_wellPath)
|
||||
{
|
||||
this->loadDataAndUpdate();
|
||||
this->loadDataAndUpdate(true);
|
||||
}
|
||||
else if (changedField == &m_simWellName)
|
||||
{
|
||||
clearGeneratedSimWellPaths();
|
||||
|
||||
this->loadDataAndUpdate();
|
||||
this->loadDataAndUpdate(true);
|
||||
}
|
||||
else if (changedField == &m_trajectoryType ||
|
||||
changedField == &m_branchIndex)
|
||||
{
|
||||
this->loadDataAndUpdate();
|
||||
this->loadDataAndUpdate(true);
|
||||
}
|
||||
else if (changedField == &m_timeStep)
|
||||
{
|
||||
this->loadDataAndUpdate();
|
||||
this->loadDataAndUpdate(true);
|
||||
}
|
||||
|
||||
if (changedField == &m_addCaseNameToCurveName ||
|
||||
@ -283,14 +283,14 @@ void RimWellLogExtractionCurve::fieldChangedByUi(const caf::PdmFieldHandle* chan
|
||||
changedField == &m_addDateToCurveName)
|
||||
{
|
||||
this->uiCapability()->updateConnectedEditors();
|
||||
updateCurveName();
|
||||
updateCurveNameAndUpdatePlotLegend();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogExtractionCurve::onLoadDataAndUpdate()
|
||||
void RimWellLogExtractionCurve::onLoadDataAndUpdate(bool updateParentPlot)
|
||||
{
|
||||
RimWellLogCurve::updateCurvePresentation();
|
||||
|
||||
|
@ -67,7 +67,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual QString createCurveAutoName();
|
||||
virtual void onLoadDataAndUpdate();
|
||||
virtual void onLoadDataAndUpdate(bool updateParentPlot);
|
||||
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
|
||||
|
@ -68,7 +68,7 @@ RimWellLogFileCurve::~RimWellLogFileCurve()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogFileCurve::onLoadDataAndUpdate()
|
||||
void RimWellLogFileCurve::onLoadDataAndUpdate(bool updateParentPlot)
|
||||
{
|
||||
RimWellLogCurve::updateCurvePresentation();
|
||||
|
||||
@ -154,11 +154,11 @@ void RimWellLogFileCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
|
||||
|
||||
if (changedField == &m_wellPath)
|
||||
{
|
||||
this->loadDataAndUpdate();
|
||||
this->loadDataAndUpdate(true);
|
||||
}
|
||||
else if (changedField == &m_wellLogChannnelName)
|
||||
{
|
||||
this->loadDataAndUpdate();
|
||||
this->loadDataAndUpdate(true);
|
||||
}
|
||||
|
||||
if (m_parentQwtPlot) m_parentQwtPlot->replot();
|
||||
|
@ -51,7 +51,7 @@ public:
|
||||
protected:
|
||||
// Overrides from RimWellLogPlotCurve
|
||||
virtual QString createCurveAutoName();
|
||||
virtual void onLoadDataAndUpdate();
|
||||
virtual void onLoadDataAndUpdate(bool updateParentPlot);
|
||||
|
||||
// Pdm overrrides
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
|
@ -169,7 +169,7 @@ void RimWellLogTrack::addCurve(RimWellLogCurve* curve)
|
||||
|
||||
if (m_wellLogTrackPlotWidget)
|
||||
{
|
||||
curve->setParentQwtPlot(m_wellLogTrackPlotWidget);
|
||||
curve->setParentQwtPlotAndReplot(m_wellLogTrackPlotWidget);
|
||||
}
|
||||
}
|
||||
|
||||
@ -183,7 +183,7 @@ void RimWellLogTrack::insertCurve(RimWellLogCurve* curve, size_t index)
|
||||
|
||||
if (m_wellLogTrackPlotWidget)
|
||||
{
|
||||
curve->setParentQwtPlot(m_wellLogTrackPlotWidget);
|
||||
curve->setParentQwtPlotAndReplot(m_wellLogTrackPlotWidget);
|
||||
}
|
||||
}
|
||||
|
||||
@ -257,7 +257,7 @@ void RimWellLogTrack::loadDataAndUpdate()
|
||||
|
||||
for (size_t cIdx = 0; cIdx < curves.size(); ++cIdx)
|
||||
{
|
||||
curves[cIdx]->loadDataAndUpdate();
|
||||
curves[cIdx]->loadDataAndUpdate(true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -281,8 +281,10 @@ void RimWellLogTrack::recreateViewer()
|
||||
|
||||
for (size_t cIdx = 0; cIdx < curves.size(); ++cIdx)
|
||||
{
|
||||
curves[cIdx]->setParentQwtPlot(this->m_wellLogTrackPlotWidget);
|
||||
curves[cIdx]->setParentQwtPlotNoReplot(this->m_wellLogTrackPlotWidget);
|
||||
}
|
||||
|
||||
this->m_wellLogTrackPlotWidget->replot();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,7 @@ void RimAsciiDataCurve::updateZoomInParentPlot()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimAsciiDataCurve::onLoadDataAndUpdate()
|
||||
void RimAsciiDataCurve::onLoadDataAndUpdate(bool updateParentPlot)
|
||||
{
|
||||
this->RimPlotCurve::updateCurvePresentation();
|
||||
|
||||
|
@ -67,7 +67,7 @@ protected:
|
||||
|
||||
virtual QString createCurveAutoName() override;
|
||||
virtual void updateZoomInParentPlot() override;
|
||||
virtual void onLoadDataAndUpdate() override;
|
||||
virtual void onLoadDataAndUpdate(bool updateParentPlot) override;
|
||||
|
||||
private:
|
||||
bool curveData(std::vector<QDateTime>* timeSteps, std::vector<double>* values) const;
|
||||
|
@ -370,9 +370,17 @@ void RimSummaryCurve::updateZoomInParentPlot()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCurve::onLoadDataAndUpdate()
|
||||
void RimSummaryCurve::onLoadDataAndUpdate(bool updateParentPlot)
|
||||
{
|
||||
this->RimPlotCurve::updateCurvePresentation();
|
||||
this->updateCurveVisibility();
|
||||
if (updateParentPlot)
|
||||
{
|
||||
this->updateCurveNameAndUpdatePlotLegend();
|
||||
}
|
||||
else
|
||||
{
|
||||
this->updateCurveNameNoLegendUpdate();
|
||||
}
|
||||
|
||||
updateCurveAppearance();
|
||||
|
||||
@ -419,12 +427,14 @@ void RimSummaryCurve::onLoadDataAndUpdate()
|
||||
m_qwtPlotCurve->setSamplesFromTimeTAndValues(std::vector<time_t>(), std::vector<double>(), isLogCurve);
|
||||
}
|
||||
|
||||
updateZoomInParentPlot();
|
||||
|
||||
if (m_parentQwtPlot) m_parentQwtPlot->replot();
|
||||
if ( updateParentPlot && m_parentQwtPlot)
|
||||
{
|
||||
updateZoomInParentPlot();
|
||||
m_parentQwtPlot->replot();
|
||||
}
|
||||
}
|
||||
|
||||
updateQwtPlotAxis();
|
||||
if (updateParentPlot) updateQwtPlotAxis();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -503,7 +513,7 @@ void RimSummaryCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
m_curveVariable->setAddress(m_uiFilterResultSelection());
|
||||
|
||||
this->calculateCurveInterpolationFromAddress();
|
||||
this->loadDataAndUpdate();
|
||||
this->loadDataAndUpdate(true);
|
||||
|
||||
plot->updateAxes();
|
||||
}
|
||||
@ -520,7 +530,7 @@ void RimSummaryCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
else if (changedField == &m_summaryCase)
|
||||
{
|
||||
plot->updateCaseNameHasChanged();
|
||||
this->onLoadDataAndUpdate();
|
||||
this->onLoadDataAndUpdate(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ protected:
|
||||
|
||||
virtual QString createCurveAutoName() override;
|
||||
virtual void updateZoomInParentPlot() override;
|
||||
virtual void onLoadDataAndUpdate() override;
|
||||
virtual void onLoadDataAndUpdate(bool updateParentPlot) override;
|
||||
|
||||
private:
|
||||
RifSummaryReaderInterface* summaryReader() const;
|
||||
|
@ -241,7 +241,7 @@ void RimSummaryCurveAutoName::fieldChangedByUi(const caf::PdmFieldHandle* change
|
||||
RimSummaryCurve* summaryCurve = dynamic_cast<RimSummaryCurve*>(this->parentField()->ownerObject());
|
||||
if (summaryCurve)
|
||||
{
|
||||
summaryCurve->updateCurveName();
|
||||
summaryCurve->updateCurveNameAndUpdatePlotLegend();
|
||||
summaryCurve->updateConnectedEditors();
|
||||
}
|
||||
|
||||
|
@ -65,23 +65,37 @@ bool RimSummaryCurveCollection::isCurvesVisible()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCurveCollection::loadDataAndUpdate()
|
||||
void RimSummaryCurveCollection::loadDataAndUpdate(bool updateParentPlot)
|
||||
{
|
||||
for (RimSummaryCurve* curve : m_curves)
|
||||
{
|
||||
curve->loadDataAndUpdate();
|
||||
curve->loadDataAndUpdate(false);
|
||||
}
|
||||
|
||||
if ( updateParentPlot )
|
||||
{
|
||||
RimSummaryPlot* parentPlot;
|
||||
firstAncestorOrThisOfTypeAsserted(parentPlot);
|
||||
if ( parentPlot->qwtPlot() )
|
||||
{
|
||||
parentPlot->qwtPlot()->updateLegend();
|
||||
parentPlot->updateAxes();
|
||||
parentPlot->updateZoomInQwt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCurveCollection::setParentQwtPlot(QwtPlot* plot)
|
||||
void RimSummaryCurveCollection::setParentQwtPlotAndReplot(QwtPlot* plot)
|
||||
{
|
||||
for (RimSummaryCurve* curve : m_curves)
|
||||
{
|
||||
curve->setParentQwtPlot(plot);
|
||||
curve->setParentQwtPlotNoReplot(plot);
|
||||
}
|
||||
|
||||
if (plot) plot->replot();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -189,9 +203,13 @@ void RimSummaryCurveCollection::updateCaseNameHasChanged()
|
||||
{
|
||||
for (RimSummaryCurve* curve : m_curves)
|
||||
{
|
||||
curve->updateCurveName();
|
||||
curve->updateCurveNameNoLegendUpdate();
|
||||
curve->updateConnectedEditors();
|
||||
}
|
||||
|
||||
RimSummaryPlot* parentPlot;
|
||||
firstAncestorOrThisOfTypeAsserted(parentPlot);
|
||||
if (parentPlot->qwtPlot()) parentPlot->qwtPlot()->updateLegend();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -49,8 +49,8 @@ public:
|
||||
|
||||
bool isCurvesVisible();
|
||||
|
||||
void loadDataAndUpdate();
|
||||
void setParentQwtPlot(QwtPlot* plot);
|
||||
void loadDataAndUpdate(bool updateParentPlot);
|
||||
void setParentQwtPlotAndReplot(QwtPlot* plot);
|
||||
void detachQwtCurves();
|
||||
|
||||
RimSummaryCurve* findRimCurveFromQwtCurve(const QwtPlotCurve* qwtCurve) const;
|
||||
|
@ -278,6 +278,7 @@ void RimSummaryCurveFilter::fieldChangedByUi(const caf::PdmFieldHandle* changedF
|
||||
{
|
||||
curve->showLegend(m_showLegend());
|
||||
}
|
||||
m_parentQwtPlot->updateLegend();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -309,13 +310,15 @@ void RimSummaryCurveFilter::loadDataAndUpdatePlot()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCurveFilter::setParentQwtPlot(QwtPlot* plot)
|
||||
void RimSummaryCurveFilter::setParentQwtPlotAndReplot(QwtPlot* plot)
|
||||
{
|
||||
m_parentQwtPlot = plot;
|
||||
for (RimSummaryCurve* curve : m_curves)
|
||||
{
|
||||
curve->setParentQwtPlot(plot);
|
||||
curve->setParentQwtPlotNoReplot(plot);
|
||||
}
|
||||
|
||||
if (plot) plot->replot();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -455,7 +458,7 @@ void RimSummaryCurveFilter::loadDataAndUpdate()
|
||||
{
|
||||
for (RimSummaryCurve* curve: m_curves)
|
||||
{
|
||||
curve->loadDataAndUpdate();
|
||||
curve->loadDataAndUpdate(true);
|
||||
}
|
||||
|
||||
syncUiSelectionFromCurves();
|
||||
@ -582,7 +585,7 @@ void RimSummaryCurveFilter::createCurvesFromCurveDefinitions(const std::set<std:
|
||||
RimSummaryCase* currentCase = caseAddrPair.first;
|
||||
|
||||
RimSummaryCurve* curve = new RimSummaryCurve();
|
||||
curve->setParentQwtPlot(m_parentQwtPlot);
|
||||
curve->setParentQwtPlotNoReplot(m_parentQwtPlot);
|
||||
curve->setSummaryCase(currentCase);
|
||||
curve->setSummaryAddress(caseAddrPair.second);
|
||||
curve->setYAxis(m_plotAxis());
|
||||
@ -601,7 +604,7 @@ void RimSummaryCurveFilter::updateCaseNameHasChanged()
|
||||
{
|
||||
for (RimSummaryCurve* curve : m_curves)
|
||||
{
|
||||
curve->updateCurveName();
|
||||
curve->updateCurveNameAndUpdatePlotLegend();
|
||||
curve->updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
@ -644,7 +647,7 @@ void RimSummaryCurveFilter::updateCurveNames()
|
||||
for (RimSummaryCurve* curve : m_curves)
|
||||
{
|
||||
curve->applyCurveAutoNameSettings(*m_curveNameConfig());
|
||||
curve->updateCurveName();
|
||||
curve->updateCurveNameAndUpdatePlotLegend();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ public:
|
||||
bool isCurvesVisible();
|
||||
|
||||
void loadDataAndUpdate();
|
||||
void setParentQwtPlot(QwtPlot* plot);
|
||||
void setParentQwtPlotAndReplot(QwtPlot* plot);
|
||||
void detachQwtCurves();
|
||||
|
||||
RimSummaryCurve* findRimCurveFromQwtCurve(const QwtPlotCurve* qwtCurve) const;
|
||||
|
@ -472,6 +472,14 @@ RimSummaryCurveCollection* RimSummaryPlot::summaryCurveCollection() const
|
||||
return m_summaryCurveCollection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuSummaryQwtPlot* RimSummaryPlot::qwtPlot() const
|
||||
{
|
||||
return m_qwtPlot;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -748,7 +756,7 @@ void RimSummaryPlot::updateCaseNameHasChanged()
|
||||
{
|
||||
for (RimSummaryCurve* curve : m_summaryCurves_OBSOLETE)
|
||||
{
|
||||
curve->updateCurveName();
|
||||
curve->updateCurveNameAndUpdatePlotLegend();
|
||||
curve->updateConnectedEditors();
|
||||
}
|
||||
|
||||
@ -807,7 +815,7 @@ void RimSummaryPlot::zoomAll()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::addCurve(RimSummaryCurve* curve)
|
||||
void RimSummaryPlot::addCurveAndUpdate(RimSummaryCurve* curve)
|
||||
{
|
||||
if (curve)
|
||||
{
|
||||
@ -815,12 +823,29 @@ void RimSummaryPlot::addCurve(RimSummaryCurve* curve)
|
||||
|
||||
if (m_qwtPlot)
|
||||
{
|
||||
curve->setParentQwtPlot(m_qwtPlot);
|
||||
curve->setParentQwtPlotAndReplot(m_qwtPlot);
|
||||
this->updateAxes();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::addCurveNoUpdate(RimSummaryCurve* curve)
|
||||
{
|
||||
if (curve)
|
||||
{
|
||||
m_summaryCurveCollection->addCurve(curve);
|
||||
|
||||
if (m_qwtPlot)
|
||||
{
|
||||
curve->setParentQwtPlotNoReplot(m_qwtPlot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -892,7 +917,7 @@ void RimSummaryPlot::addCurveFilter(RimSummaryCurveFilter* curveFilter)
|
||||
m_curveFilters_OBSOLETE.push_back(curveFilter);
|
||||
if(m_qwtPlot)
|
||||
{
|
||||
curveFilter->setParentQwtPlot(m_qwtPlot);
|
||||
curveFilter->setParentQwtPlotAndReplot(m_qwtPlot);
|
||||
this->updateAxes();
|
||||
}
|
||||
}
|
||||
@ -908,7 +933,7 @@ void RimSummaryPlot::setCurveCollection(RimSummaryCurveCollection* curveCollecti
|
||||
m_summaryCurveCollection = curveCollection;
|
||||
if (m_qwtPlot)
|
||||
{
|
||||
m_summaryCurveCollection->setParentQwtPlot(m_qwtPlot);
|
||||
m_summaryCurveCollection->setParentQwtPlotAndReplot(m_qwtPlot);
|
||||
this->updateAxes();
|
||||
}
|
||||
}
|
||||
@ -924,7 +949,7 @@ void RimSummaryPlot::addGridTimeHistoryCurve(RimGridTimeHistoryCurve* curve)
|
||||
m_gridTimeHistoryCurves.push_back(curve);
|
||||
if (m_qwtPlot)
|
||||
{
|
||||
curve->setParentQwtPlot(m_qwtPlot);
|
||||
curve->setParentQwtPlotAndReplot(m_qwtPlot);
|
||||
this->updateAxes();
|
||||
}
|
||||
}
|
||||
@ -939,7 +964,7 @@ void RimSummaryPlot::addAsciiDataCruve(RimAsciiDataCurve* curve)
|
||||
m_asciiDataCurves.push_back(curve);
|
||||
if (m_qwtPlot)
|
||||
{
|
||||
curve->setParentQwtPlot(m_qwtPlot);
|
||||
curve->setParentQwtPlotAndReplot(m_qwtPlot);
|
||||
this->updateAxes();
|
||||
}
|
||||
}
|
||||
@ -1015,26 +1040,26 @@ void RimSummaryPlot::loadDataAndUpdate()
|
||||
|
||||
if (m_summaryCurveCollection)
|
||||
{
|
||||
m_summaryCurveCollection->loadDataAndUpdate();
|
||||
m_summaryCurveCollection->loadDataAndUpdate(false);
|
||||
}
|
||||
|
||||
for (RimSummaryCurve* curve : m_summaryCurves_OBSOLETE)
|
||||
{
|
||||
curve->loadDataAndUpdate();
|
||||
curve->loadDataAndUpdate(true);
|
||||
}
|
||||
|
||||
for (RimGridTimeHistoryCurve* curve : m_gridTimeHistoryCurves)
|
||||
{
|
||||
curve->loadDataAndUpdate();
|
||||
curve->loadDataAndUpdate(true);
|
||||
}
|
||||
|
||||
for (RimAsciiDataCurve* curve : m_asciiDataCurves)
|
||||
{
|
||||
curve->loadDataAndUpdate();
|
||||
curve->loadDataAndUpdate(true);
|
||||
}
|
||||
|
||||
if (m_qwtPlot) m_qwtPlot->updateLegend();
|
||||
this->updateAxes();
|
||||
|
||||
updateZoomInQwt();
|
||||
}
|
||||
|
||||
@ -1120,29 +1145,29 @@ QWidget* RimSummaryPlot::createViewWidget(QWidget* mainWindowParent)
|
||||
|
||||
for(RimSummaryCurveFilter* curveFilter: m_curveFilters_OBSOLETE)
|
||||
{
|
||||
curveFilter->setParentQwtPlot(m_qwtPlot);
|
||||
curveFilter->setParentQwtPlotAndReplot(m_qwtPlot);
|
||||
}
|
||||
|
||||
for (RimSummaryCurve* curve : m_summaryCurves_OBSOLETE)
|
||||
{
|
||||
curve->setParentQwtPlot(m_qwtPlot);
|
||||
curve->setParentQwtPlotAndReplot(m_qwtPlot);
|
||||
}
|
||||
|
||||
if(m_summaryCurveCollection)
|
||||
for ( RimGridTimeHistoryCurve* curve : m_gridTimeHistoryCurves )
|
||||
{
|
||||
m_summaryCurveCollection->setParentQwtPlot(m_qwtPlot);
|
||||
}
|
||||
|
||||
for (RimGridTimeHistoryCurve* curve : m_gridTimeHistoryCurves)
|
||||
{
|
||||
curve->setParentQwtPlot(m_qwtPlot);
|
||||
curve->setParentQwtPlotNoReplot(m_qwtPlot);
|
||||
}
|
||||
|
||||
for (RimAsciiDataCurve* curve : m_asciiDataCurves)
|
||||
{
|
||||
curve->setParentQwtPlot(m_qwtPlot);
|
||||
curve->setParentQwtPlotNoReplot(m_qwtPlot);
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_summaryCurveCollection )
|
||||
{
|
||||
m_summaryCurveCollection->setParentQwtPlotAndReplot(m_qwtPlot);
|
||||
}
|
||||
}
|
||||
|
||||
return m_qwtPlot;
|
||||
}
|
||||
|
@ -55,7 +55,9 @@ public:
|
||||
void setDescription(const QString& description);
|
||||
QString description() const;
|
||||
|
||||
void addCurve(RimSummaryCurve* curve);
|
||||
void addCurveAndUpdate(RimSummaryCurve* curve);
|
||||
void addCurveNoUpdate(RimSummaryCurve* curve);
|
||||
|
||||
void deleteCurve(RimSummaryCurve* curve);
|
||||
void addCurveFilter(RimSummaryCurveFilter* curveFilter);
|
||||
void setCurveCollection(RimSummaryCurveCollection* curveCollection);
|
||||
@ -98,6 +100,8 @@ public:
|
||||
std::vector<RimSummaryCurve*> summaryCurves() const;
|
||||
void deleteAllSummaryCurves();
|
||||
RimSummaryCurveCollection* summaryCurveCollection() const;
|
||||
RiuSummaryQwtPlot* qwtPlot() const;
|
||||
|
||||
// RimViewWindow overrides
|
||||
public:
|
||||
virtual QWidget* createViewWidget(QWidget* mainWindowParent) override;
|
||||
|
Loading…
Reference in New Issue
Block a user