--- a/Beremiz.py Fri Oct 14 23:54:00 2011 +0200
+++ b/Beremiz.py Mon Oct 17 09:04:13 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/LPCBeremiz.py Fri Oct 14 23:54:00 2011 +0200
+++ b/LPCBeremiz.py Mon Oct 17 09:04:13 2011 +0200
@@ -397,7 +397,7 @@
{"bitmap" : opjimg("Build"),
"tooltip" : _("Build project into build folder"),
{"bitmap" : opjimg("Transfer"),
@@ -443,14 +443,14 @@
return PluginsRoot._getBuildPath(self)
save = self.ProjectTestModified()
self.AppFrame._Refresh(TITLE, FILEMENU)
if self.BuildPath is not None:
mycopytree(self.OrigBuildPath, self.BuildPath)
- PluginsRoot._build(self)
+ PluginsRoot._Build(self) wx.CallAfter(self.AppFrame.RefreshAll)
@@ -610,22 +610,22 @@
"Started" : [("_Simulate", False),
"Stopped" : [("_Simulate", False),
"Connected" : [("_Simulate", not simulating),
"Disconnected" :[("_Simulate", not simulating),
@@ -802,7 +802,7 @@
if self.CurrentMode is None and self.OnlineMode != "OFF":
self.CurrentMode = TRANSFER_MODE
- PluginsRoot._build(self)
+ PluginsRoot._Build(self) ID_ABORTTRANSFERTIMER = wx.NewId()
self.AbortTransferTimer = wx.Timer(self.AppFrame, ID_ABORTTRANSFERTIMER)
@@ -1222,7 +1222,7 @@
- self.PluginRoot._build()
+ self.PluginRoot._Build() def SetProjectProperties(self, projectname, productname, productversion, companyname):
properties = self.PluginRoot.GetProjectProperties()
--- a/plugger.py Fri Oct 14 23:54:00 2011 +0200
+++ b/plugger.py Mon Oct 17 09:04:13 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
@@ -1480,6 +1485,7 @@
self.logger.write_error(traceback.format_exc())
+ self.logger.write(_("Successfully built.\n")) # Update GUI status about need for transfer
self.CompareLocalAndRemotePLC()
@@ -1751,12 +1757,12 @@
def KillDebugThread(self):
if self.DebugThread is not None:
- self.logger.writeyield(_("Stopping debug ... "))
+ self.logger.writeyield(_("Stopping debugger...\n")) self.DebugThread.join(timeout=5)
if self.DebugThread.isAlive() and self.logger:
- self.logger.write_warning(_("Debug Thread couldn't be killed"))
+ self.logger.write_warning(_("Couldn't stop debugger.\n")) - self.logger.write(_("success\n"))
+ self.logger.write(_("Debugger stopped.\n")) def _connect_debug(self):
@@ -1946,7 +1952,7 @@
{"bitmap" : opjimg("Build"),
"tooltip" : _("Build project into build folder"),
{"bitmap" : opjimg("Clean"),