--- a/Beremiz.py Thu Jun 03 17:26:47 2010 +0200
+++ b/Beremiz.py Fri Jun 04 09:02:22 2010 +0200
@@ -1066,7 +1066,7 @@
rightwindow.SetBackgroundColour(wx.WHITE)
leftwindowsizer.Add(wx.Size(20, 16), 0)
sb = wx.StaticBitmap(leftwindow, -1)
icon = location.get("icon")
@@ -1082,7 +1082,9 @@
st.SetFont(wx.Font(faces["size"] * 0.5, wx.DEFAULT, wx.NORMAL, wx.NORMAL, faceName = faces["helv"]))
- st.Bind(wx.EVT_LEFT_DOWN, self.GenerateLocationLeftDownFunction(infos))
+ leftcallback = self.GenerateLocationLeftDownFunction(infos) + st.Bind(wx.EVT_LEFT_DOWN, leftcallback) + sb.Bind(wx.EVT_LEFT_DOWN, leftcallback) elif location["type"] == LOCATION_GROUP:
st.SetFont(wx.Font(faces["size"] * 0.6, wx.DEFAULT, wx.NORMAL, wx.NORMAL, faceName = faces["helv"]))
--- a/LPCBeremiz.py Thu Jun 03 17:26:47 2010 +0200
+++ b/LPCBeremiz.py Fri Jun 04 09:02:22 2010 +0200
@@ -97,6 +97,15 @@
+def _GetVariables(module): + for child in module["children"]: + if child["type"] in [LOCATION_GROUP, LOCATION_MODULE]: + variables.extend(_GetVariables(child)) + variables.append(child) def _GetLastModuleGroup(module):
for child in module["children"]:
@@ -136,14 +145,13 @@
/* LPCBus plugin user variables definition */
/* LPCBus plugin functions */
int __init_%(location_str)s(int argc,char **argv)
@@ -153,12 +161,12 @@
void __retrieve_%(location_str)s(void)
void __publish_%(location_str)s(void)
@@ -285,6 +293,10 @@
+ for variable in _GetVariables(self): + if variable["declare"] != "": + code_str["declare_code"] += " %s\n" % variable["declare"] self.ResetUsedLocations()
@@ -310,7 +322,6 @@
self.AddUsedLocation(location["LOC"])
vars.append({"location": location["NAME"],
"Type": variable["IEC_type"],
- "Declare": variable["declare"],
"Retrieve": variable["retrieve"],
"Publish": variable["publish"],
@@ -322,12 +333,10 @@
code_str["var_decl"] += "%s%s beremiz%s;\n"%(prefix, var["Type"], var["location"])
code_str["var_decl"] += "%s%s *%s = &beremiz%s;\n"%(prefix, var["Type"], var["location"], var["location"])
- if var["Declare"] != "":
- code_str["declare_code"] += var["Declare"] + "\n"
if var["Retrieve"] != "":
- code_str["retrieve_code"] += var["Retrieve"] % ("*" + var["location"]) + "\n"
+ code_str["retrieve_code"] += " " + var["Retrieve"] % ("*" + var["location"]) + "\n" - code_str["publish_code"] += var["Publish"] % ("*" + var["location"]) + "\n"
+ code_str["publish_code"] += " " + var["Publish"] % ("*" + var["location"]) + "\n" Gen_Module_path = os.path.join(buildpath, "Module_%s.c"%location_str)
module = open(Gen_Module_path,'w')