mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added data model for well import wizard
Updated test application p4#: 22265
This commit is contained in:
@@ -553,7 +553,9 @@ void FetchWellPathsDialog::updateFieldsModel()
|
||||
JsonReader jsonReader;
|
||||
QMap<QString, QVariant> jsonMap = jsonReader.decodeFile(fileName);
|
||||
|
||||
QStringList fieldNames;
|
||||
QStringList regions;
|
||||
QStringList fields;
|
||||
QStringList edmIds;
|
||||
QMapIterator<QString, QVariant> it(jsonMap);
|
||||
while (it.hasNext())
|
||||
{
|
||||
@@ -564,11 +566,13 @@ void FetchWellPathsDialog::updateFieldsModel()
|
||||
{
|
||||
QMap<QString, QVariant> fieldMap = it.value().toMap();
|
||||
|
||||
fieldNames.push_back(fieldMap["name"].toString());
|
||||
regions.push_back(fieldMap["region"].toString());
|
||||
fields.push_back(fieldMap["name"].toString());
|
||||
edmIds.push_back(fieldMap["edmId"].toString());
|
||||
}
|
||||
}
|
||||
|
||||
m_fieldModel->setStringList(fieldNames);
|
||||
m_fieldModel->setStringList(fields);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -760,6 +764,41 @@ void FetchWellPathsDialog::checkDownloadQueueAndIssueRequests()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void FetchWellPathsDialog::requestFieldData(QStringList& regions, QStringList& fields, QStringList& edmIds)
|
||||
{
|
||||
downloadFields();
|
||||
|
||||
QString fileName = jsonFieldsFilePath();
|
||||
|
||||
if (QFile::exists(fileName))
|
||||
{
|
||||
JsonReader jsonReader;
|
||||
QMap<QString, QVariant> jsonMap = jsonReader.decodeFile(fileName);
|
||||
|
||||
QStringList regions;
|
||||
QStringList fields;
|
||||
QStringList edmIds;
|
||||
QMapIterator<QString, QVariant> it(jsonMap);
|
||||
while (it.hasNext())
|
||||
{
|
||||
it.next();
|
||||
|
||||
QString key = it.key();
|
||||
if (key[0].isDigit())
|
||||
{
|
||||
QMap<QString, QVariant> fieldMap = it.value().toMap();
|
||||
|
||||
regions.push_back(fieldMap["region"].toString());
|
||||
fields.push_back(fieldMap["name"].toString());
|
||||
edmIds.push_back(fieldMap["edmId"].toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace ssihub
|
||||
|
||||
Reference in New Issue
Block a user