mirror of
https://github.com/naruxde/revpimodio2.git
synced 2025-11-08 13:53:53 +01:00
Add library const PROCESS_IMAGE_SIZE should it change some day in future.
This commit is contained in:
@@ -33,6 +33,7 @@ BOTH = 33
|
|||||||
INP = 300
|
INP = 300
|
||||||
OUT = 301
|
OUT = 301
|
||||||
MEM = 302
|
MEM = 302
|
||||||
|
PROCESS_IMAGE_SIZE = 4096
|
||||||
|
|
||||||
|
|
||||||
class DeviceNotFoundError(Exception):
|
class DeviceNotFoundError(Exception):
|
||||||
|
|||||||
@@ -298,7 +298,7 @@ class Device(object):
|
|||||||
if len(dict_io) <= 0:
|
if len(dict_io) <= 0:
|
||||||
return slice(0, 0)
|
return slice(0, 0)
|
||||||
|
|
||||||
int_min, int_max = 4096, 0
|
int_min, int_max = PROCESS_IMAGE_SIZE, 0
|
||||||
for key in sorted(dict_io, key=lambda x: int(x)):
|
for key in sorted(dict_io, key=lambda x: int(x)):
|
||||||
|
|
||||||
# Neuen IO anlegen
|
# Neuen IO anlegen
|
||||||
@@ -1273,4 +1273,4 @@ class Virtual(Gateway):
|
|||||||
|
|
||||||
# Nachträglicher Import
|
# Nachträglicher Import
|
||||||
from .io import IOBase, IntIO, IntIOCounter, IntIOReplaceable, MemIO
|
from .io import IOBase, IntIO, IntIOCounter, IntIOReplaceable, MemIO
|
||||||
from revpimodio2 import INP, OUT, MEM
|
from revpimodio2 import INP, OUT, MEM, PROCESS_IMAGE_SIZE
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ import struct
|
|||||||
from re import match as rematch
|
from re import match as rematch
|
||||||
from threading import Event
|
from threading import Event
|
||||||
|
|
||||||
from revpimodio2 import BOTH, FALLING, INP, MEM, OUT, RISING, consttostr
|
from revpimodio2 import BOTH, FALLING, INP, MEM, OUT, RISING, consttostr, \
|
||||||
|
PROCESS_IMAGE_SIZE
|
||||||
|
|
||||||
__author__ = "Sven Sager"
|
__author__ = "Sven Sager"
|
||||||
__copyright__ = "Copyright (C) 2018 Sven Sager"
|
__copyright__ = "Copyright (C) 2018 Sven Sager"
|
||||||
@@ -37,7 +38,7 @@ class IOList(object):
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
"""Init IOList class."""
|
"""Init IOList class."""
|
||||||
self.__dict_iobyte = {k: [] for k in range(4096)}
|
self.__dict_iobyte = {k: [] for k in range(PROCESS_IMAGE_SIZE)}
|
||||||
self.__dict_iorefname = {}
|
self.__dict_iorefname = {}
|
||||||
|
|
||||||
def __contains__(self, key):
|
def __contains__(self, key):
|
||||||
|
|||||||
Reference in New Issue
Block a user