/[PAMELA software]/quicklook/dataToXML/Data/LogTemplate.xsl
ViewVC logotype

Annotation of /quicklook/dataToXML/Data/LogTemplate.xsl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download) (as text)
Wed Aug 23 13:05:38 2006 UTC (18 years, 3 months ago) by pam-rm2
Branch: MAIN
CVS Tags: dataToXML1_03/01
Changes since 1.2: +1 -0 lines
File MIME type: application/xml
new colors

1 kusanagi 1.1 <?xml version="1.0" encoding='ISO-8859-1'?>
2     <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3     <!-- Dichiarazione del documento XSLT -->
4     <!-- <xsl:stylesheet version="1.0"
5     xmlns:xsl="http://www.w3.org/TR/WD-xsl"> -->
6    
7     <!--
8     =====================================================================================
9     Stylesheet: LogTemplate.xsl
10     Version: 1.0 (2005-01-01)
11     Author: Maurizio Nagni
12     Descr.: Merge the output of the LogToXml.c script with the loginfo.xml
13     file to generate a human readble verion of the Log packet
14     Note : Needs customization of the CPUcode parameter into the Configure.xml file
15     =====================================================================================
16     -->
17    
18     <!--Contains some utility to converts dec/hex/bin numbers-->
19     <xsl:include href="numberutils_lib.xsl"/>
20    
21     <!--Contains all the customer specific parameters-->
22     <xsl:include href="Configure.xsl"/>
23    
24     <!-- Define which a key called "fileName"
25     which will search inside the node "log"
26     all values values of the node "fileid" matching the valued passed when
27     the key "fileName" is called -->
28     <!-- No xml file is defined here because the xsl:key is absolutely generic -->
29     <xsl:key name="fileName" match="log" use="fileid"/>
30    
31     <xsl:template match="/" name="LogReference">
32     <xsl:param name="code"/>
33     <xsl:param name="line_no"/>
34     <xsl:param name="obt"/>
35     <xsl:param name="info"/>
36     <xsl:for-each select="document('./compilationInfo/loginfo.xml')">
37     <xsl:for-each select="key('fileName', $code)">
38     <xsl:if test="line=$line_no">
39     <xsl:variable name="bgcolor">
40     <xsl:choose>
41 kusanagi 1.2 <xsl:when test="alarm='yes'"> <xsl:value-of select="'#ff0000'"/> </xsl:when>
42     <xsl:when test="alarm='no'"> <xsl:value-of select="'#ffffff'"/> </xsl:when>
43     <xsl:when test="alarm='yes1'"> <xsl:value-of select="'#ff8000'"/> </xsl:when>
44     <xsl:when test="alarm='yes2'"> <xsl:value-of select="'#ffcc99'"/> </xsl:when>
45     <xsl:when test="alarm='mcalib'"> <xsl:value-of select="'#b3ff66'"/> </xsl:when>
46     <xsl:when test="alarm='macq'"> <xsl:value-of select="'#99ffff'"/> </xsl:when>
47     <xsl:when test="alarm='minit'"> <xsl:value-of select="'#ffff66'"/> </xsl:when>
48     <xsl:when test="alarm='calib'"> <xsl:value-of select="'#e6ffcc'"/> </xsl:when>
49     <xsl:when test="alarm='acq'"> <xsl:value-of select="'#ccffff'"/> </xsl:when>
50     <xsl:when test="alarm='init'"> <xsl:value-of select="'#ffffcc'"/> </xsl:when>
51 pam-rm2 1.3 <xsl:when test="alarm='ipm'"> <xsl:value-of select="'#F9B7FF'"/> </xsl:when>
52 kusanagi 1.1 <xsl:otherwise> <xsl:value-of select="'#00ff00'"/> </xsl:otherwise>
53     </xsl:choose>
54     </xsl:variable>
55     <tr bgcolor="{$bgcolor}">
56     <td><xsl:value-of select="$obt"/></td>
57     <td><xsl:value-of select="type"/></td>
58     <td>
59     <A>
60     <xsl:attribute name="href">
61     <xsl:value-of select="concat($CPUcode, fullfilename)"/>
62     </xsl:attribute>
63     <xsl:value-of select="fullfilename"/>
64     <div></div>
65     <xsl:value-of select="description"/>
66     </A>
67     </td>
68     <td>
69     0x
70     <xsl:call-template name="Dec2Hex">
71     <xsl:with-param name="value" select="$info"/>
72     </xsl:call-template>
73     ----
74     <xsl:value-of select="$info"/>
75     </td>
76     </tr>
77     </xsl:if>
78     </xsl:for-each>
79     </xsl:for-each>
80     </xsl:template>
81    
82     <xsl:template match="/" name="LogTemplate">
83     <html>
84     <body STYLE="font-family:Arial, helvetica, sans-serif; font-size:12pt">
85     <h2>Log Records</h2>
86     <table border="1">
87     <xsl:for-each select="//LOG_EVENT">
88     <tr bgcolor="#1acd32">
89     <th align="center">Packet OBT</th>
90     <th align="center">Packet Num</th>
91     </tr>
92     <tr>
93     <th align="left"><xsl:value-of select="PACKET_OBT"/></th>
94     <th align="left"><xsl:value-of select="PACKET_NUM"/></th>
95     </tr>
96     <tr bgcolor="#9acd32">
97     <xsl:for-each select="//COL">
98     <th align="left"><xsl:value-of select="."/></th>
99     </xsl:for-each>
100     </tr>
101     <xsl:for-each select="LOG_RECORDS/LOG_RECORD">
102     <xsl:variable name="retTemplate">
103     <xsl:call-template name="LogReference">
104     <xsl:with-param name="code" select="FILE_ID"/>
105     <xsl:with-param name="line_no" select="LINE_NO"/>
106     <xsl:with-param name="obt" select="RECORD_OBT"/>
107     <xsl:with-param name="info" select="INFO1"/>
108     </xsl:call-template>
109     </xsl:variable>
110     <xsl:if test='$retTemplate=""'>
111     <tr>
112     <td><xsl:value-of select="RECORD_OBT"/></td>
113     <td><xsl:value-of select="MASKTYPE"/></td>
114     <td><xsl:value-of select="FILE_ID"/> -- <xsl:value-of select="LINE_NO"/></td>
115     <td>
116     0x
117     <xsl:call-template name="Dec2Hex">
118     <xsl:with-param name="value" select="INFO1"/>
119     </xsl:call-template>
120     ----
121     <xsl:value-of select="INFO1"/>
122     </td>
123     </tr>
124     </xsl:if>
125     <xsl:if test='$retTemplate!=""'>
126     <xsl:copy-of select="$retTemplate" />
127     </xsl:if>
128     </xsl:for-each>
129     </xsl:for-each>
130    
131     </table>
132     </body>
133     </html>
134     </xsl:template>
135    
136     </xsl:stylesheet>

  ViewVC Help
Powered by ViewVC 1.1.23