plcopen/variables_infos.xslt
author Edouard Tisserant <edouard.tisserant@gmail.com>
Tue, 22 Mar 2022 14:50:46 +0100
branchwxPython4
changeset 3442 29dbdb09da2e
parent 2637 507737ec2b9a
child 3801 6839dbb9a1df
permissions -rw-r--r--
Tests: fix project edit test sikuli IDE test.

Background click based on bitmap matching doesn't work.
Grid dots are not good match candidates.
Rendering probably affected by virtual display's bpp or rasterizer approximations.
1349
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
     1
<?xml version="1.0"?>
2637
507737ec2b9a Non significant changes in generated xslt, side effect of changes in yslt_noindent.yml2
Edouard Tisserant
parents: 1951
diff changeset
     2
<xsl:stylesheet xmlns:ns="beremiz" xmlns:regexp="http://exslt.org/regular-expressions" xmlns:str="http://exslt.org/strings" xmlns:ppx="http://www.plcopen.org/xml/tc6_0201" xmlns:exsl="http://exslt.org/common" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xhtml="http://www.w3.org/1999/xhtml" version="1.0" exclude-result-prefixes="ns" extension-element-prefixes="ns">
1349
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
     3
  <xsl:output method="xml"/>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
     4
  <xsl:param name="tree"/>
1936
b85b13b1c2ec YSLT auto indent trick is useless here, added yslt_noindent.yml2, regenerated XSLT files
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1368
diff changeset
     5
  <xsl:template match="text()"/>
1951
bbd1e1744c91 GetVariableDictionary and GetPouInterfaceReturnType optimized with new VariableInfoCollector based on XSLTModelQuery. Moved corresponding definitions out of PLCControler.py.
Edouard Tisserant
parents: 1936
diff changeset
     6
  <xsl:variable name="project" select="ns:GetProject()"/>
bbd1e1744c91 GetVariableDictionary and GetPouInterfaceReturnType optimized with new VariableInfoCollector based on XSLTModelQuery. Moved corresponding definitions out of PLCControler.py.
Edouard Tisserant
parents: 1936
diff changeset
     7
  <xsl:variable name="stdlib" select="ns:GetStdLibs()"/>
bbd1e1744c91 GetVariableDictionary and GetPouInterfaceReturnType optimized with new VariableInfoCollector based on XSLTModelQuery. Moved corresponding definitions out of PLCControler.py.
Edouard Tisserant
parents: 1936
diff changeset
     8
  <xsl:variable name="extensions" select="ns:GetExtensions()"/>
bbd1e1744c91 GetVariableDictionary and GetPouInterfaceReturnType optimized with new VariableInfoCollector based on XSLTModelQuery. Moved corresponding definitions out of PLCControler.py.
Edouard Tisserant
parents: 1936
diff changeset
     9
  <xsl:variable name="all_types" select="($project | $stdlib | $extensions)/ppx:types"/>
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    10
  <xsl:template match="ppx:configuration">
1936
b85b13b1c2ec YSLT auto indent trick is useless here, added yslt_noindent.yml2, regenerated XSLT files
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1368
diff changeset
    11
    <xsl:apply-templates select="ppx:globalVars"/>
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    12
  </xsl:template>
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    13
  <xsl:template match="ppx:resource">
1936
b85b13b1c2ec YSLT auto indent trick is useless here, added yslt_noindent.yml2, regenerated XSLT files
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1368
diff changeset
    14
    <xsl:apply-templates select="ppx:globalVars"/>
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    15
  </xsl:template>
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    16
  <xsl:template match="ppx:pou">
1936
b85b13b1c2ec YSLT auto indent trick is useless here, added yslt_noindent.yml2, regenerated XSLT files
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1368
diff changeset
    17
    <xsl:apply-templates select="ppx:interface/*"/>
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
    18
  </xsl:template>
1349
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    19
  <xsl:template match="ppx:returnType">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    20
    <xsl:value-of select="ns:AddTree()"/>
1936
b85b13b1c2ec YSLT auto indent trick is useless here, added yslt_noindent.yml2, regenerated XSLT files
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1368
diff changeset
    21
    <xsl:apply-templates mode="var_type" select="."/>
1349
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    22
  </xsl:template>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    23
  <xsl:template name="variables_infos">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    24
    <xsl:param name="var_class"/>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    25
    <xsl:variable name="var_option">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    26
      <xsl:choose>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    27
        <xsl:when test="@constant='true' or @constant='1'">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    28
          <xsl:text>Constant</xsl:text>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    29
        </xsl:when>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    30
        <xsl:when test="@retain='true' or @retain='1'">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    31
          <xsl:text>Retain</xsl:text>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    32
        </xsl:when>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    33
        <xsl:when test="@nonretain='true' or @nonretain='1'">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    34
          <xsl:text>Non-Retain</xsl:text>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    35
        </xsl:when>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    36
      </xsl:choose>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    37
    </xsl:variable>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    38
    <xsl:for-each select="ppx:variable">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    39
      <xsl:variable name="initial_value">
1936
b85b13b1c2ec YSLT auto indent trick is useless here, added yslt_noindent.yml2, regenerated XSLT files
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1368
diff changeset
    40
        <xsl:apply-templates select="ppx:initialValue"/>
1349
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    41
      </xsl:variable>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    42
      <xsl:variable name="edit">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    43
        <xsl:choose>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    44
          <xsl:when test="$var_class='Global' or $var_class='External'">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    45
            <xsl:text>true</xsl:text>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    46
          </xsl:when>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    47
          <xsl:otherwise>
1936
b85b13b1c2ec YSLT auto indent trick is useless here, added yslt_noindent.yml2, regenerated XSLT files
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1368
diff changeset
    48
            <xsl:apply-templates mode="var_edit" select="ppx:type"/>
1349
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    49
          </xsl:otherwise>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    50
        </xsl:choose>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    51
      </xsl:variable>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    52
      <xsl:value-of select="ns:AddTree()"/>
1936
b85b13b1c2ec YSLT auto indent trick is useless here, added yslt_noindent.yml2, regenerated XSLT files
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1368
diff changeset
    53
      <xsl:apply-templates mode="var_type" select="ppx:type"/>
1349
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    54
      <xsl:value-of select="ns:AddVariable(@name, $var_class, $var_option, @address, $initial_value, $edit, ppx:documentation/xhtml:p/text())"/>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    55
    </xsl:for-each>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    56
  </xsl:template>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    57
  <xsl:template match="ppx:localVars">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    58
    <xsl:call-template name="variables_infos">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    59
      <xsl:with-param name="var_class">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    60
        <xsl:text>Local</xsl:text>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    61
      </xsl:with-param>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    62
    </xsl:call-template>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    63
  </xsl:template>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    64
  <xsl:template match="ppx:globalVars">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    65
    <xsl:call-template name="variables_infos">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    66
      <xsl:with-param name="var_class">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    67
        <xsl:text>Global</xsl:text>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    68
      </xsl:with-param>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    69
    </xsl:call-template>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    70
  </xsl:template>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    71
  <xsl:template match="ppx:externalVars">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    72
    <xsl:call-template name="variables_infos">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    73
      <xsl:with-param name="var_class">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    74
        <xsl:text>External</xsl:text>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    75
      </xsl:with-param>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    76
    </xsl:call-template>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    77
  </xsl:template>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    78
  <xsl:template match="ppx:tempVars">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    79
    <xsl:call-template name="variables_infos">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    80
      <xsl:with-param name="var_class">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    81
        <xsl:text>Temp</xsl:text>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    82
      </xsl:with-param>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    83
    </xsl:call-template>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    84
  </xsl:template>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    85
  <xsl:template match="ppx:inputVars">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    86
    <xsl:call-template name="variables_infos">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    87
      <xsl:with-param name="var_class">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    88
        <xsl:text>Input</xsl:text>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    89
      </xsl:with-param>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    90
    </xsl:call-template>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    91
  </xsl:template>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    92
  <xsl:template match="ppx:outputVars">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    93
    <xsl:call-template name="variables_infos">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    94
      <xsl:with-param name="var_class">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    95
        <xsl:text>Output</xsl:text>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    96
      </xsl:with-param>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    97
    </xsl:call-template>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    98
  </xsl:template>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
    99
  <xsl:template match="ppx:inOutVars">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   100
    <xsl:call-template name="variables_infos">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   101
      <xsl:with-param name="var_class">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   102
        <xsl:text>InOut</xsl:text>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   103
      </xsl:with-param>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   104
    </xsl:call-template>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   105
  </xsl:template>
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   106
  <xsl:template mode="var_type" match="ppx:pou">
1936
b85b13b1c2ec YSLT auto indent trick is useless here, added yslt_noindent.yml2, regenerated XSLT files
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1368
diff changeset
   107
    <xsl:apply-templates mode="var_type" select="ppx:interface/*[self::ppx:inputVars or self::ppx:inOutVars or self::ppx:outputVars]/ppx:variable"/>
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   108
  </xsl:template>
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   109
  <xsl:template mode="var_type" match="ppx:variable">
1349
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   110
    <xsl:variable name="name">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   111
      <xsl:value-of select="@name"/>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   112
    </xsl:variable>
1368
e567e4bee11f Fixed bugs with pou variable infos computation stylesheet
Laurent Bessard
parents: 1361
diff changeset
   113
    <xsl:value-of select="ns:AddTree()"/>
1936
b85b13b1c2ec YSLT auto indent trick is useless here, added yslt_noindent.yml2, regenerated XSLT files
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1368
diff changeset
   114
    <xsl:apply-templates mode="var_type" select="ppx:type"/>
1349
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   115
    <xsl:value-of select="ns:AddVarToTree($name)"/>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   116
  </xsl:template>
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   117
  <xsl:template mode="var_type" match="ppx:dataType">
1936
b85b13b1c2ec YSLT auto indent trick is useless here, added yslt_noindent.yml2, regenerated XSLT files
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1368
diff changeset
   118
    <xsl:apply-templates mode="var_type" select="ppx:baseType"/>
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   119
  </xsl:template>
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   120
  <xsl:template mode="var_type" match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:struct">
1936
b85b13b1c2ec YSLT auto indent trick is useless here, added yslt_noindent.yml2, regenerated XSLT files
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1368
diff changeset
   121
    <xsl:apply-templates mode="var_type" select="ppx:variable"/>
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   122
  </xsl:template>
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   123
  <xsl:template mode="var_type" match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:derived">
1349
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   124
    <xsl:variable name="type_name">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   125
      <xsl:value-of select="@name"/>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   126
    </xsl:variable>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   127
    <xsl:choose>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   128
      <xsl:when test="$tree='True'">
1951
bbd1e1744c91 GetVariableDictionary and GetPouInterfaceReturnType optimized with new VariableInfoCollector based on XSLTModelQuery. Moved corresponding definitions out of PLCControler.py.
Edouard Tisserant
parents: 1936
diff changeset
   129
        <xsl:apply-templates mode="var_type" select="$all_types/ppx:pous/ppx:pou[@name=$type_name] |                          $all_types/ppx:dataTypes/ppx:dataType[@name=$type_name]"/>
1349
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   130
      </xsl:when>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   131
    </xsl:choose>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   132
    <xsl:value-of select="ns:SetType($type_name)"/>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   133
  </xsl:template>
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   134
  <xsl:template mode="var_type" match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:array">
1936
b85b13b1c2ec YSLT auto indent trick is useless here, added yslt_noindent.yml2, regenerated XSLT files
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1368
diff changeset
   135
    <xsl:apply-templates mode="var_type" select="ppx:baseType"/>
1349
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   136
    <xsl:for-each select="ppx:dimension">
1368
e567e4bee11f Fixed bugs with pou variable infos computation stylesheet
Laurent Bessard
parents: 1361
diff changeset
   137
      <xsl:variable name="lower">
e567e4bee11f Fixed bugs with pou variable infos computation stylesheet
Laurent Bessard
parents: 1361
diff changeset
   138
        <xsl:value-of select="@lower"/>
e567e4bee11f Fixed bugs with pou variable infos computation stylesheet
Laurent Bessard
parents: 1361
diff changeset
   139
      </xsl:variable>
e567e4bee11f Fixed bugs with pou variable infos computation stylesheet
Laurent Bessard
parents: 1361
diff changeset
   140
      <xsl:variable name="upper">
e567e4bee11f Fixed bugs with pou variable infos computation stylesheet
Laurent Bessard
parents: 1361
diff changeset
   141
        <xsl:value-of select="@upper"/>
e567e4bee11f Fixed bugs with pou variable infos computation stylesheet
Laurent Bessard
parents: 1361
diff changeset
   142
      </xsl:variable>
e567e4bee11f Fixed bugs with pou variable infos computation stylesheet
Laurent Bessard
parents: 1361
diff changeset
   143
      <xsl:value-of select="ns:AddDimension($lower, $upper)"/>
1349
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   144
    </xsl:for-each>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   145
  </xsl:template>
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   146
  <xsl:template mode="var_type" match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:string">
1349
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   147
    <xsl:variable name="name">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   148
      <xsl:text>STRING</xsl:text>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   149
    </xsl:variable>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   150
    <xsl:value-of select="ns:SetType($name)"/>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   151
  </xsl:template>
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   152
  <xsl:template mode="var_type" match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:wstring">
1349
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   153
    <xsl:variable name="name">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   154
      <xsl:text>WSTRING</xsl:text>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   155
    </xsl:variable>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   156
    <xsl:value-of select="ns:SetType($name)"/>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   157
  </xsl:template>
1361
7158aa054226 Fixed bugs when editing resource variables and tasks
Laurent Bessard
parents: 1359
diff changeset
   158
  <xsl:template mode="var_type" match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/*">
1349
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   159
    <xsl:variable name="name">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   160
      <xsl:value-of select="local-name()"/>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   161
    </xsl:variable>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   162
    <xsl:value-of select="ns:SetType($name)"/>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   163
  </xsl:template>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   164
  <xsl:template mode="var_edit" match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:derived">
1368
e567e4bee11f Fixed bugs with pou variable infos computation stylesheet
Laurent Bessard
parents: 1361
diff changeset
   165
    <xsl:variable name="type_name">
e567e4bee11f Fixed bugs with pou variable infos computation stylesheet
Laurent Bessard
parents: 1361
diff changeset
   166
      <xsl:value-of select="@name"/>
e567e4bee11f Fixed bugs with pou variable infos computation stylesheet
Laurent Bessard
parents: 1361
diff changeset
   167
    </xsl:variable>
1951
bbd1e1744c91 GetVariableDictionary and GetPouInterfaceReturnType optimized with new VariableInfoCollector based on XSLTModelQuery. Moved corresponding definitions out of PLCControler.py.
Edouard Tisserant
parents: 1936
diff changeset
   168
    <xsl:variable name="pou_infos" select="$all_types/ppx:pous/ppx:pou[@name=$type_name]"/>
1349
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   169
    <xsl:choose>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   170
      <xsl:when test="$pou_infos != ''">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   171
        <xsl:text>false</xsl:text>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   172
      </xsl:when>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   173
      <xsl:otherwise>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   174
        <xsl:text>true</xsl:text>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   175
      </xsl:otherwise>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   176
    </xsl:choose>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   177
  </xsl:template>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   178
  <xsl:template mode="var_edit" match="*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/*">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   179
    <xsl:text>true</xsl:text>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   180
  </xsl:template>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   181
  <xsl:template match="ppx:value">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   182
    <xsl:choose>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   183
      <xsl:when test="@repetitionValue">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   184
        <xsl:value-of select="@repetitionValue"/>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   185
        <xsl:text>(</xsl:text>
1936
b85b13b1c2ec YSLT auto indent trick is useless here, added yslt_noindent.yml2, regenerated XSLT files
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1368
diff changeset
   186
        <xsl:apply-templates/>
1349
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   187
        <xsl:text>)</xsl:text>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   188
      </xsl:when>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   189
      <xsl:when test="@member">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   190
        <xsl:value-of select="@member"/>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   191
        <xsl:text> := </xsl:text>
1936
b85b13b1c2ec YSLT auto indent trick is useless here, added yslt_noindent.yml2, regenerated XSLT files
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1368
diff changeset
   192
        <xsl:apply-templates/>
1349
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   193
      </xsl:when>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   194
      <xsl:otherwise>
1936
b85b13b1c2ec YSLT auto indent trick is useless here, added yslt_noindent.yml2, regenerated XSLT files
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1368
diff changeset
   195
        <xsl:apply-templates/>
1349
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   196
      </xsl:otherwise>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   197
    </xsl:choose>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   198
  </xsl:template>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   199
  <xsl:template match="ppx:simpleValue">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   200
    <xsl:value-of select="@value"/>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   201
  </xsl:template>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   202
  <xsl:template name="complex_type_value">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   203
    <xsl:param name="start_bracket"/>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   204
    <xsl:param name="end_bracket"/>
1359
cce13b237b07 Fixed bug when loading complex type variable initial value
Laurent Bessard
parents: 1349
diff changeset
   205
    <xsl:value-of select="$start_bracket"/>
1349
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   206
    <xsl:for-each select="ppx:value">
1936
b85b13b1c2ec YSLT auto indent trick is useless here, added yslt_noindent.yml2, regenerated XSLT files
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 1368
diff changeset
   207
      <xsl:apply-templates select="."/>
1349
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   208
      <xsl:choose>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   209
        <xsl:when test="position()!=last()">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   210
          <xsl:text>, </xsl:text>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   211
        </xsl:when>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   212
      </xsl:choose>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   213
    </xsl:for-each>
1359
cce13b237b07 Fixed bug when loading complex type variable initial value
Laurent Bessard
parents: 1349
diff changeset
   214
    <xsl:value-of select="$end_bracket"/>
1349
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   215
  </xsl:template>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   216
  <xsl:template match="ppx:arrayValue">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   217
    <xsl:call-template name="complex_type_value">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   218
      <xsl:with-param name="start_bracket">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   219
        <xsl:text>[</xsl:text>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   220
      </xsl:with-param>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   221
      <xsl:with-param name="end_bracket">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   222
        <xsl:text>]</xsl:text>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   223
      </xsl:with-param>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   224
    </xsl:call-template>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   225
  </xsl:template>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   226
  <xsl:template match="ppx:structValue">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   227
    <xsl:call-template name="complex_type_value">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   228
      <xsl:with-param name="start_bracket">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   229
        <xsl:text>(</xsl:text>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   230
      </xsl:with-param>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   231
      <xsl:with-param name="end_bracket">
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   232
        <xsl:text>)</xsl:text>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   233
      </xsl:with-param>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   234
    </xsl:call-template>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   235
  </xsl:template>
be6c3a036844 Fixed xslt stylesheets with pretty print versions
Laurent Bessard
parents: 1347
diff changeset
   236
</xsl:stylesheet>