no elevation

This commit is contained in:
j 2020-12-07 11:30:14 +01:00
parent d6ab940f6b
commit d711133b86

View File

@ -289,11 +289,11 @@ class Camera:
#print(current, delta, move)
current, delta = get_delta()
changed = False
if 'azimuth' in delta and 'azimuth' in direction:
if delta and 'azimuth' in delta and 'azimuth' in direction:
if pan and (not delta['azimuth'] or (delta['azimuth'] >= 0) != direction['azimuth']):
pan = 0
changed = True
else:
elif delta:
print('why no azimuth? delta: %s direction: %s' % (delta, direction))
'''
if pan > 0:
@ -303,9 +303,13 @@ class Camera:
pan = max(pan, delta['azimuth'])
changed = True
'''
if tilt and (not delta['elevation'] or (delta['elevation'] >= 0) != direction['elevation']):
tilt = 0
changed = True
if delta and 'elevation' in delta and 'elevation' in direction:
if tilt and delta and (not delta['elevation'] or (delta['elevation'] >= 0) != direction['elevation']):
tilt = 0
changed = True
elif delta:
print('why no elevation? delta: %s direction: %s' % (delta, direction))
'''
if tilt > 0:
tilt = min(tilt, delta['elevation'])