mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Show summary data as tree structure in explorer. (#8430)
* Show summary data vectors in project explorer for both summary cases and ensembles. * Enable Drag to be able to drag'n'drop data vector into future summary plot * Make sure tree is refreshed on reload/replace operations * Provide case id and ensemble id in drag/drop object in addition to address
This commit is contained in:
@@ -58,6 +58,8 @@ CAF_PDM_SOURCE_INIT( RimSummaryAddress, "SummaryAddress" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryAddress::RimSummaryAddress()
|
||||
{
|
||||
CAF_PDM_InitObject( "SummaryAddress", ":/DataVector.png", "", "" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_category, "SummaryVarType", "Type" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_quantityName, "SummaryQuantityName", "Quantity" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_regionNumber, "SummaryRegion", "Region" );
|
||||
@@ -73,6 +75,9 @@ RimSummaryAddress::RimSummaryAddress()
|
||||
CAF_PDM_InitFieldNoDefault( &m_isErrorResult, "IsErrorResult", "Is Error Result" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_calculationId, "CalculationId", "Calculation Id" );
|
||||
|
||||
CAF_PDM_InitField( &m_caseId, "CaseId", -1, "CaseId" );
|
||||
CAF_PDM_InitField( &m_ensembleId, "EnsembleId", -1, "EnsembleId" );
|
||||
|
||||
m_category = RifEclipseSummaryAddress::SUMMARY_INVALID;
|
||||
m_regionNumber = -1;
|
||||
m_regionNumber2 = -1;
|
||||
@@ -92,6 +97,20 @@ RimSummaryAddress::~RimSummaryAddress()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryAddress* RimSummaryAddress::wrapFileReaderAddress( const RifEclipseSummaryAddress& addr,
|
||||
int caseId /* = -1 */,
|
||||
int ensembleId /* = -1 */ )
|
||||
{
|
||||
RimSummaryAddress* newAddress = new RimSummaryAddress();
|
||||
newAddress->setAddress( addr );
|
||||
newAddress->setCaseId( caseId );
|
||||
newAddress->setEnsembleId( ensembleId );
|
||||
return newAddress;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -112,6 +131,8 @@ void RimSummaryAddress::setAddress( const RifEclipseSummaryAddress& addr )
|
||||
m_cellJ = addr.cellJ();
|
||||
m_cellK = addr.cellK();
|
||||
m_calculationId = addr.id();
|
||||
|
||||
setUiName( m_quantityName );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -138,7 +159,7 @@ RifEclipseSummaryAddress RimSummaryAddress::address()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryAddress::ensureIdIsAssigned()
|
||||
void RimSummaryAddress::ensureCalculationIdIsAssigned()
|
||||
{
|
||||
if ( m_category == RifEclipseSummaryAddress::SUMMARY_CALCULATED && m_calculationId == -1 )
|
||||
{
|
||||
@@ -176,3 +197,59 @@ RiaDefines::PhaseType RimSummaryAddress::addressPhaseType() const
|
||||
}
|
||||
return RiaDefines::PhaseType::PHASE_NOT_APPLICABLE;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryAddress::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryAddress::setCaseId( int caseId )
|
||||
{
|
||||
m_caseId = caseId;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RimSummaryAddress::caseId() const
|
||||
{
|
||||
return m_caseId;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimSummaryAddress::quantityName() const
|
||||
{
|
||||
return m_quantityName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryAddress::setEnsembleId( int ensembleId )
|
||||
{
|
||||
m_ensembleId = ensembleId;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RimSummaryAddress::ensembleId() const
|
||||
{
|
||||
return m_ensembleId;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSummaryAddress::isEnsemble() const
|
||||
{
|
||||
return m_ensembleId >= 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user