beremiz

fab1b8da6eba
clean PLC log only if there is something to clean

Otherwise exception happens in Beremiz service.

Traceback (most recent call last):
File "/home/developer/WorkData/PLC/beremiz/beremiz/connectors/PYRO/_init_.py", line 113, in catcher_func
return func(*args, **kwargs)
File "/home/developer/WorkData/PLC/beremiz/beremiz/connectors/PYRO/_init_.py", line 194, in my_local_func
return RemotePLCObjectProxy._getattr_(attrName)(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/Pyro/core.py", line 381, in _call_
return self._send(self._name, args, kwargs)
File "/usr/lib/python2.7/dist-packages/Pyro/core.py", line 456, in _invokePYRO
return self.adapter.remoteInvocation(name, Pyro.constants.RIF_VarargsAndKeywords, vargs, kargs)
File "/usr/lib/python2.7/dist-packages/Pyro/protocol.py", line 457, in remoteInvocation
return self._remoteInvocation(method, flags, *args)
File "/usr/lib/python2.7/dist-packages/Pyro/protocol.py", line 532, in _remoteInvocation
answer.raiseEx()
File "/usr/lib/python2.7/dist-packages/Pyro/errors.py", line 72, in raiseEx
raise self.excObj
AttributeError: 'PLCObject' object has no attribute '_ResetLogCount'
+--- This exception occured remotely (Pyro) - Remote traceback:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/Pyro/protocol.py", line 719, in _handleInvocation2
res = obj.Pyro_dyncall(req[1],flags,req[3]) # (method,flags,args)
File "/usr/lib/python2.7/dist-packages/Pyro/core.py", line 108, in Pyro_dyncall
return getattr(self.delegate or self,method) (args,*keywords)
File "/home/developer/WorkData/PLC/beremiz/beremiz/runtime/PLCObject.py", line 101, in ResetLogCount
if self._ResetLogCount is not None:
AttributeError: 'PLCObject' object has no attribute '_ResetLogCount'
+--- End of remote traceback
include yslt.yml2
estylesheet xmlns:ppx="http://www.plcopen.org/xml/tc6_0201"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:ns="var_infos_ns"
extension-element-prefixes="ns"
exclude-result-prefixes="ns" {
param "tree";
template "text()";
variable "project" {
copy "document('project')/project/*";
}
variable "stdlib" {
copy "document('stdlib')/stdlib/*";
}
variable "extensions" {
copy "document('extensions')/extensions/*";
}
template "ppx:configuration" {
apply "ppx:globalVars";
}
template "ppx:resource" {
apply "ppx:globalVars";
}
template "ppx:pou" {
apply "ppx:interface/*";
}
template "ppx:returnType" {
value "ns:AddTree()";
apply ".", mode="var_type";
}
function "variables_infos" {
param "var_class";
variable "var_option" {
choose {
when "@constant='true' or @constant='1'" > Constant
when "@retain='true' or @retain='1'" > Retain
when "@nonretain='true' or @nonretain='1'" > Non-Retain
}
}
foreach "ppx:variable" {
variable "initial_value" {
apply "ppx:initialValue";
}
variable "edit" {
choose {
when "$var_class='Global' or $var_class='External'" > true
otherwise {
apply "ppx:type", mode="var_edit";
}
}
}
value "ns:AddTree()";
apply "ppx:type", mode="var_type";
value "ns:AddVariable(@name, $var_class, $var_option, @address, $initial_value, $edit, ppx:documentation/xhtml:p/text())";
}
}
template "ppx:localVars" {
call "variables_infos" {
with "var_class" > Local
}
}
template "ppx:globalVars" {
call "variables_infos" {
with "var_class" > Global
}
}
template "ppx:externalVars" {
call "variables_infos" {
with "var_class" > External
}
}
template "ppx:tempVars" {
call "variables_infos" {
with "var_class" > Temp
}
}
template "ppx:inputVars" {
call "variables_infos" {
with "var_class" > Input
}
}
template "ppx:outputVars" {
call "variables_infos" {
with "var_class" > Output
}
}
template "ppx:inOutVars" {
call "variables_infos" {
with "var_class" > InOut
}
}
template "ppx:pou", mode="var_type" {
apply "ppx:interface/*[self::ppx:inputVars or self::ppx:inOutVars or self::ppx:outputVars]/ppx:variable", mode="var_type";
}
template "ppx:variable", mode="var_type" {
variable "name" > «@name»
value "ns:AddTree()";
apply "ppx:type", mode="var_type";
value "ns:AddVarToTree($name)";
}
template "ppx:dataType", mode="var_type" {
apply "ppx:baseType", mode="var_type";
}
template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:struct", mode="var_type" {
apply "ppx:variable", mode="var_type";
}
template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:derived", mode="var_type" {
variable "type_name" > «@name»
choose {
when "$tree='True'" {
apply """exsl:node-set($project)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |
exsl:node-set($project)/ppx:project/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name] |
exsl:node-set($stdlib)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |
exsl:node-set($stdlib)/ppx:project/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name] |
exsl:node-set($extensions)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |
exsl:node-set($extensions)/ppx:project/ppx:types/ppx:dataTypes/ppx:dataType[@name=$type_name]""", mode="var_type";
}
}
value "ns:SetType($type_name)";
}
template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:array", mode="var_type" {
apply "ppx:baseType", mode="var_type";
foreach "ppx:dimension" {
variable "lower" > «@lower»
variable "upper" > «@upper»
value "ns:AddDimension($lower, $upper)";
}
}
template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:string", mode="var_type" {
variable "name" > STRING
value "ns:SetType($name)";
}
template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:wstring", mode="var_type" {
variable "name" > WSTRING
value "ns:SetType($name)";
}
template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/*", mode="var_type" {
variable "name" > «local-name()»
value "ns:SetType($name)";
}
template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/ppx:derived", mode="var_edit" {
variable "type_name" > «@name»
variable "pou_infos" {
copy """exsl:node-set($project)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |
exsl:node-set($stdlib)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name] |
exsl:node-set($extensions)/ppx:project/ppx:types/ppx:pous/ppx:pou[@name=$type_name]""";
}
choose {
when "$pou_infos != ''" > false
otherwise > true
}
}
template "*[self::ppx:type or self::ppx:baseType or self::ppx:returnType]/*", mode="var_edit" {
> true
}
template "ppx:value" {
choose {
when "@repetitionValue" {
> «@repetitionValue»(
apply;
> )
}
when "@member" {
> «@member» :=
apply;
}
otherwise {
apply;
}
}
}
template "ppx:simpleValue" {
> «@value»
}
function "complex_type_value" {
param "start_bracket";
param "end_bracket";
> «$start_bracket»
foreach "ppx:value" {
apply ".";
choose {
when "position()!=last()" > ,
}
}
> «$end_bracket»
}
template "ppx:arrayValue" {
call "complex_type_value" {
with "start_bracket" > [
with "end_bracket" > ]
}
}
template "ppx:structValue" {
call "complex_type_value" {
with "start_bracket" > (
with "end_bracket" > )
}
}
}