The old behavior was the return of the maximum value. However, this can
also be a valid value. Now all positive values are valid and a negative
value of -1 describes an error in the query.
close#37
Signed-off-by: Sven Sager <akira@narux.de>
Due to the new firmware 1.10 on the MIO module, the GPIOs that were
configured as counters can now also be reset to 0. With this change,
the .reset() function in RevPiModIO is added to the respective counter
IOs.
Cleaned up excessive indentation and unnecessary spacing in docstrings
and comments across multiple files to improve code readability and
maintain consistency.
Signed-off-by: Sven Sager <akira@narux.de>
Reformatted docstrings across device.py, helper.py, and io.py to honor
the 100 character line width limit, improving readability and
consistency with project formatting standards.
Replaced German terms with English equivalents:
- Zustand → state
- vom → of the
- Ausgang → output
- Sekunden → seconds
- toggeln → toggle
- from → off
- gruen → green
- rot/root → red
- blau → blue
Translate all inline comments, docstrings, and documentation from German to English across the codebase to improve accessibility for international developers.
Fixes#27
Signed-off-by: Nicolai Buchwitz <n.buchwitz@kunbus.com>
This context manager can delete the entire instance of ModIO when using
`with rpi:` after creating an instance of ModIO by
`rpi = revpimodio.RevPiModIO(...)`.
On the Connect 4, the hardware watchdog was removed from the process
image by KUNBUS. To use the hardware watchdog, other functions must now
be used that are not implemented by RevPiModIO.
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.
Updating parameter value of the object x2out of the "class Connect4",
from "self._slc_led" to "self._slc_output". Also updating the position
of the bit in "_slc_output" from 6 to 0!
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>
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>