tilt fix
This commit is contained in:
1 parent
b11ca40681
commit
0e22ca0e96
1 file changed
+4
-6
@@ -470,10 +470,8 @@ def calculate_tilt(
|
|||||||
tilt_rad = math.atan2(-dy, dist_horiz)
|
tilt_rad = math.atan2(-dy, dist_horiz)
|
||||||
tilt_deg = math.degrees(tilt_rad)
|
tilt_deg = math.degrees(tilt_rad)
|
||||||
|
|
||||||
# Korrigierte Skalierung: Multiplikator 127.5 für den vollen 270°-Bereich
|
base_tilt = (255.0 - DEFAULT_TILT) if ceiling_mode else float(DEFAULT_TILT)
|
||||||
tilt_dmx = 127.5 + (tilt_deg / (TILT_RANGE_DEG / 2.0)) * 127.5
|
tilt_dmx = base_tilt + (tilt_deg / (TILT_RANGE_DEG / 2.0)) * 127.5
|
||||||
if ceiling_mode:
|
|
||||||
tilt_dmx = 255.0 - tilt_dmx
|
|
||||||
|
|
||||||
return round(max(0.0, min(255.0, tilt_dmx)))
|
return round(max(0.0, min(255.0, tilt_dmx)))
|
||||||
|
|
||||||
@@ -1181,9 +1179,9 @@ def main() -> None:
|
|||||||
elif key in (ord("r"), ord("c")):
|
elif key in (ord("r"), ord("c")):
|
||||||
# Reset-Funktion: Pan/Tilt Default, Tracking Pausiert, Farben/Gobos bleiben
|
# Reset-Funktion: Pan/Tilt Default, Tracking Pausiert, Farben/Gobos bleiben
|
||||||
dmx.set_pan(DEFAULT_PAN)
|
dmx.set_pan(DEFAULT_PAN)
|
||||||
dmx.set_channel(2, 0)
|
|
||||||
dmx.set_tilt(DEFAULT_TILT)
|
dmx.set_tilt(DEFAULT_TILT)
|
||||||
dmx.set_channel(2, 0)
|
dmx.set_channel(3, 0) # Pan Fine zurücksetzen
|
||||||
|
dmx.set_channel(4, 0) # Tilt Fine zurücksetzen
|
||||||
filter_pan.reset(DEFAULT_PAN)
|
filter_pan.reset(DEFAULT_PAN)
|
||||||
filter_tilt.reset(DEFAULT_TILT)
|
filter_tilt.reset(DEFAULT_TILT)
|
||||||
tracking_enabled = False
|
tracking_enabled = False
|
||||||
|
|||||||
Reference in new issue
Block a user