mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-09 23:53:04 -06:00
Make well log tracks reorderable
This commit is contained in:
parent
5e9403d9f1
commit
92763ee902
@ -40,6 +40,7 @@
|
||||
#include "RiuWellLogPlot.h"
|
||||
|
||||
#include "cafPdmFieldIOScriptability.h"
|
||||
#include "cafPdmFieldReorderCapability.h"
|
||||
#include "cafPdmObjectScriptability.h"
|
||||
#include "cafPdmUiComboBoxEditor.h"
|
||||
#include "cafPdmUiDoubleValueEditor.h"
|
||||
@ -116,6 +117,8 @@ RimDepthTrackPlot::RimDepthTrackPlot()
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_plots, "Tracks", "", "", "", "" );
|
||||
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_availableDepthTypes = {RiaDefines::DepthTypeEnum::MEASURED_DEPTH,
|
||||
@ -571,6 +574,8 @@ void RimDepthTrackPlot::recreatePlotWidgets()
|
||||
|
||||
auto plotVector = plots();
|
||||
|
||||
m_viewer->removeAllPlots();
|
||||
|
||||
for ( size_t tIdx = 0; tIdx < plotVector.size(); ++tIdx )
|
||||
{
|
||||
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 doRenderWindowContent( QPaintDevice* paintDevice ) override;
|
||||
void doUpdateLayout() override;
|
||||
void onPlotsReordered( const SignalEmitter* emitter );
|
||||
|
||||
protected:
|
||||
caf::PdmChildField<RimWellLogCurveCommonDataSource*> m_commonDataSource;
|
||||
|
Loading…
Reference in New Issue
Block a user