Ignore:
Timestamp:
03/28/13 09:51:43 (12 years ago)
Author:
gosiaw
Message:

Translation of cooling devices corrected.

File:
1 edited

Legend:

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

    r1027 r1032  
    7676                        <!-- Base cooling device data --> 
    7777                        <xsl:apply-templates select="CoolingDevice" mode="basic" /> 
     78                         
    7879                        <!-- Air throughput connected, advanced, technical data --> 
    79                         <xsl:if test="CoolingDevice/ThroughputProfile"> 
     80                        <xsl:if test="CoolingDevice/AirThroughputProfile or CoolingDevice/WaterThroughputProfile"> 
    8081                                <xsl:element name="profile"> 
    81                                         <xsl:element name="airThroughputProfile"> 
    82                                                 <xsl:element name="airThroughputStates"> 
    83                                                         <xsl:apply-templates select="CoolingDevice" 
    84                                                                 mode="advanced" /> 
    85                                                 </xsl:element> 
    86                                         </xsl:element> 
     82                                                <xsl:if test="CoolingDevice/AirThroughputProfile"> 
     83                                                        <xsl:element name="airThroughputProfile"> 
     84                                                                <xsl:element name="airThroughputStates"> 
     85                                                                        <xsl:apply-templates select="CoolingDevice" 
     86                                                                                mode="air" /> 
     87                                                                </xsl:element> 
     88                                                        </xsl:element>                                           
     89                                                </xsl:if> 
     90                                                 
     91                                                <!-- TODO: DCWoRMS schema cannot handle water cooled devices. The code below should be enabled as soon it can.--> 
     92<!--                                            <xsl:if test="CoolingDevice/WaterThroughputProfile">--> 
     93<!--                                                    <xsl:element name="waterThroughputProfile">--> 
     94<!--                                                            <xsl:element name="waterThroughputStates">--> 
     95<!--                                                                    <xsl:apply-templates select="CoolingDevice"--> 
     96<!--                                                                            mode="water" />--> 
     97<!--                                                            </xsl:element>--> 
     98<!--                                                    </xsl:element>                                                  --> 
     99<!--                                            </xsl:if>--> 
    87100                                </xsl:element> 
    88101                        </xsl:if> 
     
    205218                                                 
    206219                                                <xsl:if test="CState"> 
    207                                                         <!-- If any CState is prsent add powerStates element --> 
     220                                                        <!-- If any CState is present add powerStates element --> 
    208221                                                        <xsl:element name="powerStates"> 
    209222                                                                <xsl:apply-templates select="CState" /> 
     
    422435        </xsl:template> 
    423436 
    424         <xsl:template match="CoolingDevice" mode="advanced"> 
    425                 <xsl:attribute name="name"><xsl:value-of select="generate-id()" /></xsl:attribute> 
    426                 <xsl:if test="ThroughputProfile"> 
    427                         <xsl:apply-templates select="ThroughputProfile" /> 
    428                 </xsl:if> 
    429         </xsl:template> 
    430  
    431         <xsl:template match="ThroughputProfile"> 
    432                 <xsl:apply-templates select="FlowState" /> 
    433         </xsl:template> 
    434  
    435         <xsl:template match="FlowState"> 
     437        <xsl:template match="CoolingDevice" mode="air">  
     438                <xsl:if test="AirThroughputProfile"> 
     439                        <xsl:attribute name="name"><xsl:value-of select="AirThroughputProfile/Name" /></xsl:attribute> 
     440                        <xsl:apply-templates select="AirThroughputProfile" />    
     441                </xsl:if>                
     442        </xsl:template> 
     443 
     444        <xsl:template match="CoolingDevice" mode="water">        
     445                <xsl:if test="WaterThroughputProfile"> 
     446                        <xsl:attribute name="name"><xsl:value-of select="WaterThroughputProfile/Name" /></xsl:attribute> 
     447                        <xsl:apply-templates select="WaterThroughputProfile" />                                                                          
     448                </xsl:if> 
     449        </xsl:template> 
     450 
     451 
     452        <xsl:template match="AirThroughputProfile"> 
     453                <xsl:apply-templates select="FlowState" mode="air"/> 
     454        </xsl:template> 
     455 
     456        <xsl:template match="WaterThroughputProfile"> 
     457                <xsl:apply-templates select="FlowState" mode="water"/> 
     458        </xsl:template> 
     459 
     460        <xsl:template match="FlowState" mode="air"> 
    436461                <xsl:element name="airThroughputState"> 
     462                        <xsl:element name="name"> 
     463                                <xsl:value-of select="State" /> 
     464                        </xsl:element> 
     465                        <xsl:if test="Flow"> 
     466                                <xsl:element name="value"> 
     467                                        <xsl:value-of select="Flow" /> 
     468                                </xsl:element> 
     469                        </xsl:if> 
     470                        <xsl:if test="PowerUsage"> 
     471                                <xsl:element name="powerUsage"> 
     472                                        <xsl:value-of select="PowerUsage" /> 
     473                                </xsl:element> 
     474                        </xsl:if> 
     475                        <xsl:if test="Transition"> 
     476                                <xsl:apply-templates select="Transition" /> 
     477                        </xsl:if> 
     478                </xsl:element> 
     479        </xsl:template> 
     480 
     481        <xsl:template match="FlowState" mode="water"> 
     482                <xsl:element name="waterThroughputState"> 
    437483                        <xsl:element name="name"> 
    438484                                <xsl:value-of select="State" /> 
     
    717763                </xsl:element> 
    718764                 
     765                <!-- TODO --> 
    719766                <!-- Transform ignored --> 
    720767                 
Note: See TracChangeset for help on using the changeset viewer.