Browse Source

Add of TaskEnd and TaskNEnd commands that draw little circle(s) to specify end of job execution

Antoine Bertout 9 years ago
parent
commit
f61ed996e5
1 changed files with 51 additions and 0 deletions
  1. 51
    0
      rtsched.sty

+ 51
- 0
rtsched.sty View File

@@ -28,7 +28,21 @@
28 28
 \usetikzlibrary{shadows, patterns}
29 29
 \RequirePackage{keyval}
30 30
 \newcommand\rtfont{\usefont{T1}{phv}{m}{n}}
31
+\@ifpackagelater{pgf}{2008/01/15}
32
+{
33
+ %pgf package date is 2008/01/15 or later
34
+}
35
+{
36
+ %pgf package date is older than 2008/01/15
37
+\PackageError{rtsched}{%
38
+rtsched requires version 2.10 of pgf or greater\MessageBreak
31 39
 
40
+}{%
41
+Please update pgf to version 2.10 minimum!\MessageBreak
42
+\space \space Try typing \space \protect\pgfversion
43
+\space to print your current version of pgf.
44
+}
45
+}
32 46
 
33 47
 %%
34 48
 %% These can be changed at any time
@@ -510,6 +524,37 @@
510 524
 \@RTExecDefaultValues
511 525
 
512 526
 }
527
+
528
+% TaskEnd
529
+% Task end: draws a circle when the job terminates
530
+% par 1: task number from 1 to n
531
+% par 2: slot number from 0 to l-1
532
+\newcommand{\TaskEnd}[3][nocommand=1]{%
533
+  \setkeys{RT}{#1}%
534
+  \@compute@yy{#2}
535
+  \@compute@xx{#3}
536
+  \yyy = \yy \advance \yyy by 2\sy%
537
+  \begin{pgfonlayer}{foreground} 
538
+  \draw[fill] (\xx,\yy) circle (1.5pt);
539
+  \end{pgfonlayer}
540
+  \@RTExecDefaultValues%
541
+}
542
+
543
+%
544
+% TaskNEnd
545
+% Task ends: draws periodically a circle when the job terminates
546
+% par 1  : task number from 1 to n
547
+% par 2  : slot number from 0 to l-1
548
+% par 3  : period
549
+% par 4  : number of instances
550
+\newcommand{\TaskNEnd}[5][nocommand=1]{%
551
+ \foreach \instance [evaluate = \instance as \activation using (#3 + \instance * #4)] in {0,...,\numexpr #5-1}{
552
+ \TaskEnd[#1]{#2}{\activation}{#4}
553
+ }
554
+}
555
+
556
+
557
+
513 558
 %% %
514 559
 % % par 1: task
515 560
 % % par 2: first instant (arrival)
@@ -649,6 +694,12 @@
649 694
   \renewcommand<>{\TaskInterval}[5][nocommand=1]{
650 695
     \only#6{\beameroriginal{\TaskInterval}[#1]{#2}{#3}{#4}{#5}}
651 696
   }
697
+  \renewcommand<>{\TaskEnd}[3][nocommand=1]{
698
+    \only#4{\beameroriginal{\TaskEnd}[#1]{#2}{#3}}
699
+  }
700
+  \renewcommand<>{\TaskNEnd}[5][nocommand=1]{
701
+    \only#6{\beameroriginal{\TaskNEnd}[#1]{#2}{#3}{#4}{#5}}
702
+  }
652 703
 }
653 704
 {\typeout{beamer not loaded}}
654 705
 

Loading…
Cancel
Save