# HG changeset patch # User PaulBeltyukov # Date 1487237680 -18000 # Node ID 6431f26aa50160943420a75a50f7560af6278e60 # Parent a656ccb868d40d24e17f618f4a3682fee9e4782c Safe diff -r a656ccb868d4 -r 6431f26aa501 .directory --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.directory Thu Feb 16 14:34:40 2017 +0500 @@ -0,0 +1,6 @@ +[Dolphin] +Timestamp=2016,9,7,13,57,30 +ViewMode=1 + +[Settings] +HiddenFilesShown=true diff -r a656ccb868d4 -r 6431f26aa501 tests/logging/py_ext_0@py_ext/py_ext.xml --- a/tests/logging/py_ext_0@py_ext/py_ext.xml Tue Aug 23 10:24:47 2016 +0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<Python xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="py_ext_xsd.xsd"> -<![CDATA[import threading, time - -MyT = None -Stop = False - -def StartLog(): - global MyT - MyT=threading.Thread(target = DoLog) - MyT.start() - -def DoLog(): - global Stop - while not Stop: - PLCObject.LogMessage("Python side Logging (PLC is %s)"%PLCObject.PLCStatus) - time.sleep(0.3) - -def StopLog(): - global MyT,Stop - Stop=True - -_runtime_init.append(StartLog) -_runtime_cleanup.append(StopLog) -]]> -</Python> diff -r a656ccb868d4 -r 6431f26aa501 tests/logging/py_ext_0@py_ext/pyfile.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/logging/py_ext_0@py_ext/pyfile.xml Thu Feb 16 14:34:40 2017 +0500 @@ -0,0 +1,41 @@ +<?xml version='1.0' encoding='utf-8'?> +<PyFile xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <variables/> + <globals> + <xhtml:p><![CDATA[import threading, time + +MyT = None +Stop = False + +def StartLog(): + global MyT + MyT=threading.Thread(target = DoLog) + MyT.start() + +def DoLog(): + global Stop + while not Stop: + PLCObject.LogMessage("Python side Logging (PLC is %s)"%PLCObject.PLCStatus) + time.sleep(0.3) + +def StopLog(): + global MyT,Stop + Stop=True + +_runtime_init.append(StartLog) +_runtime_cleanup.append(StopLog) +]]></xhtml:p> + </globals> + <init> + <xhtml:p><![CDATA[]]></xhtml:p> + </init> + <cleanup> + <xhtml:p><![CDATA[]]></xhtml:p> + </cleanup> + <start> + <xhtml:p><![CDATA[]]></xhtml:p> + </start> + <stop> + <xhtml:p><![CDATA[]]></xhtml:p> + </stop> +</PyFile>