Browse Source

fix options of periodic commands not passed to commands

abertout 9 years ago
parent
commit
9d1489df71
1 changed files with 8 additions and 11 deletions
  1. 8
    11
      rtsched.sty

+ 8
- 11
rtsched.sty View File

@@ -112,7 +112,6 @@
112 112
 \newcount\nhl % number of horizontal lines
113 113
 \newcount\nvl % number of vertical lines
114 114
 \newcount\ntasks % number of tasks
115
-\newcount\ntaskslessone %number of tasks less one
116 115
 \newcount\tmp % temp
117 116
 
118 117
 
@@ -124,8 +123,6 @@
124 123
 \def\@mygrid@begin[#1]#2#3{\setkeys{RT}{#1}%
125 124
   %% get the number of tasks
126 125
   \ntasks = #2
127
-  \ntaskslessone = \ntasks
128
-  \advance \ntaskslessone by -1
129 126
   %% number of horizontal steps in the grid
130 127
   \nsx = #3 \advance \nsx by 2 %
131 128
   %% real length of the window (approx)
@@ -174,7 +171,7 @@
174 171
 
175 172
     %% Task Names
176 173
     \if\RTWriteSymbols\RTDefWriteSymbols
177
-     \foreach \i  [evaluate = \i as \j using (\hy -3*\i*\sy)] in {0,...,\ntaskslessone}{
174
+     \foreach \i  [evaluate = \i as \j using (\hy -3*\i*\sy)] in {0,...,\numexpr \ntasks - 1}{
178 175
       \pgfmathsetmacro\task{\i + 1};
179 176
       \node[below, font=\rtfont] at (-\sx , \j-\sy) {\RTTaskLabelSize $\RTTaskSymbol_{\pgfmathprintnumber[int trunc]{\task}}$};
180 177
      }
@@ -184,7 +181,7 @@
184 181
     %% Horizontal axes
185 182
     \if\RTAxisInvisible\RTDefAxisInvisible
186 183
       \begin{pgfonlayer}{foreground} 
187
-      \foreach \i [evaluate = \i as \j using (\hy -3*\i*\sy)] in {0,...,\ntaskslessone}{
184
+      \foreach \i [evaluate = \i as \j using (\hy -3*\i*\sy)] in {0,...,\numexpr \ntasks - 1}{
188 185
       \draw [very thick,-\RTArrowStyle] (\sx,\j-3*\sy) -- (\RTWindowLength - \sx,\j-3*\sy);
189 186
       }
190 187
       \end{pgfonlayer} 
@@ -303,7 +300,7 @@
303 300
 % par 4  : number of instances
304 301
 \newcommand{\TaskNArrival}[5][nocommand=1]{%
305 302
  \foreach \instance [evaluate = \instance as \activation using (#3 + \instance * #4)] in {0,...,\numexpr #5-1}{
306
- \TaskArrival{#2}{\activation}{#4}
303
+ \TaskArrival[#1]{#2}{\activation}{#4}
307 304
  }
308 305
 }
309 306
 
@@ -339,7 +336,7 @@
339 336
 
340 337
 \newcommand{\TaskNArrDead}[6][nocommand=1]{
341 338
  \foreach \instance [evaluate = \instance as \activation using (#3 + \instance * #5)] in {0,...,\numexpr #6-1}{
342
- \TaskArrDead{#2}{\activation}{#4}
339
+ \TaskArrDead[#1]{#2}{\activation}{#4}
343 340
  }
344 341
 }
345 342
 
@@ -368,7 +365,7 @@
368 365
 % par 4  : number of instances
369 366
 \newcommand{\TaskNDeadline}[5][nocommand=1]{%
370 367
  \foreach \instance [evaluate = \instance as \activation using (#3 + \instance * #4)] in {0,...,\numexpr #5-1}{
371
- \TaskDeadline{#2}{\activation}{#4}
368
+ \TaskDeadline[#1]{#2}{\activation}{#4}
372 369
  }
373 370
 }
374 371
 
@@ -554,9 +551,9 @@
554 551
 % par 5:  number of instances
555 552
 
556 553
 \newcommand{\TaskNExecDelta}[6][nocommand=1]{
557
- \foreach \instance [evaluate = \instance as \activation using (#3 + \instance * #5)] in {0,...,\numexpr #6-1}{
558
- \TaskExecDelta{#2}{\activation}{#4}
559
- }
554
+  \foreach \instance [evaluate = \instance as \activation using (#3 + \instance * #5)] in {0,...,\numexpr #6-1}{
555
+    \TaskExecDelta[#1]{#2}{\activation}{#4}
556
+  }
560 557
 }
561 558
 
562 559
 

Loading…
Cancel
Save