beremiz

Conform to pep8 and pylint :

2019-04-07, Edouard Tisserant
8fb5c6eddc72
Conform to pep8 and pylint :

pep8 version: 2.3.1
./ConfigTreeNode.py:130:49: E231 missing whitespace after ','
./editors/Viewer.py:643:24: E128 continuation line under-indented for visual indent
./editors/Viewer.py:670:12: E221 multiple spaces before operator
./editors/Viewer.py:671:13: E221 multiple spaces before operator
./editors/Viewer.py:2138:52: E203 whitespace before ':'
./editors/Viewer.py:2139:66: W291 trailing whitespace
./controls/VariablePanel.py:154:25: E231 missing whitespace after ','
./controls/LocationCellEditor.py:88:1: W293 blank line contains whitespace
./controls/LocationCellEditor.py:191:25: E221 multiple spaces before operator
./controls/LocationCellEditor.py:200:17: E128 continuation line under-indented for visual indent

pylint 1.8.3,
************* Module controls.LocationCellEditor
controls/LocationCellEditor.py:200: [C0330(bad-continuation), ] Wrong continued indentation (add 9 spaces).
_("Selected location is identical to previous one"))
^ |
************* Module controls.VariablePanel
controls/VariablePanel.py:154: [E1601(print-statement), VariableTable.SetValue] print statement used
************* Module editors.Viewer
editors/Viewer.py:643: [C0330(bad-continuation), ] Wrong continued indentation (add 1 space).
self.GetAddMenuCallBack(self.AddNewComment))
^|
editors/Viewer.py:598: [W0612(unused-variable), Viewer.AddDivergenceMenuItems] Unused variable 'add_branch'
editors/Viewer.py:1655: [E0602(undefined-variable), Viewer.PopupConnectionMenu] Undefined variable 'variable_type'
editors/Viewer.py:1649: [W0612(unused-variable), Viewer.PopupConnectionMenu] Unused variable 'connection_type'
************* Module connectors.PYRO.PSK_Adapter
<?xml version='1.0' encoding='utf-8'?>
<project xmlns:ns1="http://www.plcopen.org/xml/tc6_0201" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.plcopen.org/xml/tc6_0201">
<fileHeader companyName="Beremiz" productName="Beremiz" productVersion="1" creationDateTime="2018-07-27T13:19:12"/>
<contentHeader name="Modbus" modificationDateTime="2018-07-27T15:43:56">
<coordinateInfo>
<fbd>
<scaling x="0" y="0"/>
</fbd>
<ld>
<scaling x="0" y="0"/>
</ld>
<sfc>
<scaling x="0" y="0"/>
</sfc>
</coordinateInfo>
</contentHeader>
<types>
<dataTypes/>
<pous>
<pou name="program0" pouType="program">
<interface>
<localVars>
<variable name="Counter">
<type>
<INT/>
</type>
</variable>
<variable name="CounterReadBack">
<type>
<INT/>
</type>
</variable>
</localVars>
<localVars>
<variable name="MasterWriteToReg0" address="%QW0.0.0.0">
<type>
<INT/>
</type>
</variable>
<variable name="MasterReadFromReg1" address="%IW0.0.1.0">
<type>
<INT/>
</type>
</variable>
<variable name="SlaveHoldReg0" address="%IW0.1.0.0">
<type>
<WORD/>
</type>
</variable>
<variable name="SlaveInputReg0" address="%QW0.1.1.0">
<type>
<WORD/>
</type>
</variable>
</localVars>
<localVars>
<variable name="CTU0">
<type>
<derived name="CTU"/>
</type>
</variable>
<variable name="Generator0">
<type>
<derived name="Generator"/>
</type>
</variable>
</localVars>
</interface>
<body>
<FBD>
<comment localId="4" height="109" width="350">
<position x="102" y="438"/>
<content>
<xhtml:p><![CDATA[Modbus TCP Master writes counter value to one holding register on Modbus TCP Slave and reads it back from other input register.]]></xhtml:p>
</content>
</comment>
<comment localId="3" height="407" width="680">
<position x="21" y="15"/>
<content>
<xhtml:p><![CDATA[This examples shows how to work with Modbus extension. It uses Modbus TCP, but the same functions are available for Modbus RTU as well. Buth protocols are supported.
Modbus extensions requires native Modbus RTU/TCP library to be installed nearby Beremiz.
Following directory structure is expected:
<Parent directory>
"beremiz"
"Modbus"
If Modbus library is installed elsewhere, then place corresponding paths
in CFLAGS/LDFLAGS in project settings.
For GNU/Linux to install Modbus library in parent directory run following commands:
$ hg clone https://bitbucket.org/mjsousa/modbus Modbus
$ cd Modbus
$ make
After that Modbus extension is ready to be used in Beremiz projects.]]></xhtml:p>
</content>
</comment>
<block localId="5" typeName="CTU" instanceName="CTU0" executionOrderId="0" height="80" width="52">
<position x="346" y="605"/>
<inputVariables>
<variable formalParameter="CU" edge="rising">
<connectionPointIn>
<relPosition x="0" y="30"/>
<connection refLocalId="6" formalParameter="OUT">
<position x="346" y="635"/>
<position x="303" y="635"/>
</connection>
</connectionPointIn>
</variable>
<variable formalParameter="R">
<connectionPointIn>
<relPosition x="0" y="50"/>
</connectionPointIn>
</variable>
<variable formalParameter="PV">
<connectionPointIn>
<relPosition x="0" y="70"/>
<connection refLocalId="7">
<position x="346" y="675"/>
<position x="324" y="675"/>
<position x="324" y="703"/>
<position x="302" y="703"/>
</connection>
</connectionPointIn>
</variable>
</inputVariables>
<inOutVariables/>
<outputVariables>
<variable formalParameter="Q">
<connectionPointOut>
<relPosition x="52" y="30"/>
</connectionPointOut>
</variable>
<variable formalParameter="CV">
<connectionPointOut>
<relPosition x="52" y="50"/>
</connectionPointOut>
</variable>
</outputVariables>
</block>
<block localId="6" typeName="Generator" instanceName="Generator0" executionOrderId="0" height="60" width="79">
<position x="224" y="605"/>
<inputVariables>
<variable formalParameter="PON">
<connectionPointIn>
<relPosition x="0" y="30"/>
<connection refLocalId="1">
<position x="224" y="635"/>
<position x="154" y="635"/>
</connection>
</connectionPointIn>
</variable>
<variable formalParameter="POFF">
<connectionPointIn>
<relPosition x="0" y="50"/>
<connection refLocalId="1">
<position x="224" y="655"/>
<position x="189" y="655"/>
<position x="189" y="635"/>
<position x="154" y="635"/>
</connection>
</connectionPointIn>
</variable>
</inputVariables>
<inOutVariables/>
<outputVariables>
<variable formalParameter="OUT">
<connectionPointOut>
<relPosition x="79" y="30"/>
</connectionPointOut>
</variable>
</outputVariables>
</block>
<inVariable localId="1" executionOrderId="0" height="30" width="138" negated="false">
<position x="16" y="620"/>
<connectionPointOut>
<relPosition x="138" y="15"/>
</connectionPointOut>
<expression>T#1s</expression>
</inVariable>
<inVariable localId="7" executionOrderId="0" height="30" width="138" negated="false">
<position x="164" y="688"/>
<connectionPointOut>
<relPosition x="138" y="15"/>
</connectionPointOut>
<expression>32767</expression>
</inVariable>
<inOutVariable localId="2" executionOrderId="0" height="30" width="138" negatedOut="false" negatedIn="false">
<position x="544" y="640"/>
<connectionPointIn>
<relPosition x="0" y="15"/>
<connection refLocalId="5" formalParameter="CV">
<position x="544" y="655"/>
<position x="398" y="655"/>
</connection>
</connectionPointIn>
<connectionPointOut>
<relPosition x="138" y="15"/>
</connectionPointOut>
<expression>Counter</expression>
</inOutVariable>
<outVariable localId="8" executionOrderId="0" height="30" width="138" negated="false">
<position x="762" y="640"/>
<connectionPointIn>
<relPosition x="0" y="15"/>
<connection refLocalId="2">
<position x="762" y="655"/>
<position x="682" y="655"/>
</connection>
</connectionPointIn>
<expression>MasterWriteToReg0</expression>
</outVariable>
<inVariable localId="9" executionOrderId="0" height="30" width="152" negated="false">
<position x="81" y="747"/>
<connectionPointOut>
<relPosition x="152" y="15"/>
</connectionPointOut>
<expression>MasterReadFromReg1</expression>
</inVariable>
<outVariable localId="10" executionOrderId="0" height="30" width="137" negated="false">
<position x="547" y="747"/>
<connectionPointIn>
<relPosition x="0" y="15"/>
<connection refLocalId="9">
<position x="547" y="762"/>
<position x="233" y="762"/>
</connection>
</connectionPointIn>
<expression>CounterReadBack</expression>
</outVariable>
<comment localId="11" height="109" width="350">
<position x="85" y="825"/>
<content>
<xhtml:p><![CDATA[Modbus TCP Slave just copies received register value from holding register to input register.]]></xhtml:p>
</content>
</comment>
<inVariable localId="12" executionOrderId="0" height="30" width="152" negated="false">
<position x="82" y="970"/>
<connectionPointOut>
<relPosition x="152" y="15"/>
</connectionPointOut>
<expression>SlaveHoldReg0</expression>
</inVariable>
<outVariable localId="13" executionOrderId="0" height="30" width="123" negated="false">
<position x="548" y="970"/>
<connectionPointIn>
<relPosition x="0" y="15"/>
<connection refLocalId="12">
<position x="548" y="985"/>
<position x="234" y="985"/>
</connection>
</connectionPointIn>
<expression>SlaveInputReg0</expression>
</outVariable>
</FBD>
</body>
</pou>
<pou name="Generator" pouType="functionBlock">
<interface>
<outputVars>
<variable name="OUT">
<type>
<BOOL/>
</type>
</variable>
</outputVars>
<inputVars>
<variable name="PON">
<type>
<TIME/>
</type>
</variable>
<variable name="POFF">
<type>
<TIME/>
</type>
</variable>
</inputVars>
<localVars>
<variable name="T1">
<type>
<derived name="TON"/>
</type>
</variable>
<variable name="T2">
<type>
<derived name="TOF"/>
</type>
</variable>
</localVars>
</interface>
<body>
<ST>
<xhtml:p><![CDATA[T1( IN := NOT T2.Q, PT := POFF);
T2( IN := T1.Q, PT := PON);
OUT := T2.Q;]]></xhtml:p>
</ST>
</body>
</pou>
</pous>
</types>
<instances>
<configurations>
<configuration name="config">
<resource name="resource1">
<task name="task0" priority="0" interval="T#20ms">
<pouInstance name="instance0" typeName="program0"/>
</task>
</resource>
</configuration>
</configurations>
</instances>
</project>