#4581 Summary Plot: Add default curve style to preferences for history curves

This commit is contained in:
Magne Sjaastad 2019-08-16 15:41:58 +02:00
parent dab424ace3
commit 4cb1c9faca
3 changed files with 53 additions and 15 deletions

View File

@ -44,7 +44,16 @@ namespace caf
addItem(RiaPreferences::NOT_IMPORT, "NOT_IMPORT", "Skip");
setDefault(RiaPreferences::IMPORT);
}
}
template<>
void RiaPreferences::SummaryHistoryCurveStyleModeType::setUp()
{
addItem(RiaPreferences::SYMBOLS, "SYMBOLS", "Symbols");
addItem(RiaPreferences::LINES, "LINES", "Lines");
addItem(RiaPreferences::SYMBOLS_AND_LINES, "SYMBOLS_AND_LINES", "Symbols and Lines");
setDefault(RiaPreferences::SYMBOLS);
}
}
CAF_PDM_SOURCE_INIT(RiaPreferences, "RiaPreferences");
@ -141,6 +150,7 @@ RiaPreferences::RiaPreferences(void)
CAF_PDM_InitField(&gridImportMode, "gridImportMode", SummaryRestartFilesImportModeType(RiaPreferences::NOT_IMPORT), "Default Grid Import Option", "", "", "");
CAF_PDM_InitField(&summaryEnsembleImportMode, "summaryEnsembleImportMode", SummaryRestartFilesImportModeType(RiaPreferences::IMPORT), "Default Ensemble Summary Import Option", "", "", "");
CAF_PDM_InitField(&defaultSummaryHistoryCurveStyle, "defaultSummaryHistoryCurveStyle", SummaryHistoryCurveStyleModeType(RiaPreferences::SYMBOLS), "Default Curve Style for History Vectors", "", "", "");
CAF_PDM_InitField(&defaultSummaryCurvesTextFilter, "defaultSummaryCurvesTextFilter", QString("FOPT"), "Default Summary Curves", "", "Semicolon separated list of filters used to create curves in new summary plots", "");
CAF_PDM_InitFieldNoDefault(&m_holoLensExportFolder, "holoLensExportFolder", "HoloLens Export Folder", "", "", "");
@ -276,11 +286,11 @@ void RiaPreferences::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
caf::PdmUiGroup* group = restartBehaviourGroup->addNewGroup("Origin Ensemble Summary Files");
group->add(&summaryEnsembleImportMode);
}
{
caf::PdmUiGroup* summaryPlotsGroup = uiOrdering.addNewGroup("Summary Plots");
summaryPlotsGroup->add(&defaultSummaryCurvesTextFilter);
}
}
else if (uiConfigName == RiaPreferences::tabNameEclipseSummary())
{
uiOrdering.add(&defaultSummaryCurvesTextFilter);
uiOrdering.add(&defaultSummaryHistoryCurveStyle);
}
else if (uiConfigName == RiaPreferences::tabNameScripting())
{

View File

@ -48,6 +48,14 @@ public:
typedef caf::AppEnum<SummaryRestartFilesImportMode> SummaryRestartFilesImportModeType;
typedef RiaFontCache::FontSizeType FontSizeType;
enum SummaryHistoryCurveStyleMode
{
SYMBOLS,
LINES,
SYMBOLS_AND_LINES
};
typedef caf::AppEnum<SummaryHistoryCurveStyleMode> SummaryHistoryCurveStyleModeType;
RiaPreferences(void);
~RiaPreferences(void) override;
@ -110,7 +118,8 @@ public: // Pdm Fields
caf::PdmField<SummaryRestartFilesImportModeType> gridImportMode;
caf::PdmField<SummaryRestartFilesImportModeType> summaryEnsembleImportMode;
caf::PdmField<QString> defaultSummaryCurvesTextFilter;
caf::PdmField<QString> defaultSummaryCurvesTextFilter;
caf::PdmField<SummaryHistoryCurveStyleModeType> defaultSummaryHistoryCurveStyle;
caf::PdmField<bool> holoLensDisableCertificateVerification;
caf::PdmField<QString> csvTextExportFieldSeparator;

View File

@ -18,13 +18,13 @@
#include "RimSummaryCurve.h"
#include "RiaGuiApplication.h"
#include "RiaDefines.h"
#include "RiaGuiApplication.h"
#include "RiaPreferences.h"
#include "RiaTimeHistoryCurveMerger.h"
#include "RifReaderEclipseSummary.h"
#include "RiaTimeHistoryCurveMerger.h"
#include "RimEclipseResultCase.h"
#include "RimEnsembleCurveSet.h"
#include "RimEnsembleCurveSetCollection.h"
@ -806,15 +806,34 @@ void RimSummaryCurve::setCurveAppearanceFromCaseType()
if (m_yValuesSummaryCase->isObservedData())
{
setLineStyle(RiuQwtPlotCurve::STYLE_NONE);
if (symbol() == RiuQwtSymbol::SYMBOL_NONE)
{
setSymbol(RiuQwtSymbol::SYMBOL_XCROSS);
}
setSymbol(RiuQwtSymbol::SYMBOL_XCROSS);
return;
}
}
if (m_yValuesCurveVariable && m_yValuesCurveVariable->address().isHistoryQuantity())
{
RiaPreferences* prefs = RiaApplication::instance()->preferences();
if (prefs->defaultSummaryHistoryCurveStyle() == RiaPreferences::SYMBOLS)
{
setSymbol(RiuQwtSymbol::SYMBOL_XCROSS);
setLineStyle(RiuQwtPlotCurve::STYLE_NONE);
}
else if (prefs->defaultSummaryHistoryCurveStyle() == RiaPreferences::SYMBOLS_AND_LINES)
{
setSymbol(RiuQwtSymbol::SYMBOL_XCROSS);
setLineStyle(RiuQwtPlotCurve::STYLE_SOLID);
}
else if (prefs->defaultSummaryHistoryCurveStyle() == RiaPreferences::LINES)
{
setSymbol(RiuQwtSymbol::SYMBOL_NONE);
setLineStyle(RiuQwtPlotCurve::STYLE_SOLID);
}
return;
}
}
//--------------------------------------------------------------------------------------------------