diff --git a/config_webrx.py b/config_webrx.py index 383068c..4fc6eab 100644 --- a/config_webrx.py +++ b/config_webrx.py @@ -67,7 +67,6 @@ sdrhu_key = "" sdrhu_public_listing = False # ==== DSP/RX settings ==== -dsp_plugin="csdr" fft_fps=9 fft_size=4096 #Should be power of 2 fft_voverlap_factor=0.3 #If fft_voverlap_factor is above 0, multiple FFTs will be used for creating a line on the diagram. diff --git a/plugins/dsp/csdr/plugin.py b/csdr.py similarity index 99% rename from plugins/dsp/csdr/plugin.py rename to csdr.py index cdd12b6..c1e4de1 100755 --- a/plugins/dsp/csdr/plugin.py +++ b/csdr.py @@ -27,7 +27,7 @@ import code import signal import fcntl -class dsp_plugin: +class dsp: def __init__(self): self.samp_rate = 250000 diff --git a/openwebrx.py b/openwebrx.py index e9228c6..d6e5ba8 100755 --- a/openwebrx.py +++ b/openwebrx.py @@ -26,8 +26,7 @@ sw_version="v0.15" import os import code import importlib -import plugins -import plugins.dsp +import csdr import thread import time import datetime @@ -63,6 +62,7 @@ try: import __pypy__ except: pass pypy="__pypy__" in globals() +""" def import_all_plugins(directory): for subdir in os.listdir(directory): if os.path.isdir(directory+subdir) and not subdir[0]=="_": @@ -71,6 +71,7 @@ def import_all_plugins(directory): importname=(directory+subdir+"/plugin").replace("/",".") print "[openwebrx-import] Found plugin:",importname importlib.import_module(importname) +""" class MultiThreadHTTPServer(ThreadingMixIn, HTTPServer): pass @@ -128,9 +129,6 @@ def main(): signal.signal(signal.SIGINT, handle_signal) #http://stackoverflow.com/questions/1112343/how-do-i-capture-sigint-in-python signal.signal(signal.SIGUSR1, handle_signal) - #Load plugins - import_all_plugins("plugins/dsp/") - #Pypy if pypy: print "pypy detected (and now something completely different: c code is expected to run at a speed of 3*10^8 m/s?)" @@ -292,7 +290,7 @@ def apply_csdr_cfg_to_dsp(dsp): def spectrum_thread_function(): global clients, spectrum_dsp, spectrum_thread_watchdog_last_tick - spectrum_dsp=dsp=getattr(plugins.dsp,cfg.dsp_plugin).plugin.dsp_plugin() + spectrum_dsp=dsp=csdr.dsp() dsp.nc_port=cfg.iq_server_port dsp.set_demodulator("fft") dsp.set_samp_rate(cfg.samp_rate) @@ -459,7 +457,7 @@ class WebRXHandler(BaseHTTPRequestHandler): rxws.send(self, "MSG center_freq={0} bandwidth={1} fft_size={2} fft_fps={3} audio_compression={4} fft_compression={5} max_clients={6} setup".format(str(cfg.shown_center_freq),str(cfg.samp_rate),cfg.fft_size,cfg.fft_fps,cfg.audio_compression,cfg.fft_compression,cfg.max_clients)) # ========= Initialize DSP ========= - dsp=getattr(plugins.dsp,cfg.dsp_plugin).plugin.dsp_plugin() + dsp=csdr.dsp() dsp_initialized=False dsp.set_audio_compression(cfg.audio_compression) dsp.set_format_conversion(cfg.format_conversion) diff --git a/plugins/__init__.py b/plugins/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/plugins/dsp/__init__.py b/plugins/dsp/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/plugins/dsp/csdr/__init__.py b/plugins/dsp/csdr/__init__.py deleted file mode 100644 index e69de29..0000000