Fault reactivation (#10624)

Update result to generate well paths based on information from model generator. Store settings in JSON file.
Add method to access local coordinate system definition
This commit is contained in:
jonjenssen
2023-09-19 18:03:36 +02:00
committed by GitHub
parent 9b797fdd36
commit 5d3fb8ceb9
17 changed files with 346 additions and 109 deletions

View File

@@ -23,6 +23,7 @@
#include <QtCore/QJsonDocument>
#include <QtCore/QJsonObject>
#include <QtCore/QString>
#include <QtCore/QTextStream>
namespace ResInsightInternalJson
{
@@ -30,10 +31,14 @@ QMap<QString, QVariant> JsonReader::decodeFile( QString filePath )
{
QFile file;
file.setFileName( filePath );
file.open( QIODevice::ReadOnly );
QByteArray byteArray = file.readAll();
file.close();
return Json::decode( byteArray );
if ( file.open( QIODevice::ReadOnly ) )
{
QByteArray byteArray = file.readAll();
file.close();
return Json::decode( byteArray );
}
return QMap<QString, QVariant>();
}
//--------------------------------------------------------------------------------------------------
@@ -53,6 +58,25 @@ QString JsonReader::rootKeyText()
return "root";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool JsonWriter::encodeFile( QString filePath, QMap<QString, QVariant> map )
{
QFile file;
file.setFileName( filePath );
if ( file.open( QIODevice::ReadWrite | QIODevice::Text ) )
{
QString content = Json::encode( map, true );
QTextStream out( &file );
out << content;
file.close();
return true;
}
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------