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

Remove unused private members

parent 06559141
...@@ -48,21 +48,23 @@ class telescope(): ...@@ -48,21 +48,23 @@ class telescope():
self._offsetsocket.connect((consoleHost, self._offsetsocket.connect((consoleHost,
config.getint('Console','Port_Write_Offset'))) config.getint('Console','Port_Write_Offset')))
self._thread_read_j2000 = threading.Thread(target=self._readj2000, args=( self._event_j2000 = threading.Event()
thread_read_j2000 = threading.Thread(target=self._readj2000, args=(
consoleHost, consoleHost,
config.getint('Console','Port_Read_J2000'))) config.getint('Console','Port_Read_J2000')))
self._thread_read_j2000.daemon = True thread_read_j2000.daemon = True
self._thread_read_j2000.start() thread_read_j2000.start()
self._thread_read_trace = threading.Thread(target=self._readtraces, args=( self._event_traces = threading.Event()
thread_read_traces = threading.Thread(target=self._readtraces, args=(
config.get('Trace2Port', 'Hostname'), config.get('Trace2Port', 'Hostname'),
config.getint('Trace2Port', 'Port'))) config.getint('Trace2Port', 'Port')))
self._thread_read_trace.daemon = True thread_read_traces.daemon = True
self._thread_read_trace.start() thread_read_traces.start()
def _readj2000(self, consolehost, j2000_read_port): def _readj2000(self, consolehost, j2000_read_port):
''' '''
Poll the socket with the j2000 info, store its values in class members Poll the socket with the j2000 info, store its values in class members.
''' '''
try: try:
self._j2000socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self._j2000socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
...@@ -81,6 +83,7 @@ class telescope(): ...@@ -81,6 +83,7 @@ class telescope():
self.radec = SkyCoord(ra, dec, frame='icrs') self.radec = SkyCoord(ra, dec, frame='icrs')
(setpoint_ra, setpoint_dec) = (vals[0], vals[1]) (setpoint_ra, setpoint_dec) = (vals[0], vals[1])
self.setpoint_radec = SkyCoord(setpoint_ra, setpoint_dec, frame='icrs') self.setpoint_radec = SkyCoord(setpoint_ra, setpoint_dec, frame='icrs')
self._event_j2000.set()
def _readtraces(self, tracehost, traceport): def _readtraces(self, tracehost, traceport):
''' '''
...@@ -105,6 +108,7 @@ class telescope(): ...@@ -105,6 +108,7 @@ class telescope():
self.dist_el = (float(vals[3])*u.rad).to(u.deg) self.dist_el = (float(vals[3])*u.rad).to(u.deg)
self.speed_az = float(vals[4]) self.speed_az = float(vals[4])
self.speed_el = float(vals[5]) self.speed_el = float(vals[5])
self._event_traces.set()
def setRaDec(self, setpoint): def setRaDec(self, setpoint):
''' '''
...@@ -197,8 +201,9 @@ class telescope(): ...@@ -197,8 +201,9 @@ class telescope():
speed the console is outputting them (probably once a second). speed the console is outputting them (probably once a second).
''' '''
while True: while True:
time.sleep(1) self._event_j2000.wait()
yield({'current_position_j2000': self.radec, self._event_j2000.clear()
yield({'position_j2000': self.radec,
'setpoint_j2000': self.setpoint_radec}) 'setpoint_j2000': self.setpoint_radec})
def getTraces(self): def getTraces(self):
...@@ -207,7 +212,8 @@ class telescope(): ...@@ -207,7 +212,8 @@ class telescope():
rate trace2port generates them (probably once a second). rate trace2port generates them (probably once a second).
''' '''
while True: while True:
time.sleep(1) self._event_traces.wait()
yield({'current_position_azel': (self.az, self.el), self._event_traces.clear()
'distance_to_setpoint': (self.dist_az, self.dist_el), yield({'position_azel': (self.az, self.el),
'distance': (self.dist_az, self.dist_el),
'speed': (self.speed_az, self.speed_el)}) 'speed': (self.speed_az, self.speed_el)})
Supports Markdown
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