bacnet/__init__.py
author Edouard Tisserant <edouard.tisserant@gmail.com>
Wed, 05 Oct 2022 16:10:17 +0200
branchwxPython4
changeset 3617 c3aae4c95bc1
parent 2250 86f61c4dfe76
child 3750 f62625418bff
permissions -rw-r--r--
Runtime: work around 1s delay added when using twisted reactor's callLater.

Since wxPython4, using wxReactor from non-main thread was producing
exceptions in wxWidget's C++ code. Then reactor.run() was called from
main thread, and runtime's worker was delegating calls to reactor
with callLater(0, callable).

While this worked perfectly with wxReactor, it did introduce an unexplained
1 second delay to each worker call when using nomal linux reactors
(i.e. without wxPython). As a workaround reactor runs in a thread when using
twisted without wxPython
2020
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
     1
#!/usr/bin/env python
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
     2
# -*- coding: utf-8 -*-
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
     3
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
     4
# This file is part of Beremiz, a Integrated Development Environment for
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
     5
# programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
     6
#
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
     7
# Copyright (c) 2017 Mario de Sousa (msousa@fe.up.pt)
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
     8
#
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
     9
# This program is free software: you can redistribute it and/or modify
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    10
# it under the terms of the GNU General Public License as published by
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    11
# the Free Software Foundation, either version 2 of the License, or
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    12
# (at your option) any later version.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    13
#
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    14
# This program is distributed in the hope that it will be useful,
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    17
# GNU General Public License for more details.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    18
#
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    19
# You should have received a copy of the GNU General Public License
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    20
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
2250
86f61c4dfe76 Passed bacnet*.py through autopep8, and attemped to fix manually what went wrong + fixed pylint complains
Edouard Tisserant
parents: 2020
diff changeset
    21
#
2020
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    22
# This code is made available on the understanding that it will not be
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    23
# used in safety-critical situations without a full and competent review.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    24
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    25
2250
86f61c4dfe76 Passed bacnet*.py through autopep8, and attemped to fix manually what went wrong + fixed pylint complains
Edouard Tisserant
parents: 2020
diff changeset
    26
from __future__ import absolute_import
86f61c4dfe76 Passed bacnet*.py through autopep8, and attemped to fix manually what went wrong + fixed pylint complains
Edouard Tisserant
parents: 2020
diff changeset
    27
86f61c4dfe76 Passed bacnet*.py through autopep8, and attemped to fix manually what went wrong + fixed pylint complains
Edouard Tisserant
parents: 2020
diff changeset
    28
from bacnet.bacnet import *