Compare commits

..

No commits in common. "f57dfcfaf7ded8469510bff92de380b6079905a0" and "fa6092784c381b9a8c3ea1416ae13f4ac2822bde" have entirely different histories.

2 changed files with 11 additions and 16 deletions

View File

@ -228,12 +228,13 @@ class Camera:
raise Exception('unknown preset %s' % id)
preset = preset[0]
i = preset['position']
#info = etree_to_dict(xml.etree.ElementTree.fromstring(self.get('presets/%s' % id)))
#i = info['PTZPreset']['AbsoluteHigh']
if i['elevation'] < 0:
i['elevation'] -= 1
i['azimuth'] += 1
print('goto preset', id, i['elevation'], i['azimuth'], i['absoluteZoom'])
return self.goto(i['elevation'], i['azimuth'], i['absoluteZoom'],
pan=pan, tilt=tilt, zoom=zoom, zoom_last=zoom_last)
return self.goto(i['elevation'], i['azimuth'], i['absoluteZoom'], pan=pan, tilt=tilt, zoom=zoom, zoom_last=zoom_last)
def goto(self, elevation, azimuth, absoluteZoom, speed=1, pan=None, tilt=None, zoom=None, zoom_last=False):
t0 = time.time()
@ -363,6 +364,7 @@ class Camera:
def get_presets_xml(self):
return self.get('presets')
def get_presets(self, details=False):
system_presets = list(range(33, 47)) + list(range(90, 106))
presets = etree_to_list(xml.etree.ElementTree.fromstring(self.get('presets')))
@ -375,3 +377,6 @@ class Camera:
preset['position'] = preset.pop('AbsoluteHigh')
preset['name'] = preset.pop('presetName')
return presets
#/PTZCtrl/channels/<ID>/patterns/<ID>/recordstart
#/PTZCtrl/channels/<ID>/patterns/<ID>/recordstop

View File

@ -504,11 +504,7 @@ function exportSequenceCSV() {
var r = [];
r.push(row.preset)
var preset = getPreset(row.preset)
if (preset) {
r.push(preset.name)
} else {
r.push(row.preset)
}
r.push(preset.name)
if (row.duration) {
position += row.duration
r.push(formatDuration(position))
@ -519,15 +515,9 @@ function exportSequenceCSV() {
}
r.push(row.speed)
r.push(row.sleep)
if (preset) {
r.push(preset.position.elevation)
r.push(preset.position.azimuth)
r.push(preset.position.absoluteZoom)
} else {
r.push('')
r.push('')
r.push('')
}
r.push(preset.position.elevation)
r.push(preset.position.azimuth)
r.push(preset.position.absoluteZoom)
return r.join(',');
})).join('\n');
}