Skip to content

Commit

Permalink
[Janitor mode] Fix whitespace
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@24371 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
OpenModelica-Hudson committed Feb 2, 2015
1 parent 9e1ce97 commit d22c585
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions SimulationRuntime/cpp/Core/SimController/SimManager.cpp
Expand Up @@ -140,7 +140,7 @@ void SimManager::initialize()
if (_timeeventcounter)
delete[] _timeeventcounter;
_timeeventcounter = new int[_dimtimeevent];
memset(_timeeventcounter, 0, _dimtimeevent * sizeof(int));
memset(_timeeventcounter, 0, _dimtimeevent * sizeof(int));
// compute sampleCycles for RT simulation
if (_config->getGlobalSettings()->useEndlessSim())
{
Expand Down Expand Up @@ -182,9 +182,9 @@ void SimManager::initialize()
_resetCycle = _sampleCycles[0];
for (int i = 1; i < _dimtimeevent; i++)
_resetCycle *= _sampleCycles[i];
// All Events are updated every cycle. In order to have a change in timeEventCounter, the reset is set to two
if(_resetCycle == 1)
_resetCycle++;
// All Events are updated every cycle. In order to have a change in timeEventCounter, the reset is set to two
if(_resetCycle == 1)
_resetCycle++;
_solver->initialize();
}
//#endif
Expand All @@ -201,8 +201,8 @@ void SimManager::runSingleStep(double cycletime)
// Increase time event counter
if (_dimtimeevent && cycletime > 0.0)
{
if (_lastCycleTime && cycletime != _lastCycleTime)

if (_lastCycleTime && cycletime != _lastCycleTime)
throw std::runtime_error("Cycle time can not be changed, if time events (samples) are present!");
else
_lastCycleTime = cycletime;
Expand All @@ -212,20 +212,20 @@ void SimManager::runSingleStep(double cycletime)
if (_cycleCounter % _sampleCycles[i] == 0)
_timeeventcounter[i]++;
}
}
}
//Handle time event
_timeevent_system->handleTimeEvent(_timeeventcounter);
_cont_system->evaluateAll(IContinuous::CONTINUOUS);
_event_system->saveAll();
_timeevent_system->handleTimeEvent(_timeeventcounter);

// Solve
_solver->setcycletime(cycletime);
_solver->solve(_solverTask);
_cycleCounter++;
// Reset everything to prevent overflows
if (_cycleCounter == _resetCycle + 1)

_cycleCounter++;
// Reset everything to prevent overflows
if (_cycleCounter == _resetCycle + 1)
{
_cycleCounter = 1;
for (int i = 0; i < _dimtimeevent; i++)
Expand Down

0 comments on commit d22c585

Please sign in to comment.