mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2049 Curve calc. Add curve calc command to more objects and toolbar
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafSelectionManager.h"
|
||||
#include "cafSelectionManagerTools.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
@@ -35,9 +36,7 @@ CAF_CMD_SOURCE_INIT(RicShowSummaryCurveCalculatorFeature, "RicShowSummaryCurveCa
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicShowSummaryCurveCalculatorFeature::isCommandEnabled()
|
||||
{
|
||||
if (selectedSummaryPlot()) return true;
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -57,19 +56,3 @@ void RicShowSummaryCurveCalculatorFeature::setupActionLook(QAction* actionToSetu
|
||||
actionToSetup->setText("Curve Calculator");
|
||||
actionToSetup->setIcon(QIcon(":/SummaryPlot16x16.png"));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryPlot* RicShowSummaryCurveCalculatorFeature::selectedSummaryPlot() const
|
||||
{
|
||||
RimSummaryPlot* sumPlot = nullptr;
|
||||
|
||||
caf::PdmObject* selObj = dynamic_cast<caf::PdmObject*>(caf::SelectionManager::instance()->selectedItem());
|
||||
if (selObj)
|
||||
{
|
||||
selObj->firstAncestorOrThisOfType(sumPlot);
|
||||
}
|
||||
|
||||
return sumPlot;
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
class RimSummaryPlot;
|
||||
class RimSummaryPlotCollection;
|
||||
class RimSummaryCase;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@@ -33,7 +35,4 @@ protected:
|
||||
virtual bool isCommandEnabled() override;
|
||||
virtual void onActionTriggered( bool isChecked ) override;
|
||||
virtual void setupActionLook(QAction* actionToSetup) override;
|
||||
|
||||
private:
|
||||
RimSummaryPlot* selectedSummaryPlot() const;
|
||||
};
|
||||
|
||||
@@ -285,6 +285,7 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
|
||||
commandIds << "RicPasteSummaryPlotFeature";
|
||||
commandIds << "RicPasteAsciiDataToSummaryPlotFeature";
|
||||
commandIds << "Separator";
|
||||
commandIds << "RicShowSummaryCurveCalculatorFeature";
|
||||
commandIds << "RicNewSummaryPlotFeature";
|
||||
}
|
||||
else if (dynamic_cast<RimWellLogPlot*>(uiItem))
|
||||
@@ -353,6 +354,7 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
|
||||
{
|
||||
if (!dynamic_cast<RimObservedData*>(uiItem))
|
||||
{
|
||||
commandIds << "RicShowSummaryCurveCalculatorFeature";
|
||||
commandIds << "RicNewSummaryPlotFeature";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,6 +267,7 @@ QStringList RiuMainPlotWindow::toolbarCommandIds(const QString& toolbarName)
|
||||
{
|
||||
commandIds << "RicShowMainWindowFeature";
|
||||
commandIds << "RicTilePlotWindowsFeature";
|
||||
commandIds << "RicShowSummaryCurveCalculatorFeature";
|
||||
}
|
||||
|
||||
if (toolbarName.isEmpty() || toolbarName == "View Snapshots")
|
||||
|
||||
Reference in New Issue
Block a user