/[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.4 - (hide annotations) (download) (as text)
Sun Aug 27 06:19:05 2006 UTC (18 years, 3 months ago) by pam-fi
Branch: MAIN
CVS Tags: dataToXML1_03_02, HEAD
Changes since 1.3: +1 -0 lines
File MIME type: application/xml
new log 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 pam-fi 1.4 <xsl:when test="alarm='boot'"> <xsl:value-of select="'#B93B8F'"/> </xsl:when>
53 kusanagi 1.1 <xsl:otherwise> <xsl:value-of select="'#00ff00'"/> </xsl:otherwise>
54     </xsl:choose>
55     </xsl:variable>
56     <tr bgcolor="{$bgcolor}">
57     <td><xsl:value-of select="$obt"/></td>
58     <td><xsl:value-of select="type"/></td>
59     <td>
60     <A>
61     <xsl:attribute name="href">
62     <xsl:value-of select="concat($CPUcode, fullfilename)"/>
63     </xsl:attribute>
64     <xsl:value-of select="fullfilename"/>
65     <div></div>
66     <xsl:value-of select="description"/>
67     </A>
68     </td>
69     <td>
70     0x
71     <xsl:call-template name="Dec2Hex">
72     <xsl:with-param name="value" select="$info"/>
73     </xsl:call-template>
74     ----
75     <xsl:value-of select="$info"/>
76     </td>
77     </tr>
78     </xsl:if>
79     </xsl:for-each>
80     </xsl:for-each>
81     </xsl:template>
82    
83     <xsl:template match="/" name="LogTemplate">
84     <html>
85     <body STYLE="font-family:Arial, helvetica, sans-serif; font-size:12pt">
86     <h2>Log Records</h2>
87     <table border="1">
88     <xsl:for-each select="//LOG_EVENT">
89     <tr bgcolor="#1acd32">
90     <th align="center">Packet OBT</th>
91     <th align="center">Packet Num</th>
92     </tr>
93     <tr>
94     <th align="left"><xsl:value-of select="PACKET_OBT"/></th>
95     <th align="left"><xsl:value-of select="PACKET_NUM"/></th>
96     </tr>
97     <tr bgcolor="#9acd32">
98     <xsl:for-each select="//COL">
99     <th align="left"><xsl:value-of select="."/></th>
100     </xsl:for-each>
101     </tr>
102     <xsl:for-each select="LOG_RECORDS/LOG_RECORD">
103     <xsl:variable name="retTemplate">
104     <xsl:call-template name="LogReference">
105     <xsl:with-param name="code" select="FILE_ID"/>
106     <xsl:with-param name="line_no" select="LINE_NO"/>
107     <xsl:with-param name="obt" select="RECORD_OBT"/>
108     <xsl:with-param name="info" select="INFO1"/>
109     </xsl:call-template>
110     </xsl:variable>
111     <xsl:if test='$retTemplate=""'>
112     <tr>
113     <td><xsl:value-of select="RECORD_OBT"/></td>
114     <td><xsl:value-of select="MASKTYPE"/></td>
115     <td><xsl:value-of select="FILE_ID"/> -- <xsl:value-of select="LINE_NO"/></td>
116     <td>
117     0x
118     <xsl:call-template name="Dec2Hex">
119     <xsl:with-param name="value" select="INFO1"/>
120     </xsl:call-template>
121     ----
122     <xsl:value-of select="INFO1"/>
123     </td>
124     </tr>
125     </xsl:if>
126     <xsl:if test='$retTemplate!=""'>
127     <xsl:copy-of select="$retTemplate" />
128     </xsl:if>
129     </xsl:for-each>
130     </xsl:for-each>
131    
132     </table>
133     </body>
134     </html>
135     </xsl:template>
136    
137     </xsl:stylesheet>

  ViewVC Help
Powered by ViewVC 1.1.23