tests/logging/py_ext_0@py_ext/py_ext.xml
author Andrey Skvortsov <andrej.skvortzov@gmail.com>
Fri, 13 Jan 2017 19:51:36 +0300
changeset 1631 940e20a8865b
parent 1014 e2f7d6c95db0
permissions -rw-r--r--
fix issue with printing scheme (FBD, LD or SFC) with comment element on GNU/Linux

If you draw FBD scheme and place comment on it and then try to print
it, then no wires will be printed and comment box is empty (text is
missing). This happens only for wx.PrinterDC and not on wx.MemoryDC
that is used to draw print preview window in Beremiz IDE.
Looks like a bug in wxPython or wxWidgets.

There were found several workaround for this issue.
1) If some dc.DrawLines call is placed before dc.DrawPolygon, then the
problem is gone.

...
dc.DrawLines(polygon)
dc.DrawPolygon(polygon)
...

2) Reseting DC brush solves the problem as well (see this changeset).
914
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
     2
<Python xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="py_ext_xsd.xsd">
1014
e2f7d6c95db0 Now python files provided by extentions have init, start, stop and cleanup hooks
Edouard Tisserant
parents: 944
diff changeset
     3
<![CDATA[import threading, time
914
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
     4
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
     5
MyT = None
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
     6
Stop = False
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
     7
1014
e2f7d6c95db0 Now python files provided by extentions have init, start, stop and cleanup hooks
Edouard Tisserant
parents: 944
diff changeset
     8
def StartLog():
e2f7d6c95db0 Now python files provided by extentions have init, start, stop and cleanup hooks
Edouard Tisserant
parents: 944
diff changeset
     9
    global MyT
e2f7d6c95db0 Now python files provided by extentions have init, start, stop and cleanup hooks
Edouard Tisserant
parents: 944
diff changeset
    10
    MyT=threading.Thread(target = DoLog)
e2f7d6c95db0 Now python files provided by extentions have init, start, stop and cleanup hooks
Edouard Tisserant
parents: 944
diff changeset
    11
    MyT.start()
e2f7d6c95db0 Now python files provided by extentions have init, start, stop and cleanup hooks
Edouard Tisserant
parents: 944
diff changeset
    12
914
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
    13
def DoLog():
1014
e2f7d6c95db0 Now python files provided by extentions have init, start, stop and cleanup hooks
Edouard Tisserant
parents: 944
diff changeset
    14
    global Stop
e2f7d6c95db0 Now python files provided by extentions have init, start, stop and cleanup hooks
Edouard Tisserant
parents: 944
diff changeset
    15
    while not Stop:
e2f7d6c95db0 Now python files provided by extentions have init, start, stop and cleanup hooks
Edouard Tisserant
parents: 944
diff changeset
    16
        PLCObject.LogMessage("Python side Logging (PLC is %s)"%PLCObject.PLCStatus)
e2f7d6c95db0 Now python files provided by extentions have init, start, stop and cleanup hooks
Edouard Tisserant
parents: 944
diff changeset
    17
        time.sleep(0.3)
914
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
    18
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
    19
def StopLog():
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
    20
    global MyT,Stop
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
    21
    Stop=True
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
    22
1014
e2f7d6c95db0 Now python files provided by extentions have init, start, stop and cleanup hooks
Edouard Tisserant
parents: 944
diff changeset
    23
_runtime_init.append(StartLog)
914
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
    24
_runtime_cleanup.append(StopLog)
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
    25
]]>
94436558f0ce More stable logging. Added small one-entry log for loading errors. Test now include python side concurrent logging
Edouard Tisserant
parents:
diff changeset
    26
</Python>