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
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
 
11
!exit
12
 
13
:proc
14
 
15
!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
16
 
17
slib_parm=!item 1 to 6 of $wims_read_parm
18
!distribute item $slib_parm into slib_xd, slib_yd, slib_xo, slib_yo, slib_xs, slib_ys
19
 
20
slib_coords=!item 7 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
!default slib_xc=0
29
!default slib_yc=0
30
 
31
slib_labx=!word 2 to -1 of $slib_xs
32
slib_laby=!word 2 to -1 of $slib_ys
33
slib_xs=!word 1 of $slib_xs
34
slib_ys=!word 1 of $slib_ys
35
slib_coords= !declosing $slib_coords
36
 
37
slib_maxx=!word 1 of $slib_labx
38
!if $slib_maxx = max
39
  slib_labx = !word 2 to -1 of $slib_labx
40
  !! we need to compute the X step slib_xs, given the values
41
  !! of the total width slib_xd, abscissa of origin slib_xo
42
  !! and knowing that slib_xs currently means a maximum value.
43
  !! slib_xd-slib_xo must be be sufficient to display ticks greater
44
  !! than the current value of slib_xs, the tick step being a multiple
45
  !! of 1, 2 or 5.
46
  slib_log=$[log10($slib_xs/($slib_xd-$slib_xo))]
47
  slib_logint=$[floor($slib_log)]
48
  slib_logmant=$[$slib_log-$slib_logint]
49
  !if $slib_logmant > $[log10(5)]
50
     slib_xs=1e$[$slib_logint+1]
51
  !else
52
    !if $slib_logmant > $[log10(2)]
53
      slib_xs=5e$slib_logint
54
    !else
55
      slib_xs=2e$slib_logint
56
    !endif
57
  !endif
58
!else
59
  slib_maxx=$empty
60
!endif
61
 
62
slib_maxy=!word 1 of $slib_laby
63
!if $slib_maxy = max
64
  slib_laby = !word 2 to -1 of $slib_laby
65
  !! we need to compute the Y step slib_ys, given the values
66
  !! of the total height slib_yd, ordinate of origin slib_yo
67
  !! and knowing that slib_ys currently means a maximum value.
68
  !! slib_yd-slib_yo must be be sufficient to display ticks greater
69
  !! than the current value of slib_ys, the tick step being a multiple
70
  !! of 1, 2 or 5.
71
  slib_log=$[log10($slib_ys/($slib_yd-$slib_yo))]
72
  slib_logint=$[floor($slib_log)]
73
  slib_logmant=$[$slib_log-$slib_logint]
74
  !if $slib_logmant > $[log10(5)]
75
     slib_ys=1e$[$slib_logint+1]
76
  !else
77
    !if $slib_logmant > $[log10(2)]
78
      slib_ys=5e$slib_logint
79
    !else
80
      slib_ys=2e$slib_logint
81
    !endif
82
  !endif
83
!else
84
  slib_maxy=$empty
85
!endif
86
 
87
 
88
!!!!!! values from millimetre !!!!
89
!! new 60*$slib_xd,60*$slib_yd
90
!! xrange -0.5, 10*$slib_xd-0.5
91
!! yrange -0.5, 10*$slib_yd-0.5
92
 
93
slib_out=
94
 
95
slib_len=!itemcnt $slib_coords
96
!for slib_i=1 to $slib_len step 2
97
  slib_x= !item 1 of $slib_coords
98
  slib_y= !item 2 of $slib_coords
99
  slib_coords= !item 3 to -1 of $slib_coords
100
  slib_x=!eval 60*(0.05+$slib_xo+$slib_x/$slib_xs)
101
  slib_y=!eval 60*($slib_yd-0.05-$slib_yo-$slib_y/$slib_ys)
102
  slib_out= $slib_out $slib_x, $slib_y,
103
!next slib_i
104
 
105
slib_out=!item 1 to -2 of $slib_out