Adding support for finding character_string while computing connector types. Adding 'ANY' type on continuation by default.
authorgreg
Fri, 22 May 2009 09:38:09 +0200
changeset 356 f6453b89e7f9
parent 355 a9046671e0ce
child 357 e5501b3337db
Adding support for finding character_string while computing connector types. Adding 'ANY' type on continuation by default.
PLCGenerator.py
--- a/PLCGenerator.py	Fri May 22 09:30:04 2009 +0200
+++ b/PLCGenerator.py	Fri May 22 09:38:09 2009 +0200
@@ -615,6 +615,10 @@
                         parts = expression.split("#")
                         if len(parts) > 1:
                             var_type = parts[0]
+                        elif expression.startswith("'"):
+                            var_type = "STRING"
+                        elif expression.startswith('"'):
+                            var_type = "WSTRING"
                     if var_type is not None:
                         if isinstance(instance, (plcopen.fbdObjects_inVariable, plcopen.fbdObjects_inOutVariable)):
                             for connection in self.ExtractRelatedConnections(instance.connectionPointOut):
@@ -654,6 +658,7 @@
                 elif isinstance(instance, plcopen.commonObjects_continuation):
                     name = instance.getname()
                     connector = None
+                    var_type = "ANY"
                     for element in body.getcontentInstances():
                         if isinstance(element, plcopen.commonObjects_connector) and element.getname() == name:
                             if connector is not None: