Update column names in XSY module.

This commit is contained in:
2026-11-05 22:03:40 -06:00
parent af6d214e5a
commit c62bac9d7e
3 changed files with 51 additions and 28 deletions

View File

@@ -18,13 +18,23 @@
<xsl:template match="variables"> <xsl:template match="variables">
<xsl:copy> <xsl:copy>
<name><xsl:value-of select="@name"/></name> <tagname>
<type><xsl:value-of select="@typeName"/></type> <xsl:value-of select="@name" />
<address><xsl:value-of select="@topologicalAddress"/></address> </tagname>
<comment><xsl:value-of select="comment"/></comment> <type>
<xsl:value-of select="@typeName" />
</type>
<address>
<xsl:value-of select="@topologicalAddress" />
</address>
<comment>
<xsl:value-of select="comment" />
</comment>
<parent /> <parent />
<bitrank /> <bitrank />
<save><xsl:value-of select="attribute/@Save"/></save> <save>
<xsl:value-of select="attribute/@Save" />
</save>
</xsl:copy> </xsl:copy>
</xsl:template> </xsl:template>

View File

@@ -23,11 +23,17 @@
<xsl:template match="structure/variables"> <xsl:template match="structure/variables">
<xsl:copy> <xsl:copy>
<name><xsl:value-of select="@name"/></name> <tagname>
<type><xsl:value-of select="translate(@typeName, $lowercase, $uppercase)"/></type> <xsl:value-of select="@name" />
</tagname>
<type>
<xsl:value-of select="translate(@typeName, $lowercase, $uppercase)" />
</type>
<address /> <address />
<comment><xsl:value-of select="../../comment" />: <xsl:value-of select="comment" /></comment> <comment><xsl:value-of select="../../comment" />: <xsl:value-of select="comment" /></comment>
<parent><xsl:value-of select="translate(../../@DDTName, $lowercase, $uppercase)"/></parent> <parent>
<xsl:value-of select="translate(../../@DDTName, $lowercase, $uppercase)" />
</parent>
<bitrank> <bitrank>
<xsl:for-each select="attribute"> <xsl:for-each select="attribute">
<xsl:if test="@name='ExtractBit'"> <xsl:if test="@name='ExtractBit'">
@@ -42,7 +48,9 @@
<xsl:template match="FBSource"> <xsl:template match="FBSource">
<xsl:copy> <xsl:copy>
<name>NULL</name> <name>NULL</name>
<parent><xsl:value-of select="translate(@nameOfFBType, $lowercase, $uppercase)"/></parent> <parent>
<xsl:value-of select="translate(@nameOfFBType, $lowercase, $uppercase)" />
</parent>
<type>DFB</type> <type>DFB</type>
</xsl:copy> </xsl:copy>
</xsl:template> </xsl:template>

View File

@@ -405,15 +405,15 @@ class XSY:
"""Compile a cross-joined and filtered DataBlock by combining the """Compile a cross-joined and filtered DataBlock by combining the
columns from the datablock with the columns from the definitions.""" columns from the datablock with the columns from the definitions."""
datablock_compiled = pd.DataFrame() datablock_compiled = pd.DataFrame()
datablock_compiled["name"] = datablock.apply( datablock_compiled["tagname"] = datablock.apply(
lambda row: f"{row['name']}.{row['name_def']}", axis=1 lambda row: f"{row['tagname']}.{row['tagname_def']}", axis=1
) )
datablock_compiled["parent"] = ""
datablock_compiled["type"] = datablock["type_def"] datablock_compiled["type"] = datablock["type_def"]
datablock_compiled["address"] = datablock.apply( datablock_compiled["address"] = datablock.apply(
lambda row: self._combine_addresses(row), lambda row: self._combine_addresses(row),
axis=1, axis=1,
) )
datablock_compiled["parent"] = ""
datablock_compiled["bitrank"] = datablock["bitrank_def"] datablock_compiled["bitrank"] = datablock["bitrank_def"]
datablock_compiled["save"] = datablock["save"] datablock_compiled["save"] = datablock["save"]
datablock_compiled["comment"] = datablock.apply( datablock_compiled["comment"] = datablock.apply(
@@ -573,7 +573,12 @@ class XSYReader:
self.definitions_ss_path = definitions_ss_path self.definitions_ss_path = definitions_ss_path
self.even_addresses = even_addresses self.even_addresses = even_addresses
def read(self, path: Traversable, expand: bool = True) -> XSYBlock: def read(
self,
path: Traversable,
expand: bool = True,
converters=None,
) -> XSYBlock:
"""Read the dataBlock and definitions of an XSY file into an XSY """Read the dataBlock and definitions of an XSY file into an XSY
object. object.
""" """