mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1139 - pre-proto - Reading in all parameters available in StimPlan file.
This commit is contained in:
@@ -18,6 +18,17 @@
|
||||
|
||||
#include "RigStimPlanFractureDefinition.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigStimPlanData::RigStimPlanData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -76,6 +87,57 @@ size_t RigStimPlanFractureDefinition::getTimeStepIndex(double timeStepValue)
|
||||
return -1; //returns -1 if not found
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigStimPlanFractureDefinition::setDataAtTimeValue(QString resultName, QString unit, std::vector<std::vector<double>> data, double timeStepValue)
|
||||
{
|
||||
bool resultNameExists = false;
|
||||
for (RigStimPlanData& resultData : stimPlanData)
|
||||
{
|
||||
if (resultData.resultName == resultName)
|
||||
{
|
||||
resultNameExists = true;
|
||||
resultData.parameterValues[getTimeStepIndex(timeStepValue)] = data;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!resultNameExists)
|
||||
{
|
||||
RigStimPlanData resultData;
|
||||
|
||||
resultData.resultName = resultName;
|
||||
resultData.unit = unit;
|
||||
|
||||
std::vector<std::vector<std::vector<double>>> values(timeSteps.size());
|
||||
resultData.parameterValues = values;
|
||||
resultData.parameterValues[getTimeStepIndex(timeStepValue)] = data;
|
||||
|
||||
stimPlanData.push_back(resultData);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<std::vector<double>> RigStimPlanFractureDefinition::getDataAtTimeIndex(QString resultName, size_t timeStepIndex)
|
||||
{
|
||||
for (RigStimPlanData& resultData : stimPlanData)
|
||||
{
|
||||
if (resultData.resultName == resultName)
|
||||
{
|
||||
return resultData.parameterValues[timeStepIndex];
|
||||
}
|
||||
}
|
||||
|
||||
qDebug() << "ERROR: Requested parameter does not exists in stimPlan data";
|
||||
std::vector<std::vector<double>> emptyVector;
|
||||
return emptyVector;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user