Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
2101 georgesk 1
!if  $wims_read_parm!=slib_header
2
 !goto proc
3
!endif
4162 bpr 4
 
4351 bpr 5
slib_author=Georges, Khaznadar
2101 georgesk 6
 
7
!exit
8
 
9
:proc
10
 
11
!reset slib_xd, slib_yd, slib_xo, slib_yo, slib_xs, slib_ys, slib_list, slib_x, slib_y, slib_labx, slib_laby, slib_maxx, slib_maxy
12
 
13
slib_parm=!item 1 to 6 of $wims_read_parm
14
!distribute item $slib_parm into slib_xd, slib_yd, slib_xo, slib_yo, slib_xs, slib_ys
15
slib_list=!item 7 to -1 of $wims_read_parm
16
 
17
!default slib_xd=8
18
!default slib_yd=8
19
!default slib_xo=1
20
!default slib_yo=1
21
!default slib_xs=1
22
!default slib_ys=1
23
!default slib_list=0,0
24
 
25
slib_list=!declosing $slib_list
26
 
27
slib_labx=!word 2 to -1 of $slib_xs
28
slib_laby=!word 2 to -1 of $slib_ys
29
slib_xs=!word 1 of $slib_xs
30
slib_ys=!word 1 of $slib_ys
31
 
32
slib_maxx=!word 1 of $slib_labx
33
!if $slib_maxx = max
34
  slib_labx = !word 2 to -1 of $slib_labx
35
  !! we need to compute the X step slib_xs, given the values
36
  !! of the total width slib_xd, abscissa of origin slib_xo
37
  !! and knowing that slib_xs currently means a maximum value.
38
  !! slib_xd-slib_xo must be be sufficient to display ticks greater
39
  !! than the current value of slib_xs, the tick step being a multiple
40
  !! of 1, 2 or 5.
41
  slib_log=$[log10($slib_xs/($slib_xd-$slib_xo))]
42
  slib_logint=$[floor($slib_log)]
43
  slib_logmant=$[$slib_log-$slib_logint]
44
  !if $slib_logmant > $[log10(5)]
45
     slib_xs=1e$[$slib_logint+1]
46
  !else
47
    !if $slib_logmant > $[log10(2)]
48
      slib_xs=5e$slib_logint
49
    !else
50
      slib_xs=2e$slib_logint
51
    !endif
52
  !endif
53
!else
54
  slib_maxx=$empty
55
!endif
56
 
57
slib_maxy=!word 1 of $slib_laby
58
!if $slib_maxy = max
59
  slib_laby = !word 2 to -1 of $slib_laby
60
  !! we need to compute the Y step slib_ys, given the values
61
  !! of the total height slib_yd, ordinate of origin slib_yo
62
  !! and knowing that slib_ys currently means a maximum value.
63
  !! slib_yd-slib_yo must be be sufficient to display ticks greater
64
  !! than the current value of slib_ys, the tick step being a multiple
65
  !! of 1, 2 or 5.
66
  slib_log=$[log10($slib_ys/($slib_yd-$slib_yo))]
67
  slib_logint=$[floor($slib_log)]
68
  slib_logmant=$[$slib_log-$slib_logint]
69
  !if $slib_logmant > $[log10(5)]
70
     slib_ys=1e$[$slib_logint+1]
71
  !else
72
    !if $slib_logmant > $[log10(2)]
73
      slib_ys=5e$slib_logint
74
    !else
75
      slib_ys=2e$slib_logint
76
    !endif
77
  !endif
78
!else
79
  slib_maxy=$empty
80
!endif
81
 
82
 
83
!!!!!! values from millimetre !!!!
84
!! new 60*$slib_xd,60*$slib_yd
85
!! xrange -0.5, 10*$slib_xd-0.5
86
!! yrange -0.5, 10*$slib_yd-0.5
87
 
88
slib_out=
89
!while void$slib_list != void
90
  slib_x=!item 1 of $slib_list
91
  slib_y=!item 2 of $slib_list
92
  slib_out=$slib_out, $[10*($slib_x+$slib_xo)]
93
  slib_out=$slib_out, $[10*($slib_y+$slib_yo)]
94
  slib_list=!item 3 to -1 of $slib_list
95
!endwhile
96
 
97
slib_out=!item 2 to -1 of $slib_out
98
!!! suppression de la virgule en trop au début