#4569 Summary Command Line: Add support for normalization (-n)

This commit is contained in:
Jacob Støren 2019-08-14 08:53:08 +02:00 committed by Gaute Lindkvist
parent 421cbb3e74
commit b670f3df0d
3 changed files with 16 additions and 7 deletions

View File

@ -179,9 +179,10 @@ RimSummaryPlot* RicSummaryPlotFeatureImpl::createSummaryPlotFromArgumentLine(con
"\n" "\n"
"The summary plot options are: \n" "The summary plot options are: \n"
" -help\t Show this help text and ignore the rest of the options.\n" " -help\t Show this help text and ignore the rest of the options.\n"
" -nl Omit legend in plot.\n" " -nl\t Omit legend in plot.\n"
" -h Include history vectors. Will be read from the summary file if the vectors exist.\n" " -h\t Include history vectors. Will be read from the summary file if the vectors exist.\n"
" Only history vectors from the first summary case in the project will be included.\n" " \t Only history vectors from the first summary case in the project will be included.\n"
" -n\t Scale all curves into the range 0.0-1.0."
); );
return nullptr; return nullptr;
} }
@ -214,6 +215,7 @@ RimSummaryPlot* RicSummaryPlotFeatureImpl::createSummaryPlotFromArgumentLine(con
} }
bool hideLegend = options.contains("-nl"); bool hideLegend = options.contains("-nl");
bool addHistoryCurves = options.contains("-h"); bool addHistoryCurves = options.contains("-h");
bool isNormalizedY = options.contains("-n");
std::vector<RimSummaryCase*> summaryCasesToUse = RiaApplication::instance()->project()->allSummaryCases(); std::vector<RimSummaryCase*> summaryCasesToUse = RiaApplication::instance()->project()->allSummaryCases();
@ -228,10 +230,8 @@ RimSummaryPlot* RicSummaryPlotFeatureImpl::createSummaryPlotFromArgumentLine(con
addHistoryCurves = false; addHistoryCurves = false;
} }
if (hideLegend) newPlot->showLegend(!hideLegend);
{ newPlot->setNormalizationEnabled(isNormalizedY);
newPlot->showLegend(false);
}
newPlot->applyDefaultCurveAppearances(); newPlot->applyDefaultCurveAppearances();
newPlot->loadDataAndUpdate(); newPlot->loadDataAndUpdate();

View File

@ -638,6 +638,14 @@ bool RimSummaryPlot::applyFontSize(RiaDefines::FontSettingType fontSettingType,
return anyChange; return anyChange;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryPlot::setNormalizationEnabled(bool enable)
{
m_normalizeCurveYValues = enable;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -140,6 +140,7 @@ public:
bool hasCustomFontSizes(RiaDefines::FontSettingType fontSettingType, int defaultFontSize) const override; bool hasCustomFontSizes(RiaDefines::FontSettingType fontSettingType, int defaultFontSize) const override;
bool applyFontSize(RiaDefines::FontSettingType fontSettingType, int oldFontSize, int fontSize, bool forceChange = false) override; bool applyFontSize(RiaDefines::FontSettingType fontSettingType, int oldFontSize, int fontSize, bool forceChange = false) override;
void setNormalizationEnabled(bool enable);
bool isNormalizationEnabled(); bool isNormalizationEnabled();
void showLegend(bool enable); void showLegend(bool enable);
public: public: