mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge remote-tracking branch 'refs/remotes/origin/dev'
Conflicts: ApplicationCode/CMakeLists.txt ApplicationCode/ProjectDataModel/CMakeLists_files.cmake ApplicationCode/ProjectDataModel/RimEclipseWell.h ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake
This commit is contained in:
@@ -40,6 +40,7 @@ ${CEE_CURRENT_LIST_DIR}RiuGeoMechXfTensorResultAccessor.h
|
||||
${CEE_CURRENT_LIST_DIR}RiuFemTimeHistoryResultAccessor.h
|
||||
${CEE_CURRENT_LIST_DIR}RiuExportMultipleSnapshotsWidget.h
|
||||
${CEE_CURRENT_LIST_DIR}RiuWellAllocationPlot.h
|
||||
${CEE_CURRENT_LIST_DIR}RiuNightchartsWidget.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@@ -78,6 +79,7 @@ ${CEE_CURRENT_LIST_DIR}RiuGeoMechXfTensorResultAccessor.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RiuFemTimeHistoryResultAccessor.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RiuExportMultipleSnapshotsWidget.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RiuWellAllocationPlot.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RiuNightchartsWidget.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
@@ -105,6 +107,7 @@ ${CEE_CURRENT_LIST_DIR}RiuSummaryQwtPlot.h
|
||||
${CEE_CURRENT_LIST_DIR}RiuQwtScalePicker.h
|
||||
${CEE_CURRENT_LIST_DIR}RiuExportMultipleSnapshotsWidget.h
|
||||
${CEE_CURRENT_LIST_DIR}RiuWellAllocationPlot.h
|
||||
${CEE_CURRENT_LIST_DIR}RiuNightchartsWidget.h
|
||||
)
|
||||
|
||||
list(APPEND QT_UI_FILES
|
||||
|
||||
@@ -766,6 +766,7 @@ RimMdiWindowGeometry RiuMainPlotWindow::windowGeometryForWidget(QWidget* widget)
|
||||
|
||||
if (widget)
|
||||
{
|
||||
geo.mainWindowID = 1;
|
||||
geo.x = widget->pos().x();
|
||||
geo.y = widget->pos().y();
|
||||
geo.width = widget->size().width();
|
||||
|
||||
@@ -57,9 +57,9 @@ public:
|
||||
void initializeGuiNewProjectLoaded();
|
||||
void cleanupGuiBeforeProjectClose();
|
||||
|
||||
void removeViewer( QWidget* viewer );
|
||||
void addViewer(QWidget* viewer, const RimMdiWindowGeometry& windowsGeometry);
|
||||
void setActiveViewer(QWidget* subWindow);
|
||||
void removeViewer( QWidget* viewer ) override;
|
||||
void addViewer(QWidget* viewer, const RimMdiWindowGeometry& windowsGeometry) override;
|
||||
void setActiveViewer(QWidget* subWindow) override;
|
||||
|
||||
caf::PdmUiTreeView* projectTreeView() { return m_projectTreeView;}
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
|
||||
void setExpanded(const caf::PdmUiItem* uiItem, bool expanded);
|
||||
|
||||
RimMdiWindowGeometry windowGeometryForViewer(QWidget* viewer);
|
||||
RimMdiWindowGeometry windowGeometryForViewer(QWidget* viewer) override;
|
||||
RimMdiWindowGeometry windowGeometryForWidget(QWidget* widget);
|
||||
|
||||
void tileWindows();
|
||||
|
||||
@@ -1638,6 +1638,7 @@ RimMdiWindowGeometry RiuMainWindow::windowGeometryForWidget(QWidget* widget)
|
||||
|
||||
if (widget)
|
||||
{
|
||||
geo.mainWindowID = 0;
|
||||
geo.x = widget->pos().x();
|
||||
geo.y = widget->pos().y();
|
||||
geo.width = widget->size().width();
|
||||
|
||||
@@ -77,9 +77,9 @@ public:
|
||||
void cleanupGuiCaseClose();
|
||||
void cleanupGuiBeforeProjectClose();
|
||||
|
||||
void removeViewer( QWidget* viewer );
|
||||
void addViewer(QWidget* viewer, const RimMdiWindowGeometry& windowsGeometry);
|
||||
void setActiveViewer(QWidget* subWindow);
|
||||
void removeViewer( QWidget* viewer ) override;
|
||||
void addViewer(QWidget* viewer, const RimMdiWindowGeometry& windowsGeometry) override;
|
||||
void setActiveViewer(QWidget* subWindow) override;
|
||||
|
||||
void setResultInfo(const QString& info) const;
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <QMainWindow>
|
||||
struct RimMdiWindowGeometry;
|
||||
|
||||
class RiuMainWindowBase : public QMainWindow
|
||||
{
|
||||
@@ -29,6 +30,12 @@ public:
|
||||
|
||||
virtual QString mainWindowName() = 0;
|
||||
|
||||
virtual void removeViewer( QWidget* viewer ) = 0;
|
||||
virtual void addViewer(QWidget* viewer, const RimMdiWindowGeometry& windowsGeometry)= 0;
|
||||
virtual void setActiveViewer(QWidget* subWindow) = 0;
|
||||
|
||||
virtual RimMdiWindowGeometry windowGeometryForViewer(QWidget* viewer) = 0;
|
||||
|
||||
void loadWinGeoAndDockToolBarLayout();
|
||||
void saveWinGeoAndDockToolBarLayout();
|
||||
void showWindow();
|
||||
|
||||
79
ApplicationCode/UserInterface/RiuNightchartsWidget.cpp
Normal file
79
ApplicationCode/UserInterface/RiuNightchartsWidget.cpp
Normal file
@@ -0,0 +1,79 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil ASA
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiuNightchartsWidget.h"
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuNightchartsWidget::RiuNightchartsWidget(QWidget* parent) :
|
||||
QWidget(parent)
|
||||
{
|
||||
clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuNightchartsWidget::setType(Nightcharts::type t)
|
||||
{
|
||||
m_chart.setType(t);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuNightchartsWidget::clear()
|
||||
{
|
||||
m_chart = Nightcharts();
|
||||
m_chart.setType(Nightcharts::Pie);
|
||||
m_chart.setLegendType(Nightcharts::Vertical);
|
||||
|
||||
m_marginLeft = 16;
|
||||
m_marginTop = 16;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuNightchartsWidget::paintEvent(QPaintEvent* e)
|
||||
{
|
||||
QWidget::paintEvent(e);
|
||||
|
||||
if(!m_chart.pieceCount()) return ;
|
||||
|
||||
QPainter painter;
|
||||
QFont font;
|
||||
painter.begin(this);
|
||||
int w = (this->width() - m_marginLeft - 150);
|
||||
int h = (this->height() - m_marginTop - 100);
|
||||
int size = (w<h)?w:h;
|
||||
m_chart.setCords(m_marginLeft, m_marginTop,size, size);
|
||||
|
||||
m_chart.draw(&painter);
|
||||
m_chart.drawLegend(&painter);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuNightchartsWidget::addItem(QString name, QColor color, float value)
|
||||
{
|
||||
m_chart.addPiece(name,color,value);
|
||||
}
|
||||
48
ApplicationCode/UserInterface/RiuNightchartsWidget.h
Normal file
48
ApplicationCode/UserInterface/RiuNightchartsWidget.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil ASA
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "nightcharts/nightcharts.h"
|
||||
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QPaintEvent>
|
||||
|
||||
|
||||
class RiuNightchartsWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit RiuNightchartsWidget(QWidget* parent = 0);
|
||||
|
||||
void addItem(QString name, QColor color, float value);
|
||||
void setType(Nightcharts::type type);
|
||||
void clear();
|
||||
|
||||
protected:
|
||||
virtual void paintEvent(QPaintEvent* e);
|
||||
|
||||
private:
|
||||
Nightcharts m_chart;
|
||||
int m_marginLeft;
|
||||
int m_marginTop;
|
||||
};
|
||||
|
||||
@@ -151,7 +151,8 @@ RiuSummaryQwtPlot::~RiuSummaryQwtPlot()
|
||||
|
||||
if (m_plotDefinition)
|
||||
{
|
||||
m_plotDefinition->handleViewerDeletion();
|
||||
m_plotDefinition->detachAllCurves();
|
||||
m_plotDefinition->handleMdiWindowClosed();
|
||||
}
|
||||
|
||||
m_plotMarker->detach();
|
||||
|
||||
@@ -182,8 +182,7 @@ RiuViewer::~RiuViewer()
|
||||
{
|
||||
if (m_rimView)
|
||||
{
|
||||
m_rimView->showWindow = false;
|
||||
m_rimView->uiCapability()->updateUiIconFromToggleField();
|
||||
m_rimView->handleMdiWindowClosed();
|
||||
|
||||
m_rimView->cameraPosition = m_mainCamera->viewMatrix();
|
||||
m_rimView->cameraPointOfInterest = pointOfInterest();
|
||||
|
||||
@@ -18,11 +18,14 @@
|
||||
|
||||
#include "RiuWellAllocationPlot.h"
|
||||
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimWellAllocationPlot.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellLogTrack.h"
|
||||
#include "RimTotalWellAllocationPlot.h"
|
||||
|
||||
#include "QBoxLayout"
|
||||
|
||||
|
||||
|
||||
@@ -30,10 +33,19 @@
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuWellAllocationPlot::RiuWellAllocationPlot(RimWellAllocationPlot* plotDefinition, QWidget* parent)
|
||||
: QwtPlot(parent)
|
||||
: QFrame(parent)
|
||||
{
|
||||
Q_ASSERT(plotDefinition);
|
||||
this->setLayout(new QHBoxLayout());
|
||||
this->layout()->setMargin(0);
|
||||
|
||||
m_plotDefinition = plotDefinition;
|
||||
|
||||
QWidget* totalFlowAllocationWidget = m_plotDefinition->totalWellFlowPlot()->createViewWidget(this);
|
||||
this->layout()->addWidget(totalFlowAllocationWidget);
|
||||
|
||||
QWidget* wellFlowWidget = m_plotDefinition->accumulatedWellFlowPlot()->createViewWidget(this);
|
||||
this->layout()->addWidget(wellFlowWidget);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -43,7 +55,7 @@ RiuWellAllocationPlot::~RiuWellAllocationPlot()
|
||||
{
|
||||
if (m_plotDefinition)
|
||||
{
|
||||
m_plotDefinition->handleViewerDeletion();
|
||||
m_plotDefinition->handleMdiWindowClosed();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ class RimWellAllocationPlot;
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class RiuWellAllocationPlot : public QwtPlot
|
||||
class RiuWellAllocationPlot : public QFrame
|
||||
{
|
||||
Q_OBJECT;
|
||||
public:
|
||||
|
||||
@@ -65,7 +65,8 @@ RiuWellLogPlot::~RiuWellLogPlot()
|
||||
{
|
||||
if (m_plotDefinition)
|
||||
{
|
||||
m_plotDefinition->handleViewerDeletion();
|
||||
m_plotDefinition->detachAllCurves();
|
||||
m_plotDefinition->handleMdiWindowClosed();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,10 +19,12 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include <QList>
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
#include <QList>
|
||||
#include <QPointer>
|
||||
#include <QWidget>
|
||||
|
||||
class RimWellLogPlot;
|
||||
class RiuWellLogTrack;
|
||||
|
||||
@@ -72,8 +74,8 @@ private slots:
|
||||
private:
|
||||
QHBoxLayout* m_layout;
|
||||
QScrollBar* m_scrollBar;
|
||||
QList<QwtLegend*> m_legends;
|
||||
QList<RiuWellLogTrack*> m_trackPlots;
|
||||
QList<QPointer<QwtLegend> > m_legends;
|
||||
QList<QPointer<RiuWellLogTrack> > m_trackPlots;
|
||||
caf::PdmPointer<RimWellLogPlot> m_plotDefinition;
|
||||
QTimer* m_scheduleUpdateChildrenLayoutTimer;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user