Subversion Repositories wimsdev

Rev

Rev 7692 | Details | Compare with Previous | Last modification | View Log | RSS feed

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