//-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RicfExportVisibleCells::execute() { if (m_caseId < 0 || m_viewName().isEmpty()) { RiaLogging::error("exportVisibleCells: CaseId or view name not specified"); return; } auto eclipseView = RicfApplicationTools::viewFromCaseIdAndViewName(m_caseId, m_viewName); if (!eclipseView) { RiaLogging::error(QString("exportVisibleCells: Could not find view '%1' in case ID %2").arg(m_viewName).arg(m_caseId)); return; } QString exportFolder = RicfCommandFileExecutor::instance()->getExportPath(RicfCommandFileExecutor::CELLS); if (exportFolder.isNull()) { exportFolder = RiaApplication::instance()->createAbsolutePathFromProjectRelativePath("visibleCells"); } RiaViewRedrawScheduler::instance()->clearViewsScheduledForUpdate(); RicSaveEclipseInputVisibleCellsUi exportSettings; buildExportSettings(exportFolder, &exportSettings); RicSaveEclipseInputVisibleCellsFeature::executeCommand(eclipseView, exportSettings, "exportVisibleCells"); }
//-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RicfExportSimWellFractureCompletions::execute() { RimProject* project = RiaApplication::instance()->project(); RicExportCompletionDataSettingsUi* exportSettings = project->dialogData()->exportCompletionData(); exportSettings->timeStep = m_timeStep; exportSettings->fileSplit = m_fileSplit; exportSettings->compdatExport = m_compdatExport; { bool foundCase = false; for (RimEclipseCase* c : RiaApplication::instance()->project()->activeOilField()->analysisModels->cases()) { if (c->caseId() == m_caseId()) { exportSettings->caseToApply = c; foundCase = true; break; } } if (!foundCase) { RiaLogging::error(QString("exportSimWellCompletions: Could not find case with ID %1").arg(m_caseId())); return; } } QString exportFolder = RicfCommandFileExecutor::instance()->getExportPath(RicfCommandFileExecutor::COMPLETIONS); if (exportFolder.isNull()) { exportFolder = RiaApplication::instance()->createAbsolutePathFromProjectRelativePath("completions"); } exportSettings->folder = exportFolder; std::vector<RimEclipseView*> views; for (Rim3dView* v : exportSettings->caseToApply->views()) { RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>(v); if (eclipseView && eclipseView->name() == m_viewName()) { views.push_back(eclipseView); } } if (views.empty()) { RiaLogging::error(QString("exportSimWellCompletions: Could not find any views named \"%1\" in the case with ID %2").arg(m_viewName).arg(m_caseId())); return; } std::vector<RimSimWellInView*> simWells; if (m_simWellNames().empty()) { for (RimEclipseView* view : views) { for (auto simWell : view->wellCollection()->wells) { if (simWell->showWell()) { simWells.push_back(simWell); } } } } else { for (const QString& wellPathName : m_simWellNames()) { for (RimEclipseView* view : views) { RimSimWellInView* simWell = view->wellCollection()->findWell(wellPathName); if (simWell) { simWells.push_back(simWell); } else { RiaLogging::warning(QString("exportSimWellCompletions: Could not find well with name %1 in view \"%2\" on case with ID %2").arg(wellPathName).arg(m_viewName).arg(m_caseId())); } } } } std::vector<RimWellPath*> wellPaths; RicWellPathExportCompletionDataFeatureImpl::exportCompletions(wellPaths, simWells, *exportSettings); }