Skip to content

Commit

Permalink
Fixed reading of csv file for animation.
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Nov 9, 2016
1 parent 1d320bd commit 77ccba7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions OMEdit/OMEditGUI/Animation/VisualizerCSV.cpp
Expand Up @@ -183,6 +183,15 @@ double VisualizerCSV::omcGetVarValue(const char* varName, double time)
double *varDataSet = read_csv_dataset(mpCSVData, varName);
if (varDataSet) {
return varDataSet[i];
} else {
std::cout<<"Did not get variable from result file. Variable name is "<<std::string(varName)<<std::endl;
}
} else if ((time > timeDataSet[i]) && (i + 1 < mpCSVData->numsteps) && (time < timeDataSet[i + 1])) { // interpolate
double *varDataSet = read_csv_dataset(mpCSVData, varName);
if (varDataSet) {
return (varDataSet[i] + varDataSet[i + 1]) / 2;
} else {
std::cout<<"Did not get variable from result file. Variable name is "<<std::string(varName)<<std::endl;
}
}
}
Expand Down

0 comments on commit 77ccba7

Please sign in to comment.