Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ApplicationExeCode/Resources/Play.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion ApplicationExeCode/Resources/ResInsight.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,9 @@
<file>arrow-swap.svg</file>
<file>inspect.svg</file>
<file>pin.svg</file>
<file>pinned.svg</file>
<file>Play.svg</file>
<file>gear_icon_16x16.png</file>
<file>pinned.svg</file>
<file>pinned-remove.svg</file>
<file>Select.svg</file>
<file>NavigationProperty.svg</file>
Expand Down
Binary file added ApplicationExeCode/Resources/gear_icon_16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions ApplicationLibCode/Application/Tools/CMakeLists_files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RiaCurveDataTools.h
${CMAKE_CURRENT_LIST_DIR}/RiaWellLogCurveMerger.h
${CMAKE_CURRENT_LIST_DIR}/RiaTimeHistoryCurveResampler.h
${CMAKE_CURRENT_LIST_DIR}/RiaStatisticsTools.h
${CMAKE_CURRENT_LIST_DIR}/RiaOffshoreSphericalCoords.h
${CMAKE_CURRENT_LIST_DIR}/RiaWeightedMeanCalculator.h
${CMAKE_CURRENT_LIST_DIR}/RiaMedianCalculator.h
Expand Down Expand Up @@ -91,7 +90,6 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RiaCurveDataTools.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaWellLogCurveMerger.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaTimeHistoryCurveResampler.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaStatisticsTools.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaWeightedGeometricMeanCalculator.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaWeightedHarmonicMeanCalculator.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaOptionItemFactory.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/////////////////////////////////////////////////////////////////////////////////
#include "RicMswValveAccumulators.h"

#include "RiaStatisticsTools.h"
#include "RigStatisticsTools.h"

#include "RicMswCompletions.h"

Expand Down Expand Up @@ -110,7 +110,7 @@ bool RicMswAICDAccumulator::accumulateValveParameters( const RimWellPathValve* w
std::array<double, AICD_NUM_PARAMS> values = params->doubleValues();
for ( size_t i = 0; i < (size_t)AICD_NUM_PARAMS; ++i )
{
if ( RiaStatisticsTools::isValidNumber( values[i] ) )
if ( RigStatisticsTools::isValidNumber( values[i] ) )
{
m_meanCalculators[i].addValueAndWeight( values[i], overlapLength );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#include "RiaFractureDefines.h"
#include "RiaLogging.h"
#include "RiaPreferencesSystem.h"
#include "RiaStatisticsTools.h"
#include "RiaWeightedMeanCalculator.h"
#include "RigStatisticsTools.h"

#include "ExportCommands/RicExportLgrFeature.h"
#include "RicExportCompletionDataSettingsUi.h"
Expand Down Expand Up @@ -493,7 +493,7 @@ RigCompletionData RicWellPathExportCompletionDataFeatureImpl::combineEclipseCell
RiaWeightedMeanCalculator<double> skinFactorCalculator;

auto isValidTransmissibility = []( double transmissibility )
{ return RiaStatisticsTools::isValidNumber<double>( transmissibility ) && transmissibility >= 0.0; };
{ return RigStatisticsTools::isValidNumber<double>( transmissibility ) && transmissibility >= 0.0; };

auto startMD = completions[0].startMD();
auto endMD = completions[0].endMD();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,9 @@ cvf::ref<cvf::UByteArray>
cvf::ref<cvf::UByteArray> visibility = new cvf::UByteArray( totalCellCount );
visibility->setAll( false );

for ( size_t activeCellIdx : activeReservoirCells )
for ( auto activeCellIdx : activeReservoirCells )
{
visibility->set( activeCellIdx, true );
visibility->set( activeCellIdx.value(), true );
}
return visibility;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RicRunJobFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewOpmFlowJobFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicDuplicateJobFeature.h
)

set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RicRunJobFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewOpmFlowJobFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicDuplicateJobFeature.cpp
)

list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
Expand Down
73 changes: 73 additions & 0 deletions ApplicationLibCode/Commands/JobCommands/RicDuplicateJobFeature.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2025 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 "RicDuplicateJobFeature.h"

#include "RicNewOpmFlowJobFeature.h"

#include "Jobs/RimJobCollection.h"
#include "Jobs/RimOpmFlowJob.h"
#include "RimTools.h"

#include "Riu3DMainWindowTools.h"

#include "cafSelectionManager.h"

#include <QAction>
#include <QDir>
#include <QFileInfo>

CAF_CMD_SOURCE_INIT( RicDuplicateJobFeature, "RicDuplicateJobFeature" );

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicDuplicateJobFeature::onActionTriggered( bool isChecked )
{
if ( auto job = dynamic_cast<RimOpmFlowJob*>( caf::SelectionManager::instance()->selectedItem() ) )
{
QString defaultDir = job->mainWorkingDirectory();
QFileInfo fi( defaultDir );
defaultDir = fi.dir().absolutePath();

QString workDir = RicNewOpmFlowJobFeature::workingFolder( defaultDir );
if ( workDir.isEmpty() ) return;

if ( auto copiedJob = job->copyObject<RimOpmFlowJob>() )
{
copiedJob->setWorkingDirectory( workDir );
copiedJob->setName( job->name() + " (copy)" );

auto jobColl = RimTools::jobCollection();
jobColl->addNewJob( copiedJob );

copiedJob->resolveReferencesRecursively();

Riu3DMainWindowTools::selectAsCurrentItem( copiedJob );
}
}
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicDuplicateJobFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon( QIcon( ":/Copy.svg" ) );
actionToSetup->setText( "Duplicate..." );
}
33 changes: 33 additions & 0 deletions ApplicationLibCode/Commands/JobCommands/RicDuplicateJobFeature.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2025 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 "cafCmdFeature.h"

//==================================================================================================
///
//==================================================================================================
class RicDuplicateJobFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;

protected:
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
};
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,13 @@ void RicNewOpmFlowJobFeature::setupActionLook( QAction* actionToSetup )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RicNewOpmFlowJobFeature::workingFolder()
QString RicNewOpmFlowJobFeature::workingFolder( QString defaultDir )
{
// get base directory for our work, should be a new, empty folder somewhere
const QString defaultDirName = "OPM_FLOW_MODELING";
QString defaultDir = RiaApplication::instance()->lastUsedDialogDirectoryWithFallbackToProjectFolder( defaultDirName );
QString baseDir =
if ( defaultDir.isEmpty() )
defaultDir = RiaApplication::instance()->lastUsedDialogDirectoryWithFallbackToProjectFolder( defaultDirName );
QString baseDir =
RiuFileDialogTools::getExistingDirectory( Riu3DMainWindowTools::mainWindowWidget(), "Select Simulation Output Directory", defaultDir );
if ( baseDir.isNull() || baseDir.isEmpty() ) return "";
RiaApplication::instance()->setLastUsedDialogDirectory( defaultDirName, baseDir );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ class RicNewOpmFlowJobFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;

public:
static QString workingFolder( QString defaultDir = "" );
static QString inputDataFile();

protected:
bool isCommandEnabled() const override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;

private:
static QString workingFolder();
static QString inputDataFile();
};
4 changes: 2 additions & 2 deletions ApplicationLibCode/Commands/JobCommands/RicRunJobFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ void RicRunJobFeature::onActionTriggered( bool isChecked )
//--------------------------------------------------------------------------------------------------
void RicRunJobFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon( QIcon( ":/gear.png" ) );
actionToSetup->setText( "Run Job..." );
actionToSetup->setIcon( QIcon( ":/Play.svg" ) );
actionToSetup->setText( "Run..." );
}

//--------------------------------------------------------------------------------------------------
Expand Down
Loading
Loading