The LED colors for the A1-A5 objects of the .core class of the connect 4
did not match the values of the constants for GREEN and RED, as on all
other RevPi Devices. In addition, the color BLUE was added.
The context managers tried to write to the process image in
monitoring=True mode. This is not allowed and the application crashed
with an error.
Signed-off-by: Sven Sager <akira@narux.de>
When leaving the IO context manager, the loop flag was not reset
properly. The context manager could therefore only be traversed once.
Signed-off-by: Sven Sager <akira@narux.de>
This adds the RO device as its own class. The RO device has a special
ioctl function, via which the switching cycles of the relays can be
called up. Relay outputs from the RO device get the additional
attribute 'cycles', which returns the number of switching cycles.
The implementation via RevPiNetIO classes cannot currently be
implemented because the server does not support a return value.
Signed-off-by: Sven Sager <akira@narux.de>
When applying the PiCtory configuration, all IOs are now checked to
see if they overlap with the previous ones. If an overlap is
detected, the IO is ignored and a warning is given to the user.
Signed-off-by: Sven Sager <akira@narux.de>
In the event of a misconfiguration in PiCtory, it may happen that the
offset values are given as floating point numbers. These devices and
their IOs must ignore ModiO that it cannot be ensured which offset
is correct.
Signed-off-by: Sven Sager <akira@narux.de>
The RevPiModIO parameter 'direct_output' was replaced by
'shared_procimg' in the commit c11b435 from 2020-08-08. Users have
received a DepricatedWarning since then. With the upcoming version,
this parameter will be completely deleted.
Refs: c11b435
Signed-off-by: Sven Sager <akira@narux.de>
On February 3, the project was placed under the LGPLv2 license, with
the consent of all contributors. Unfortunately, an incorrect version
of the license was inserted into the LICENSE.txt. This is now fixed
with the text of the LGPLv2, which has been valid for RevPiModIO2
since version 2.6.0.
Refs: 7d482d49
Signed-off-by: Sven Sager <akira@narux.de>
If the IOs cannot be written quickly enough by the ProcimgWriter,
this indicates high system utilization. The cycle function itself
would trigger a different message through the lck_refresh lock.
Signed-off-by: Sven Sager <akira@narux.de>
When using `autofresh` in combination with `shared_procimg`, the
outputs were written to the process image, but kept with old values
in the local buffer. A query to a set output could therefore display
an incorrect value under certain circumstances.
Closes: #25
Signed-off-by: Sven Sager <akira@narux.de>
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>
Fixes the bug that with automatic process image update and
shared_procimg, outputs of devices are also written without automatic
update enabled.
Signed-off-by: Sven Sager <akira@narux.de>
In sets, elements can only occur once. Therefore, no `if` statement
has to check whether the element is already included in the list.
Signed-off-by: Sven Sager <akira@narux.de>
When switching to the modular approach, the addresses of a core were
accidentally adopted as a global configuration.
Signed-off-by: Sven Sager <akira@narux.de>
Measure each cycle of process image synchronisation and do not build a mean value for that.
The cycle function is now exactly timed, even if the individual runtimes are different.
If shared_procimg=True, ModIO wrote the new set values directly to the process
image without cycle sync mechanisms. As a result, the IOs could change status
several times within the cycleloop, which is wrong.
User has to use maxioerrors = n, if the program should crash on process
image errors.
If the ProcimgWriter helper is running but get no new data for 2500 ms,
the cycleloop will print just a warning. Cycle function is paused for
that time. Most interesting for RevPi NET classes.
You can detect changes of IO values between two cycles. The function will
return True or False.
On bit IO objects you can also use parameter edge RISING or FALLING.