Maintenance fixes

* Remove light mode from theme selection
The light mode is not working well, and was intended to be used when exporting to pdf from dark mode.

* Allow direct edit of summary case name
The name for a summary case can be automatically created. If the user starts to edit the name manually, set the name option to Custom. Make the descriptionField available as not read-only, then it is possible to edit the name directly in the project tree using F2 or double-click.

* Allow drag of ensembles
* Add support for drag/drop of well segments
* Add support for well segment number stepping in toolbar
This commit is contained in:
Magne Sjaastad
2023-05-30 15:56:19 +02:00
committed by GitHub
parent 5975fe6765
commit a9f412b1f6
19 changed files with 52 additions and 45 deletions

View File

@@ -134,7 +134,6 @@ void caf::AppEnum<RiaDefines::ThemeEnum>::setUp()
{ {
addItem( RiaDefines::ThemeEnum::DEFAULT, "DEFAULT", "Default theme" ); addItem( RiaDefines::ThemeEnum::DEFAULT, "DEFAULT", "Default theme" );
addItem( RiaDefines::ThemeEnum::DARK, "DARK", "Dark theme" ); addItem( RiaDefines::ThemeEnum::DARK, "DARK", "Dark theme" );
addItem( RiaDefines::ThemeEnum::LIGHT, "LIGHT", "Light theme" );
setDefault( RiaDefines::ThemeEnum::DEFAULT ); setDefault( RiaDefines::ThemeEnum::DEFAULT );
} }

View File

@@ -171,7 +171,6 @@ enum class ThemeEnum
{ {
DEFAULT, DEFAULT,
DARK, DARK,
LIGHT,
UNDEFINED UNDEFINED
}; };

View File

@@ -59,7 +59,6 @@ void RicImportRevealSummaryCaseFeature::onActionTriggered( bool isChecked )
auto newSumCase = new RimCsvSummaryCase(); auto newSumCase = new RimCsvSummaryCase();
newSumCase->setSummaryHeaderFileName( filePath ); newSumCase->setSummaryHeaderFileName( filePath );
newSumCase->updateOptionSensitivity();
project->assignCaseIdToSummaryCase( newSumCase ); project->assignCaseIdToSummaryCase( newSumCase );
sumCaseColl->addCase( newSumCase ); sumCaseColl->addCase( newSumCase );

View File

@@ -59,7 +59,6 @@ void RicImportStimPlanSummaryCaseFeature::onActionTriggered( bool isChecked )
auto newSumCase = new RimCsvSummaryCase(); auto newSumCase = new RimCsvSummaryCase();
newSumCase->setFileType( RimCsvSummaryCase::FileType::STIMPLAN ); newSumCase->setFileType( RimCsvSummaryCase::FileType::STIMPLAN );
newSumCase->setSummaryHeaderFileName( filePath ); newSumCase->setSummaryHeaderFileName( filePath );
newSumCase->updateOptionSensitivity();
project->assignCaseIdToSummaryCase( newSumCase ); project->assignCaseIdToSummaryCase( newSumCase );
sumCaseColl->addCase( newSumCase ); sumCaseColl->addCase( newSumCase );

View File

@@ -168,7 +168,6 @@ RimObservedSummaryData* RimObservedDataCollection::createAndAddRsmObservedSummar
observedData->setSummaryHeaderFileName( fileName ); observedData->setSummaryHeaderFileName( fileName );
observedData->createSummaryReaderInterface(); observedData->createSummaryReaderInterface();
observedData->updateMetaData(); observedData->updateMetaData();
observedData->updateOptionSensitivity();
if ( errorText && !observedData->errorMessagesFromReader().isEmpty() ) if ( errorText && !observedData->errorMessagesFromReader().isEmpty() )
{ {
@@ -224,7 +223,6 @@ RimObservedSummaryData* RimObservedDataCollection::createAndAddCvsObservedSummar
userData->setSummaryHeaderFileName( fileName ); userData->setSummaryHeaderFileName( fileName );
userData->createSummaryReaderInterface(); userData->createSummaryReaderInterface();
userData->updateMetaData(); userData->updateMetaData();
userData->updateOptionSensitivity();
if ( errorText && !userData->errorMessagesFromReader().isEmpty() ) if ( errorText && !userData->errorMessagesFromReader().isEmpty() )
{ {

View File

@@ -81,7 +81,6 @@ RimDerivedEnsembleCaseCollection::RimDerivedEnsembleCaseCollection()
m_fixedTimeStepIndex.uiCapability()->setUiEditorTypeName( caf::PdmUiTreeSelectionEditor::uiEditorTypeName() ); m_fixedTimeStepIndex.uiCapability()->setUiEditorTypeName( caf::PdmUiTreeSelectionEditor::uiEditorTypeName() );
m_fixedTimeStepIndex.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN ); m_fixedTimeStepIndex.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
setNameAsReadOnly();
setName( "Delta Ensemble" ); setName( "Delta Ensemble" );
setAsEnsemble( true ); setAsEnsemble( true );

View File

@@ -356,7 +356,7 @@ bool RimSummaryAddressCollection::canBeDragged() const
bool ok = m_subfolders.empty(); bool ok = m_subfolders.empty();
ok = ok && ( m_contentType == CollectionContentType::WELL || m_contentType == CollectionContentType::GROUP || ok = ok && ( m_contentType == CollectionContentType::WELL || m_contentType == CollectionContentType::GROUP ||
m_contentType == CollectionContentType::REGION ); m_contentType == CollectionContentType::REGION || m_contentType == CollectionContentType::WELL_SEGMENT );
return ok || isFolder(); return ok || isFolder();
} }

View File

@@ -174,7 +174,6 @@ void RimSummaryCase::copyFrom( const RimSummaryCase& rhs )
m_isObservedData = rhs.m_isObservedData; m_isObservedData = rhs.m_isObservedData;
this->updateTreeItemName(); this->updateTreeItemName();
this->updateOptionSensitivity();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -197,6 +196,7 @@ void RimSummaryCase::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
} }
else if ( changedField == &m_displayName ) else if ( changedField == &m_displayName )
{ {
m_displayNameOption = RimCaseDisplayNameTools::DisplayName::CUSTOM;
updateTreeItemName(); updateTreeItemName();
nameChanged.send(); nameChanged.send();
} }
@@ -204,16 +204,6 @@ void RimSummaryCase::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
{ {
updateConnectedEditors(); updateConnectedEditors();
} }
updateOptionSensitivity();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryCase::updateOptionSensitivity()
{
m_displayName.uiCapability()->setUiReadOnly( m_displayNameOption != RimCaseDisplayNameTools::DisplayName::CUSTOM );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -246,13 +236,19 @@ void RimSummaryCase::buildChildNodes()
m_dataVectorFolders->updateFolderStructure( addresses, m_caseId ); m_dataVectorFolders->updateFolderStructure( addresses, m_caseId );
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* RimSummaryCase::userDescriptionField()
{
return &m_displayName;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimSummaryCase::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) void RimSummaryCase::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{ {
updateOptionSensitivity();
uiOrdering.add( &m_displayName ); uiOrdering.add( &m_displayName );
uiOrdering.add( &m_displayNameOption ); uiOrdering.add( &m_displayNameOption );
uiOrdering.add( &m_summaryHeaderFilename ); uiOrdering.add( &m_summaryHeaderFilename );
@@ -346,8 +342,6 @@ void RimSummaryCase::initAfterRead()
{ {
m_displayNameOption = RimCaseDisplayNameTools::DisplayName::SHORT_CASE_NAME; m_displayNameOption = RimCaseDisplayNameTools::DisplayName::SHORT_CASE_NAME;
} }
updateOptionSensitivity();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@@ -65,7 +65,6 @@ public:
void setCaseId( int caseId ); void setCaseId( int caseId );
int caseId() const; int caseId() const;
void updateOptionSensitivity();
void refreshMetaData(); void refreshMetaData();
virtual void createSummaryReaderInterface() = 0; virtual void createSummaryReaderInterface() = 0;
@@ -94,6 +93,8 @@ protected:
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override; void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override;
caf::PdmFieldHandle* userDescriptionField() override;
void updateTreeItemName(); void updateTreeItemName();
virtual QString caseName() const = 0; virtual QString caseName() const = 0;

View File

@@ -1073,6 +1073,7 @@ void RimSummaryCaseCollection::fieldChangedByUi( const caf::PdmFieldHandle* chan
} }
if ( changedField == &m_name ) if ( changedField == &m_name )
{ {
m_autoName = false;
caseNameChanged.send(); caseNameChanged.send();
} }
} }
@@ -1092,7 +1093,6 @@ void RimSummaryCaseCollection::defineUiOrdering( QString uiConfigName, caf::PdmU
{ {
uiOrdering.add( &m_autoName ); uiOrdering.add( &m_autoName );
uiOrdering.add( &m_name ); uiOrdering.add( &m_name );
m_name.uiCapability()->setUiReadOnly( m_autoName() );
if ( m_isEnsemble() ) if ( m_isEnsemble() )
{ {
uiOrdering.add( &m_ensembleId ); uiOrdering.add( &m_ensembleId );
@@ -1124,14 +1124,6 @@ void RimSummaryCaseCollection::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiT
} }
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryCaseCollection::setNameAsReadOnly()
{
m_name.uiCapability()->setUiReadOnly( true );
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@@ -137,7 +137,6 @@ protected:
virtual void onLoadDataAndUpdate(); virtual void onLoadDataAndUpdate();
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override; void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override;
void setNameAsReadOnly();
caf::PdmChildArrayField<RimSummaryCase*> m_cases; caf::PdmChildArrayField<RimSummaryCase*> m_cases;

View File

@@ -579,7 +579,6 @@ std::vector<RimSummaryCase*>
} }
newSumCase->setSummaryHeaderFileName( smspecFileName ); newSumCase->setSummaryHeaderFileName( smspecFileName );
newSumCase->updateOptionSensitivity();
project->assignCaseIdToSummaryCase( newSumCase ); project->assignCaseIdToSummaryCase( newSumCase );
sumCases.push_back( newSumCase ); sumCases.push_back( newSumCase );

View File

@@ -35,6 +35,7 @@ void AppEnum<RimSummaryDataSourceStepping::SourceSteppingDimension>::setUp()
addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::REGION, "REGION", RiaDefines::summaryRegion() ); addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::REGION, "REGION", RiaDefines::summaryRegion() );
addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::BLOCK, "BLOCK", RiaDefines::summaryBlock() ); addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::BLOCK, "BLOCK", RiaDefines::summaryBlock() );
addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::AQUIFER, "AQUIFER", RiaDefines::summaryAquifer() ); addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::AQUIFER, "AQUIFER", RiaDefines::summaryAquifer() );
addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::WELL_SEGMENT, "WELL_SEGMENT", RiaDefines::summaryWellSegment() );
setDefault( RimSummaryDataSourceStepping::SourceSteppingDimension::VECTOR ); setDefault( RimSummaryDataSourceStepping::SourceSteppingDimension::VECTOR );
} }
} // namespace caf } // namespace caf

View File

@@ -42,7 +42,8 @@ public:
REGION, REGION,
VECTOR, VECTOR,
BLOCK, BLOCK,
AQUIFER AQUIFER,
WELL_SEGMENT
}; };
public: public:

View File

@@ -807,7 +807,16 @@ void RimSummaryMultiPlot::setDefaultRangeAggregationSteppingDimension()
auto stepDimension = RimSummaryDataSourceStepping::SourceSteppingDimension::VECTOR; auto stepDimension = RimSummaryDataSourceStepping::SourceSteppingDimension::VECTOR;
if ( analyzer.wellNames().size() == 1 ) if ( analyzer.wellNames().size() == 1 )
{ {
stepDimension = RimSummaryDataSourceStepping::SourceSteppingDimension::WELL; auto wellName = *( analyzer.wellNames().begin() );
if ( analyzer.wellSegmentNumbers( wellName ).size() == 1 )
{
stepDimension = RimSummaryDataSourceStepping::SourceSteppingDimension::WELL_SEGMENT;
}
else
{
stepDimension = RimSummaryDataSourceStepping::SourceSteppingDimension::WELL;
}
} }
else if ( analyzer.groupNames().size() == 1 ) else if ( analyzer.groupNames().size() == 1 )
{ {

View File

@@ -2308,6 +2308,16 @@ RimSummaryPlot::CurveInfo RimSummaryPlot::handleAddressCollectionDrop( RimSummar
curveAdr.setRegion( droppedRegion ); curveAdr.setRegion( droppedRegion );
newCurveDef.setSummaryAddress( curveAdr ); newCurveDef.setSummaryAddress( curveAdr );
} }
else if ( ( curveAdr.category() == RifEclipseSummaryAddress::SUMMARY_WELL_SEGMENT ) &&
( addressCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::WELL_SEGMENT ) )
{
objectIdentifierString = std::to_string( curveAdr.wellSegmentNumber() );
int droppedWellSegmentNumber = std::stoi( droppedName );
curveAdr.setWellSegmentNumber( droppedWellSegmentNumber );
newCurveDef.setSummaryAddress( curveAdr );
}
if ( !objectIdentifierString.empty() ) if ( !objectIdentifierString.empty() )
{ {

View File

@@ -76,7 +76,7 @@ RimSummaryPlotSourceStepping::RimSummaryPlotSourceStepping()
CAF_PDM_InitFieldNoDefault( &m_vectorName, "VectorName", "Vector" ); CAF_PDM_InitFieldNoDefault( &m_vectorName, "VectorName", "Vector" );
CAF_PDM_InitFieldNoDefault( &m_cellBlock, "CellBlock", "Block" ); CAF_PDM_InitFieldNoDefault( &m_cellBlock, "CellBlock", "Block" );
CAF_PDM_InitFieldNoDefault( &m_segment, "Segment", "Segment" ); CAF_PDM_InitFieldNoDefault( &m_wellSegment, "Segment", "Segment" );
CAF_PDM_InitFieldNoDefault( &m_completion, "Completion", "Completion" ); CAF_PDM_InitFieldNoDefault( &m_completion, "Completion", "Completion" );
CAF_PDM_InitFieldNoDefault( &m_aquifer, "Aquifer", "Aquifer" ); CAF_PDM_InitFieldNoDefault( &m_aquifer, "Aquifer", "Aquifer" );
@@ -271,7 +271,7 @@ QList<caf::PdmOptionItemInfo> RimSummaryPlotSourceStepping::calculateValueOption
{ {
category = RifEclipseSummaryAddress::SUMMARY_BLOCK; category = RifEclipseSummaryAddress::SUMMARY_BLOCK;
} }
else if ( fieldNeedingOptions == &m_segment ) else if ( fieldNeedingOptions == &m_wellSegment )
{ {
secondaryIdentifier = m_wellName().toStdString(); secondaryIdentifier = m_wellName().toStdString();
category = RifEclipseSummaryAddress::SUMMARY_WELL_SEGMENT; category = RifEclipseSummaryAddress::SUMMARY_WELL_SEGMENT;
@@ -453,7 +453,7 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi( const caf::PdmFieldHandle*
{ {
summaryCategoryToModify = RifEclipseSummaryAddress::SUMMARY_BLOCK; summaryCategoryToModify = RifEclipseSummaryAddress::SUMMARY_BLOCK;
} }
else if ( changedField == &m_segment ) else if ( changedField == &m_wellSegment )
{ {
summaryCategoryToModify = RifEclipseSummaryAddress::SUMMARY_WELL_SEGMENT; summaryCategoryToModify = RifEclipseSummaryAddress::SUMMARY_WELL_SEGMENT;
} }
@@ -577,6 +577,9 @@ caf::PdmValueField* RimSummaryPlotSourceStepping::fieldToModify()
case RimSummaryDataSourceStepping::SourceSteppingDimension::AQUIFER: case RimSummaryDataSourceStepping::SourceSteppingDimension::AQUIFER:
return &m_aquifer; return &m_aquifer;
case RimSummaryDataSourceStepping::SourceSteppingDimension::WELL_SEGMENT:
return &m_wellSegment;
default: default:
break; break;
} }
@@ -779,10 +782,10 @@ std::vector<caf::PdmFieldHandle*> RimSummaryPlotSourceStepping::activeFieldsForD
if ( analyzer.wellSegmentNumbers( m_wellName().toStdString() ).size() == 1 ) if ( analyzer.wellSegmentNumbers( m_wellName().toStdString() ).size() == 1 )
{ {
QString txt = QString::number( *( analyzer.wellSegmentNumbers( m_wellName().toStdString() ).begin() ) ); QString txt = QString::number( *( analyzer.wellSegmentNumbers( m_wellName().toStdString() ).begin() ) );
m_segment = txt; m_wellSegment = txt;
fieldsCommonForAllCurves.push_back( &m_segment ); fieldsCommonForAllCurves.push_back( &m_wellSegment );
} }
if ( analyzer.blocks().size() == 1 ) if ( analyzer.blocks().size() == 1 )
@@ -1152,6 +1155,10 @@ void RimSummaryPlotSourceStepping::syncWithStepper( RimSummaryPlotSourceStepping
m_aquifer = other->m_aquifer(); m_aquifer = other->m_aquifer();
break; break;
case RimSummaryDataSourceStepping::SourceSteppingDimension::WELL_SEGMENT:
m_wellSegment = other->m_wellSegment();
break;
default: default:
break; break;
} }

View File

@@ -123,7 +123,7 @@ private:
caf::PdmField<QString> m_placeholderForLabel; caf::PdmField<QString> m_placeholderForLabel;
caf::PdmField<QString> m_cellBlock; caf::PdmField<QString> m_cellBlock;
caf::PdmField<QString> m_segment; caf::PdmField<QString> m_wellSegment;
caf::PdmField<QString> m_completion; caf::PdmField<QString> m_completion;
caf::PdmField<int> m_aquifer; caf::PdmField<int> m_aquifer;

View File

@@ -251,7 +251,8 @@ Qt::ItemFlags RiuDragDrop::flags( const QModelIndex& index ) const
if ( dynamic_cast<RimEclipseCase*>( uiItem ) || dynamic_cast<RimWellLogCurve*>( uiItem ) || if ( dynamic_cast<RimEclipseCase*>( uiItem ) || dynamic_cast<RimWellLogCurve*>( uiItem ) ||
dynamic_cast<RimWellLogFileChannel*>( uiItem ) || dynamic_cast<RimPlot*>( uiItem ) || dynamic_cast<RimWellLogFileChannel*>( uiItem ) || dynamic_cast<RimPlot*>( uiItem ) ||
dynamic_cast<RimSummaryCase*>( uiItem ) || dynamic_cast<RimSummaryCurve*>( uiItem ) || dynamic_cast<RimSurface*>( uiItem ) ) dynamic_cast<RimSummaryCase*>( uiItem ) || dynamic_cast<RimSummaryCaseCollection*>( uiItem ) ||
dynamic_cast<RimSummaryCurve*>( uiItem ) || dynamic_cast<RimSurface*>( uiItem ) )
{ {
itemflags |= Qt::ItemIsDragEnabled; itemflags |= Qt::ItemIsDragEnabled;
} }