#3283 Editable well path. Set default unit system to match grid

This commit is contained in:
Bjørn Erik Jensen
2018-08-28 11:12:05 +02:00
parent d07b7d1456
commit 9ec2bc6922
4 changed files with 43 additions and 28 deletions

View File

@@ -60,14 +60,17 @@ bool RicNewEditableWellPathFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicNewEditableWellPathFeature::onActionTriggered(bool isChecked)
{
if ( RiaApplication::instance()->project() && RiaApplication::instance()->project()->activeOilField() )
RimProject* project = RiaApplication::instance()->project();
if (project && RiaApplication::instance()->project()->activeOilField() )
{
RimWellPathCollection* wellPathCollection = RiaApplication::instance()->project()->activeOilField()->wellPathCollection();
if ( wellPathCollection )
{
std::vector<RimWellPath*> newWellPaths;
newWellPaths.push_back(new RimModeledWellPath());
auto newModeledWellPath = new RimModeledWellPath();
newModeledWellPath->setUnitSystem(project->commonUnitSystemForAllCases());
newWellPaths.push_back(newModeledWellPath);
newWellPaths.back()->setName("UWell-" + QString::number(wellPathCollection->modelledWellPathCount()+1));
wellPathCollection->addWellPaths(newWellPaths);
wellPathCollection->uiCapability()->updateConnectedEditors();