2017-11-15 13:45:56 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2017 Statoil ASA
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2017-11-15 13:45:56 -06:00
|
|
|
// 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2017-11-15 13:45:56 -06:00
|
|
|
// 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2017-11-15 13:45:56 -06:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "RicShowGridStatisticsFeature.h"
|
|
|
|
|
|
|
|
#include "RiaApplication.h"
|
|
|
|
#include "RicGridStatisticsDialog.h"
|
2017-11-30 04:10:54 -06:00
|
|
|
#include "RicWellLogTools.h"
|
2017-11-15 13:45:56 -06:00
|
|
|
|
|
|
|
#include "Rim3dOverlayInfoConfig.h"
|
|
|
|
#include "RimEclipseView.h"
|
2017-11-16 07:13:50 -06:00
|
|
|
#include "RimGeoMechView.h"
|
2017-11-30 04:10:54 -06:00
|
|
|
#include "RimProject.h"
|
2017-11-15 13:45:56 -06:00
|
|
|
|
|
|
|
#include "cafSelectionManagerTools.h"
|
|
|
|
|
|
|
|
#include <QAction>
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_CMD_SOURCE_INIT( RicShowGridStatisticsFeature, "RicShowGridStatisticsFeature" );
|
2017-11-15 13:45:56 -06:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-15 13:45:56 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RicShowGridStatisticsFeature::isCommandEnabled()
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( RicWellLogTools::isWellPathOrSimWellSelectedInView() ) return false;
|
|
|
|
|
2018-01-15 07:52:22 -06:00
|
|
|
return RiaApplication::instance()->activeGridView() != nullptr;
|
2017-11-15 13:45:56 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-15 13:45:56 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RicShowGridStatisticsFeature::onActionTriggered( bool isChecked )
|
2017-11-15 13:45:56 -06:00
|
|
|
{
|
2019-10-24 02:29:48 -05:00
|
|
|
RimGridView* activeView = RiaApplication::instance()->activeMainOrComparisonGridView();
|
2017-11-15 13:45:56 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( activeView )
|
2017-11-15 13:45:56 -06:00
|
|
|
{
|
2017-11-20 04:59:04 -06:00
|
|
|
activeView->overlayInfoConfig()->showStatisticsInfoDialog();
|
2017-11-16 07:13:50 -06:00
|
|
|
}
|
2017-11-15 13:45:56 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-15 13:45:56 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RicShowGridStatisticsFeature::setupActionLook( QAction* actionToSetup )
|
2017-11-15 13:45:56 -06:00
|
|
|
{
|
2021-06-10 02:33:22 -05:00
|
|
|
actionToSetup->setText( "Grid Statistics (legacy)" );
|
2019-09-06 03:40:57 -05:00
|
|
|
actionToSetup->setIcon( QIcon( ":/statistics.png" ) ); // Todo: Change icon
|
2017-11-15 13:45:56 -06:00
|
|
|
}
|