Changeset trunk,187
- Timestamp:
- 02/24/10 03:02:44 (5 months ago)
- revision id:
- csa@dside.dyndns.org-20100224030244-8lb5hmrvr777vcw5
- branch-nick:
- adei
- Files:
-
- trunk/.htaccess (modified) (1 diff)
- trunk/ToDo (modified) (2 diffs)
- trunk/setups/katrin/classes/kdbfileidentifier.php (modified) (2 diffs)
- trunk/setups/katrin/classes/kdbphp.php (modified) (7 diffs)
- trunk/setups/katrin/classes/kdbrunidentifier.php (modified) (2 diffs)
- trunk/setups/katrin/classes/readers/katrinreader.php (modified) (14 diffs)
- trunk/setups/katrin/config.php (modified) (7 diffs)
- trunk/setups/katrin/services/katrin.php (modified) (3 diffs)
- trunk/setups/katrin/wiki.xml (modified) (1 diff)
- trunk/setups/katrin/xslt/katrin.xsl (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/.htaccess
r102 r187 10 10 php_value max_execution_time 300 11 11 php_value allow_url_fopen "On" 12 13 <Files ~ "(auth\.php$)"> 14 AuthType Basic 15 AuthName "ADEI Authentication" 16 AuthBasicProvider file 17 AuthUserFile /var/www/localhost/htdocs/adei/admin/.htpasswd 18 Require valid-user 19 </Files> 20 <Files ~ "(auth2\.php$)"> 21 AuthType Basic 22 AuthName "ADEI Authentication" 23 AuthBasicProvider file 24 AuthUserFile /var/www/localhost/htdocs/adei/admin/.htpasswd 25 # Require valid-user 26 </Files> trunk/ToDo
r182 r187 13 13 14 14 - Support for Database names 15 16 KATRIN 17 ====== 18 - Quite often, on update instead of KATRIN data, the error message "MySQL 19 server has gone away" is displayed at KATRIN page. 20 21 - Can you please, test if your PHP module is loaded and otherwise skip 22 loading KATRIN extensions. Basically, if module is not present you should 23 remove "katrin" from the list of modules in config.php ($MODULES variable) 24 25 - The hangup is happening due invalid axis_id returned by your service. I 26 made a fix to ADEI, so it will no hang anymore in any case. However, it 27 is still better to fix. You are returning following properties which are 28 related to axis: 29 "axis":["counts\/sec"],"color":["black"],"name":["counts\/sec"] 30 However, in the "axis" array the axis id's of KNOWN axis should be 31 returned. Known axis are listed in config.php or can be additionally 32 added by the READER code, like in IPEReader. And anyway only 33 alpha-numeric characters are allowed in ids, no "/". 34 If you want just a default axis you should use '0' as an id. So, in this 35 case I think you just need to return 36 "axis":["0"],"color":["black"],"name":["counts\/sec"] 15 37 16 38 Version 0.0.8 (DATA Handling) … … 102 124 distributed uniformely over time. On each position the first item 103 125 after time is displayed. The time stamp is shown on as well. 126 127 VERSION 0.0.15 (Monitoring) 128 ============== 129 1. Port conky monitoring system to web and mozilla prism 130 a) Lua scripts execution from cron 131 b) Lua + conky to html translation script 104 132 105 133 ---------------------------------------------------------------------------- trunk/setups/katrin/classes/kdbfileidentifier.php
r171 r187 8 8 { 9 9 public $self = 0; 10 11 function __construct($arg1 , $arg2 = null)10 11 function __construct($arg1 = null, $arg2 = null) 12 12 { 13 switch (func_num_args()) { 14 case 1: 15 $r = new_KDBFileIdentifier($arg1); 16 break; 17 default: 18 $r = new_KDBFileIdentifier($arg1->GetName() . "/" . $arg2); 13 if (!extension_loaded("kdbphp")) { 14 throw new ADEIException("KDBPhp extension is not loaded!"); 19 15 } 16 17 $r = new_KDBFileIdentifier(); 18 19 if (func_num_args() == 1) { 20 KDBFileIdentifier_SetFileName($arg1); 21 } 22 elseif (func_num_args() == 2) { 23 KDBFileIdentifier_SetRun($arg1); 24 KDBFileIdentifier_SetFileName($arg2); 25 } 26 20 27 $this->self = $r; 21 28 } 22 29 30 function SetRun(KDBRunIdentifier $run) 31 { 32 KDBFileIdentifier_SetRun($this->self, $run->self); 33 } 34 23 35 function GetRun() 24 36 { … … 26 38 return new KDBRunIdentifier($run); 27 39 } 28 40 41 function SetFileName($filename) 42 { 43 KDBFileIdentifier_SetFileName($this->self, $filename); 44 } 45 29 46 function GetFileName() 30 47 { 31 48 return KDBFileIdentifier_GetFileName($this->self); 32 49 } 33 50 51 function SetFileType($type) 52 { 53 KDBFileIdentifier_SetFileType($this->self, $type); 54 } 55 56 function GetFileType() 57 { 58 return KDBFileIdentifier_GetFileType($this->self); 59 } 60 34 61 function AsString() 35 62 { trunk/setups/katrin/classes/kdbphp.php
r171 r187 1 1 <?php 2 // $Id: kdbphp.php 1004 2009-08-31 15:51:16Z s_voec01 $2 // $Id: kdbphp.php 6292 2010-01-19 15:44:58Z s_voec01 $ 3 3 // Author: Sebastian Voecking <sebastian.voecking@uni-muenster.de> 4 4 … … 29 29 } 30 30 31 function vectord_to_array($v) 32 { 33 $a = array(); 34 35 if (is_resource($v)) { 36 for ($i = 0; $i < vectord_size($v); $i++) { 37 $a[] = vectord_get($v, $i); 38 } 39 } 40 41 return $a; 42 } 43 44 function vectord_from_array(array $a) 45 { 46 $size = count($a); 47 $r = new_vectord($size); 48 for ($i = 0; $i < $size; $i++) { 49 vectord_set($r, $i, $a[$i]); 50 } 51 52 return $r; 53 } 54 31 55 class KDBPhp 32 56 { … … 35 59 function __construct() 36 60 { 61 if (!extension_loaded("kdbphp")) { 62 throw new ADEIException("KDBPhp extension is not loaded!"); 63 } 37 64 try { 38 65 $this->_cPtr = KDBPhp_Self(); … … 73 100 } 74 101 75 102 76 103 //function GetFileServer() 77 104 //{ … … 90 117 if ($file->GetRun()->IsValid()) { 91 118 $runname = $file->GetRun()->GetName(); 92 $message = 119 $message = 93 120 "File \"$filename\" does not exist for subrun $runname."; 94 121 } … … 108 135 readfile($path); 109 136 } 110 137 111 138 function GetAbsolutePath(KDBFileIdentifier $file) 112 139 { … … 128 155 } 129 156 } 157 158 function HaveRuns($from, $to) 159 { 160 try { 161 return KDBPhp_HaveRuns($this->_cPtr, $from, $to); 162 } 163 catch (Exception $e) { 164 throw new ADEIException($e->getMessage()); 165 } 166 } 167 168 function HaveCountrates($from, $to) 169 { 170 try { 171 return KDBPhp_HaveCountrates($this->_cPtr, $from, $to); 172 } 173 catch (Exception $e) { 174 throw new ADEIException($e->getMessage()); 175 } 176 } 130 177 } 131 178 trunk/setups/katrin/classes/kdbrunidentifier.php
r171 r187 1 1 <?php 2 // $Id: kdbrunidentifier.php 1002 2009-08-31 12:18:00Z s_voec01 $2 // $Id: kdbrunidentifier.php 5933 2009-11-11 20:55:40Z s_voec01 $ 3 3 // Author: Sebastian Voecking <sebastian.voecking@uni-muenster.de> 4 4 … … 6 6 { 7 7 public $self = 0; 8 8 9 9 function __construct($text) 10 10 { 11 if (!extension_loaded("kdbphp")) { 12 throw new ADEIException("KDBPhp extension is not loaded!"); 13 } 14 11 15 if (is_resource($text)) { 12 16 $this->self = $text; 13 17 } 14 18 else { 15 $this->self = new_ KDBRunIdentifier($text);19 $this->self = new_RunIdentifier($text); 16 20 } 17 21 } 18 22 19 23 function GetRun() 20 24 { 21 return KDBRunIdentifier_GetRun($this->self);25 return RunIdentifier_GetRun($this->self); 22 26 } 23 27 24 28 function GetSubRun() 25 29 { 26 return KDBRunIdentifier_GetSubRun($this->self);30 return RunIdentifier_GetSubRun($this->self); 27 31 } 28 32 29 33 function GetRunName() 30 34 { 31 return KDBRunIdentifier_GetRunName($this->self);35 return RunIdentifier_GetRunName($this->self); 32 36 } 33 37 34 38 function GetName() 35 39 { 36 return KDBRunIdentifier_GetName($this->self);40 return RunIdentifier_GetName($this->self); 37 41 } 38 42 39 43 function IsValid() 40 44 { 41 return KDBRunIdentifier_IsValid($this->self);45 return RunIdentifier_IsValid($this->self); 42 46 } 43 47 } trunk/setups/katrin/classes/readers/katrinreader.php
r171 r187 1 1 <?php 2 // $Id: katrinreader.php 973 2009-08-19 09:40:28Z s_voec01 $2 // $Id: katrinreader.php 6292 2010-01-19 15:44:58Z s_voec01 $ 3 3 // Author: Sebastian Voecking <sebastian.voecking@uni-muenster.de> 4 4 5 require_once "../KDBPhp.php";5 ADEI::RequireClass("KDBPhp", true); 6 6 7 7 abstract class KATRINData implements Iterator … … 9 9 public $_cPtr = NULL; 10 10 private $iterator = NULL; 11 11 12 12 abstract protected function create($kdb, $from, $to, $v); 13 13 … … 22 22 $to = $ivl->GetWindowEnd(); 23 23 $pixels = $items; 24 24 25 25 try { 26 26 $v = vectori_from_array(array_keys($pixels)); … … 46 46 try { 47 47 $r = KDBDataIter_Current($this->_cPtr); 48 $a = vector i_to_array($r);48 $a = vectord_to_array($r); 49 49 return $a; 50 50 } … … 73 73 } 74 74 } 75 75 76 76 function key() 77 77 { … … 123 123 $this->items['countrates'][] = array('name' => $name); 124 124 } 125 125 126 126 $this->items['runs'] = array(); 127 127 $this->items['runs'][] = array('name' => "Run numbers"); 128 $this->items['runs'][] = array('name' => "Sequence numbers"); 128 $this->items['runs'][] = array('name' => "Run numbers (no subruns)"); 129 $this->items['runs'][] = array('name' => "Activity"); 129 130 130 131 $this->groups = array( … … 211 212 $item['uid'] = $items[$i]['uid']; 212 213 } 213 214 214 215 if ($flags & REQUEST::NEED_AXISINFO) { 215 216 if ($grp->GetGroupID() == "countrates") { … … 220 221 } 221 222 } 222 223 223 224 $res[] = $item; 224 225 } … … 226 227 return $res; 227 228 } 228 229 229 230 function GetMaskList(LOGGROUP $grp = NULL, $flags = 0) 230 231 { 231 232 //print "KATRINReader::GetMaskList"; 232 233 233 234 $grp = $this->CheckGroup($grp); 234 235 235 236 $masks = array(); 236 237 237 238 if ($grp->GetGroupID() == "runs") { 238 239 } … … 245 246 } 246 247 $masks[] = $mask; 247 248 248 249 $mask = array(); 249 250 $mask["id"] = "ipe"; … … 257 258 } 258 259 $masks[] = $mask; 259 260 260 261 $mask = array(); 261 262 $mask["id"] = "uw"; … … 268 269 $mask["mask"] = implode(",", $items); 269 270 } 270 $masks[] = $mask; 271 } 272 271 $masks[] = $mask; 272 } 273 273 274 return array_merge(parent::GetMaskList($grp, $flags), $masks); 274 275 } … … 277 278 DATAFilter $filter = NULL, &$filter_data = NULL) 278 279 { 279 print "KATRINReader::GetRawData\n";280 print "$from $to\n";281 282 283 if ($filter) {284 var_dump($filter);285 }286 280 $grp = $this->CheckGroup($grp); 287 281 288 282 $ivl = $this->CreateInterval($grp); 289 283 $ivl->Limit($from, $to); 290 284 291 285 if ($filter) { 292 286 $mask = $filter->GetItemMask(); … … 339 333 function HaveData(LOGGROUP $grp = NULL, $from = 0, $to = 0) 340 334 { 341 try { 342 if (is_null($grp) || $grp->GetGroupID() == "runs") { 343 return KDBPhp_HaveRuns($this->kdb->_cPtr, $from, $to); 344 } 345 else if ($grp->GetGroupID() == "countrates") { 346 return KDBPhp_HaveCountrates($this->kdb->_cPtr, $from, $to); 347 } 348 else { 349 return FALSE; 350 } 351 } 352 catch (Exception $e) { 353 throw new ADEIException($e->getMessage()); 335 if (is_null($grp) || $grp->GetGroupID() == "runs") { 336 return $this->kdb->HaveRuns($from, $to); 337 } 338 else if ($grp->GetGroupID() == "countrates") { 339 return $this->kdb->HaveCountrates($from, $to); 340 } 341 else { 342 return FALSE; 354 343 } 355 344 } trunk/setups/katrin/config.php
r171 r187 38 38 "database" => array ("katrinpse_archiv"), 39 39 "multibase" => true, 40 // "database" => array ("katrinpse_archiv_20080331", "katrinpse_archiv_20071221", "katrinpse_archiv_20070924", "katrinpse_archiv_20070710"), 41 // "database" => array ("katrinpse_archiv_1", "katrinpse_archiv_2", "katrinpse_archiv_3", "katrinpse_archiv_4", "katrinpse_archiv_5", "katrinpse_archiv_6"), 42 "disconnected" => false 40 // "disconnected" => true 43 41 ), 44 42 "toskanadb" => array ( 45 "title" => _("PreSpektrometer Zeus8"),43 "title" => _("PreSpektrometer/Zeus8"), 46 44 "reader" => "ZEUS", 47 45 "driver" => "odbc", 48 46 "sqldrv" => "mssql", 49 47 "subdrv" => "FreeTDS", 50 //"host" => "192.168.8.6", 51 "host" => "itpfmdb1.ka.fzk.de", 48 "host" => "ipepdvmssqldb1.ka.fzk.de", 52 49 "port" => 1433, 53 50 "user" => 'souren', … … 55 52 "database" => array ("prespektrometer_rep"), 56 53 "timeout" => 200000, 57 "ping" => true 58 ), 54 "ping" => true, 55 // "disconnected" => true 56 ), 57 "opcreader" => array( 58 "title" => _("MainSpektrometer/OPC"), 59 "reader" => "DBReader", 60 "driver" => "odbc", 61 "sqldrv" => "mssql", 62 "subdrv" => "FreeTDS", 63 "host" => "ipepdvmssqldb1.ka.fzk.de", 64 "port" => 1433, 65 "database" => array ("dbMagnet-archive", "dbMagnet-archive_rep", "KatrinOPCTest"), 66 "user" => 'souren', 67 "password" => '$souren$', 68 "multibase" => false, 69 "timeout" => 200000, 70 "ping" => true, 71 // "disconnected" => true 72 ), 59 73 "detector" => array ( 60 74 "title" => _("KATRIN Detector"), … … 63 77 "sqldrv" => "mssql", 64 78 "subdrv" => "FreeTDS", 65 // "host" => "128.95.93.87", 66 // "database" => array ("katrin"), 67 // "timeout" => 1500000, // us 68 // "ping" => true, // host and port should be specified 69 "host" => "192.168.8.6", 79 "host" => "ipepdvmssqldb1.ka.fzk.de", 70 80 "database" => array ("katrin_rep"), 71 81 "port" => 1433, … … 77 87 // "disconnected" => true 78 88 ), 79 "heiko" => array ( 80 "title" => _("Magnetometer (ZEUS)"), 81 "reader" => "ZEUS", 82 "driver" => "odbc", 83 "sqldrv" => "mssql", 84 "subdrv" => "FreeTDS", 85 "host" => "192.168.8.6", 86 "database" => array ("dbMagnet-archive"), 87 "port" => 1433, 88 "user" => 'souren', 89 "password" => '$souren$', 90 "multibase" => false, 91 "timeout" => 200000, 92 "ping" => true 93 // "disconnected" => true 94 ), 95 "opcreader" => array( 96 "title" => _("Magnetometer"), 97 "reader" => "DBReader", 98 "driver" => "odbc", 99 "sqldrv" => "mssql", 100 "subdrv" => "FreeTDS", 101 "host" => "192.168.8.6", 102 "port" => 1433, 103 "database" => array ("dbMagnet-archive"), 104 "user" => 'souren', 105 "password" => '$souren$', 106 "multibase" => false, 107 "timeout" => 200000, 108 "ping" => true 109 ) 110 ); 89 "kdb" => array( 90 "title" => _("KATRIN Database"), 91 "reader" => "KATRINreader", 92 "database" => array ("kps") 93 ) 94 ); 95 111 96 112 97 if (is_array($READER_DB)) $READER_DB = array_merge($READER_DB_KATRIN, $READER_DB); … … 143 128 "overcome_reader_faults" => true, // Use CACHE if connection to reader is failed 144 129 "use_cache_timewindow" => true, 145 "channel_uids" => "/^4\d\d[\-_]/",146 130 "timestamp_channels" => true, // Groups is prefixed with two channels with accquisition timestamps (may give a number) 147 "alarm_severity" => 0 131 "alarm_severity" => 0, 132 "channel_uids" => "/^5\d\d[\-_]/", 133 "axis" => array( 134 "/^522-RTP/i" => "temperature", 135 "/^522-RP[PV]/i" => "vacuum" 136 ) 148 137 ); 149 138 … … 169 158 ), 170 159 "groups" => array( 171 "/^(.*)$/" => 'mda. Wt$LiveData\$${1}'160 "/^(.*)$/" => 'mda.[Wt$LiveData\$${1}]' 172 161 ), 173 162 "columns" => array( 174 163 "time" => "WsDateTimeTicks", 175 "data" => "/^Ws _/"164 "data" => "/^Ws(Ch)?_/" 176 165 ), 177 166 "timezone" => "Europe/Berlin", … … 187 176 ); 188 177 178 $OPTIONS["opcreader__dbMagnet-archive_rep"] = array( 179 "mask_table" => array( 180 "table" => 'mda.[Wt$ConfigData$Masks]', 181 "id" => "WsTID", 182 "gid" => "WsTable", 183 "properties" => array( 184 "name" => "WsName", 185 "mask" => "WsChannels" 186 ) 187 ) 188 ); 189 190 $OPTIONS["opcreader__KatrinOPCTest"] = array( 191 "tables" => array( 192 "/^Wv\\\$LiveData\\\$(.*)$/" => array( 193 'gid' => '${1}', 194 'title' => '${1}' 195 ) 196 ), 197 "groups" => array( 198 "/^(.*)$/" => '[Wv$LiveData\$${1}]' 199 ), 200 "columns" => array( 201 "time" => "WsDateTimeTicks", 202 "data" => "/^\d+/" 203 ) 204 ); 205 206 $OPTIONS["kdb"] = array( 207 "date_limit" => "2009-11-00 00:00:00" 208 ); 209 189 210 ?> trunk/setups/katrin/services/katrin.php
r171 r187 1 1 <?php 2 // $Id: katrin.php 1037 2009-09-23 13:54:51Z s_voec01 $2 // $Id: katrin.php 6273 2010-01-18 15:44:27Z s_voec01 $ 3 3 // Author: Sebastian Voecking <sebastian.voecking@uni-muenster.de> 4 4 … … 8 8 ADEI::RequireClass("KDBFileIdentifier", true); 9 9 ADEI::RequireClass("KDBPhp", true); 10 ADEI::RequireClass("KDBRunIdentifier", "true");10 ADEI::RequireClass("KDBRunIdentifier", true); 11 11 ADEI::RequireClass("INTERVAL"); 12 12 … … 86 86 87 87 case 'file': 88 if (!isset($_GET['filename'])) 89 throw new ADEIException("No filename specified"); 90 $filename = $_GET['filename']; 88 $file = new KDBFileIdentifier(); 91 89 if (isset($_GET['run'])) { 92 90 $identifier = new KDBRunIdentifier($_GET['run']); 93 $file = new KDBFileIdentifier($identifier, $filename); 94 $path = $kdb->GetAbsolutePath($file); 95 } 96 else { 97 $file = new KDBFileIdentifier($filename); 98 $path = $kdb->GetAbsolutePath($file); 91 $file->SetRun($identifier); 99 92 } 100 93 101 if (isset($_GET['download']) && $_GET['download'] == "yes") { 102 $download = true; 103 } 104 else { 105 $download = false; 94 if (isset($_GET['filename'])) { 95 $file->SetFilename($_GET['filename']); 106 96 } 107 97 108 PrintFile($path, $download); 98 if (isset($_GET['type'])) { 99 $type = $_GET['type']; 100 if ($type == "orca") { 101 $file->SetFileType(kTypeOrca); 102 } 103 if ($type == "orcaroot") { 104 $file->SetFileType(kTypeOrcaRoot); 105 } 106 if ($type == "crun") { 107 $file->SetFileType(kTypeCrun); 108 } 109 if ($type == "header") { 110 $file->SetFileType(kTypeHeader); 111 } 112 if ($type == "plot") { 113 $file->SetFileType(kTypePlot); 114 } 115 } 116 117 PrintFile($kdb->GetAbsolutePath($file), $download); 109 118 break; 110 119 trunk/setups/katrin/wiki.xml
r171 r187 782 782 <page id="346" title="KATRIN Database Archives">...</page> 783 783 <page id="347" title="KATRIN Database Archives">...</page> 784 <page id="348" title="KATRIN Database 784 <page id="348" title="KATRIN Database Archives">...</page> 785 <page id="349" title="KATRIN Database Archives">...</page> 786 <page id="350" title="KATRIN Database 785 787 Archives">...</page> 786 788 </pages> trunk/setups/katrin/xslt/katrin.xsl
r171 r187 7 7 </xsl:variable> 8 8 9 <xsl:template name="image">9 <xsl:template match="image" mode="image"> 10 10 <xsl:variable name="link"> 11 11 <xsl:text>services/katrin.php?target=file&</xsl:text> 12 <xsl:text>type=plot&</xsl:text> 12 13 <xsl:if test="@run">run=<xsl:value-of select="@run" />&</xsl:if> 13 14 <xsl:text>filename=</xsl:text><xsl:value-of select="@filename" /> 14 15 </xsl:variable> 15 16 16 <xsl:element name="a"> 17 <xsl:attribute name="href"> 18 <xsl:value-of select="$link" /> 19 <xsl:text>.png</xsl:text> 20 </xsl:attribute> 21 <xsl:attribute name="target">_blank</xsl:attribute> 22 <xsl:element name="img"> 23 <xsl:attribute name="src"> 17 <td> 18 <xsl:element name="a"> 19 <xsl:attribute name="href"> 24 20 <xsl:value-of select="$link" /> 25 <xsl:text> _pv.png</xsl:text>21 <xsl:text>.png</xsl:text> 26 22 </xsl:attribute> 27 <xsl:attribute name="border">0</xsl:attribute> 28 <xsl:attribute name="alt"> 29 <xsl:value-of select="." /> 30 </xsl:attribute> 23 <xsl:attribute name="target">_blank</xsl:attribute> 24 <xsl:element name="img"> 25 <xsl:attribute name="src"> 26 <xsl:value-of select="$link" /> 27 <xsl:text>_pv.png</xsl:text> 28 </xsl:attribute> 29 <xsl:attribute name="border">0</xsl:attribute> 30 <xsl:attribute name="alt"> 31 <xsl:value-of select="." /> 32 </xsl:attribute> 33 </xsl:element> 31 34 </xsl:element> 32 </xsl:element> 35 </td> 36 </xsl:template> 37 38 <xsl:template match="image" mode="title"> 39 <th><xsl:value-of select="." /></th> 33 40 </xsl:template> 34 41 … … 37 44 <xsl:element name="a"> 38 45 <xsl:attribute name="href"> 39 <xsl:text>services/katrin.php?target=file&</xsl:text> 46 <xsl:text>services/katrin.php?target=file</xsl:text> 47 <xsl:text>&download=yes</xsl:text> 40 48 <xsl:if test="@run"> 41 <xsl:text> run=</xsl:text>42 <xsl:value-of select="@run" /> <xsl:text>&</xsl:text>49 <xsl:text>&run=</xsl:text> 50 <xsl:value-of select="@run" /> 43 51 </xsl:if> 44 <xsl:text>filename=</xsl:text> 45 <xsl:value-of select="@filename" /> 46 <xsl:text>&download=yes</xsl:text> 52 <xsl:if test="@type"> 53 <xsl:text>&type=</xsl:text> 54 <xsl:value-of select="@type" /> 55 </xsl:if> 56 <xsl:if test="@filename"> 57 <xsl:text>&filename=</xsl:text> 58 <xsl:value-of select="@filename" /> 59 </xsl:if> 60 <xsl:if test="@board"> 61 <xsl:text>&board=</xsl:text> 62 <xsl:value-of select="@board" /> 63 </xsl:if> 47 64 </xsl:attribute> 48 65 <xsl:value-of select="." /> … … 56 73 </xsl:template> 57 74 75 <!-- ADEI links and images --> 76 <xsl:template match="adei"> 77 <xsl:text>db_server=</xsl:text> 78 <xsl:value-of select="@server" /> 79 <xsl:text>&db_name=</xsl:text> 80 <xsl:value-of select="@database" /> 81 <xsl:text>&db_group=</xsl:text> 82 <xsl:value-of select="@group" /> 83 <xsl:if test="@mask"> 84 <xsl:text>&db_mask=</xsl:text> 85 <xsl:value-of select="@mask" /> 86 </xsl:if> 87 <xsl:if test="@window"> 88 <xsl:text>&window=</xsl:text> 89 <xsl:value-of select="@window" /> 90 </xsl:if> 91 </xsl:template> 92 93 <xsl:template match="adeiimage" mode="image"> 94 <xsl:variable name="url"> 95 <xsl:apply-templates select="adei" /> 96 </xsl:variable> 97 <td> 98 <xsl:element name="a"> 99 <xsl:attribute name="href"> 100 <xsl:text>javascript:adei.config.Load('</xsl:text> 101 <xsl:value-of select="$url" /> 102 <xsl:text>&module=graph&setup=katrin', true)</xsl:text> 103 </xsl:attribute> 104 <xsl:element name="img"> 105 <xsl:attribute name="src"> 106 <xsl:text>services/getimage.php?</xsl:text> 107 <xsl:value-of select="$url" /> 108 <xsl:text>&hide_axes=1&precision=LOW&width=</xsl:text> 109 <xsl:value-of select="@width" /> 110 <xsl:text>&height=</xsl:text> 111 <xsl:value-of select="@height" /> 112 </xsl:attribute> 113 <xsl:attribute name="alt"> 114 <xsl:value-of select="@text" /> 115 </xsl:attribute> 116 <xsl:attribute name="width"> 117 <xsl:value-of select="@width" /> 118 </xsl:attribute> 119 <xsl:attribute name="height"> 120 <xsl:value-of select="@height" /> 121 </xsl:attribute> 122 <xsl:attribute name="border"> 123 <xsl:text>0</xsl:text> 124 </xsl:attribute> 125 </xsl:element> 126 </xsl:element> 127 </td> 128 </xsl:template> 129 130 <xsl:template match="adeiimage" mode="title"> 131 <th><xsl:value-of select="@text" /></th> 132 </xsl:template> 133 58 134 <xsl:template match="plots"> 59 135 <h4><xsl:value-of select="@title" />:</h4> … … 61 137 <table> 62 138 <tr> 63 <xsl:for-each select="image"> 64 <th><xsl:value-of select="." />:</th> 65 </xsl:for-each> 139 <xsl:apply-templates select="image" mode="title" /> 140 <xsl:apply-templates select="adeiimage" mode="title" /> 66 141 </tr> 67 142 <tr> 68 <xsl:for-each select="image"> 69 <td><xsl:call-template name="image" /></td> 70 </xsl:for-each> 143 <xsl:apply-templates select="image" mode="image" /> 144 <xsl:apply-templates select="adeiimage" mode="image" /> 71 145 </tr> 72 146 </table> 73 147 </div> 74 <p><xsl:apply-templates select="image" /></p>75 148 </xsl:template> 76 149 … … 236 309 <span class="fett"> 237 310 <xsl:value-of select="date" /> 238 <xsl:text> </xsl:text>239 </span>240 <b>Run number: </b>241 <span class="fett">242 <xsl:value-of select="identifier" />243 311 <xsl:text> </xsl:text> 244 312 </span> … … 260 328 <b>Z: </b> 261 329 <span class="fett"><xsl:value-of select="detector_z" />cm </span> 262 <b>Crate: </b>263 <span class="fett"><xsl:value-of select="crate" /> </span>264 330 </div> 265 331 <div class="det"> … … 273 339 </div> 274 340 <xsl:apply-templates select="parameters" /> 341 <xsl:apply-templates select="plots" /> 275 342 <xsl:apply-templates select="downloads" /> 276 343 </xsl:template> … … 279 346 <h4>Subrun <xsl:value-of select="identifier" /></h4> 280 347 <div class="gen"> 281 <b>Subrun number: </b>282 <span class="fett">283 <xsl:value-of select="identifier" />284 <xsl:text> </xsl:text>285 </span>286 348 <b>Timestamp: </b> 287 349 <span class="fett"> … … 337 399 div.cmt { 338 400 background-color: rgb(0,0,0); 339 color:white; 401 color:white; 340 402 } 341 403 div.pics { … … 356 418 <xsl:apply-templates select="run" /> 357 419 <xsl:apply-templates select="subrun" /> 358 </xsl:if> 420 </xsl:if> 359 421 </div> 360 422 </xsl:template>