mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge branch 'dev' into feature-ensemble-rft
This commit is contained in:
37
.travis.yml
Normal file
37
.travis.yml
Normal file
@@ -0,0 +1,37 @@
|
||||
dist: xenial # For 18.04, use bionic
|
||||
|
||||
language: cpp
|
||||
|
||||
compiler:
|
||||
- gcc
|
||||
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
packages:
|
||||
- cmake
|
||||
- cmake-data
|
||||
- libqt5opengl5
|
||||
- qt5-qmake
|
||||
- qt5-default
|
||||
- libqt5opengl5-dev
|
||||
- qtbase5-dev
|
||||
- qtscript5-dev
|
||||
|
||||
before_script:
|
||||
- git clone https://github.com/OPM/ResInsight.git
|
||||
|
||||
script:
|
||||
############################################################################
|
||||
# Build main and tests
|
||||
############################################################################
|
||||
- mkdir -p build
|
||||
- cd build
|
||||
|
||||
- cmake -DRESINSIGHT_ENABLE_COTIRE=true ..
|
||||
|
||||
# Build the default target
|
||||
#- make -j8
|
||||
|
||||
# Build the target produced by Cotire
|
||||
- make -j8 ResInsight_unity
|
||||
@@ -27,8 +27,8 @@
|
||||
#define PRODUCTVER "@PRODUCTVER@"
|
||||
#define STRPRODUCTVER "@STRPRODUCTVER@"
|
||||
|
||||
#define RESINSIGHT_MAJOR_VERSION @RESINSIGHT_MAJOR_VERSION@
|
||||
#define RESINSIGHT_MINOR_VERSION @RESINSIGHT_MINOR_VERSION@
|
||||
#define RESINSIGHT_PATCH_VERSION @RESINSIGHT_PATCH_VERSION@
|
||||
#define RESINSIGHT_MAJOR_VERSION "@RESINSIGHT_MAJOR_VERSION@"
|
||||
#define RESINSIGHT_MINOR_VERSION "@RESINSIGHT_MINOR_VERSION@"
|
||||
#define RESINSIGHT_PATCH_VERSION "@RESINSIGHT_PATCH_VERSION@"
|
||||
|
||||
#define RESINSIGHT_OCTAVE_VERSION "@OCTAVE_VERSION_STRING@"
|
||||
|
||||
2775
ApplicationCode/Adm/projectfilekeywords/2019.08/ri-fieldKeywords.txt
Normal file
2775
ApplicationCode/Adm/projectfilekeywords/2019.08/ri-fieldKeywords.txt
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,289 @@
|
||||
// ResInsight version string : 2019.08.0-dev.01
|
||||
// Report generated : Tue Aug 27 11:38:53 2019
|
||||
//
|
||||
//
|
||||
|
||||
Annotations
|
||||
AsciiDataCurve
|
||||
CalcScript
|
||||
CalculatedSummaryCase
|
||||
CellEdgeResultSlot
|
||||
CellFilter
|
||||
CellPropertyFilter
|
||||
CellPropertyFilters
|
||||
CellRangeFilter
|
||||
CellRangeFilterCollection
|
||||
ChangeDataSourceFeatureUi
|
||||
CmdAddItemExecData
|
||||
CmdDeleteItemExecData
|
||||
CmdFieldChangeExecData
|
||||
CompletionTemplateCollection
|
||||
CrossSection
|
||||
CrossSectionCollection
|
||||
Eclipse2dViewCollection
|
||||
EclipseCase
|
||||
EclipseGeometrySelectionItem
|
||||
Fault
|
||||
Faults
|
||||
FileSummaryCase
|
||||
FishbonesCollection
|
||||
FishbonesMultipleSubs
|
||||
FishbonesPipeProperties
|
||||
FlowCharacteristicsPlot
|
||||
FlowDiagSolution
|
||||
FlowPlotCollection
|
||||
FormationNames
|
||||
FormationNamesCollectionObject
|
||||
FractureContainment
|
||||
FractureDefinitionCollection
|
||||
GeoMech2dViewCollection
|
||||
GeoMechGeometrySelectionItem
|
||||
GeoMechPropertyFilter
|
||||
GeoMechPropertyFilters
|
||||
GeoMechResultDefinition
|
||||
GeoMechResultSlot
|
||||
GeoMechView
|
||||
GridCollection
|
||||
GridCrossPlotCurve
|
||||
GridCrossPlotCurveSet
|
||||
GridInfo
|
||||
GridInfoCollection
|
||||
GridSummaryCase
|
||||
GridTimeHistoryCurve
|
||||
Intersection2dView
|
||||
Intersection2dViewCollection
|
||||
IntersectionBox
|
||||
Legend
|
||||
MainPlotCollection
|
||||
MdiWindowController
|
||||
MockModelSettings
|
||||
ModeledWellPath
|
||||
MultiSnapshotDefinition
|
||||
NoCommonAreaNNC
|
||||
ObservedDataCollection
|
||||
PdmDocument
|
||||
PdmObjectCollection
|
||||
PdmObjectGroup
|
||||
Perforation
|
||||
PerforationCollection
|
||||
PolylineTarget
|
||||
PolylinesFromFileAnnotation
|
||||
PropertyFilter
|
||||
ResInsightAnalysisModels
|
||||
ResInsightGeoMechCase
|
||||
ResInsightGeoMechModels
|
||||
ResInsightOilField
|
||||
ResInsightProject
|
||||
ReservoirCellResultStorage
|
||||
ReservoirView
|
||||
ResultDefinition
|
||||
ResultSlot
|
||||
ResultStorageEntryInfo
|
||||
RftAddress
|
||||
RiaMemoryCleanup
|
||||
RiaPreferences
|
||||
RiaRegressionTest
|
||||
RicCaseAndFileExportSettingsUi
|
||||
RicCellRangeUi
|
||||
RicDeleteItemExecData
|
||||
RicExportCarfinUi
|
||||
RicExportCompletionDataSettingsUi
|
||||
RicExportEclipseInputGridUi
|
||||
RicExportLgrUi
|
||||
RicExportToLasFileObj
|
||||
RicExportToLasFileResampleUi
|
||||
RicExportWellPathsUi
|
||||
RicHoloLensCreateSessionUi
|
||||
RicHoloLensExportToFolderUi
|
||||
RicHoloLensServerSettings
|
||||
RicLinkVisibleViewsFeatureUi
|
||||
RicPasteAsciiDataToSummaryPlotFeatureUi
|
||||
RicSaturationPressureUi
|
||||
RicSaveEclipseInputVisibleCellsUi
|
||||
RicSelectSummaryPlotUI
|
||||
RicSelectViewUI
|
||||
RicSummaryAddressSelection
|
||||
RicSummaryCurveCalculator
|
||||
RicSummaryCurveCreator
|
||||
RicWellPathsUnitSystemSettingsUi
|
||||
RifReaderSettings
|
||||
Rim3dWellLogCurveCollection
|
||||
Rim3dWellLogExtractionCurve
|
||||
Rim3dWellLogFileCurve
|
||||
Rim3dWellLogRftCurve
|
||||
RimAnnotationCollection
|
||||
RimAnnotationCollectionBase
|
||||
RimAnnotationGroupCollection
|
||||
RimAnnotationLineAppearance
|
||||
RimAnnotationTextAppearance
|
||||
RimBinaryExportSettings
|
||||
RimCaseCollection
|
||||
RimCommandExecuteScript
|
||||
RimCommandIssueFieldChanged
|
||||
RimCommandObject
|
||||
RimContourMapView
|
||||
RimCsvUserData
|
||||
RimCurveNameConfig
|
||||
RimDerivedEnsembleCaseCollection
|
||||
RimDialogData
|
||||
RimEclipseContourMapProjection
|
||||
RimEllipseFractureTemplate
|
||||
RimEnsembleCurveFilter
|
||||
RimEnsembleCurveFilterCollection
|
||||
RimEnsembleCurveSet
|
||||
RimEnsembleCurveSetCollection
|
||||
RimEnsembleStatistics
|
||||
RimExportInputSettings
|
||||
RimFaultResultSlot
|
||||
RimFractureExportSettings
|
||||
RimGeoMechContourMapProjection
|
||||
RimGeoMechContourMapView
|
||||
RimGridCrossPlot
|
||||
RimGridCrossPlotCollection
|
||||
RimGridCrossPlotCurveSetNameConfig
|
||||
RimGridCrossPlotNameConfig
|
||||
RimIdenticalGridCaseGroup
|
||||
RimInputProperty
|
||||
RimInputPropertyCollection
|
||||
RimInputReservoir
|
||||
RimMeasurement
|
||||
RimMswCompletionParameters
|
||||
RimMultipleValveLocations
|
||||
RimNoCommonAreaNncCollection
|
||||
RimNonDarcyPerforationParameters
|
||||
RimObservedEclipseUserData
|
||||
RimOilFieldEntry
|
||||
RimOilRegionEntry
|
||||
RimPlotAxisAnnotation
|
||||
RimPlotCellFilterCollection
|
||||
RimPlotCellPropertyFilter
|
||||
RimPolylineAppearance
|
||||
RimPolylinesAnnotationInView
|
||||
RimPolylinesFromFileAnnotationInView
|
||||
RimReachCircleAnnotation
|
||||
RimReachCircleAnnotationInView
|
||||
RimSaturationPressurePlot
|
||||
RimSaturationPressurePlotCollection
|
||||
RimStatisticalCalculation
|
||||
RimStatisticalCollection
|
||||
RimStimPlanColors
|
||||
RimStimPlanFractureTemplate
|
||||
RimStimPlanLegendConfig
|
||||
RimSummaryCalculation
|
||||
RimSummaryCalculationCollection
|
||||
RimSummaryCalculationVariable
|
||||
RimSummaryCurveCollection
|
||||
RimSummaryCurveCollectionModifier
|
||||
RimTensorResults
|
||||
RimTernaryLegendConfig
|
||||
RimTextAnnotation
|
||||
RimTextAnnotationInView
|
||||
RimTimeStepFilter
|
||||
RimUserDefinedPolylinesAnnotationInView
|
||||
RimViewLinkerCollection
|
||||
RimViewNameConfig
|
||||
RimVirtualPerforationResults
|
||||
RimWellLogExtractionCurve
|
||||
RimWellLogExtractionCurveNameConfig
|
||||
RimWellLogFileCurveNameConfig
|
||||
RimWellLogPlotNameConfig
|
||||
RimWellLogRftCurveNameConfig
|
||||
RimWellPathEntry
|
||||
RimWellPathImport
|
||||
RiuCreateMultipleFractionsUi
|
||||
RiuMultipleFractionsOptions
|
||||
ScaleLegend
|
||||
ScriptLocation
|
||||
SimWellFracture
|
||||
SimWellFractureCollection
|
||||
SummaryAddress
|
||||
SummaryCaseCollection
|
||||
SummaryCaseSubCollection
|
||||
SummaryCrossPlot
|
||||
SummaryCrossPlotCollection
|
||||
SummaryCurve
|
||||
SummaryCurveAutoName
|
||||
SummaryCurveFilter
|
||||
SummaryFilterSettings
|
||||
SummaryObservedDataFile
|
||||
SummaryPageDownloadEntity
|
||||
SummaryPlot
|
||||
SummaryPlotCollection
|
||||
SummaryTimeAxisProperties
|
||||
SummaryYAxisProperties
|
||||
TC2
|
||||
TestCommand1
|
||||
TofAccumulatedPhaseFractionsPlot
|
||||
TotalWellAllocationPlot
|
||||
UserDefinedPolylinesAnnotation
|
||||
ValveTemplate
|
||||
ValveTemplateCollection
|
||||
View3dOverlayInfoConfig
|
||||
ViewController
|
||||
ViewLinker
|
||||
Well
|
||||
WellAllocationPlot
|
||||
WellAllocationPlotLegend
|
||||
WellFlowRateCurve
|
||||
WellLogFile
|
||||
WellLogFileChannel
|
||||
WellLogFileCurve
|
||||
WellLogPlot
|
||||
WellLogPlotCollection
|
||||
WellLogPlotTrack
|
||||
WellLogRftCurve
|
||||
WellPath
|
||||
WellPathAicdParameters
|
||||
WellPathAttribute
|
||||
WellPathAttributes
|
||||
WellPathBase
|
||||
WellPathCompletion
|
||||
WellPathCompletionCollection
|
||||
WellPathCompletions
|
||||
WellPathFracture
|
||||
WellPathFractureCollection
|
||||
WellPathGeometryDef
|
||||
WellPathTarget
|
||||
WellPathValve
|
||||
WellPaths
|
||||
WellPltPlot
|
||||
WellPltPlotCollection
|
||||
WellRftPlot
|
||||
WellRftPlotCollection
|
||||
Wells
|
||||
cloneView
|
||||
closeProject
|
||||
computeCaseGroupStatistics
|
||||
createGridCaseGroup
|
||||
createGridCaseGroupResult
|
||||
createLgrForCompletions
|
||||
createMultipleFractures
|
||||
createSaturationPressurePlots
|
||||
createStatisticsCase
|
||||
createStatisticsCaseResult
|
||||
createView
|
||||
createViewResult
|
||||
exportFlowCharacteristics
|
||||
exportLgrForCompletions
|
||||
exportMsw
|
||||
exportMultiCaseSnapshots
|
||||
exportProperty
|
||||
exportPropertyInViews
|
||||
exportSimWellFractureCompletions
|
||||
exportSnapshots
|
||||
exportVisibleCells
|
||||
exportWellPathCompletions
|
||||
exportWellPaths
|
||||
loadCase
|
||||
loadCaseResult
|
||||
openProject
|
||||
replaceCase
|
||||
replaceMultipleCases
|
||||
replaceSourceCases
|
||||
runOctaveScript
|
||||
scaleFractureTemplate
|
||||
setExportFolder
|
||||
setFractureContainment
|
||||
setMainWindowSize
|
||||
setStartDir
|
||||
setTimeStep
|
||||
@@ -289,7 +289,7 @@ bool RiaApplication::openFile(const QString& fileName)
|
||||
}
|
||||
else if (fileType & RiaDefines::ANY_ECLIPSE_FILE)
|
||||
{
|
||||
loadingSucceded = RicImportGeneralDataFeature::openEclipseFilesFromFileNames(QStringList{fileName});
|
||||
loadingSucceded = RicImportGeneralDataFeature::openEclipseFilesFromFileNames(QStringList{fileName}, true);
|
||||
lastUsedDialogTag = RiaDefines::defaultDirectoryLabel(fileType);
|
||||
}
|
||||
|
||||
|
||||
@@ -259,7 +259,7 @@ RiaApplication::ApplicationStatus RiaConsoleApplication::handleArguments(cvf::Pr
|
||||
{
|
||||
QStringList fileNames = RicImportGeneralDataFeature::fileNamesFromCaseNames(cvfqt::Utils::toQStringList(o.values()));
|
||||
RicImportGeneralDataFeature::OpenCaseResults results =
|
||||
RicImportGeneralDataFeature::openEclipseFilesFromFileNames(fileNames);
|
||||
RicImportGeneralDataFeature::openEclipseFilesFromFileNames(fileNames, true);
|
||||
}
|
||||
|
||||
if (cvf::Option o = progOpt->option("commandFile"))
|
||||
|
||||
@@ -133,6 +133,7 @@
|
||||
#ifdef USE_UNIT_TESTS
|
||||
#include "gtest/gtest.h"
|
||||
#endif // USE_UNIT_TESTS
|
||||
#include "SummaryPlotCommands/RicSummaryPlotFeatureImpl.h"
|
||||
|
||||
namespace caf
|
||||
{
|
||||
@@ -657,6 +658,11 @@ RiaApplication::ApplicationStatus RiaGuiApplication::handleArguments(cvf::Progra
|
||||
}
|
||||
}
|
||||
|
||||
if (cvf::Option o = progOpt->option("summaryplot"))
|
||||
{
|
||||
RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( cvfqt::Utils::toQStringList(o.values()));
|
||||
}
|
||||
|
||||
QString projectFileName;
|
||||
|
||||
if (progOpt->hasOption("last"))
|
||||
@@ -777,7 +783,7 @@ RiaApplication::ApplicationStatus RiaGuiApplication::handleArguments(cvf::Progra
|
||||
QStringList fileNames = RicImportGeneralDataFeature::fileNamesFromCaseNames(cvfqt::Utils::toQStringList(o.values()));
|
||||
|
||||
RicImportGeneralDataFeature::OpenCaseResults results =
|
||||
RicImportGeneralDataFeature::openEclipseFilesFromFileNames(fileNames);
|
||||
RicImportGeneralDataFeature::openEclipseFilesFromFileNames(fileNames, true);
|
||||
if (results && !results.eclipseSummaryFiles.empty())
|
||||
{
|
||||
getOrCreateAndShowMainPlotWindow();
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "cafPdmUiFilePathEditor.h"
|
||||
|
||||
#include <QDate>
|
||||
#include <QDir>
|
||||
#include <QLocale>
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
@@ -74,7 +75,10 @@ RiaPreferences::RiaPreferences(void)
|
||||
CAF_PDM_InitFieldNoDefault(&scriptDirectories, "scriptDirectory", "Shared Script Folder(s)", "", "", "");
|
||||
scriptDirectories.uiCapability()->setUiEditorTypeName(caf::PdmUiFilePathEditor::uiEditorTypeName());
|
||||
|
||||
QString defaultTextEditor;
|
||||
// TODO: This only currently works for installed ResInsight.
|
||||
scriptDirectories = QCoreApplication::applicationDirPath() + "/Python/rips/PythonExamples";
|
||||
|
||||
QString defaultTextEditor;
|
||||
#ifdef WIN32
|
||||
defaultTextEditor = QString("notepad.exe");
|
||||
#else
|
||||
@@ -101,6 +105,7 @@ RiaPreferences::RiaPreferences(void)
|
||||
CAF_PDM_InitField(&pythonExecutable, "pythonExecutable", QString("python"), "Python Executable Location", "", "", "");
|
||||
pythonExecutable.uiCapability()->setUiEditorTypeName(caf::PdmUiFilePathEditor::uiEditorTypeName());
|
||||
pythonExecutable.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::TOP);
|
||||
CAF_PDM_InitField(&showPythonDebugInfo, "pythonDebugInfo", false, "Show Python Debug Info", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&ssihubAddress, "ssihubAddress", QString("http://"), "SSIHUB Address", "", "", "");
|
||||
ssihubAddress.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::TOP);
|
||||
@@ -268,8 +273,6 @@ void RiaPreferences::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
viewsGroup->add(&showHud);
|
||||
|
||||
caf::PdmUiGroup* otherGroup = uiOrdering.addNewGroup("Other");
|
||||
otherGroup->add(&m_dateFormat);
|
||||
otherGroup->add(&m_timeFormat);
|
||||
otherGroup->add(&ssihubAddress);
|
||||
otherGroup->add(&showLasCurveWithoutTvdWarning);
|
||||
otherGroup->add(&holoLensDisableCertificateVerification);
|
||||
@@ -300,10 +303,12 @@ void RiaPreferences::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
group->add(&summaryEnsembleImportMode);
|
||||
}
|
||||
}
|
||||
else if (uiConfigName == RiaPreferences::tabNameEclipseSummary())
|
||||
else if (uiConfigName == RiaPreferences::tabNamePlotting())
|
||||
{
|
||||
uiOrdering.add(&defaultSummaryCurvesTextFilter);
|
||||
uiOrdering.add(&defaultSummaryHistoryCurveStyle);
|
||||
uiOrdering.add(&m_dateFormat);
|
||||
uiOrdering.add(&m_timeFormat);
|
||||
}
|
||||
else if (uiConfigName == RiaPreferences::tabNameScripting())
|
||||
{
|
||||
@@ -314,8 +319,9 @@ void RiaPreferences::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
#ifdef ENABLE_GRPC
|
||||
caf::PdmUiGroup* pythonGroup = uiOrdering.addNewGroup("Python");
|
||||
pythonGroup->add(&enableGrpcServer);
|
||||
pythonGroup->add(&showPythonDebugInfo);
|
||||
pythonGroup->add(&defaultGrpcPortNumber);
|
||||
pythonGroup->add(&pythonExecutable);
|
||||
pythonGroup->add(&pythonExecutable);
|
||||
#endif
|
||||
caf::PdmUiGroup* scriptGroup = uiOrdering.addNewGroup("Script files");
|
||||
scriptGroup->add(&scriptDirectories);
|
||||
@@ -426,9 +432,9 @@ QString RiaPreferences::tabNameEclipse()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaPreferences::tabNameEclipseSummary()
|
||||
QString RiaPreferences::tabNamePlotting()
|
||||
{
|
||||
return "Summary";
|
||||
return "Plotting";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -464,7 +470,7 @@ QStringList RiaPreferences::tabNames()
|
||||
|
||||
names << tabNameGeneral();
|
||||
names << tabNameEclipse();
|
||||
names << tabNameEclipseSummary();
|
||||
names << tabNamePlotting();
|
||||
names << tabNameScripting();
|
||||
names << tabNameExport();
|
||||
|
||||
|
||||
@@ -89,6 +89,7 @@ public: // Pdm Fields
|
||||
caf::PdmField<bool> octaveShowHeaderInfoWhenExecutingScripts;
|
||||
|
||||
caf::PdmField<QString> pythonExecutable;
|
||||
caf::PdmField<bool> showPythonDebugInfo;
|
||||
|
||||
caf::PdmField<QString> ssihubAddress;
|
||||
|
||||
@@ -135,7 +136,7 @@ protected:
|
||||
private:
|
||||
static QString tabNameGeneral();
|
||||
static QString tabNameEclipse();
|
||||
static QString tabNameEclipseSummary();
|
||||
static QString tabNamePlotting();
|
||||
static QString tabNameScripting();
|
||||
static QString tabNameExport();
|
||||
static QString tabNameSystem();
|
||||
|
||||
@@ -72,6 +72,13 @@ bool RiaArgumentParser::parseArguments(cvf::ProgramOptions* progOpt)
|
||||
progOpt->registerOption("server", "[<portnumber>]", "Launch as a GRPC server. Default port is 50051", cvf::ProgramOptions::SINGLE_VALUE);
|
||||
progOpt->registerOption("startdir", "<folder>", "Set startup directory.\n", cvf::ProgramOptions::SINGLE_VALUE);
|
||||
|
||||
progOpt->registerOption("summaryplot",
|
||||
"[<plotOptions>] <eclipsesummaryvectors> [<eclipsedatafiles>]",
|
||||
"Creates a summary plot using all the <eclipsedatafiles>,"
|
||||
"and all the summary vectors defined in <eclipsesummaryvectors>."
|
||||
"Use --summaryplot -help to show a more detailed help text.\n",
|
||||
cvf::ProgramOptions::OPTIONAL_MULTI_VALUE);
|
||||
|
||||
progOpt->registerOption("commandFile", "<commandfile>", "Execute the command file.", cvf::ProgramOptions::SINGLE_VALUE);
|
||||
progOpt->registerOption("commandFileReplaceCases",
|
||||
"[<caseId>] <caseListFile>",
|
||||
|
||||
@@ -438,7 +438,9 @@ std::vector<QString> RiaQDateTimeTools::supportedDateFormats()
|
||||
dateFormats.push_back("yy;M/yy;d/M/yy");
|
||||
dateFormats.push_back("yy;M/yy;M/d/yy");
|
||||
dateFormats.push_back("yyyy;MM-yyyy;dd-MM-yyyy");
|
||||
dateFormats.push_back("yyyy;MM.yyyy;dd.MM.yyyy");
|
||||
dateFormats.push_back("yyyy;MM-yyyy;MM-dd-yyyy");
|
||||
dateFormats.push_back("yyyy;MM.yyyy;MM.dd.yyyy");
|
||||
dateFormats.push_back("yy;MM-yy;dd-MM-yy");
|
||||
dateFormats.push_back("yy;MM-yy;MM-dd-yy");
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
#include "RiaRegressionTestRunner.h"
|
||||
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "RiaGitDiff.h"
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "RiaImageCompareReporter.h"
|
||||
#include "RiaImageFileCompare.h"
|
||||
#include "RiaLogging.h"
|
||||
@@ -199,7 +199,7 @@ void RiaRegressionTestRunner::runRegressionTest()
|
||||
|
||||
regressionTestConfigureProject();
|
||||
|
||||
resizeMaximizedPlotWindows();
|
||||
resizePlotWindows();
|
||||
|
||||
QString fullPathGeneratedFolder = testCaseFolder.absoluteFilePath(generatedFolderName);
|
||||
RicSnapshotAllViewsToFileFeature::exportSnapshotOfAllViewsIntoFolder(fullPathGeneratedFolder);
|
||||
@@ -499,7 +499,7 @@ void RiaRegressionTestRunner::regressionTestConfigureProject()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaRegressionTestRunner::resizeMaximizedPlotWindows()
|
||||
void RiaRegressionTestRunner::resizePlotWindows()
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
if (!proj) return;
|
||||
@@ -515,20 +515,16 @@ void RiaRegressionTestRunner::resizeMaximizedPlotWindows()
|
||||
{
|
||||
if (viewWindow->isMdiWindow())
|
||||
{
|
||||
RimMdiWindowGeometry wndGeo = viewWindow->mdiWindowGeometry();
|
||||
if (wndGeo.isMaximized)
|
||||
QWidget* viewWidget = viewWindow->viewWidget();
|
||||
|
||||
if (viewWidget)
|
||||
{
|
||||
QWidget* viewWidget = viewWindow->viewWidget();
|
||||
|
||||
if (viewWidget)
|
||||
QMdiSubWindow* mdiWindow = plotMainWindow->findMdiSubWindow(viewWidget);
|
||||
if (mdiWindow)
|
||||
{
|
||||
QMdiSubWindow* mdiWindow = plotMainWindow->findMdiSubWindow(viewWidget);
|
||||
if (mdiWindow)
|
||||
{
|
||||
mdiWindow->showNormal();
|
||||
mdiWindow->showNormal();
|
||||
|
||||
viewWidget->resize(RiaRegressionTestRunner::regressionDefaultImageSize());
|
||||
}
|
||||
viewWidget->resize(RiaRegressionTestRunner::regressionDefaultImageSize());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -603,8 +599,7 @@ QFileInfoList RiaRegressionTestRunner::subDirectoriesForTestExecution(const QDir
|
||||
for (const auto& s : m_testFilter)
|
||||
{
|
||||
QString trimmed = s.trimmed();
|
||||
if ((m_appendAllTestsAfterLastItemInFilter && anyMatchFound) ||
|
||||
baseName.contains(trimmed, Qt::CaseInsensitive))
|
||||
if ((m_appendAllTestsAfterLastItemInFilter && anyMatchFound) || baseName.contains(trimmed, Qt::CaseInsensitive))
|
||||
{
|
||||
foldersMatchingTestFilter.push_back(fi);
|
||||
anyMatchFound = true;
|
||||
|
||||
@@ -60,7 +60,7 @@ private:
|
||||
const QDir& testDir);
|
||||
|
||||
static void removeDirectoryWithContent(QDir& dirToDelete);
|
||||
static void resizeMaximizedPlotWindows();
|
||||
static void resizePlotWindows();
|
||||
static QSize regressionDefaultImageSize();
|
||||
static QString diff2htmlHeaderText(const QString& testRootPath);
|
||||
QFileInfoList subDirectoriesForTestExecution(const QDir& directory);
|
||||
|
||||
@@ -713,7 +713,7 @@ if (RESINSIGHT_PRIVATE_INSTALL)
|
||||
add_custom_command(
|
||||
TARGET ResInsight
|
||||
POST_BUILD
|
||||
COMMAND ${RESINSIGHT_GRPC_PYTHON_EXECUTABLE} -m pip install --target=${GRPC_PYTHON_SOURCE_PATH} grpcio
|
||||
COMMAND ${RESINSIGHT_GRPC_PYTHON_EXECUTABLE} -m pip install --target=${GRPC_PYTHON_SOURCE_PATH} grpcio-tools
|
||||
)
|
||||
endif()
|
||||
install(DIRECTORY ${GRPC_PYTHON_SOURCE_PATH}/ DESTINATION ${RESINSIGHT_INSTALL_FOLDER}/Python)
|
||||
|
||||
@@ -21,9 +21,12 @@
|
||||
|
||||
#include "RicScriptFeatureImpl.h"
|
||||
|
||||
#include "RimCalcScript.h"
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RimCalcScript.h"
|
||||
#include "RiuMainWindow.h"
|
||||
#include "RiuProcessMonitor.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
#include "cvfAssert.h"
|
||||
@@ -31,6 +34,8 @@
|
||||
#include <QAction>
|
||||
#include <QFileInfo>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicExecuteScriptFeature, "RicExecuteScriptFeature");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -71,7 +76,35 @@ void RicExecuteScriptFeature::onActionTriggered(bool isChecked)
|
||||
if (!pythonPath.isEmpty())
|
||||
{
|
||||
QStringList arguments = RimCalcScript::createCommandLineArguments(calcScript->absoluteFileName());
|
||||
RiaApplication::instance()->launchProcess(pythonPath, arguments, app->pythonProcessEnvironment());
|
||||
QProcessEnvironment penv = app->pythonProcessEnvironment();
|
||||
|
||||
RiuProcessMonitor* processMonitor = RiuMainWindow::instance()->processMonitor();
|
||||
if (RiaApplication::instance()->preferences()->showPythonDebugInfo() && processMonitor)
|
||||
{
|
||||
QStringList debugInfo;
|
||||
debugInfo << "----- Launching Python interpreter -----";
|
||||
debugInfo << "Python interpreter path: " + pythonPath;
|
||||
debugInfo << "Using arguments: ";
|
||||
for (QString argument : arguments)
|
||||
{
|
||||
debugInfo << "* " + argument;
|
||||
}
|
||||
QStringList envList = penv.toStringList();
|
||||
debugInfo << "Using environment: ";
|
||||
for (QString envVariable : envList)
|
||||
{
|
||||
debugInfo << "* " + envVariable;
|
||||
}
|
||||
|
||||
debugInfo << "------------------------------------";
|
||||
|
||||
for (QString debugString : debugInfo)
|
||||
{
|
||||
std::cout << debugString.toStdString() << std::endl;
|
||||
processMonitor->addStringToLog(debugString + "\n");
|
||||
}
|
||||
}
|
||||
RiaApplication::instance()->launchProcess(pythonPath, arguments, penv);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,8 @@ CAF_CMD_SOURCE_INIT(RicImportGeneralDataFeature, "RicImportGeneralDataFeature");
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicImportGeneralDataFeature::OpenCaseResults
|
||||
RicImportGeneralDataFeature::openEclipseFilesFromFileNames(const QStringList& fileNames)
|
||||
RicImportGeneralDataFeature::openEclipseFilesFromFileNames(const QStringList& fileNames,
|
||||
bool doCreateDefaultPlot)
|
||||
{
|
||||
CVF_ASSERT(!fileNames.empty());
|
||||
|
||||
@@ -89,7 +90,7 @@ RicImportGeneralDataFeature::OpenCaseResults
|
||||
}
|
||||
if (!eclipseSummaryFiles.empty())
|
||||
{
|
||||
if (!openSummaryCaseFromFileNames(eclipseSummaryFiles))
|
||||
if (!openSummaryCaseFromFileNames(eclipseSummaryFiles, doCreateDefaultPlot))
|
||||
{
|
||||
return OpenCaseResults();
|
||||
}
|
||||
@@ -200,7 +201,7 @@ void RicImportGeneralDataFeature::openFileDialog(ImportFileType fileTypes)
|
||||
RiaApplication::instance()->setLastUsedDialogDirectory(defaultDirectoryLabel(ANY_ECLIPSE_FILE), fileNames.front());
|
||||
}
|
||||
|
||||
if (!openEclipseFilesFromFileNames(fileNames))
|
||||
if (!openEclipseFilesFromFileNames(fileNames, true))
|
||||
{
|
||||
RiaLogging::error(QString("Failed to open file names: %1").arg(fileNames.join(", ")));
|
||||
}
|
||||
@@ -240,10 +241,11 @@ bool RicImportGeneralDataFeature::openInputEclipseCaseFromFileNames(const QStrin
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicImportGeneralDataFeature::openSummaryCaseFromFileNames(const QStringList& fileNames)
|
||||
bool RicImportGeneralDataFeature::openSummaryCaseFromFileNames(const QStringList& fileNames,
|
||||
bool doCreateDefaultPlot)
|
||||
{
|
||||
std::vector<RimSummaryCase*> newCases;
|
||||
if (RicImportSummaryCasesFeature::createAndAddSummaryCasesFromFiles(fileNames, &newCases))
|
||||
if (RicImportSummaryCasesFeature::createAndAddSummaryCasesFromFiles(fileNames, doCreateDefaultPlot, &newCases))
|
||||
{
|
||||
RicImportSummaryCasesFeature::addCasesToGroupIfRelevant(newCases);
|
||||
for (const RimSummaryCase* newCase : newCases)
|
||||
|
||||
@@ -46,7 +46,8 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
static OpenCaseResults openEclipseFilesFromFileNames(const QStringList& fileNames);
|
||||
static OpenCaseResults openEclipseFilesFromFileNames(const QStringList& fileNames,
|
||||
bool doCreateDefaultPlot);
|
||||
static QStringList fileNamesFromCaseNames(const QStringList& caseNames);
|
||||
|
||||
protected:
|
||||
@@ -60,6 +61,7 @@ protected:
|
||||
|
||||
static bool openEclipseCaseFromFileNames(const QStringList& fileNames);
|
||||
static bool openInputEclipseCaseFromFileNames(const QStringList& fileNames);
|
||||
static bool openSummaryCaseFromFileNames(const QStringList& fileNames);
|
||||
static bool openSummaryCaseFromFileNames(const QStringList& fileNames,
|
||||
bool doCreateDefaultPlot = true);
|
||||
|
||||
};
|
||||
|
||||
@@ -122,6 +122,7 @@ void RicImportSummaryCasesFeature::setupActionLook(QAction* actionToSetup)
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicImportSummaryCasesFeature::createAndAddSummaryCasesFromFiles(const QStringList& fileNames,
|
||||
bool doCreateDefaultPlot,
|
||||
std::vector<RimSummaryCase*>* newCases)
|
||||
{
|
||||
RiaGuiApplication* app = RiaGuiApplication::instance();
|
||||
@@ -131,7 +132,7 @@ bool RicImportSummaryCasesFeature::createAndAddSummaryCasesFromFiles(const QStri
|
||||
if (createSummaryCasesFromFiles(fileNames, cases))
|
||||
{
|
||||
addSummaryCases(*cases);
|
||||
if (!cases->empty())
|
||||
if (!cases->empty() && doCreateDefaultPlot)
|
||||
{
|
||||
RicSummaryPlotFeatureImpl::createDefaultSummaryPlot(cases->back());
|
||||
}
|
||||
|
||||
@@ -38,7 +38,9 @@ class RicImportSummaryCasesFeature : public caf::CmdFeature
|
||||
public:
|
||||
RicImportSummaryCasesFeature() { }
|
||||
|
||||
static bool createAndAddSummaryCasesFromFiles(const QStringList& fileName, std::vector<RimSummaryCase*>* newCases = nullptr);
|
||||
static bool createAndAddSummaryCasesFromFiles(const QStringList& fileName,
|
||||
bool doCreateDefaultPlot,
|
||||
std::vector<RimSummaryCase*>* newCases = nullptr);
|
||||
static bool createSummaryCasesFromFiles(const QStringList& fileName, std::vector<RimSummaryCase*>* newCases, bool ensembleOrGroup = false);
|
||||
static void addSummaryCases(const std::vector<RimSummaryCase*> cases);
|
||||
static void addCasesToGroupIfRelevant(const std::vector<RimSummaryCase*> cases);
|
||||
|
||||
@@ -23,15 +23,39 @@
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimEnsembleCurveSet.h"
|
||||
#include "RimEnsembleCurveSetCollection.h"
|
||||
|
||||
#include "RiuPlotMainWindowTools.h"
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaColorTables.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaEclipseFileNameTools.h"
|
||||
#include "RiaDefines.h"
|
||||
|
||||
#include "RifSummaryReaderInterface.h"
|
||||
#include "RimSummaryCase.h"
|
||||
|
||||
#include "RicImportGeneralDataFeature.h"
|
||||
#include "RicCreateSummaryCaseCollectionFeature.h"
|
||||
#include "RicImportSummaryCasesFeature.h"
|
||||
|
||||
#include <QStringList>
|
||||
#include <QFileInfo>
|
||||
#include <QRegularExpression>
|
||||
#include "RiaImportEclipseCaseTools.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimGridTimeHistoryCurve.h"
|
||||
#include "WellLogCommands/RicWellLogPlotCurveFeatureImpl.h"
|
||||
#include "RimEclipseResultCase.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimEclipseCaseCollection.h"
|
||||
#include "RigEclipseResultAddress.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@@ -92,33 +116,7 @@ std::vector<RimSummaryCurve*> RicSummaryPlotFeatureImpl::addDefaultCurvesToPlot(
|
||||
QString curvesTextFilter = RiaApplication::instance()->preferences()->defaultSummaryCurvesTextFilter;
|
||||
QStringList curveFilters = curvesTextFilter.split(";", QString::SkipEmptyParts);
|
||||
|
||||
const std::set<RifEclipseSummaryAddress>& addrs = summaryCase->summaryReader()->allResultAddresses();
|
||||
std::vector<RifEclipseSummaryAddress> curveAddressesToUse;
|
||||
|
||||
for (const auto & addr : addrs)
|
||||
{
|
||||
for (const QString& filter: curveFilters)
|
||||
{
|
||||
if ( addr.isUiTextMatchingFilterText(filter) )
|
||||
{
|
||||
curveAddressesToUse.push_back(addr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto & addr : curveAddressesToUse)
|
||||
{
|
||||
RimSummaryCurve* newCurve = new RimSummaryCurve();
|
||||
plot->addCurveNoUpdate(newCurve);
|
||||
if (summaryCase)
|
||||
{
|
||||
newCurve->setSummaryCaseY(summaryCase);
|
||||
}
|
||||
newCurve->setSummaryAddressYAndApplyInterpolation(addr);
|
||||
defaultCurves.push_back(newCurve);
|
||||
}
|
||||
|
||||
return defaultCurves;
|
||||
return addCurvesFromAddressFiltersToPlot(curveFilters, plot, summaryCase, false);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -142,7 +140,7 @@ void RicSummaryPlotFeatureImpl::createDefaultSummaryPlot( RimSummaryCase* summar
|
||||
{
|
||||
RimSummaryPlotCollection* summaryPlotCollection = RiaApplication::instance()->project()->mainPlotCollection->summaryPlotCollection();
|
||||
|
||||
if (summaryPlotCollection && summaryCase)
|
||||
if (summaryPlotCollection && summaryCase && !RiaApplication::instance()->preferences()->defaultSummaryCurvesTextFilter().isEmpty())
|
||||
{
|
||||
auto plot = summaryPlotCollection->createSummaryPlotWithAutoTitle();
|
||||
|
||||
@@ -161,4 +159,652 @@ void RicSummaryPlotFeatureImpl::createDefaultSummaryPlot( RimSummaryCase* summar
|
||||
}
|
||||
}
|
||||
|
||||
RimSummaryCurve* createHistoryCurve(const RifEclipseSummaryAddress& addr, RimSummaryCase* summaryCasesToUse)
|
||||
{
|
||||
RifEclipseSummaryAddress historyAddr = addr;
|
||||
historyAddr.setQuantityName(historyAddr.quantityName() + "H");
|
||||
if ( summaryCasesToUse->summaryReader()->allResultAddresses().count(historyAddr) )
|
||||
{
|
||||
RimSummaryCurve* historyCurve = new RimSummaryCurve();
|
||||
historyCurve->setSummaryCaseY(summaryCasesToUse);
|
||||
historyCurve->setSummaryAddressYAndApplyInterpolation(historyAddr);
|
||||
return historyCurve;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
class RigGridCellResultAddress
|
||||
{
|
||||
public:
|
||||
RigGridCellResultAddress()
|
||||
: gridIndex(-1)
|
||||
, i(-1)
|
||||
, j(-1)
|
||||
, k(-1)
|
||||
{}
|
||||
|
||||
RigGridCellResultAddress(size_t gridIndex,
|
||||
size_t i,
|
||||
size_t j,
|
||||
size_t k,
|
||||
const RigEclipseResultAddress & eclipseResultAddress)
|
||||
: gridIndex(gridIndex)
|
||||
, i(i)
|
||||
, j(j)
|
||||
, k(k)
|
||||
, eclipseResultAddress(eclipseResultAddress)
|
||||
{}
|
||||
|
||||
// Using zero based ijk
|
||||
|
||||
size_t gridIndex;
|
||||
size_t i;
|
||||
size_t j;
|
||||
size_t k;
|
||||
RigEclipseResultAddress eclipseResultAddress;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RigGridCellResultAddress> createGridCellAddressesFromFilter(const QString& text)
|
||||
{
|
||||
std::vector<RigGridCellResultAddress> addresses;
|
||||
QStringList addressParts = text.split(":");
|
||||
|
||||
if (addressParts.size() > 1)
|
||||
{
|
||||
QString resultVarName = addressParts[0];
|
||||
size_t gridIdx = 0;
|
||||
if (addressParts.size() > 2)
|
||||
{
|
||||
gridIdx = addressParts[1].toULong();
|
||||
}
|
||||
|
||||
QString ijkText = addressParts.back();
|
||||
QStringList ijkTextParts = ijkText.split(",");
|
||||
if (ijkTextParts.size() == 3)
|
||||
{
|
||||
bool isOk = true;
|
||||
bool allOk = true;
|
||||
size_t i = ijkTextParts[0].toULong(&isOk);
|
||||
allOk &= isOk;
|
||||
size_t j = ijkTextParts[1].toULong(&isOk);
|
||||
allOk &= isOk;
|
||||
size_t k = ijkTextParts[2].toULong(&isOk);
|
||||
allOk &= isOk;
|
||||
|
||||
if (allOk)
|
||||
{
|
||||
addresses.emplace_back(RigGridCellResultAddress(gridIdx, i-1, j-1, k-1, RigEclipseResultAddress(resultVarName )));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return addresses;
|
||||
}
|
||||
|
||||
std::vector<RimEclipseCase*> openEclipseCasesForCellPlotting(QStringList gridFileNames)
|
||||
{
|
||||
std::vector<RimEclipseCase*> openedCases;
|
||||
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
RimProject* project = app->project();
|
||||
RimEclipseCaseCollection* analysisModels = project->activeOilField()->analysisModels();
|
||||
for ( const QString& fileName: gridFileNames )
|
||||
{
|
||||
QFileInfo gridFileInfo(fileName);
|
||||
|
||||
if (!gridFileInfo.exists()) continue;
|
||||
|
||||
QString caseName = gridFileInfo.completeBaseName();
|
||||
|
||||
RimEclipseResultCase* rimResultReservoir = new RimEclipseResultCase();
|
||||
rimResultReservoir->setCaseInfo(caseName, fileName);
|
||||
|
||||
analysisModels->cases.push_back(rimResultReservoir);
|
||||
|
||||
if ( !rimResultReservoir->openReserviorCase() )
|
||||
{
|
||||
analysisModels->removeCaseFromAllGroups(rimResultReservoir);
|
||||
|
||||
delete rimResultReservoir;
|
||||
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
openedCases.push_back(rimResultReservoir);
|
||||
}
|
||||
}
|
||||
|
||||
analysisModels->updateConnectedEditors();
|
||||
|
||||
return openedCases;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine(const QStringList & arguments)
|
||||
{
|
||||
// Split arguments in options, vectors and filenames
|
||||
|
||||
QStringList options;
|
||||
QStringList allCurveAddressFilters;
|
||||
QStringList summaryFileNames;
|
||||
QStringList gridFileNames;
|
||||
QString ensembleColoringParameter;
|
||||
|
||||
std::set<QString> validOptions = {"-help", "-h", "-nl", "-s", "-n", "-e", "-c", "-cl"};
|
||||
|
||||
for (int optionIdx = 0; optionIdx < arguments.size(); ++optionIdx)
|
||||
{
|
||||
if (arguments[optionIdx].startsWith("-"))
|
||||
{
|
||||
if (arguments[optionIdx] == "-help")
|
||||
{
|
||||
RiaApplication::instance()->showFormattedTextInMessageBoxOrConsole(
|
||||
"The --summaryplot option has the following syntax:\n"
|
||||
"\n"
|
||||
"[<plotOptions>] <eclipsesummaryvectorfilters> [<eclipsedatafiles>]\n"
|
||||
"\n"
|
||||
"It Creates one summary plot for each of the the summary vectors matched by the <eclipsesummaryvectorfilters> using all the <eclipsedatafiles> in each plot.\n"
|
||||
"The <eclipsesummaryvectorfilters> has the syntax <vectorname>[:<item>[:<subitem>[:i,j,k]]] and can be repeated.\n"
|
||||
"Wildcards can also be used, eg. \"WOPT:*\" to select the total oil production from all the wells.\n"
|
||||
"The <eclipsedatafiles> can be written with or without extension. Only the corresponding SMSPEC file will be opened for each case.\n"
|
||||
"\n"
|
||||
"The summary plot options are: \n"
|
||||
" -help\t Show this help text and ignore the rest of the options.\n"
|
||||
" -h\t Include history vectors. Will be read from the summary file if the vectors exist.\n"
|
||||
" \t Only history vectors from the first summary case in the project will be included.\n"
|
||||
" -nl\t Omit legend in plot.\n"
|
||||
" -s\t Create only one plot including all the defined vectors and cases.\n"
|
||||
" -n\t Scale all curves into the range 0.0-1.0. Useful when using -s.\n"
|
||||
" -e\t Import all the cases as an ensemble, and create ensemble curves sets instead of single curves.\n"
|
||||
" -c <parametername>\t Same as -e, but colors the curves by the ensemble parameter <parametername> . \n"
|
||||
" -cl <parametername>\t Same as -c, but uses logarithmic legend.\n"
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ( validOptions.count(arguments[optionIdx]) )
|
||||
{
|
||||
options.push_back(arguments[optionIdx]);
|
||||
|
||||
if ( arguments[optionIdx] == "-c" || arguments[optionIdx] == "-cl" )
|
||||
{
|
||||
optionIdx++;
|
||||
if ( optionIdx < arguments.size() ) ensembleColoringParameter = arguments[optionIdx];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
RiaLogging::error("The summaryplot option: \"" + arguments[optionIdx] + "\" is unknown.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
RiaEclipseFileNameTools nameTool(arguments[optionIdx]);
|
||||
QString smSpecFileName = nameTool.findRelatedSummarySpecFile();
|
||||
QString gridFileName = nameTool.findRelatedGridFile();
|
||||
|
||||
if (smSpecFileName != "" || gridFileName != "")
|
||||
{
|
||||
if (smSpecFileName != "") summaryFileNames.push_back(smSpecFileName);
|
||||
if (gridFileName != "") gridFileNames.push_back(gridFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
allCurveAddressFilters.push_back(arguments[optionIdx]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( allCurveAddressFilters.empty() )
|
||||
{
|
||||
RiaLogging::error("Needs at least one vector to create a plot.");
|
||||
}
|
||||
|
||||
bool hideLegend = options.contains("-nl");
|
||||
bool addHistoryCurves = options.contains("-h");
|
||||
bool isNormalizedY = options.contains("-n");
|
||||
bool isSinglePlot = options.contains("-s");
|
||||
|
||||
enum EnsembleColoringType { SINGLE_COLOR, PARAMETER, LOG_PARAMETER, NONE };
|
||||
EnsembleColoringType ensembleColoringStyle = NONE;
|
||||
{
|
||||
int e_pos = options.lastIndexOf("-e");
|
||||
int c_pos = options.lastIndexOf("-c");
|
||||
int cl_pos = options.lastIndexOf("-cl");
|
||||
|
||||
|
||||
int lastEnsembleOptionPos = -1;
|
||||
if ( e_pos > lastEnsembleOptionPos ) { lastEnsembleOptionPos = e_pos ; ensembleColoringStyle = SINGLE_COLOR; }
|
||||
if ( c_pos > lastEnsembleOptionPos ) { lastEnsembleOptionPos = c_pos ; ensembleColoringStyle = PARAMETER; }
|
||||
if ( cl_pos > lastEnsembleOptionPos ) { lastEnsembleOptionPos = cl_pos ; ensembleColoringStyle = LOG_PARAMETER; }
|
||||
}
|
||||
|
||||
bool isEnsembleMode = ensembleColoringStyle != NONE;
|
||||
|
||||
std::vector<RimSummaryCase*> summaryCasesToUse;
|
||||
|
||||
if ( summaryFileNames.size() )
|
||||
{
|
||||
RicImportSummaryCasesFeature::createSummaryCasesFromFiles(summaryFileNames, &summaryCasesToUse, isEnsembleMode);
|
||||
RicImportSummaryCasesFeature::addSummaryCases(summaryCasesToUse);
|
||||
RiaApplication::instance()->setLastUsedDialogDirectory(RiaDefines::defaultDirectoryLabel(RiaDefines::ECLIPSE_SUMMARY_FILE),
|
||||
QFileInfo(summaryFileNames[0]).absolutePath());
|
||||
}
|
||||
|
||||
// Sort in summary and grid curve addresses
|
||||
|
||||
QStringList gridResultAddressFilters;
|
||||
QStringList summaryAddressFilters;
|
||||
if ( summaryCasesToUse.size() )
|
||||
{
|
||||
const std::set<RifEclipseSummaryAddress>& addrs = summaryCasesToUse[0]->summaryReader()->allResultAddresses();
|
||||
std::vector<bool> usedFilters;
|
||||
std::set<RifEclipseSummaryAddress> setToInsertFilteredAddressesIn;
|
||||
filteredSummaryAdressesFromCase(allCurveAddressFilters, addrs, &setToInsertFilteredAddressesIn, &usedFilters);
|
||||
|
||||
QRegularExpression gridAddressPattern("^[A-Z]+:[0-9]+,[0-9]+,[0-9]+$");
|
||||
|
||||
for ( int filterIdx = 0; filterIdx < allCurveAddressFilters.size(); ++filterIdx )
|
||||
{
|
||||
const QString& address = allCurveAddressFilters[filterIdx];
|
||||
if ( usedFilters[filterIdx] )
|
||||
{
|
||||
summaryAddressFilters.push_back(address);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( gridAddressPattern.match(address).hasMatch() )
|
||||
{
|
||||
gridResultAddressFilters.push_back(address);
|
||||
}
|
||||
else
|
||||
{
|
||||
RiaLogging::warning("No summary or restart vectors matched \"" + address + "\"");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( summaryCasesToUse.size() )
|
||||
{
|
||||
if ( summaryAddressFilters.size() )
|
||||
{
|
||||
RimSummaryPlotCollection* sumPlotColl = RiaApplication::instance()->project()->mainPlotCollection()->summaryPlotCollection();
|
||||
RimSummaryPlot* lastPlotCreated = nullptr;
|
||||
RimSummaryCaseCollection* ensemble = nullptr;
|
||||
if ( isEnsembleMode ) ensemble = RicCreateSummaryCaseCollectionFeature::groupSummaryCases(summaryCasesToUse, "Ensemble", true);
|
||||
|
||||
if ( isSinglePlot )
|
||||
{
|
||||
RimSummaryPlot* newPlot = sumPlotColl->createSummaryPlotWithAutoTitle();
|
||||
|
||||
if ( isEnsembleMode )
|
||||
{
|
||||
std::set<RifEclipseSummaryAddress> filteredAdressesFromCases = applySummaryAddressFiltersToCases(summaryCasesToUse,
|
||||
summaryAddressFilters);
|
||||
for ( const auto & addr : filteredAdressesFromCases )
|
||||
{
|
||||
RimEnsembleCurveSet* curveSet = new RimEnsembleCurveSet();
|
||||
|
||||
curveSet->setSummaryCaseCollection(ensemble);
|
||||
curveSet->setSummaryAddress(addr);
|
||||
|
||||
if ( ensembleColoringStyle == PARAMETER || ensembleColoringStyle == LOG_PARAMETER )
|
||||
{
|
||||
curveSet->setColorMode(RimEnsembleCurveSet::BY_ENSEMBLE_PARAM);
|
||||
curveSet->setEnsembleParameter(ensembleColoringParameter);
|
||||
if ( ensembleColoringStyle == LOG_PARAMETER )
|
||||
{
|
||||
curveSet->legendConfig()->setMappingMode(RimRegularLegendConfig::LOG10_CONTINUOUS);
|
||||
}
|
||||
}
|
||||
newPlot->ensembleCurveSetCollection()->addCurveSet(curveSet);
|
||||
|
||||
|
||||
if ( addHistoryCurves )
|
||||
{
|
||||
RimSummaryCurve* historyCurve = createHistoryCurve(addr, summaryCasesToUse[0]);
|
||||
if ( historyCurve ) newPlot->addCurveNoUpdate(historyCurve);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( RimSummaryCase* sumCase : summaryCasesToUse )
|
||||
{
|
||||
RicSummaryPlotFeatureImpl::addCurvesFromAddressFiltersToPlot(summaryAddressFilters, newPlot, sumCase, addHistoryCurves);
|
||||
addHistoryCurves = false;
|
||||
}
|
||||
}
|
||||
|
||||
lastPlotCreated = newPlot;
|
||||
|
||||
newPlot->showLegend(!hideLegend);
|
||||
newPlot->setNormalizationEnabled(isNormalizedY);
|
||||
|
||||
newPlot->applyDefaultCurveAppearances();
|
||||
newPlot->loadDataAndUpdate();
|
||||
|
||||
sumPlotColl->updateConnectedEditors();
|
||||
|
||||
RiuPlotMainWindowTools::setExpanded(newPlot);
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem(newPlot);
|
||||
}
|
||||
else // Multiplot, one for each separate summary address
|
||||
{
|
||||
|
||||
std::set<RifEclipseSummaryAddress> filteredAdressesFromCases = applySummaryAddressFiltersToCases(summaryCasesToUse,
|
||||
summaryAddressFilters);
|
||||
|
||||
for ( const auto & addr : filteredAdressesFromCases )
|
||||
{
|
||||
std::vector<RimSummaryCurve*> createdCurves;
|
||||
std::vector<RimEnsembleCurveSet*> createdEnsembleCurveSets;
|
||||
if ( isEnsembleMode )
|
||||
{
|
||||
RimEnsembleCurveSet* curveSet = new RimEnsembleCurveSet();
|
||||
|
||||
curveSet->setSummaryCaseCollection(ensemble);
|
||||
curveSet->setSummaryAddress(addr);
|
||||
if ( ensembleColoringStyle == PARAMETER || ensembleColoringStyle == LOG_PARAMETER )
|
||||
{
|
||||
curveSet->setColorMode(RimEnsembleCurveSet::BY_ENSEMBLE_PARAM);
|
||||
curveSet->setEnsembleParameter(ensembleColoringParameter);
|
||||
if ( ensembleColoringStyle == LOG_PARAMETER )
|
||||
{
|
||||
curveSet->legendConfig()->setMappingMode(RimRegularLegendConfig::LOG10_CONTINUOUS);
|
||||
}
|
||||
}
|
||||
createdEnsembleCurveSets.push_back(curveSet);
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( RimSummaryCase* sumCase : summaryCasesToUse )
|
||||
{
|
||||
const std::set<RifEclipseSummaryAddress>& allAddrsInCase = sumCase->summaryReader()->allResultAddresses();
|
||||
if ( allAddrsInCase.count(addr) )
|
||||
{
|
||||
RimSummaryCurve* newCurve = new RimSummaryCurve();
|
||||
newCurve->setSummaryCaseY(sumCase);
|
||||
newCurve->setSummaryAddressYAndApplyInterpolation(addr);
|
||||
createdCurves.push_back(newCurve);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( addHistoryCurves )
|
||||
{
|
||||
RimSummaryCurve* historyCurve = createHistoryCurve(addr, summaryCasesToUse[0]);
|
||||
if ( historyCurve ) createdCurves.push_back(historyCurve);
|
||||
}
|
||||
|
||||
if ( createdCurves.size() || createdEnsembleCurveSets.size() )
|
||||
{
|
||||
RimSummaryPlot* newPlot = sumPlotColl->createSummaryPlotWithAutoTitle();
|
||||
|
||||
for ( auto curve : createdCurves )
|
||||
{
|
||||
newPlot->addCurveNoUpdate(curve);
|
||||
}
|
||||
|
||||
for ( auto curveSet: createdEnsembleCurveSets )
|
||||
{
|
||||
newPlot->ensembleCurveSetCollection()->addCurveSet(curveSet);
|
||||
}
|
||||
|
||||
newPlot->showLegend(!hideLegend);
|
||||
newPlot->setNormalizationEnabled(isNormalizedY);
|
||||
|
||||
newPlot->applyDefaultCurveAppearances();
|
||||
newPlot->loadDataAndUpdate();
|
||||
lastPlotCreated = newPlot;
|
||||
}
|
||||
}
|
||||
}
|
||||
sumPlotColl->updateConnectedEditors();
|
||||
|
||||
if ( lastPlotCreated )
|
||||
{
|
||||
RiuPlotMainWindowTools::setExpanded(lastPlotCreated);
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem(lastPlotCreated);
|
||||
RiuPlotMainWindowTools::showPlotMainWindow();
|
||||
RiuMainWindow::instance()->close();
|
||||
}
|
||||
}
|
||||
|
||||
// Grid Cell Result vectors
|
||||
|
||||
if ( gridResultAddressFilters.size() )
|
||||
{
|
||||
// Todo: Use identical grid case import if -e -c or -cl
|
||||
|
||||
std::vector<RimEclipseCase*> gridCasesToPlotFrom = openEclipseCasesForCellPlotting(gridFileNames);
|
||||
|
||||
RimSummaryPlotCollection* sumPlotColl = RiaApplication::instance()->project()->mainPlotCollection()->summaryPlotCollection();
|
||||
|
||||
if ( isSinglePlot )
|
||||
{
|
||||
std::vector<RimGridTimeHistoryCurve*> createdCurves;
|
||||
int curveColorIndex = 0;
|
||||
for ( const QString& gridAddressFilter : gridResultAddressFilters )
|
||||
{
|
||||
std::vector<RigGridCellResultAddress> cellResAddrs = createGridCellAddressesFromFilter(gridAddressFilter);
|
||||
for ( RigGridCellResultAddress cellResAddr : cellResAddrs )
|
||||
{
|
||||
for ( RimEclipseCase* eclCase: gridCasesToPlotFrom )
|
||||
{
|
||||
if (!(eclCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL) &&
|
||||
eclCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->resultInfo(cellResAddr.eclipseResultAddress)) )
|
||||
{
|
||||
RiaLogging::warning("Could not find a restart result property with name: \"" + cellResAddr.eclipseResultAddress.m_resultName + "\"");
|
||||
continue;
|
||||
}
|
||||
|
||||
RimGridTimeHistoryCurve* newCurve = new RimGridTimeHistoryCurve();
|
||||
newCurve->setFromEclipseCellAndResult(eclCase,
|
||||
cellResAddr.gridIndex,
|
||||
cellResAddr.i,
|
||||
cellResAddr.j,
|
||||
cellResAddr.k,
|
||||
cellResAddr.eclipseResultAddress);
|
||||
newCurve->setLineThickness(2);
|
||||
cvf::Color3f curveColor = RicWellLogPlotCurveFeatureImpl::curveColorFromTable(curveColorIndex);
|
||||
newCurve->setColor(curveColor);
|
||||
if (!isEnsembleMode) ++curveColorIndex;
|
||||
|
||||
createdCurves.push_back(newCurve);
|
||||
}
|
||||
if (isEnsembleMode) ++curveColorIndex;
|
||||
}
|
||||
}
|
||||
|
||||
if ( createdCurves.size() )
|
||||
{
|
||||
RimSummaryPlot* newPlot = sumPlotColl->createSummaryPlotWithAutoTitle();
|
||||
for ( auto curve: createdCurves )
|
||||
{
|
||||
newPlot->addGridTimeHistoryCurve(curve);
|
||||
}
|
||||
|
||||
newPlot->showLegend(!hideLegend);
|
||||
newPlot->setNormalizationEnabled(isNormalizedY);
|
||||
newPlot->loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
else // Multiplot
|
||||
{
|
||||
int curveColorIndex = 0;
|
||||
|
||||
for ( const QString& gridAddressFilter : gridResultAddressFilters )
|
||||
{
|
||||
std::vector<RigGridCellResultAddress> cellResAddrs = createGridCellAddressesFromFilter(gridAddressFilter);
|
||||
for ( RigGridCellResultAddress cellResAddr : cellResAddrs )
|
||||
{
|
||||
std::vector<RimGridTimeHistoryCurve*> createdCurves;
|
||||
for ( RimEclipseCase* eclCase: gridCasesToPlotFrom )
|
||||
{
|
||||
if (!(eclCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL) &&
|
||||
eclCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->resultInfo(cellResAddr.eclipseResultAddress)) )
|
||||
{
|
||||
RiaLogging::warning("Could not find a restart result property with name: \"" + cellResAddr.eclipseResultAddress.m_resultName + "\"");
|
||||
continue;
|
||||
}
|
||||
RimGridTimeHistoryCurve* newCurve = new RimGridTimeHistoryCurve();
|
||||
newCurve->setFromEclipseCellAndResult(eclCase,
|
||||
cellResAddr.gridIndex,
|
||||
cellResAddr.i,
|
||||
cellResAddr.j,
|
||||
cellResAddr.k,
|
||||
cellResAddr.eclipseResultAddress);
|
||||
newCurve->setLineThickness(2);
|
||||
cvf::Color3f curveColor = RicWellLogPlotCurveFeatureImpl::curveColorFromTable(curveColorIndex);
|
||||
newCurve->setColor(curveColor);
|
||||
if (!isEnsembleMode) ++curveColorIndex;
|
||||
createdCurves.push_back(newCurve);
|
||||
}
|
||||
|
||||
if (isEnsembleMode) ++curveColorIndex;
|
||||
|
||||
if ( createdCurves.size() )
|
||||
{
|
||||
RimSummaryPlot* newPlot = sumPlotColl->createSummaryPlotWithAutoTitle();
|
||||
for (auto newCurve : createdCurves)
|
||||
{
|
||||
newPlot->addGridTimeHistoryCurve(newCurve);
|
||||
}
|
||||
newPlot->showLegend(!hideLegend);
|
||||
newPlot->setNormalizationEnabled(isNormalizedY);
|
||||
newPlot->loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sumPlotColl->updateConnectedEditors();
|
||||
|
||||
RiuPlotMainWindowTools::showPlotMainWindow();
|
||||
RiuMainWindow::instance()->close();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
RiaLogging::error("Needs at least one summary case to create a plot.");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<RifEclipseSummaryAddress> RicSummaryPlotFeatureImpl::applySummaryAddressFiltersToCases(const std::vector<RimSummaryCase *>& summaryCasesToUse,
|
||||
const QStringList& summaryAddressFilters)
|
||||
{
|
||||
std::set<RifEclipseSummaryAddress> filteredAdressesFromCases;
|
||||
for ( RimSummaryCase* sumCase : summaryCasesToUse )
|
||||
{
|
||||
const std::set<RifEclipseSummaryAddress>& addrs = sumCase->summaryReader()->allResultAddresses();
|
||||
std::vector<bool> usedFilters;
|
||||
|
||||
filteredSummaryAdressesFromCase(summaryAddressFilters, addrs, &filteredAdressesFromCases, &usedFilters);
|
||||
|
||||
for ( int cfIdx = 0 ; cfIdx < usedFilters.size() ; ++cfIdx )
|
||||
{
|
||||
if ( !usedFilters[cfIdx] )
|
||||
{
|
||||
RiaLogging::warning("Vector filter \"" + summaryAddressFilters[cfIdx] + "\" did not match anything in case: \"" + sumCase->caseName() + "\"");
|
||||
}
|
||||
}
|
||||
}
|
||||
return filteredAdressesFromCases;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryCurve*> RicSummaryPlotFeatureImpl::addCurvesFromAddressFiltersToPlot(const QStringList& curveFilters,
|
||||
RimSummaryPlot* plot,
|
||||
RimSummaryCase* summaryCase,
|
||||
bool addHistoryCurves)
|
||||
{
|
||||
std::vector<RimSummaryCurve*> createdCurves;
|
||||
|
||||
std::set<RifEclipseSummaryAddress> curveAddressesToUse;
|
||||
|
||||
const std::set<RifEclipseSummaryAddress>& addrs = summaryCase->summaryReader()->allResultAddresses();
|
||||
std::vector<bool> usedFilters;
|
||||
|
||||
filteredSummaryAdressesFromCase(curveFilters, addrs, &curveAddressesToUse, &usedFilters);
|
||||
|
||||
for (int cfIdx = 0 ; cfIdx < usedFilters.size() ; ++cfIdx)
|
||||
{
|
||||
if (!usedFilters[cfIdx])
|
||||
{
|
||||
RiaLogging::warning("Vector filter \"" + curveFilters[cfIdx] + "\" did not match anything in case: \"" + summaryCase->caseName() + "\"");
|
||||
}
|
||||
}
|
||||
|
||||
if (addHistoryCurves)
|
||||
{
|
||||
std::vector<RifEclipseSummaryAddress> historyAddressesToUse;
|
||||
for (RifEclipseSummaryAddress historyAddr : curveAddressesToUse)
|
||||
{
|
||||
historyAddr.setQuantityName(historyAddr.quantityName() + "H");
|
||||
if (addrs.count(historyAddr))
|
||||
{
|
||||
historyAddressesToUse.push_back(historyAddr);
|
||||
}
|
||||
}
|
||||
curveAddressesToUse.insert( historyAddressesToUse.begin(), historyAddressesToUse.end() );
|
||||
}
|
||||
|
||||
|
||||
for (const auto & addr : curveAddressesToUse)
|
||||
{
|
||||
RimSummaryCurve* newCurve = new RimSummaryCurve();
|
||||
plot->addCurveNoUpdate(newCurve);
|
||||
if (summaryCase)
|
||||
{
|
||||
newCurve->setSummaryCaseY(summaryCase);
|
||||
}
|
||||
newCurve->setSummaryAddressYAndApplyInterpolation(addr);
|
||||
createdCurves.push_back(newCurve);
|
||||
}
|
||||
|
||||
return createdCurves;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSummaryPlotFeatureImpl::filteredSummaryAdressesFromCase(const QStringList& curveFilters,
|
||||
const std::set<RifEclipseSummaryAddress>& allAddressesInCase,
|
||||
std::set<RifEclipseSummaryAddress>* setToInsertFilteredAddressesIn,
|
||||
std::vector<bool>* usedFilters)
|
||||
{
|
||||
int curveFilterCount = curveFilters.size();
|
||||
|
||||
usedFilters->clear();
|
||||
usedFilters->resize(curveFilterCount, false);
|
||||
|
||||
for (const auto & addr : allAddressesInCase)
|
||||
{
|
||||
for (int cfIdx = 0 ; cfIdx < curveFilterCount ; ++cfIdx)
|
||||
{
|
||||
if ( addr.isUiTextMatchingFilterText( curveFilters[cfIdx]) )
|
||||
{
|
||||
setToInsertFilteredAddressesIn->insert(addr);
|
||||
(*usedFilters)[cfIdx] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,11 @@ class RimSummaryCase;
|
||||
class RimSummaryPlotCollection;
|
||||
|
||||
#include <vector>
|
||||
#include <set>
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
|
||||
class QStringList;
|
||||
|
||||
|
||||
class RicSummaryPlotFeatureImpl
|
||||
{
|
||||
@@ -31,7 +36,20 @@ public:
|
||||
static std::vector<RimSummaryCurve*> addDefaultCurvesToPlot(RimSummaryPlot* plot, RimSummaryCase* summaryCase);
|
||||
static void ensureAtLeastOnePlot(RimSummaryPlotCollection* summaryPlotCollection, RimSummaryCase* summaryCase);
|
||||
static void createDefaultSummaryPlot(RimSummaryCase* summaryCase);
|
||||
|
||||
static void createSummaryPlotsFromArgumentLine(const QStringList & arguments);
|
||||
|
||||
private:
|
||||
static std::vector<RimSummaryCurve*> addCurvesFromAddressFiltersToPlot(const QStringList& curveFilters,
|
||||
RimSummaryPlot* plot,
|
||||
RimSummaryCase* summaryCase,
|
||||
bool addHistoryCurves);
|
||||
static std::set<RifEclipseSummaryAddress> applySummaryAddressFiltersToCases(const std::vector<RimSummaryCase *>& summaryCasesToUse,
|
||||
const QStringList& summaryAddressFilters);
|
||||
static void filteredSummaryAdressesFromCase(const QStringList& curveFilters,
|
||||
const std::set<RifEclipseSummaryAddress>& allAddressesInCase,
|
||||
std::set<RifEclipseSummaryAddress>* setToInsertFilteredAddressesIn,
|
||||
std::vector<bool>* usedFilters);
|
||||
|
||||
};
|
||||
|
||||
|
||||
10
ApplicationCode/GrpcInterface/Python/.gitignore
vendored
10
ApplicationCode/GrpcInterface/Python/.gitignore
vendored
@@ -7,4 +7,12 @@ rips.egg-info
|
||||
setup.py
|
||||
grpc
|
||||
grpcio*
|
||||
six*
|
||||
six*
|
||||
easy_install*
|
||||
bin*
|
||||
grpc_tools
|
||||
pkg_resources
|
||||
google
|
||||
protobuf*
|
||||
setuptools*
|
||||
extern*
|
||||
|
||||
@@ -2,5 +2,5 @@ import rips
|
||||
|
||||
resInsight = rips.Instance.find()
|
||||
if resInsight is not None:
|
||||
print(resInsight.app.versionString())
|
||||
print("Is this a console run?", resInsight.app.isConsole())
|
||||
print(resInsight.versionString())
|
||||
print("Is this a console run?", resInsight.isConsole())
|
||||
|
||||
@@ -27,9 +27,9 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
grpc::Status RiaGrpcAppService::GetVersion(grpc::ServerContext* context, const rips::Empty* request, rips::Version* reply)
|
||||
{
|
||||
reply->set_major_version(RESINSIGHT_MAJOR_VERSION);
|
||||
reply->set_minor_version(RESINSIGHT_MINOR_VERSION);
|
||||
reply->set_patch_version(RESINSIGHT_PATCH_VERSION);
|
||||
reply->set_major_version(QString(RESINSIGHT_MAJOR_VERSION).toInt());
|
||||
reply->set_minor_version(QString(RESINSIGHT_MINOR_VERSION).toInt());
|
||||
reply->set_patch_version(QString(RESINSIGHT_PATCH_VERSION).toInt());
|
||||
return grpc::Status::OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
#include "RimEclipseGeometrySelectionItem.h"
|
||||
|
||||
#include "RigTimeHistoryResultAccessor.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigGridBase.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
@@ -61,6 +63,24 @@ void RimEclipseGeometrySelectionItem::setFromSelectionItem(const RiuEclipseSelec
|
||||
m_eclipseCase = selectionItem->m_view->eclipseCase();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseGeometrySelectionItem::setFromCaseGridAndIJK(RimEclipseCase* eclipseCase,
|
||||
size_t gridIndex,
|
||||
size_t i,
|
||||
size_t j,
|
||||
size_t k)
|
||||
{
|
||||
m_eclipseCase = eclipseCase;
|
||||
m_gridIndex = gridIndex;
|
||||
|
||||
size_t lgrCellIndex = eclipseCase->eclipseCaseData()->grid(gridIndex)->cellIndexFromIJK(i, j, k);
|
||||
size_t reservoirCellIndex = eclipseCase->eclipseCaseData()->grid(gridIndex)->reservoirCellIndex(lgrCellIndex);
|
||||
m_cellIndex = reservoirCellIndex;
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -39,7 +39,11 @@ public:
|
||||
~RimEclipseGeometrySelectionItem() override;
|
||||
|
||||
void setFromSelectionItem(const RiuEclipseSelectionItem* selectionItem);
|
||||
|
||||
void setFromCaseGridAndIJK(RimEclipseCase* eclipseCase,
|
||||
size_t gridIndex,
|
||||
size_t i,
|
||||
size_t j,
|
||||
size_t k);
|
||||
QString geometrySelectionText() const override;
|
||||
|
||||
RimEclipseCase* eclipseCase() const;
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigFlowDiagResultAddress.h"
|
||||
#include "RigFlowDiagResults.h"
|
||||
#include "RigEclipseResultInfo.h"
|
||||
|
||||
#include "Rim3dView.h"
|
||||
#include "Rim3dWellLogCurve.h"
|
||||
@@ -763,21 +764,32 @@ RigEclipseResultAddress RimEclipseResultDefinition::eclipseResultAddress() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseResultDefinition::setFromEclipseResultAddress(const RigEclipseResultAddress& address)
|
||||
{
|
||||
m_resultType = address.m_resultCatType;
|
||||
m_resultVariable = address.m_resultName;
|
||||
m_timeLapseBaseTimestep = address.m_timeLapseBaseFrameIdx;
|
||||
RigEclipseResultAddress canonizedAddress = address;
|
||||
|
||||
if (address.hasDifferenceCase())
|
||||
const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults();
|
||||
if (gridCellResults)
|
||||
{
|
||||
auto rinfo = gridCellResults->resultInfo(address);
|
||||
if (rinfo) canonizedAddress = rinfo->eclipseResultAddress();
|
||||
}
|
||||
|
||||
m_resultType = canonizedAddress.m_resultCatType;
|
||||
m_resultVariable = canonizedAddress.m_resultName;
|
||||
m_timeLapseBaseTimestep = canonizedAddress.m_timeLapseBaseFrameIdx;
|
||||
|
||||
if (canonizedAddress.hasDifferenceCase())
|
||||
{
|
||||
auto eclipseCases = RiaApplication::instance()->project()->eclipseCases();
|
||||
for (RimEclipseCase* c : eclipseCases)
|
||||
{
|
||||
if (c && c->caseId() == address.m_differenceCaseId)
|
||||
if (c && c->caseId() == canonizedAddress.m_differenceCaseId)
|
||||
{
|
||||
m_differenceCase = c;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this->updateUiFieldsFromActiveResult();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -135,6 +135,30 @@ void RimGridTimeHistoryCurve::setFromSelectionItem(const RiuSelectionItem* selec
|
||||
updateResultDefinitionFromCase();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridTimeHistoryCurve::setFromEclipseCellAndResult(RimEclipseCase* eclCase,
|
||||
size_t gridIdx,
|
||||
size_t i,
|
||||
size_t j,
|
||||
size_t k,
|
||||
const RigEclipseResultAddress& resAddr)
|
||||
{
|
||||
delete m_geometrySelectionItem();
|
||||
delete m_eclipseResultDefinition();
|
||||
delete m_geoMechResultDefinition();
|
||||
|
||||
m_eclipseResultDefinition = new RimEclipseResultDefinition;
|
||||
m_eclipseResultDefinition->setEclipseCase(eclCase);
|
||||
m_eclipseResultDefinition->setFromEclipseResultAddress(resAddr);
|
||||
|
||||
RimEclipseGeometrySelectionItem* geomSelectionItem = new RimEclipseGeometrySelectionItem;
|
||||
m_geometrySelectionItem = geomSelectionItem;
|
||||
geomSelectionItem->setFromCaseGridAndIJK(eclCase, gridIdx, i, j, k);
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -190,6 +214,22 @@ std::vector<double> RimGridTimeHistoryCurve::yValues() const
|
||||
}
|
||||
}
|
||||
|
||||
RimSummaryPlot* plot = nullptr;
|
||||
firstAncestorOrThisOfTypeAsserted(plot);
|
||||
bool isNormalized = plot->isNormalizationEnabled();
|
||||
if (isNormalized)
|
||||
{
|
||||
auto minMaxPair = std::minmax_element(values.begin(), values.end());
|
||||
double min = *minMaxPair.first;
|
||||
double max = *minMaxPair.second;
|
||||
double range = max - min;
|
||||
|
||||
for (double & v: values)
|
||||
{
|
||||
v = (v - min)/range;
|
||||
}
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ class RimGeoMechGeometrySelectionItem;
|
||||
class RimGeometrySelectionItem;
|
||||
class RiuFemTimeHistoryResultAccessor;
|
||||
class RiuSelectionItem;
|
||||
class RigEclipseResultAddress;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@@ -51,6 +52,12 @@ public:
|
||||
~RimGridTimeHistoryCurve() override;
|
||||
|
||||
void setFromSelectionItem(const RiuSelectionItem* selectionItem);
|
||||
void setFromEclipseCellAndResult(RimEclipseCase* eclCase,
|
||||
size_t gridIdx,
|
||||
size_t i,
|
||||
size_t j,
|
||||
size_t k,
|
||||
const RigEclipseResultAddress& resAddr);
|
||||
RiaDefines::PlotAxis yAxis() const;
|
||||
void setYAxis(RiaDefines::PlotAxis plotAxis);
|
||||
|
||||
|
||||
@@ -426,6 +426,22 @@ RimEnsembleCurveSet::ColorMode RimEnsembleCurveSet::colorMode() const
|
||||
return m_colorMode();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEnsembleCurveSet::setColorMode(ColorMode mode)
|
||||
{
|
||||
m_colorMode = mode;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEnsembleCurveSet::setEnsembleParameter(const QString& parameterName)
|
||||
{
|
||||
m_ensembleParameter = parameterName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -97,6 +97,8 @@ public:
|
||||
RimEnsembleCurveFilterCollection* filterCollection() const;
|
||||
|
||||
ColorMode colorMode() const;
|
||||
void setColorMode(ColorMode mode);
|
||||
void setEnsembleParameter(const QString& parameterName);
|
||||
void updateEnsembleLegendItem();
|
||||
EnsembleParameter::Type currentEnsembleParameterType() const;
|
||||
static QString ensembleParameterUiName(const NameParameterPair& paramPair);
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
#include "RiaDefines.h"
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaStatisticsTools.h"
|
||||
#include "RiaTimeHistoryCurveMerger.h"
|
||||
|
||||
#include "RifReaderEclipseSummary.h"
|
||||
|
||||
@@ -55,6 +57,7 @@
|
||||
#include "qwt_plot.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
#include "cafPdmUiLineEditor.h"
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimSummaryCurve, "SummaryCurve");
|
||||
@@ -72,31 +75,21 @@ RimSummaryCurve::RimSummaryCurve()
|
||||
m_yValuesSummaryCase.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
m_yValuesSummaryCase.uiCapability()->setAutoAddingOptionFromValue(false);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_yValuesSelectedVariableDisplayField, "SelectedVariableDisplayVar", "Vector", "", "", "");
|
||||
m_yValuesSelectedVariableDisplayField.xmlCapability()->disableIO();
|
||||
m_yValuesSelectedVariableDisplayField.uiCapability()->setUiReadOnly(true);
|
||||
CAF_PDM_InitFieldNoDefault(&m_yValuesSummaryAddressUiField, "SelectedVariableDisplayVar", "Vector", "", "", "");
|
||||
m_yValuesSummaryAddressUiField.xmlCapability()->disableIO();
|
||||
m_yValuesSummaryAddressUiField.uiCapability()->setUiEditorTypeName(caf::PdmUiLineEditor::uiEditorTypeName());
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_yValuesSummaryFilter, "VarListFilter", "Filter", "", "", "");
|
||||
m_yValuesSummaryFilter.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
m_yValuesSummaryFilter.uiCapability()->setUiHidden(true);
|
||||
|
||||
m_yValuesSummaryFilter = new RimSummaryFilter;
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_yValuesUiFilterResultSelection, "FilterResultSelection", "Filter Result", "", "", "");
|
||||
m_yValuesUiFilterResultSelection.xmlCapability()->disableIO();
|
||||
m_yValuesUiFilterResultSelection.uiCapability()->setUiEditorTypeName(caf::PdmUiListEditor::uiEditorTypeName());
|
||||
m_yValuesUiFilterResultSelection.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||
m_yValuesUiFilterResultSelection.uiCapability()->setAutoAddingOptionFromValue(false);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_yValuesCurveVariable, "SummaryAddress", "Summary Address", "", "", "");
|
||||
m_yValuesCurveVariable.uiCapability()->setUiHidden(true);
|
||||
m_yValuesCurveVariable.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
CAF_PDM_InitFieldNoDefault(&m_yValuesSummaryAddress, "SummaryAddress", "Summary Address", "", "", "");
|
||||
m_yValuesSummaryAddress.uiCapability()->setUiHidden(true);
|
||||
m_yValuesSummaryAddress.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_yPushButtonSelectSummaryAddress, "SelectAddress", "", "", "", "");
|
||||
caf::PdmUiPushButtonEditor::configureEditorForField(&m_yPushButtonSelectSummaryAddress);
|
||||
m_yPushButtonSelectSummaryAddress.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||
m_yPushButtonSelectSummaryAddress = false;
|
||||
|
||||
m_yValuesCurveVariable = new RimSummaryAddress;
|
||||
m_yValuesSummaryAddress = new RimSummaryAddress;
|
||||
|
||||
|
||||
// X Values
|
||||
@@ -105,31 +98,23 @@ RimSummaryCurve::RimSummaryCurve()
|
||||
m_xValuesSummaryCase.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
m_xValuesSummaryCase.uiCapability()->setAutoAddingOptionFromValue(false);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_xValuesSelectedVariableDisplayField, "SelectedVariableDisplayVarX", "Vector", "", "", "");
|
||||
m_xValuesSelectedVariableDisplayField.xmlCapability()->disableIO();
|
||||
m_xValuesSelectedVariableDisplayField.uiCapability()->setUiReadOnly(true);
|
||||
CAF_PDM_InitFieldNoDefault(&m_xValuesSummaryAddressUiField, "SelectedVariableDisplayVarX", "Vector", "", "", "");
|
||||
m_xValuesSummaryAddressUiField.xmlCapability()->disableIO();
|
||||
m_xValuesSummaryAddressUiField.uiCapability()->setUiEditorTypeName(caf::PdmUiLineEditor::uiEditorTypeName());
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_xValuesSummaryFilter, "VarListFilterX", "Filter", "", "", "");
|
||||
m_xValuesSummaryFilter.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
m_xValuesSummaryFilter.uiCapability()->setUiHidden(true);
|
||||
|
||||
m_xValuesSummaryFilter = new RimSummaryFilter;
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_xValuesUiFilterResultSelection, "FilterResultSelectionX", "Filter Result", "", "", "");
|
||||
m_xValuesUiFilterResultSelection.xmlCapability()->disableIO();
|
||||
m_xValuesUiFilterResultSelection.uiCapability()->setUiEditorTypeName(caf::PdmUiListEditor::uiEditorTypeName());
|
||||
m_xValuesUiFilterResultSelection.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||
m_xValuesUiFilterResultSelection.uiCapability()->setAutoAddingOptionFromValue(false);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_xValuesCurveVariable, "SummaryAddressX", "Summary Address", "", "", "");
|
||||
m_xValuesCurveVariable.uiCapability()->setUiHidden(true);
|
||||
m_xValuesCurveVariable.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
CAF_PDM_InitFieldNoDefault(&m_xValuesSummaryAddress, "SummaryAddressX", "Summary Address", "", "", "");
|
||||
m_xValuesSummaryAddress.uiCapability()->setUiHidden(true);
|
||||
m_xValuesSummaryAddress.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_xPushButtonSelectSummaryAddress, "SelectAddressX", "", "", "", "");
|
||||
caf::PdmUiPushButtonEditor::configureEditorForField(&m_xPushButtonSelectSummaryAddress);
|
||||
m_xPushButtonSelectSummaryAddress.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||
|
||||
m_xPushButtonSelectSummaryAddress = false;
|
||||
|
||||
m_xValuesCurveVariable = new RimSummaryAddress;
|
||||
m_xValuesSummaryAddress = new RimSummaryAddress;
|
||||
|
||||
|
||||
// Other members
|
||||
@@ -147,6 +132,19 @@ RimSummaryCurve::RimSummaryCurve()
|
||||
|
||||
m_symbolSkipPixelDistance = 10.0f;
|
||||
m_curveThickness = 2;
|
||||
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_yValuesSummaryFilter_OBSOLETE, "VarListFilter", "Filter", "", "", "");
|
||||
m_yValuesSummaryFilter_OBSOLETE.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
m_yValuesSummaryFilter_OBSOLETE.uiCapability()->setUiHidden(true);
|
||||
m_yValuesSummaryFilter_OBSOLETE.xmlCapability()->setIOWritable(false);
|
||||
m_yValuesSummaryFilter_OBSOLETE = new RimSummaryFilter;
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_xValuesSummaryFilter_OBSOLETE, "VarListFilterX", "Filter", "", "", "");
|
||||
m_xValuesSummaryFilter_OBSOLETE.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
m_xValuesSummaryFilter_OBSOLETE.uiCapability()->setUiHidden(true);
|
||||
m_xValuesSummaryFilter_OBSOLETE.xmlCapability()->setIOWritable(false);
|
||||
m_xValuesSummaryFilter_OBSOLETE = new RimSummaryFilter;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -182,7 +180,7 @@ RimSummaryCase* RimSummaryCurve::summaryCaseY() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RimSummaryCurve::summaryAddressX() const
|
||||
{
|
||||
return m_xValuesCurveVariable->address();
|
||||
return m_xValuesSummaryAddress->address();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -190,7 +188,7 @@ RifEclipseSummaryAddress RimSummaryCurve::summaryAddressX() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCurve::setSummaryAddressX(const RifEclipseSummaryAddress& address)
|
||||
{
|
||||
m_xValuesCurveVariable->setAddress(address);
|
||||
m_xValuesSummaryAddress->setAddress(address);
|
||||
|
||||
// TODO: Should interpolation be computed similar to RimSummaryCurve::setSummaryAddressY
|
||||
}
|
||||
@@ -200,7 +198,7 @@ void RimSummaryCurve::setSummaryAddressX(const RifEclipseSummaryAddress& address
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseSummaryAddress RimSummaryCurve::summaryAddressY() const
|
||||
{
|
||||
return m_yValuesCurveVariable->address();
|
||||
return m_yValuesSummaryAddress->address();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -218,14 +216,12 @@ void RimSummaryCurve::setSummaryAddressYAndApplyInterpolation(const RifEclipseSu
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCurve::setSummaryAddressY(const RifEclipseSummaryAddress& address)
|
||||
{
|
||||
if (m_yValuesCurveVariable->address() != address)
|
||||
if (m_yValuesSummaryAddress->address() != address)
|
||||
{
|
||||
m_qwtPlotCurve->clearErrorBars();
|
||||
}
|
||||
|
||||
m_yValuesCurveVariable->setAddress(address);
|
||||
|
||||
m_yValuesSummaryFilter->updateFromAddress(address);
|
||||
m_yValuesSummaryAddress->setAddress(address);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -261,9 +257,25 @@ std::vector<double> RimSummaryCurve::valuesY() const
|
||||
|
||||
if ( !reader ) return values;
|
||||
|
||||
RifEclipseSummaryAddress addr = m_yValuesCurveVariable()->address();
|
||||
RifEclipseSummaryAddress addr = m_yValuesSummaryAddress()->address();
|
||||
reader->values(addr, &values);
|
||||
|
||||
RimSummaryPlot* plot = nullptr;
|
||||
firstAncestorOrThisOfTypeAsserted(plot);
|
||||
bool isNormalized = plot->isNormalizationEnabled();
|
||||
if (isNormalized)
|
||||
{
|
||||
auto minMaxPair = std::minmax_element(values.begin(), values.end());
|
||||
double min = *minMaxPair.first;
|
||||
double max = *minMaxPair.second;
|
||||
double range = max - min;
|
||||
|
||||
for (double & v: values)
|
||||
{
|
||||
v = (v - min)/range;
|
||||
}
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
@@ -308,7 +320,7 @@ std::vector<double> RimSummaryCurve::valuesX() const
|
||||
{
|
||||
RifSummaryReaderInterface* reader = m_xValuesSummaryCase()->summaryReader();
|
||||
|
||||
RifEclipseSummaryAddress addr = m_xValuesCurveVariable()->address();
|
||||
RifEclipseSummaryAddress addr = m_xValuesSummaryAddress()->address();
|
||||
reader->values(addr, &values);
|
||||
}
|
||||
|
||||
@@ -325,7 +337,7 @@ const std::vector<time_t>& RimSummaryCurve::timeStepsY() const
|
||||
|
||||
if ( !reader ) return emptyVector;
|
||||
|
||||
RifEclipseSummaryAddress addr = m_yValuesCurveVariable()->address();
|
||||
RifEclipseSummaryAddress addr = m_yValuesSummaryAddress()->address();
|
||||
|
||||
return reader->timeSteps(addr);
|
||||
}
|
||||
@@ -389,15 +401,14 @@ QList<caf::PdmOptionItemInfo> RimSummaryCurve::calculateValueOptions(const caf::
|
||||
options.push_front(caf::PdmOptionItemInfo("None", nullptr));
|
||||
}
|
||||
}
|
||||
else if(fieldNeedingOptions == &m_yValuesUiFilterResultSelection)
|
||||
else if (&m_yValuesSummaryAddressUiField == fieldNeedingOptions)
|
||||
{
|
||||
appendOptionItemsForSummaryAddresses(&options, m_yValuesSummaryCase(), m_yValuesSummaryFilter());
|
||||
appendOptionItemsForSummaryAddresses(&options, m_yValuesSummaryCase(), nullptr);
|
||||
}
|
||||
else if (fieldNeedingOptions == &m_xValuesUiFilterResultSelection)
|
||||
else if (&m_xValuesSummaryAddressUiField == fieldNeedingOptions)
|
||||
{
|
||||
appendOptionItemsForSummaryAddresses(&options, m_xValuesSummaryCase(), m_xValuesSummaryFilter());
|
||||
appendOptionItemsForSummaryAddresses(&options, m_xValuesSummaryCase(), nullptr);
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
@@ -410,18 +421,18 @@ QString RimSummaryCurve::createCurveAutoName()
|
||||
firstAncestorOrThisOfTypeAsserted(plot);
|
||||
|
||||
const RimSummaryPlotNameHelper* nameHelper = plot->activePlotTitleHelperAllCurves();
|
||||
QString curveName = m_curveNameConfig->curveNameY(m_yValuesCurveVariable->address(), nameHelper);
|
||||
QString curveName = m_curveNameConfig->curveNameY(m_yValuesSummaryAddress->address(), nameHelper);
|
||||
if (curveName.isEmpty())
|
||||
{
|
||||
curveName = m_curveNameConfig->curveNameY(m_yValuesCurveVariable->address(), nullptr);
|
||||
curveName = m_curveNameConfig->curveNameY(m_yValuesSummaryAddress->address(), nullptr);
|
||||
}
|
||||
|
||||
if (isCrossPlotCurve())
|
||||
{
|
||||
QString curveNameX = m_curveNameConfig->curveNameX(m_xValuesCurveVariable->address(), nameHelper);
|
||||
QString curveNameX = m_curveNameConfig->curveNameX(m_xValuesSummaryAddress->address(), nameHelper);
|
||||
if (curveNameX.isEmpty())
|
||||
{
|
||||
curveNameX = m_curveNameConfig->curveNameX(m_xValuesCurveVariable->address(), nullptr);
|
||||
curveNameX = m_curveNameConfig->curveNameX(m_xValuesSummaryAddress->address(), nullptr);
|
||||
}
|
||||
|
||||
if (!curveName.isEmpty() || !curveNameX.isEmpty())
|
||||
@@ -456,11 +467,8 @@ void RimSummaryCurve::onLoadDataAndUpdate(bool updateParentPlot)
|
||||
{
|
||||
this->RimPlotCurve::updateCurvePresentation(updateParentPlot);
|
||||
|
||||
m_yValuesSelectedVariableDisplayField = QString::fromStdString(m_yValuesCurveVariable->address().uiText());
|
||||
m_yValuesUiFilterResultSelection = m_yValuesCurveVariable->address();
|
||||
|
||||
m_xValuesSelectedVariableDisplayField = QString::fromStdString(m_xValuesCurveVariable->address().uiText());
|
||||
m_xValuesUiFilterResultSelection = m_xValuesCurveVariable->address();
|
||||
m_yValuesSummaryAddressUiField = m_yValuesSummaryAddress->address();
|
||||
m_xValuesSummaryAddressUiField = m_xValuesSummaryAddress->address();
|
||||
|
||||
updateConnectedEditors();
|
||||
|
||||
@@ -615,7 +623,7 @@ void RimSummaryCurve::defineEditorAttribute(const caf::PdmFieldHandle* field, QS
|
||||
caf::PdmUiPushButtonEditorAttribute* attrib = dynamic_cast<caf::PdmUiPushButtonEditorAttribute*> (attribute);
|
||||
if (attrib)
|
||||
{
|
||||
attrib->m_buttonText = "Vector Selection Dialog";
|
||||
attrib->m_buttonText = "...";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -629,18 +637,12 @@ void RimSummaryCurve::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
|
||||
{
|
||||
QString curveDataGroupName = "Summary Vector";
|
||||
if (isCrossPlotCurve()) curveDataGroupName += " Y";
|
||||
if ( isCrossPlotCurve() ) curveDataGroupName += " Y";
|
||||
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroupWithKeyword(curveDataGroupName, "Summary Vector Y");
|
||||
curveDataGroup->add(&m_yValuesSummaryCase);
|
||||
curveDataGroup->add(&m_yValuesSelectedVariableDisplayField);
|
||||
curveDataGroup->add(&m_plotAxis);
|
||||
curveDataGroup->add(&m_yPushButtonSelectSummaryAddress);
|
||||
|
||||
QString curveVarSelectionGroupName = "Vector Selection Filter Y";
|
||||
caf::PdmUiGroup* curveVarSelectionGroup = curveDataGroup->addNewGroupWithKeyword("Vector Selection Filter", curveVarSelectionGroupName);
|
||||
curveVarSelectionGroup->setCollapsedByDefault(true);
|
||||
m_yValuesSummaryFilter->uiOrdering(uiConfigName, *curveVarSelectionGroup);
|
||||
curveVarSelectionGroup->add(&m_yValuesUiFilterResultSelection);
|
||||
curveDataGroup->add(&m_yValuesSummaryCase, { true, 3, 1 });
|
||||
curveDataGroup->add(&m_yValuesSummaryAddressUiField, { true, 2, 1 });
|
||||
curveDataGroup->add(&m_yPushButtonSelectSummaryAddress, { false, 1, 0 });
|
||||
curveDataGroup->add(&m_plotAxis, { true, 3, 1 });
|
||||
|
||||
if (isCrossPlotCurve()) m_showErrorBars = false;
|
||||
else curveDataGroup->add(&m_showErrorBars);
|
||||
@@ -649,14 +651,9 @@ void RimSummaryCurve::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
if (isCrossPlotCurve())
|
||||
{
|
||||
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup("Summary Vector X");
|
||||
curveDataGroup->add(&m_xValuesSummaryCase);
|
||||
curveDataGroup->add(&m_xValuesSelectedVariableDisplayField);
|
||||
curveDataGroup->add(&m_xPushButtonSelectSummaryAddress);
|
||||
|
||||
caf::PdmUiGroup* curveVarSelectionGroup = curveDataGroup->addNewGroupWithKeyword("Vector Selection Filter", "Vector Selection Filter X");
|
||||
curveVarSelectionGroup->setCollapsedByDefault(true);
|
||||
m_xValuesSummaryFilter->uiOrdering(uiConfigName, *curveVarSelectionGroup);
|
||||
curveVarSelectionGroup->add(&m_xValuesUiFilterResultSelection);
|
||||
curveDataGroup->add(&m_xValuesSummaryCase, { true, 3, 1 });
|
||||
curveDataGroup->add(&m_xValuesSummaryAddressUiField, { true, 2, 1 });
|
||||
curveDataGroup->add(&m_xPushButtonSelectSummaryAddress, { false, 1, 0});
|
||||
}
|
||||
|
||||
caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup("Appearance");
|
||||
@@ -773,7 +770,7 @@ void RimSummaryCurve::applyCurveAutoNameSettings(const RimSummaryCurveAutoName&
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimSummaryCurve::curveExportDescription(const RifEclipseSummaryAddress& address) const
|
||||
{
|
||||
auto addr = address.isValid() ? address : m_yValuesCurveVariable->address();
|
||||
auto addr = address.isValid() ? address : m_yValuesSummaryAddress->address();
|
||||
|
||||
RimEnsembleCurveSetCollection* coll;
|
||||
firstAncestorOrThisOfType(coll);
|
||||
@@ -781,17 +778,24 @@ QString RimSummaryCurve::curveExportDescription(const RifEclipseSummaryAddress&
|
||||
auto curveSet = coll ? coll->findRimCurveSetFromQwtCurve(m_qwtPlotCurve) : nullptr;
|
||||
auto group = curveSet ? curveSet->summaryCaseCollection() : nullptr;
|
||||
|
||||
auto addressUiText = addr.uiText();
|
||||
if (addr.category() == RifEclipseSummaryAddress::SUMMARY_ENSEMBLE_STATISTICS)
|
||||
{
|
||||
addressUiText = RiaStatisticsTools::replacePercentileByPValueText(QString::fromStdString(addressUiText)).toStdString();
|
||||
|
||||
}
|
||||
|
||||
if (group && group->isEnsemble())
|
||||
{
|
||||
return QString("%1.%2.%3")
|
||||
.arg(QString::fromStdString(addr.uiText()))
|
||||
.arg(QString::fromStdString(addressUiText))
|
||||
.arg(m_yValuesSummaryCase->caseName())
|
||||
.arg(group->name());
|
||||
}
|
||||
else
|
||||
{
|
||||
return QString("%1.%2")
|
||||
.arg(QString::fromStdString(addr.uiText()))
|
||||
.arg(QString::fromStdString(addressUiText))
|
||||
.arg(m_yValuesSummaryCase->caseName());
|
||||
}
|
||||
}
|
||||
@@ -812,7 +816,7 @@ void RimSummaryCurve::setCurveAppearanceFromCaseType()
|
||||
}
|
||||
}
|
||||
|
||||
if (m_yValuesCurveVariable && m_yValuesCurveVariable->address().isHistoryQuantity())
|
||||
if (m_yValuesSummaryAddress && m_yValuesSummaryAddress->address().isHistoryQuantity())
|
||||
{
|
||||
RiaPreferences* prefs = RiaApplication::instance()->preferences();
|
||||
|
||||
@@ -842,7 +846,7 @@ void RimSummaryCurve::setCurveAppearanceFromCaseType()
|
||||
void RimSummaryCurve::markCachedDataForPurge()
|
||||
{
|
||||
auto reader = valuesSummaryReaderY();
|
||||
if(reader) reader->markForCachePurge(m_yValuesCurveVariable->address());
|
||||
if(reader) reader->markForCachePurge(m_yValuesSummaryAddress->address());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -867,22 +871,22 @@ void RimSummaryCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
bool loadAndUpdate = false;
|
||||
bool crossPlotTestForMatchingTimeSteps = false;
|
||||
|
||||
if(changedField == &m_yValuesUiFilterResultSelection)
|
||||
if(changedField == &m_yValuesSummaryAddressUiField)
|
||||
{
|
||||
m_yValuesCurveVariable->setAddress(m_yValuesUiFilterResultSelection());
|
||||
m_yValuesSummaryAddress->setAddress(m_yValuesSummaryAddressUiField());
|
||||
|
||||
this->calculateCurveInterpolationFromAddress();
|
||||
|
||||
loadAndUpdate = true;
|
||||
}
|
||||
else if (changedField == &m_xValuesUiFilterResultSelection)
|
||||
else if(changedField == &m_xValuesSummaryAddressUiField)
|
||||
{
|
||||
m_xValuesCurveVariable->setAddress(m_xValuesUiFilterResultSelection());
|
||||
m_xValuesSummaryAddress->setAddress(m_xValuesSummaryAddressUiField());
|
||||
|
||||
this->calculateCurveInterpolationFromAddress();
|
||||
|
||||
loadAndUpdate = true;
|
||||
}
|
||||
}
|
||||
else if (&m_showCurve == changedField)
|
||||
{
|
||||
plot->updateAxes();
|
||||
@@ -919,7 +923,7 @@ void RimSummaryCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
{
|
||||
RiuSummaryCurveDefSelectionDialog dlg(nullptr);
|
||||
RimSummaryCase* candidateCase = m_yValuesSummaryCase();
|
||||
RifEclipseSummaryAddress candicateAddress = m_yValuesCurveVariable->address();
|
||||
RifEclipseSummaryAddress candicateAddress = m_yValuesSummaryAddress->address();
|
||||
|
||||
if (candidateCase == nullptr)
|
||||
{
|
||||
@@ -928,7 +932,7 @@ void RimSummaryCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
|
||||
if (!candicateAddress.isValid())
|
||||
{
|
||||
candicateAddress = m_xValuesCurveVariable->address();
|
||||
candicateAddress = m_xValuesSummaryAddress->address();
|
||||
}
|
||||
|
||||
dlg.hideEnsembles();
|
||||
@@ -940,7 +944,7 @@ void RimSummaryCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
if (curveSelection.size() > 0)
|
||||
{
|
||||
m_yValuesSummaryCase = curveSelection[0].summaryCase();
|
||||
m_yValuesCurveVariable->setAddress(curveSelection[0].summaryAddress());
|
||||
m_yValuesSummaryAddress->setAddress(curveSelection[0].summaryAddress());
|
||||
|
||||
crossPlotTestForMatchingTimeSteps = true;
|
||||
loadAndUpdate = true;
|
||||
@@ -953,7 +957,7 @@ void RimSummaryCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
{
|
||||
RiuSummaryCurveDefSelectionDialog dlg(nullptr);
|
||||
RimSummaryCase* candidateCase = m_xValuesSummaryCase();
|
||||
RifEclipseSummaryAddress candicateAddress = m_xValuesCurveVariable->address();
|
||||
RifEclipseSummaryAddress candicateAddress = m_xValuesSummaryAddress->address();
|
||||
|
||||
if (candidateCase == nullptr)
|
||||
{
|
||||
@@ -962,7 +966,7 @@ void RimSummaryCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
|
||||
if (!candicateAddress.isValid())
|
||||
{
|
||||
candicateAddress = m_yValuesCurveVariable->address();
|
||||
candicateAddress = m_yValuesSummaryAddress->address();
|
||||
}
|
||||
|
||||
dlg.hideEnsembles();
|
||||
@@ -974,7 +978,7 @@ void RimSummaryCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
if (curveSelection.size() > 0)
|
||||
{
|
||||
m_xValuesSummaryCase = curveSelection[0].summaryCase();
|
||||
m_xValuesCurveVariable->setAddress(curveSelection[0].summaryAddress());
|
||||
m_xValuesSummaryAddress->setAddress(curveSelection[0].summaryAddress());
|
||||
|
||||
crossPlotTestForMatchingTimeSteps = true;
|
||||
loadAndUpdate = true;
|
||||
@@ -1100,7 +1104,7 @@ const std::vector<time_t>& RimSummaryCurve::timeStepsX() const
|
||||
|
||||
if (!reader) return emptyVector;
|
||||
|
||||
RifEclipseSummaryAddress addr = m_xValuesCurveVariable()->address();
|
||||
RifEclipseSummaryAddress addr = m_xValuesSummaryAddress()->address();
|
||||
|
||||
return reader->timeSteps(addr);
|
||||
}
|
||||
@@ -1110,9 +1114,9 @@ const std::vector<time_t>& RimSummaryCurve::timeStepsX() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCurve::calculateCurveInterpolationFromAddress()
|
||||
{
|
||||
if (m_yValuesCurveVariable())
|
||||
if (m_yValuesSummaryAddress())
|
||||
{
|
||||
auto address = m_yValuesCurveVariable()->address();
|
||||
auto address = m_yValuesSummaryAddress()->address();
|
||||
if (address.hasAccumulatedData())
|
||||
{
|
||||
m_curveInterpolation = RiuQwtPlotCurve::INTERPOLATION_POINT_TO_POINT;
|
||||
|
||||
@@ -118,21 +118,22 @@ private:
|
||||
private:
|
||||
// Y values
|
||||
caf::PdmPtrField<RimSummaryCase*> m_yValuesSummaryCase;
|
||||
caf::PdmChildField<RimSummaryAddress*> m_yValuesCurveVariable;
|
||||
caf::PdmField<QString> m_yValuesSelectedVariableDisplayField;
|
||||
caf::PdmChildField<RimSummaryFilter*> m_yValuesSummaryFilter;
|
||||
caf::PdmField<RifEclipseSummaryAddress> m_yValuesUiFilterResultSelection;
|
||||
caf::PdmChildField<RimSummaryAddress*> m_yValuesSummaryAddress;
|
||||
caf::PdmField<RifEclipseSummaryAddress> m_yValuesSummaryAddressUiField;
|
||||
caf::PdmField<bool> m_yPushButtonSelectSummaryAddress;
|
||||
|
||||
// X values
|
||||
caf::PdmPtrField<RimSummaryCase*> m_xValuesSummaryCase;
|
||||
caf::PdmChildField<RimSummaryAddress*> m_xValuesCurveVariable;
|
||||
caf::PdmField<QString> m_xValuesSelectedVariableDisplayField;
|
||||
caf::PdmChildField<RimSummaryFilter*> m_xValuesSummaryFilter;
|
||||
caf::PdmField<RifEclipseSummaryAddress> m_xValuesUiFilterResultSelection;
|
||||
caf::PdmChildField<RimSummaryAddress*> m_xValuesSummaryAddress;
|
||||
caf::PdmField<RifEclipseSummaryAddress> m_xValuesSummaryAddressUiField;
|
||||
caf::PdmField<bool> m_xPushButtonSelectSummaryAddress;
|
||||
|
||||
caf::PdmChildField<RimSummaryCurveAutoName*> m_curveNameConfig;
|
||||
caf::PdmField<caf::AppEnum< RiaDefines::PlotAxis>> m_plotAxis;
|
||||
caf::PdmField<bool> m_isTopZWithinCategory;
|
||||
|
||||
|
||||
// Obsolete fields
|
||||
caf::PdmChildField<RimSummaryFilter*> m_yValuesSummaryFilter_OBSOLETE;
|
||||
caf::PdmChildField<RimSummaryFilter*> m_xValuesSummaryFilter_OBSOLETE;
|
||||
};
|
||||
|
||||
@@ -140,6 +140,9 @@ RimSummaryPlot::RimSummaryPlot()
|
||||
CAF_PDM_InitField(&m_useAutoPlotTitle, "IsUsingAutoName", true, "Auto Name", "", "", "");
|
||||
m_useAutoPlotTitle.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||
|
||||
CAF_PDM_InitField(&m_normalizeCurveYValues, "normalizeCurveYValues", false, "Normalize all curves", "", "", "");
|
||||
m_normalizeCurveYValues.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_curveFilters_OBSOLETE, "SummaryCurveFilters", "", "", "", "");
|
||||
m_curveFilters_OBSOLETE.uiCapability()->setUiTreeHidden(true);
|
||||
|
||||
@@ -635,6 +638,22 @@ bool RimSummaryPlot::applyFontSize(RiaDefines::FontSettingType fontSettingType,
|
||||
return anyChange;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::setNormalizationEnabled(bool enable)
|
||||
{
|
||||
m_normalizeCurveYValues = enable;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSummaryPlot::isNormalizationEnabled()
|
||||
{
|
||||
return m_normalizeCurveYValues();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1227,6 +1246,11 @@ void RimSummaryPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
||||
c->updateCurveNameNoLegendUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
if (changedField == &m_normalizeCurveYValues)
|
||||
{
|
||||
this->loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1510,6 +1534,8 @@ void RimSummaryPlot::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
uiOrdering.add(&m_legendFontSize);
|
||||
}
|
||||
|
||||
uiOrdering.add(&m_normalizeCurveYValues);
|
||||
|
||||
m_userDefinedPlotTitle.uiCapability()->setUiReadOnly(m_useAutoPlotTitle);
|
||||
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
@@ -1794,6 +1820,14 @@ caf::PdmObject* RimSummaryPlot::findRimPlotObjectFromQwtCurve(const QwtPlotCurve
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::showLegend(bool enable)
|
||||
{
|
||||
m_showLegend = enable;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1809,7 +1843,8 @@ void RimSummaryPlot::defineEditorAttribute(const caf::PdmFieldHandle* field, QSt
|
||||
{
|
||||
if (field == &m_showLegend ||
|
||||
field == &m_showPlotTitle ||
|
||||
field == &m_useAutoPlotTitle)
|
||||
field == &m_useAutoPlotTitle ||
|
||||
field == &m_normalizeCurveYValues)
|
||||
{
|
||||
caf::PdmUiCheckBoxEditorAttribute* myAttr = dynamic_cast<caf::PdmUiCheckBoxEditorAttribute*>(attribute);
|
||||
if (myAttr)
|
||||
|
||||
@@ -140,6 +140,9 @@ public:
|
||||
bool hasCustomFontSizes(RiaDefines::FontSettingType fontSettingType, int defaultFontSize) const override;
|
||||
bool applyFontSize(RiaDefines::FontSettingType fontSettingType, int oldFontSize, int fontSize, bool forceChange = false) override;
|
||||
|
||||
void setNormalizationEnabled(bool enable);
|
||||
bool isNormalizationEnabled();
|
||||
void showLegend(bool enable);
|
||||
public:
|
||||
// Rim2dPlotInterface overrides
|
||||
void updateAxisScaling() override;
|
||||
@@ -194,6 +197,8 @@ private:
|
||||
private:
|
||||
caf::PdmField<bool> m_showPlotTitle;
|
||||
caf::PdmField<bool> m_showLegend;
|
||||
caf::PdmField<bool> m_normalizeCurveYValues;
|
||||
|
||||
caf::PdmField<int> m_legendFontSize;
|
||||
|
||||
caf::PdmField<bool> m_useAutoPlotTitle;
|
||||
|
||||
@@ -301,8 +301,7 @@ bool RimSummaryTimeAxisProperties::isActive() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QDateTime RimSummaryTimeAxisProperties::visibleDateTimeMin() const
|
||||
{
|
||||
QDateTime fullMin(m_visibleDateRangeMin(), m_visibleTimeRangeMin());
|
||||
return fullMin;
|
||||
return RiaQDateTimeTools::createUtcDateTime(m_visibleDateRangeMin(), m_visibleTimeRangeMin());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -310,8 +309,7 @@ QDateTime RimSummaryTimeAxisProperties::visibleDateTimeMin() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QDateTime RimSummaryTimeAxisProperties::visibleDateTimeMax() const
|
||||
{
|
||||
QDateTime fullMax(m_visibleDateRangeMax(), m_visibleTimeRangeMax());
|
||||
return fullMax;
|
||||
return RiaQDateTimeTools::createUtcDateTime(m_visibleDateRangeMax(), m_visibleTimeRangeMax());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -991,7 +991,13 @@ std::vector<RigEclipseResultAddress> RigCaseCellResultsData::existingResults() c
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RigEclipseResultInfo* RigCaseCellResultsData::resultInfo(const RigEclipseResultAddress& resVarAddr) const
|
||||
{
|
||||
return &(m_resultInfos[findScalarResultIndexFromAddress(resVarAddr)]);
|
||||
size_t index = findScalarResultIndexFromAddress(resVarAddr);
|
||||
if (index < m_resultInfos.size())
|
||||
{
|
||||
return &(m_resultInfos[index]);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -22,6 +22,8 @@ public:
|
||||
QVariant toUiBasedQVariant() const override;
|
||||
|
||||
private:
|
||||
bool isQVariantDataEqual(const QVariant& oldUiBasedQVariant, const QVariant& newUiBasedQVariant) const override;
|
||||
|
||||
mutable QList<PdmOptionItemInfo> m_optionEntryCache;
|
||||
|
||||
private:
|
||||
|
||||
@@ -247,6 +247,15 @@ QVariant caf::PdmFieldUiCap<FieldType>::toUiBasedQVariant() const
|
||||
return PdmUiFieldSpecialization<typename FieldType::FieldDataType>::convert(m_field->value());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
template < typename FieldType>
|
||||
bool caf::PdmFieldUiCap<FieldType>::isQVariantDataEqual(const QVariant& oldUiBasedQVariant, const QVariant& newUiBasedQVariant) const
|
||||
{
|
||||
return PdmUiFieldSpecialization<typename FieldType::FieldDataType>::isDataElementEqual(oldUiBasedQVariant, newUiBasedQVariant);
|
||||
}
|
||||
|
||||
|
||||
} // End of namespace caf
|
||||
|
||||
|
||||
@@ -52,9 +52,8 @@ QList<caf::PdmOptionItemInfo> PdmUiFieldHandle::valueOptions(bool* useOptionsOnl
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmUiFieldHandle::notifyFieldChanged(const QVariant& oldFieldValue, const QVariant& newFieldValue)
|
||||
{
|
||||
// Todo : Should use a virtual version of isElementEqual. The variant != operation will not work on user types
|
||||
|
||||
if (oldFieldValue != newFieldValue)
|
||||
if (!this->isQVariantDataEqual( oldFieldValue, newFieldValue))
|
||||
{
|
||||
PdmFieldHandle* fieldHandle = this->fieldHandle();
|
||||
CAF_ASSERT(fieldHandle && fieldHandle->ownerObject());
|
||||
@@ -126,6 +125,15 @@ void PdmUiFieldHandle::setAutoAddingOptionFromValue(bool isAddingValue)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmUiFieldHandle::setValueFromUiEditor(const QVariant& uiValue) {}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool PdmUiFieldHandle::isQVariantDataEqual(const QVariant& oldUiBasedQVariant, const QVariant& newUiBasedQVariant) const
|
||||
{
|
||||
CAF_ASSERT(false);
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Implementation of uiCapability() defined in cafPdmFieldHandle.h
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -31,6 +31,8 @@ private:
|
||||
friend class PdmUiCommandSystemProxy;
|
||||
friend class CmdFieldChangeExec;
|
||||
virtual void setValueFromUiEditor(const QVariant& uiValue);
|
||||
// This is needed to handle custom types in QVariants since operator == between QVariant does not work when they use custom types.
|
||||
virtual bool isQVariantDataEqual(const QVariant& oldUiBasedQVariant, const QVariant& newUiBasedQVariant) const;
|
||||
|
||||
private:
|
||||
PdmFieldHandle* m_owner;
|
||||
|
||||
@@ -56,6 +56,12 @@
|
||||
#include <QPalette>
|
||||
#include <QStatusBar>
|
||||
#include <QString>
|
||||
#include <QCompleter>
|
||||
#include <QStringListModel>
|
||||
#include <QAbstractProxyModel>
|
||||
#include <QAbstractItemView>
|
||||
#include <QDebug>
|
||||
|
||||
|
||||
namespace caf
|
||||
{
|
||||
@@ -111,8 +117,8 @@ void PdmUiLineEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
|
||||
m_lineEdit->setToolTip(uiField()->uiToolTip(uiConfigName));
|
||||
|
||||
PdmUiLineEditorAttribute leab;
|
||||
{
|
||||
PdmUiLineEditorAttribute leab;
|
||||
caf::PdmUiObjectHandle* uiObject = uiObj(uiField()->fieldHandle()->ownerObject());
|
||||
if (uiObject)
|
||||
{
|
||||
@@ -126,31 +132,58 @@ void PdmUiLineEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
|
||||
m_lineEdit->setAvoidSendingEnterEventToParentWidget(leab.avoidSendingEnterEventToParentWidget);
|
||||
}
|
||||
|
||||
|
||||
bool fromMenuOnly = true;
|
||||
QList<PdmOptionItemInfo> enumNames = uiField()->valueOptions(&fromMenuOnly);
|
||||
m_optionCache = uiField()->valueOptions(&fromMenuOnly);
|
||||
CAF_ASSERT(fromMenuOnly); // Not supported
|
||||
|
||||
if (!enumNames.isEmpty() && fromMenuOnly == true)
|
||||
if (!m_optionCache.isEmpty() && fromMenuOnly == true)
|
||||
{
|
||||
if (!m_completer)
|
||||
{
|
||||
m_completer = new QCompleter(this);
|
||||
m_completerTextList = new QStringListModel( this);
|
||||
|
||||
m_completer->setModel(m_completerTextList);
|
||||
m_completer->setFilterMode( leab.completerFilterMode );
|
||||
m_completer->setCaseSensitivity( leab.completerCaseSensitivity);
|
||||
|
||||
m_lineEdit->setCompleter(m_completer);
|
||||
connect(m_completer, SIGNAL(activated(const QModelIndex&)), this, SLOT(slotCompleterActivated(const QModelIndex&)));
|
||||
m_completer->popup()->installEventFilter(this);
|
||||
}
|
||||
|
||||
QStringList optionNames;
|
||||
for (const PdmOptionItemInfo& item: m_optionCache)
|
||||
{
|
||||
optionNames.push_back(item.optionUiText());
|
||||
}
|
||||
|
||||
m_completerTextList->setStringList(optionNames);
|
||||
|
||||
int enumValue = uiField()->uiValue().toInt();
|
||||
|
||||
if (enumValue < enumNames.size() && enumValue > -1)
|
||||
if (enumValue < m_optionCache.size() && enumValue > -1)
|
||||
{
|
||||
m_lineEdit->setText(enumNames[enumValue].optionUiText());
|
||||
m_lineEdit->setText(m_optionCache[enumValue].optionUiText());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
PdmUiLineEditorAttributeUiDisplayString leab;
|
||||
m_lineEdit->setCompleter(nullptr);
|
||||
delete m_completerTextList;
|
||||
delete m_completer;
|
||||
m_optionCache.clear();
|
||||
|
||||
PdmUiLineEditorAttributeUiDisplayString displayStringAttrib;
|
||||
caf::PdmUiObjectHandle* uiObject = uiObj(uiField()->fieldHandle()->ownerObject());
|
||||
if (uiObject)
|
||||
{
|
||||
uiObject->editorAttribute(uiField()->fieldHandle(), uiConfigName, &leab);
|
||||
uiObject->editorAttribute(uiField()->fieldHandle(), uiConfigName, &displayStringAttrib);
|
||||
}
|
||||
|
||||
QString displayString;
|
||||
if (leab.m_displayString.isEmpty())
|
||||
if (displayStringAttrib.m_displayString.isEmpty())
|
||||
{
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) && QT_VERSION < QT_VERSION_CHECK(5, 9, 0))
|
||||
bool valueOk = false;
|
||||
@@ -171,7 +204,7 @@ void PdmUiLineEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
}
|
||||
else
|
||||
{
|
||||
displayString = leab.m_displayString;
|
||||
displayString = displayStringAttrib.m_displayString;
|
||||
}
|
||||
|
||||
m_lineEdit->setText(displayString);
|
||||
@@ -203,9 +236,50 @@ QMargins PdmUiLineEditor::calculateLabelContentMargins() const
|
||||
void PdmUiLineEditor::slotEditingFinished()
|
||||
{
|
||||
QVariant v;
|
||||
QString textValue = m_lineEdit->text();
|
||||
v = textValue;
|
||||
this->setValueToField(v);
|
||||
|
||||
if (m_optionCache.size())
|
||||
{
|
||||
int index = findIndexToOption(m_lineEdit->text());
|
||||
if (index > -1)
|
||||
{
|
||||
v = QVariant(static_cast<unsigned int>(index));
|
||||
this->setValueToField(v);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Try to complete the text in the widget
|
||||
|
||||
QModelIndex sourceindex = static_cast<QAbstractProxyModel*>(m_completer->completionModel())->mapToSource(m_completer->currentIndex());
|
||||
|
||||
if ( sourceindex.isValid() )
|
||||
{
|
||||
int currentRow = sourceindex.row();
|
||||
{
|
||||
// If the existing value in the field is the same as the completer will hit, we need to echo the
|
||||
// choice into the text field because the field values are equal, so the normal echoing is considered unneccessary by the caf system.
|
||||
int currentFieldIndexValue = uiField()->uiValue().toInt();
|
||||
if ( currentRow == currentFieldIndexValue )
|
||||
{
|
||||
m_lineEdit->setText(m_completer->completionModel()->data(m_completer->currentIndex()).toString());
|
||||
}
|
||||
}
|
||||
|
||||
v = QVariant(static_cast<unsigned int>(sourceindex.row()));
|
||||
this->setValueToField(v);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Revert to value stored in the PdmField, because we didn't find any matches
|
||||
this->updateUi();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QString textValue = m_lineEdit->text();
|
||||
v = textValue;
|
||||
this->setValueToField(v);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -240,7 +314,6 @@ bool PdmUiLineEditor::isMultipleFieldsWithSameKeywordSelected(PdmFieldHandle* ed
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -274,6 +347,57 @@ void PdmUiLineEdit::keyPressEvent(QKeyEvent * event)
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Event filter filtering events to the QCompleter
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool PdmUiLineEditor::eventFilter(QObject *watched, QEvent *event)
|
||||
{
|
||||
if ( event->type() == QEvent::KeyPress )
|
||||
{
|
||||
QKeyEvent * ke = static_cast<QKeyEvent*>(event);
|
||||
|
||||
if (ke->key() == Qt::Key_Return || ke->key() == Qt::Key_Enter)
|
||||
{
|
||||
m_ignoreCompleterActivated = true;
|
||||
this->m_completer->popup()->close();
|
||||
this->slotEditingFinished();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmUiLineEditor::slotCompleterActivated(const QModelIndex& index)
|
||||
{
|
||||
if (m_completer && !m_ignoreCompleterActivated)
|
||||
{
|
||||
slotEditingFinished();
|
||||
}
|
||||
|
||||
m_ignoreCompleterActivated = false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int PdmUiLineEditor::findIndexToOption(const QString& uiText)
|
||||
{
|
||||
QString uiTextTrimmed = uiText.trimmed();
|
||||
for (int idx = 0; idx < m_optionCache.size(); ++idx)
|
||||
{
|
||||
if (uiTextTrimmed == m_optionCache[idx].optionUiText())
|
||||
{
|
||||
return idx;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Define at this location to avoid duplicate symbol definitions in 'cafPdmUiDefaultObjectEditor.cpp' in a cotire build. The
|
||||
// variables defined by the macro are prefixed by line numbers causing a crash if the macro is defined at the same line number.
|
||||
CAF_PDM_UI_FIELD_EDITOR_SOURCE_INIT(PdmUiLineEditor);
|
||||
|
||||
@@ -47,6 +47,8 @@
|
||||
#include <QWidget>
|
||||
|
||||
class QGridLayout;
|
||||
class QCompleter;
|
||||
class QStringListModel;
|
||||
|
||||
namespace caf
|
||||
{
|
||||
@@ -60,11 +62,17 @@ public:
|
||||
PdmUiLineEditorAttribute()
|
||||
{
|
||||
avoidSendingEnterEventToParentWidget = false;
|
||||
completerCaseSensitivity = Qt::CaseSensitive;
|
||||
completerFilterMode = Qt::MatchContains;
|
||||
}
|
||||
|
||||
public:
|
||||
bool avoidSendingEnterEventToParentWidget;
|
||||
bool avoidSendingEnterEventToParentWidget;
|
||||
QPointer<QValidator> validator;
|
||||
|
||||
// Completer setup
|
||||
Qt::CaseSensitivity completerCaseSensitivity;
|
||||
Qt::MatchFlags completerFilterMode;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -80,6 +88,9 @@ public:
|
||||
QString m_displayString;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
class PdmUiLineEdit : public QLineEdit
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -101,7 +112,7 @@ class PdmUiLineEditor : public PdmUiFieldEditorHandle
|
||||
CAF_PDM_UI_FIELD_EDITOR_HEADER_INIT;
|
||||
|
||||
public:
|
||||
PdmUiLineEditor() {}
|
||||
PdmUiLineEditor() : m_ignoreCompleterActivated(false) {}
|
||||
~PdmUiLineEditor() override {}
|
||||
|
||||
protected:
|
||||
@@ -110,16 +121,25 @@ protected:
|
||||
void configureAndUpdateUi(const QString& uiConfigName) override;
|
||||
QMargins calculateLabelContentMargins() const override;
|
||||
|
||||
virtual bool eventFilter(QObject *watched, QEvent *event) override;
|
||||
|
||||
protected slots:
|
||||
void slotEditingFinished();
|
||||
void slotCompleterActivated(const QModelIndex& index);
|
||||
|
||||
private:
|
||||
bool isMultipleFieldsWithSameKeywordSelected(PdmFieldHandle* editorField) const;
|
||||
|
||||
protected:
|
||||
QPointer<PdmUiLineEdit> m_lineEdit;
|
||||
QPointer<QShortenedLabel> m_label;
|
||||
QPointer<PdmUiLineEdit> m_lineEdit;
|
||||
QPointer<QShortenedLabel> m_label;
|
||||
|
||||
QPointer<QCompleter> m_completer;
|
||||
QPointer<QStringListModel> m_completerTextList;
|
||||
QList<PdmOptionItemInfo> m_optionCache;
|
||||
bool m_ignoreCompleterActivated;
|
||||
|
||||
int findIndexToOption(const QString& uiText);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
//
|
||||
//##################################################################################################
|
||||
|
||||
|
||||
#include "cafPdmUiTimeEditor.h"
|
||||
|
||||
#include "cafFactory.h"
|
||||
@@ -43,11 +42,10 @@
|
||||
#include "cafPdmUiDefaultObjectEditor.h"
|
||||
#include "cafPdmUiFieldEditorHandle.h"
|
||||
#include "cafPdmUiOrdering.h"
|
||||
#include "cafSelectionManager.h"
|
||||
#include "cafQShortenedLabel.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDate>
|
||||
#include <QGridLayout>
|
||||
#include <QIntValidator>
|
||||
#include <QLabel>
|
||||
@@ -58,64 +56,69 @@
|
||||
#include <QStatusBar>
|
||||
#include <QString>
|
||||
|
||||
|
||||
namespace caf
|
||||
{
|
||||
CAF_PDM_UI_FIELD_EDITOR_SOURCE_INIT(PdmUiTimeEditor);
|
||||
|
||||
CAF_PDM_UI_FIELD_EDITOR_SOURCE_INIT(PdmUiTimeEditor);
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmUiTimeEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
{
|
||||
CAF_ASSERT(!m_timeEdit.isNull());
|
||||
|
||||
PdmUiFieldEditorHandle::updateLabelFromField(m_label, uiConfigName);
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmUiTimeEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
{
|
||||
CAF_ASSERT(!m_timeEdit.isNull());
|
||||
m_timeEdit->setEnabled(!uiField()->isUiReadOnly(uiConfigName));
|
||||
|
||||
PdmUiFieldEditorHandle::updateLabelFromField(m_label, uiConfigName);
|
||||
caf::PdmUiObjectHandle* uiObject = uiObj(uiField()->fieldHandle()->ownerObject());
|
||||
if (uiObject)
|
||||
{
|
||||
uiObject->editorAttribute(uiField()->fieldHandle(), uiConfigName, &m_attributes);
|
||||
}
|
||||
|
||||
m_timeEdit->setEnabled(!uiField()->isUiReadOnly(uiConfigName));
|
||||
if (!m_attributes.timeFormat.isEmpty())
|
||||
{
|
||||
m_timeEdit->setDisplayFormat(m_attributes.timeFormat);
|
||||
}
|
||||
|
||||
caf::PdmUiObjectHandle* uiObject = uiObj(uiField()->fieldHandle()->ownerObject());
|
||||
if (uiObject)
|
||||
{
|
||||
uiObject->editorAttribute(uiField()->fieldHandle(), uiConfigName, &m_attributes);
|
||||
}
|
||||
m_timeEdit->setTime(uiField()->uiValue().toTime());
|
||||
}
|
||||
|
||||
if (!m_attributes.timeFormat.isEmpty())
|
||||
{
|
||||
m_timeEdit->setDisplayFormat(m_attributes.timeFormat);
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QWidget* PdmUiTimeEditor::createEditorWidget(QWidget* parent)
|
||||
{
|
||||
m_timeEdit = new QTimeEdit(parent);
|
||||
connect(m_timeEdit, SIGNAL(editingFinished()), this, SLOT(slotEditingFinished()));
|
||||
connect(m_timeEdit, SIGNAL(timeChanged(QTime)), this, SLOT(slotTimeChanged(QTime)));
|
||||
return m_timeEdit;
|
||||
}
|
||||
|
||||
m_timeEdit->setDate(uiField()->uiValue().toDate());
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QWidget* PdmUiTimeEditor::createLabelWidget(QWidget* parent)
|
||||
{
|
||||
m_label = new QShortenedLabel(parent);
|
||||
return m_label;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmUiTimeEditor::slotEditingFinished()
|
||||
{
|
||||
this->setValueToField(m_timeEdit->time());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QWidget* PdmUiTimeEditor::createEditorWidget(QWidget* parent)
|
||||
{
|
||||
m_timeEdit = new QTimeEdit(parent);
|
||||
connect(m_timeEdit, SIGNAL(editingFinished()), this, SLOT(slotEditingFinished()));
|
||||
return m_timeEdit;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QWidget* PdmUiTimeEditor::createLabelWidget(QWidget* parent)
|
||||
{
|
||||
m_label = new QShortenedLabel(parent);
|
||||
return m_label;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmUiTimeEditor::slotEditingFinished()
|
||||
{
|
||||
this->setValueToField(m_timeEdit->date());
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmUiTimeEditor::slotTimeChanged(const QTime& time)
|
||||
{
|
||||
this->setValueToField(m_timeEdit->time());
|
||||
}
|
||||
|
||||
} // end namespace caf
|
||||
|
||||
@@ -34,60 +34,56 @@
|
||||
//
|
||||
//##################################################################################################
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafPdmUiFieldEditorHandle.h"
|
||||
|
||||
#include <QTimeEdit>
|
||||
#include <QLabel>
|
||||
#include <QPointer>
|
||||
#include <QString>
|
||||
#include <QTimeEdit>
|
||||
#include <QWidget>
|
||||
|
||||
namespace caf
|
||||
{
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class PdmUiTimeEditorAttribute : public PdmUiEditorAttribute
|
||||
{
|
||||
public:
|
||||
QString timeFormat;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class PdmUiTimeEditorAttribute : public PdmUiEditorAttribute
|
||||
{
|
||||
public:
|
||||
QString timeFormat;
|
||||
public:
|
||||
PdmUiTimeEditorAttribute() {}
|
||||
};
|
||||
|
||||
public:
|
||||
PdmUiTimeEditorAttribute()
|
||||
{
|
||||
}
|
||||
};
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
class PdmUiTimeEditor : public PdmUiFieldEditorHandle
|
||||
{
|
||||
Q_OBJECT
|
||||
CAF_PDM_UI_FIELD_EDITOR_HEADER_INIT;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
class PdmUiTimeEditor : public PdmUiFieldEditorHandle
|
||||
{
|
||||
Q_OBJECT
|
||||
CAF_PDM_UI_FIELD_EDITOR_HEADER_INIT;
|
||||
public:
|
||||
PdmUiTimeEditor() {}
|
||||
~PdmUiTimeEditor() override {}
|
||||
|
||||
public:
|
||||
PdmUiTimeEditor() {}
|
||||
~PdmUiTimeEditor() override {}
|
||||
protected:
|
||||
QWidget* createEditorWidget(QWidget* parent) override;
|
||||
QWidget* createLabelWidget(QWidget* parent) override;
|
||||
void configureAndUpdateUi(const QString& uiConfigName) override;
|
||||
|
||||
protected:
|
||||
QWidget* createEditorWidget(QWidget * parent) override;
|
||||
QWidget* createLabelWidget(QWidget * parent) override;
|
||||
void configureAndUpdateUi(const QString& uiConfigName) override;
|
||||
protected slots:
|
||||
void slotEditingFinished();
|
||||
void slotTimeChanged(const QTime& time);
|
||||
|
||||
protected slots:
|
||||
void slotEditingFinished();
|
||||
|
||||
private:
|
||||
QPointer<QTimeEdit> m_timeEdit;
|
||||
QPointer<QShortenedLabel> m_label;
|
||||
|
||||
PdmUiTimeEditorAttribute m_attributes;
|
||||
};
|
||||
private:
|
||||
QPointer<QTimeEdit> m_timeEdit;
|
||||
QPointer<QShortenedLabel> m_label;
|
||||
|
||||
PdmUiTimeEditorAttribute m_attributes;
|
||||
};
|
||||
|
||||
} // end namespace caf
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
set(RESINSIGHT_MAJOR_VERSION 2019)
|
||||
set(RESINSIGHT_MINOR_VERSION 04)
|
||||
set(RESINSIGHT_MINOR_VERSION 08)
|
||||
set(RESINSIGHT_PATCH_VERSION 0)
|
||||
|
||||
# Opional text with no restrictions
|
||||
@@ -10,7 +10,7 @@ set(RESINSIGHT_VERSION_TEXT "-dev")
|
||||
# Must be unique and increasing within one combination of major/minor/patch version
|
||||
# The uniqueness of this text is independent of RESINSIGHT_VERSION_TEXT
|
||||
# Format of text must be ".xx"
|
||||
set(RESINSIGHT_DEV_VERSION ".05")
|
||||
set(RESINSIGHT_DEV_VERSION ".01")
|
||||
|
||||
# https://github.com/CRAVA/crava/tree/master/libs/nrlib
|
||||
set(NRLIB_GITHUB_SHA "ba35d4359882f1c6f5e9dc30eb95fe52af50fd6f")
|
||||
|
||||
Reference in New Issue
Block a user