#1842 RFT Plot. Implement property view and RFT plot commands

This commit is contained in:
Bjørn Erik Jensen
2017-09-29 11:24:18 +02:00
parent 536225eb7e
commit 141bfd27d7
16 changed files with 306 additions and 658 deletions

View File

@@ -54,6 +54,7 @@ CAF_CMD_SOURCE_INIT(RicNewRftPlotFeature, "RicNewRftPlotFeature");
bool RicNewRftPlotFeature::isCommandEnabled()
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false;
return true;
int branchIndex;
return (selectedWellLogPlotTrack() != nullptr || selectedWellPath() != nullptr || selectedSimulationWell(&branchIndex) != nullptr) && caseAvailable();
}
@@ -70,12 +71,17 @@ void RicNewRftPlotFeature::onActionTriggered(bool isChecked)
auto rftPlotColl = proj->mainPlotCollection()->rftPlotCollection();
if (rftPlotColl)
{
RiuSelectionItem* selItem = RiuSelectionManager::instance()->selectedItem(RiuSelectionManager::RUI_TEMPORARY);
RiuSimWellSelectionItem* simWellSelItem = dynamic_cast<RiuSimWellSelectionItem*>(selItem);
QString plotName = QString("RFT: %1").arg(simWellSelItem != nullptr ? simWellSelItem->m_simWell->name : QString("(Unknown)"));
std::vector<caf::PdmUiItem*> selectedItems;
caf::SelectionManager::instance()->selectedItems(selectedItems);
// Todo: support other classes as well
RimWellPath* simWellPath = dynamic_cast<RimWellPath*>(selectedItems.front());
QString plotName = QString("RFT: %1").arg(simWellPath != nullptr ? simWellPath->name() : QString("(Unknown)"));
auto plot = new RimWellRftPlot();
rftPlotColl->rftPlots().push_back(plot);
plot->setCurrentWellName(simWellPath->name());
rftPlotColl->addPlot(plot);
plot->setDescription(plotName);
plot->loadDataAndUpdate();