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.
45 lines
1.3 KiB
Python
45 lines
1.3 KiB
Python
import os
|
|
|
|
'''
|
|
Plugin handler for the nmxptool plugin.
|
|
'''
|
|
class SeedlinkPluginHandler:
|
|
# Create defaults
|
|
def __init__(self):
|
|
pass
|
|
|
|
def push(self, seedlink):
|
|
# Check and set defaults
|
|
address = "idahub.ucsd.edu"
|
|
try: address = seedlink.param('sources.nmxp.address')
|
|
except: seedlink.setParam('sources.nmxp.address', address)
|
|
|
|
port = 28000
|
|
try: port = int(seedlink.param('sources.nmxp.port'))
|
|
except: seedlink.setParam('sources.nmxp.port', port)
|
|
|
|
max_latency = 300
|
|
try: max_latency = int(seedlink.param('sources.nmxp.max_latency'))
|
|
except: seedlink.setParam('sources.nmxp.max_latency', max_latency)
|
|
|
|
short_term_completion = -1
|
|
try: short_term_completion = int(seedlink.param('sources.nmxp.short_term_completion'))
|
|
except: seedlink.setParam('sources.nmxp.short_term_completion', short_term_completion)
|
|
|
|
try: seedlink.param('sources.nmxp.proc')
|
|
except: seedlink.setParam('sources.nmxp.proc', 'naqs_bb40_sm100')
|
|
|
|
additional_options = ""
|
|
try: additional_options = " " + seedlink.param('sources.nmxp.additional_options')
|
|
except: pass
|
|
|
|
seedlink.setParam('sources.nmxp.additional_options', additional_options)
|
|
|
|
# Key is address (one instance per address)
|
|
return address + ":" + str(port)
|
|
|
|
|
|
# Flush does nothing
|
|
def flush(self, seedlink):
|
|
pass
|