2017-03-24 15:10:39 +01:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2017 Statoil ASA
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2017-03-24 15:10:39 +01:00
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2017-03-24 15:10:39 +01:00
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2017-03-24 15:10:39 +01:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2017-05-11 11:43:15 +02:00
|
|
|
#include "RiuInterfaceToViewWindow.h"
|
2017-03-24 15:10:39 +01:00
|
|
|
|
|
|
|
#include "cafPdmPointer.h"
|
|
|
|
|
2017-05-11 11:43:15 +02:00
|
|
|
#include "qwt_plot.h"
|
|
|
|
|
2017-03-24 15:10:39 +01:00
|
|
|
#include <QFrame>
|
2017-05-11 11:43:15 +02:00
|
|
|
#include <QPointer>
|
2017-03-24 15:10:39 +01:00
|
|
|
|
|
|
|
class RimFlowCharacteristicsPlot;
|
|
|
|
class RiuNightchartsWidget;
|
|
|
|
class RiuResultQwtPlot;
|
2018-09-04 09:08:29 +02:00
|
|
|
class RiuQwtPlotCurve;
|
2017-03-24 15:10:39 +01:00
|
|
|
|
|
|
|
class QLabel;
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
namespace cvf
|
|
|
|
{
|
|
|
|
class Color3f;
|
2017-03-24 15:10:39 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==================================================================================================
|
2017-03-31 09:17:49 +02:00
|
|
|
class RiuFlowCharacteristicsPlot : public QFrame, public RiuInterfaceToViewWindow
|
2017-03-24 15:10:39 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT;
|
2019-09-06 10:40:57 +02:00
|
|
|
|
2017-03-24 15:10:39 +01:00
|
|
|
public:
|
2019-09-06 10:40:57 +02:00
|
|
|
RiuFlowCharacteristicsPlot( RimFlowCharacteristicsPlot* plotDefinition, QWidget* parent = nullptr );
|
2018-10-18 19:45:57 +02:00
|
|
|
~RiuFlowCharacteristicsPlot() override;
|
2017-03-24 15:10:39 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void setLorenzCurve( const QStringList& dateTimeStrings,
|
|
|
|
const std::vector<QDateTime>& dateTimes,
|
|
|
|
const std::vector<double>& timeHistoryValues );
|
|
|
|
void addFlowCapStorageCapCurve( const QDateTime& dateTime,
|
|
|
|
const std::vector<double>& xVals,
|
|
|
|
const std::vector<double>& yVals );
|
|
|
|
void addSweepEfficiencyCurve( const QDateTime& dateTime,
|
|
|
|
const std::vector<double>& xVals,
|
|
|
|
const std::vector<double>& yVals );
|
2017-03-24 15:10:39 +01:00
|
|
|
|
2017-03-28 23:35:53 +02:00
|
|
|
void removeAllCurves();
|
|
|
|
void zoomAll();
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void showLegend( bool show );
|
2017-05-11 21:44:44 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
RimFlowCharacteristicsPlot* ownerPlotDefinition();
|
|
|
|
RimViewWindow* ownerViewWindow() const override;
|
2017-03-24 15:10:39 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
static void addWindowZoom( QwtPlot* plot );
|
|
|
|
static RiuQwtPlotCurve* createEmptyCurve( QwtPlot* plot, const QString& curveName, const QColor& curveColor );
|
2017-03-28 23:35:53 +02:00
|
|
|
|
2017-03-24 15:10:39 +01:00
|
|
|
protected:
|
2019-09-06 10:40:57 +02:00
|
|
|
QSize sizeHint() const override;
|
|
|
|
QSize minimumSizeHint() const override;
|
|
|
|
void contextMenuEvent( QContextMenuEvent* event ) override;
|
2017-03-24 15:10:39 +01:00
|
|
|
|
|
|
|
private:
|
2019-09-06 10:40:57 +02:00
|
|
|
void setDefaults();
|
|
|
|
void initializeColors( const std::vector<QDateTime>& dateTimes );
|
|
|
|
|
|
|
|
static void addCurveWithLargeSymbol( QwtPlot* plot,
|
|
|
|
const QString& curveName,
|
|
|
|
const QColor& color,
|
|
|
|
const QDateTime& dateTime,
|
|
|
|
double timeHistoryValue );
|
2017-03-28 23:35:53 +02:00
|
|
|
|
2017-03-24 15:10:39 +01:00
|
|
|
private:
|
|
|
|
caf::PdmPointer<RimFlowCharacteristicsPlot> m_plotDefinition;
|
2017-03-28 23:35:53 +02:00
|
|
|
QPointer<QwtPlot> m_lorenzPlot;
|
|
|
|
QPointer<QwtPlot> m_flowCapVsStorageCapPlot;
|
|
|
|
QPointer<QwtPlot> m_sweepEffPlot;
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
std::map<QDateTime, QColor> m_dateToColorMap;
|
2017-03-24 15:10:39 +01:00
|
|
|
};
|