Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit df66a21

Browse files
rfrankeOpenModelica-Hudson
authored andcommitted
Revert "Separate subSample and superSample from shiftSample"
This reverts commit c0dbec8.
1 parent 9a067c8 commit df66a21

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Compiler/Template/CodegenCpp.tpl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9470,8 +9470,8 @@ case SIMCODE(modelInfo = MODELINFO(__), modelStructure = fmims) then
94709470
<<
94719471
<%preExp%>
94729472
_clockInterval[<%i%>] = <%interval%> * <%fnom%>.0 / <%fres%>.0;
9473-
_clockShift[<%i%>] = <%interval%> * <%snom%>.0 / <%sres%>.0;
9474-
_clockTime[<%i%>] = _simTime + _clockShift[<%i%>];
9473+
_clockShift[<%i%>] = <%snom%>.0 / <%sres%>.0;
9474+
_clockTime[<%i%>] = _simTime + _clockShift[<%i%>] * _clockInterval[<%i%>];
94759475
_clockStart[<%i%>] = true;
94769476
_clockSubactive[<%i%>] = false;
94779477
<%i%> ++;
@@ -10166,7 +10166,7 @@ template generateTimeEvent(list<BackendDAE.TimeEvent> timeEvents, SimCode simCod
1016610166
// simplified treatment of clocks in model as time events
1016710167
for (int i = 0; i < _dimClock; i++)
1016810168
{
10169-
_timeEventData[_dimTimeEvent-_dimClock+i] = std::make_pair(_clockShift[i], _clockInterval[i]);
10169+
_timeEventData[_dimTimeEvent-_dimClock+i] = std::make_pair(_clockShift[i] * _clockInterval[i], _clockInterval[i]);
1017010170
}
1017110171
}
1017210172
>>
@@ -12514,8 +12514,8 @@ if intNe(subClockIdx,0) then
1251412514
let absSubClockIdx = intAdd(absClockIdx,subClockIdx)
1251512515
<<
1251612516
//activate boolean triggered subclock <%absSubClockIdx%> of the base sub-clock <%absClockIdx%> is triggered
12517-
if (_time_conditions[<%absClockIdx%> -1+<%numberOfTimeEvents%>] && (_simTime >= _clockShift[<%absSubClockIdx%> -1])) {
12518-
_time_conditions[<%absSubClockIdx%> -1+<%numberOfTimeEvents%>] = (_simTime >= _clockShift[<%absSubClockIdx%> -1]);
12517+
if (_time_conditions[<%absClockIdx%> -1+<%numberOfTimeEvents%>] && (_simTime >= _clockShift[<%absSubClockIdx%> -1]*_clockInterval[<%absClockIdx%> -1])) {
12518+
_time_conditions[<%absSubClockIdx%> -1+<%numberOfTimeEvents%>] = (_simTime >= _clockShift[<%absSubClockIdx%> -1]*_clockInterval[<%absClockIdx%> -1]);
1251912519
}
1252012520
>>
1252112521
else

0 commit comments

Comments
 (0)