mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-08 07:03:25 -06:00
#3087 Show plot data. Do not display tabs when only ascii data curves exist. Bugfixes
This commit is contained in:
parent
13e5a3214b
commit
0baf2226a2
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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>());
|
||||
|
||||
|
@ -126,6 +126,8 @@ public:
|
||||
void showPlotInfoLabel(bool show);
|
||||
void updatePlotInfoLabel();
|
||||
|
||||
bool containsResamplableCurves() const;
|
||||
|
||||
// RimViewWindow overrides
|
||||
public:
|
||||
virtual QWidget* createViewWidget(QWidget* mainWindowParent) override;
|
||||
|
Loading…
Reference in New Issue
Block a user