Commit 20ed2cf1 authored by Stephen Thompson's avatar Stephen Thompson

Issue #6 separated init code for aurora, polaris, and vega trackers

parent 0f63e984
Pipeline #1366 passed with stages
in 14 minutes and 15 seconds
......@@ -53,26 +53,33 @@ class NDITracker:
"""
self._configure(configuration)
if self.tracker_type == "vega":
self._connect_network()
self._connect_vega()
if self.tracker_type in ("aurora", "polaris"):
self._connect_serial()
if self.tracker_type == "aurora":
self._connect_aurora()
if self.tracker_type == "polaris":
self._connect_polaris()
if self.tracker_type == "dummy":
self.device = True
if self.tracker_type != "dummy":
ndiCommand(self.device, 'INIT:')
self._check_for_errors('Sending INIT command')
def _connect_vega(self):
self._connect_network()
if self.tracker_type in ("aurora", "polaris"):
ndiCommand(self.device,
'COMM:{:d}{:03d}{:d}'
.format(NDI_115200, NDI_8N1, NDI_NOHANDSHAKE))
self._read_sroms_from_file()
self._initialise_ports()
self._enable_tools()
self._read_sroms_from_file()
self._initialise_ports()
self._enable_tools()
def _connect_polaris(self):
self._connect_serial()
self._read_sroms_from_file()
self._initialise_ports()
self._enable_tools()
def _connect_aurora(self):
self._connect_serial()
def _connect_network(self):
#try and ping first to save time with timeouts
......@@ -86,6 +93,9 @@ class NDITracker:
raise IOError('Could not connect to network NDI device at {}'
.format(self.ip_address))
ndiCommand(self.device, 'INIT:')
self._check_for_errors('Sending INIT command')
def _connect_serial(self):
if self.serial_port == -1:
for port_no in range(self.ports_to_probe):
......@@ -115,6 +125,12 @@ class NDITracker:
raise IOError('Could not connect to serial NDI device at {}'
.format(name))
ndiCommand(self.device, 'INIT:')
self._check_for_errors('Sending INIT command')
ndiCommand(self.device,
'COMM:{:d}{:03d}{:d}'
.format(NDI_115200, NDI_8N1, NDI_NOHANDSHAKE))
def _configure(self, configuration):
""" Reads a configuration dictionary
describing the tracker configuration.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment