Browse Source

Merge pull request #3 from abertout/master

Minor graphical bug fixes (arrow style, label positions) and copyright update
Giuseppe Lipari 9 years ago
parent
commit
7fef6b07f7
2 changed files with 27 additions and 24 deletions
  1. 2
    1
      README.md
  2. 25
    23
      rtsched.sty

+ 2
- 1
README.md View File

2
  rtsched: The Real-Time scheduling style
2
  rtsched: The Real-Time scheduling style
3
 =========================================
3
 =========================================
4
 
4
 
5
-Author:  Giuseppe Lipari (g.lipari@sssup.it)
5
+Author: Giuseppe Lipari (g.lipari@sssup.it)
6
+	Antoine Bertout (bertout.antoine@gmail.com)
6
 Version: 2.0
7
 Version: 2.0
7
 Date:    2015/05/01
8
 Date:    2015/05/01
8
 
9
 

+ 25
- 23
rtsched.sty View File

1
   %% rtsched.sty
1
   %% rtsched.sty
2
-  %% Copyright 2005 M. G. Lipari
3
-  %
2
+  %% Copyright 2005 Giuseppe Lipari
3
+  %% Copyright 2015 Antoine Bertout <bertout.antoine@gmail.com> Transition from PSTricks to TikZ/PGF.
4
   % This work may be distributed and/or modified under the
4
   % This work may be distributed and/or modified under the
5
   % conditions of the LaTeX Project Public License, either version 1.3
5
   % conditions of the LaTeX Project Public License, either version 1.3
6
   % of this license or (at your option) any later version.
6
   % of this license or (at your option) any later version.
11
   %
11
   %
12
   % This work has the LPPL maintenance status `maintained'.
12
   % This work has the LPPL maintenance status `maintained'.
13
   % 
13
   % 
14
-  % The Current Maintainer of this work is G. Lipari
14
+  % The Current Maintainer of this work is Giuseppe Lipari
15
   %
15
   %
16
-  % This work consists of the file pig.sty.
16
+  % This work consists of the file rtsched.sty.
17
   
17
   
18
   
18
   
19
 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
19
 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
20
-\ProvidesPackage{rtsched}[2005/01/01]
20
+\ProvidesPackage{rtsched}[2015/05/01]
21
 \typeout{'rtsched' style for Latex and TikZ/PGF}
21
 \typeout{'rtsched' style for Latex and TikZ/PGF}
22
 \typeout{Easily draw real-time schedules in TeX/Latex.}
22
 \typeout{Easily draw real-time schedules in TeX/Latex.}
23
 \typeout{(c) 2005, Giuseppe Lipari, Pisa, Italy (g.lipari@sssup.it)}
23
 \typeout{(c) 2005, Giuseppe Lipari, Pisa, Italy (g.lipari@sssup.it)}
24
+\typeout{(c) 2015, Antoine Bertout (bertout.antoine@gmail.com)}
24
 \typeout{Version 2.0}
25
 \typeout{Version 2.0}
25
 
26
 
26
 \RequirePackage{tikz}
27
 \RequirePackage{tikz}
51
 \def\RTDefLineWidth{1pt}
52
 \def\RTDefLineWidth{1pt}
52
 \def\RTDefLineStyle{solid}
53
 \def\RTDefLineStyle{solid}
53
 \def\RTDefExecHeight{1}
54
 \def\RTDefExecHeight{1}
54
-\def\RTArrowStyle{-stealth} %arrow style for deadlines, arrivals and horizontal axes
55
+\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
 % -{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
57
 %-stealth is a predefined more classical arrow style
57
 
58
 
184
     \if\RTAxisInvisible\RTDefAxisInvisible
185
     \if\RTAxisInvisible\RTDefAxisInvisible
185
       \begin{pgfonlayer}{foreground} 
186
       \begin{pgfonlayer}{foreground} 
186
       \foreach \i [evaluate = \i as \j using (\hy -3*\i*\sy)] in {0,...,\ntaskslessone}{
187
       \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);
188
+      \draw [very thick,-\RTArrowStyle] (\sx,\j-3*\sy) -- (\RTWindowLength - \sx,\j-3*\sy);
188
       }
189
       }
189
       \end{pgfonlayer} 
190
       \end{pgfonlayer} 
190
     \fi 
191
     \fi 
251
     \@compute@yy{#2}
252
     \@compute@yy{#2}
252
     \@compute@xx{0}
253
     \@compute@xx{0}
253
     \xxx = \RTWindowLength \advance \xxx by -\sx 
254
     \xxx = \RTWindowLength \advance \xxx by -\sx 
254
-    \draw [\RTLineColor,\RTArrowStyle] (\xx,\yy) -- (\xx,\yyy);
255
-    \psline[linecolor=\RTLineColor]{->}(\xx,\yy)(\xxx,\yy)%
255
+    \draw [\RTLineColor,-\RTArrowStyle] (\xx,\yy) -- (\xx,\yyy);
256
     \@RTExecDefaultValues%
256
     \@RTExecDefaultValues%
257
 }
257
 }
258
 
258
 
261
     \@compute@yy{#2}
261
     \@compute@yy{#2}
262
     \@compute@xx{0}
262
     \@compute@xx{0}
263
     \xxx = \RTWindowLength \advance \xxx by -\sx 
263
     \xxx = \RTWindowLength \advance \xxx by -\sx 
264
-    \draw [\RTLineColor,\RTArrowStyle] (\xx,\yy) -- (\xxx,\yy);
264
+    \draw [\RTLineColor,-\RTArrowStyle] (\xx,\yy) -- (\xxx,\yy);
265
     \yyy = 3\sy \multiply \yyy by #3 \advance \yyy by \yy
265
     \yyy = 3\sy \multiply \yyy by #3 \advance \yyy by \yy
266
     \advance \yyy by -\sy
266
     \advance \yyy by -\sy
267
-    \draw [\RTLineColor,\RTArrowStyle] (\xx,\yy) -- (\xx,\yyy);
267
+    \draw [\RTLineColor,-\RTArrowStyle] (\xx,\yy) -- (\xx,\yyy);
268
     \@RTExecDefaultValues%
268
     \@RTExecDefaultValues%
269
 }
269
 }
270
 
270
 
287
     \@compute@xx{#3}
287
     \@compute@xx{#3}
288
     \yyy = \yy \advance \yyy by 2\sy%
288
     \yyy = \yy \advance \yyy by 2\sy%
289
      \begin{pgfonlayer}{foreground} 
289
      \begin{pgfonlayer}{foreground} 
290
-    \draw [\RTLineColor, thick,\RTArrowStyle] (\xx,\yy) -- (\xx,\yyy);
290
+    \draw [\RTLineColor, thick,-\RTArrowStyle] (\xx,\yy) -- (\xx,\yyy);
291
      \end{pgfonlayer}
291
      \end{pgfonlayer}
292
 
292
 
293
     \@RTExecDefaultValues%
293
     \@RTExecDefaultValues%
303
   \@compute@xx{#3}
303
   \@compute@xx{#3}
304
   \yyy = \yy \advance \yyy by 2\sy
304
   \yyy = \yy \advance \yyy by 2\sy
305
   \begin{pgfonlayer}{foreground} 
305
   \begin{pgfonlayer}{foreground} 
306
-  \draw [\RTLineColor, thick,\RTArrowStyle] (\xx,\yy) -- (\xx,\yyy);
306
+  \draw [\RTLineColor, thick,-\RTArrowStyle] (\xx,\yy) -- (\xx,\yyy);
307
   \end{pgfonlayer}
307
   \end{pgfonlayer}
308
   \advance \xx by #4\sx
308
   \advance \xx by #4\sx
309
   \begin{pgfonlayer}{foreground} 
309
   \begin{pgfonlayer}{foreground} 
310
-  \draw [\RTLineColor, thick,\RTArrowStyle] (\xx,\yyy) -- (\xx,\yy);
310
+  \draw [\RTLineColor, thick, -\RTArrowStyle] (\xx,\yyy) -- (\xx,\yy);
311
   \end{pgfonlayer}
311
   \end{pgfonlayer}
312
   \@RTExecDefaultValues
312
   \@RTExecDefaultValues
313
 }
313
 }
322
   \@compute@xx{#3}
322
   \@compute@xx{#3}
323
   \yyy = \yy \advance \yyy by 2\sy
323
   \yyy = \yy \advance \yyy by 2\sy
324
   \begin{pgfonlayer}{foreground} 
324
   \begin{pgfonlayer}{foreground} 
325
-  \draw [\RTLineColor, thick,<-] (\xx,\yy) -- (\xx,\yyy);
325
+  \draw [\RTLineColor, thick, \RTArrowStyle-] (\xx,\yy) -- (\xx,\yyy);
326
   \end{pgfonlayer}
326
   \end{pgfonlayer}
327
   \@RTExecDefaultValues
327
   \@RTExecDefaultValues
328
 }
328
 }
333
   \@compute@xx{#3}
333
   \@compute@xx{#3}
334
   \yyy = \yy \advance \yyy by \RTExecHeight\sy
334
   \yyy = \yy \advance \yyy by \RTExecHeight\sy
335
   \@compute@xxx{#4}
335
   \@compute@xxx{#4}
336
- \draw [fill=\RTTaskColor,\RTTaskFill,draw=\RTLineColor, thick] (\xx,\yy) rectangle (\xxx,\yyy);
336
+  \draw [fill=\RTTaskColor,\RTTaskFill,draw=\RTLineColor, thick] (\xx,\yy) rectangle (\xxx,\yyy);
337
   \advance \xx by \xxx \xx = .5\xx
337
   \advance \xx by \xxx \xx = .5\xx
338
- \draw (\xx,\yy) node[above, font=\rtfont] {\RTNumberLabelSize \RTExecLabel};%\RTNumberLabelSize
338
+  \advance \yy by .5\RTExecHeight\sy
339
+  \draw (\xx,\yy) node[font=\rtfont] {\RTNumberLabelSize \RTExecLabel};%\RTNumberLabelSize
339
   \@RTExecDefaultValues
340
   \@RTExecDefaultValues
340
 }
341
 }
341
 %
342
 %
349
   \@compute@yy{#2}
350
   \@compute@yy{#2}
350
   \@compute@xx{#3}
351
   \@compute@xx{#3}
351
   \yyy = \yy \advance \yyy by \sy
352
   \yyy = \yy \advance \yyy by \sy
352
-   \node[above,font=\rtfont] at (\xx , \yyy) {\RTNumberLabelSize L(#4)}; %\RTNumberLabelSize
353
+  \advance \yyy by .5\sy
354
+  \node[font=\rtfont] at (\xx , \yyy) {\RTNumberLabelSize L(#4)}; %\RTNumberLabelSize
353
   \@RTExecDefaultValues
355
   \@RTExecDefaultValues
354
 }
356
 }
355
 %
357
 %
363
   \@compute@yy{#2}
365
   \@compute@yy{#2}
364
   \@compute@xx{#3}
366
   \@compute@xx{#3}
365
   \yyy = \yy \advance \yyy by \sy
367
   \yyy = \yy \advance \yyy by \sy
366
-   \node[above, font=\rtfont] at (\xx , \yyy) {\RTNumberLabelSize U(#4)}; %\RTNumberLabelSize
368
+  \advance \yyy by .5\sy
369
+  \node[font=\rtfont] at (\xx , \yyy) {\RTNumberLabelSize U(#4)}; %\RTNumberLabelSize
367
   \@RTExecDefaultValues
370
   \@RTExecDefaultValues
368
 }
371
 }
369
 %
372
 %
396
   \yyy = -3\sy \multiply \yyy by #3 \advance \yyy by \sy
399
   \yyy = -3\sy \multiply \yyy by #3 \advance \yyy by \sy
397
   \advance \yyy by \hy \advance \yyy by -\sy % \RTWindowHeight
400
   \advance \yyy by \hy \advance \yyy by -\sy % \RTWindowHeight
398
   \begin{pgfonlayer}{foreground} 
401
   \begin{pgfonlayer}{foreground} 
399
-  \draw [dashed, thick,\RTArrowStyle] (\xx,\yy) -- (\xx,\yyy);
402
+  \draw [dashed, thick,-\RTArrowStyle] (\xx,\yy) -- (\xx,\yyy);
400
   \end{pgfonlayer}
403
   \end{pgfonlayer}
401
   \@RTExecDefaultValues
404
   \@RTExecDefaultValues
402
 }
405
 }
416
   \advance \yyy by \hy %\advance \yyy by -\sy %\RTWindowHeight
419
   \advance \yyy by \hy %\advance \yyy by -\sy %\RTWindowHeight
417
   \xxx = #5\sx \advance \xxx by \sx
420
   \xxx = #5\sx \advance \xxx by \sx
418
    \begin{pgfonlayer}{foreground} 
421
    \begin{pgfonlayer}{foreground} 
419
-  \draw [dashed, thick,\RTArrowStyle] (\xx,\yy) -- (\xxx,\yyy);
422
+  \draw [dashed, thick,-\RTArrowStyle] (\xx,\yy) -- (\xxx,\yyy);
420
    \end{pgfonlayer}
423
    \end{pgfonlayer}
421
 
424
 
422
 }
425
 }
465
 \newcommand{\RowLabel}[3][nocommand=1]{
468
 \newcommand{\RowLabel}[3][nocommand=1]{
466
   \setkeys{RT}{#1}%
469
   \setkeys{RT}{#1}%
467
   \@compute@yy{#2}
470
   \@compute@yy{#2}
468
-  \advance \yy by 1.5\sy
471
+  \advance \yy by 2\sy
469
   \xx = \RTRowLabelOffset %\advance \xx by \sx
472
   \xx = \RTRowLabelOffset %\advance \xx by \sx
470
   \node[below left,font=\rtfont] at (-\xx , \yy) {\RTTaskLabelSize #3};%\RTTaskLabelSize
473
   \node[below left,font=\rtfont] at (-\xx , \yy) {\RTTaskLabelSize #3};%\RTTaskLabelSize
471
 }
474
 }
506
   \@RTExecDefaultValues
509
   \@RTExecDefaultValues
507
 }
510
 }
508
 
511
 
509
-
510
 \@ifclassloaded{beamer}{
512
 \@ifclassloaded{beamer}{
511
   \renewcommand<>{\TaskArrival}[3][nocommand=1]{
513
   \renewcommand<>{\TaskArrival}[3][nocommand=1]{
512
     \only#4{\beameroriginal{\TaskArrival}[#1]{#2}{#3}}
514
     \only#4{\beameroriginal{\TaskArrival}[#1]{#2}{#3}}

Loading…
Cancel
Save