Fix whitespace and includes

This commit is contained in:
Magne Sjaastad committed 2019-03-12 09:22:48 +01:00
1 parent 246326229e
commit f7600199c7
7 files changed
+355 -356

No files matched your search

@@ -1,17 +1,17 @@
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2017 Statoil ASA // Copyright (C) 2017 Statoil ASA
// //
// ResInsight is free software: you can redistribute it and/or modify // ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY // ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or // WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. // FITNESS FOR A PARTICULAR PURPOSE.
// //
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html> // See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details. // for more details.
// //
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
@@ -19,10 +19,11 @@
#include "RifEclipseRftAddress.h" #include "RifEclipseRftAddress.h"
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RifEclipseRftAddress::RifEclipseRftAddress(QString wellName, QDateTime timeStep, RftWellLogChannelType wellLogChannelName) : RifEclipseRftAddress::RifEclipseRftAddress(QString wellName, QDateTime timeStep, RftWellLogChannelType wellLogChannelName)
m_wellName(wellName), m_wellLogChannel(wellLogChannelName) : m_wellName(wellName)
, m_wellLogChannel(wellLogChannelName)
{ {
timeStep.setTimeSpec(Qt::TimeSpec::UTC); timeStep.setTimeSpec(Qt::TimeSpec::UTC);
@@ -31,19 +32,19 @@ RifEclipseRftAddress::RifEclipseRftAddress(QString wellName, QDateTime timeStep,
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool operator==(const RifEclipseRftAddress& first, const RifEclipseRftAddress& second) bool operator==(const RifEclipseRftAddress& first, const RifEclipseRftAddress& second)
{ {
if (first.wellName() != second.wellName()) return false; if (first.wellName() != second.wellName()) return false;
if (first.timeStep() != second.timeStep()) return false; if (first.timeStep() != second.timeStep()) return false;
if (first.wellLogChannel() != second.wellLogChannel()) return false; if (first.wellLogChannel() != second.wellLogChannel()) return false;
return true; return true;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool operator<(const RifEclipseRftAddress& first, const RifEclipseRftAddress& second) bool operator<(const RifEclipseRftAddress& first, const RifEclipseRftAddress& second)
{ {
@@ -53,4 +54,3 @@ bool operator<(const RifEclipseRftAddress& first, const RifEclipseRftAddress& se
return false; return false;
} }
@@ -111,7 +111,7 @@ std::pair<RigEclipseResultAddress, QString> RimWellPlotTools::pressureResultData
for (const auto& pressureDataName : PRESSURE_DATA_NAMES) for (const auto& pressureDataName : PRESSURE_DATA_NAMES)
{ {
if (eclipseCaseData->results(RiaDefines::MATRIX_MODEL) if (eclipseCaseData->results(RiaDefines::MATRIX_MODEL)
->hasResultEntry(RigEclipseResultAddress(RiaDefines::DYNAMIC_NATIVE, pressureDataName))) ->hasResultEntry(RigEclipseResultAddress(RiaDefines::DYNAMIC_NATIVE, pressureDataName)))
{ {
return std::make_pair(RigEclipseResultAddress(RiaDefines::DYNAMIC_NATIVE, pressureDataName), pressureDataName); return std::make_pair(RigEclipseResultAddress(RiaDefines::DYNAMIC_NATIVE, pressureDataName), pressureDataName);
} }
@@ -226,8 +226,8 @@ bool RimWellPlotTools::hasFlowData(RimEclipseResultCase* gridCase)
for (const QString& channelName : FLOW_DATA_NAMES) for (const QString& channelName : FLOW_DATA_NAMES)
{ {
if (eclipseCaseData->results(RiaDefines::MATRIX_MODEL)->hasResultEntry(RigEclipseResultAddress(RiaDefines::DYNAMIC_NATIVE, if (eclipseCaseData->results(RiaDefines::MATRIX_MODEL)
channelName)) ) ->hasResultEntry(RigEclipseResultAddress(RiaDefines::DYNAMIC_NATIVE, channelName)))
{ {
return true; return true;
} }
@@ -411,7 +411,7 @@ std::vector<RimEclipseResultCase*> RimWellPlotTools::rftCasesForWell(const QStri
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::map<QDateTime, std::set<RifDataSourceForRftPlt>> RimWellPlotTools::timeStepsMapFromGridCase(RimEclipseCase* gridCase) std::map<QDateTime, std::set<RifDataSourceForRftPlt>> RimWellPlotTools::timeStepsMapFromGridCase(RimEclipseCase* gridCase)
{ {
const RigEclipseCaseData* const eclipseCaseData = gridCase->eclipseCaseData(); const RigEclipseCaseData* const eclipseCaseData = gridCase->eclipseCaseData();
std::pair<RigEclipseResultAddress, QString> resultDataInfo = pressureResultDataInfo(eclipseCaseData); std::pair<RigEclipseResultAddress, QString> resultDataInfo = pressureResultDataInfo(eclipseCaseData);
std::map<QDateTime, std::set<RifDataSourceForRftPlt>> timeStepsMap; std::map<QDateTime, std::set<RifDataSourceForRftPlt>> timeStepsMap;
@@ -521,7 +521,7 @@ RiaRftPltCurveDefinition RimWellPlotTools::curveDefFromCurve(const RimWellLogCur
} }
else if (wellLogFileCurve != nullptr) else if (wellLogFileCurve != nullptr)
{ {
RimWellLogFile* const wellLogFile = wellLogFileCurve->wellLogFile(); RimWellLogFile* const wellLogFile = wellLogFileCurve->wellLogFile();
if (wellLogFile != nullptr) if (wellLogFile != nullptr)
{ {
@@ -943,9 +943,9 @@ void RimWellPlotTools::calculateValueOptionsForTimeSteps(
{ {
QString optionText = RiaQDateTimeTools::toStringUsingApplicationLocale(timeStepPair.first, dateFormatString); QString optionText = RiaQDateTimeTools::toStringUsingApplicationLocale(timeStepPair.first, dateFormatString);
bool hasObs = false; bool hasObs = false;
bool hasRft = false; bool hasRft = false;
bool hasGrid = false; bool hasGrid = false;
for (const auto& source : timeStepPair.second) for (const auto& source : timeStepPair.second)
{ {
@@ -75,9 +75,6 @@ public:
static std::map<QDateTime, std::set<RifDataSourceForRftPlt>> timeStepsMapFromGridCase(RimEclipseCase* gridCase); static std::map<QDateTime, std::set<RifDataSourceForRftPlt>> timeStepsMapFromGridCase(RimEclipseCase* gridCase);
static RiaRftPltCurveDefinition curveDefFromCurve(const RimWellLogCurve* curve); static RiaRftPltCurveDefinition curveDefFromCurve(const RimWellLogCurve* curve);
template<typename T>
static void appendSet(std::set<T>& destSet, const std::set<T>& setToAppend);
// others // others
static bool hasFlowData(const RimWellLogFile* wellLogFile); static bool hasFlowData(const RimWellLogFile* wellLogFile);
static bool hasAssociatedWellPath(const QString& wellName); static bool hasAssociatedWellPath(const QString& wellName);
@@ -138,12 +135,3 @@ private:
}; };
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
template<typename T>
void RimWellPlotTools::appendSet(std::set<T>& destSet, const std::set<T>& setToAppend)
{
destSet.insert(setToAppend.begin(), setToAppend.end());
}
File diff suppressed because it is too large. Load diff
@@ -17,12 +17,8 @@
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
#pragma once #pragma once
#include "RimViewWindow.h"
#include "RigFlowDiagResultAddress.h"
#include "RimDataSourceForRftPlt.h"
#include "RifDataSourceForRftPltQMetaType.h" #include "RifDataSourceForRftPltQMetaType.h"
#include "RimPlotCurve.h"
#include "RimWellPlotTools.h" #include "RimWellPlotTools.h"
#include "cafPdmField.h" #include "cafPdmField.h"
@@ -34,9 +30,9 @@
#include <QPointer> #include <QPointer>
#include <QDate> #include <QDate>
#include <QMetaType> #include <QMetaType>
#include <set> #include <set>
#include <map> #include <map>
#include "RifEclipseRftAddress.h"
class RimEclipseCase; class RimEclipseCase;
class RimEclipseResultCase; class RimEclipseResultCase;
@@ -46,6 +42,8 @@ class RimWellLogPlot;
class RimWellPath; class RimWellPath;
class RiuWellPltPlot; class RiuWellPltPlot;
class RimWellLogTrack; class RimWellLogTrack;
class RiaRftPltCurveDefinition;
class RimDataSourceForRftPlt;
namespace cvf { namespace cvf {
@@ -70,63 +68,62 @@ public:
RimWellPltPlot(); RimWellPltPlot();
~RimWellPltPlot() override; ~RimWellPltPlot() override;
void setDescription(const QString& description); void setDescription(const QString& description);
QString description() const; QString description() const;
QWidget* viewWidget() override; QWidget* viewWidget() override;
void zoomAll() override; void zoomAll() override;
RimWellLogPlot* wellLogPlot() const; RimWellLogPlot* wellLogPlot() const;
void setCurrentWellName(const QString& currWellName); void setCurrentWellName(const QString& currWellName);
static const char* plotNameFormatString(); static const char* plotNameFormatString();
protected: protected:
// Overridden PDM methods // Overridden PDM methods
caf::PdmFieldHandle* userDescriptionField() override { return &m_userName; } caf::PdmFieldHandle* userDescriptionField() override { return &m_userName; }
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override; void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName) override; void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override; QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
void calculateValueOptionsForWells(QList<caf::PdmOptionItemInfo>& options); void calculateValueOptionsForWells(QList<caf::PdmOptionItemInfo>& options);
QImage snapshotWindowContent() override; QImage snapshotWindowContent() override;
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override; void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override; void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override;
void onLoadDataAndUpdate() override; void onLoadDataAndUpdate() override;
void initAfterRead() override; void initAfterRead() override;
void setupBeforeSave() override; void setupBeforeSave() override;
void initAfterLoad(); void initAfterLoad();
private: private:
void syncSourcesIoFieldFromGuiField();
void syncCurvesFromUiSelection();
void syncSourcesIoFieldFromGuiField(); std::set<RiaRftPltCurveDefinition> selectedCurveDefs() const;
void syncCurvesFromUiSelection(); void addStackedCurve(const QString& tracerName,
const std::vector<double>& depthValues,
const std::vector<double>& accFlow,
RimWellLogTrack* plotTrack,
cvf::Color3f color,
int curveGroupId,
bool doFillCurve);
std::set<RiaRftPltCurveDefinition> selectedCurveDefs() const; std::vector<RifDataSourceForRftPlt> selectedSourcesExpanded() const;
void addStackedCurve(const QString& tracerName,
const std::vector<double>& depthValues,
const std::vector<double>& accFlow,
RimWellLogTrack* plotTrack,
cvf::Color3f color,
int curveGroupId,
bool doFillCurve);
std::vector<RifDataSourceForRftPlt> selectedSourcesExpanded() const;
// RimViewWindow overrides // RimViewWindow overrides
void updateWidgetTitleWindowTitle(); void updateWidgetTitleWindowTitle();
QWidget* createViewWidget(QWidget* mainWindowParent) override; QWidget* createViewWidget(QWidget* mainWindowParent) override;
void deleteViewWidget() override; void deleteViewWidget() override;
void setPlotXAxisTitles(RimWellLogTrack* plotTrack); void setPlotXAxisTitles(RimWellLogTrack* plotTrack);
void updateFormationsOnPlot() const; void updateFormationsOnPlot() const;
private: private:
caf::PdmField<bool> m_showPlotTitle; caf::PdmField<bool> m_showPlotTitle;
@@ -134,8 +131,8 @@ private:
caf::PdmField<QString> m_wellPathName; caf::PdmField<QString> m_wellPathName;
caf::PdmField<std::vector<RifDataSourceForRftPlt>> m_selectedSources; caf::PdmField<std::vector<RifDataSourceForRftPlt>> m_selectedSources;
caf::PdmChildArrayField<RimDataSourceForRftPlt*> m_selectedSourcesForIo; caf::PdmChildArrayField<RimDataSourceForRftPlt*> m_selectedSourcesForIo;
caf::PdmField<std::vector<QDateTime>> m_selectedTimeSteps; caf::PdmField<std::vector<QDateTime>> m_selectedTimeSteps;
@@ -105,7 +105,7 @@ RimWellRftPlot::RimWellRftPlot()
m_selectedTimeSteps.uiCapability()->setAutoAddingOptionFromValue(false); m_selectedTimeSteps.uiCapability()->setAutoAddingOptionFromValue(false);
this->setAsPlotMdiWindow(); this->setAsPlotMdiWindow();
m_isOnLoad = true; m_isOnLoad = true;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -21,11 +21,6 @@
#include "RimViewWindow.h" #include "RimViewWindow.h"
#include "RiaRftPltCurveDefinition.h"
#include "RimCase.h"
#include "RimPlotCurve.h"
#include "RifDataSourceForRftPltQMetaType.h" #include "RifDataSourceForRftPltQMetaType.h"
#include "cafPdmField.h" #include "cafPdmField.h"
@@ -36,6 +31,7 @@
#include <QDate> #include <QDate>
#include <QMetaType> #include <QMetaType>
#include <QPointer> #include <QPointer>
#include <map> #include <map>
#include <set> #include <set>
#include <utility> #include <utility>
@@ -48,6 +44,8 @@ class RimWellLogPlot;
class RimWellPath; class RimWellPath;
class RiuWellRftPlot; class RiuWellRftPlot;
class RigEclipseCaseData; class RigEclipseCaseData;
class RiaRftPltCurveDefinition;
class RifDataSourceForRftPlt;
namespace cvf { namespace cvf {
class Color3f; class Color3f;
@@ -73,60 +71,60 @@ public:
RimWellRftPlot(); RimWellRftPlot();
~RimWellRftPlot() override; ~RimWellRftPlot() override;
void setDescription(const QString& description); void setDescription(const QString& description);
QString description() const; QString description() const;
QWidget* viewWidget() override; QWidget* viewWidget() override;
void zoomAll() override; void zoomAll() override;
RimWellLogPlot* wellLogPlot() const; RimWellLogPlot* wellLogPlot() const;
void setSimWellOrWellPathName(const QString& currWellName); void setSimWellOrWellPathName(const QString& currWellName);
int branchIndex() const;
static const char* plotNameFormatString(); int branchIndex() const;
void applyInitialSelections(); void applyInitialSelections();
static const char* plotNameFormatString();
protected: protected:
// Overridden PDM methods // Overridden PDM methods
caf::PdmFieldHandle* userDescriptionField() override { return &m_userName; } caf::PdmFieldHandle* userDescriptionField() override { return &m_userName; }
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override; void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName) override; void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override; QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
QImage snapshotWindowContent() override; QImage snapshotWindowContent() override;
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override; void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
void onLoadDataAndUpdate() override; void onLoadDataAndUpdate() override;
private: private:
void calculateValueOptionsForWells(QList<caf::PdmOptionItemInfo>& options); void calculateValueOptionsForWells(QList<caf::PdmOptionItemInfo>& options);
void updateEditorsFromCurves();
void updateWidgetTitleWindowTitle();
void syncCurvesFromUiSelection();
void updateEditorsFromCurves(); std::set<RiaRftPltCurveDefinition> selectedCurveDefs() const;
void updateWidgetTitleWindowTitle(); std::set<RiaRftPltCurveDefinition> curveDefsFromCurves() const;
void syncCurvesFromUiSelection(); void updateCurvesInPlot(const std::set<RiaRftPltCurveDefinition>& allCurveDefs,
const std::set<RiaRftPltCurveDefinition>& curveDefsToAdd,
const std::set<RimWellLogCurve*>& curvesToDelete);
std::set<RiaRftPltCurveDefinition> selectedCurveDefs() const; std::vector<RifDataSourceForRftPlt> selectedSourcesExpanded() const;
std::set<RiaRftPltCurveDefinition> curveDefsFromCurves() const;
void updateCurvesInPlot(const std::set<RiaRftPltCurveDefinition>& allCurveDefs,
const std::set<RiaRftPltCurveDefinition>& curveDefsToAdd,
const std::set<RimWellLogCurve*>& curvesToDelete);
std::vector<RifDataSourceForRftPlt> selectedSourcesExpanded() const;
// RimViewWindow overrides // RimViewWindow overrides
QWidget* createViewWidget(QWidget* mainWindowParent) override; QWidget* createViewWidget(QWidget* mainWindowParent) override;
void deleteViewWidget() override; void deleteViewWidget() override;
void applyCurveAppearance(RimWellLogCurve* newCurve); void applyCurveAppearance(RimWellLogCurve* newCurve);
void updateFormationsOnPlot() const; void updateFormationsOnPlot() const;
QString associatedSimWellName() const; QString associatedSimWellName() const;
private: private:
caf::PdmField<bool> m_showPlotTitle; caf::PdmField<bool> m_showPlotTitle;