mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-23 15:03:27 -06:00
#1784 Add option for curve prefix when pasting ASCII data
This commit is contained in:
parent
bbb3e937d3
commit
6b0a59b864
@ -224,12 +224,21 @@ std::vector<RimAsciiDataCurve*> RicPasteAsciiDataToSummaryPlotFeature::parseCurv
|
||||
|
||||
std::map< CurveType, std::vector<RimAsciiDataCurve*> > curveToTypeMap;
|
||||
|
||||
QString curvePrefix = settings.curvePrefix();
|
||||
|
||||
for (size_t i = 0; i < values.size(); ++i)
|
||||
{
|
||||
RimAsciiDataCurve* curve = new RimAsciiDataCurve();
|
||||
curve->setTimeSteps(timeSteps);
|
||||
curve->setValues(values[i]);
|
||||
curve->setTitle(headers[i]);
|
||||
if (curvePrefix.isEmpty())
|
||||
{
|
||||
curve->setTitle(headers[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
curve->setTitle(QString("%1: %2").arg(curvePrefix).arg(headers[i]));
|
||||
}
|
||||
curveToTypeMap[guessCurveType(headers[i])].push_back(curve);
|
||||
curves.push_back(curve);
|
||||
}
|
||||
|
@ -65,6 +65,7 @@ RicPasteAsciiDataToSummaryPlotFeatureUi::RicPasteAsciiDataToSummaryPlotFeatureUi
|
||||
CAF_PDM_InitObject("RicPasteAsciiDataToSummaryPlotFeatureUi", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&m_plotTitle, "PlotTitle", QString(), "Plot Title", "", "", "");
|
||||
CAF_PDM_InitField(&m_curvePrefix, "CurvePrefix", QString(), "Curve Prefix", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_decimalSeparator, "DecimalSeparator", "Decimal Separator", "", "", "");
|
||||
|
||||
@ -134,6 +135,14 @@ QString RicPasteAsciiDataToSummaryPlotFeatureUi::plotTitle() const
|
||||
return m_plotTitle();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicPasteAsciiDataToSummaryPlotFeatureUi::curvePrefix() const
|
||||
{
|
||||
return m_curvePrefix();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -147,9 +156,13 @@ void RicPasteAsciiDataToSummaryPlotFeatureUi::createNewPlot()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicPasteAsciiDataToSummaryPlotFeatureUi::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
if (m_createNewPlot)
|
||||
{
|
||||
uiOrdering.add(&m_plotTitle);
|
||||
caf::PdmUiGroup* namingGroup = uiOrdering.addNewGroup("Naming");
|
||||
if (m_createNewPlot)
|
||||
{
|
||||
namingGroup->add(&m_plotTitle);
|
||||
}
|
||||
namingGroup->add(&m_curvePrefix);
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -73,6 +73,7 @@ public:
|
||||
QLocale decimalLocale() const;
|
||||
QString cellSeparator() const;
|
||||
QString plotTitle() const;
|
||||
QString curvePrefix() const;
|
||||
|
||||
void createNewPlot();
|
||||
|
||||
@ -81,6 +82,7 @@ protected:
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_plotTitle;
|
||||
caf::PdmField<QString> m_curvePrefix;
|
||||
caf::PdmField<DecimalSeparatorEnum> m_decimalSeparator;
|
||||
caf::PdmField<DateFormatEnum> m_dateFormat;
|
||||
caf::PdmField<TimeFormatEnum> m_timeFormat;
|
||||
|
Loading…
Reference in New Issue
Block a user