# HG changeset patch # User Edouard Tisserant # Date 1395911190 -3600 # Node ID 611fded24ce4beffe5f1702f0a6e8a249d68873b # Parent 65a751cbb9b994d15d14727ecf10d5412f458385 Pair with matiec a51a3bb4d613. Re-enable resource add/remove, updated CFLAGS, disabled broken global FG test in tests/python diff -r 65a751cbb9b9 -r 611fded24ce4 Beremiz.py --- a/Beremiz.py Fri Mar 21 00:21:15 2014 +0100 +++ b/Beremiz.py Thu Mar 27 10:06:30 2014 +0100 @@ -349,13 +349,6 @@ def _init_coll_AddMenu_Items(self, parent): IDEFrame._init_coll_AddMenu_Items(self, parent, False) - - # Disable add resource until matiec is able to handle multiple ressource definition - #new_id = wx.NewId() - #AppendMenu(parent, help='', id=new_id, - # kind=wx.ITEM_NORMAL, text=_(u'&Resource')) - #self.Bind(wx.EVT_MENU, self.AddResourceMenu, id=new_id) - self._RecursiveAddMenuItems(parent, GetAddMenuItems()) def _init_coll_HelpMenu_Items(self, parent): @@ -1010,10 +1003,11 @@ confnode_menu.Destroy() event.Skip() - elif item_infos["type"] != ITEM_PROJECT: + elif item_infos["type"] == ITEM_RESOURCE: + # prevent last resource to be delted parent = self.ProjectTree.GetItemParent(item) parent_name = self.ProjectTree.GetItemText(parent) - if item_infos["type"] != ITEM_RESOURCE or parent_name == _("Resources"): + if parent_name == _("Resources"): IDEFrame.OnProjectTreeRightUp(self, event) else: IDEFrame.OnProjectTreeRightUp(self, event) diff -r 65a751cbb9b9 -r 611fded24ce4 IDEFrame.py --- a/IDEFrame.py Fri Mar 21 00:21:15 2014 +0100 +++ b/IDEFrame.py Thu Mar 27 10:06:30 2014 +0100 @@ -36,8 +36,8 @@ ID_PLCOPENEDITOREDITMENUADDFUNCTION, ID_PLCOPENEDITOREDITMENUADDFUNCTIONBLOCK, ID_PLCOPENEDITOREDITMENUADDPROGRAM, ID_PLCOPENEDITOREDITMENUADDCONFIGURATION, ID_PLCOPENEDITOREDITMENUFINDNEXT, ID_PLCOPENEDITOREDITMENUFINDPREVIOUS, - ID_PLCOPENEDITOREDITMENUSEARCHINPROJECT, -] = [wx.NewId() for _init_coll_EditMenu_Items in range(9)] + ID_PLCOPENEDITOREDITMENUSEARCHINPROJECT, ID_PLCOPENEDITOREDITMENUADDRESOURCE +] = [wx.NewId() for _init_coll_EditMenu_Items in range(10)] # Define PLCOpenEditor DisplayMenu extra items id [ID_PLCOPENEDITORDISPLAYMENURESETPERSPECTIVE, @@ -325,6 +325,8 @@ kind=wx.ITEM_NORMAL, text=_(u'Function &Block')) AppendMenu(parent, help='', id=ID_PLCOPENEDITOREDITMENUADDPROGRAM, kind=wx.ITEM_NORMAL, text=_(u'&Program')) + AppendMenu(parent, help='', id=ID_PLCOPENEDITOREDITMENUADDRESOURCE, + kind=wx.ITEM_NORMAL, text=_(u'&Resource')) if add_config: AppendMenu(parent, help='', id=ID_PLCOPENEDITOREDITMENUADDCONFIGURATION, kind=wx.ITEM_NORMAL, text=_(u'&Configuration')) @@ -385,6 +387,8 @@ id=ID_PLCOPENEDITOREDITMENUADDFUNCTIONBLOCK) self.Bind(wx.EVT_MENU, self.GenerateAddPouFunction("program"), id=ID_PLCOPENEDITOREDITMENUADDPROGRAM) + self.Bind(wx.EVT_MENU, self.AddResourceMenu, + id=ID_PLCOPENEDITOREDITMENUADDRESOURCE) self.Bind(wx.EVT_MENU, self.OnAddConfigurationMenu, id=ID_PLCOPENEDITOREDITMENUADDCONFIGURATION) self.Bind(wx.EVT_MENU, self.OnSelectAllMenu, id=wx.ID_SELECTALL) diff -r 65a751cbb9b9 -r 611fded24ce4 ProjectController.py --- a/ProjectController.py Fri Mar 21 00:21:15 2014 +0100 +++ b/ProjectController.py Thu Mar 27 10:06:30 2014 +0100 @@ -440,7 +440,7 @@ if len(self.Libraries)==0: return [],[],() self.GetIECProgramsAndVariables() - LibIECCflags = '"-I%s"'%os.path.abspath(self.GetIECLibPath()) + LibIECCflags = '"-I%s" -Wno-unused-function'%os.path.abspath(self.GetIECLibPath()) LocatedCCodeAndFlags=[] Extras=[] for lib in self.Libraries: @@ -668,7 +668,7 @@ # Keep track of generated C files for later use by self.CTNGenerate_C self.PLCGeneratedCFiles = C_files # compute CFLAGS for plc - self.plcCFLAGS = '"-I%s"'%self.ieclib_path + self.plcCFLAGS = '"-I%s" -Wno-unused-function'%self.ieclib_path return True def GetBuilder(self): diff -r 65a751cbb9b9 -r 611fded24ce4 tests/python/beremiz.xml --- a/tests/python/beremiz.xml Fri Mar 21 00:21:15 2014 +0100 +++ b/tests/python/beremiz.xml Thu Mar 27 10:06:30 2014 +0100 @@ -1,4 +1,4 @@ - + diff -r 65a751cbb9b9 -r 611fded24ce4 tests/python/c_code@c_ext/baseconfnode.xml --- a/tests/python/c_code@c_ext/baseconfnode.xml Fri Mar 21 00:21:15 2014 +0100 +++ b/tests/python/c_code@c_ext/baseconfnode.xml Thu Mar 27 10:06:30 2014 +0100 @@ -1,2 +1,2 @@ - + diff -r 65a751cbb9b9 -r 611fded24ce4 tests/python/c_code@c_ext/cfile.xml --- a/tests/python/c_code@c_ext/cfile.xml Fri Mar 21 00:21:15 2014 +0100 +++ b/tests/python/c_code@c_ext/cfile.xml Thu Mar 27 10:06:30 2014 +0100 @@ -1,15 +1,15 @@ - - + + - + - +]]> - + - + - + - +]]> diff -r 65a751cbb9b9 -r 611fded24ce4 tests/python/c_code@c_ext/confnode.xml --- a/tests/python/c_code@c_ext/confnode.xml Fri Mar 21 00:21:15 2014 +0100 +++ b/tests/python/c_code@c_ext/confnode.xml Thu Mar 27 10:06:30 2014 +0100 @@ -1,2 +1,2 @@ - + diff -r 65a751cbb9b9 -r 611fded24ce4 tests/python/plc.xml --- a/tests/python/plc.xml Fri Mar 21 00:21:15 2014 +0100 +++ b/tests/python/plc.xml Thu Mar 27 10:06:30 2014 +0100 @@ -1,14 +1,7 @@ - - - - + + + + @@ -428,7 +421,7 @@ - + @@ -674,32 +667,32 @@ - + - + - + - + - + @@ -889,23 +882,19 @@ - + Global_RS.Q1 - + - - - - @@ -934,45 +923,33 @@ BOOL#TRUE - + - - - - Global_RS.S - + - - - - Global_RS.R1 - + Global_RS.Q1 - + - - - - @@ -1117,6 +1094,12 @@ 23 + + + + + + @@ -1185,7 +1168,7 @@ - +]]> @@ -1226,7 +1209,7 @@ - + diff -r 65a751cbb9b9 -r 611fded24ce4 tests/python/python@py_ext/baseconfnode.xml --- a/tests/python/python@py_ext/baseconfnode.xml Fri Mar 21 00:21:15 2014 +0100 +++ b/tests/python/python@py_ext/baseconfnode.xml Thu Mar 27 10:06:30 2014 +0100 @@ -1,2 +1,2 @@ - + diff -r 65a751cbb9b9 -r 611fded24ce4 tests/python/python@py_ext/pyfile.xml --- a/tests/python/python@py_ext/pyfile.xml Fri Mar 21 00:21:15 2014 +0100 +++ b/tests/python/python@py_ext/pyfile.xml Thu Mar 27 10:06:30 2014 +0100 @@ -1,11 +1,11 @@ - - + + - +]]> - +]]> - +]]> - +]]> - +]]>