--- a/Beremiz.py Thu Apr 05 04:42:01 2012 +0200
+++ b/Beremiz.py Fri Apr 27 02:07:47 2012 +0200
@@ -150,7 +150,8 @@
from wxPopen import ProcessLogger
-from PLCOpenEditor import IDEFrame, Viewer, AppendMenu, TITLE, EDITORTOOLBAR, FILEMENU, EDITMENU, DISPLAYMENU, TYPESTREE, INSTANCESTREE, LIBRARYTREE, SCALING, PAGETITLES, USE_AUI
+from PLCOpenEditor import IDEFrame, AppendMenu, TITLE, EDITORTOOLBAR, FILEMENU, EDITMENU, DISPLAYMENU, TYPESTREE, INSTANCESTREE, LIBRARYTREE, SCALING, PAGETITLES, USE_AUI +from PLCOpenEditor import EditorPanel, Viewer, TextViewer, GraphicViewer, ResourceEditor, ConfigurationEditor, DataTypeEditor from PLCControler import LOCATION_PLUGIN, LOCATION_MODULE, LOCATION_GROUP, LOCATION_VAR_INPUT, LOCATION_VAR_OUTPUT, LOCATION_VAR_MEMORY
@@ -501,13 +502,15 @@
self.PLCConfig.Bind(wx.EVT_LEFT_DOWN, self.OnPanelLeftDown)
self.PLCConfig.Bind(wx.EVT_SIZE, self.OnMoveWindow)
self.PLCConfig.Bind(wx.EVT_MOUSEWHEEL, self.OnPLCConfigScroll)
+ self.MainTabs["PLCConfig"] = (self.PLCConfig, _("Topology")) self.BottomNoteBook.InsertPage(0, self.PLCConfig, _("Topology"), True)
self.LogConsole = wx.TextCtrl(id=ID_BEREMIZLOGCONSOLE, value='',
name='LogConsole', parent=self.BottomNoteBook, pos=wx.Point(0, 0),
size=wx.Size(0, 0), style=wx.TE_MULTILINE|wx.TE_RICH2)
self.LogConsole.Bind(wx.EVT_LEFT_DCLICK, self.OnLogConsoleDClick)
- self.BottomNoteBook.AddPage(self.LogConsole, _("Log Console"))
+ self.MainTabs["LogConsole"] = (self.LogConsole, _("Log Console")) + self.BottomNoteBook.AddPage(*self.MainTabs["LogConsole"]) self.BottomNoteBook.Split(self.BottomNoteBook.GetPageIndex(self.LogConsole), wx.RIGHT)
@@ -546,6 +549,11 @@
# Add beremiz's icon in top left corner of the frame
self.SetIcon(wx.Icon(Bpath( "images", "brz.ico"), wx.BITMAP_TYPE_ICO))
+ if projectOpen is None and self.Config.HasEntry("currenteditedproject"): + projectOpen = str(self.Config.Read("currenteditedproject")) if projectOpen is not None and os.path.isdir(projectOpen):
self.PluginRoot = PluginsRoot(self, self.Log)
self.Controler = self.PluginRoot
@@ -656,13 +664,39 @@
+ def GetTabInfos(self, tab): + if (isinstance(tab, EditorPanel) and + not isinstance(tab, (Viewer, + return ("plugin", tab.Controler.PlugFullName()) + return IDEFrame.GetTabInfos(self, tab) + def LoadTab(self, notebook, page_infos): + if page_infos[0] == "plugin": + plugin = self.PluginRoot.GetChildByName(page_infos[1]) + return notebook.GetPageIndex(plugin._OpenView()) + return IDEFrame.LoadTab(self, notebook, page_infos) def OnCloseFrame(self, event):
if self.PluginRoot is None or self.CheckSaveBeforeClosing(_("Close Application")):
if self.PluginRoot is not None:
self.PluginRoot.KillDebugThread()
+ if self.PluginRoot is not None: + project_path = os.path.realpath(self.PluginRoot.GetProjectPath()) + self.Config.Write("currenteditedproject", project_path) @@ -1676,6 +1710,7 @@
self.RefreshConfigRecentProjects(projectpath)
self.DebugVariablePanel.SetDataProducer(self.PluginRoot)
+ self.LoadProjectOrganization() self._Refresh(TYPESTREE, INSTANCESTREE, LIBRARYTREE)
@@ -1689,6 +1724,7 @@
if self.PluginRoot is not None and not self.CheckSaveBeforeClosing():
+ self.SaveProjectOrganization() self._Refresh(TITLE, EDITORTOOLBAR, FILEMENU, EDITMENU)
--- a/LPCBeremiz.py Thu Apr 05 04:42:01 2012 +0200
+++ b/LPCBeremiz.py Fri Apr 27 02:07:47 2012 +0200
@@ -1120,7 +1120,7 @@
self.PluginRoot.KillDebugThread()
lpcberemiz_cmd.Log.write("Closed\n")
--- a/plugger.py Thu Apr 05 04:42:01 2012 +0200
+++ b/plugger.py Fri Apr 27 02:07:47 2012 +0200
@@ -500,6 +500,9 @@
self._View = self.EditorType(app_frame.TabsOpened, self, app_frame)
app_frame.EditProjectElement(self._View, self.PlugName())
def OnCloseEditor(self, view):
@@ -1568,8 +1571,6 @@
self.AppFrame.EditProjectElement(IEC_code_viewer, "IEC code")
def _editIECrawcode(self):
- new_dialog = wx.Frame(self.AppFrame)
controler = MiniTextControler(self._getIECrawcodepath())
IEC_raw_code_viewer = TextViewer(self.AppFrame.TabsOpened, "", None, controler, instancepath="IEC raw code")
#IEC_raw_code_viewer.Enable(False)