|
@@ -1,23 +1,43 @@
|
|
1
|
+ %% rtsched.sty
|
|
2
|
+ %% Copyright 2005 M. G. Lipari
|
|
3
|
+ %
|
|
4
|
+ % This work may be distributed and/or modified under the
|
|
5
|
+ % conditions of the LaTeX Project Public License, either version 1.3
|
|
6
|
+ % of this license or (at your option) any later version.
|
|
7
|
+ % The latest version of this license is in
|
|
8
|
+ % http://www.latex-project.org/lppl.txt
|
|
9
|
+ % and version 1.3 or later is part of all distributions of LaTeX
|
|
10
|
+ % version 2005/12/01 or later.
|
|
11
|
+ %
|
|
12
|
+ % This work has the LPPL maintenance status `maintained'.
|
|
13
|
+ %
|
|
14
|
+ % The Current Maintainer of this work is G. Lipari
|
|
15
|
+ %
|
|
16
|
+ % This work consists of the file pig.sty.
|
|
17
|
+
|
|
18
|
+
|
1
|
19
|
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
|
2
|
20
|
\ProvidesPackage{rtsched}[2005/01/01]
|
3
|
|
-\typeout{'rtsched' style for Latex and PSTricks}
|
|
21
|
+\typeout{'rtsched' style for Latex and TikZ/PGF}
|
4
|
22
|
\typeout{Easily draw real-time schedules in TeX/Latex.}
|
5
|
23
|
\typeout{(c) 2005, Giuseppe Lipari, Pisa, Italy (g.lipari@sssup.it)}
|
6
|
|
-\typeout{Version 1.2beta}
|
|
24
|
+\typeout{Version 2.0}
|
7
|
25
|
|
8
|
|
-\RequirePackage{multido}
|
9
|
|
-\RequirePackage{pstricks}
|
|
26
|
+\RequirePackage{tikz}
|
|
27
|
+\usetikzlibrary{shadows, patterns}
|
10
|
28
|
\RequirePackage{keyval}
|
|
29
|
+\newcommand\rtfont{\usefont{T1}{phv}{m}{n}}
|
|
30
|
+
|
11
|
31
|
|
12
|
32
|
%%
|
13
|
33
|
%% These can be changed at any time
|
14
|
34
|
%%
|
15
|
35
|
\def\RTWindowLength{10cm} % window length
|
16
|
|
-\def\RTWindowHeight{0cm} % window height
|
17
|
|
-\def\RTNullWindowHeight{0cm} % nullwindow height
|
18
|
|
-\def\RTTaskLabelSize{10pt} % Size in pt of the task label
|
19
|
|
-\def\RTNumberLabelSize{10pt} % Size in pt of the number labels
|
20
|
|
-\def\RTDefTaskSymbol{\tau}
|
|
36
|
+\def\RTWindowHeight{0} % window height
|
|
37
|
+\def\RTNullWindowHeight{0} % nullwindow height
|
|
38
|
+\def\RTTaskLabelSize{\normalsize} % font size the task label
|
|
39
|
+\def\RTNumberLabelSize{\normalsize} % font size of the number labels
|
|
40
|
+\def\RTDefTaskSymbol{\tau}
|
21
|
41
|
\def\RTDefNumberOffset{0}
|
22
|
42
|
\def\RTDefTaskFill{solid}
|
23
|
43
|
\def\RTDefTaskColor{gray}
|
|
@@ -31,6 +51,9 @@
|
31
|
51
|
\def\RTDefLineWidth{1pt}
|
32
|
52
|
\def\RTDefLineStyle{solid}
|
33
|
53
|
\def\RTDefExecHeight{1}
|
|
54
|
+\def\RTArrowStyle{-stealth} %arrow style for deadlines, arrivals and horizontal axes
|
|
55
|
+% -{Triangle 45}[length=x] with length is a more modern arrow style but requires arrows.meta tikz library (available on latest texlive but rarely up to date on linux distribution)
|
|
56
|
+%-stealth is a predefined more classical arrow style
|
34
|
57
|
|
35
|
58
|
\def\RTExecLabel{\ }
|
36
|
59
|
\def\RTTaskSymbol{\RTDefTaskSymbol}
|
|
@@ -40,19 +63,21 @@
|
40
|
63
|
\def\RTXScale{\RTDefXScale}
|
41
|
64
|
\def\RTWriteSymbols{\RTDefWriteSymbols}
|
42
|
65
|
\def\RTNumberOffset{\RTDefNumberOffset}
|
43
|
|
-\def\RTNumberOffset{\RTDefNumberOffset}
|
44
|
66
|
\def\RTGridInvisible{\RTDefGridInvisible}
|
|
67
|
+\def\RTNumbersInvisible{\RTDefNumbersInvisible}
|
45
|
68
|
\def\RTAxisInvisible{\RTDefAxisInvisible}
|
46
|
|
-\def\RTNumbersInvisible{\RTDefGridInvisible}
|
47
|
69
|
\def\RTRowLabelOffset{\RTDefRowLabelOffset}
|
48
|
70
|
\def\RTLineWidth{\RTDefLineWidth}
|
49
|
71
|
\def\RTLineStyle{\RTDefLineStyle}
|
50
|
72
|
\def\RTExecHeight{\RTDefExecHeight}
|
51
|
73
|
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
52
|
77
|
\define@key{RT}{height}[\RTNullWindowHeight]{\def\RTWindowHeight{#1}}
|
53
|
|
-\define@key{RT}{width}[10cm]{\def\RTWindowLength{#1}}
|
54
|
|
-\define@key{RT}{labelsize}[10pt]{\def\RTTaskLabelSize{#1}}
|
55
|
|
-\define@key{RT}{numbersize}[10pt]{\def\RTNumberLabelSize{#1}}
|
|
78
|
+\define@key{RT}{width}[10]{\def\RTWindowLength{#1}}
|
|
79
|
+\define@key{RT}{labelsize}[\normalsize]{\def\RTTaskLabelSize{#1}}
|
|
80
|
+\define@key{RT}{numbersize}[\normalsize]{\def\RTNumberLabelSize{#1}}
|
56
|
81
|
\define@key{RT}{color}[\RTDefTaskColor]{\def\RTTaskColor{#1}}
|
57
|
82
|
\define@key{RT}{linecolor}[\RTDefLineColor]{\def\RTLineColor{#1}}
|
58
|
83
|
\define@key{RT}{execlabel}[\ ]{\def\RTExecLabel{#1}}
|
|
@@ -70,8 +95,10 @@
|
70
|
95
|
\define@key{RT}{style}[\RTDefLineStyle]{\def\RTLineStyle{#1}}
|
71
|
96
|
\define@key{RT}{exeheight}[\RTDefExecHeight]{\def\RTExecHeight{#1}}
|
72
|
97
|
|
|
98
|
+
|
73
|
99
|
%%
|
74
|
100
|
%% temporaries
|
|
101
|
+
|
75
|
102
|
\newdimen\sx % slot length
|
76
|
103
|
\newdimen\sy % slot height
|
77
|
104
|
\newdimen\hy % frame height
|
|
@@ -81,91 +108,88 @@
|
81
|
108
|
\newdimen\yyy % y position
|
82
|
109
|
\newcount\nsx % number of horizontal slots
|
83
|
110
|
\newcount\nsy % number of vertical slots
|
84
|
|
-\newcount\nhl % number of horizonatal lines
|
|
111
|
+\newcount\nhl % number of horizontal lines
|
85
|
112
|
\newcount\nvl % number of vertical lines
|
|
113
|
+\newcount\ntasks % number of tasks
|
|
114
|
+\newcount\ntaskslessone %number of tasks less one
|
86
|
115
|
\newcount\tmp % temp
|
87
|
116
|
|
|
117
|
+
|
88
|
118
|
\newcounter{myLabel}
|
89
|
119
|
|
90
|
120
|
\def\RTGrid{\@ifnextchar[\@mygrid@begin{\@mygrid@begin[]}}
|
91
|
121
|
|
92
|
122
|
\def\RTGridBegin{\@ifnextchar[\@mygrid@begin{\@mygrid@begin[]}}
|
93
|
123
|
\def\@mygrid@begin[#1]#2#3{\setkeys{RT}{#1}%
|
|
124
|
+ %% get the number of tasks
|
|
125
|
+ \ntasks = #2
|
|
126
|
+ \ntaskslessone = \ntasks
|
|
127
|
+ \advance \ntaskslessone by -1
|
94
|
128
|
%% number of horizontal steps in the grid
|
95
|
129
|
\nsx = #3 \advance \nsx by 2 %
|
96
|
|
- %% real lenght of the window (approx)
|
|
130
|
+ %% real length of the window (approx)
|
97
|
131
|
\nvl = \nsx \advance \nvl by 1 %
|
98
|
|
- %% compute lenght of a step
|
|
132
|
+ %% compute length of a step
|
99
|
133
|
\sx = \RTWindowLength \divide \sx by \nsx %
|
100
|
134
|
%% number of vertical steps in the grid
|
101
|
135
|
\nsy = #2 \multiply \nsy by 3 \advance \nsy by 1 %
|
102
|
|
- %% compute lenght of a vertical step (if height is null, \sy is the
|
|
136
|
+ %% compute length of a vertical step (if height is null, \sy is the
|
103
|
137
|
%% same as \sx)
|
104
|
138
|
\ifx\RTWindowHeight\RTNullWindowHeight%
|
105
|
139
|
\sy = \sx%
|
106
|
|
- \hy = \sy \multiply \hy by \nsy \advance \hy by \sy%
|
|
140
|
+ \hy = \sy \multiply \hy by \nsy %\advance \hy by \sy%
|
107
|
141
|
\else
|
108
|
142
|
\sy = \RTWindowHeight \divide \sy by \nsy %
|
109
|
|
- \hy = \RTWindowHeight \advance \hy by \sy %
|
|
143
|
+ \hy = \RTWindowHeight %\advance \hy by \sy %
|
110
|
144
|
\fi
|
111
|
145
|
%% compute real height
|
112
|
146
|
\nhl = \nsy \advance \nhl by 1 %
|
113
|
147
|
\advance \nsy by -1 \advance \nsx by -1
|
114
|
148
|
%% the picture
|
115
|
|
- \begin{pspicture}(0,0)(\RTWindowLength,\hy) %
|
|
149
|
+ \pgfdeclarelayer{foreground}
|
|
150
|
+ \pgfsetlayers{main,foreground}
|
|
151
|
+
|
|
152
|
+ \begin{tikzpicture}
|
116
|
153
|
%% draw grid (if not invisible)
|
117
|
154
|
\if\RTGridInvisible\RTDefGridInvisible
|
118
|
|
- \multips(0,\sy)(0,\sy){\nsy}{\psline[linecolor=lightgray]{-}(0,\sy)(\RTWindowLength,\sy)}%
|
119
|
|
- \multips(\sx,0)(\sx,0){\nsx}{\psline[linecolor=lightgray]{-}(0,\sy)(0,\hy)}%
|
120
|
|
- \psframe(0,\sy)(\RTWindowLength,\hy)%
|
|
155
|
+ \draw[lightgray, semithick] (0,0) grid[xstep = \sx,ystep=\sy ] (\RTWindowLength,\hy);
|
|
156
|
+ %% draw border grid
|
|
157
|
+ \draw [black, thick] (0,0) rectangle (\RTWindowLength,\hy);
|
121
|
158
|
\else\relax
|
122
|
159
|
\fi
|
|
160
|
+
|
123
|
161
|
%% draw numbers (if not invisible)
|
124
|
162
|
\if\RTNumbersInvisible\RTDefNumbersInvisible
|
125
|
|
- \tmp = #3 \divide \tmp by 2 \advance \tmp by 1%
|
126
|
|
- \pssetlength{\xx}{\sx}%
|
127
|
|
- \setcounter{myLabel}{\RTNumberOffset}
|
128
|
|
- \multido{\n=0+1}{\tmp}{%
|
129
|
|
- \uput{4pt}[d](\xx,\sy){%
|
130
|
|
- \usefont{T1}{phv}{m}{n}%
|
131
|
|
- \fontsize{\RTNumberLabelSize}{\RTNumberLabelSize}%
|
132
|
|
- \selectfont{\arabic{myLabel}}}%
|
133
|
|
- \psaddtolength{\xx}{\sx}%
|
134
|
|
- \psaddtolength{\xx}{\sx}%
|
135
|
|
- \addtocounter{myLabel}{2}
|
136
|
|
- }
|
137
|
|
- \else\relax
|
|
163
|
+ \foreach \i [evaluate = \i as \j using \i*\sx] in {0,...,#3}{
|
|
164
|
+ \ifodd \i
|
|
165
|
+ \else
|
|
166
|
+ \pgfmathsetmacro\nbwithoffset{\i + \RTNumberOffset};
|
|
167
|
+ \node[below, font=\RTNumberLabelSize \rtfont] at (\j +\sx , 0) {\pgfmathprintnumber[int trunc,/pgf/number format/assume math mode=true]{\nbwithoffset }};
|
|
168
|
+ \fi
|
|
169
|
+ }
|
|
170
|
+ \else
|
|
171
|
+ \relax
|
138
|
172
|
\fi
|
139
|
|
- %
|
|
173
|
+
|
140
|
174
|
%% Task Names
|
141
|
|
- \setcounter{myLabel}{1}
|
142
|
|
- \pssetlength{\yy}{\hy}%
|
143
|
|
- \psaddtolength{\yy}{-\sy}
|
144
|
|
- \multido{\n=0+1}{#2}{%
|
145
|
|
- \uput{4pt}[d](-\sx,\yy){
|
146
|
|
- \usefont{T1}{phv}{m}{n}
|
147
|
|
- \fontsize{\RTTaskLabelSize}{\RTTaskLabelSize}
|
148
|
|
- \if\RTWriteSymbols\RTDefWriteSymbols\selectfont{$\RTTaskSymbol_{\arabic{myLabel}}$}
|
149
|
|
- \else\relax
|
150
|
|
- \fi
|
151
|
|
- }%
|
152
|
|
- \psaddtolength{\yy}{-3\sy}%
|
153
|
|
- \addtocounter{myLabel}{1}
|
154
|
|
- }%
|
|
175
|
+ \if\RTWriteSymbols\RTDefWriteSymbols
|
|
176
|
+ \foreach \i [evaluate = \i as \j using (\hy -3*\i*\sy)] in {0,...,\ntaskslessone}{
|
|
177
|
+ \pgfmathsetmacro\task{\i + 1};
|
|
178
|
+ \node[below, font=\rtfont] at (-\sx , \j-\sy) {\RTTaskLabelSize $\RTTaskSymbol_{\pgfmathprintnumber[int trunc]{\task}}$};
|
|
179
|
+ }
|
|
180
|
+ \else\relax
|
|
181
|
+ \fi
|
|
182
|
+
|
155
|
183
|
%% Horizontal axes
|
156
|
|
-
|
157
|
184
|
\if\RTAxisInvisible\RTDefAxisInvisible
|
158
|
|
- \xx = \sx \xxx = \RTWindowLength \advance \xxx by -\sx
|
159
|
|
- \yy = 2\sy
|
160
|
|
- \multido{\n=0+1}{#2}{
|
161
|
|
- \psline{->}(\xx,\yy)(\xxx,\yy)
|
162
|
|
- \advance \yy by 3\sy
|
|
185
|
+ \begin{pgfonlayer}{foreground}
|
|
186
|
+ \foreach \i [evaluate = \i as \j using (\hy -3*\i*\sy)] in {0,...,\ntaskslessone}{
|
|
187
|
+ \draw [very thick,\RTArrowStyle] (\sx,\j-3*\sy) -- (\RTWindowLength - \sx,\j-3*\sy);
|
163
|
188
|
}
|
164
|
|
- \fi
|
|
189
|
+ \end{pgfonlayer}
|
|
190
|
+ \fi
|
165
|
191
|
}
|
166
|
|
-
|
167
|
|
-
|
168
|
|
-
|
|
192
|
+
|
169
|
193
|
\def\@RTDefaultValues{%
|
170
|
194
|
\setkeys{RT}{height}%
|
171
|
195
|
\setkeys{RT}{width}%
|
|
@@ -186,12 +210,12 @@
|
186
|
210
|
}
|
187
|
211
|
|
188
|
212
|
\def\RTGridEnd{
|
189
|
|
- \end{pspicture}%
|
|
213
|
+ \end{tikzpicture}%
|
190
|
214
|
\@RTDefaultValues%
|
191
|
215
|
}
|
192
|
216
|
|
193
|
217
|
\def\endRTGrid{
|
194
|
|
- \end{pspicture}%
|
|
218
|
+ \end{tikzpicture}%
|
195
|
219
|
\@RTDefaultValues%
|
196
|
220
|
}
|
197
|
221
|
|
|
@@ -221,11 +245,13 @@
|
221
|
245
|
\advance \yy by \hy
|
222
|
246
|
}
|
223
|
247
|
|
|
248
|
+
|
224
|
249
|
\newcommand{\DrawTaskAxis}[2][nocommand=1]{%
|
225
|
250
|
\setkeys{RT}{#1}%
|
226
|
251
|
\@compute@yy{#2}
|
227
|
252
|
\@compute@xx{0}
|
228
|
253
|
\xxx = \RTWindowLength \advance \xxx by -\sx
|
|
254
|
+ \draw [\RTLineColor,\RTArrowStyle] (\xx,\yy) -- (\xx,\yyy);
|
229
|
255
|
\psline[linecolor=\RTLineColor]{->}(\xx,\yy)(\xxx,\yy)%
|
230
|
256
|
\@RTExecDefaultValues%
|
231
|
257
|
}
|
|
@@ -235,10 +261,10 @@
|
235
|
261
|
\@compute@yy{#2}
|
236
|
262
|
\@compute@xx{0}
|
237
|
263
|
\xxx = \RTWindowLength \advance \xxx by -\sx
|
238
|
|
- \psline[linecolor=\RTLineColor]{->}(\xx,\yy)(\xxx,\yy)%
|
|
264
|
+ \draw [\RTLineColor,\RTArrowStyle] (\xx,\yy) -- (\xxx,\yy);
|
239
|
265
|
\yyy = 3\sy \multiply \yyy by #3 \advance \yyy by \yy
|
240
|
266
|
\advance \yyy by -\sy
|
241
|
|
- \psline[linecolor=\RTLineColor]{->}(\xx,\yy)(\xx,\yyy)%
|
|
267
|
+ \draw [\RTLineColor,\RTArrowStyle] (\xx,\yy) -- (\xx,\yyy);
|
242
|
268
|
\@RTExecDefaultValues%
|
243
|
269
|
}
|
244
|
270
|
|
|
@@ -248,7 +274,7 @@
|
248
|
274
|
\@compute@xxx{#4}
|
249
|
275
|
\yy = #3\sy \advance \yy by 2\sy
|
250
|
276
|
\yyy = #5\sy \advance \yyy by 2\sy
|
251
|
|
- \psline[linecolor=\RTLineColor,linestyle=\RTLineStyle,linewidth=\RTLineWidth]{-}(\xx,\yy)(\xxx,\yyy)
|
|
277
|
+ \draw [\RTLineColor, line width=\RTLineWidth,\RTLineStyle] (\xx,\yy) -- (\xxx,\yyy);
|
252
|
278
|
\@RTExecDefaultValues%
|
253
|
279
|
}
|
254
|
280
|
|
|
@@ -260,7 +286,10 @@
|
260
|
286
|
\@compute@yy{#2}
|
261
|
287
|
\@compute@xx{#3}
|
262
|
288
|
\yyy = \yy \advance \yyy by 2\sy%
|
263
|
|
- \psline[linecolor=\RTLineColor]{->}(\xx,\yy)(\xx,\yyy)%
|
|
289
|
+ \begin{pgfonlayer}{foreground}
|
|
290
|
+ \draw [\RTLineColor, thick,\RTArrowStyle] (\xx,\yy) -- (\xx,\yyy);
|
|
291
|
+ \end{pgfonlayer}
|
|
292
|
+
|
264
|
293
|
\@RTExecDefaultValues%
|
265
|
294
|
}
|
266
|
295
|
|
|
@@ -273,9 +302,13 @@
|
273
|
302
|
\@compute@yy{#2}
|
274
|
303
|
\@compute@xx{#3}
|
275
|
304
|
\yyy = \yy \advance \yyy by 2\sy
|
276
|
|
- \psline[linecolor=\RTLineColor]{->}(\xx,\yy)(\xx,\yyy)
|
|
305
|
+ \begin{pgfonlayer}{foreground}
|
|
306
|
+ \draw [\RTLineColor, thick,\RTArrowStyle] (\xx,\yy) -- (\xx,\yyy);
|
|
307
|
+ \end{pgfonlayer}
|
277
|
308
|
\advance \xx by #4\sx
|
278
|
|
- \psline[linecolor=\RTLineColor]{->}(\xx,\yyy)(\xx,\yy)
|
|
309
|
+ \begin{pgfonlayer}{foreground}
|
|
310
|
+ \draw [\RTLineColor, thick,\RTArrowStyle] (\xx,\yyy) -- (\xx,\yy);
|
|
311
|
+ \end{pgfonlayer}
|
279
|
312
|
\@RTExecDefaultValues
|
280
|
313
|
}
|
281
|
314
|
|
|
@@ -288,7 +321,9 @@
|
288
|
321
|
\@compute@yy{#2}
|
289
|
322
|
\@compute@xx{#3}
|
290
|
323
|
\yyy = \yy \advance \yyy by 2\sy
|
291
|
|
- \psline[linecolor=\RTLineColor]{<-}(\xx,\yy)(\xx,\yyy)
|
|
324
|
+ \begin{pgfonlayer}{foreground}
|
|
325
|
+ \draw [\RTLineColor, thick,<-] (\xx,\yy) -- (\xx,\yyy);
|
|
326
|
+ \end{pgfonlayer}
|
292
|
327
|
\@RTExecDefaultValues
|
293
|
328
|
}
|
294
|
329
|
|
|
@@ -298,16 +333,12 @@
|
298
|
333
|
\@compute@xx{#3}
|
299
|
334
|
\yyy = \yy \advance \yyy by \RTExecHeight\sy
|
300
|
335
|
\@compute@xxx{#4}
|
301
|
|
- \psframe[fillstyle=\RTTaskFill,fillcolor=\RTTaskColor,linecolor=\RTLineColor](\xx,\yy)(\xxx,\yyy)
|
|
336
|
+ \draw [fill=\RTTaskColor,\RTTaskFill,draw=\RTLineColor, thick] (\xx,\yy) rectangle (\xxx,\yyy);
|
302
|
337
|
\advance \xx by \xxx \xx = .5\xx
|
303
|
|
- \uput{2pt}[u](\xx,\yy){%
|
304
|
|
- \usefont{T1}{phv}{m}{n}%
|
305
|
|
- \fontsize{\RTNumberLabelSize}{\RTNumberLabelSize}%
|
306
|
|
- \selectfont{\RTExecLabel}%
|
307
|
|
- }
|
|
338
|
+ \draw (\xx,\yy) node[above, font=\rtfont] {\RTNumberLabelSize \RTExecLabel};%\RTNumberLabelSize
|
308
|
339
|
\@RTExecDefaultValues
|
309
|
340
|
}
|
310
|
|
-
|
|
341
|
+%
|
311
|
342
|
% Task Lock
|
312
|
343
|
% par 1: task
|
313
|
344
|
% par 2: time
|
|
@@ -318,15 +349,11 @@
|
318
|
349
|
\@compute@yy{#2}
|
319
|
350
|
\@compute@xx{#3}
|
320
|
351
|
\yyy = \yy \advance \yyy by \sy
|
321
|
|
- \uput{2pt}[u](\xx,\yyy){%
|
322
|
|
- \usefont{T1}{phv}{m}{n}%
|
323
|
|
- \fontsize{\RTNumberLabelSize}{\RTNumberLabelSize}%
|
324
|
|
- \selectfont{L(#4)}%
|
325
|
|
- }
|
|
352
|
+ \node[above,font=\rtfont] at (\xx , \yyy) {\RTNumberLabelSize L(#4)}; %\RTNumberLabelSize
|
326
|
353
|
\@RTExecDefaultValues
|
327
|
354
|
}
|
328
|
|
-
|
329
|
|
-% \TaskUnlock
|
|
355
|
+%
|
|
356
|
+% TaskUnlock
|
330
|
357
|
% par 1: task
|
331
|
358
|
% par 2: time
|
332
|
359
|
% par 3: resource
|
|
@@ -336,15 +363,11 @@
|
336
|
363
|
\@compute@yy{#2}
|
337
|
364
|
\@compute@xx{#3}
|
338
|
365
|
\yyy = \yy \advance \yyy by \sy
|
339
|
|
- \uput{2pt}[u](\xx,\yyy){%
|
340
|
|
- \usefont{T1}{phv}{m}{n}%
|
341
|
|
- \fontsize{\RTNumberLabelSize}{\RTNumberLabelSize}%
|
342
|
|
- \selectfont{U(#4)}%
|
343
|
|
- }
|
|
366
|
+ \node[above, font=\rtfont] at (\xx , \yyy) {\RTNumberLabelSize U(#4)}; %\RTNumberLabelSize
|
344
|
367
|
\@RTExecDefaultValues
|
345
|
368
|
}
|
346
|
|
-
|
347
|
|
-%
|
|
369
|
+%
|
|
370
|
+% Label
|
348
|
371
|
% par 1: number of vertical slot
|
349
|
372
|
% par 2: time
|
350
|
373
|
% par 3: label
|
|
@@ -355,17 +378,13 @@
|
355
|
378
|
\@compute@xx{#3}
|
356
|
379
|
\yy = -\sy \multiply \yy by #2
|
357
|
380
|
\advance \yy by \hy
|
358
|
|
- \yyy = \yy \advance \yyy by \sy
|
359
|
|
- \uput{2pt}[u](\xx,\yyy){%
|
360
|
|
- \psshadowbox{
|
361
|
|
- \usefont{T1}{phv}{m}{n}%
|
362
|
|
- \fontsize{\RTNumberLabelSize}{\RTNumberLabelSize}%
|
363
|
|
- \selectfont{{#4}}}%
|
364
|
|
- }
|
|
381
|
+ \yyy = \yy \advance \yyy by 2\sy %\yyy = \yy \advance \yyy by \sy
|
|
382
|
+
|
|
383
|
+ \node[font=\rtfont, fill = white, draw=\RTLineColor, thin, drop shadow = {color = black}] at (\xx , \yyy) {\RTNumberLabelSize #4}; %\RTNumberLabelSize
|
365
|
384
|
\@RTExecDefaultValues
|
366
|
385
|
}
|
367
|
|
-
|
368
|
|
-%
|
|
386
|
+%
|
|
387
|
+% Inherit
|
369
|
388
|
% par 1: higher priority task (from)
|
370
|
389
|
% par 2: lower priority task (to)
|
371
|
390
|
% par 3: time
|
|
@@ -376,16 +395,19 @@
|
376
|
395
|
\@compute@xx{#4}
|
377
|
396
|
\yyy = -3\sy \multiply \yyy by #3 \advance \yyy by \sy
|
378
|
397
|
\advance \yyy by \hy \advance \yyy by -\sy % \RTWindowHeight
|
379
|
|
- \psline[linestyle=dashed,linewidth=1.5pt]{->}(\xx,\yy)(\xx,\yyy)
|
|
398
|
+ \begin{pgfonlayer}{foreground}
|
|
399
|
+ \draw [dashed, thick,\RTArrowStyle] (\xx,\yy) -- (\xx,\yyy);
|
|
400
|
+ \end{pgfonlayer}
|
380
|
401
|
\@RTExecDefaultValues
|
381
|
402
|
}
|
382
|
403
|
|
383
|
404
|
%
|
|
405
|
+% Activation
|
384
|
406
|
% par 1: activating task (from)
|
385
|
407
|
% par 2: signal start time
|
386
|
408
|
% par 3: activated task (to)
|
387
|
409
|
% par 4: signal arrival time
|
388
|
|
-%
|
|
410
|
+
|
389
|
411
|
\newcommand{\Activation}[5][nocommand=1]{
|
390
|
412
|
\setkeys{RT}{#1}%
|
391
|
413
|
\@compute@yy{#2}
|
|
@@ -393,10 +415,14 @@
|
393
|
415
|
\yyy = -3\sy \multiply \yyy by #4 %\advance \yyy by \sy
|
394
|
416
|
\advance \yyy by \hy %\advance \yyy by -\sy %\RTWindowHeight
|
395
|
417
|
\xxx = #5\sx \advance \xxx by \sx
|
396
|
|
- \psline[linestyle=dashed,linewidth=1pt]{->}(\xx,\yy)(\xxx,\yyy)
|
|
418
|
+ \begin{pgfonlayer}{foreground}
|
|
419
|
+ \draw [dashed, thick,\RTArrowStyle] (\xx,\yy) -- (\xxx,\yyy);
|
|
420
|
+ \end{pgfonlayer}
|
|
421
|
+
|
397
|
422
|
}
|
398
|
423
|
|
399
|
424
|
%
|
|
425
|
+% RTBox
|
400
|
426
|
% par 1: time1
|
401
|
427
|
% par 2: time2
|
402
|
428
|
%
|
|
@@ -404,14 +430,16 @@
|
404
|
430
|
\setkeys{RT}{#1}%
|
405
|
431
|
\yy = 0cm
|
406
|
432
|
\advance \yy by \hy
|
407
|
|
- \yyy = \sy
|
|
433
|
+ \yyy = 0cm % \yyy = \sy
|
408
|
434
|
\@compute@xx{#2}
|
409
|
435
|
\@compute@xxx{#3}
|
410
|
|
- \psframe[fillstyle=crosshatch,hatchwidth=.2pt,hatchsep=2pt,hatchcolor=lightgray,linewidth=0pt,framearc=.2](\xx,\yy)(\xxx,\yyy)
|
|
436
|
+ \draw [pattern color=lightgray, draw=\RTLineColor, pattern=crosshatch, rounded corners, thin](\xx,\yy) rectangle (\xxx,\yyy);
|
411
|
437
|
\@RTExecDefaultValues
|
412
|
438
|
}
|
413
|
439
|
|
414
|
|
-% %
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+%% %
|
415
|
443
|
% % par 1: task
|
416
|
444
|
% % par 2: first instant (arrival)
|
417
|
445
|
% % par 3: second instant (deadline)
|
|
@@ -426,48 +454,59 @@
|
426
|
454
|
% \pscurve*[linecolor=\RTLineColor]{-}(\xx,\yy)(\xxx,\yy)
|
427
|
455
|
% \@RTExecDefaultValues
|
428
|
456
|
% }
|
|
457
|
+%
|
429
|
458
|
|
|
459
|
+
|
|
460
|
+%
|
|
461
|
+% RowLabel
|
|
462
|
+% par 1: task
|
|
463
|
+% par 2: label
|
|
464
|
+%
|
430
|
465
|
\newcommand{\RowLabel}[3][nocommand=1]{
|
431
|
466
|
\setkeys{RT}{#1}%
|
432
|
467
|
\@compute@yy{#2}
|
433
|
468
|
\advance \yy by 1.5\sy
|
434
|
469
|
\xx = \RTRowLabelOffset %\advance \xx by \sx
|
435
|
|
- \uput{4pt}[dl](-\xx,\yy){
|
436
|
|
- \usefont{T1}{phv}{m}{n}
|
437
|
|
- \fontsize{\RTTaskLabelSize}{\RTTaskLabelSize}
|
438
|
|
- \selectfont{#3}
|
439
|
|
- }%
|
|
470
|
+ \node[below left,font=\rtfont] at (-\xx , \yy) {\RTTaskLabelSize #3};%\RTTaskLabelSize
|
440
|
471
|
}
|
441
|
472
|
|
|
473
|
+%
|
|
474
|
+% TaskExecDelta
|
|
475
|
+% par 1: task
|
|
476
|
+% par 2: start time
|
|
477
|
+% par 3: delta
|
|
478
|
+%
|
442
|
479
|
\newcommand{\TaskExecDelta}[4][nocommand=1]{
|
443
|
480
|
\setkeys{RT}{#1}%
|
444
|
481
|
\@compute@yy{#2}
|
445
|
482
|
\@compute@xx{#3}
|
446
|
|
- \yyy = \yy \advance \yyy by \RTExecHeight\sy
|
|
483
|
+ \yyy = \yy \advance \yyy by \RTExecHeight \sy
|
447
|
484
|
%\@compute@xxx{#4}
|
448
|
485
|
\xxx = \xx \advance \xxx by #4\sx
|
449
|
|
- \psframe[fillstyle=\RTTaskFill,fillcolor=\RTTaskColor,linecolor=\RTLineColor](\xx,\yy)(\xxx,\yyy)
|
|
486
|
+ \draw [fill=\RTTaskColor,\RTTaskFill,draw=\RTLineColor, thick] (\xx,\yy) rectangle (\xxx,\yyy);
|
450
|
487
|
\advance \xx by \xxx \xx = .5\xx
|
451
|
|
- \uput{2pt}[u](\xx,\yy){%
|
452
|
|
- \usefont{T1}{phv}{m}{n}%
|
453
|
|
- \fontsize{\RTNumberLabelSize}{\RTNumberLabelSize}%
|
454
|
|
- \selectfont{\RTExecLabel}%
|
455
|
|
- }
|
|
488
|
+ \draw (\xx,\yy) node[above, font=\rtfont] {\RTTaskLabelSize \RTExecLabel}; %\RTNumberLabelSize
|
456
|
489
|
\@RTExecDefaultValues
|
457
|
490
|
}
|
458
|
491
|
|
|
492
|
+
|
|
493
|
+%
|
|
494
|
+% TaskRespTime
|
|
495
|
+% par 1: task
|
|
496
|
+% par 2: start time
|
|
497
|
+% par 3: finish time
|
|
498
|
+%
|
459
|
499
|
\newcommand{\TaskRespTime}[4][nocommand=1]{
|
460
|
500
|
\setkeys{RT}{#1}
|
461
|
501
|
\@compute@yy{#2}
|
462
|
502
|
\@compute@xx{#3}
|
463
|
503
|
\yyy = \yy \advance \yyy by \sy
|
464
|
504
|
\xxx = \xx \advance \xxx by #4\sx
|
465
|
|
- \psframe[fillstyle=crosshatch*,hatchcolor=white,
|
466
|
|
- hatchwidth=.4pt,hatchsep=1pt,
|
467
|
|
- linestyle=none,fillcolor=\RTTaskColor](\xx,\yy)(\xxx,\yyy)
|
|
505
|
+ \draw [pattern color=\RTTaskColor,draw=\RTLineColor, pattern=crosshatch, thin] (\xx,\yy) rectangle (\xxx,\yyy);
|
468
|
506
|
\@RTExecDefaultValues
|
469
|
507
|
}
|
470
|
508
|
|
|
509
|
+
|
471
|
510
|
\@ifclassloaded{beamer}{
|
472
|
511
|
\renewcommand<>{\TaskArrival}[3][nocommand=1]{
|
473
|
512
|
\only#4{\beameroriginal{\TaskArrival}[#1]{#2}{#3}}
|
|
@@ -511,4 +550,5 @@
|
511
|
550
|
}
|
512
|
551
|
{\typeout{beamer not loaded}}
|
513
|
552
|
|
514
|
|
-\endinput
|
|
553
|
+\endinput
|
|
554
|
+
|