mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-24 22:27:55 -05:00
RimEclipseView_exportVisibleCells writes a FLUXNUM/MULTNUM/ACTNUM keyword based on cell visibility in the view and requires an explicit export file. The export keyword reuses RicSaveEclipseInputVisibleCellsUi::ExportKeyword, registered as the Python StrEnum VisibleCellsExportKeyword. RicSaveEclipseInputVisibleCellsFeature::exportVisibleCells() is split out of executeCommand() to return errors via std::expected instead of only logging them. RicfExportVisibleCells resolves the export folder from the command file executor's CELLS export path and forwards to the object method. The hand-written View.export_visible_cells() wrapper is removed since the generated EclipseView method shadows it.
64 lines
2.3 KiB
C++
64 lines
2.3 KiB
C++
/////////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// Copyright (C) 2017- Statoil ASA
|
|
//
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
|
//
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
|
// for more details.
|
|
//
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#pragma once
|
|
|
|
#include "cafCmdFeature.h"
|
|
|
|
#include <expected>
|
|
|
|
class RimEclipseView;
|
|
class RicSaveEclipseInputVisibleCellsUi;
|
|
|
|
//==================================================================================================
|
|
///
|
|
//==================================================================================================
|
|
class RicSaveEclipseInputVisibleCellsFeature : public caf::CmdFeature
|
|
{
|
|
CAF_CMD_HEADER_INIT;
|
|
|
|
public:
|
|
static void openDialogAndExecuteCommand( RimEclipseView* view );
|
|
static void executeCommand( RimEclipseView* view, const RicSaveEclipseInputVisibleCellsUi& exportSettings, const QString& logPrefix );
|
|
static std::expected<void, QString> exportVisibleCells( RimEclipseView* view, const RicSaveEclipseInputVisibleCellsUi& exportSettings );
|
|
|
|
protected:
|
|
bool isCommandEnabled() const override;
|
|
void onActionTriggered( bool isChecked ) override;
|
|
void setupActionLook( QAction* actionToSetup ) override;
|
|
|
|
private:
|
|
RimEclipseView* selectedView() const;
|
|
};
|
|
|
|
//==================================================================================================
|
|
///
|
|
//==================================================================================================
|
|
class RicSaveEclipseInputActiveVisibleCellsFeature : public caf::CmdFeature
|
|
{
|
|
CAF_CMD_HEADER_INIT;
|
|
|
|
protected:
|
|
bool isCommandEnabled() const override;
|
|
void onActionTriggered( bool isChecked ) override;
|
|
void setupActionLook( QAction* actionToSetup ) override;
|
|
|
|
private:
|
|
static RimEclipseView* selectedView();
|
|
};
|