Subversion Repositories wimsdev

Rev

Rev 4162 | Rev 7692 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
475 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
 
475 georgesk 7
slib_example= ,,,,,,,,,0,0,1.2,1.5,2.4,3.2\
8
12,8,0,0,1 max t (ms),1 max U (V),blue,red,[255,128,128],[,1,1,,Hello at 1,1],[red,5,2,large,Large red hello at 5,2]
9
 
10
 
11
!exit
12
 
13
:proc
14
 
15
!reset slib_xd, slib_yd, slib_bg, slib_lc, slib_dc, slib_strings, slib_xo, slib_yo, slib_xs, slib_ys, slib_labx, slib_laby, slib_maxx, slib_maxy
16
 
17
slib_parm=!item 1 to 9 of $wims_read_parm
18
!distribute item $slib_parm into slib_xd, slib_yd, slib_xo, slib_yo, slib_xs, slib_ys, slib_bg, slib_lc, slib_dc
19
 
20
slib_strings=!item 10 to -1 of $wims_read_parm
21
 
22
!default slib_xd=8
23
!default slib_yd=8
24
!default slib_xo=1
25
!default slib_yo=1
26
!default slib_xs=1
27
!default slib_ys=1
28
 
29
slib_labx=!word 2 to -1 of $slib_xs
30
slib_laby=!word 2 to -1 of $slib_ys
31
slib_xs=!word 1 of $slib_xs
32
slib_ys=!word 1 of $slib_ys
33
 
34
slib_maxx=!word 1 of $slib_labx
35
!if $slib_maxx = max
36
  slib_labx = !word 2 to -1 of $slib_labx
37
  !! we need to compute the X step slib_xs, given the values
38
  !! of the total width slib_xd, abscissa of origin slib_xo
39
  !! and knowing that slib_xs currently means a maximum value.
40
  !! slib_xd-slib_xo must be be sufficient to display ticks greater
41
  !! than the current value of slib_xs, the tick step being a multiple
42
  !! of 1, 2 or 5.
43
  slib_log=$[log10($slib_xs/($slib_xd-$slib_xo))]
44
  slib_logint=$[floor($slib_log)]
45
  slib_logmant=$[$slib_log-$slib_logint]
46
  !if $slib_logmant > $[log10(5)]
47
     slib_xs=1e$[$slib_logint+1]
48
  !else
49
    !if $slib_logmant > $[log10(2)]
50
      slib_xs=5e$slib_logint
51
    !else
52
      slib_xs=2e$slib_logint
53
    !endif
54
  !endif
55
!else
56
  slib_maxx=$empty
57
!endif
58
 
59
slib_maxy=!word 1 of $slib_laby
60
!if $slib_maxy = max
61
  slib_laby = !word 2 to -1 of $slib_laby
62
  !! we need to compute the Y step slib_ys, given the values
63
  !! of the total height slib_yd, ordinate of origin slib_yo
64
  !! and knowing that slib_ys currently means a maximum value.
65
  !! slib_yd-slib_yo must be be sufficient to display ticks greater
66
  !! than the current value of slib_ys, the tick step being a multiple
67
  !! of 1, 2 or 5.
68
  slib_log=$[log10($slib_ys/($slib_yd-$slib_yo))]
69
  slib_logint=$[floor($slib_log)]
70
  slib_logmant=$[$slib_log-$slib_logint]
71
  !if $slib_logmant > $[log10(5)]
72
     slib_ys=1e$[$slib_logint+1]
73
  !else
74
    !if $slib_logmant > $[log10(2)]
75
      slib_ys=5e$slib_logint
76
    !else
77
      slib_ys=2e$slib_logint
78
    !endif
79
  !endif
80
!else
81
  slib_maxy=$empty
82
!endif
83
 
84
slib_dc=!declosing $slib_dc
85
 
86
slib_bg=!declosing $slib_bg
87
!default slib_bg=240,233,255
88
 
89
slib_lc=!declosing $slib_lc
90
!default slib_lc=255,220,180
91
 
92
slib_dc=!declosing $slib_dc
93
!default slib_dc=10,10,10
94
 
95
!!!!!!!!!!!!!!!!! no grid !!!!!!!!!!!!!!!!!!!!!!!!!
96
 
97
slib_dessin = 
98
 
99
slib_i=0
100
!for slib_s in $slib_strings
101
  slib_s = !declosing $slib_s
102
  slib_parm = !item 1 to 4 of $slib_s
103
  !reset slib_c, slib_size, slib_text
104
  !distribute item $slib_parm into slib_c,slib_x,slib_y,slib_size
105
  !default slib_c black
106
  !default slib_size medium
107
  slib_text = !item 5 to -1 of $slib_s
108
  slib_y = $[10*$slib_y/$slib_ys]
109
  slib_y = $[10*$slib_yo+$slib_y]
110
  slib_x=$[10*$slib_x/$slib_xs]
111
  slib_x=$[10*$slib_xo+$slib_x]
112
  slib_dessin= $slib_dessin \
113
  text $slib_c,$slib_x,$slib_y,$slib_size,$slib_text
114
!next slib_s
115
 
116
slib_out= $slib_dessin