#!/usr/bin/env ruby
#
# 表題: ape お絵描きサムネイル HTML 作成スクリプト
#
# 履歴: 2003/09/28 やまだ由 
#
# 注意: 本プログラムは, 
#       dcphoto.pl Ver 1.02 - 写真用 HTML作成スクリプト
#       Mitsuda Chihiro   <totera@ep.sci.hokudai.ac.jp>
#       を ruby で写経し, やまだ由用にカスタマイズしたものである 
#
#
#
#

END{

#  $exp_list = [ "fr_",
#    "fr_fs_df_", "fr_fv_df_" , "fr_fvs_df_", "fr_fvs_dfm_", "fr_nvs_m_" ,
#    #-----
#    "fr_fvs_df_2times_", "fr_fvs_df_10times_", "fr_fvs_df_20times_", 
#    "fr_fvs_df_50times_",
#    "fr_fvs_df_half_", #"fvs_df_tenth" ,
#    #-----
#    "fr_fvs_df_fvdf_2times_",
#    "fr_fvs_df_fvdf_10times_", "fr_fvs_df_fvdf_20times_", 
#    #"fvs_df_fvdf_50times" ,
#    "fr_fvs_df_fvdf_half_", "fr_fvs_df_fvdf_tenth_"  ]
  
#  $exp_list.each{ |exp| 
#
#  html_make(exp)
#
#  }

  html_sonota_make

}



########################################################
##  include ファイル
########################################################

require 'date'
#require '/home/yukiko/lib/ape-thum.rb'
require './ape-thum.rb'
$KCODE = "e"


########################################################
##  ユーザ設定
########################################################

def jikkou

# インデックスファイル  $PWD/../html/${index}.html, $PWD/../html/table_${index}.rd
#$index = ""

# 情報ファイル, $PWD/${infofile}
#$infofile = $index + ".txt"

# 拡張子
#$base = "-lay1.gif"

# 絵のあるディレクトリ名, $PWD/../${figdir}
#$figdir = "tmean"
# $figdir = "spct"
#$figdir = "xteq"


# 横にならべるファイル数
# $figtable_num = 5
#$figtable_num = 4


#画像ファイルサイズ
# $width  = "160"
# $height = "120"
# $width  = "200"
# $height = "150"
# $width  = "280"
# $height = "210"


# テーブル, フォントの色
$color_table   = "#ADD8E6" 
$color_font    = "#000080" 
$color_link    = "#269900" 
$color_visited = "#269900" 
$color_hover   = "#CC9933" 

# html ヘッダタイトル
#$title  = "baseSST q,t の qradl への感度"

# サムネイルタイトル
$header1 = $title 
$header2 = "
kuo-c-mod Exp. <br>
<hr>

<table BORDER=\"0\" cellspacing=\"10\" align=\"center\">
<tr><td><small>
Yamada&Mellor 拡散係数のみを変更: 
</small></td><td><small>
[<a href =\"fr_fvs_df_fvdf_sh.html\">sh</a>] 
[<a href =\"fr_fvs_df_fvdf_ml_lat0.html\">ml-lat0</a>] 
[<a href =\"fr_fvs_df_fvdf_ml.html\">ml</a>] 
[<a href =\"fr_fvs_df_fvdf_anim.html\">anim</a>] <br>
</small></td></tr><tr><td><small>
Louis バルク係数, Yamada&Mellor 拡散係数ともに変更: 
</small></td><td><small>
[<a href =\"fr_fvs_df_sh.html\">sh</a>] 
[<a href =\"fr_fvs_df_ml_lat0.html\">ml-lat0</a>] 
[<a href =\"fr_fvs_df_ml.html\">ml</a>] 
[<a href =\"fr_fvs_df_anim.html\">anim</a>] <br>
</small></td></tr><tr><td><small>
その他: 
</small></td><td><small>
[<a href =\"fr_sh.html\">sh</a>] 
[<a href =\"fr_ml_lat0.html\">ml-lat0</a>] 
[<a href =\"fr_ml.html\">ml</a>] 
[<a href =\"fr_anim.html\">anim</a>] <br>
</td></tr></table>

<hr> 
[<a href =\"../stdexp/stdexp.html\">Standard</a>] 
[<a href =\"../t42l12/t42l12.html\">T42L12</a>] 
[<a href =\"../hs86sst/hs86sst.html\">HS86SST</a>] 
<hr> 
[<a href =\"../../\">HOME</a>]
"

# サムネイルフッタ ;
$footer = "Last update: #{Time.now} <br> 
           Copyright &copy\; 2005 YAMADA Yukiko"


# ファイル生成実行
print $title, "\n" ; apethum

end


def anim_sed(index)

#  `sed s/-t0.gif\"\>/-anim.gif\"\>/ ../#{index}.html > tmp.html`
  `sed s/_t0.gif\\"\\>/_anim.gif\\"\\>/ ../#{index}.html > tmp.html`
  `mv tmp.html ../#{index}.html`

end


def html_make(exp)

  $width  = "200";  $height = "150"
  $head = "kuo_#{exp}"
  $base = ".gif"
  $figdir = "mlsh"
  $index = "#{exp}#{$figdir}"
  $infofile = "#{$figdir}.txt"
  $title  = "kuo-c-mphys Experiment"
  $figtable_num = 4
  jikkou
  anim_sed($index)

end

def html_sonota_make

  $width  = "200";  $height = "150"
  $head = "kuo_c-"
  $base = ".gif"
  $figdir = "anim"
  $index = "#{$figdir}"
  $infofile = "#{$figdir}.txt"
  $title  = "kuo-c-mphys Experiment"
  $figtable_num = 4
  jikkou
  anim_sed($index)

  $head = "kuo-c_"
  $base = ".gif"
  $figdir = ""
  $index = "kuo-c-mphys"
  $infofile = "kuo-c-mphys.txt"
  $title  = "kuo-c-mphys Experiment index"
  $figtable_num = 4
  jikkou
##-----

  $width  = "200";  $height = "150"
  $head = "kuo_"
  $base = ".gif"
  $figdir = "ml"
  $index = "fr_ml"
  $infofile = "#{$index}.txt"
  $title  = "kuo-c-mphys Experiment"
  $figtable_num = 4
  jikkou

  $width  = "200";  $height = "150"
  $head = "kuo_"
  $base = ".gif"
  $figdir = "ml"
  $index = "fr_fvs_df_ml"
  $infofile = "#{$index}.txt"
  $title  = "kuo-c-mphys Experiment"
  $figtable_num = 4
  jikkou

  $width  = "200";  $height = "150"
  $head = "kuo_"
  $base = ".gif"
  $figdir = "ml"
  $index = "fr_fvs_df_fvdf_ml"
  $infofile = "#{$index}.txt"
  $title  = "kuo-c-mphys Experiment"
  $figtable_num = 4
  jikkou

##-----

  $width  = "200";  $height = "150"
  $head = "kuo_fr_"
  $base = ".gif"
  $figdir = "lat0"
  $index = "fr_ml_lat0"
  $infofile = "#{$index}.txt"
  $title  = "kuo-c-mphys Experiment"
  $figtable_num = 4
  jikkou

  $width  = "200";  $height = "150"
  $head = "kuo_fr_fvs_df_"
  $base = ".gif"
  $figdir = "lat0"
  $index = "fr_fvs_df_ml_lat0"
  $infofile = "#{$index}.txt"
  $title  = "kuo-c-mphys Experiment"
  $figtable_num = 4
  jikkou

  $width  = "200";  $height = "150"
  $head = "kuo_fr_fvs_df_fvdf_"
  $base = ".gif"
  $figdir = "lat0"
  $index = "fr_fvs_df_fvdf_ml_lat0"
  $infofile = "#{$index}.txt"
  $title  = "kuo-c-mphys Experiment"
  $figtable_num = 4
  jikkou

##-----

  $width  = "200";  $height = "150"
  $head = "kuo_fr_"
  $base = ".gif"
  $figdir = "sh"
  $index = "fr_sh"
  $infofile = "#{$index}.txt"
  $title  = "kuo-c-mphys Experiment"
  $figtable_num = 4
  jikkou

  $width  = "200";  $height = "150"
  $head = "kuo_fr_fvs_df_"
  $base = ".gif"
  $figdir = "sh"
  $index = "fr_fvs_df_sh"
  $infofile = "#{$index}.txt"
  $title  = "kuo-c-mphys Experiment"
  $figtable_num = 4
  jikkou

  $width  = "200";  $height = "150"
  $head = "kuo_fr_fvs_df_fvdf_"
  $base = ".gif"
  $figdir = "sh"
  $index = "fr_fvs_df_fvdf_sh"
  $infofile = "#{$index}.txt"
  $title  = "kuo-c-mphys Experiment"
  $figtable_num = 4
  jikkou

##-----

  $width  = "200";  $height = "150"
  $head = "kuo_c-"
  $base = ".gif"
  $figdir = "anim"
  $index = "fr_anim"
  $infofile = "#{$index}.txt"
  $title  = "kuo-c-mphys Experiment"
  $figtable_num = 4
  jikkou
  anim_sed($index)

  $width  = "200";  $height = "150"
  $head = "kuo_c-"
  $base = ".gif"
  $figdir = "anim"
  $index = "fr_fvs_df_anim"
  $infofile = "#{$index}.txt"
  $title  = "kuo-c-mphys Experiment"
  $figtable_num = 4
  jikkou
  anim_sed($index)

  $width  = "200";  $height = "150"
  $head = "kuo_c-"
  $base = ".gif"
  $figdir = "anim"
  $index = "fr_fvs_df_fvdf_anim"
  $infofile = "#{$index}.txt"
  $title  = "kuo-c-mphys Experiment"
  $figtable_num = 4
  jikkou
  anim_sed($index)

##-----

end










