mirror of
https://github.com/naruxde/revpimodio2.git
synced 2025-11-08 13:53:53 +01:00
Bugfix: Set A1 - A5 LED did not work with shared_procimg=True
This commit is contained in:
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -3,7 +3,7 @@
|
|||||||
<component name="JavaScriptSettings">
|
<component name="JavaScriptSettings">
|
||||||
<option name="languageLevel" value="ES6" />
|
<option name="languageLevel" value="ES6" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6" project-jdk-type="Python SDK" />
|
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8" project-jdk-type="Python SDK" />
|
||||||
<component name="PythonCompatibilityInspectionAdvertiser">
|
<component name="PythonCompatibilityInspectionAdvertiser">
|
||||||
<option name="version" value="3" />
|
<option name="version" value="3" />
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
2
.idea/revpimodio2.iml
generated
2
.idea/revpimodio2.iml
generated
@@ -2,7 +2,7 @@
|
|||||||
<module type="PYTHON_MODULE" version="4">
|
<module type="PYTHON_MODULE" version="4">
|
||||||
<component name="NewModuleRootManager">
|
<component name="NewModuleRootManager">
|
||||||
<content url="file://$MODULE_DIR$" />
|
<content url="file://$MODULE_DIR$" />
|
||||||
<orderEntry type="jdk" jdkName="Python 3.6" jdkType="Python SDK" />
|
<orderEntry type="jdk" jdkName="Python 3.8" jdkType="Python SDK" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
</component>
|
</component>
|
||||||
<component name="TestRunnerService">
|
<component name="TestRunnerService">
|
||||||
|
|||||||
@@ -675,13 +675,8 @@ class Core(Base):
|
|||||||
:param value: 0=aus, 1=gruen, 2=rot
|
:param value: 0=aus, 1=gruen, 2=rot
|
||||||
"""
|
"""
|
||||||
if 0 <= value <= 3:
|
if 0 <= value <= 3:
|
||||||
proc_value = self._ba_devdata[self._slc_led.start]
|
self.a1green(bool(value & 1))
|
||||||
proc_value_calc = proc_value & 3
|
self.a1red(bool(value & 2))
|
||||||
if proc_value_calc == value:
|
|
||||||
return
|
|
||||||
# Set new value
|
|
||||||
self._ba_devdata[self._slc_led.start] = \
|
|
||||||
proc_value - proc_value_calc + value
|
|
||||||
else:
|
else:
|
||||||
raise ValueError("led status must be between 0 and 3")
|
raise ValueError("led status must be between 0 and 3")
|
||||||
|
|
||||||
@@ -692,14 +687,8 @@ class Core(Base):
|
|||||||
:param value: 0=aus, 1=gruen, 2=rot
|
:param value: 0=aus, 1=gruen, 2=rot
|
||||||
"""
|
"""
|
||||||
if 0 <= value <= 3:
|
if 0 <= value <= 3:
|
||||||
value <<= 2
|
self.a2green(bool(value & 1))
|
||||||
proc_value = self._ba_devdata[self._slc_led.start]
|
self.a2red(bool(value & 2))
|
||||||
proc_value_calc = proc_value & 12
|
|
||||||
if proc_value_calc == value:
|
|
||||||
return
|
|
||||||
# Set new value
|
|
||||||
self._ba_devdata[self._slc_led.start] = \
|
|
||||||
proc_value - proc_value_calc + value
|
|
||||||
else:
|
else:
|
||||||
raise ValueError("led status must be between 0 and 3")
|
raise ValueError("led status must be between 0 and 3")
|
||||||
|
|
||||||
@@ -963,14 +952,8 @@ class Connect(Core):
|
|||||||
:param: value 0=aus, 1=gruen, 2=rot
|
:param: value 0=aus, 1=gruen, 2=rot
|
||||||
"""
|
"""
|
||||||
if 0 <= value <= 3:
|
if 0 <= value <= 3:
|
||||||
value <<= 4
|
self.a3green(bool(value & 1))
|
||||||
proc_value = self._ba_devdata[self._slc_led.start]
|
self.a3red(bool(value & 2))
|
||||||
proc_value_calc = proc_value & 48
|
|
||||||
if proc_value_calc == value:
|
|
||||||
return
|
|
||||||
# Set new value
|
|
||||||
self._ba_devdata[self._slc_led.start] = \
|
|
||||||
proc_value - proc_value_calc + value
|
|
||||||
else:
|
else:
|
||||||
raise ValueError("led status must be between 0 and 3")
|
raise ValueError("led status must be between 0 and 3")
|
||||||
|
|
||||||
@@ -1102,13 +1085,8 @@ class Compact(Base):
|
|||||||
:param value: 0=aus, 1=gruen, 2=rot
|
:param value: 0=aus, 1=gruen, 2=rot
|
||||||
"""
|
"""
|
||||||
if 0 <= value <= 3:
|
if 0 <= value <= 3:
|
||||||
proc_value = self._ba_devdata[self._slc_led.start]
|
self.a1green(bool(value & 1))
|
||||||
proc_value_calc = proc_value & 3
|
self.a1red(bool(value & 2))
|
||||||
if proc_value_calc == value:
|
|
||||||
return
|
|
||||||
# Set new value
|
|
||||||
self._ba_devdata[self._slc_led.start] = \
|
|
||||||
proc_value - proc_value_calc + value
|
|
||||||
else:
|
else:
|
||||||
raise ValueError("led status must be between 0 and 3")
|
raise ValueError("led status must be between 0 and 3")
|
||||||
|
|
||||||
@@ -1119,14 +1097,8 @@ class Compact(Base):
|
|||||||
:param value: 0=aus, 1=gruen, 2=rot
|
:param value: 0=aus, 1=gruen, 2=rot
|
||||||
"""
|
"""
|
||||||
if 0 <= value <= 3:
|
if 0 <= value <= 3:
|
||||||
value <<= 2
|
self.a2green(bool(value & 1))
|
||||||
proc_value = self._ba_devdata[self._slc_led.start]
|
self.a2red(bool(value & 2))
|
||||||
proc_value_calc = proc_value & 12
|
|
||||||
if proc_value_calc == value:
|
|
||||||
return
|
|
||||||
# Set new value
|
|
||||||
self._ba_devdata[self._slc_led.start] = \
|
|
||||||
proc_value - proc_value_calc + value
|
|
||||||
else:
|
else:
|
||||||
raise ValueError("led status must be between 0 and 3")
|
raise ValueError("led status must be between 0 and 3")
|
||||||
|
|
||||||
@@ -1263,6 +1235,8 @@ class Flat(Base):
|
|||||||
exp_a5red, None, "LED_A5_RED", "9"
|
exp_a5red, None, "LED_A5_RED", "9"
|
||||||
], OUT, "little", False)
|
], OUT, "little", False)
|
||||||
|
|
||||||
|
# todo: Add internal switch and relay, like Connect
|
||||||
|
|
||||||
# Software watchdog einrichten
|
# Software watchdog einrichten
|
||||||
self.wd = IOBase(self, [
|
self.wd = IOBase(self, [
|
||||||
"core.wd", 0, 1, self._slc_led.start,
|
"core.wd", 0, 1, self._slc_led.start,
|
||||||
@@ -1316,13 +1290,8 @@ class Flat(Base):
|
|||||||
:param value: 0=off, 1=green, 2=red
|
:param value: 0=off, 1=green, 2=red
|
||||||
"""
|
"""
|
||||||
if 0 <= value <= 3:
|
if 0 <= value <= 3:
|
||||||
proc_value = self._ba_devdata[self._slc_led.start]
|
self.a1green(bool(value & 1))
|
||||||
proc_value_calc = proc_value & 0b11
|
self.a1red(bool(value & 2))
|
||||||
if proc_value_calc == value:
|
|
||||||
return
|
|
||||||
# Set new value
|
|
||||||
self._ba_devdata[self._slc_led.start] = \
|
|
||||||
proc_value - proc_value_calc + value
|
|
||||||
else:
|
else:
|
||||||
raise ValueError("led status must be between 0 and 3")
|
raise ValueError("led status must be between 0 and 3")
|
||||||
|
|
||||||
@@ -1333,14 +1302,8 @@ class Flat(Base):
|
|||||||
:param value: 0=off, 1=green, 2=red
|
:param value: 0=off, 1=green, 2=red
|
||||||
"""
|
"""
|
||||||
if 0 <= value <= 3:
|
if 0 <= value <= 3:
|
||||||
value <<= 2
|
self.a2green(bool(value & 1))
|
||||||
proc_value = self._ba_devdata[self._slc_led.start]
|
self.a2red(bool(value & 2))
|
||||||
proc_value_calc = proc_value & 0b1100
|
|
||||||
if proc_value_calc == value:
|
|
||||||
return
|
|
||||||
# Set new value
|
|
||||||
self._ba_devdata[self._slc_led.start] = \
|
|
||||||
proc_value - proc_value_calc + value
|
|
||||||
else:
|
else:
|
||||||
raise ValueError("led status must be between 0 and 3")
|
raise ValueError("led status must be between 0 and 3")
|
||||||
|
|
||||||
@@ -1351,14 +1314,8 @@ class Flat(Base):
|
|||||||
:param value: 0=off, 1=green, 2=red
|
:param value: 0=off, 1=green, 2=red
|
||||||
"""
|
"""
|
||||||
if 0 <= value <= 3:
|
if 0 <= value <= 3:
|
||||||
value <<= 4
|
self.a3green(bool(value & 1))
|
||||||
proc_value = self._ba_devdata[self._slc_led.start]
|
self.a3red(bool(value & 2))
|
||||||
proc_value_calc = proc_value & 0b110000
|
|
||||||
if proc_value_calc == value:
|
|
||||||
return
|
|
||||||
# Set new value
|
|
||||||
self._ba_devdata[self._slc_led.start] = \
|
|
||||||
proc_value - proc_value_calc + value
|
|
||||||
else:
|
else:
|
||||||
raise ValueError("led status must be between 0 and 3")
|
raise ValueError("led status must be between 0 and 3")
|
||||||
|
|
||||||
@@ -1369,14 +1326,8 @@ class Flat(Base):
|
|||||||
:param value: 0=off, 1=green, 2=red
|
:param value: 0=off, 1=green, 2=red
|
||||||
"""
|
"""
|
||||||
if 0 <= value <= 3:
|
if 0 <= value <= 3:
|
||||||
value <<= 6
|
self.a4green(bool(value & 1))
|
||||||
proc_value = self._ba_devdata[self._slc_led.start]
|
self.a4red(bool(value & 2))
|
||||||
proc_value_calc = proc_value & 0b11000000
|
|
||||||
if proc_value_calc == value:
|
|
||||||
return
|
|
||||||
# Set new value
|
|
||||||
self._ba_devdata[self._slc_led.start] = \
|
|
||||||
proc_value - proc_value_calc + value
|
|
||||||
else:
|
else:
|
||||||
raise ValueError("led status must be between 0 and 3")
|
raise ValueError("led status must be between 0 and 3")
|
||||||
|
|
||||||
@@ -1387,13 +1338,8 @@ class Flat(Base):
|
|||||||
:param value: 0=off, 1=green, 2=red
|
:param value: 0=off, 1=green, 2=red
|
||||||
"""
|
"""
|
||||||
if 0 <= value <= 3:
|
if 0 <= value <= 3:
|
||||||
proc_value = self._ba_devdata[self._slc_led.start + 1]
|
self.a5green(bool(value & 1))
|
||||||
proc_value_calc = proc_value & 0b11
|
self.a5red(bool(value & 2))
|
||||||
if proc_value_calc == value:
|
|
||||||
return
|
|
||||||
# Set new value
|
|
||||||
self._ba_devdata[self._slc_led.start + 1] = \
|
|
||||||
proc_value - proc_value_calc + value
|
|
||||||
else:
|
else:
|
||||||
raise ValueError("led status must be between 0 and 3")
|
raise ValueError("led status must be between 0 and 3")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user