mirror of
https://github.com/naruxde/revpimodio2.git
synced 2025-11-08 22:03:53 +01:00
Reorder package to src-layout.
Move package to src directory and update project base files for build process.
This commit is contained in:
7
.idea/revpimodio2.iml
generated
7
.idea/revpimodio2.iml
generated
@@ -1,10 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Python 3.9" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
<component name="PackageRequirementsSettings">
|
||||
<option name="versionSpecifier" value="Greater or equal (>=x.y.z)" />
|
||||
</component>
|
||||
<component name="TestRunnerService">
|
||||
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
|
||||
</component>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
global-exclude test/*
|
||||
global-exclude *.pyc
|
||||
recursive-include src/revpimodio *.py
|
||||
include LICENSE.txt
|
||||
include MANIFEST.in
|
||||
include README.md
|
||||
include setup.py
|
||||
|
||||
43
Makefile
Normal file
43
Makefile
Normal file
@@ -0,0 +1,43 @@
|
||||
SHELL := bash
|
||||
MAKEFLAGS = --no-print-directory --no-builtin-rules
|
||||
.DEFAULT_GOAL = all
|
||||
|
||||
# Variables
|
||||
PACKAGE = revpimodio2
|
||||
|
||||
# If virtualenv exists, use it. If not, use PATH to find, except python3
|
||||
SYSTEM_PYTHON = /usr/bin/python3
|
||||
PYTHON = $(or $(wildcard venv/bin/python), $(SYSTEM_PYTHON))
|
||||
|
||||
all: build
|
||||
|
||||
.PHONY: all
|
||||
|
||||
## Environment
|
||||
venv:
|
||||
$(SYSTEM_PYTHON) -m venv venv
|
||||
source venv/bin/activate && \
|
||||
python3 -m pip install --upgrade pip && \
|
||||
python3 -m pip install -r requirements.txt
|
||||
exit 0
|
||||
|
||||
.PHONY: venv
|
||||
|
||||
## Build, install
|
||||
build:
|
||||
$(PYTHON) -m setup sdist
|
||||
$(PYTHON) -m setup bdist_wheel
|
||||
|
||||
install:
|
||||
$(PYTHON) -m pip install dist/$(PACKAGE)-*.whl
|
||||
|
||||
.PHONY: build install
|
||||
|
||||
## Clean
|
||||
clean:
|
||||
rm -rf build dist src/*.egg-info *.spec
|
||||
|
||||
clean-all: clean
|
||||
rm -R venv
|
||||
|
||||
.PHONY: clean clean-all
|
||||
2
requirements.txt
Normal file
2
requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
setuptools>=65.6.3
|
||||
wheel
|
||||
37
setup.py
37
setup.py
@@ -1,31 +1,34 @@
|
||||
#! /usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""Setupscript fuer python3-revpimodio."""
|
||||
"""Setupscript for revpimodio."""
|
||||
__author__ = "Sven Sager"
|
||||
__copyright__ = "Copyright (C) 2020 Sven Sager"
|
||||
__copyright__ = "Copyright (C) 2023 Sven Sager"
|
||||
__license__ = "LGPLv3"
|
||||
|
||||
from distutils.core import setup
|
||||
from setuptools import setup, find_namespace_packages
|
||||
|
||||
setup(
|
||||
name="revpimodio2",
|
||||
version="2.6.0rc2",
|
||||
|
||||
packages=find_namespace_packages("src"),
|
||||
package_dir={'': 'src'},
|
||||
include_package_data=True,
|
||||
|
||||
python_requires="~=3.2",
|
||||
install_requires=[],
|
||||
entry_points={},
|
||||
|
||||
platforms=["all"],
|
||||
|
||||
url="https://revpimodio.org/",
|
||||
license="LGPLv3",
|
||||
author="Sven Sager",
|
||||
author_email="akira@narux.de",
|
||||
url="https://revpimodio.org/",
|
||||
download_url="https://revpimodio.org/quellen/",
|
||||
maintainer="Sven Sager",
|
||||
maintainer_email="akira@revpimodio.org",
|
||||
|
||||
license="LGPLv3",
|
||||
name="revpimodio2",
|
||||
version="2.6.0a0",
|
||||
|
||||
packages=["revpimodio2"],
|
||||
python_requires="~=3.2",
|
||||
keywords="revolutionpi plc automation",
|
||||
|
||||
description="Python3 programming for RevolutionPi of Kunbus GmbH",
|
||||
long_description=""
|
||||
"Das Modul stellt alle Devices und IOs aus der piCtory Konfiguration \n"
|
||||
long_description="Das Modul stellt alle Devices und IOs aus der piCtory Konfiguration \n"
|
||||
"in Python3 zur Verfügung. Es ermöglicht den direkten Zugriff auf die \n"
|
||||
"Werte über deren vergebenen Namen. Lese- und Schreibaktionen mit dem \n"
|
||||
"Prozessabbild werden von dem Modul selbst verwaltet, ohne dass sich \n"
|
||||
@@ -34,7 +37,7 @@ setup(
|
||||
"'Outputs' über einen bestimmten Adressbereich definierbar. Auf \n"
|
||||
"diese IOs kann mit Python3 über den Namen direkt auf die Werte \n"
|
||||
"zugegriffen werden.",
|
||||
|
||||
keywords=["revpi", "revolution pi", "revpimodio", "plc", "automation"],
|
||||
classifiers=[
|
||||
"Development Status :: 5 - Production/Stable",
|
||||
"Environment :: Console",
|
||||
|
||||
33
src/revpimodio2/__init__.py
Normal file
33
src/revpimodio2/__init__.py
Normal file
@@ -0,0 +1,33 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Stellt alle Klassen fuer den RevolutionPi zur Verfuegung.
|
||||
|
||||
Webpage: https://revpimodio.org/
|
||||
|
||||
Stellt Klassen fuer die einfache Verwendung des Revolution Pis der
|
||||
Kunbus GmbH (https://revolution.kunbus.de/) zur Verfuegung. Alle I/Os werden
|
||||
aus der piCtory Konfiguration eingelesen und mit deren Namen direkt zugreifbar
|
||||
gemacht. Fuer Gateways sind eigene IOs ueber mehrere Bytes konfigurierbar
|
||||
Mit den definierten Namen greift man direkt auf die gewuenschten Daten zu.
|
||||
Auf alle IOs kann der Benutzer Funktionen als Events registrieren. Diese
|
||||
fuehrt das Modul bei Datenaenderung aus.
|
||||
"""
|
||||
__all__ = [
|
||||
"IOEvent",
|
||||
"RevPiModIO", "RevPiModIODriver", "RevPiModIOSelected", "run_plc",
|
||||
"RevPiNetIO", "RevPiNetIODriver", "RevPiNetIOSelected",
|
||||
"Cycletools", "EventCallback",
|
||||
"ProductType", "AIO", "COMPACT", "DI", "DO", "DIO", "FLAT", "MIO",
|
||||
]
|
||||
__author__ = "Sven Sager <akira@revpimodio.org>"
|
||||
__copyright__ = "Copyright (C) 2023 Sven Sager"
|
||||
__license__ = "LGPLv3"
|
||||
__name__ = "revpimodio2"
|
||||
__version__ = "2.6.0rc2"
|
||||
|
||||
from ._internal import *
|
||||
from .helper import Cycletools, EventCallback
|
||||
from .io import IOEvent
|
||||
from .modio import RevPiModIO, RevPiModIODriver, RevPiModIOSelected, run_plc
|
||||
from .netio import RevPiNetIO, RevPiNetIODriver, RevPiNetIOSelected
|
||||
from .pictory import ProductType, AIO, COMPACT, DI, DO, DIO, FLAT, MIO
|
||||
@@ -1,28 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Stellt alle Klassen fuer den RevolutionPi zur Verfuegung.
|
||||
|
||||
Webpage: https://revpimodio.org/
|
||||
|
||||
Stellt Klassen fuer die einfache Verwendung des Revolution Pis der
|
||||
Kunbus GmbH (https://revolution.kunbus.de/) zur Verfuegung. Alle I/Os werden
|
||||
aus der piCtory Konfiguration eingelesen und mit deren Namen direkt zugreifbar
|
||||
gemacht. Fuer Gateways sind eigene IOs ueber mehrere Bytes konfigurierbar
|
||||
Mit den definierten Namen greift man direkt auf die gewuenschten Daten zu.
|
||||
Auf alle IOs kann der Benutzer Funktionen als Events registrieren. Diese
|
||||
fuehrt das Modul bei Datenaenderung aus.
|
||||
"""
|
||||
__all__ = [
|
||||
"RevPiModIO", "RevPiModIODriver", "RevPiModIOSelected", "run_plc",
|
||||
"RevPiNetIO", "RevPiNetIODriver", "RevPiNetIOSelected",
|
||||
"Cycletools", "EventCallback",
|
||||
"ProductType", "AIO", "COMPACT", "DI", "DO", "DIO", "FLAT", "MIO",
|
||||
]
|
||||
__author__ = "Sven Sager <akira@revpimodio.org>"
|
||||
__copyright__ = "Copyright (C) 2020 Sven Sager"
|
||||
__license__ = "LGPLv3"
|
||||
__name__ = "revpimodio2"
|
||||
__version__ = "2.6.0rc1"
|
||||
"""Internal functions and values for this package."""
|
||||
__author__ = "Sven Sager"
|
||||
__copyright__ = "Copyright (C) 2023 Sven Sager"
|
||||
__license__ = "GPLv3"
|
||||
|
||||
# Global package values
|
||||
OFF = 0
|
||||
@@ -37,12 +17,6 @@ MEM = 302
|
||||
PROCESS_IMAGE_SIZE = 4096
|
||||
|
||||
|
||||
class DeviceNotFoundError(Exception):
|
||||
"""Fehler wenn ein Device nicht gefunden wird."""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
def acheck(check_type, **kwargs) -> None:
|
||||
"""
|
||||
Check type of given arguments.
|
||||
@@ -93,10 +67,3 @@ def consttostr(value) -> str:
|
||||
return "MEM"
|
||||
else:
|
||||
return ""
|
||||
|
||||
|
||||
# Benötigte Klassen importieren
|
||||
from .pictory import ProductType, AIO, COMPACT, DI, DO, DIO, FLAT, MIO
|
||||
from .helper import Cycletools, EventCallback
|
||||
from .modio import RevPiModIO, RevPiModIODriver, RevPiModIOSelected, run_plc
|
||||
from .netio import RevPiNetIO, RevPiNetIODriver, RevPiNetIOSelected
|
||||
@@ -1,11 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""Bildet die App Sektion von piCtory ab."""
|
||||
from time import strptime
|
||||
|
||||
__author__ = "Sven Sager"
|
||||
__copyright__ = "Copyright (C) 2020 Sven Sager"
|
||||
__copyright__ = "Copyright (C) 2023 Sven Sager"
|
||||
__license__ = "LGPLv3"
|
||||
|
||||
from time import strptime
|
||||
|
||||
|
||||
class App(object):
|
||||
"""Bildet die App Sektion der config.rsc ab."""
|
||||
@@ -1,13 +1,15 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""Modul fuer die Verwaltung der Devices."""
|
||||
__author__ = "Sven Sager"
|
||||
__copyright__ = "Copyright (C) 2021 Sven Sager"
|
||||
__copyright__ = "Copyright (C) 2023 Sven Sager"
|
||||
__license__ = "LGPLv3"
|
||||
|
||||
import warnings
|
||||
from threading import Event, Lock, Thread
|
||||
|
||||
from ._internal import INP, OUT, MEM, PROCESS_IMAGE_SIZE
|
||||
from .helper import ProcimgWriter
|
||||
from .io import IOBase, IntIO, IntIOCounter, IntIOReplaceable, MemIO
|
||||
from .pictory import ProductType
|
||||
|
||||
|
||||
@@ -1538,8 +1540,3 @@ class Virtual(Gateway):
|
||||
|
||||
self._filelock.release()
|
||||
return workokay
|
||||
|
||||
|
||||
# Nachträglicher Import
|
||||
from .io import IOBase, IntIO, IntIOCounter, IntIOReplaceable, MemIO
|
||||
from revpimodio2 import INP, OUT, MEM, PROCESS_IMAGE_SIZE
|
||||
13
src/revpimodio2/errors.py
Normal file
13
src/revpimodio2/errors.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""Error classes of RevPiModIO."""
|
||||
__author__ = "Sven Sager"
|
||||
__copyright__ = "Copyright (C) 2023 Sven Sager"
|
||||
__license__ = "LGPLv3"
|
||||
|
||||
|
||||
class RevPiModIOError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class DeviceNotFoundError(RevPiModIOError):
|
||||
pass
|
||||
@@ -1,5 +1,9 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""RevPiModIO Helperklassen und Tools."""
|
||||
__author__ = "Sven Sager"
|
||||
__copyright__ = "Copyright (C) 2023 Sven Sager"
|
||||
__license__ = "LGPLv3"
|
||||
|
||||
import queue
|
||||
import warnings
|
||||
from math import ceil
|
||||
@@ -7,12 +11,8 @@ from threading import Event, Lock, Thread
|
||||
from time import sleep
|
||||
from timeit import default_timer
|
||||
|
||||
from revpimodio2 import BOTH, FALLING, RISING
|
||||
from revpimodio2.io import IOBase
|
||||
|
||||
__author__ = "Sven Sager"
|
||||
__copyright__ = "Copyright (C) 2020 Sven Sager"
|
||||
__license__ = "LGPLv3"
|
||||
from ._internal import RISING, FALLING, BOTH
|
||||
from .io import IOBase
|
||||
|
||||
|
||||
class EventCallback(Thread):
|
||||
@@ -1,15 +1,15 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""RevPiModIO Modul fuer die Verwaltung der IOs."""
|
||||
__author__ = "Sven Sager"
|
||||
__copyright__ = "Copyright (C) 2023 Sven Sager"
|
||||
__license__ = "LGPLv3"
|
||||
|
||||
import struct
|
||||
from re import match as rematch
|
||||
from threading import Event
|
||||
|
||||
from revpimodio2 import BOTH, FALLING, INP, MEM, OUT, RISING, consttostr, \
|
||||
PROCESS_IMAGE_SIZE
|
||||
|
||||
__author__ = "Sven Sager"
|
||||
__copyright__ = "Copyright (C) 2020 Sven Sager"
|
||||
__license__ = "LGPLv3"
|
||||
from ._internal import consttostr, RISING, FALLING, BOTH, INP, OUT, \
|
||||
MEM, PROCESS_IMAGE_SIZE
|
||||
|
||||
try:
|
||||
# Funktioniert nur auf Unix
|
||||
@@ -209,10 +209,9 @@ class IOList(object):
|
||||
if io._defaultvalue is None:
|
||||
# Nur bei StructIO und keiner gegebenen defaultvalue übernehmen
|
||||
if io._bitshift:
|
||||
io_byte_address = io._parentio_address - io.address
|
||||
io._defaultvalue = bool(
|
||||
io._parentio_defaultvalue[
|
||||
io._parentio_address - io.address
|
||||
] & io._bitshift
|
||||
io._parentio_defaultvalue[io_byte_address] & io._bitshift
|
||||
)
|
||||
else:
|
||||
io._defaultvalue = calc_defaultvalue
|
||||
@@ -294,7 +293,8 @@ class IOBase(object):
|
||||
"_export", "_iotype", "_length", "_name", "_parentdevice", \
|
||||
"_read_only_io", "_signed", "_slc_address", "bmk"
|
||||
|
||||
def __init__(self, parentdevice, valuelist: list, iotype: int, byteorder: str, signed: bool):
|
||||
def __init__(self, parentdevice, valuelist: list, iotype: int,
|
||||
byteorder: str, signed: bool):
|
||||
"""
|
||||
Instantiierung der IOBase-Klasse.
|
||||
|
||||
@@ -428,7 +428,8 @@ class IOBase(object):
|
||||
"""
|
||||
return self._name
|
||||
|
||||
def __reg_xevent(self, func, delay: int, edge: int, as_thread: bool, overwrite: bool, prefire: bool) -> None:
|
||||
def __reg_xevent(self, func, delay: int, edge: int, as_thread: bool,
|
||||
overwrite: bool, prefire: bool) -> None:
|
||||
"""
|
||||
Verwaltet reg_event und reg_timerevent.
|
||||
|
||||
@@ -1043,8 +1044,9 @@ class IntIOCounter(IntIO):
|
||||
# Deviceposition + leer + Counter_ID
|
||||
# ID-Bits: 7|6|5|4|3|2|1|0|15|14|13|12|11|10|9|8
|
||||
self.__ioctl_arg = \
|
||||
parentdevice._position.to_bytes(1, "little") + b'\x00' + \
|
||||
(1 << counter_id).to_bytes(2, "little")
|
||||
parentdevice._position.to_bytes(1, "little") \
|
||||
+ b'\x00' \
|
||||
+ (1 << counter_id).to_bytes(2, "little")
|
||||
|
||||
"""
|
||||
IOCTL fuellt dieses struct, welches durch padding im Speicher nach
|
||||
@@ -1,5 +1,9 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""RevPiModIO Hauptklasse fuer piControl0 Zugriff."""
|
||||
__author__ = "Sven Sager"
|
||||
__copyright__ = "Copyright (C) 2023 Sven Sager"
|
||||
__license__ = "LGPLv3"
|
||||
|
||||
import warnings
|
||||
from configparser import ConfigParser
|
||||
from json import load as jload
|
||||
@@ -12,12 +16,14 @@ from stat import S_ISCHR
|
||||
from threading import Event, Lock, Thread
|
||||
from timeit import default_timer
|
||||
|
||||
from revpimodio2 import BOTH, DeviceNotFoundError, FALLING, RISING, acheck
|
||||
|
||||
__author__ = "Sven Sager"
|
||||
__copyright__ = "Copyright (C) 2020 Sven Sager"
|
||||
__license__ = "LGPLv3"
|
||||
|
||||
from . import app as appmodule
|
||||
from . import device as devicemodule
|
||||
from . import helper as helpermodule
|
||||
from . import summary as summarymodule
|
||||
from ._internal import acheck, RISING, FALLING, BOTH
|
||||
from .errors import DeviceNotFoundError
|
||||
from .io import IOList
|
||||
from .io import StructIO
|
||||
from .pictory import ProductType
|
||||
|
||||
|
||||
@@ -33,14 +39,16 @@ class RevPiModIO(object):
|
||||
Device Positionen oder Device Namen.
|
||||
"""
|
||||
|
||||
__slots__ = "__cleanupfunc", "_autorefresh", "_buffedwrite", "_exit_level", \
|
||||
"_configrsc", "_shared_procimg", "_exit", "_imgwriter", "_ioerror", \
|
||||
__slots__ = "__cleanupfunc", \
|
||||
"_autorefresh", "_buffedwrite", "_configrsc", "_debug", \
|
||||
"_exit", "_exit_level", "_imgwriter", "_ioerror", \
|
||||
"_length", "_looprunning", "_lst_devselect", "_lst_refresh", \
|
||||
"_lst_shared", \
|
||||
"_maxioerrors", "_myfh", "_myfh_lck", "_monitoring", "_procimg", \
|
||||
"_simulator", "_syncoutputs", "_th_mainloop", "_waitexit", \
|
||||
"core", "app", "device", "exitsignal", "io", "summary", "_debug", \
|
||||
"_replace_io_file", "_run_on_pi"
|
||||
"_maxioerrors", "_monitoring", "_myfh", "_myfh_lck", \
|
||||
"_procimg", "_replace_io_file", "_run_on_pi", \
|
||||
"_set_device_based_cycle_time", "_simulator", "_shared_procimg", \
|
||||
"_syncoutputs", "_th_mainloop", "_waitexit", \
|
||||
"app", "core", "device", "exitsignal", "io", "summary"
|
||||
|
||||
def __init__(
|
||||
self, autorefresh=False, monitoring=False, syncoutputs=True,
|
||||
@@ -81,6 +89,7 @@ class RevPiModIO(object):
|
||||
self._configrsc = configrsc
|
||||
self._monitoring = monitoring
|
||||
self._procimg = "/dev/piControl0" if procimg is None else procimg
|
||||
self._set_device_based_cycle_time = True
|
||||
self._simulator = simulator
|
||||
self._shared_procimg = shared_procimg or direct_output
|
||||
self._syncoutputs = syncoutputs
|
||||
@@ -333,8 +342,8 @@ class RevPiModIO(object):
|
||||
# ImgWriter erstellen
|
||||
self._imgwriter = helpermodule.ProcimgWriter(self)
|
||||
|
||||
if self._set_device_based_cycle_time:
|
||||
# Refreshzeit CM1 25 Hz / CM3 50 Hz
|
||||
if not isinstance(self, RevPiNetIO):
|
||||
self._imgwriter.refresh = 20 if cpu_count() > 1 else 40
|
||||
|
||||
# Aktuellen Outputstatus von procimg einlesen
|
||||
@@ -1446,13 +1455,4 @@ def run_plc(
|
||||
rpi.handlesignalend()
|
||||
return rpi.cycleloop(func, cycletime)
|
||||
|
||||
|
||||
# Nachträglicher Import
|
||||
from . import app as appmodule
|
||||
from . import device as devicemodule
|
||||
from . import helper as helpermodule
|
||||
from . import summary as summarymodule
|
||||
from .io import IOList
|
||||
from .io import StructIO
|
||||
|
||||
from .netio import RevPiNetIODriver, RevPiNetIO
|
||||
from .netio import RevPiNetIODriver
|
||||
@@ -1,5 +1,9 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""RevPiModIO Hauptklasse fuer Netzwerkzugriff."""
|
||||
__author__ = "Sven Sager"
|
||||
__copyright__ = "Copyright (C) 2023 Sven Sager"
|
||||
__license__ = "LGPLv3"
|
||||
|
||||
import socket
|
||||
import warnings
|
||||
from configparser import ConfigParser
|
||||
@@ -8,14 +12,10 @@ from re import compile
|
||||
from struct import pack, unpack
|
||||
from threading import Event, Lock, Thread
|
||||
|
||||
from revpimodio2 import DeviceNotFoundError
|
||||
from .device import Device
|
||||
from .errors import DeviceNotFoundError
|
||||
from .modio import RevPiModIO as _RevPiModIO
|
||||
|
||||
__author__ = "Sven Sager"
|
||||
__copyright__ = "Copyright (C) 2020 Sven Sager"
|
||||
__license__ = "LGPLv3"
|
||||
|
||||
# Synchronisierungsbefehl
|
||||
_syssync = b'\x01\x06\x16\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17'
|
||||
# Disconnectbefehl
|
||||
@@ -344,7 +344,9 @@ class NetFH(Thread):
|
||||
# b CM ii ii 00000000 b = 16
|
||||
buff = self._direct_sr(pack(
|
||||
"=c2sHH8xc",
|
||||
HEADER_START, b'FD', self.__int_buff, len(self.__by_buff), HEADER_STOP
|
||||
HEADER_START,
|
||||
b'FD', self.__int_buff, len(self.__by_buff),
|
||||
HEADER_STOP
|
||||
) + self.__by_buff, 1)
|
||||
except Exception:
|
||||
raise
|
||||
@@ -663,9 +665,10 @@ class NetFH(Thread):
|
||||
self.__int_buff += 1
|
||||
|
||||
# Datenblock mit Position und Länge in Puffer ablegen
|
||||
self.__by_buff += self.__position.to_bytes(length=2, byteorder="little") + \
|
||||
len(bytebuff).to_bytes(length=2, byteorder="little") + \
|
||||
bytebuff
|
||||
self.__by_buff += \
|
||||
self.__position.to_bytes(length=2, byteorder="little") \
|
||||
+ len(bytebuff).to_bytes(length=2, byteorder="little") \
|
||||
+ bytebuff
|
||||
|
||||
# TODO: Bufferlänge und dann flushen?
|
||||
|
||||
@@ -760,6 +763,7 @@ class RevPiNetIO(_RevPiModIO):
|
||||
shared_procimg=shared_procimg,
|
||||
direct_output=direct_output,
|
||||
)
|
||||
self._set_device_based_cycle_time = False
|
||||
|
||||
# Netzwerkfilehandler anlegen
|
||||
self._myfh = self._create_myfh()
|
||||
@@ -1,8 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""Pictory aliases for IO values."""
|
||||
|
||||
__author__ = "Théo Rozier"
|
||||
__copyright__ = "Copyright (C) 2020 Sven Sager"
|
||||
__copyright__ = "Copyright (C) 2023 Sven Sager"
|
||||
__license__ = "LGPLv3"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""Bildet die Summary-Sektion von piCtory ab."""
|
||||
__author__ = "Sven Sager"
|
||||
__copyright__ = "Copyright (C) 2020 Sven Sager"
|
||||
__copyright__ = "Copyright (C) 2023 Sven Sager"
|
||||
__license__ = "LGPLv3"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user