mirror of
https://github.com/naruxde/revpimodio2.git
synced 2025-11-08 22:03:53 +01:00
fix: Set shared_procimg value is stored in the device
Classes have accessed a global shared_procimg value during instantiation. However, this value is managed directly for each device individually. There can be no global value. Signed-off-by: Sven Sager <akira@narux.de>
This commit is contained in:
@@ -156,7 +156,6 @@ class Device(object):
|
|||||||
self._selfupdate = False
|
self._selfupdate = False
|
||||||
self._shared_procimg = False
|
self._shared_procimg = False
|
||||||
self._shared_write = set()
|
self._shared_write = set()
|
||||||
self.shared_procimg(parentmodio._shared_procimg) # Set with register
|
|
||||||
|
|
||||||
# Wertzuweisung aus dict_device
|
# Wertzuweisung aus dict_device
|
||||||
self._name = dict_device.get("name")
|
self._name = dict_device.get("name")
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class RevPiModIO(object):
|
|||||||
"_length", "_looprunning", "_lst_devselect", "_lst_refresh", \
|
"_length", "_looprunning", "_lst_devselect", "_lst_refresh", \
|
||||||
"_maxioerrors", "_monitoring", "_myfh", "_myfh_lck", \
|
"_maxioerrors", "_monitoring", "_myfh", "_myfh_lck", \
|
||||||
"_procimg", "_replace_io_file", "_run_on_pi", \
|
"_procimg", "_replace_io_file", "_run_on_pi", \
|
||||||
"_set_device_based_cycle_time", "_simulator", "_shared_procimg", \
|
"_set_device_based_cycle_time", "_simulator", "_init_shared_procimg", \
|
||||||
"_syncoutputs", "_th_mainloop", "_waitexit", \
|
"_syncoutputs", "_th_mainloop", "_waitexit", \
|
||||||
"app", "core", "device", "exitsignal", "io", "summary"
|
"app", "core", "device", "exitsignal", "io", "summary"
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ class RevPiModIO(object):
|
|||||||
self._procimg = "/dev/piControl0" if procimg is None else procimg
|
self._procimg = "/dev/piControl0" if procimg is None else procimg
|
||||||
self._set_device_based_cycle_time = True
|
self._set_device_based_cycle_time = True
|
||||||
self._simulator = simulator
|
self._simulator = simulator
|
||||||
self._shared_procimg = shared_procimg or direct_output
|
self._init_shared_procimg = shared_procimg or direct_output
|
||||||
self._syncoutputs = syncoutputs
|
self._syncoutputs = syncoutputs
|
||||||
|
|
||||||
# TODO: bei simulator und procimg prüfen ob datei existiert / anlegen?
|
# TODO: bei simulator und procimg prüfen ob datei existiert / anlegen?
|
||||||
@@ -363,6 +363,9 @@ class RevPiModIO(object):
|
|||||||
err_names_check[dev_new.name] = []
|
err_names_check[dev_new.name] = []
|
||||||
err_names_check[dev_new.name].append(str(dev_new.position))
|
err_names_check[dev_new.name].append(str(dev_new.position))
|
||||||
|
|
||||||
|
# Set shared_procimg mode, if requested on instantiation
|
||||||
|
dev_new.shared_procimg(self._init_shared_procimg)
|
||||||
|
|
||||||
# DeviceList für direkten Zugriff aufbauen
|
# DeviceList für direkten Zugriff aufbauen
|
||||||
setattr(self.device, dev_new.name, dev_new)
|
setattr(self.device, dev_new.name, dev_new)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user