Bugfix in io Module

This commit is contained in:
2017-08-15 12:13:47 +02:00
parent d733038563
commit ddc93c9b9e
4 changed files with 16 additions and 8 deletions

View File

@@ -17,3 +17,7 @@ glob:cur
glob:tmp glob:tmp
glob:__pycache__ glob:__pycache__
glob:**.DS_Store glob:**.DS_Store
syntax: glob
test/*
deb/*
dist/*

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Project SYSTEM "Project-5.1.dtd"> <!DOCTYPE Project SYSTEM "Project-5.1.dtd">
<!-- eric project file for project revpimodio2 --> <!-- eric project file for project revpimodio2 -->
<!-- Saved: 2017-08-14, 16:08:00 --> <!-- Saved: 2017-08-15, 08:04:54 -->
<!-- Copyright (C) 2017 Sven Sager, akira@narux.de --> <!-- Copyright (C) 2017 Sven Sager, akira@narux.de -->
<Project version="5.1"> <Project version="5.1">
<Language>en_US</Language> <Language>en_US</Language>
@@ -22,6 +22,9 @@
<Source>revpimodio2/__init__.py</Source> <Source>revpimodio2/__init__.py</Source>
<Source>revpimodio2/device.py</Source> <Source>revpimodio2/device.py</Source>
<Source>revpimodio2/helper.py</Source> <Source>revpimodio2/helper.py</Source>
<Source>test/test_dio_while2.py</Source>
<Source>test/test_dio_mainloop.py</Source>
<Source>test/test_dio_cycleloop.py</Source>
</Sources> </Sources>
<Forms/> <Forms/>
<Translations/> <Translations/>

View File

@@ -529,7 +529,7 @@ class IOBase(object):
return -1 return -1
# WaitExit Event säubern # WaitExit Event säubern
self._parentdevice._parent._waitexit.clear() self._parentdevice._modio._waitexit.clear()
val_start = self.value val_start = self.value
timeout = timeout / 1000 timeout = timeout / 1000
@@ -538,12 +538,12 @@ class IOBase(object):
exitevent = Event() exitevent = Event()
flt_timecount = 0 if bool_timecount else -1 flt_timecount = 0 if bool_timecount else -1
while not self._parentdevice._parent._waitexit.is_set() \ while not self._parentdevice._modio._waitexit.is_set() \
and not exitevent.is_set() \ and not exitevent.is_set() \
and flt_timecount < timeout: and flt_timecount < timeout:
if self._parentdevice._parent.imgwriter.newdata.wait(2.5): if self._parentdevice._modio._imgwriter.newdata.wait(2.5):
self._parentdevice._parent.imgwriter.newdata.clear() self._parentdevice._modio._imgwriter.newdata.clear()
if val_start != self.value: if val_start != self.value:
if edge == BOTH \ if edge == BOTH \
@@ -554,7 +554,7 @@ class IOBase(object):
val_start = not val_start val_start = not val_start
if bool_timecount: if bool_timecount:
flt_timecount += \ flt_timecount += \
self._parentdevice._parent.imgwriter._refresh self._parentdevice._modio._imgwriter._refresh
elif bool_timecount: elif bool_timecount:
# TODO: Prüfen # TODO: Prüfen
flt_timecount += 1 flt_timecount += 1
@@ -564,7 +564,7 @@ class IOBase(object):
return 1 return 1
# RevPiModIO mainloop wurde verlassen # RevPiModIO mainloop wurde verlassen
if self._parentdevice._parent._waitexit.is_set(): if self._parentdevice._modio._waitexit.is_set():
return 100 return 100
# Timeout abgelaufen # Timeout abgelaufen

View File

@@ -197,7 +197,7 @@ class RevPiModIO(object):
delattr(self.device, errdev) delattr(self.device, errdev)
warnings.warn( warnings.warn(
"equal device name in pictory configuration. can not " "equal device name in pictory configuration. can not "
"build device to acces by name. you can access all devices " "build device to access by name. you can access all devices "
"by position number .device[nn] only!", "by position number .device[nn] only!",
Warning Warning
) )
@@ -378,6 +378,7 @@ class RevPiModIO(object):
dev._selfupdate = False dev._selfupdate = False
if not self._monitoring: if not self._monitoring:
self.writeprocimg(True, dev) self.writeprocimg(True, dev)
self._looprunning = False
def get_jconfigrsc(self): def get_jconfigrsc(self):
"""Laed die piCotry Konfiguration und erstellt ein dict(). """Laed die piCotry Konfiguration und erstellt ein dict().