--- 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
- #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 @@
- 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)
IDEFrame.OnProjectTreeRightUp(self, event)
--- 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')) 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)
--- 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:
self.GetIECProgramsAndVariables()
- LibIECCflags = '"-I%s"'%os.path.abspath(self.GetIECLibPath())
+ LibIECCflags = '"-I%s" -Wno-unused-function'%os.path.abspath(self.GetIECLibPath()) 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
- self.plcCFLAGS = '"-I%s"'%self.ieclib_path
+ self.plcCFLAGS = '"-I%s" -Wno-unused-function'%self.ieclib_path --- 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 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version='1.0' encoding='utf-8'?> <BeremizRoot URI_location="LOCAL://">
--- 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 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version='1.0' encoding='utf-8'?> <BaseParams Name="c_code" IEC_Channel="1"/>
--- 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 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?xml version='1.0' encoding='utf-8'?> +<CFile xmlns:xhtml="http://www.w3.org/1999/xhtml">
<variable name="TestInput" type="SINT" initial="0"/>
<variable name="TestOutput" type="SINT"/>
volatile char PtoC=1,CtoP=2;
@@ -48,26 +48,26 @@
if(!AtomicCompareExchange((long*)&Lock, 0, 1)){
TestInput = CtoP + PtoC + TestOutput;
AtomicCompareExchange((long*)&Lock, 1, 0);
--- 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 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version='1.0' encoding='utf-8'?> <CExtension CFLAGS="" LDFLAGS=""/>
--- 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 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://www.plcopen.org/xml/tc6.xsd"
- xsi:schemaLocation="http://www.plcopen.org/xml/tc6.xsd"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xhtml="http://www.w3.org/1999/xhtml">
- <fileHeader companyName=""
- creationDateTime="2008-12-14T16:21:19"/>
- <contentHeader name="Beremiz Python Support Tests"
- modificationDateTime="2013-05-15T18:19:52">
+<?xml version='1.0' encoding='utf-8'?> +<project xmlns="http://www.plcopen.org/xml/tc6_0201" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xsi:schemaLocation="http://www.plcopen.org/xml/tc6_0201"> + <fileHeader companyName="" productName="Beremiz" productVersion="0.0" creationDateTime="2008-12-14T16:21:19"/> + <contentHeader name="Beremiz Python Support Tests" modificationDateTime="2014-03-27T09:15:55"> <pageSize x="1024" y="1024"/>
@@ -428,7 +421,7 @@
<comment localId="16" height="90" width="680">
<position x="50" y="25"/>
-<![CDATA[This example test that, despite of 2T period clock stimulating TRIG pin of pyth_eval blocks, blocks keep executing one after the other, in respect of execution order.]]>
+ <xhtml:p><![CDATA[This example test that, despite of 2T period clock stimulating TRIG pin of pyth_eval blocks, blocks keep executing one after the other, in respect of execution order.]]></xhtml:p> <block localId="17" width="80" height="120" typeName="MUX">
@@ -674,32 +667,32 @@
<comment localId="30" height="90" width="405">
<position x="245" y="825"/>
-<![CDATA[You will be ready to use beremiz with C and Python when you will understand why "FromInput" is equal to 75.
+ <xhtml:p><![CDATA[You will be ready to use beremiz with C and Python when you will understand why "FromInput" is equal to 75. <comment localId="31" height="60" width="345">
<position x="295" y="265"/>
-<![CDATA[Sleep here is bad. It blocks other py_eval instances. Whith a wxGlade GUI, GUI freeze for a second.]]>
+ <xhtml:p><![CDATA[Sleep here is bad. It blocks other py_eval instances. Whith a wxGlade GUI, GUI freeze for a second.]]></xhtml:p> <comment localId="6" height="60" width="345">
<position x="295" y="380"/>
-<![CDATA[Prints FBID to stdout of PLC runtime. FBID is a unique reference to py_eval instance.]]>
+ <xhtml:p><![CDATA[Prints FBID to stdout of PLC runtime. FBID is a unique reference to py_eval instance.]]></xhtml:p> <comment localId="10" height="60" width="345">
<position x="295" y="500"/>
-<![CDATA[Simple_C_Call is declared in C_File "1.x:c_code". See python ctypes manual for details on typing.]]>
+ <xhtml:p><![CDATA[Simple_C_Call is declared in C_File "1.x:c_code". See python ctypes manual for details on typing.]]></xhtml:p> <comment localId="32" height="105" width="235">
<position x="25" y="285"/>
-<![CDATA[Fast clock, at least faster that sleep(1). See what happens when python takes time to answer : PLC continues.]]>
+ <xhtml:p><![CDATA[Fast clock, at least faster that sleep(1). See what happens when python takes time to answer : PLC continues.]]></xhtml:p> <outVariable localId="33" height="30" width="130">
@@ -889,23 +882,19 @@
- <inVariable localId="50" height="30" width="105">
+ <inVariable localId="50" height="30" width="105" executionOrderId="0" negated="false"> <position x="200" y="1085"/>
<relPosition x="105" y="15"/>
<expression>Global_RS.Q1</expression>
- <block localId="51" width="70" height="85" typeName="AND">
+ <block localId="51" width="70" height="85" typeName="AND" executionOrderId="0"> <position x="365" y="1065"/>
<variable formalParameter="IN1" negated="true">
<relPosition x="0" y="35"/>
- <connection refLocalId="50">
- <position x="365" y="1100"/>
- <position x="305" y="1100"/>
<variable formalParameter="IN2">
@@ -934,45 +923,33 @@
<expression>BOOL#TRUE</expression>
- <outVariable localId="13" height="30" width="105">
+ <outVariable localId="13" height="30" width="105" executionOrderId="0" negated="false"> <position x="510" y="1085"/>
<relPosition x="0" y="15"/>
- <connection refLocalId="51" formalParameter="OUT">
- <position x="510" y="1100"/>
- <position x="435" y="1100"/>
<expression>Global_RS.S</expression>
- <outVariable localId="20" height="30" width="105">
+ <outVariable localId="20" height="30" width="105" executionOrderId="0" negated="false"> <position x="510" y="1200"/>
<relPosition x="0" y="15"/>
- <connection refLocalId="41" formalParameter="OUT">
- <position x="510" y="1215"/>
- <position x="435" y="1215"/>
<expression>Global_RS.R1</expression>
- <inVariable localId="24" height="30" width="105">
+ <inVariable localId="24" height="30" width="105" executionOrderId="0" negated="false"> <position x="200" y="1200"/>
<relPosition x="105" y="15"/>
<expression>Global_RS.Q1</expression>
- <block localId="41" width="70" height="85" typeName="OR">
+ <block localId="41" width="70" height="85" typeName="OR" executionOrderId="0"> <position x="365" y="1180"/>
<variable formalParameter="IN1">
<relPosition x="0" y="35"/>
- <connection refLocalId="24">
- <position x="365" y="1215"/>
- <position x="305" y="1215"/>
<variable formalParameter="IN2">
@@ -1117,6 +1094,12 @@
<expression>23</expression>
+ <comment localId="60" height="40" width="500"> + <position x="120" y="1020"/> + <xhtml:p><![CDATA[Test for access to Gobal FB variables is disabled, as broken in matiec]]></xhtml:p> @@ -1185,7 +1168,7 @@
-<![CDATA[(* hereafter is a C pragma accessing FB interface in a clean way *)
+ <xhtml:p><![CDATA[(* hereafter is a C pragma accessing FB interface in a clean way *) char fromPLC = GetFbVar(IN);
@@ -1202,7 +1185,7 @@
(* If you do not use __GET_VAR and _SET_VAR macro, expect unexpected *)
@@ -1226,7 +1209,7 @@
-<![CDATA[NORM := SQRT(IN1 * IN1 + IN2 * IN2);]]>
+ <xhtml:p><![CDATA[NORM := SQRT(IN1 * IN1 + IN2 * IN2);]]></xhtml:p> --- 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 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version='1.0' encoding='utf-8'?> <BaseParams Name="python" IEC_Channel="0"/>
--- 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 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?xml version='1.0' encoding='utf-8'?> +<PyFile xmlns:xhtml="http://www.w3.org/1999/xhtml"> <variable name="Test_Python_Var" type="INT" initial="4"/>
<variable name="Second_Python_Var" type="INT" initial="5"/>
Python_to_C_Call = PLCBinary.Python_to_C_Call
Python_to_C_Call.restype = ctypes.c_int
@@ -39,30 +39,30 @@
print "py_runtime init:", x, ",", y
print "py_runtime cleanup"
print "py_runtime start", x * x + y * y