mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-25 14:40:26 -05:00
#13283 OSDU: Add ExistenceKind support and improve well import wizard
- Add ExistenceKind field to OsduWellboreTrajectory struct - Extract ExistenceKind from OSDU trajectory JSON data - Add ExistenceKind field to WellInfo structure - Display ExistenceKind in RimOsduWellPath UI under OSDU group - Add Enter key support for field search in import wizard - Show trajectory count in well import summary page
This commit is contained in:
1 parent
52854c2e86
commit
54e8b59ccf
7 files changed
+47
-3
No files matched your search
@@ -414,10 +414,20 @@ void RiaOsduConnector::parseWellTrajectory( QNetworkReply* reply, const QString&
|
||||
for ( const QJsonValue& value : resultsArray )
|
||||
{
|
||||
QJsonObject resultObj = value.toObject();
|
||||
QString id = resultObj["id"].toString();
|
||||
QString kind = resultObj["kind"].toString();
|
||||
if ( resultObj.isEmpty() ) continue;
|
||||
|
||||
m_wellboreTrajectories[wellboreId].push_back( OsduWellboreTrajectory{ id, kind, wellboreId } );
|
||||
QString id = resultObj["id"].toString();
|
||||
QString kind = resultObj["kind"].toString();
|
||||
QString existenceKind;
|
||||
|
||||
// Safely extract existenceKind from nested data object
|
||||
QJsonObject dataObj = resultObj["data"].toObject();
|
||||
if ( !dataObj.isEmpty() && dataObj.contains( "ExistenceKind" ) )
|
||||
{
|
||||
existenceKind = dataObj["ExistenceKind"].toString();
|
||||
}
|
||||
|
||||
m_wellboreTrajectories[wellboreId].push_back( OsduWellboreTrajectory{ id, kind, wellboreId, existenceKind } );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ struct OsduWellboreTrajectory
|
||||
QString id;
|
||||
QString kind;
|
||||
QString wellboreId;
|
||||
QString existenceKind;
|
||||
};
|
||||
|
||||
struct OsduWellLogChannel
|
||||
|
||||
@@ -91,6 +91,7 @@ void RicWellPathsImportOsduFeature::onActionTriggered( bool isChecked )
|
||||
wellPath->setWellId( w.wellId );
|
||||
wellPath->setWellboreId( w.wellboreId );
|
||||
wellPath->setWellboreTrajectoryId( w.wellboreTrajectoryId );
|
||||
wellPath->setExistenceKind( w.existenceKind );
|
||||
wellPath->setDatumElevationFromOsdu( w.datumElevation );
|
||||
wellPath->setWellPathColor( RiaColorTables::wellPathsPaletteColors().cycledColor3f( colorIndex++ ) );
|
||||
|
||||
|
||||
@@ -508,6 +508,8 @@ void WellSummaryPage::initializePage()
|
||||
{
|
||||
RiuWellImportWizard* wiz = dynamic_cast<RiuWellImportWizard*>( wizard() );
|
||||
|
||||
m_textEdit->clear();
|
||||
|
||||
QMutexLocker lock( &m_mutex );
|
||||
m_pendingWellboreIds.clear();
|
||||
for ( const QString& wellboreId : wiz->selectedWellboreIds() )
|
||||
@@ -544,6 +546,10 @@ void WellSummaryPage::wellboreTrajectoryFinished( const QString& wellboreId, int
|
||||
{
|
||||
m_textEdit->append( QString( "Wellbore '%1': No trajectory found." ).arg( wellbore.value().name ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_textEdit->append( QString( "Wellbore '%1': Found %2 trajectory(ies)." ).arg( wellbore.value().name ).arg( numTrajectories ) );
|
||||
}
|
||||
|
||||
for ( auto w : wellboreTrajectories )
|
||||
{
|
||||
@@ -552,6 +558,7 @@ void WellSummaryPage::wellboreTrajectoryFinished( const QString& wellboreId, int
|
||||
.wellId = wellbore.value().wellId,
|
||||
.wellboreId = w.wellboreId,
|
||||
.wellboreTrajectoryId = wellboreTrajectoryId,
|
||||
.existenceKind = w.existenceKind,
|
||||
.datumElevation = wellbore.value().datumElevation } );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -370,6 +370,7 @@ public:
|
||||
QString wellId;
|
||||
QString wellboreId;
|
||||
QString wellboreTrajectoryId;
|
||||
QString existenceKind;
|
||||
double datumElevation;
|
||||
};
|
||||
|
||||
|
||||
@@ -21,6 +21,9 @@ RimOsduWellPath::RimOsduWellPath()
|
||||
CAF_PDM_InitFieldNoDefault( &m_wellboreTrajectoryId, "WellboreTrajectoryId", "Wellbore Trajectory Id" );
|
||||
m_wellboreTrajectoryId.uiCapability()->setUiReadOnly( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_existenceKind, "ExistenceKind", "Existence Kind" );
|
||||
m_existenceKind.uiCapability()->setUiReadOnly( true );
|
||||
|
||||
CAF_PDM_InitField( &m_datumElevationFromOsdu, "DatumElevationFromOsdu", 0.0, "Datum Elevation From OSDU" );
|
||||
m_datumElevationFromOsdu.uiCapability()->setUiReadOnly( true );
|
||||
}
|
||||
@@ -96,6 +99,22 @@ double RimOsduWellPath::datumElevationFromOsdu() const
|
||||
return m_datumElevationFromOsdu;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimOsduWellPath::setExistenceKind( const QString& existenceKind )
|
||||
{
|
||||
m_existenceKind = existenceKind;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimOsduWellPath::existenceKind() const
|
||||
{
|
||||
return m_existenceKind;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -105,6 +124,7 @@ void RimOsduWellPath::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering
|
||||
osduGroup->add( &m_wellId );
|
||||
osduGroup->add( &m_wellboreId );
|
||||
osduGroup->add( &m_wellboreTrajectoryId );
|
||||
osduGroup->add( &m_existenceKind );
|
||||
osduGroup->add( &m_datumElevationFromOsdu );
|
||||
|
||||
RimWellPath::defineUiOrdering( uiConfigName, uiOrdering );
|
||||
|
||||
@@ -39,6 +39,9 @@ public:
|
||||
void setDatumElevationFromOsdu( double datumElevationFromOsdu );
|
||||
double datumElevationFromOsdu() const;
|
||||
|
||||
void setExistenceKind( const QString& existenceKind );
|
||||
QString existenceKind() const;
|
||||
|
||||
protected:
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
|
||||
@@ -46,5 +49,6 @@ private:
|
||||
caf::PdmField<QString> m_wellId;
|
||||
caf::PdmField<QString> m_wellboreId;
|
||||
caf::PdmField<QString> m_wellboreTrajectoryId;
|
||||
caf::PdmField<QString> m_existenceKind;
|
||||
caf::PdmField<double> m_datumElevationFromOsdu;
|
||||
};
|
||||
Reference in new issue
Block a user