#3087 Show plot data. Do not display tabs when only ascii data curves exist. Bugfixes

This commit is contained in:
Bjørn Erik Jensen 2018-07-02 13:06:07 +02:00
parent 13e5a3214b
commit 0baf2226a2
4 changed files with 23 additions and 5 deletions

View File

@ -90,7 +90,7 @@ const std::vector<double>& RiaTimeHistoryCurveResampler::resampledValues() const
//--------------------------------------------------------------------------------------------------
std::vector<time_t> RiaTimeHistoryCurveResampler::timeStepsFromTimeRange(DateTimePeriod period, time_t minTime, time_t maxTime)
{
CVF_ASSERT(minTime <= maxTime);
if(minTime > maxTime) return std::vector<time_t>();
auto firstOriginalTimeStep = QDT::fromTime_t(minTime);
auto lastOriginalTimeStep = QDT::fromTime_t(maxTime);

View File

@ -88,9 +88,16 @@ void RicShowPlotDataFeature::onActionTriggered(bool isChecked)
for (RimSummaryPlot* summaryPlot : selectedSummaryPlots)
{
QString title = summaryPlot->description();
QString text = summaryPlot->asciiDataForPlotExport();
RicShowPlotDataFeature::showTabbedTextWindow(title, [summaryPlot](DateTimePeriod period) { return summaryPlot->asciiDataForPlotExport(period); });
if (summaryPlot->containsResamplableCurves())
{
RicShowPlotDataFeature::showTabbedTextWindow(title, [summaryPlot](DateTimePeriod period) { return summaryPlot->asciiDataForPlotExport(period); });
}
else
{
QString text = summaryPlot->asciiDataForPlotExport();
RicShowPlotDataFeature::showTextWindow(title, text);
}
}
for (RimWellLogPlot* wellLogPlot : wellLogPlots)

View File

@ -511,6 +511,14 @@ void RimSummaryPlot::updatePlotInfoLabel()
showPlotInfoLabel(anyCurveSetFiltered);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimSummaryPlot::containsResamplableCurves() const
{
return !m_gridTimeHistoryCurves.empty() || !summaryAndEnsembleCurves().empty();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -1739,6 +1747,9 @@ void prepareCaseCurvesForExport(DateTimePeriod period, ResampleAlgorithm algorit
if (period != DateTimePeriod::NONE)
{
// Prepare result data
resultCurvesData->resamplePeriod = period;
for (size_t i = 0; i < inputCurvesData.caseNames.size(); i++)
{
// Shortcuts to input data
@ -1747,8 +1758,6 @@ void prepareCaseCurvesForExport(DateTimePeriod period, ResampleAlgorithm algorit
auto& caseCurveData = inputCurvesData.allCurveData[i];
// Prepare result data
resultCurvesData->resamplePeriod = period;
//resultCurvesData->resampleAlgorithm = algorithm;
resultCurvesData->caseNames.push_back(caseName);
resultCurvesData->allCurveData.push_back(std::vector<CurveData>());

View File

@ -126,6 +126,8 @@ public:
void showPlotInfoLabel(bool show);
void updatePlotInfoLabel();
bool containsResamplableCurves() const;
// RimViewWindow overrides
public:
virtual QWidget* createViewWidget(QWidget* mainWindowParent) override;