PLCGenerator.py
changeset 2418 5587c490a070
parent 2277 068ccc02f5f2
child 2429 15f18dc8b56a
child 2432 dbc065a2f7a5
equal deleted inserted replaced
2417:316ee9fff395 2418:5587c490a070
  1022                         raise PLCGenException(
  1022                         raise PLCGenException(
  1023                             _("Undefined block type \"{a1}\" in \"{a2}\" POU").
  1023                             _("Undefined block type \"{a1}\" in \"{a2}\" POU").
  1024                             format(a1=block_type, a2=self.Name))
  1024                             format(a1=block_type, a2=self.Name))
  1025                     try:
  1025                     try:
  1026                         self.GenerateBlock(instance, block_infos, body, None)
  1026                         self.GenerateBlock(instance, block_infos, body, None)
  1027                     except ValueError, e:
  1027                     except ValueError as e:
  1028                         raise PLCGenException(e.message)
  1028                         raise PLCGenException(e.message)
  1029                 elif isinstance(instance, ConnectorClass):
  1029                 elif isinstance(instance, ConnectorClass):
  1030                     connector = instance.getname()
  1030                     connector = instance.getname()
  1031                     if self.ComputedConnectors.get(connector, None):
  1031                     if self.ComputedConnectors.get(connector, None):
  1032                         continue
  1032                         continue
  1300                     raise PLCGenException(
  1300                     raise PLCGenException(
  1301                         _("Undefined block type \"{a1}\" in \"{a2}\" POU").
  1301                         _("Undefined block type \"{a1}\" in \"{a2}\" POU").
  1302                         format(a1=block_type, a2=self.Name))
  1302                         format(a1=block_type, a2=self.Name))
  1303                 try:
  1303                 try:
  1304                     paths.append(str(self.GenerateBlock(next, block_infos, body, connection, order, to_inout)))
  1304                     paths.append(str(self.GenerateBlock(next, block_infos, body, connection, order, to_inout)))
  1305                 except ValueError, e:
  1305                 except ValueError as e:
  1306                     raise PLCGenException(e.message)
  1306                     raise PLCGenException(e.message)
  1307             elif isinstance(next, ContinuationClass):
  1307             elif isinstance(next, ContinuationClass):
  1308                 name = next.getname()
  1308                 name = next.getname()
  1309                 computed_value = self.ComputedConnectors.get(name, None)
  1309                 computed_value = self.ComputedConnectors.get(name, None)
  1310                 if computed_value is not None:
  1310                 if computed_value is not None: