Commit c4f692e9 authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema
Browse files

Detect console setting properly

parent fa47422c
......@@ -25,22 +25,25 @@ class telescope():
raise Exception("Mode must be None, 'J2000' or 'AZEL', not " + mode)
self.setmode = setmode
if consoleHost is None:
consoleHost = config.get('Console','HostName')
if consoleHost == 'console':
logging.warning("You are using the actual console, not a demo!")
self.outsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
if self.setmode == 'J2000':
self.outsocket.connect((config.get('Console','HostName'),
self.outsocket.connect((consoleHost,
config.getint('Console','Port_Write_J2000')))
elif self.setmode == 'AZEL':
self.outsocket.connect((config.get('Console','HostName'),
self.outsocket.connect((consoleHost,
config.getint('Console','Port_Write_AzEl')))
# Initialize offset socket for all modes where output is desired
if self.setmode is not None:
self.offsetsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.offsetsocket.connect((config.get('Console','HostName'),
self.offsetsocket.connect((consoleHost,
config.getint('Console','Port_Write_Offset')))
if consoleHost is None:
consoleHost = config.get('Console','HostName')
self.j2000readthread = threading.Thread(target=self.readj2000, args=(
consoleHost,
config.getint('Console','Port_Read_J2000')))
......
......@@ -6,9 +6,5 @@ Port_Write_AzEl : 11041
Port_Write_Offset: 11011
[Trace2Port]
HostName: localhost
HostName: mercurius
Port: 11042
Azimuth_Position: 0
Elevation_Position: 1
azimuth_setpoint_error.difference: 2
elevation_setpoint_error.difference: 3
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