# 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 @@
-
+