//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
void RicNewWellLogPlotTrackFeature::onActionTriggered(bool isChecked)
{
    RimWellLogPlot* wellLogPlot = selectedWellLogPlot();
    if (wellLogPlot)
    {
         RimWellLogTrack* plotTrack = new RimWellLogTrack;
         wellLogPlot->addTrack(plotTrack);
         plotTrack->setDescription(QString("Track %1").arg(wellLogPlot->trackCount()));

         wellLogPlot->updateConnectedEditors();
         RicNewWellLogCurveExtractionFeature::addCurve(plotTrack, NULL, NULL);
    }
}
Example #2
0
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
void RicNewPltPlotFeature::onActionTriggered(bool isChecked)
{
    RimProject* proj = RiaApplication::instance()->project();

    RimPltPlotCollection* pltPlotColl = proj->mainPlotCollection()->pltPlotCollection();
    if (pltPlotColl)
    {
        QString wellPathName;
        RimWellPath* wellPath = nullptr;
        RimSimWellInView* eclipseWell = nullptr;

        if ((wellPath = caf::firstAncestorOfTypeFromSelectedObject<RimWellPath*>()) != nullptr)
        {
            wellPathName = wellPath->name();
        }
        else if ((eclipseWell = caf::firstAncestorOfTypeFromSelectedObject<RimSimWellInView*>()) != nullptr)
        {
            RimWellPath* wellPath = proj->wellPathFromSimWellName(eclipseWell->name());
            if (!wellPath ) return;

            wellPathName = wellPath->name();
        }

        QString plotName = QString(RimWellPltPlot::plotNameFormatString()).arg(wellPathName);

        RimWellPltPlot* pltPlot = new RimWellPltPlot();
        pltPlot->setCurrentWellName(wellPathName);

        RimWellLogTrack* plotTrack = new RimWellLogTrack();
        pltPlot->wellLogPlot()->addTrack(plotTrack);
        plotTrack->setDescription(QString("Track %1").arg(pltPlot->wellLogPlot()->trackCount()));

        pltPlotColl->addPlot(pltPlot);
        pltPlot->setDescription(plotName);

        //pltPlot->applyInitialSelections();
        pltPlot->loadDataAndUpdate();
        pltPlotColl->updateConnectedEditors();

        RiuPlotMainWindowTools::showPlotMainWindow();
        RiuPlotMainWindowTools::setExpanded(plotTrack);
        RiuPlotMainWindowTools::selectAsCurrentItem(pltPlot);
    }
}