--- a/ProjectController.py Sat Sep 10 11:19:40 2016 +0500
+++ b/ProjectController.py Mon Sep 12 10:15:39 2016 +0500
@@ -1561,11 +1561,8 @@
if connector is not None:
if self.StatusTimer is not None:
- # Suppress WXDEBUG assertions, as happens by default with wx2.8
- self.StatusTimer.Start(milliseconds=500, oneShot=False)
+ self.StatusTimer.Start(milliseconds=500, oneShot=False) if self.StatusTimer is not None:
--- a/controls/VariablePanel.py Sat Sep 10 11:19:40 2016 +0500
+++ b/controls/VariablePanel.py Mon Sep 12 10:15:39 2016 +0500
@@ -144,6 +144,14 @@
+ def _GetRowEdit(self, row): + row_edit = self.GetValueByName(row, "Edit") + var_type = self.Parent.GetTagName() + bodytype = self.Parent.Controler.GetEditedElementBodyType(var_type) + if bodytype in ["ST", "IL"]: def _updateColAttrs(self, grid):
wx.grid.Grid -> update the column attributes to add the
@@ -171,7 +179,7 @@
editor.SetParameters(",".join(map(_, options)))
grid.SetReadOnly(row, col, True)
- elif col != 0 and self.GetValueByName(row, "Edit"):
+ elif col != 0 and self._GetRowEdit(row): grid.SetReadOnly(row, col, False)
editor = wx.grid.GridCellTextEditor()
--- a/tests/logging/plc.xml Sat Sep 10 11:19:40 2016 +0500
+++ b/tests/logging/plc.xml Mon Sep 12 10:15:39 2016 +0500
@@ -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="Unknown"
- creationDateTime="2013-01-29T14:01:00"/>
- <contentHeader name="Unnamed"
- modificationDateTime="2013-04-04T11:06:06">
+<?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="Unknown" productName="Generic PLC" productVersion="1" creationDateTime="2013-01-29T14:01:00" contentDescription="This example shows logging functionality in Beremiz. Here are shown two ways of logging: - from IEC PLC program; - from python extension. "/> + <contentHeader name="Logging example" modificationDateTime="2016-09-09T17:54:15"> @@ -47,29 +40,34 @@
<derived name="LOGLEVEL"/>
- <simpleValue value="WARNING"/>
+ <simpleValue value="INFO"/> + <variable name="Timer"> - <inVariable localId="2" height="27" width="85">
- <position x="732" y="188"/>
+ <inVariable localId="2" height="30" width="170" executionOrderId="0" negated="false"> + <position x="507" y="347"/> - <relPosition x="85" y="13"/>
+ <relPosition x="170" y="15"/> - <expression>'Moooooo'</expression>
+ <expression>'IEC side logging: beat #'</expression> - <block localId="3" width="59" height="40" typeName="NOT">
- <position x="213" y="64"/>
+ <block localId="3" width="59" height="40" typeName="NOT" executionOrderId="0"> + <position x="241" y="269"/> <variable formalParameter="IN">
<relPosition x="0" y="30"/>
- <connection refLocalId="4">
- <position x="213" y="94"/>
- <position x="179" y="94"/>
+ <connection refLocalId="14" formalParameter="Q"> + <position x="241" y="299"/> + <position x="195" y="299"/> @@ -83,44 +81,46 @@
- <inOutVariable localId="4" height="27" width="41">
- <position x="138" y="81"/>
+ <inOutVariable localId="4" height="27" width="51" executionOrderId="0" negatedOut="false" negatedIn="false"> + <position x="66" y="286"/> <relPosition x="0" y="13"/>
<connection refLocalId="3" formalParameter="OUT">
- <position x="138" y="94"/>
- <position x="123" y="94"/>
- <position x="123" y="124"/>
- <position x="282" y="124"/>
- <position x="282" y="94"/>
- <position x="272" y="94"/>
+ <position x="66" y="299"/> + <position x="37" y="299"/> + <position x="37" y="372"/> + <position x="314" y="372"/> + <position x="314" y="299"/> + <position x="300" y="299"/> - <relPosition x="41" y="13"/>
+ <relPosition x="51" y="13"/> <expression>beat</expression>
- <block localId="5" width="68" height="80" typeName="ADD">
- <position x="482" y="209"/>
+ <block localId="5" width="68" height="98" typeName="ADD" executionOrderId="0"> + <position x="463" y="385"/> <variable formalParameter="IN1">
- <relPosition x="0" y="35"/>
+ <relPosition x="0" y="39"/> <connection refLocalId="10" formalParameter="OUT">
- <position x="482" y="244"/>
- <position x="459" y="244"/>
- <position x="459" y="230"/>
- <position x="449" y="230"/>
+ <position x="463" y="424"/> + <position x="452" y="424"/> + <position x="452" y="424"/> + <position x="454" y="424"/> + <position x="454" y="424"/> + <position x="444" y="424"/> <variable formalParameter="IN2">
- <relPosition x="0" y="65"/>
+ <relPosition x="0" y="78"/> <connection refLocalId="6">
- <position x="482" y="274"/>
- <position x="397" y="274"/>
+ <position x="463" y="463"/> + <position x="444" y="463"/> @@ -129,51 +129,47 @@
<variable formalParameter="OUT">
- <relPosition x="68" y="35"/>
+ <relPosition x="68" y="39"/> - <inOutVariable localId="6" height="27" width="48">
- <position x="349" y="261"/>
+ <inOutVariable localId="6" height="27" width="103" executionOrderId="0" negatedOut="false" negatedIn="false"> + <position x="341" y="450"/> <relPosition x="0" y="13"/>
<connection refLocalId="5" formalParameter="OUT">
- <position x="349" y="274"/>
- <position x="339" y="274"/>
- <position x="339" y="306"/>
- <position x="563" y="306"/>
- <position x="563" y="244"/>
- <position x="550" y="244"/>
+ <position x="341" y="463"/> + <position x="320" y="463"/> + <position x="320" y="500"/> + <position x="544" y="500"/> + <position x="544" y="424"/> + <position x="531" y="424"/> - <relPosition x="48" y="13"/>
+ <relPosition x="103" y="13"/> <expression>count</expression>
- <block localId="8" width="67" height="60" typeName="CONCAT">
- <position x="868" y="174"/>
+ <block localId="8" width="67" height="144" typeName="CONCAT" executionOrderId="0"> + <position x="727" y="311"/> <variable formalParameter="IN1">
- <relPosition x="0" y="30"/>
+ <relPosition x="0" y="51"/> <connection refLocalId="2">
- <position x="868" y="204"/>
- <position x="843" y="204"/>
- <position x="843" y="201"/>
- <position x="817" y="201"/>
+ <position x="727" y="362"/> + <position x="677" y="362"/> <variable formalParameter="IN2">
- <relPosition x="0" y="50"/>
+ <relPosition x="0" y="113"/> <connection refLocalId="9" formalParameter="OUT">
- <position x="868" y="224"/>
- <position x="765" y="224"/>
- <position x="765" y="232"/>
- <position x="712" y="232"/>
+ <position x="727" y="424"/> + <position x="677" y="424"/> @@ -182,22 +178,20 @@
<variable formalParameter="OUT">
- <relPosition x="67" y="30"/>
+ <relPosition x="67" y="51"/> - <block localId="9" width="116" height="40" typeName="INT_TO_STRING">
- <position x="596" y="202"/>
+ <block localId="9" width="116" height="40" typeName="INT_TO_STRING" executionOrderId="0"> + <position x="561" y="394"/> <variable formalParameter="IN">
<relPosition x="0" y="30"/>
<connection refLocalId="5" formalParameter="OUT">
- <position x="596" y="232"/>
- <position x="573" y="232"/>
- <position x="573" y="244"/>
- <position x="550" y="244"/>
+ <position x="561" y="424"/> + <position x="531" y="424"/> @@ -211,19 +205,17 @@
- <block localId="10" width="105" height="40" typeName="BOOL_TO_INT">
- <position x="344" y="200"/>
+ <block localId="10" width="105" height="40" typeName="BOOL_TO_INT" executionOrderId="0"> + <position x="339" y="394"/> <variable formalParameter="IN" edge="rising">
<relPosition x="0" y="30"/>
<connection refLocalId="3" formalParameter="OUT">
- <position x="344" y="230"/>
- <position x="242" y="230"/>
- <position x="242" y="163"/>
- <position x="282" y="163"/>
- <position x="282" y="94"/>
- <position x="272" y="94"/>
+ <position x="339" y="424"/> + <position x="314" y="424"/> + <position x="314" y="299"/> + <position x="300" y="299"/> @@ -237,39 +229,33 @@
- <block localId="11" width="65" height="80" typeName="LOGGER" instanceName="LOGGER0">
- <position x="1100" y="98"/>
+ <block localId="11" width="65" height="209" typeName="LOGGER" instanceName="LOGGER0" executionOrderId="0"> + <position x="907" y="248"/> <variable formalParameter="TRIG">
- <relPosition x="0" y="30"/>
+ <relPosition x="0" y="52"/> <connection refLocalId="3" formalParameter="OUT">
- <position x="1100" y="128"/>
- <position x="631" y="128"/>
- <position x="631" y="94"/>
- <position x="272" y="94"/>
+ <position x="907" y="300"/> + <position x="300" y="300"/> <variable formalParameter="MSG">
- <relPosition x="0" y="50"/>
+ <relPosition x="0" y="112"/> <connection refLocalId="8" formalParameter="OUT">
- <position x="1100" y="148"/>
- <position x="963" y="148"/>
- <position x="963" y="204"/>
- <position x="935" y="204"/>
+ <position x="907" y="360"/> + <position x="794" y="360"/> <variable formalParameter="LEVEL">
- <relPosition x="0" y="70"/>
+ <relPosition x="0" y="177"/> <connection refLocalId="12">
- <position x="1100" y="168"/>
- <position x="1090" y="168"/>
- <position x="1090" y="168"/>
- <position x="1057" y="168"/>
+ <position x="907" y="425"/> + <position x="879" y="425"/> @@ -277,13 +263,72 @@
- <inVariable localId="12" height="27" width="79">
- <position x="978" y="155"/>
+ <inVariable localId="12" height="27" width="79" executionOrderId="0" negated="false"> + <position x="800" y="412"/> <relPosition x="79" y="13"/>
- <expression>WARNING</expression>
+ <expression>lvl</expression> + <block localId="14" typeName="TOF" instanceName="Timer" executionOrderId="0" height="98" width="45"> + <position x="150" y="260"/> + <variable formalParameter="IN"> + <relPosition x="0" y="39"/> + <connection refLocalId="4"> + <position x="150" y="299"/> + <position x="117" y="299"/> + <variable formalParameter="PT"> + <relPosition x="0" y="78"/> + <connection refLocalId="1"> + <position x="150" y="338"/> + <position x="117" y="338"/> + <variable formalParameter="Q"> + <relPosition x="45" y="39"/> + <variable formalParameter="ET"> + <relPosition x="45" y="78"/> + <inVariable localId="1" executionOrderId="0" height="24" width="52" negated="false"> + <position x="65" y="326"/> + <relPosition x="52" y="12"/> + <expression>T#3s</expression> + <comment localId="15" height="212" width="675"> + <position x="27" y="16"/> + <xhtml:p><![CDATA[This example shows logging functionality in Beremiz. +Here are shown two ways of logging: +- from python extension. +In IEC PLC program every third second (beat) new message is generated and put in PLC log. +See function blocks below. +Every 15 seconds status of PLC program is put in PLC log from python extension. +For more information about logging from python look at 0.x: py_ext_0 implementation in project tree. @@ -293,8 +338,8 @@
<configuration name="config">
<resource name="resource1">
- <task name="blob" interval="T#100ms" priority="0">
- <pouInstance name="blub" typeName="program0"/>
+ <task name="task0" priority="0" interval="T#100ms"> + <pouInstance name="prg" typeName="program0"/>