mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Make well log tracks reorderable
This commit is contained in:
@@ -40,6 +40,7 @@
|
|||||||
#include "RiuWellLogPlot.h"
|
#include "RiuWellLogPlot.h"
|
||||||
|
|
||||||
#include "cafPdmFieldIOScriptability.h"
|
#include "cafPdmFieldIOScriptability.h"
|
||||||
|
#include "cafPdmFieldReorderCapability.h"
|
||||||
#include "cafPdmObjectScriptability.h"
|
#include "cafPdmObjectScriptability.h"
|
||||||
#include "cafPdmUiComboBoxEditor.h"
|
#include "cafPdmUiComboBoxEditor.h"
|
||||||
#include "cafPdmUiDoubleValueEditor.h"
|
#include "cafPdmUiDoubleValueEditor.h"
|
||||||
@@ -116,6 +117,8 @@ RimDepthTrackPlot::RimDepthTrackPlot()
|
|||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault( &m_plots, "Tracks", "", "", "", "" );
|
CAF_PDM_InitFieldNoDefault( &m_plots, "Tracks", "", "", "", "" );
|
||||||
m_plots.uiCapability()->setUiHidden( true );
|
m_plots.uiCapability()->setUiHidden( true );
|
||||||
|
auto reorderability = caf::PdmFieldReorderCapability::addToField( &m_plots );
|
||||||
|
reorderability->orderChanged.connect( this, &RimDepthTrackPlot::onPlotsReordered );
|
||||||
|
|
||||||
m_availableDepthUnits = {RiaDefines::DepthUnitType::UNIT_METER, RiaDefines::DepthUnitType::UNIT_FEET};
|
m_availableDepthUnits = {RiaDefines::DepthUnitType::UNIT_METER, RiaDefines::DepthUnitType::UNIT_FEET};
|
||||||
m_availableDepthTypes = {RiaDefines::DepthTypeEnum::MEASURED_DEPTH,
|
m_availableDepthTypes = {RiaDefines::DepthTypeEnum::MEASURED_DEPTH,
|
||||||
@@ -571,6 +574,8 @@ void RimDepthTrackPlot::recreatePlotWidgets()
|
|||||||
|
|
||||||
auto plotVector = plots();
|
auto plotVector = plots();
|
||||||
|
|
||||||
|
m_viewer->removeAllPlots();
|
||||||
|
|
||||||
for ( size_t tIdx = 0; tIdx < plotVector.size(); ++tIdx )
|
for ( size_t tIdx = 0; tIdx < plotVector.size(); ++tIdx )
|
||||||
{
|
{
|
||||||
plotVector[tIdx]->createPlotWidget();
|
plotVector[tIdx]->createPlotWidget();
|
||||||
@@ -715,6 +720,16 @@ void RimDepthTrackPlot::doUpdateLayout()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimDepthTrackPlot::onPlotsReordered( const SignalEmitter* emitter )
|
||||||
|
{
|
||||||
|
updateSubPlotNames();
|
||||||
|
recreatePlotWidgets();
|
||||||
|
loadDataAndUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -155,6 +155,7 @@ private:
|
|||||||
void onPlotAdditionOrRemoval();
|
void onPlotAdditionOrRemoval();
|
||||||
void doRenderWindowContent( QPaintDevice* paintDevice ) override;
|
void doRenderWindowContent( QPaintDevice* paintDevice ) override;
|
||||||
void doUpdateLayout() override;
|
void doUpdateLayout() override;
|
||||||
|
void onPlotsReordered( const SignalEmitter* emitter );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
caf::PdmChildField<RimWellLogCurveCommonDataSource*> m_commonDataSource;
|
caf::PdmChildField<RimWellLogCurveCommonDataSource*> m_commonDataSource;
|
||||||
|
|||||||
Reference in New Issue
Block a user