Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
20 reyssat 1
!if  $wims_read_parm!=slib_header
13594 bpr 2
  !goto proc
20 reyssat 3
!endif
4162 bpr 4
 
4351 bpr 5
slib_author=Georges, Khaznadar
4162 bpr 6
 
20 reyssat 7
slib_example= 12,8,0,0,1,1,125,13\
8
12,8,0,0,1 max t (ms),1 max U (V),125,13
9
 
7692 bpr 10
 
20 reyssat 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_x, slib_y, slib_labx, slib_laby, slib_maxx, slib_maxy
16
 
17
slib_parm=!item 1 to 8 of $wims_read_parm
18
!distribute item $slib_parm into slib_xd, slib_yd, slib_xo, slib_yo, slib_xs, slib_ys, slib_xc, slib_yc
19
 
20
!default slib_xd=8
21
!default slib_yd=8
22
!default slib_xo=1
23
!default slib_yo=1
24
!default slib_xs=1
25
!default slib_ys=1
26
!default slib_xc=0
27
!default slib_yc=0
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)]
13594 bpr 47
    slib_xs=1e$[$slib_logint+1]
20 reyssat 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
 
85
!!!!!! values from millimetre !!!!
86
!! new 60*$slib_xd,60*$slib_yd
87
!! xrange -0.5, 10*$slib_xd-0.5
88
!! yrange -0.5, 10*$slib_yd-0.5
89
 
90
slib_x=$[($slib_xc/60-0.05-$slib_xo)*$slib_xs]
91
slib_y=$[(-$slib_yc/60-0.05+$slib_yd-$slib_yo)*$slib_ys]
92
 
93
slib_out= $slib_x, $slib_y,