Ignore:
Timestamp:
11/14/12 13:31:46 (12 years ago)
Author:
gosiaw
Message:

Handling CoolingDevices? changed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DCWoRMS/trunk/src/test/DEBBTranslator/xml/DEBBComponentTranslator.xsl

    r606 r613  
    3131                                <xsl:apply-templates select="Storage" /> 
    3232                        </xsl:if> 
    33                         <xsl:if test="CoolingDevice"> 
    34                                 <xsl:apply-templates select="CoolingDevice" /> 
    35                         </xsl:if> 
    3633                        <xsl:call-template name="BasicDEBBPhysicalElementParameters" /> 
    3734                        <xsl:if test="Baseboard"> 
     
    4138                                <xsl:apply-templates select="Sensor" /> 
    4239                        </xsl:if> 
     40                        <xsl:if test="PowerSupply"> 
     41                                <xsl:apply-templates select="PowerSupply" /> 
     42                        </xsl:if> 
    4343                        <xsl:if test="Processor"> 
    4444                                <xsl:apply-templates select="Processor" /> 
    4545                        </xsl:if> 
    46                         <xsl:if test="PowerSupply"> 
    47                                 <xsl:apply-templates select="PowerSupply" /> 
     46                        <xsl:if test="CoolingDevice"> 
     47                                <!-- Base cooling device data --> 
     48                                <xsl:apply-templates select="CoolingDevice" 
     49                                        mode="basic" /> 
     50                                <!-- Air throughput connected, advanced, technical data --> 
     51                                <xsl:element name="profile"> 
     52                                        <xsl:element name="airThroughputProfile"> 
     53                                                <xsl:element name="airThroughputStates"> 
     54                                                        <xsl:apply-templates select="CoolingDevice" 
     55                                                                mode="advanced" /> 
     56                                                </xsl:element> 
     57                                        </xsl:element> 
     58                                </xsl:element> 
    4859                        </xsl:if> 
    4960                </xsl:element> 
     
    5869                </xsl:if> 
    5970                <xsl:if test="CoolingDevice"> 
    60                         <xsl:apply-templates select="CoolingDevice" /> 
     71                        <!-- <xsl:apply-templates select="CoolingDevice" /> --> 
    6172                </xsl:if> 
    6273                <xsl:call-template name="BasicDEBBPhysicalElementParameters" /> 
     
    240251                                </xsl:element> 
    241252                        </xsl:element> 
    242  
    243253                        <xsl:call-template name="BasicDEBBPhysicalElementParameters" /> 
    244254                </xsl:element> 
    245255        </xsl:template> 
    246256 
    247         <xsl:template match="CoolingDevice"> 
    248                 <!-- TODO: Not finished --> 
    249                 <xsl:element name="profile"> 
    250                         <xsl:element name="airThroughputProfile"> 
    251                                 <!-- <xsl:attribute name="name">CoolingDevice</xsl:attribute> --> 
    252                                 <!-- TODO: What to take it from?? --> 
    253                                 <!-- <xsl:element name="airThroughputEstimationPlugin"> --> 
    254                                 <!-- </xsl:element> --> 
    255                                 <xsl:if test="ThroughputProfile"> 
    256                                         <xsl:element name="airThroughputStates"> 
    257                                                 <xsl:apply-templates select="ThroughputProfile" /> 
    258                                         </xsl:element> 
    259                                 </xsl:if> 
    260                                 <!-- Obligatory attribute --> 
    261                                 <xsl:element name="parameter"> 
    262                                         <xsl:attribute name="name">Class</xsl:attribute> 
    263                                         <xsl:element name="value"> 
    264                                                 <xsl:value-of select="Class" /> 
    265                                         </xsl:element> 
    266                                 </xsl:element> 
    267                                 <xsl:if test="MaxCoolingCapacity"> 
    268                                         <xsl:element name="parameter"> 
    269                                                 <xsl:attribute name="name">MaxCoolingCapacity</xsl:attribute> 
    270                                                 <xsl:element name="value"> 
    271                                                         <xsl:value-of select="MaxCoolingCapacity" /> 
    272                                                 </xsl:element> 
    273                                         </xsl:element> 
    274                                 </xsl:if> 
    275                                 <xsl:if test="MaxAirThroughput"> 
    276                                         <xsl:element name="parameter"> 
    277                                                 <xsl:attribute name="name">MaxAirThroughput</xsl:attribute> 
    278                                                 <xsl:element name="value"> 
    279                                                         <xsl:value-of select="MaxAirThroughput" /> 
    280                                                 </xsl:element> 
    281                                         </xsl:element> 
    282                                 </xsl:if> 
    283                                 <xsl:if test="MaxWaterThroughput"> 
    284                                         <xsl:element name="parameter"> 
    285                                                 <xsl:attribute name="name">MaxWaterThroughput</xsl:attribute> 
    286                                                 <xsl:element name="value"> 
    287                                                         <xsl:value-of select="MaxWaterThroughput" /> 
    288                                                 </xsl:element> 
    289                                         </xsl:element> 
    290                                 </xsl:if> 
    291                                 <xsl:call-template name="BasicDEBBPhysicalElementParameters" /> 
    292                         </xsl:element> 
    293                 </xsl:element> 
     257        <xsl:template match="CoolingDevice" mode="basic"> 
     258                <xsl:element name="parameter"> 
     259                        <xsl:attribute name="name">CoolingDevice</xsl:attribute> 
     260                        <!-- Don't call BasicDEBBPhysicalElementParameters, because parameter  
     261                                cannot contain parameters. Must be parameter containing properties. --> 
     262 
     263                        <!-- Obligatory attribute --> 
     264                        <xsl:element name="property"> 
     265                                <xsl:attribute name="name">Class</xsl:attribute> 
     266                                <xsl:element name="value"> 
     267                                        <xsl:value-of select="Class" /> 
     268                                </xsl:element> 
     269                        </xsl:element> 
     270                        <xsl:if test="MaxCoolingCapacity"> 
     271                                <xsl:element name="property"> 
     272                                        <xsl:attribute name="name">MaxCoolingCapacity</xsl:attribute> 
     273                                        <xsl:element name="value"> 
     274                                                <xsl:value-of select="MaxCoolingCapacity" /> 
     275                                        </xsl:element> 
     276                                </xsl:element> 
     277                        </xsl:if> 
     278                        <xsl:if test="MaxAirThroughput"> 
     279                                <xsl:element name="property"> 
     280                                        <xsl:attribute name="name">MaxAirThroughput</xsl:attribute> 
     281                                        <xsl:element name="value"> 
     282                                                <xsl:value-of select="MaxAirThroughput" /> 
     283                                        </xsl:element> 
     284                                </xsl:element> 
     285                        </xsl:if> 
     286                        <xsl:if test="MaxWaterThroughput"> 
     287                                <xsl:element name="property"> 
     288                                        <xsl:attribute name="name">MaxWaterThroughput</xsl:attribute> 
     289                                        <xsl:element name="value"> 
     290                                                <xsl:value-of select="MaxWaterThroughput" /> 
     291                                        </xsl:element> 
     292                                </xsl:element> 
     293                        </xsl:if> 
     294                        <xsl:call-template name="BasicDEBBPhysicalElementProperties" /> 
     295                </xsl:element> 
     296        </xsl:template> 
     297 
     298        <xsl:template match="CoolingDevice" mode="advanced"> 
     299                <xsl:attribute name="name">DummyCoolingDeviceName</xsl:attribute> 
     300                <xsl:if test="ThroughputProfile"> 
     301                        <xsl:apply-templates select="ThroughputProfile" /> 
     302                </xsl:if> 
    294303        </xsl:template> 
    295304 
Note: See TracChangeset for help on using the changeset viewer.