Subversion Repositories wimsdev

Rev

Rev 2101 | Go to most recent revision | 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
 
2101 georgesk 5
slib_author=Georges KHAZNADAR
6
slib_out= list of coordinates (x1, y1, ...) in graphpaper's pixel space
7
slib_comment=The 6 first parameters are the same as in\
8
slib/graphpaper/millimetre
9
 
10
 
11
!exit
12
 
13
:proc
14
 
15
!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
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
slib_list=!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_list=0,0
28
 
29
slib_list=!declosing $slib_list
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
 
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
!while void$slib_list != void
94
  slib_x=!item 1 of $slib_list
95
  slib_y=!item 2 of $slib_list
96
  slib_out=$slib_out, $[10*($slib_x+$slib_xo)]
97
  slib_out=$slib_out, $[10*($slib_y+$slib_yo)]
98
  slib_list=!item 3 to -1 of $slib_list
99
!endwhile
100
 
101
slib_out=!item 2 to -1 of $slib_out
102
!!! suppression de la virgule en trop au début