Skip to content

Commit

Permalink
- update a bit the omi_Calculation.cpp with things that are done befo…
Browse files Browse the repository at this point in the history
…re callSolver.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10555 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Nov 19, 2011
1 parent d088e81 commit a3f224d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions c_runtime/interactive/omi_Calculation.cpp
Expand Up @@ -22,7 +22,7 @@
#include "omi_ServiceInterface.h"
#include "omi_Control.h"
#include "omi_Calculation.h"
#include "simulation_delay.h"
#include "simulation_runtime.h"

using namespace std;

Expand Down Expand Up @@ -52,7 +52,8 @@ int calculate() {
double tolerance = 1e-4;
string method;
string outputFormat;

measure_time_flag = 0;
function_initMemoryState();
getSimulationStartData(&stepSizeORG, &outputSteps, &tolerance, &method,
&outputFormat);
//TODO 20100217 pv catch correct stepSize value for calculation loop
Expand All @@ -72,7 +73,7 @@ int calculate() {
set_forceEmit(0);
}

initDelay(start);
callExternalObjectConstructors(globalData);

while (!calculationInterrupted) { //TODO 20100210 pv Interrupt is not implemented yet

Expand Down Expand Up @@ -123,6 +124,9 @@ int calculate() {
}
}

initSample(start, stop);
initDelay(start);

retVal = callSolverFromOM(method, outputFormat, start, stop, stepSize, outputSteps, tolerance);

if (retVal != 0) {
Expand All @@ -135,6 +139,8 @@ int calculate() {
createSSDEntry(method);
calculationInterrupted = false;
setResultData(p_SimStepData_from_Calculation); //ssd(tn) as parameter

deinitDelay();
}
//if (debugCalculation)
cout
Expand Down

0 comments on commit a3f224d

Please sign in to comment.