mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
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:
parent
5975fe6765
commit
a9f412b1f6
@ -134,7 +134,6 @@ void caf::AppEnum<RiaDefines::ThemeEnum>::setUp()
|
||||
{
|
||||
addItem( RiaDefines::ThemeEnum::DEFAULT, "DEFAULT", "Default theme" );
|
||||
addItem( RiaDefines::ThemeEnum::DARK, "DARK", "Dark theme" );
|
||||
addItem( RiaDefines::ThemeEnum::LIGHT, "LIGHT", "Light theme" );
|
||||
setDefault( RiaDefines::ThemeEnum::DEFAULT );
|
||||
}
|
||||
|
||||
|
@ -171,7 +171,6 @@ enum class ThemeEnum
|
||||
{
|
||||
DEFAULT,
|
||||
DARK,
|
||||
LIGHT,
|
||||
UNDEFINED
|
||||
};
|
||||
|
||||
|
@ -59,7 +59,6 @@ void RicImportRevealSummaryCaseFeature::onActionTriggered( bool isChecked )
|
||||
auto newSumCase = new RimCsvSummaryCase();
|
||||
|
||||
newSumCase->setSummaryHeaderFileName( filePath );
|
||||
newSumCase->updateOptionSensitivity();
|
||||
project->assignCaseIdToSummaryCase( newSumCase );
|
||||
|
||||
sumCaseColl->addCase( newSumCase );
|
||||
|
@ -59,7 +59,6 @@ void RicImportStimPlanSummaryCaseFeature::onActionTriggered( bool isChecked )
|
||||
auto newSumCase = new RimCsvSummaryCase();
|
||||
newSumCase->setFileType( RimCsvSummaryCase::FileType::STIMPLAN );
|
||||
newSumCase->setSummaryHeaderFileName( filePath );
|
||||
newSumCase->updateOptionSensitivity();
|
||||
project->assignCaseIdToSummaryCase( newSumCase );
|
||||
|
||||
sumCaseColl->addCase( newSumCase );
|
||||
|
@ -168,7 +168,6 @@ RimObservedSummaryData* RimObservedDataCollection::createAndAddRsmObservedSummar
|
||||
observedData->setSummaryHeaderFileName( fileName );
|
||||
observedData->createSummaryReaderInterface();
|
||||
observedData->updateMetaData();
|
||||
observedData->updateOptionSensitivity();
|
||||
|
||||
if ( errorText && !observedData->errorMessagesFromReader().isEmpty() )
|
||||
{
|
||||
@ -224,7 +223,6 @@ RimObservedSummaryData* RimObservedDataCollection::createAndAddCvsObservedSummar
|
||||
userData->setSummaryHeaderFileName( fileName );
|
||||
userData->createSummaryReaderInterface();
|
||||
userData->updateMetaData();
|
||||
userData->updateOptionSensitivity();
|
||||
|
||||
if ( errorText && !userData->errorMessagesFromReader().isEmpty() )
|
||||
{
|
||||
|
@ -81,7 +81,6 @@ RimDerivedEnsembleCaseCollection::RimDerivedEnsembleCaseCollection()
|
||||
m_fixedTimeStepIndex.uiCapability()->setUiEditorTypeName( caf::PdmUiTreeSelectionEditor::uiEditorTypeName() );
|
||||
m_fixedTimeStepIndex.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
|
||||
|
||||
setNameAsReadOnly();
|
||||
setName( "Delta Ensemble" );
|
||||
|
||||
setAsEnsemble( true );
|
||||
|
@ -356,7 +356,7 @@ bool RimSummaryAddressCollection::canBeDragged() const
|
||||
bool ok = m_subfolders.empty();
|
||||
|
||||
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();
|
||||
}
|
||||
|
@ -174,7 +174,6 @@ void RimSummaryCase::copyFrom( const RimSummaryCase& rhs )
|
||||
m_isObservedData = rhs.m_isObservedData;
|
||||
|
||||
this->updateTreeItemName();
|
||||
this->updateOptionSensitivity();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -197,6 +196,7 @@ void RimSummaryCase::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
}
|
||||
else if ( changedField == &m_displayName )
|
||||
{
|
||||
m_displayNameOption = RimCaseDisplayNameTools::DisplayName::CUSTOM;
|
||||
updateTreeItemName();
|
||||
nameChanged.send();
|
||||
}
|
||||
@ -204,16 +204,6 @@ void RimSummaryCase::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
{
|
||||
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 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimSummaryCase::userDescriptionField()
|
||||
{
|
||||
return &m_displayName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCase::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
updateOptionSensitivity();
|
||||
|
||||
uiOrdering.add( &m_displayName );
|
||||
uiOrdering.add( &m_displayNameOption );
|
||||
uiOrdering.add( &m_summaryHeaderFilename );
|
||||
@ -346,8 +342,6 @@ void RimSummaryCase::initAfterRead()
|
||||
{
|
||||
m_displayNameOption = RimCaseDisplayNameTools::DisplayName::SHORT_CASE_NAME;
|
||||
}
|
||||
|
||||
updateOptionSensitivity();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -65,7 +65,6 @@ public:
|
||||
void setCaseId( int caseId );
|
||||
int caseId() const;
|
||||
|
||||
void updateOptionSensitivity();
|
||||
void refreshMetaData();
|
||||
|
||||
virtual void createSummaryReaderInterface() = 0;
|
||||
@ -94,6 +93,8 @@ protected:
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override;
|
||||
caf::PdmFieldHandle* userDescriptionField() override;
|
||||
|
||||
void updateTreeItemName();
|
||||
|
||||
virtual QString caseName() const = 0;
|
||||
|
@ -1073,6 +1073,7 @@ void RimSummaryCaseCollection::fieldChangedByUi( const caf::PdmFieldHandle* chan
|
||||
}
|
||||
if ( changedField == &m_name )
|
||||
{
|
||||
m_autoName = false;
|
||||
caseNameChanged.send();
|
||||
}
|
||||
}
|
||||
@ -1092,7 +1093,6 @@ void RimSummaryCaseCollection::defineUiOrdering( QString uiConfigName, caf::PdmU
|
||||
{
|
||||
uiOrdering.add( &m_autoName );
|
||||
uiOrdering.add( &m_name );
|
||||
m_name.uiCapability()->setUiReadOnly( m_autoName() );
|
||||
if ( m_isEnsemble() )
|
||||
{
|
||||
uiOrdering.add( &m_ensembleId );
|
||||
@ -1124,14 +1124,6 @@ void RimSummaryCaseCollection::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiT
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCaseCollection::setNameAsReadOnly()
|
||||
{
|
||||
m_name.uiCapability()->setUiReadOnly( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -137,7 +137,6 @@ protected:
|
||||
virtual void onLoadDataAndUpdate();
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override;
|
||||
void setNameAsReadOnly();
|
||||
|
||||
caf::PdmChildArrayField<RimSummaryCase*> m_cases;
|
||||
|
||||
|
@ -579,7 +579,6 @@ std::vector<RimSummaryCase*>
|
||||
}
|
||||
|
||||
newSumCase->setSummaryHeaderFileName( smspecFileName );
|
||||
newSumCase->updateOptionSensitivity();
|
||||
project->assignCaseIdToSummaryCase( newSumCase );
|
||||
|
||||
sumCases.push_back( newSumCase );
|
||||
|
@ -35,6 +35,7 @@ void AppEnum<RimSummaryDataSourceStepping::SourceSteppingDimension>::setUp()
|
||||
addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::REGION, "REGION", RiaDefines::summaryRegion() );
|
||||
addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::BLOCK, "BLOCK", RiaDefines::summaryBlock() );
|
||||
addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::AQUIFER, "AQUIFER", RiaDefines::summaryAquifer() );
|
||||
addItem( RimSummaryDataSourceStepping::SourceSteppingDimension::WELL_SEGMENT, "WELL_SEGMENT", RiaDefines::summaryWellSegment() );
|
||||
setDefault( RimSummaryDataSourceStepping::SourceSteppingDimension::VECTOR );
|
||||
}
|
||||
} // namespace caf
|
||||
|
@ -42,7 +42,8 @@ public:
|
||||
REGION,
|
||||
VECTOR,
|
||||
BLOCK,
|
||||
AQUIFER
|
||||
AQUIFER,
|
||||
WELL_SEGMENT
|
||||
};
|
||||
|
||||
public:
|
||||
|
@ -807,7 +807,16 @@ void RimSummaryMultiPlot::setDefaultRangeAggregationSteppingDimension()
|
||||
auto stepDimension = RimSummaryDataSourceStepping::SourceSteppingDimension::VECTOR;
|
||||
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 )
|
||||
{
|
||||
|
@ -2308,6 +2308,16 @@ RimSummaryPlot::CurveInfo RimSummaryPlot::handleAddressCollectionDrop( RimSummar
|
||||
curveAdr.setRegion( droppedRegion );
|
||||
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() )
|
||||
{
|
||||
|
@ -76,7 +76,7 @@ RimSummaryPlotSourceStepping::RimSummaryPlotSourceStepping()
|
||||
CAF_PDM_InitFieldNoDefault( &m_vectorName, "VectorName", "Vector" );
|
||||
|
||||
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_aquifer, "Aquifer", "Aquifer" );
|
||||
|
||||
@ -271,7 +271,7 @@ QList<caf::PdmOptionItemInfo> RimSummaryPlotSourceStepping::calculateValueOption
|
||||
{
|
||||
category = RifEclipseSummaryAddress::SUMMARY_BLOCK;
|
||||
}
|
||||
else if ( fieldNeedingOptions == &m_segment )
|
||||
else if ( fieldNeedingOptions == &m_wellSegment )
|
||||
{
|
||||
secondaryIdentifier = m_wellName().toStdString();
|
||||
category = RifEclipseSummaryAddress::SUMMARY_WELL_SEGMENT;
|
||||
@ -453,7 +453,7 @@ void RimSummaryPlotSourceStepping::fieldChangedByUi( const caf::PdmFieldHandle*
|
||||
{
|
||||
summaryCategoryToModify = RifEclipseSummaryAddress::SUMMARY_BLOCK;
|
||||
}
|
||||
else if ( changedField == &m_segment )
|
||||
else if ( changedField == &m_wellSegment )
|
||||
{
|
||||
summaryCategoryToModify = RifEclipseSummaryAddress::SUMMARY_WELL_SEGMENT;
|
||||
}
|
||||
@ -577,6 +577,9 @@ caf::PdmValueField* RimSummaryPlotSourceStepping::fieldToModify()
|
||||
case RimSummaryDataSourceStepping::SourceSteppingDimension::AQUIFER:
|
||||
return &m_aquifer;
|
||||
|
||||
case RimSummaryDataSourceStepping::SourceSteppingDimension::WELL_SEGMENT:
|
||||
return &m_wellSegment;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -779,10 +782,10 @@ std::vector<caf::PdmFieldHandle*> RimSummaryPlotSourceStepping::activeFieldsForD
|
||||
|
||||
if ( analyzer.wellSegmentNumbers( m_wellName().toStdString() ).size() == 1 )
|
||||
{
|
||||
QString txt = QString::number( *( analyzer.wellSegmentNumbers( m_wellName().toStdString() ).begin() ) );
|
||||
m_segment = txt;
|
||||
QString txt = QString::number( *( analyzer.wellSegmentNumbers( m_wellName().toStdString() ).begin() ) );
|
||||
m_wellSegment = txt;
|
||||
|
||||
fieldsCommonForAllCurves.push_back( &m_segment );
|
||||
fieldsCommonForAllCurves.push_back( &m_wellSegment );
|
||||
}
|
||||
|
||||
if ( analyzer.blocks().size() == 1 )
|
||||
@ -1152,6 +1155,10 @@ void RimSummaryPlotSourceStepping::syncWithStepper( RimSummaryPlotSourceStepping
|
||||
m_aquifer = other->m_aquifer();
|
||||
break;
|
||||
|
||||
case RimSummaryDataSourceStepping::SourceSteppingDimension::WELL_SEGMENT:
|
||||
m_wellSegment = other->m_wellSegment();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ private:
|
||||
caf::PdmField<QString> m_placeholderForLabel;
|
||||
|
||||
caf::PdmField<QString> m_cellBlock;
|
||||
caf::PdmField<QString> m_segment;
|
||||
caf::PdmField<QString> m_wellSegment;
|
||||
caf::PdmField<QString> m_completion;
|
||||
|
||||
caf::PdmField<int> m_aquifer;
|
||||
|
@ -251,7 +251,8 @@ Qt::ItemFlags RiuDragDrop::flags( const QModelIndex& index ) const
|
||||
|
||||
if ( dynamic_cast<RimEclipseCase*>( uiItem ) || dynamic_cast<RimWellLogCurve*>( 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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user