You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
912 B
Python
34 lines
912 B
Python
1 year ago
|
import os
|
||
|
|
||
|
'''
|
||
|
Plugin handler for the NRTS plugin.
|
||
|
'''
|
||
|
class SeedlinkPluginHandler:
|
||
|
# Create defaults
|
||
|
def __init__(self):
|
||
|
self.__channels = set()
|
||
|
pass
|
||
|
|
||
|
def push(self, seedlink):
|
||
|
address = "localhost"
|
||
|
try: address = seedlink.param('sources.naqs.address')
|
||
|
except: seedlink.setParam('sources.naqs.address', address)
|
||
|
|
||
|
port = 28000
|
||
|
try: port = int(seedlink.param('sources.naqs.port'))
|
||
|
except: seedlink.setParam('sources.naqs.port', port)
|
||
|
|
||
|
try: seedlink.param('sources.naqs.proc')
|
||
|
except: seedlink.setParam('sources.naqs.proc', 'naqs_bb40_sm100')
|
||
|
|
||
|
self.__channels.add(seedlink.param('seedlink.station.code'))
|
||
|
|
||
|
# Key is address and network code
|
||
|
return (address + ":" + str(port), seedlink.param('seedlink.station.network'))
|
||
|
|
||
|
|
||
|
# Flush does nothing
|
||
|
def flush(self, seedlink):
|
||
|
seedlink.setParam('sources.naqs.channels', ",".join(self.__channels))
|
||
|
pass
|