Skip to content

Commit

Permalink
Merge branch 'dev' into sumo-prototype-a
Browse files Browse the repository at this point in the history
  • Loading branch information
magnesj committed Jun 20, 2024
2 parents fba2002 + 812097c commit d7eb0ff
Show file tree
Hide file tree
Showing 168 changed files with 5,393 additions and 3,429 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ResInsightWithCache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ jobs:
os: windows-2022,
cc: "cl",
cxx: "cl",
build-python-module: false,
execute-unit-tests: false,
execute-pytests: false,
build-python-module: true,
execute-unit-tests: true,
execute-pytests: true,
unity-build: true,
publish-to-pypi: false,
vcpkg-bootstrap: bootstrap-vcpkg.bat,
Expand Down
2 changes: 2 additions & 0 deletions ApplicationLibCode/Application/CMakeLists_files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RiaSeismicDefines.h
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryDefines.h
${CMAKE_CURRENT_LIST_DIR}/RiaLasDefines.h
${CMAKE_CURRENT_LIST_DIR}/RiaOsduDefines.h
${CMAKE_CURRENT_LIST_DIR}/RiaWellFlowDefines.h
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveAddress.h
${CMAKE_CURRENT_LIST_DIR}/RiaFileDownloader.h
Expand Down Expand Up @@ -75,6 +76,7 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryDefines.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaSeismicDefines.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaLasDefines.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaOsduDefines.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaWellFlowDefines.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveAddress.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaFileDownloader.cpp
Expand Down
20 changes: 20 additions & 0 deletions ApplicationLibCode/Application/RiaApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
/////////////////////////////////////////////////////////////////////////////////
#include "RiaApplication.h"

#include "OsduImportCommands/RiaOsduConnector.h"
#include "RiaArgumentParser.h"
#include "RiaBaseDefs.h"
#include "RiaFilePathTools.h"
Expand Down Expand Up @@ -97,6 +98,7 @@

#include "Riu3DMainWindowTools.h"
#include "RiuGuiTheme.h"
#include "RiuMainWindow.h"
#include "RiuViewer.h"
#include "RiuViewerCommands.h"

Expand Down Expand Up @@ -170,6 +172,7 @@ RiaApplication::RiaApplication()
setLastUsedDialogDirectory( "MULTICASEIMPORT", "/" );

m_commandRouter = std::make_unique<RimCommandRouter>();
m_osduConnector = nullptr;
}

//--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -1690,3 +1693,20 @@ bool RiaApplication::generateCode( const QString& fileName, gsl::not_null<QStrin

return true;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiaOsduConnector* RiaApplication::makeOsduConnector()
{
if ( m_osduConnector ) return m_osduConnector;

RiaPreferencesOsdu* osduPreferences = preferences()->osduPreferences();
const QString server = osduPreferences->server();
const QString dataPartitionId = osduPreferences->dataPartitionId();
const QString authority = osduPreferences->authority();
const QString scopes = osduPreferences->scopes();
const QString clientId = osduPreferences->clientId();
m_osduConnector = new RiaOsduConnector( RiuMainWindow::instance(), server, dataPartitionId, authority, scopes, clientId );
return m_osduConnector;
}
6 changes: 5 additions & 1 deletion ApplicationLibCode/Application/RiaApplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class RiuMainWindowBase;
class RiuPlotMainWindow;
class RiuRecentFileActionProvider;
class RiaArgumentParser;
class RiaOsduConnector;

namespace caf
{
Expand Down Expand Up @@ -200,6 +201,8 @@ class RiaApplication
virtual void addToRecentFiles( const QString& fileName ) {}
virtual void showFormattedTextInMessageBoxOrConsole( const QString& errMsg ) = 0;

RiaOsduConnector* makeOsduConnector();

protected:
// Protected implementation specific overrides
virtual void invokeProcessEvents( QEventLoop::ProcessEventsFlags flags = QEventLoop::AllEvents ) = 0;
Expand Down Expand Up @@ -254,5 +257,6 @@ class RiaApplication
bool m_runningWorkerProcess;

private:
static RiaApplication* s_riaApplication;
static RiaApplication* s_riaApplication;
QPointer<RiaOsduConnector> m_osduConnector;
};
75 changes: 75 additions & 0 deletions ApplicationLibCode/Application/RiaOsduDefines.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2024- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////

#include "RiaOsduDefines.h"

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::osduFieldKind()
{
return "osdu:wks:master-data--Field:1.0.0";
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::osduWellKind()
{
return "osdu:wks:master-data--Well:1.*.*";
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::osduWellboreKind()
{
return "osdu:wks:master-data--Wellbore:1.*.*";
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::osduWellboreTrajectoryKind()
{
return "osdu:wks:work-product-component--WellboreTrajectory:1.*.*";
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::osduWellLogKind()
{
return "osdu:wks:work-product-component--WellLog:1.*.*";
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::contentTypeJson()
{
return "application/json";
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::contentTypeParquet()
{
return "application/x-parquet";
}
32 changes: 32 additions & 0 deletions ApplicationLibCode/Application/RiaOsduDefines.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2024- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////

#pragma once

#include <QString>

namespace RiaDefines
{
QString osduFieldKind();
QString osduWellKind();
QString osduWellboreKind();
QString osduWellboreTrajectoryKind();
QString osduWellLogKind();
QString contentTypeJson();
QString contentTypeParquet();
}; // namespace RiaDefines
19 changes: 19 additions & 0 deletions ApplicationLibCode/Application/Tools/RiaColorTables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,25 @@ const caf::ColorTable& RiaColorTables::heatMapPaletteColors()
return colorTable;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const caf::ColorTable& RiaColorTables::curveSetPaletteColors()
{
static std::vector<cvf::Color3ub> colors{
cvf::Color3ub( 255, 131, 140 ), // Old pink
cvf::Color3ub( 210, 176, 112 ), // Light Brown
cvf::Color3ub( 140, 171, 238 ), // Light gray blue
cvf::Color3ub( 130, 255, 120 ), // Light green
cvf::Color3ub( 255, 64, 236 ), // Magenta
cvf::Color3ub( 101, 132, 96 ), // Dark green
};

static caf::ColorTable colorTable = caf::ColorTable( colors );

return colorTable;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions ApplicationLibCode/Application/Tools/RiaColorTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class RiaColorTables
static const caf::ColorTable& waterAndRockPaletteColors();
static const caf::ColorTable& correlationPaletteColors();
static const caf::ColorTable& heatMapPaletteColors();
static const caf::ColorTable& curveSetPaletteColors();

static cvf::Color3f undefinedCellColor();

Expand Down
6 changes: 3 additions & 3 deletions ApplicationLibCode/Application/Tools/RiaQDateTimeTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,12 @@ QDateTime RiaQDateTimeTools::subtractPeriod( const QDateTime& dt, RiaDefines::Da
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QDateTime RiaQDateTimeTools::createDateTime( const QDate& date )
QDateTime RiaQDateTimeTools::createDateTime( const QDate& date, Qt::TimeSpec timeSpec /*= Qt::LocalTime*/ )
{
#if QT_VERSION >= QT_VERSION_CHECK( 5, 14, 0 )
return date.startOfDay();
return date.startOfDay( timeSpec );
#else
return QDateTime( date, QTime( 0, 0 ) );
return QDateTime( date, QTime( 0, 0 ), timeSpec );
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion ApplicationLibCode/Application/Tools/RiaQDateTimeTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class RiaQDateTimeTools
static QDateTime addPeriod( const QDateTime& dt, RiaDefines::DateTimePeriod period );
static QDateTime subtractPeriod( const QDateTime& dt, RiaDefines::DateTimePeriod period );

static QDateTime createDateTime( const QDate& date );
static QDateTime createDateTime( const QDate& date, Qt::TimeSpec timeSpec = Qt::LocalTime );

static QDateTime epoch();

Expand Down
3 changes: 3 additions & 0 deletions ApplicationLibCode/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,9 @@ set(UNITY_EXCLUDE_FILES
ProjectDataModel/RimVfpTableExtractor.cpp
ProjectDataModel/RimVfpPlot.cpp
ProjectDataModel/RiaOpmParserTools.cpp
FileInterface/RifOsduWellPathReader.cpp
FileInterface/RifOsduWellLogReader.cpp
FileInterface/RifByteArrayArrowRandomAccessFile.cpp
)

if(RESINSIGHT_ENABLE_UNITY_BUILD)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@ void RicEditPreferencesFeature::setupActionLook( QAction* actionToSetup )
//--------------------------------------------------------------------------------------------------
std::unique_ptr<RiaPreferences> RicEditPreferencesFeature::clonePreferences( const RiaPreferences* preferences )
{
caf::PdmObjectHandle* pdmClone = preferences->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() );

return std::unique_ptr<RiaPreferences>( dynamic_cast<RiaPreferences*>( pdmClone ) );
return std::unique_ptr<RiaPreferences>( preferences->copyObject<RiaPreferences>() );
}

//--------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#include "RimWellLogTrack.h"

#include "VerticalFlowPerformance/RimCustomVfpPlot.h"
#include "VerticalFlowPerformance/RimVfpPlot.h"

#include "RiuPlotMainWindow.h"
#include "RiuTextDialog.h"
Expand Down Expand Up @@ -194,7 +193,7 @@ bool RicShowPlotDataFeature::isCommandEnabled() const
for ( auto plot : selection )
{
if ( dynamic_cast<RimSummaryPlot*>( plot ) || dynamic_cast<RimWellLogPlot*>( plot ) || dynamic_cast<RimWellLogTrack*>( plot ) ||
dynamic_cast<RimGridCrossPlot*>( plot ) || dynamic_cast<RimVfpPlot*>( plot ) || dynamic_cast<RimCustomVfpPlot*>( plot ) ||
dynamic_cast<RimGridCrossPlot*>( plot ) || dynamic_cast<RimCustomVfpPlot*>( plot ) ||
dynamic_cast<RimWellAllocationOverTimePlot*>( plot ) || dynamic_cast<RimAnalysisPlot*>( plot ) ||
dynamic_cast<RimCorrelationMatrixPlot*>( plot ) || dynamic_cast<RimAbstractCorrelationPlot*>( plot ) ||
dynamic_cast<RimCorrelationReportPlot*>( plot ) )
Expand Down
3 changes: 1 addition & 2 deletions ApplicationLibCode/Commands/CMakeLists_files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RicImportSummaryCalculationExpressionsFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicImportWellLogCsvFileFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewViewForGridEnsembleFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewVfpPlotFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewCustomVfpPlotFeature.h
)

Expand Down Expand Up @@ -194,8 +193,8 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RicExportSummaryCalculationExpressionsFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicImportSummaryCalculationExpressionsFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicImportWellLogCsvFileFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicImportWellLogOsduFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewViewForGridEnsembleFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewVfpPlotFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewCustomVfpPlotFeature.cpp
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ void RicCopyStandardLegendFeature::onActionTriggered( bool isChecked )
if ( standardLegend )
{
// perform deep copy of standard legend object via XML
RimColorLegend* customLegend = dynamic_cast<RimColorLegend*>(
standardLegend->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );

auto customLegend = standardLegend->copyObject<RimColorLegend>();
customLegend->setColorLegendName( "Copy of " + standardLegend->colorLegendName() );

RimColorLegendCollection* colorLegendCollection = RimProject::current()->colorLegendCollection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ void RicCopyIntersectionsToAllViewsInCaseFeature::copyIntersectionsToOtherViews(
{
RimIntersectionCollection* destCollection = currGridView->intersectionCollection();

RimExtrudedCurveIntersection* copy = dynamic_cast<RimExtrudedCurveIntersection*>(
intersection->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );
auto copy = intersection->copyObject<RimExtrudedCurveIntersection>();
CVF_ASSERT( copy );

destCollection->appendIntersectionAndUpdate( copy, false );
Expand Down Expand Up @@ -150,8 +149,7 @@ void RicCopyIntersectionsToAllViewsInCaseFeature::copyIntersectionBoxesToOtherVi
{
RimIntersectionCollection* destCollection = currGridView->intersectionCollection();

RimBoxIntersection* copy = dynamic_cast<RimBoxIntersection*>(
intersectionBox->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );
auto copy = intersectionBox->copyObject<RimBoxIntersection>();
CVF_ASSERT( copy );

destCollection->appendIntersectionBoxAndUpdate( copy );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ void RicAdvancedSnapshotExportFeature::exportMultipleSnapshots( const QString& f
RimGeoMechView* sourceGeoMechView = dynamic_cast<RimGeoMechView*>( sourceView );
if ( geomCase && sourceGeoMechView )
{
RimGeoMechView* copyOfGeoMechView = dynamic_cast<RimGeoMechView*>(
sourceGeoMechView->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );
auto copyOfGeoMechView = sourceGeoMechView->copyObject<RimGeoMechView>();
CVF_ASSERT( copyOfGeoMechView );

geomCase->geoMechViews().push_back( copyOfGeoMechView );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ void RicAddStoredFlowCharacteristicsPlotFeature::onActionTriggered( bool isCheck
RimFlowCharacteristicsPlot* sourceObject =
dynamic_cast<RimFlowCharacteristicsPlot*>( caf::SelectionManager::instance()->selectedItem() );

RimFlowCharacteristicsPlot* flowCharacteristicsPlot =
dynamic_cast<RimFlowCharacteristicsPlot*>( sourceObject->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );
auto flowCharacteristicsPlot = sourceObject->copyObject<RimFlowCharacteristicsPlot>();
CVF_ASSERT( flowCharacteristicsPlot );

flowPlotColl->addFlowCharacteristicsPlotToStoredPlots( flowCharacteristicsPlot );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ void RicAddStoredWellAllocationPlotFeature::onActionTriggered( bool isChecked )
{
RimWellAllocationPlot* sourceObject = dynamic_cast<RimWellAllocationPlot*>( caf::SelectionManager::instance()->selectedItem() );

RimWellAllocationPlot* wellAllocationPlot =
dynamic_cast<RimWellAllocationPlot*>( sourceObject->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );

auto wellAllocationPlot = sourceObject->copyObject<RimWellAllocationPlot>();
CVF_ASSERT( wellAllocationPlot );

flowPlotColl->addWellAllocPlotToStoredPlots( wellAllocationPlot );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ void RicCreateDuplicateTemplateInOtherUnitSystemFeature::onActionTriggered( bool
RimFractureTemplate* fractureTemplate = caf::firstAncestorOfTypeFromSelectedObject<RimFractureTemplate>();
if ( !fractureTemplate ) return;

auto copyOfTemplate = dynamic_cast<RimFractureTemplate*>(
fractureTemplate->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );
auto copyOfTemplate = fractureTemplate->copyObject<RimFractureTemplate>();

RimFractureTemplateCollection* fractureTemplateCollection = caf::firstAncestorOfTypeFromSelectedObject<RimFractureTemplateCollection>();
fractureTemplateCollection->addFractureTemplate( copyOfTemplate );
Expand Down
Loading

0 comments on commit d7eb0ff

Please sign in to comment.