--- a/PLCControler.py Tue Sep 11 18:10:20 2012 +0200
+++ b/PLCControler.py Tue Sep 11 19:13:42 2012 +0200
@@ -454,6 +454,21 @@
var_infos = self.GetPouVariableInfos(project, variable, var_class, debug)
if var_infos is not None:
+ if pou.getbodyType() == "SFC": + for transition in pou.gettransitionList(): + "name": transition.getname(), + "class": ITEM_TRANSITION, + for action in pou.getactionList(): + "name": action.getname(), return {"class": POU_TYPES[pou_type],
@@ -480,6 +495,19 @@
+ elif words[0] in ['A', 'T']: + pou_vars = self.GetPouVariables(self.ComputePouName(words[1]), debug) + if pou_vars is not None: + element_type = ITEM_ACTION + element_type = ITEM_TRANSITION + return {"class": element_type, + "variables": [var for var in pou_vars["variables"] + if var["class"] not in [ITEM_ACTION, ITEM_TRANSITION]], elif words[0] in ['C', 'R']:
element_type = ITEM_CONFIGURATION
@@ -579,6 +607,10 @@
return ["%s.%s" % (words[1], words[2])]
+ elif words[0] in ['T', 'A']: + return ["%s.%s" % (instance, words[2]) + for instance in self.SearchPouInstances( + self.ComputePouName(words[1]), debug)] def RecursiveGetPouInstanceTagName(self, project, pou_type, parts):
--- a/controls/PouInstanceVariablesPanel.py Tue Sep 11 18:10:20 2012 +0200
+++ b/controls/PouInstanceVariablesPanel.py Tue Sep 11 19:13:42 2012 +0200
@@ -26,7 +26,7 @@
import wx.lib.agw.customtreectrl as CT
-from PLCControler import ITEMS_VARIABLE, ITEM_CONFIGURATION, ITEM_RESOURCE, ITEM_POU
+from PLCControler import ITEMS_VARIABLE, ITEM_CONFIGURATION, ITEM_RESOURCE, ITEM_POU, ITEM_TRANSITION, ITEM_ACTION from util.BitmapLibrary import GetBitmap
class PouInstanceVariablesPanel(wx.Panel):
@@ -221,6 +221,14 @@
tagname = self.Controller.ComputeConfigurationResourceName(
self.InstanceChoice.GetStringSelection(),
+ elif var_class == ITEM_TRANSITION: + tagname = self.Controller.ComputePouTransitionName( + self.PouTagName.split("::")[1], + elif var_class == ITEM_ACTION: + tagname = self.Controller.ComputePouActionName( + self.PouTagName.split("::")[1], tagname = self.Controller.ComputePouName(infos["type"])
@@ -236,9 +244,23 @@
if var_class in ITEMS_VARIABLE:
self.ParentWindow.AddDebugVariable(var_path, force=True)
+ elif var_class == ITEM_TRANSITION: + self.ParentWindow.OpenDebugViewer( + self.Controller.ComputePouTransitionName( + self.PouTagName.split("::")[1], + elif var_class == ITEM_ACTION: + self.ParentWindow.OpenDebugViewer( + self.Controller.ComputePouActionName( + self.PouTagName.split("::")[1], self.ParentWindow.OpenDebugViewer(
self.Controller.ComputePouName(infos["type"]))