--- a/Beremiz.py Thu Oct 06 22:39:05 2011 +0200
+++ b/Beremiz.py Sun Oct 09 23:30:18 2011 +0200
@@ -325,11 +325,7 @@
[ID_BEREMIZ, ID_BEREMIZMAINSPLITTER,
ID_BEREMIZPLCCONFIG, ID_BEREMIZLOGCONSOLE,
- ID_BEREMIZINSPECTOR, ID_BUILD] = [wx.NewId() for _init_ctrls in range(6)]
-[ID_BEREMIZRUNMENUBUILD, ID_BEREMIZRUNMENUSIMULATE,
- ID_BEREMIZRUNMENURUN, ID_BEREMIZRUNMENUSAVELOG,
-] = [wx.NewId() for _init_coll_EditMenu_Items in range(4)]
+ ID_BEREMIZINSPECTOR] = [wx.NewId() for _init_ctrls in range(5)] @@ -408,10 +404,23 @@
IDEFrame._init_ctrls(self, prnt)
self.Bind(wx.EVT_MENU, self.OnOpenWidgetInspector, id=ID_BEREMIZINSPECTOR)
- self.Bind(wx.EVT_MENU, self.OnBuildProject, id=ID_BUILD)
- accel = wx.AcceleratorTable([wx.AcceleratorEntry(wx.ACCEL_CTRL|wx.ACCEL_ALT, ord('I'), ID_BEREMIZINSPECTOR),
- wx.AcceleratorEntry(wx.ACCEL_NORMAL, wx.WXK_F11, ID_BUILD)])
- self.SetAcceleratorTable(accel)
+ accels = [wx.AcceleratorEntry(wx.ACCEL_CTRL|wx.ACCEL_ALT, ord('I'), ID_BEREMIZINSPECTOR)] + for method,shortcut in [("Stop", wx.WXK_F4), + ("Transfer", wx.WXK_F6), + ("Connect", wx.WXK_F7), + ("Build", wx.WXK_F11)]: + def OnMethodGen(obj,meth): + if obj.PluginRoot is not None: + obj.PluginRoot.CallMethod('_'+meth) + wx.CallAfter(self.RefreshAll) + self.Bind(wx.EVT_MENU, OnMethodGen(self,method), id=newid) + accels += [wx.AcceleratorEntry(wx.ACCEL_NORMAL, shortcut,newid)] + self.SetAcceleratorTable(wx.AcceleratorTable(accels)) self.PLCConfig = wx.ScrolledWindow(id=ID_BEREMIZPLCCONFIG,
name='PLCConfig', parent=self.LeftNoteBook, pos=wx.Point(0, 0),
@@ -525,10 +534,6 @@
InspectionTool().Show(wnd, True)
- def OnBuildProject(self, evt):
- if self.PluginRoot is not None:
- self.PluginRoot._build()
def OnLogConsoleDClick(self, event):
wx.CallAfter(self.SearchLineForError)
--- a/plugger.py Thu Oct 06 22:39:05 2011 +0200
+++ b/plugger.py Sun Oct 09 23:30:18 2011 +0200
@@ -651,6 +651,11 @@
+ def CallMethod(self, method): + for d in self.PluginMethods: + if d["method"]==method and d.get("enabled", True) and d.get("shown", True): + getattr(self, method)() def _GetClassFunction(name):
return getattr(__import__("plugins." + name), name).RootClass
@@ -1385,7 +1390,7 @@
Method called by user to (re)build SoftPLC and plugin tree
@@ -1946,7 +1951,7 @@
{"bitmap" : opjimg("Build"),
"tooltip" : _("Build project into build folder"),
{"bitmap" : opjimg("Clean"),