Skip to content
Snippets Groups Projects
Commit b56d80ef authored by Hal Simpson's avatar Hal Simpson
Browse files

Pulled _get_forceout, and _get_data out _send, and made corresponding changes

parent f31057f8
No related branches found
No related tags found
No related merge requests found
...@@ -152,7 +152,8 @@ class RawInputClient(): ...@@ -152,7 +152,8 @@ class RawInputClient():
Fourceout tells edge that we're done sending data for now, and Fourceout tells edge that we're done sending data for now, and
to go ahead and make it available to go ahead and make it available
""" """
self._send([], UTCDateTime(datetime.utcnow()), 0., True) buf = self._get_forceout(UTCDateTime(datetime.utcnow()), 0.)
self._send(buf)
def send_trace(self, interval, trace): def send_trace(self, interval, trace):
"""send an obspy trace using send. """send an obspy trace using send.
...@@ -200,10 +201,11 @@ class RawInputClient(): ...@@ -200,10 +201,11 @@ class RawInputClient():
nsamp = endsample - i nsamp = endsample - i
endtime = starttime + (nsamp - 1) * timeoffset endtime = starttime + (nsamp - 1) * timeoffset
trace_send = trace.slice(starttime, endtime) trace_send = trace.slice(starttime, endtime)
self._send(trace_send.data, starttime, samplerate) buf = self._get_data(trace_send.data, starttime, samplerate)
self._send(buf)
starttime += nsamp * timeoffset starttime += nsamp * timeoffset
def _send(self, samples, time, rate, forceout=False): def _send(self, buf):
""" Send a block of data to the Edge/CWB combination. """ Send a block of data to the Edge/CWB combination.
PARAMETERS PARAMETERS
...@@ -222,10 +224,6 @@ class RawInputClient(): ...@@ -222,10 +224,6 @@ class RawInputClient():
------ ------
TimeseriesFactoryException - if the socket will not open TimeseriesFactoryException - if the socket will not open
""" """
if forceout:
buf = self._get_forceout(time, rate)
else:
buf = self._get_data(samples, time, rate)
# Try and send the packet, if the socket doesn't exist open it. # Try and send the packet, if the socket doesn't exist open it.
try: try:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment