mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge pull request #4950 from OPM/summary-curve-filter-recently-used-to-registry
Summary curve filter recently used
This commit is contained in:
@@ -17,6 +17,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RiaMemoryCleanup.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaFontCache.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaEclipseFileNameTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaFeatureCommandContext.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaStringListSerializer.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@@ -38,6 +39,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RiaMemoryCleanup.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaFontCache.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaEclipseFileNameTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaFeatureCommandContext.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaStringListSerializer.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
69
ApplicationCode/Application/RiaStringListSerializer.cpp
Normal file
69
ApplicationCode/Application/RiaStringListSerializer.cpp
Normal file
@@ -0,0 +1,69 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2019- Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiaStringListSerializer.h"
|
||||
|
||||
#include <QSettings>
|
||||
#include <QStringList>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaStringListSerializer::RiaStringListSerializer( const QString& key )
|
||||
: m_key( key )
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaStringListSerializer::addString( const QString& textString, int maxStringCount )
|
||||
{
|
||||
QSettings settings;
|
||||
QStringList stringList = settings.value( m_key ).toStringList();
|
||||
|
||||
stringList.removeAll( textString );
|
||||
stringList.prepend( textString );
|
||||
while ( stringList.size() > maxStringCount )
|
||||
stringList.removeLast();
|
||||
|
||||
settings.setValue( m_key, stringList );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaStringListSerializer::removeString( const QString& textString )
|
||||
{
|
||||
QSettings settings;
|
||||
QStringList files = settings.value( m_key ).toStringList();
|
||||
files.removeAll( textString );
|
||||
|
||||
settings.setValue( m_key, files );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QStringList RiaStringListSerializer::textStrings()
|
||||
{
|
||||
QSettings settings;
|
||||
QStringList stringList = settings.value( m_key ).toStringList();
|
||||
|
||||
return stringList;
|
||||
}
|
40
ApplicationCode/Application/RiaStringListSerializer.h
Normal file
40
ApplicationCode/Application/RiaStringListSerializer.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2019- Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QString>
|
||||
|
||||
class QStringList;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
class RiaStringListSerializer
|
||||
{
|
||||
public:
|
||||
RiaStringListSerializer( const QString& key );
|
||||
|
||||
void addString( const QString& textString, int maxStringCount );
|
||||
void removeString( const QString& textString );
|
||||
|
||||
QStringList textStrings();
|
||||
|
||||
private:
|
||||
QString m_key;
|
||||
};
|
@@ -17,9 +17,12 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiaWellNameComparer.h"
|
||||
#include "../../ProjectDataModel/RimProject.h"
|
||||
#include "../../ProjectDataModel/RimWellPath.h"
|
||||
#include "../RiaApplication.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimProject.h"
|
||||
#include "RimWellPath.h"
|
||||
|
||||
#include <regex>
|
||||
|
||||
//==================================================================================================
|
||||
|
@@ -21,7 +21,7 @@
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "../Commands/ExportCommands/RicEclipseCellResultToFileImpl.h"
|
||||
#include "ExportCommands/RicEclipseCellResultToFileImpl.h"
|
||||
#include "RicfApplicationTools.h"
|
||||
#include "RicfCommandFileExecutor.h"
|
||||
|
||||
|
@@ -18,7 +18,7 @@
|
||||
|
||||
#include "RicfExportProperty.h"
|
||||
|
||||
#include "../Commands/ExportCommands/RicEclipseCellResultToFileImpl.h"
|
||||
#include "ExportCommands/RicEclipseCellResultToFileImpl.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
|
@@ -18,7 +18,7 @@
|
||||
|
||||
#include "RicTextAnnotation3dEditor.h"
|
||||
|
||||
#include "../WellPathCommands/PointTangentManipulator/RicPointTangentManipulator.h"
|
||||
#include "WellPathCommands/PointTangentManipulator/RicPointTangentManipulator.h"
|
||||
|
||||
#include "Rim3dView.h"
|
||||
#include "RimCase.h"
|
||||
|
@@ -25,7 +25,7 @@
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaWeightedMeanCalculator.h"
|
||||
|
||||
#include "../ExportCommands/RicExportLgrFeature.h"
|
||||
#include "ExportCommands/RicExportLgrFeature.h"
|
||||
#include "RicExportCompletionDataSettingsUi.h"
|
||||
#include "RicExportFeatureImpl.h"
|
||||
#include "RicExportFractureCompletionsImpl.h"
|
||||
@@ -646,7 +646,7 @@ std::map<QString, std::vector<RigCompletionData>>
|
||||
auto it = completions.find( gridName );
|
||||
if ( it == completions.end() )
|
||||
{
|
||||
completions.insert( std::pair<QString, std::vector<RigCompletionData>>( gridName, {completion} ) );
|
||||
completions.insert( std::pair<QString, std::vector<RigCompletionData>>( gridName, { completion } ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -722,19 +722,19 @@ void RicWellPathExportCompletionDataFeatureImpl::exportWelspecsToFile( RimEclips
|
||||
RifTextDataTableFormatter formatter( stream );
|
||||
formatter.setColumnSpacing( 2 );
|
||||
|
||||
std::vector<RifTextDataTableColumn> header = {RifTextDataTableColumn( "Well" ),
|
||||
RifTextDataTableColumn( "Grp" ),
|
||||
RifTextDataTableColumn( "I" ),
|
||||
RifTextDataTableColumn( "J" ),
|
||||
RifTextDataTableColumn( "RefDepth" ),
|
||||
RifTextDataTableColumn( "Type" ),
|
||||
RifTextDataTableColumn( "DrainRad" ),
|
||||
RifTextDataTableColumn( "GasInEq" ),
|
||||
RifTextDataTableColumn( "AutoShut" ),
|
||||
RifTextDataTableColumn( "XFlow" ),
|
||||
RifTextDataTableColumn( "FluidPVT" ),
|
||||
RifTextDataTableColumn( "HydSDens" ),
|
||||
RifTextDataTableColumn( "FluidInPlReg" )};
|
||||
std::vector<RifTextDataTableColumn> header = { RifTextDataTableColumn( "Well" ),
|
||||
RifTextDataTableColumn( "Grp" ),
|
||||
RifTextDataTableColumn( "I" ),
|
||||
RifTextDataTableColumn( "J" ),
|
||||
RifTextDataTableColumn( "RefDepth" ),
|
||||
RifTextDataTableColumn( "Type" ),
|
||||
RifTextDataTableColumn( "DrainRad" ),
|
||||
RifTextDataTableColumn( "GasInEq" ),
|
||||
RifTextDataTableColumn( "AutoShut" ),
|
||||
RifTextDataTableColumn( "XFlow" ),
|
||||
RifTextDataTableColumn( "FluidPVT" ),
|
||||
RifTextDataTableColumn( "HydSDens" ),
|
||||
RifTextDataTableColumn( "FluidInPlReg" ) };
|
||||
|
||||
formatter.keyword( "WELSPECS" );
|
||||
formatter.header( header );
|
||||
@@ -787,20 +787,20 @@ void RicWellPathExportCompletionDataFeatureImpl::exportWelspeclToFile(
|
||||
RifTextDataTableFormatter formatter( stream );
|
||||
formatter.setColumnSpacing( 2 );
|
||||
|
||||
std::vector<RifTextDataTableColumn> header = {RifTextDataTableColumn( "Well" ),
|
||||
RifTextDataTableColumn( "Grp" ),
|
||||
RifTextDataTableColumn( "LGR" ),
|
||||
RifTextDataTableColumn( "I" ),
|
||||
RifTextDataTableColumn( "J" ),
|
||||
RifTextDataTableColumn( "RefDepth" ),
|
||||
RifTextDataTableColumn( "Type" ),
|
||||
RifTextDataTableColumn( "DrainRad" ),
|
||||
RifTextDataTableColumn( "GasInEq" ),
|
||||
RifTextDataTableColumn( "AutoShut" ),
|
||||
RifTextDataTableColumn( "XFlow" ),
|
||||
RifTextDataTableColumn( "FluidPVT" ),
|
||||
RifTextDataTableColumn( "HydSDens" ),
|
||||
RifTextDataTableColumn( "FluidInPlReg" )};
|
||||
std::vector<RifTextDataTableColumn> header = { RifTextDataTableColumn( "Well" ),
|
||||
RifTextDataTableColumn( "Grp" ),
|
||||
RifTextDataTableColumn( "LGR" ),
|
||||
RifTextDataTableColumn( "I" ),
|
||||
RifTextDataTableColumn( "J" ),
|
||||
RifTextDataTableColumn( "RefDepth" ),
|
||||
RifTextDataTableColumn( "Type" ),
|
||||
RifTextDataTableColumn( "DrainRad" ),
|
||||
RifTextDataTableColumn( "GasInEq" ),
|
||||
RifTextDataTableColumn( "AutoShut" ),
|
||||
RifTextDataTableColumn( "XFlow" ),
|
||||
RifTextDataTableColumn( "FluidPVT" ),
|
||||
RifTextDataTableColumn( "HydSDens" ),
|
||||
RifTextDataTableColumn( "FluidInPlReg" ) };
|
||||
|
||||
formatter.keyword( "WELSPECL" );
|
||||
formatter.header( header );
|
||||
@@ -965,45 +965,45 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompdatTableUsingFormatte
|
||||
if ( gridName.isEmpty() )
|
||||
{
|
||||
header =
|
||||
{RifTextDataTableColumn( "Well" ),
|
||||
RifTextDataTableColumn( "I" ),
|
||||
RifTextDataTableColumn( "J" ),
|
||||
RifTextDataTableColumn( "K1" ),
|
||||
RifTextDataTableColumn( "K2" ),
|
||||
RifTextDataTableColumn( "Status" ),
|
||||
RifTextDataTableColumn( "SAT" ),
|
||||
RifTextDataTableColumn( "TR",
|
||||
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat::RIF_SCIENTIFIC ) ),
|
||||
RifTextDataTableColumn( "DIAM" ),
|
||||
RifTextDataTableColumn( "KH",
|
||||
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat::RIF_SCIENTIFIC ) ),
|
||||
RifTextDataTableColumn( "S" ),
|
||||
RifTextDataTableColumn( "Df",
|
||||
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat::RIF_SCIENTIFIC ) ),
|
||||
RifTextDataTableColumn( "DIR" )};
|
||||
{ RifTextDataTableColumn( "Well" ),
|
||||
RifTextDataTableColumn( "I" ),
|
||||
RifTextDataTableColumn( "J" ),
|
||||
RifTextDataTableColumn( "K1" ),
|
||||
RifTextDataTableColumn( "K2" ),
|
||||
RifTextDataTableColumn( "Status" ),
|
||||
RifTextDataTableColumn( "SAT" ),
|
||||
RifTextDataTableColumn( "TR",
|
||||
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat::RIF_SCIENTIFIC ) ),
|
||||
RifTextDataTableColumn( "DIAM" ),
|
||||
RifTextDataTableColumn( "KH",
|
||||
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat::RIF_SCIENTIFIC ) ),
|
||||
RifTextDataTableColumn( "S" ),
|
||||
RifTextDataTableColumn( "Df",
|
||||
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat::RIF_SCIENTIFIC ) ),
|
||||
RifTextDataTableColumn( "DIR" ) };
|
||||
|
||||
formatter.keyword( "COMPDAT" );
|
||||
}
|
||||
else
|
||||
{
|
||||
header =
|
||||
{RifTextDataTableColumn( "Well" ),
|
||||
RifTextDataTableColumn( "LgrName" ),
|
||||
RifTextDataTableColumn( "I" ),
|
||||
RifTextDataTableColumn( "J" ),
|
||||
RifTextDataTableColumn( "K1" ),
|
||||
RifTextDataTableColumn( "K2" ),
|
||||
RifTextDataTableColumn( "Status" ),
|
||||
RifTextDataTableColumn( "SAT" ),
|
||||
RifTextDataTableColumn( "TR",
|
||||
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat::RIF_SCIENTIFIC ) ),
|
||||
RifTextDataTableColumn( "DIAM" ),
|
||||
RifTextDataTableColumn( "KH",
|
||||
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat::RIF_SCIENTIFIC ) ),
|
||||
RifTextDataTableColumn( "S" ),
|
||||
RifTextDataTableColumn( "Df",
|
||||
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat::RIF_SCIENTIFIC ) ),
|
||||
RifTextDataTableColumn( "DIR" )};
|
||||
{ RifTextDataTableColumn( "Well" ),
|
||||
RifTextDataTableColumn( "LgrName" ),
|
||||
RifTextDataTableColumn( "I" ),
|
||||
RifTextDataTableColumn( "J" ),
|
||||
RifTextDataTableColumn( "K1" ),
|
||||
RifTextDataTableColumn( "K2" ),
|
||||
RifTextDataTableColumn( "Status" ),
|
||||
RifTextDataTableColumn( "SAT" ),
|
||||
RifTextDataTableColumn( "TR",
|
||||
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat::RIF_SCIENTIFIC ) ),
|
||||
RifTextDataTableColumn( "DIAM" ),
|
||||
RifTextDataTableColumn( "KH",
|
||||
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat::RIF_SCIENTIFIC ) ),
|
||||
RifTextDataTableColumn( "S" ),
|
||||
RifTextDataTableColumn( "Df",
|
||||
RifTextDataTableDoubleFormatting( RifTextDataTableDoubleFormat::RIF_SCIENTIFIC ) ),
|
||||
RifTextDataTableColumn( "DIR" ) };
|
||||
|
||||
formatter.keyword( "COMPDATL" );
|
||||
}
|
||||
@@ -1270,7 +1270,7 @@ void RicWellPathExportCompletionDataFeatureImpl::appendCompletionData(
|
||||
{
|
||||
completionData->insert(
|
||||
std::pair<size_t, std::vector<RigCompletionData>>( completion.completionDataGridCell().globalCellIndex(),
|
||||
std::vector<RigCompletionData>{completion} ) );
|
||||
std::vector<RigCompletionData>{ completion } ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -18,21 +18,22 @@
|
||||
|
||||
#include "RicEditSummaryCurveCalculationFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RicShowSummaryCurveCalculatorFeature.h"
|
||||
#include "RicSummaryCurveCalculator.h"
|
||||
#include "RicSummaryCurveCalculatorDialog.h"
|
||||
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
|
||||
#include "RimCalculatedSummaryCurveReader.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCalculation.h"
|
||||
#include "RimSummaryCalculationCollection.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "../../Application/RiaApplication.h"
|
||||
#include "../../FileInterface/RifEclipseSummaryAddress.h"
|
||||
#include "../../ProjectDataModel/RimProject.h"
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafSelectionManager.h"
|
||||
#include "cafSelectionManagerTools.h"
|
||||
|
@@ -17,12 +17,15 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicShowWellPlanFeature.h"
|
||||
#include "../ApplicationCommands/RicShowPlotDataFeature.h"
|
||||
|
||||
#include "ApplicationCommands/RicShowPlotDataFeature.h"
|
||||
|
||||
#include "RimModeledWellPath.h"
|
||||
|
||||
#include "RiuTextDialog.h"
|
||||
|
||||
#include "cafSelectionManagerTools.h"
|
||||
|
||||
#include "RiuTextDialog.h"
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicShowWellPlanFeature, "RicShowWellPlanFeature" );
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
#include "RifSummaryReaderInterface.h"
|
||||
|
||||
#include "../Commands/SummaryPlotCommands/RicPasteAsciiDataToSummaryPlotFeatureUi.h"
|
||||
#include "SummaryPlotCommands/RicPasteAsciiDataToSummaryPlotFeatureUi.h"
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
|
@@ -28,7 +28,7 @@
|
||||
#include "RiaStdStringTools.h"
|
||||
#include "RiaTextStringTools.h"
|
||||
|
||||
#include "../Commands/SummaryPlotCommands/RicPasteAsciiDataToSummaryPlotFeatureUi.h"
|
||||
#include "SummaryPlotCommands/RicPasteAsciiDataToSummaryPlotFeatureUi.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
|
||||
@@ -63,7 +63,7 @@ enum class CsvLineBasedColumnType
|
||||
ERROR_VALUE,
|
||||
COMMENTS
|
||||
};
|
||||
const std::vector<QString> CSV_LINE_BASED_COL_NAMES = {"DATE", "VECTOR", "VALUE", "ERROR", "COMMENTS"};
|
||||
const std::vector<QString> CSV_LINE_BASED_COL_NAMES = { "DATE", "VECTOR", "VALUE", "ERROR", "COMMENTS" };
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
#include "RimObservedSummaryData.h"
|
||||
|
||||
#include "../../Commands/SummaryPlotCommands/RicPasteAsciiDataToSummaryPlotFeatureUi.h"
|
||||
#include "SummaryPlotCommands/RicPasteAsciiDataToSummaryPlotFeatureUi.h"
|
||||
|
||||
#include "cafPdmChildField.h"
|
||||
#include "cafPdmField.h"
|
||||
|
@@ -142,59 +142,71 @@ void RimEnsembleCurveFilterCollection::fieldChangedByUi( const caf::PdmFieldHand
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEnsembleCurveFilterCollection::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
uiOrdering.add( &m_newFilterButton );
|
||||
|
||||
for ( auto& filter : m_filters )
|
||||
RimEnsembleCurveSet* curveSet = nullptr;
|
||||
this->firstAncestorOrThisOfType( curveSet );
|
||||
if ( curveSet )
|
||||
{
|
||||
QString groupTitle;
|
||||
auto selEnsembleParam = filter->selectedEnsembleParameter();
|
||||
if ( selEnsembleParam.isNumeric() )
|
||||
// Show the color control group
|
||||
curveSet->appendColorGroup( uiOrdering );
|
||||
}
|
||||
|
||||
{
|
||||
caf::PdmUiGroup* group = uiOrdering.addNewGroup( "Filters" );
|
||||
|
||||
group->add( &m_newFilterButton );
|
||||
|
||||
for ( auto& filter : m_filters )
|
||||
{
|
||||
groupTitle = filter->ensembleParameterName();
|
||||
QString groupTitle;
|
||||
auto selEnsembleParam = filter->selectedEnsembleParameter();
|
||||
if ( selEnsembleParam.isNumeric() )
|
||||
{
|
||||
groupTitle = filter->ensembleParameterName();
|
||||
|
||||
if ( !filter->isActive() )
|
||||
{
|
||||
groupTitle += " - [Disabled]";
|
||||
}
|
||||
else
|
||||
{
|
||||
groupTitle += QString( " [%2 .. %3]" )
|
||||
.arg( QString::number( filter->minValue() ) )
|
||||
.arg( QString::number( filter->maxValue() ) );
|
||||
}
|
||||
}
|
||||
else if ( selEnsembleParam.isText() )
|
||||
{
|
||||
groupTitle = filter->ensembleParameterName();
|
||||
|
||||
if ( !filter->isActive() )
|
||||
{
|
||||
groupTitle += " - [Disabled]";
|
||||
}
|
||||
else
|
||||
{
|
||||
groupTitle += " { ";
|
||||
|
||||
bool first = true;
|
||||
for ( auto cat : filter->categories() )
|
||||
if ( !filter->isActive() )
|
||||
{
|
||||
if ( !first ) groupTitle += ", ";
|
||||
groupTitle += cat;
|
||||
first = false;
|
||||
groupTitle += " - [Disabled]";
|
||||
}
|
||||
groupTitle += " }";
|
||||
|
||||
if ( groupTitle.size() > 45 )
|
||||
else
|
||||
{
|
||||
groupTitle = groupTitle.left( 40 ) + "... }";
|
||||
groupTitle += QString( " [%2 .. %3]" )
|
||||
.arg( QString::number( filter->minValue() ) )
|
||||
.arg( QString::number( filter->maxValue() ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( selEnsembleParam.isText() )
|
||||
{
|
||||
groupTitle = filter->ensembleParameterName();
|
||||
|
||||
caf::PdmUiGroup* filterGroup = uiOrdering.addNewGroupWithKeyword( groupTitle,
|
||||
if ( !filter->isActive() )
|
||||
{
|
||||
groupTitle += " - [Disabled]";
|
||||
}
|
||||
else
|
||||
{
|
||||
groupTitle += " { ";
|
||||
|
||||
bool first = true;
|
||||
for ( const auto& cat : filter->categories() )
|
||||
{
|
||||
if ( !first ) groupTitle += ", ";
|
||||
groupTitle += cat;
|
||||
first = false;
|
||||
}
|
||||
groupTitle += " }";
|
||||
|
||||
if ( groupTitle.size() > 45 )
|
||||
{
|
||||
groupTitle = groupTitle.left( 40 ) + "... }";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
caf::PdmUiGroup* filterGroup = group->addNewGroupWithKeyword( groupTitle,
|
||||
QString( "EnsembleFilter_" ) +
|
||||
filter->filterId() );
|
||||
filter->defineUiOrdering( uiConfigName, *filterGroup );
|
||||
filter->defineUiOrdering( uiConfigName, *filterGroup );
|
||||
}
|
||||
}
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
|
@@ -639,19 +639,7 @@ void RimEnsembleCurveSet::defineUiOrdering( QString uiConfigName, caf::PdmUiOrde
|
||||
curveDataGroup->add( &m_plotAxis );
|
||||
}
|
||||
|
||||
caf::PdmUiGroup* colorsGroup = uiOrdering.addNewGroup( "Colors" );
|
||||
m_colorMode.uiCapability()->setUiReadOnly( !m_yValuesSummaryCaseCollection() );
|
||||
colorsGroup->add( &m_colorMode );
|
||||
|
||||
if ( m_colorMode == SINGLE_COLOR )
|
||||
{
|
||||
colorsGroup->add( &m_color );
|
||||
}
|
||||
else if ( m_colorMode == BY_ENSEMBLE_PARAM )
|
||||
{
|
||||
m_ensembleParameter.uiCapability()->setUiReadOnly( !m_yValuesSummaryCaseCollection() );
|
||||
colorsGroup->add( &m_ensembleParameter );
|
||||
}
|
||||
appendColorGroup( uiOrdering );
|
||||
|
||||
{
|
||||
caf::PdmUiGroup* nameGroup = uiOrdering.addNewGroup( "Curve Name" );
|
||||
@@ -674,6 +662,26 @@ void RimEnsembleCurveSet::defineUiOrdering( QString uiConfigName, caf::PdmUiOrde
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEnsembleCurveSet::appendColorGroup( caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
caf::PdmUiGroup* colorsGroup = uiOrdering.addNewGroup( "Colors" );
|
||||
m_colorMode.uiCapability()->setUiReadOnly( !m_yValuesSummaryCaseCollection() );
|
||||
colorsGroup->add( &m_colorMode );
|
||||
|
||||
if ( m_colorMode == SINGLE_COLOR )
|
||||
{
|
||||
colorsGroup->add( &m_color );
|
||||
}
|
||||
else if ( m_colorMode == BY_ENSEMBLE_PARAM )
|
||||
{
|
||||
m_ensembleParameter.uiCapability()->setUiReadOnly( !m_yValuesSummaryCaseCollection() );
|
||||
colorsGroup->add( &m_ensembleParameter );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@@ -125,6 +125,8 @@ public:
|
||||
bool hasP90Data() const;
|
||||
bool hasMeanData() const;
|
||||
|
||||
void appendColorGroup( caf::PdmUiOrdering& uiOrdering );
|
||||
|
||||
private:
|
||||
void updateEnsembleCurves( const std::vector<RimSummaryCase*>& sumCases );
|
||||
void updateStatisticsCurves( const std::vector<RimSummaryCase*>& sumCases );
|
||||
@@ -138,6 +140,7 @@ private:
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly ) override;
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
|
||||
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override;
|
||||
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
@@ -145,7 +148,7 @@ private:
|
||||
const QVariant& newValue ) override;
|
||||
|
||||
void appendOptionItemsForSummaryAddresses( QList<caf::PdmOptionItemInfo>* options,
|
||||
RimSummaryCaseCollection* summaryCaseGroup);
|
||||
RimSummaryCaseCollection* summaryCaseGroup );
|
||||
|
||||
void updateCurveColors();
|
||||
void updateQwtPlotAxis();
|
||||
@@ -154,7 +157,6 @@ private:
|
||||
QString createAutoName() const;
|
||||
|
||||
void updateLegendMappingMode();
|
||||
void sortParameterVectorByBinnedVariation( std::vector<NameParameterPair>& parameterVector ) const;
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_showCurves;
|
||||
@@ -190,5 +192,5 @@ private:
|
||||
bool m_isCurveSetFiltered;
|
||||
|
||||
// Obsolete fields
|
||||
caf::PdmChildField<RimSummaryFilter_OBSOLETE*> m_yValuesSummaryFilter_OBSOLETE;
|
||||
caf::PdmChildField<RimSummaryFilter_OBSOLETE*> m_yValuesSummaryFilter_OBSOLETE;
|
||||
};
|
||||
|
@@ -21,6 +21,7 @@
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaStringListSerializer.h"
|
||||
#include "RiaSummaryCurveDefinition.h"
|
||||
|
||||
#include "RifSummaryReaderInterface.h"
|
||||
@@ -384,14 +385,10 @@ void RimSummaryPlotFilterTextCurveSetEditor::fieldChangedByUi( const caf::PdmFie
|
||||
m_curveFilterText = curveFilterTextWithoutOutdatedLabel();
|
||||
|
||||
{
|
||||
if ( m_historyItems.indexOf( m_curveFilterText ) == -1 )
|
||||
{
|
||||
m_historyItems.push_front( m_curveFilterText );
|
||||
while ( m_historyItems.size() > 10 )
|
||||
{
|
||||
m_historyItems.pop_back();
|
||||
}
|
||||
}
|
||||
RiaStringListSerializer stringListSerializer( curveFilterRecentlyUsedRegistryKey() );
|
||||
|
||||
int maxItemCount = 10;
|
||||
stringListSerializer.addString( m_curveFilterText, maxItemCount );
|
||||
}
|
||||
|
||||
m_curveFilterText.uiCapability()->updateConnectedEditors();
|
||||
@@ -485,7 +482,9 @@ QList<caf::PdmOptionItemInfo>
|
||||
|
||||
if ( fieldNeedingOptions == &m_curveFilterText )
|
||||
{
|
||||
for ( const auto& s : m_historyItems )
|
||||
RiaStringListSerializer stringListSerializer( curveFilterRecentlyUsedRegistryKey() );
|
||||
|
||||
for ( const auto& s : stringListSerializer.textStrings() )
|
||||
{
|
||||
options.push_back( caf::PdmOptionItemInfo( s, s ) );
|
||||
}
|
||||
@@ -607,3 +606,11 @@ QString RimSummaryPlotFilterTextCurveSetEditor::curveFilterTextWithoutOutdatedLa
|
||||
|
||||
return filterText;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimSummaryPlotFilterTextCurveSetEditor::curveFilterRecentlyUsedRegistryKey()
|
||||
{
|
||||
return "curveFilterRecentlyUsedStrings";
|
||||
}
|
||||
|
@@ -57,11 +57,13 @@ private:
|
||||
std::vector<SummarySource*> selectedSummarySources() const;
|
||||
QString curveFilterTextWithoutOutdatedLabel() const;
|
||||
|
||||
static QString curveFilterRecentlyUsedRegistryKey();
|
||||
|
||||
private:
|
||||
caf::PdmPtrArrayField<SummarySource*> m_selectedSources;
|
||||
|
||||
caf::PdmField<QString> m_curveFilterLabelText;
|
||||
caf::PdmField<QString> m_curveFilterText;
|
||||
QStringList m_historyItems;
|
||||
|
||||
bool m_isFieldRecentlyChangedFromGui;
|
||||
};
|
||||
|
@@ -20,11 +20,11 @@
|
||||
|
||||
#include "RiaFilePathTools.h"
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "RiaStringListSerializer.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QFileInfo>
|
||||
#include <QMessageBox>
|
||||
#include <QSettings>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@@ -46,14 +46,8 @@ RiuRecentFileActionProvider::~RiuRecentFileActionProvider() {}
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuRecentFileActionProvider::addFileName( const QString& fileName )
|
||||
{
|
||||
QSettings settings;
|
||||
QStringList files = settings.value( "recentFileList" ).toStringList();
|
||||
files.removeAll( fileName );
|
||||
files.prepend( fileName );
|
||||
while ( files.size() > m_maxActionCount )
|
||||
files.removeLast();
|
||||
|
||||
settings.setValue( "recentFileList", files );
|
||||
RiaStringListSerializer stringListSerializer( registryKey() );
|
||||
stringListSerializer.addString( fileName, m_maxActionCount );
|
||||
|
||||
updateActions();
|
||||
}
|
||||
@@ -63,22 +57,28 @@ void RiuRecentFileActionProvider::addFileName( const QString& fileName )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuRecentFileActionProvider::removeFileName( const QString& fileName )
|
||||
{
|
||||
QSettings settings;
|
||||
QStringList files = settings.value( "recentFileList" ).toStringList();
|
||||
files.removeAll( fileName );
|
||||
|
||||
settings.setValue( "recentFileList", files );
|
||||
RiaStringListSerializer stringListSerializer( registryKey() );
|
||||
stringListSerializer.removeString( fileName );
|
||||
|
||||
updateActions();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiuRecentFileActionProvider::registryKey()
|
||||
{
|
||||
return "recentFileList";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuRecentFileActionProvider::updateActions()
|
||||
{
|
||||
QSettings settings;
|
||||
QStringList files = settings.value( "recentFileList" ).toStringList();
|
||||
RiaStringListSerializer stringListSerializer( registryKey() );
|
||||
|
||||
QStringList files = stringListSerializer.textStrings();
|
||||
|
||||
int numRecentFiles = qMin( files.size(), m_maxActionCount );
|
||||
|
||||
|
@@ -49,6 +49,8 @@ private:
|
||||
void updateActions();
|
||||
void removeFileName( const QString& fileName );
|
||||
|
||||
static QString registryKey();
|
||||
|
||||
private:
|
||||
int m_maxActionCount;
|
||||
|
||||
|
Reference in New Issue
Block a user