aboutsummaryrefslogtreecommitdiffstats
path: root/mail/quickml/files/patch-quickml-analog.in
blob: 7790b94d618344a59b9fd1bd78cbd90bca1ed918 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
*** quickml-analog.in.orig  2004-06-07 17:50:59.000000000 +0900
--- quickml-analog.in   2005-01-07 19:11:59.000000000 +0900
***************
*** 15,20 ****
--- 15,21 ----
  require 'ftools'
  require 'time'
  require 'cgi'
+ require 'open3'
  
  class Array
    def tail (n)
***************
*** 395,413 ****
    end
  
    def add_basic (f)
!     f.print '
!     set grid
!     set timefmt "%y%m%d%H"
!     set xdata time
!     set size ratio 0.76
!     set linestyle 1 linetype 1 linewidth 5
!     set linestyle 2 linetype 3 linewidth 5
!     set linestyle 3 linetype 2 linewidth 5
!     set linestyle 4 linetype 4 linewidth 5
!     set linestyle 5 linetype 5 linewidth 5
!     set linestyle 6 linetype 7 linewidth 5
  
!     '.gsub(/^    /, "")
    end
  
    def add_chart (f, default, lang, chart_prefix, stat_files, type, 
--- 396,435 ----
    end
  
    def add_basic (f)
!     Open3.popen3( "gnuplot" ) { |stdin, stdout, stderr|
!       stdin.puts "show version"
!       stdin.close
!       stderr.read[/[Vv]ersion (\d+\.\d+)/]
!     }
!     if ( Float( $1 ) < 4.0 ) then
!       f.print '
!       set grid
!       set timefmt "%y%m%d%H"
!       set xdata time
!       set size ratio 0.76
!       set linestyle 1 linetype 1 linewidth 5
!       set linestyle 2 linetype 3 linewidth 5
!       set linestyle 3 linetype 2 linewidth 5
!       set linestyle 4 linetype 4 linewidth 5
!       set linestyle 5 linetype 5 linewidth 5
!       set linestyle 6 linetype 7 linewidth 5
  
!       '.gsub(/^    /, "")
!     else
!        f.print '
!        set grid
!        set timefmt "%y%m%d%H"
!        set xdata time
!        set size ratio 0.76
!        set style line 1 linetype 1 linewidth 5
!        set style line 2 linetype 3 linewidth 5
!        set style line 3 linetype 2 linewidth 5
!        set style line 4 linetype 4 linewidth 5
!        set style line 5 linetype 5 linewidth 5
!        set style line 6 linetype 7 linewidth 5
! 
!        '.gsub(/^    /, "")
!     end
    end
  
    def add_chart (f, default, lang, chart_prefix, stat_files, type,