plcopen/pou_block_instances.ysl2
changeset 1344 2eaa84c37f10
parent 1339 6adf05c4508d
child 1345 53e51e786654
equal deleted inserted replaced
1343:a76a020b8822 1344:2eaa84c37f10
    25         }
    25         }
    26     }
    26     }
    27     
    27     
    28     function "ConnectionInfos" {
    28     function "ConnectionInfos" {
    29         param "type";
    29         param "type";
    30         param "modifiers";
    30         param "negated";
       
    31         param "edge";
    31         param "formalParameter";
    32         param "formalParameter";
    32         variable "negated" {
       
    33             choose {
       
    34                 when "$modifiers='input'" > «@negatedIn»
       
    35                 when "$modifiers='output'" > «@negatedOut»
       
    36                 otherwise > «@negated»
       
    37             }
       
    38         }
       
    39         variable "edge" {
       
    40             choose {
       
    41                 when "$modifiers='input'" > «@edgeIn»
       
    42                 when "$modifiers='output'" > «@edgeOut»
       
    43                 otherwise > «@edge»
       
    44             }
       
    45         }
       
    46         variable "instance_connection" {
    33         variable "instance_connection" {
    47             > «ns:AddInstanceConnection($type, $formalParameter, $negated, $edge, ppx:relPosition/@x, ppx:relPosition/@y)»
    34             > «ns:AddInstanceConnection($type, $formalParameter, $negated, $edge, ppx:relPosition/@x, ppx:relPosition/@y)»
    48         }
    35         }
    49     }
    36     }
    50     
    37     
    60         }
    47         }
    61         apply "ppx:position";
    48         apply "ppx:position";
    62     }
    49     }
    63     
    50     
    64     template "ppx:connectionPointIn" {
    51     template "ppx:connectionPointIn" {
    65         param "modifiers";
    52         param "negated";
       
    53         param "edge";
    66         param "formalParameter";
    54         param "formalParameter";
    67         call "ConnectionInfos" {
    55         call "ConnectionInfos" {
    68             with "type" > input
    56             with "type" > input
    69             with "modifiers" > «$modifiers»
    57             with "negated" > «$negated»
       
    58             with "edge" > «$edge»
    70             with "formalParameter" > «$formalParameter»
    59             with "formalParameter" > «$formalParameter»
    71         }
    60         }
    72         apply "ppx:connection";
    61         apply "ppx:connection";
    73     }
    62     }
    74     
    63     
    75     template "ppx:connectionPointOut" {
    64     template "ppx:connectionPointOut" {
    76         param "modifiers";
    65         param "negated";
       
    66         param "edge";
    77         param "formalParameter";
    67         param "formalParameter";
    78         call "ConnectionInfos" {
    68         call "ConnectionInfos" {
    79             with "type" > output
    69             with "type" > output
    80             with "modifiers" > «$modifiers»
    70             with "negated" > «$negated»
       
    71             with "edge" > «$edge»
    81             with "formalParameter" > «$formalParameter»
    72             with "formalParameter" > «$formalParameter»
    82         }
    73         }
    83     }
    74     }
    84     
    75     
    85     template "ppx:connectionPointOutAction" {
    76     template "ppx:connectionPointOutAction" {
   108         call "add_instance" {
    99         call "add_instance" {
   109             with "type" > «@typeName»
   100             with "type" > «@typeName»
   110         }
   101         }
   111         foreach "ppx:inputVariables/ppx:variable" {
   102         foreach "ppx:inputVariables/ppx:variable" {
   112             apply "ppx:connectionPointIn" {
   103             apply "ppx:connectionPointIn" {
       
   104                 with "negated" > «@negated»
       
   105                 with "edge" > «@edge»
   113                 with "formalParameter" > «@formalParameter»
   106                 with "formalParameter" > «@formalParameter»
   114             }
   107             }
   115         }
   108         }
   116         foreach "ppx:outputVariables/ppx:variable" {
   109         foreach "ppx:outputVariables/ppx:variable" {
   117             apply "ppx:connectionPointOut" {
   110             apply "ppx:connectionPointOut" {
       
   111                 with "negated" > «@negated»
       
   112                 with "edge" > «@edge»
   118                 with "formalParameter" > «@formalParameter»
   113                 with "formalParameter" > «@formalParameter»
   119             }
   114             }
   120         }
   115         }
   121     }
   116     }
   122     
   117     
   158         }
   153         }
   159         call "add_instance" {
   154         call "add_instance" {
   160             with "type" > «$type»
   155             with "type" > «$type»
   161         }
   156         }
   162         apply "ppx:connectionPointIn" {
   157         apply "ppx:connectionPointIn" {
   163             with "modifiers" {
   158             with "negated" > «@negatedIn»
   164                 choose {
   159             with "edge" > «@edgeIn»
   165                     when "$type='inout'" > input
       
   166                     otherwise > 
       
   167                 }
       
   168             }
       
   169         }
   160         }
   170         apply "ppx:connectionPointOut" {
   161         apply "ppx:connectionPointOut" {
   171             with "modifiers" {
   162             with "negated" > «@negatedOut»
   172                 choose {
   163             with "edge" > «@edgeOut»
   173                     when "$type='inout'" > output
       
   174                     otherwise > 
       
   175                 }
       
   176             }
       
   177         }
   164         }
   178     }
   165     }
   179     
   166     
   180     template "ppx:inVariable" {
   167     template "ppx:inVariable" {
   181         call "VariableBlockInfos" with "type", "'input'";
   168         call "VariableBlockInfos" with "type", "'input'";
   249     template "ppx:step" {
   236     template "ppx:step" {
   250         variable "type" > «local-name()»
   237         variable "type" > «local-name()»
   251         variable "instance_specific_values" {
   238         variable "instance_specific_values" {
   252             > «ns:SetSpecificValues(@name, @initialStep)»
   239             > «ns:SetSpecificValues(@name, @initialStep)»
   253         }
   240         }
   254         apply "ppx:connectionPointOutAction";
   241         apply "ppx:connectionPointOutAction" {
       
   242             with "negated" > «@negated»
       
   243         }
   255         call "add_instance" {
   244         call "add_instance" {
   256             with "type" > «$type»
   245             with "type" > «$type»
   257         }
   246         }
   258         apply "ppx:connectionPointIn";
   247         apply "ppx:connectionPointIn";
   259         apply "ppx:connectionPointOut";
   248         apply "ppx:connectionPointOut";
   283             }
   272             }
   284         }
   273         }
   285         variable "instance_specific_values" {
   274         variable "instance_specific_values" {
   286             > «ns:SetSpecificValues($priority, $condition_type, $condition)»
   275             > «ns:SetSpecificValues($priority, $condition_type, $condition)»
   287         }
   276         }
   288         apply "ppx:condition/ppx:connectionPointIn";
   277         apply "ppx:condition/ppx:connectionPointIn" {
       
   278             with "negated" > «ppx:condition/@negated»
       
   279         }
   289         call "add_instance" {
   280         call "add_instance" {
   290             with "type" > «$type»
   281             with "type" > «$type»
   291         }
   282         }
   292         apply "ppx:connectionPointIn";
   283         apply "ppx:connectionPointIn";
   293         apply "ppx:connectionPointOut";
   284         apply "ppx:connectionPointOut";
   357         }
   348         }
   358         apply "ppx:action";
   349         apply "ppx:action";
   359         call "add_instance" {
   350         call "add_instance" {
   360             with "type" > «$type»
   351             with "type" > «$type»
   361         }
   352         }
   362         apply "ppx:connectionPointIn";
   353         apply "ppx:connectionPointIn" {
       
   354             with "negated" > «@negated»
       
   355         }
   363     }
   356     }
   364 }
   357 }