Subversion Repositories wimsdev

Rev

Rev 13135 | Blame | Compare with Previous | Last modification | View Log | RSS feed

# Variable calculations should be done in this file.
# It is read and interpreted by wims for all valid calls to the module.
!read adm/language lang/names.phtml
!read tabletheme

!if $job=map
  !changeto map.proc
!endif
max_modules=50



!if $cmd=new or $cmd=renew
  sitestart=!mexec getstart.sh
!endif

!bound style within day,week,month,year,beginning default week
!bound plot_type within 2,3,4 default 2

start_year=!char 1,2,3,4 of $sitestart
start_month=!char 5,6 of $sitestart
start_day=!char 7,8 of $sitestart
insplot_set=timefmt "%Y%m%d"; xdata time; tmargin 1; nomxtics; nox2tics; size 0.7,0.7
insplot_transparent=white
module_type=!item $plot_type of 1,1,2,3
!read adm/class/stat

!if $cmd=reply
  show=yes
  !read date
  !if $date1<$start_year$start_month$start_day
    date1=$start_year$start_month$start_day
  !endif
  stat_out=!mexec stat.sh
  !read stat
  wims_module_log=$cnt $style modules=$modules
!endif

!for i in 1,2
  year$i=!char 1 to 4 of $(date$i)
  month$i=!char 5,6 of $(date$i)
  day$i=!char 7,8 of $(date$i)
  date_$i=!date -d $(date$i) '+%j'
!next i

laps=!eval ($year2-$year1)*365+$date_2-$date_1+1
!ifval floor($year1/4)<floor($year2/4) and floor($year1/100)=floor($year2/100)
  laps=!eval $laps+1
!endif

# plotting data
!if $cmd=reply
  !if $laps<20
    step=1
    dateformat=$format1
  !else
    !if $laps<36
      step=2
      dateformat=$format1
    !else
      !if $laps<70
        step=4
        dateformat=$format2
      !else
        step=!eval 7*ceil($laps/(7*50))
        dateformat=$format3
      !endif
    !endif
  !endif
  insplot_set=$insplot_set;format x "$dateformat"
  insplot_data=!mexec plotdata.sh
!endif