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 "cafPdmObject.h"
|
||||||
#include "cafSelectionManager.h"
|
#include "cafSelectionManager.h"
|
||||||
|
#include "cafSelectionManagerTools.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
|
||||||
@@ -35,9 +36,7 @@ CAF_CMD_SOURCE_INIT(RicShowSummaryCurveCalculatorFeature, "RicShowSummaryCurveCa
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RicShowSummaryCurveCalculatorFeature::isCommandEnabled()
|
bool RicShowSummaryCurveCalculatorFeature::isCommandEnabled()
|
||||||
{
|
{
|
||||||
if (selectedSummaryPlot()) return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -57,19 +56,3 @@ void RicShowSummaryCurveCalculatorFeature::setupActionLook(QAction* actionToSetu
|
|||||||
actionToSetup->setText("Curve Calculator");
|
actionToSetup->setText("Curve Calculator");
|
||||||
actionToSetup->setIcon(QIcon(":/SummaryPlot16x16.png"));
|
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"
|
#include "cafCmdFeature.h"
|
||||||
|
|
||||||
class RimSummaryPlot;
|
class RimSummaryPlot;
|
||||||
|
class RimSummaryPlotCollection;
|
||||||
|
class RimSummaryCase;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
@@ -33,7 +35,4 @@ protected:
|
|||||||
virtual bool isCommandEnabled() override;
|
virtual bool isCommandEnabled() override;
|
||||||
virtual void onActionTriggered( bool isChecked ) override;
|
virtual void onActionTriggered( bool isChecked ) override;
|
||||||
virtual void setupActionLook(QAction* actionToSetup) override;
|
virtual void setupActionLook(QAction* actionToSetup) override;
|
||||||
|
|
||||||
private:
|
|
||||||
RimSummaryPlot* selectedSummaryPlot() const;
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -285,6 +285,7 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
|
|||||||
commandIds << "RicPasteSummaryPlotFeature";
|
commandIds << "RicPasteSummaryPlotFeature";
|
||||||
commandIds << "RicPasteAsciiDataToSummaryPlotFeature";
|
commandIds << "RicPasteAsciiDataToSummaryPlotFeature";
|
||||||
commandIds << "Separator";
|
commandIds << "Separator";
|
||||||
|
commandIds << "RicShowSummaryCurveCalculatorFeature";
|
||||||
commandIds << "RicNewSummaryPlotFeature";
|
commandIds << "RicNewSummaryPlotFeature";
|
||||||
}
|
}
|
||||||
else if (dynamic_cast<RimWellLogPlot*>(uiItem))
|
else if (dynamic_cast<RimWellLogPlot*>(uiItem))
|
||||||
@@ -353,6 +354,7 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
|
|||||||
{
|
{
|
||||||
if (!dynamic_cast<RimObservedData*>(uiItem))
|
if (!dynamic_cast<RimObservedData*>(uiItem))
|
||||||
{
|
{
|
||||||
|
commandIds << "RicShowSummaryCurveCalculatorFeature";
|
||||||
commandIds << "RicNewSummaryPlotFeature";
|
commandIds << "RicNewSummaryPlotFeature";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -267,6 +267,7 @@ QStringList RiuMainPlotWindow::toolbarCommandIds(const QString& toolbarName)
|
|||||||
{
|
{
|
||||||
commandIds << "RicShowMainWindowFeature";
|
commandIds << "RicShowMainWindowFeature";
|
||||||
commandIds << "RicTilePlotWindowsFeature";
|
commandIds << "RicTilePlotWindowsFeature";
|
||||||
|
commandIds << "RicShowSummaryCurveCalculatorFeature";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (toolbarName.isEmpty() || toolbarName == "View Snapshots")
|
if (toolbarName.isEmpty() || toolbarName == "View Snapshots")
|
||||||
|
|||||||
Reference in New Issue
Block a user