fixed minor mapping table bugs and further optimized converter (now generates output from IfcGroup)

parent aa48eb13
......@@ -31,14 +31,13 @@
</xsl:when>
<xsl:otherwise>-->
<!--GENERATE the target element-->
<xsl:element name="{$simelemname}">
<!--DEBUG-->
<!--<xsl:element name="SimFlowPlant_Boiler_BoilerHotWater">-->
<!--<xsl:copy-of select="$KeyPool"/>-->
<!--<xsl:element name="ConcatedPsetCollections">
<xsl:copy-of select="$ConcatedPsetCollections"/>
<!--<xsl:element name="SimFlowPlant_Boiler_BoilerHotWater">
<xsl:copy-of select="$KeyPool"/>
</xsl:element>-->
<!--DEBUG-->
<xsl:element name="{$simelemname}">
<!--DEBUG-->
<!--<xsl:element name="SimFlowPlant_Boiler_BoilerHotWater">-->
<!--<xsl:element name="DuplicateList">
......@@ -60,7 +59,6 @@
<xsl:call-template name="IterateAlongSequenceOrder">
<xsl:with-param name="KeyPool" select="$KeyPool"/>
<xsl:with-param name="CurrentSimElementName" select="$simelemname"/>
<!--<xsl:with-param name="unsortedtargetcontent" select="$unsortedtargetcontent"/>-->
<xsl:with-param name="unsortedtargetcontent" select="$unsortedtargetcontent"/>
</xsl:call-template>
<!--<xsl:if test="$pregens != ''">
......
@echo off
cscript Main.js //Nologo %1
/* KIT Tool | EneffBIM converter 2016 Version 0.1 (Author KIT BLM)
* main.js
*
* JScript zur Transformation einer IFC Quelldatei in das designierte Zielformat durch den Einsatz von xsl stylesheet
*/var args = WScript.Arguments;
if (args.length == 0) {
WScript.Echo("Syntaxfehler.");
WScript.Quit();
}
// command-line argumente auslesen
filename = args(0); // Quelldatei
try {
// XML Objekt fr die Quelldatei erzeugen
var xml = new ActiveXObject("Msxml2.DOMDocument.6.0");
xml.async = false;
xml.validateOnParse = true;
xml.load(filename);
WScript.Echo("source XML load succeeded.");
// Einlesevorgang Quelldatei error handling
if (xml.parseError.errorCode != 0) {
WScript.Echo(xml.parseError.reason);
WScript.Quit()
}
// XSLT-Stylesheet laden
var xsl = new ActiveXObject("Msxml2.DOMDocument.6.0");
xsl.async = false;
xsl.resolveExternals = true; // xsl:include zulassen
xsl.setProperty("AllowXsltScript", true); // Skripte erlauben
////////////////
xsl.setProperty("AllowDocumentFunction", true); // document() Funktion erlauben
///////////////
xsl.validateOnParse = true;
xsl.load("xsl\\Main.xsl"); // "Statisch verdrahteter" Einstiegspunkt in XSLT Geflecht
WScript.Echo("XSL load succeeded.");
// Einlesevorgang XSLT error handling
if (xsl.parseError.errorCode != 0) {
WScript.Echo(xsl.parseError.reason);
WScript.Quit()
}
// Objekt fr Zieldokument erzeugen
var result = new ActiveXObject("Msxml2.DOMDocument.6.0");
// Speichere Startzeit
var sTime = new Date();
// Quelldatei TRANSFORMieren
WScript.Echo("Started Transformation.");
xml.transformNodeToObject(xsl.documentElement, result);
WScript.Echo("Transformation succeeded.");
var eTime = new Date();
var elapsed = (eTime.getTime() - sTime.getTime()) / 1000;
WScript.Echo("Transformation took " + elapsed + " seconds.");
// Zieldokument in UTF-8-Stream schreiben
var utf8Stream = new ActiveXObject("ADODB.Stream");
fso = new ActiveXObject("Scripting.FileSystemObject");
utf8Stream.Type = 2; // adTypeText
utf8Stream.Charset = "utf-8"
utf8Stream.LineSeparator = 10; // adLF
utf8Stream.Open();
utf8Stream.WriteText(result.xml);
utf8Stream.Position = 3; // Byte Order Mark berspringen
utf8Stream.SaveToFile("output\\" + fso.GetBaseName(filename) + ".simxml", 2); // adSaveCreateOverWrite
WScript.Echo("Transformation result saved to OUTPUT folder.");
utf8Stream.Close();
}
catch (err) {
WScript.Echo(err.description);
}
<?xml version="1.0" encoding="utf-8"?>
<!-- KIT Tool | EneffBIM converter 2016 Version 0.1 (Author KIT BLM)-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://d-alchemy.com/schema/simxml/Model" xmlns:simcore="http://d-alchemy.com/schema/simxml/SimModelCore" xmlns:simres="http://d-alchemy.com/schema/simxml/ResourcesGeneral" xmlns:simgeom="http://d-alchemy.com/schema/simxml/ResourcesGeometry" xmlns:simbldg="http://d-alchemy.com/schema/simxml/BuildingModel" xmlns:simmep="http://d-alchemy.com/schema/simxml/MepModel" xmlns:ifc="http://www.buildingsmart-tech.org/ifcXML/IFC4/Add1" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="xsl ifc msxsl">
<xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="yes"/>
<xsl:strip-space elements="*"/>
<!--the IfcGroup template-->
<xsl:template match="ifc:IfcGroup">
<xsl:param name="KeyPool"/>
<xsl:if test="$KeyPool != '' and @GlobalId != ''">
<xsl:variable name="simelemname">
<xsl:call-template name="getTargetElementName">
<xsl:with-param name="KeyPool" select="$KeyPool"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="generictargetcontent">
<!--<xsl:element name="simcore:SimUniqueID">TTT</xsl:element>-->
<!-- generate current's target elements specific fields and attributes (e.g. UniqueId)-->
<!--<xsl:copy>-->
<xsl:call-template name="resolvekeypool">
<xsl:with-param name="KeyPoolSnippet" select="$KeyPool"/>
<xsl:with-param name="elemname" select="name()"/>
</xsl:call-template>
<!--</xsl:copy>-->
</xsl:variable>
<xsl:variable name="resolvedfromproperties">
<!-- generate target element content from current source object's properties-->
<!--<xsl:copy>-->
<xsl:call-template name="GenerateTargetElementContentsFromSourceProperties">
<xsl:with-param name="KeyPool" select="$KeyPool"/>
</xsl:call-template>
<!--</xsl:copy>-->
</xsl:variable>
<!--Call the Generic Generation Template-->
<xsl:call-template name="GenerateTargetElement">
<xsl:with-param name="KeyPool" select="$KeyPool"/>
<xsl:with-param name="simelemname" select="$simelemname"/>
<xsl:with-param name="unsortedtargetcontent">
<!--<xsl:copy-of select="$generictargetcontent"/>-->
<!--<xsl:copy-of select="$resolvedfromproperties"/>-->
<xsl:call-template name="MergeTargetElementContentCollections">
<xsl:with-param name="generictargetcontent" select="$generictargetcontent"/>
<xsl:with-param name="resolvedfromproperties" select="$resolvedfromproperties"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
<!--DEBUG-->
<!--SimList_EquipmentList_ZoneHvac-->
<!--<xsl:element name="{$simelemname}">
<xsl:copy-of select="$simelemname"/>
<xsl:copy-of select="@id"/>
<xsl:copy-of select="$KeyPool"/>
<xsl:copy-of select="$resolvedfromproperties"/>
</xsl:element>-->
<!--DEBUG-->
</xsl:if>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?>
<!-- KIT Tool | EneffBIM converter 2016 Version 0.1 (Author KIT BLM)-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ifc="http://www.buildingsmart-tech.org/ifcXML/IFC4/Add1" exclude-result-prefixes="xsl ifc">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:strip-space elements="*"/>
<!--EneffBIM common templates-->
<xsl:include href="../../KeyPoolBuilder/xsl/KeyPoolBuilder.xsl"/>
<xsl:include href="../../KeyPoolHelper/xsl/KeyPoolHelper.xsl"/>
<xsl:include href="../../KeyBoundElementGenerator/xsl/KeyBoundElementGenerator.xsl"/>
<xsl:include href="../../SimXsdRrepository/xsl/SimXsdRrepository.xsl"/>
<xsl:include href="../../GenerateTargetElement/xsl/GenerateTargetElement.xsl"/>
<!--IFC common templates-->
<xsl:include href="../../IfcPropertySet/xsl/IfcPropertySet.xsl"/>
<xsl:include href="../../IfcType/xsl/IfcType.xsl"/>
<xsl:include href="../../IfcHelper/xsl/IfcHelper.xsl"/>
<xsl:include href="../../ifcXML/xsl/ifcXML.xsl"/>
<!--nested IFC Object traversal templates-->
<xsl:include href="../../IfcProject/xsl/IfcProject.xsl"/>
<xsl:include href="../../IfcSite/xsl/IfcSite.xsl"/>
<xsl:include href="../../IfcBuilding/xsl/IfcBuilding.xsl"/>
<xsl:include href="../../IfcBuildingStorey/xsl/IfcBuildingStorey.xsl"/>
<xsl:include href="../../IfcSpace/xsl/IfcSpace.xsl"/>
<!--IFC object transformation templates-->
<!--<xsl:include href="../../IfcBuildingSystem/xsl/IfcBuildingSystem.xsl"/>
<xsl:include href="../../IfcDistributionSystem/xsl/IfcDistributionSystem.xsl"/>
<xsl:include href="../../IfcDistributionPort/xsl/IfcDistributionPort.xsl"/>
<xsl:include href="../../IfcRelConnectsPorts/xsl/IfcRelConnectsPorts.xsl"/>
<xsl:include href="../../IfcSpaceHeater/xsl/IfcSpaceHeater.xsl"/>
<xsl:include href="../../IfcOccupant/xsl/IfcOccupant.xsl"/>
<xsl:include href="../../IfcActor/xsl/IfcActor.xsl"/>
<xsl:include href="../../IfcBoiler/xsl/IfcBoiler.xsl"/>-->
<!--<xsl:include href="../../IfcTank/xsl/IfcTank.xsl"/>
<xsl:include href="../../IfcValve/xsl/IfcValve.xsl"/>
<xsl:include href="../../IfcPump/xsl/IfcPump.xsl"/>
<xsl:include href="../../IfcPipeSegment/xsl/IfcPipeSegment.xsl"/>
<xsl:include href="../../IfcPipeFitting/xsl/IfcPipeFitting.xsl"/>-->
<!--<xsl:include href="../../IfcZone/xsl/IfcZone.xsl"/>-->
<xsl:include href="../../IfcGroup/xsl/IfcGroup.xsl"/>
<xsl:template match="/">
<!--<xsl:apply-templates/>-->
<xsl:if test="ifc:ifcXML">
<xsl:call-template name="ifcXML"/>
</xsl:if>
</xsl:template>
<!--prevent text() output if no template matching the type is present in xslt constellation-->
<xsl:template match="text()"/>
</xsl:stylesheet>
......@@ -76,6 +76,18 @@
<xsl:for-each select="msxsl:node-set($allsourceobjects)/node()">
<xsl:variable name="currentElem" select="current()"/>
<xsl:choose>
<!--workarround IFC4 inverse attribute-->
<xsl:when test="current()/ifc:IsDecomposedBy/ifc:IfcRelAggregates/ifc:RelatedObjects/ifc:IfcGroup[@GlobalId]">
<xsl:for-each select="current()/ifc:IsDecomposedBy/ifc:IfcRelAggregates/ifc:RelatedObjects/ifc:IfcGroup[@GlobalId]">
<xsl:call-template name="KeyPoolHelper">
<xsl:with-param name="currentElement" select="name()"/>
</xsl:call-template>
</xsl:for-each>
<xsl:call-template name="KeyPoolHelper">
<xsl:with-param name="currentElement" select="name()"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="current()/ifc:IsNestedBy/ifc:IfcRelNests/ifc:RelatedObjects/ifc:IfcDistributionPort">
<xsl:if test="current()/ifc:IsNestedBy/ifc:IfcRelNests/ifc:RelatedObjects/ifc:IfcDistributionPort[@GlobalId]">
<!--<xsl:apply-templates select="current()/IsNestedBy/IfcRelNests/RelatedObjects/ifc:IfcDistributionPort"/>-->
......
......@@ -429,7 +429,7 @@
<xsl:variable name="term" select="substring-before(substring-after($cleanedupKeyPool,'__'), ' ')"/>
<xsl:variable name="int" select="substring-before(substring-after($term, '_'), '_')"/>
<xsl:variable name="resint" select="$int +1 - $posint"/>
<xsl:value-of select="concat(substring-before($term, '_'),' ')"/>
<xsl:value-of select="concat(substring-before($term, '_'),': ')"/>
<xsl:value-of select="concat($resint, ':')"/>
<xsl:value-of select="substring-after(substring-after($term, '_'), '_')"/>
</xsl:variable>
......@@ -449,10 +449,11 @@
<xsl:otherwise>
<!--DEBUG-->
Something went wrong..
KeyPool: <xsl:copy-of select="$cleanedupKeyPool"/>
KeyPoolCurrentSnippet: <xsl:copy-of select="$cleanedupKeyPool"/>
Flag: <xsl:copy-of select="$token"/>
Element Name:<xsl:copy-of select="$elemname"/>
CheckedFlag: <xsl:copy-of select="$current_FLAG"/>
KeyPool: <xsl:copy-of select="$KeyPool"/>
<!--DEBUG-->
</xsl:otherwise>
</xsl:choose>
......
......@@ -6,11 +6,6 @@
<!--the IfcZone template-->
<xsl:template match="ifc:IfcZone">
<xsl:param name="KeyPool"/>
<!--DEBUG-->
<xsl:element name="SimActor_Actor_Default">
<xsl:copy-of select="'test'"/>
</xsl:element>
<!--DEBUG-->
<xsl:if test="$KeyPool != ''">
<xsl:variable name="simelemname">
<xsl:call-template name="getTargetElementName">
......@@ -19,7 +14,7 @@
</xsl:variable>
<xsl:variable name="generictargetcontent">
<!--<xsl:element name="simcore:SimUniqueID">TTT</xsl:element>-->
<!-- generate current source object's target elements specific fields and attributes (e.g. UniqueId)-->
<!-- generate current's target elements specific fields and attributes (e.g. UniqueId)-->
<!--<xsl:copy>-->
<xsl:call-template name="resolvekeypool">
<xsl:with-param name="KeyPoolSnippet" select="$KeyPool"/>
......@@ -35,47 +30,26 @@
</xsl:call-template>
<!--</xsl:copy>-->
</xsl:variable>
<!--we need to introduce additional xsl:variable as intermediate step because with the content of target element also the content of e.g. corrosponding controller was generated which we need to filter and assemble-->
<xsl:variable name="filtercontrollercontent">
<xsl:call-template name="tryAssembleTargetController">
<xsl:with-param name="input" select="$resolvedfromproperties"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="filterreferencepropertycontent">
<xsl:call-template name="tryAssembleTargetElement">
<xsl:with-param name="input" select="$resolvedfromproperties"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="mergeGeneratedContents">
<xsl:choose>
<xsl:when test="$filtercontrollercontent != 'FALSE' or $filterreferencepropertycontent != 'FALSE'">
<xsl:variable name="filteredcurrentelementcontents">
<xsl:call-template name="filterAllElementContents">
<xsl:with-param name="input" select="$resolvedfromproperties"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="MergeTargetElementContentCollections">
<xsl:with-param name="generictargetcontent" select="$generictargetcontent"/>
<xsl:with-param name="resolvedfromproperties" select="$filteredcurrentelementcontents"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="MergeTargetElementContentCollections">
<xsl:with-param name="generictargetcontent" select="$generictargetcontent"/>
<xsl:with-param name="resolvedfromproperties" select="$resolvedfromproperties"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!--Call the Generic Generation Template-->
<xsl:call-template name="GenerateTargetElement">
<xsl:with-param name="KeyPool" select="$KeyPool"/>
<xsl:with-param name="simelemname" select="$simelemname"/>
<xsl:with-param name="unsortedtargetcontent" select="$mergeGeneratedContents"/>
<xsl:with-param name="unsortedtargetcontent">
<!--<xsl:copy-of select="$generictargetcontent"/>-->
<!--<xsl:copy-of select="$resolvedfromproperties"/>-->
<xsl:call-template name="MergeTargetElementContentCollections">
<xsl:with-param name="generictargetcontent" select="$generictargetcontent"/>
<xsl:with-param name="resolvedfromproperties" select="$resolvedfromproperties"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
<!--in case additional elements were generated add to RST-->
<xsl:copy-of select="$filtercontrollercontent"/>
<xsl:copy-of select="$filterreferencepropertycontent"/>
</xsl:if>
<!--DEBUG-->
<!--<xsl:element name="SimSpatialZone">
<xsl:copy-of select="$simelemname"/>
<xsl:copy-of select="$generictargetcontent"/>
<xsl:copy-of select="$resolvedfromproperties"/>
</xsl:element>-->
<!--DEBUG-->
</xsl:template>
</xsl:stylesheet>
......@@ -792,7 +792,7 @@
<xsl:choose>
<xsl:when test="$conditionTestString = $currentTestString">TRUE</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$pvalue"/>
<!--<xsl:value-of select="$pvalue"/>-->FALSE
</xsl:otherwise>
</xsl:choose>
</xsl:when>
......
<!-- KIT Tool | EneffBIM converter 2016 Version 0.1 (Author KIT BLM)-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ifc="http://www.buildingsmart-tech.org/ifcXML/IFC4/Add1" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="xsl ifc msxsl">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<!-- http://stackoverflow.com/questions/12011669/csv-to-xml-using-xslt-how-to-have-incrementing-column-name -->
<!--HTML Encoded Line Feed character-->
......@@ -11,10 +10,17 @@
<!--<xsl:variable name="currentElem" select="current()"/>-->
<!--<root>-->
<!--ElementName = <xsl:value-of select="$ElementName"/>-->
<!--strip ALL quote sign from CSV imported string-->
<xsl:variable name="stripedQuotesCSV">
<xsl:call-template name="remove">
<xsl:with-param name="input" select="$GetMappingTable"/>
<xsl:with-param name="removal" select="'&quot;'"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="csvrowfilter">
<xsl:with-param name="localname" select="$ElementName"/>
<!--currentElement-->
<xsl:with-param name="csvStringToFilter" select="$GetMappingTable"/>
<xsl:with-param name="csvStringToFilter" select="$stripedQuotesCSV"/>
</xsl:call-template>
<!--</root>-->
</xsl:template>
......@@ -52,14 +58,14 @@
<!--bedingung für valides (zu beachtendes) Mapping Konditionsfeld: es enthält den namen des aktuelle ifc element! Zudem Kontercheck (e.g. falls namen im Kommentarfeld verwendet werden): nachfolgendes Feld muss das der IFC Spalte sein daher NUR der name des elementes-->
<xsl:call-template name="checkConditionCell">
<xsl:with-param name="elementname" select="$localname"/>
<xsl:with-param name="rowsnippet">
<xsl:call-template name="remove">
<xsl:with-param name="input" select="substring-before($csvStringToFilter,$LF)"/>
<xsl:with-param name="removal" select="'&quot;'"/>
</xsl:call-template>
</xsl:with-param>
<xsl:with-param name="rowsnippet" select="substring-before($csvStringToFilter,$LF)"/>
</xsl:call-template>
<!--</xsl:if>-->
<!--<xsl:call-template name="csvcolumfilter">
<xsl:with-param name="localname" select="$localname"/>
<xsl:with-param name="csvStringToFilter" select="substring-before($csvStringToFilter,$LF)"/>
<xsl:with-param name="getSingleSnippet" select="''"/>
</xsl:call-template>-->
</xsl:variable>
<xsl:choose>
<xsl:when test="contains($MappingCondition, concat($localname, '.'))">
......@@ -107,7 +113,6 @@ B) ###.###.PSim_Pump.IsVariableSpeed.FALSE (Note: this case also covers a case-s
<!--select="$keyPoolSnippet"-->
<!--</xsl:call-template>-->
</xsl:variable>
<!--Note: if the designated value is not found on the designated property the actual value is returned-->
<xsl:if test="$preEvaluatePsets = 'TRUE'">
<!--$preEvaluatePsets != ''-->
<xsl:call-template name="csvcolumfilter">
......@@ -209,8 +214,6 @@ B) ###.###.PSim_Pump.IsVariableSpeed.FALSE (Note: this case also covers a case-s
</xsl:choose>
</xsl:if>
<!--<xsl:value-of select="$MappingCondition"/>-->
<!--</row>-->
<!-- repeat for the remainder of the original string-->
<xsl:call-template name="csvrowfilter">
<xsl:with-param name="localname" select="$localname"/>
<xsl:with-param name="csvStringToFilter">
......@@ -231,46 +234,37 @@ B) ###.###.PSim_Pump.IsVariableSpeed.FALSE (Note: this case also covers a case-s
<xsl:template name="csvcolumfilter">
<xsl:param name="localname" select="''"/>
<xsl:param name="csvStringToFilter" select="''"/>
<xsl:param name="getSingleSnippet" select="''"/>
<xsl:choose>
<!-- string contains linefeed (delimiter by CSV; caution can also be comma!-->
<!-- string contains linefeed (delimiter by CSV; caution CSV also allows comma!-->
<xsl:when test="contains($csvStringToFilter,';')">
<!-- Filter everything up to the first carriage return-->
<!--<xsl:element name="{concat('column', position())}">-->
<xsl:variable name="currentColumnText">
<!--select="substring-before($csvStringToFilter,';')"/>-->
<xsl:call-template name="remove">
<xsl:with-param name="input" select="substring-before($csvStringToFilter,';')"/>
<xsl:with-param name="removal" select="'&quot;'"/>
</xsl:call-template>
</xsl:variable>
<!--Filter the IFC Element name; prefix to all entries in the IFC colum-->
<xsl:variable name="triggerWord" select="substring-before($currentColumnText, '.')"/>
<xsl:variable name="combinedTrigger" select="concat($localname,'.')"/>
<!--<xsl:value-of select="$combinedTrigger"/>-->
<!--Mapping Condition Column identifier-->
<xsl:if test="(not(starts-with($currentColumnText, 'Sim')) and $combinedTrigger !='.') and (contains($currentColumnText, $combinedTrigger) or contains($currentColumnText, concat('.', $localname)))">
<xsl:value-of select="$currentColumnText"/>
<!--add the mapping delimiter: *space*-->
<xsl:value-of select="' '"/>
<!--<xsl:copy-of select="translate(substring-before($csvStringToFilter,';'), '&quot;', '')"/>-->
</xsl:if>
<!--IFC Column identifier-->
<xsl:if test="($currentColumnText = $localname) or boolean($triggerWord != '')">
<!-- obsolete since quotes are already removed above
<xsl:variable name="trigger" select="substring-after($triggerText,'&quot;')"/>-->
<xsl:if test="($currentColumnText = $localname) or ($triggerWord = $localname)">
<!--add the value of the cell to return collection-->
<xsl:value-of select="$currentColumnText"/>
<!--add the mapping delimiter: *space*-->
<xsl:value-of select="' '"/>
</xsl:if>
</xsl:if>
<!--Filter the to be mapped Simmodel element in the Simmodel colum-->
<xsl:if test="starts-with($currentColumnText, 'Sim') and not(contains($currentColumnText, 'SimModel '))">
<xsl:value-of select="$currentColumnText"/>
<!--add the next mapping tuple delimiter: # -->
<!--# (Note: changed due to conflicting syntax ###.### as escaped predefined attribute within mapping table conditional field syntax)-->
§
<!--we iterate each cell in the handed in row here and yield for the preview 2 (two delimiter ahead) var to start with "SIM" - the match condition for the SimModel colum - then we write the valid mapping entry to KeyPool-->
<xsl:variable name="preview2delim" select="substring-after(substring-after($csvStringToFilter, ';'), ';')"/>
<xsl:if test="starts-with($preview2delim, 'Sim')">
<xsl:variable name="mapConditionColumn">
<xsl:value-of select="substring-before($csvStringToFilter,';')"/>
</xsl:variable>
<xsl:variable name="sourceColumn">
<xsl:value-of select="substring-before(substring-after($csvStringToFilter, ';'),';')"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$getSingleSnippet != ''">
<!--check and if applicable return-->
<xsl:if test="($sourceColumn != '' and contains($mapConditionColumn,concat($localname, '.')) and $sourceColumn = $localname)">
<!-- and (contains($firstcellofsnippet, 'Predefined') or contains($firstcellofsnippet, '###'))-->
<xsl:value-of select="$mapConditionColumn"/>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="targetColumn">
<xsl:value-of select="substring-before($preview2delim,';')"/>
</xsl:variable>
<xsl:value-of select="concat($mapConditionColumn, ' ')"/>
<xsl:value-of select="concat($sourceColumn, ' ')"/>
<xsl:value-of select="concat($targetColumn, '§')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<!--</xsl:element>-->
<!-- repeat for the remainder of the original string-->
......@@ -293,6 +287,55 @@ B) ###.###.PSim_Pump.IsVariableSpeed.FALSE (Note: this case also covers a case-s
</xsl:otherwise>-->
</xsl:choose>
</xsl:template>
<!--<xsl:template name="oldfilterlogic">
-->
<!--Filter the IFC Element name; prefix to all entries in the IFC colum-->
<!--
<xsl:variable name="triggerWord" select="substring-before($currentColumnText, '.')"/>
<xsl:variable name="combinedTrigger" select="concat($localname,'.')"/>
-->
<!--Mapping Condition Column identifier-->
<!--
<xsl:if test="(not(starts-with($currentColumnText, 'Sim')) and $combinedTrigger !='.') and (contains($currentColumnText, $combinedTrigger) or contains($currentColumnText, concat('.', $localname)))">
<xsl:value-of select="$currentColumnText"/>
-->
<!--add the mapping delimiter: *space*-->
<!--
<xsl:value-of select="' '"/>
</xsl:if>
-->
<!--IFC Column identifier-->
<!--
<xsl:if test="($currentColumnText = $localname) or boolean($triggerWord != '')">
-->
<!-- obsolete since quotes are already removed above
<xsl:variable name="trigger" select="substring-after($triggerText,'&quot;')"/>-->
<!--
<xsl:if test="($currentColumnText = $localname) or ($triggerWord = $localname)">
-->
<!--add the value of the cell to return collection-->
<!--
<xsl:value-of select="$currentColumnText"/>
-->
<!--add the mapping delimiter: *space*-->
<!--
<xsl:value-of select="' '"/>
</xsl:if>
</xsl:if>
-->
<!--Filter the to be mapped Simmodel element in the Simmodel colum-->
<!--
<xsl:if test="starts-with($currentColumnText, 'Sim') and not(contains($currentColumnText, 'SimModel '))">
<xsl:value-of select="$currentColumnText"/>
-->
<!--add the next mapping tuple delimiter: # -->
<!--
-->
<!--# (Note: changed due to conflicting syntax ###.### as escaped predefined attribute within mapping table conditional field syntax)-->
<!--
§
</xsl:if>
</xsl:template>-->
<!--<xsl:variable name="MappingCondition">
<xsl:value-of select="current()"/>
</xsl:variable>-->
......
......@@ -284,7 +284,8 @@
<xsl:with-param name="KeyPool" select="concat($KeyPoolSnippet, '§')"/>
<!--concat($localname, '.IfcSomething SimDummy.ElementName§')-->
<!--we need to filter the term "pset_name.property_name.property_vlaue" from the current mapping table line-->
<xsl:with-param name="preEvaluation" select="substring-after(substring-before($KeyPoolSnippet, ' '), concat($localname, '.'))"/>
<!--<xsl:with-param name="preEvaluation" select="substring-after(substring-before($KeyPoolSnippet, ' '), concat($localname, '.'))"/>-->
<xsl:with-param name="preEvaluation" select="substring-after(substring-before($KeyPoolSnippet, ' Sim'), concat($localname, '.'))"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
......
......@@ -38,6 +38,7 @@
<xsl:include href="../../IfcPipeSegment/xsl/IfcPipeSegment.xsl"/>
<xsl:include href="../../IfcPipeFitting/xsl/IfcPipeFitting.xsl"/>
<xsl:include href="../../IfcZone/xsl/IfcZone.xsl"/>
<xsl:include href="../../IfcGroup/xsl/IfcGroup.xsl"/>
<!--configuration (adjust local path variables - mapping table and target schema files-->
<!--PATH TO MAPPING TABLE FILE-->
<!--NOTE: by setting a value to conf_optional_absolute_filepath variable the default relative path workflow is overriden-->
......
......@@ -126,7 +126,7 @@ Pump;"";"";"IfcPump";"";
Rotation Speed;"";"1:1,IfcPump.###.###.PSim_Pump.IsVariableSpeed.FALSE";"IfcPump.Pset_PumpPHistory.RotationSpeed";"SimFlowMover.simmep:SimFlowMover_PumprpmSchedName";
SimFlowMover_Name;"";"1:1";"IfcPump.Name";"SimFlowMover.simmep:SimFlowMover_Name";
SimModelName;"";"1:1";"IfcPump.Name";"SimFlowMover.simcore:SimModelName";
SimModelSubtype;"";"Enum,True=VariableSpeedReturn,False=ConstantSpeedReturn";"IfcPump.PSim_Pump.IsVariableSpeed";"SimFlowMover.simcore:SimModelSubtype";
SimModelSubtype;"Enum,True=VariableSpeedReturn,False=ConstantSpeedReturn";"";"IfcPump.PSim_Pump.SimModelSubtype";"SimFlowMover.simcore:SimModelSubtype";
SimModelType;"";"Value:Pump";"";"SimFlowMover.simcore:SimModelType";
Status;"[R] not relevant for SimModel";"";"IfcPump.Pset_PumpTypeCommon.Status";"";
System Reference;"";"1:1";"IfcPump.RelatedObjects.IfcRelAssignsToGroup.RelatingGroup.GlobalId";"SimFlowMover.simcore:AssignedToGroups";
......@@ -166,7 +166,7 @@ Pump;"";"";"IfcPump";"";
Rotation Speed;"";"1:1,IfcPump.###.###.PSim_Pump.IsVariableSpeed.TRUE";"IfcPump.Pset_PumpPHistory.RotationSpeed";"SimFlowMover.simmep:SimFlowMover_PumprpmSchedName";
SimFlowMover_Name;"";"1:1";"IfcPump.Name";"SimFlowMover.simmep:SimFlowMover_Name";
SimModelName;"";"1:1";"IfcPump.Name";"SimFlowMover.simcore:SimModelName";
SimModelSubtype;"";"Enum,True=VariableSpeedReturn,False=ConstantSpeedReturn";"IfcPump.PSim_Pump.IsVariableSpeed";"SimFlowMover.simcore:SimModelSubtype";
SimModelSubtype;"Enum,True=VariableSpeedReturn,False=ConstantSpeedReturn";"";"IfcPump.PSim_Pump.SimModelSubtype";"SimFlowMover.simcore:SimModelSubtype";
SimModelType;"";"Value:Pump";"";"SimFlowMover.simcore:SimModelType";
Status;"[R] not relevant for SimModel";"";"IfcPump.Pset_PumpTypeCommon.Status";"";
System Reference;"";"1:1";"IfcPump.RelatedObjects.IfcRelAssignsToGroup.RelatingGroup.GlobalId";"SimFlowMover.simcore:AssignedToGroups";
......@@ -430,8 +430,8 @@ Valve;"[R] Maybe tempering valve is more specific...on SimModel side?";"- ";"";"
Finish;"";"";"IfcValve.Pset_ValveTypeFaucet.Finish";"";
Flow Coefficient;"";"";"IfcValve.Pset_ValveTypeCommon.FlowCoefficient";"";
Flushing Rate;"";"";"IfcValve.Pset_ValveTypeFlushing.FlushingRate";"";
Has Hose Union;"";"";"IfcValve.Pset_ValveTypeGasTap.HasHoseUnion";"";
Has Hose Union;"";"";"IfcValve.Pset_ValveTypeDrawOffCock.HasHoseUnion";"";
Has Hose Union;"";"";"IfcValve.Pset_ValveTypeGasTap.HasHoseUnion";"";
Has Integral Shut Off Device;"";"";"IfcValve.Pset_ValveTypeFlushing.HasIntegralShutOffDevice";"";
Is Automatic;"";"";"IfcValve.Pset_ValveTypeAirRelease.IsAutomatic";"";
Is High Pressure;"";"";"IfcValve.Pset_ValveTypeFlushing.IsHighPressure";"";
......@@ -474,8 +474,8 @@ Valve;"[R] Maybe tempering valve is more specific...on SimModel side?";"- ";"";"
Finish;"";"";"IfcValve.Pset_ValveTypeFaucet.Finish";"";
Flow Coefficient;"";"";"IfcValve.Pset_ValveTypeCommon.FlowCoefficient";"";
Flushing Rate;"";"";"IfcValve.Pset_ValveTypeFlushing.FlushingRate";"";
Has Hose Union;"";"";"IfcValve.Pset_ValveTypeDrawOffCock.HasHoseUnion";"";
Has Hose Union;"";"";"IfcValve.Pset_ValveTypeGasTap.HasHoseUnion";"";
Has Hose Union;"";"";"IfcValve.Pset_ValveTypeDrawOffCock.HasHoseUnion";"";
Has Integral Shut Off Device;"";"";"IfcValve.Pset_ValveTypeFlushing.HasIntegralShutOffDevice";"";
Is Automatic;"";"";"IfcValve.Pset_ValveTypeAirRelease.IsAutomatic";"";
Is High Pressure;"";"";"IfcValve.Pset_ValveTypeFlushing.IsHighPressure";"";
......@@ -543,9 +543,9 @@ RegularTimeSeries_Week;"";"IfcRegularTimeSeries.###.###.TimeStep.31536000";"IfcR
Values;"";"IfcRegularTimeSeries.###.###.TimeStep.31536000";"IfcRegularTimeseries.###.###.CB_1";"SimTimeSeriesSchedule_Week_Daily.simcore:SimUniqueID";
RegularTimeSeries_Day;"";"IfcRegularTimeSeries.###.###.TimeStep.31536000";"IfcRegularTimeSeries";"SimTimeSeriesSchedule_Day_Interval";
Properties for TimeSeriesSchedule Day;"";"";"";"";
Values;"";"IfcRegularTimeSeries.###.###.TimeStep.31536000";"IfcRegularTimeseries.###.###.Values";"SimTimeSeriesSchedule_Day_Interval.simres:SimTimeSeriesSched_Time_1_144";
Values;"";"IfcRegularTimeSeries.###.###.TimeStep.31536000";"IfcRegularTimeseries.###.###.CB_1";"SimTimeSeriesSchedule_Day_Interval.simcore:SimUniqueID";
Values Until;"";"IfcRegularTimeSeries.###.###.TimeStep.31536000";"IfcRegularTimeseries.###.###.Values_Until_24_00";"SimTimeSeriesSchedule_Day_Interval.simres:SimTimeSeriesSched_ValUntilTime_1_144";
Values;"";"IfcRegularTimeSeries.###.###.TimeStep.31536000";"IfcRegularTimeseries.###.###.Values_Until_24_00";"SimTimeSeriesSchedule_Day_Interval.simres:SimTimeSeriesSched_Time_1_144";
Values Until;"";"IfcRegularTimeSeries.###.###.TimeStep.31536000";"IfcRegularTimeseries.###.###.Values";"SimTimeSeriesSchedule_Day_Interval.simres:SimTimeSeriesSched_ValUntilTime_1_144";
Silencer;"";"";"IfcDuctSilencer";"";
Properties for Silencer;"";"";"";"";
Air Flowrate Range;"";"";"IfcDuctSilencer.Pset_DuctSilencerTypeCommon.AirFlowrateRange";"";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment