Changeset 1266 for DCWoRMS/branches
- Timestamp:
- 02/09/14 23:41:01 (11 years ago)
- Location:
- DCWoRMS/branches/coolemall/simulator/xslt/debb
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/branches/coolemall/simulator/xslt/debb/PLMXMLTranslator.xsl
r1260 r1266 11 11 <xsl:param name="templateStartLevel" select="templateStartLevel" /> 12 12 13 <xsl:param name="plmxmlFolderName" select="plmxmlFolderName" /> 13 14 <xsl:param name="plmxmlFileName" select="plmxmlFileName" /> 14 15 … … 54 55 55 56 <xsl:template match="plm:InstanceGraph" mode="createTemplates"> 56 <xsl:apply-templates select="//plm:ProductRevisionView[plm:UserData/plm:UserValue/@title='DEBBLevel' and plm:UserData/plm:UserValue/@value=$templateStartLevel]" mode="createTemplates"/> 57 58 59 </xsl:template> 60 57 <xsl:variable name="rootRef" select="@rootRefs" /> 58 <xsl:apply-templates select="//plm:ProductInstance[@id=$rootRef]" mode="createTemplates"/> 59 60 </xsl:template> 61 62 <xsl:template match="plm:ProductInstance" mode="createTemplates"> 63 64 <xsl:variable name="nodesTemplates" select="distinct-values(//plm:ProductRevisionView[plm:UserData/plm:UserValue/@value=$templateStartLevel]/plm:UserData/plm:UserValue[@title='DEBBComponentFile']/@value)"/> 65 <xsl:for-each select="1 to count($nodesTemplates)"> 66 <xsl:variable name="index" select="." /> 67 <xsl:variable name="debbFileName" select="$nodesTemplates[$index]"/> 68 <xsl:variable name="nodesTemplatesIds" select="distinct-values($rootDoc//plm:ProductRevisionView[plm:UserData/plm:UserValue/@value=$debbFileName]/plm:UserData/plm:UserValue[@title='DEBBComponentId']/@value)"/> 69 <xsl:for-each select="1 to count($nodesTemplatesIds)"> 70 <xsl:variable name="index2" select="." /> 71 <xsl:variable name="debbFileFullName"> 72 <xsl:value-of select="$plmxmlFolderName"/> 73 <xsl:text>/</xsl:text> 74 <xsl:value-of select="$debbFileName"/> 75 </xsl:variable> 76 <xsl:variable name="nestedDoc" select="document($debbFileFullName)" /> 77 <xsl:variable name="debbComponentId" select="$nodesTemplatesIds[$index2]"/> 78 79 <xsl:variable name="instancesReferences" select="distinct-values($rootDoc//plm:ProductRevisionView[plm:UserData/plm:UserValue/@value=$debbFileName and plm:UserData/plm:UserValue/@value=$debbComponentId]/@instanceRefs)"/> 80 81 <xsl:variable name="partsReferences" select="distinct-values($rootDoc//plm:ProductInstance[@id=($instancesReferences)]/@partRef)"/> 82 83 <xsl:variable name="devicesIds" select="distinct-values($rootDoc//plm:ProductRevisionView[@id=($partsReferences)]/plm:UserData/plm:UserValue[@title='DEBBComponentId']/@value)"/> 84 85 <xsl:for-each select="1 to count($devicesIds)"> 86 <xsl:variable name="index3" select="." /> 87 <xsl:element name="computingResourceTemplate"> 88 <xsl:attribute name="name"> 89 <xsl:value-of select="$templateStartLevel"/> 90 <xsl:text>-</xsl:text> 91 <xsl:value-of select="$debbComponentId"/> 92 </xsl:attribute> 93 <xsl:attribute name="class"> 94 <xsl:value-of select="$templateStartLevel"/> 95 </xsl:attribute> 96 <xsl:apply-templates select="$nestedDoc//*[ComponentId=$debbComponentId]" mode="component"/> 97 <xsl:element name="device"> 98 <xsl:variable name="deviceName" select="distinct-values($rootDoc//plm:ProductRevisionView[plm:UserData/plm:UserValue/@value=$devicesIds[$index3]]/@name)[1]" /> 99 <xsl:attribute name="name"> 100 <xsl:value-of select="$deviceName" /> 101 </xsl:attribute> 102 <xsl:variable name="deviceClass" select="distinct-values($rootDoc//plm:ProductRevisionView[plm:UserData/plm:UserValue/@value=$devicesIds[$index3]]/plm:UserData/plm:UserValue[@title='DEBBLevel']/@value)[1]" /> 103 <xsl:attribute name="class"> 104 <xsl:value-of select="$deviceClass"/> 105 </xsl:attribute> 106 <xsl:variable name="devicesTemplates" select="distinct-values($rootDoc//plm:ProductRevisionView[plm:UserData/plm:UserValue/@value=$devicesIds[$index3]]/plm:UserData/plm:UserValue[@title='DEBBComponentFile']/@value)"/> 107 108 <xsl:for-each select="1 to count($devicesTemplates)"> 109 <xsl:variable name="index4" select="." /> 110 <xsl:variable name="deviceFileFullName"> 111 <xsl:value-of select="$plmxmlFolderName"/> 112 <xsl:text>/</xsl:text> 113 <xsl:value-of select="$devicesTemplates[$index4]"/> 114 </xsl:variable> 115 <xsl:variable name="nestedDoc2" select="document($deviceFileFullName)" /> 116 <xsl:apply-templates select="$nestedDoc2//*[ComponentId=$devicesIds[$index3]]" mode="heatsink"> 117 <xsl:with-param name="instanceRefs" select="distinct-values($rootDoc//plm:ProductRevisionView[plm:UserData/plm:UserValue/@value=$devicesIds[$index3]]/@id)[1]" /> 118 </xsl:apply-templates> 119 </xsl:for-each> 120 </xsl:element> 121 </xsl:element> 122 123 124 </xsl:for-each> 125 126 </xsl:for-each> 127 </xsl:for-each> 128 </xsl:template> 129 61 130 <xsl:template match="plm:ProductInstance" mode="createHierarchy"> 62 131 <xsl:variable name="partRef" select="@partRef" /> -
DCWoRMS/branches/coolemall/simulator/xslt/debb/coolemallPlugins.xml
r1260 r1266 89 89 </energyEstimationPlugin> 90 90 91 91 <energyEstimationPlugin> 92 92 <name>example.energy.coolemall.FlowPumpInletEnergyEstimationPlugin</name> 93 93 <resources> … … 111 111 </resources> 112 112 </energyEstimationPlugin> 113 114 <loadEstimationPlugin> 115 <name>example.energy.coolemall.DefaultLoadEstimationPlugin</name> 116 <resources> 117 <class>ComputeBox2</class> 118 <class>Room</class> 119 <class>ComputeBox1</class> 120 <class>Rack</class> 121 <class>NodeGroup</class> 122 <class>Node</class> 123 </resources> 124 </loadEstimationPlugin> 125 126 <loadEstimationPlugin> 127 <name>example.energy.coolemall.ProcessorLoadEstimationPlugin</name> 128 <resources> 129 <class>Processor</class> 130 </resources> 131 </loadEstimationPlugin> 113 132 </plugins>
Note: See TracChangeset
for help on using the changeset viewer.