Rev 4351 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
839 | georgesk | 1 | !if $wims_read_parm!=slib_header |
2 | !goto proc |
||
3 | !endif |
||
4162 | bpr | 4 | |
4351 | bpr | 5 | slib_author=Georges, Khaznadar |
4162 | bpr | 6 | |
839 | georgesk | 7 | slib_example= 12,8,0,0,1,1,2,4\ |
8 | 12,8,0,0,1 max t (ms),1 max U (V),2,4 |
||
9 | |||
10 | !exit |
||
11 | |||
12 | :proc |
||
13 | |||
14 | !reset slib_xd, slib_yd, slib_xo, slib_yo, slib_xs, slib_ys, slib_xc, slib_yc, slib_coords, slib_labx, slib_laby, slib_maxx, slib_maxy |
||
15 | |||
16 | slib_parm=!item 1 to 6 of $wims_read_parm |
||
17 | !distribute item $slib_parm into slib_xd, slib_yd, slib_xo, slib_yo, slib_xs, slib_ys |
||
18 | |||
19 | slib_coords=!item 7 to -1 of $wims_read_parm |
||
20 | |||
21 | !default slib_xd=8 |
||
22 | !default slib_yd=8 |
||
23 | !default slib_xo=1 |
||
24 | !default slib_yo=1 |
||
25 | !default slib_xs=1 |
||
26 | !default slib_ys=1 |
||
27 | !default slib_xc=0 |
||
28 | !default slib_yc=0 |
||
29 | |||
30 | slib_labx=!word 2 to -1 of $slib_xs |
||
31 | slib_laby=!word 2 to -1 of $slib_ys |
||
32 | slib_xs=!word 1 of $slib_xs |
||
33 | slib_ys=!word 1 of $slib_ys |
||
34 | slib_coords= !declosing $slib_coords |
||
35 | |||
36 | slib_maxx=!word 1 of $slib_labx |
||
37 | !if $slib_maxx = max |
||
38 | slib_labx = !word 2 to -1 of $slib_labx |
||
39 | !! we need to compute the X step slib_xs, given the values |
||
40 | !! of the total width slib_xd, abscissa of origin slib_xo |
||
41 | !! and knowing that slib_xs currently means a maximum value. |
||
42 | !! slib_xd-slib_xo must be be sufficient to display ticks greater |
||
43 | !! than the current value of slib_xs, the tick step being a multiple |
||
44 | !! of 1, 2 or 5. |
||
45 | slib_log=$[log10($slib_xs/($slib_xd-$slib_xo))] |
||
46 | slib_logint=$[floor($slib_log)] |
||
47 | slib_logmant=$[$slib_log-$slib_logint] |
||
48 | !if $slib_logmant > $[log10(5)] |
||
49 | slib_xs=1e$[$slib_logint+1] |
||
50 | !else |
||
51 | !if $slib_logmant > $[log10(2)] |
||
52 | slib_xs=5e$slib_logint |
||
53 | !else |
||
54 | slib_xs=2e$slib_logint |
||
55 | !endif |
||
56 | !endif |
||
57 | !else |
||
58 | slib_maxx=$empty |
||
59 | !endif |
||
60 | |||
61 | slib_maxy=!word 1 of $slib_laby |
||
62 | !if $slib_maxy = max |
||
63 | slib_laby = !word 2 to -1 of $slib_laby |
||
64 | !! we need to compute the Y step slib_ys, given the values |
||
65 | !! of the total height slib_yd, ordinate of origin slib_yo |
||
66 | !! and knowing that slib_ys currently means a maximum value. |
||
67 | !! slib_yd-slib_yo must be be sufficient to display ticks greater |
||
68 | !! than the current value of slib_ys, the tick step being a multiple |
||
69 | !! of 1, 2 or 5. |
||
70 | slib_log=$[log10($slib_ys/($slib_yd-$slib_yo))] |
||
71 | slib_logint=$[floor($slib_log)] |
||
72 | slib_logmant=$[$slib_log-$slib_logint] |
||
73 | !if $slib_logmant > $[log10(5)] |
||
74 | slib_ys=1e$[$slib_logint+1] |
||
75 | !else |
||
76 | !if $slib_logmant > $[log10(2)] |
||
77 | slib_ys=5e$slib_logint |
||
78 | !else |
||
79 | slib_ys=2e$slib_logint |
||
80 | !endif |
||
81 | !endif |
||
82 | !else |
||
83 | slib_maxy=$empty |
||
84 | !endif |
||
85 | |||
86 | |||
87 | !!!!!! values from millimetre !!!! |
||
88 | !! new 60*$slib_xd,60*$slib_yd |
||
89 | !! xrange -0.5, 10*$slib_xd-0.5 |
||
90 | !! yrange -0.5, 10*$slib_yd-0.5 |
||
91 | |||
92 | slib_out= |
||
93 | |||
94 | slib_len=!itemcnt $slib_coords |
||
95 | !for slib_i=1 to $slib_len step 2 |
||
96 | slib_x= !item 1 of $slib_coords |
||
97 | slib_y= !item 2 of $slib_coords |
||
98 | slib_coords= !item 3 to -1 of $slib_coords |
||
99 | slib_x=!eval 60*(0.05+$slib_xo+$slib_x/$slib_xs) |
||
100 | slib_y=!eval 60*($slib_yd-0.05-$slib_yo-$slib_y/$slib_ys) |
||
101 | slib_out= $slib_out $slib_x, $slib_y, |
||
102 | !next slib_i |
||
103 | |||
104 | slib_out=!item 1 to -2 of $slib_out |