mirror of
https://github.com/BOSWatch/BW3-Core.git
synced 2026-04-21 06:03:50 +00:00
Early draft
This commit is contained in:
parent
6b0a7822e9
commit
35ada90130
4 changed files with 22 additions and 45 deletions
|
|
@ -18,6 +18,7 @@ import time
|
||||||
import logging
|
import logging
|
||||||
import threading
|
import threading
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
|
from boswatch.processManager import ProcessManager
|
||||||
|
|
||||||
logging.debug("- %s loaded", __name__)
|
logging.debug("- %s loaded", __name__)
|
||||||
|
|
||||||
|
|
@ -63,3 +64,21 @@ class InputBase(ABC):
|
||||||
self._inputQueue.put_nowait((data, time.time()))
|
self._inputQueue.put_nowait((data, time.time()))
|
||||||
logging.debug("Add received data to queue")
|
logging.debug("Add received data to queue")
|
||||||
print(data)
|
print(data)
|
||||||
|
|
||||||
|
def startmm(self, decoderConfig):
|
||||||
|
mmProc = ProcessManager(str(decoderConfig.get("mmPath", default="multimon-ng")), textMode=True)
|
||||||
|
if decoderConfig.get("fms", default=0):
|
||||||
|
mmProc.addArgument("-a FMSFSK")
|
||||||
|
if decoderConfig.get("zvei", default=0):
|
||||||
|
mmProc.addArgument("-a ZVEI1")
|
||||||
|
if decoderConfig.get("poc512", default=0):
|
||||||
|
mmProc.addArgument("-a POCSAG512")
|
||||||
|
if decoderConfig.get("poc1200", default=0):
|
||||||
|
mmProc.addArgument("-a POCSAG1200")
|
||||||
|
if decoderConfig.get("poc2400", default=0):
|
||||||
|
mmProc.addArgument("-a POCSAG2400")
|
||||||
|
if decoderConfig.get("mmChar"):
|
||||||
|
mmProc.addArgument("-C " + str(decoderConfig.get("mmChar")))
|
||||||
|
mmProc.addArgument("-f alpha")
|
||||||
|
mmProc.addArgument("-t raw -")
|
||||||
|
return mmProc
|
||||||
|
|
|
||||||
|
|
@ -40,21 +40,7 @@ class LineInInput(InputBase):
|
||||||
lineInProc.setStderr(open(paths.LOG_PATH + "asla.log", "a"))
|
lineInProc.setStderr(open(paths.LOG_PATH + "asla.log", "a"))
|
||||||
lineInProc.start()
|
lineInProc.start()
|
||||||
|
|
||||||
mmProc = ProcessManager(str(lineInConfig.get("mmPath", default="multimon-ng")), textMode=True)
|
mmProc = self.startmm(decoderConfig)
|
||||||
if decoderConfig.get("fms", default=0):
|
|
||||||
mmProc.addArgument("-a FMSFSK")
|
|
||||||
if decoderConfig.get("zvei", default=0):
|
|
||||||
mmProc.addArgument("-a ZVEI1")
|
|
||||||
if decoderConfig.get("poc512", default=0):
|
|
||||||
mmProc.addArgument("-a POCSAG512")
|
|
||||||
if decoderConfig.get("poc1200", default=0):
|
|
||||||
mmProc.addArgument("-a POCSAG1200")
|
|
||||||
if decoderConfig.get("poc2400", default=0):
|
|
||||||
mmProc.addArgument("-a POCSAG2400")
|
|
||||||
if lineInConfig.get("mmChar"):
|
|
||||||
mmProc.addArgument("-C " + str(lineInConfig.get("mmChar")))
|
|
||||||
mmProc.addArgument("-f alpha")
|
|
||||||
mmProc.addArgument("-t raw -")
|
|
||||||
mmProc.setStdin(lineInProc.stdout)
|
mmProc.setStdin(lineInProc.stdout)
|
||||||
mmProc.setStderr(open(paths.LOG_PATH + "multimon-ng.log", "a"))
|
mmProc.setStderr(open(paths.LOG_PATH + "multimon-ng.log", "a"))
|
||||||
mmProc.start()
|
mmProc.start()
|
||||||
|
|
|
||||||
|
|
@ -39,21 +39,7 @@ class PulseAudioInput(InputBase):
|
||||||
PulseAudioProc.setStderr(open(paths.LOG_PATH + "pulseaudio.log", "a"))
|
PulseAudioProc.setStderr(open(paths.LOG_PATH + "pulseaudio.log", "a"))
|
||||||
PulseAudioProc.start()
|
PulseAudioProc.start()
|
||||||
|
|
||||||
mmProc = ProcessManager(str(PulseAudioConfig.get("mmPath", default="multimon-ng")), textMode=True)
|
mmProc = self.startmm(decoderConfig)
|
||||||
if decoderConfig.get("fms", default=0):
|
|
||||||
mmProc.addArgument("-a FMSFSK")
|
|
||||||
if decoderConfig.get("zvei", default=0):
|
|
||||||
mmProc.addArgument("-a ZVEI1")
|
|
||||||
if decoderConfig.get("poc512", default=0):
|
|
||||||
mmProc.addArgument("-a POCSAG512")
|
|
||||||
if decoderConfig.get("poc1200", default=0):
|
|
||||||
mmProc.addArgument("-a POCSAG1200")
|
|
||||||
if decoderConfig.get("poc2400", default=0):
|
|
||||||
mmProc.addArgument("-a POCSAG2400")
|
|
||||||
if PulseAudioConfig.get("mmChar"):
|
|
||||||
mmProc.addArgument("-C " + str(PulseAudioConfig.get("mmChar")))
|
|
||||||
mmProc.addArgument("-f alpha")
|
|
||||||
mmProc.addArgument("-t raw -")
|
|
||||||
mmProc.setStdin(PulseAudioProc.stdout)
|
mmProc.setStdin(PulseAudioProc.stdout)
|
||||||
mmProc.setStderr(open(paths.LOG_PATH + "multimon-ng.log", "a"))
|
mmProc.setStderr(open(paths.LOG_PATH + "multimon-ng.log", "a"))
|
||||||
mmProc.start()
|
mmProc.start()
|
||||||
|
|
|
||||||
|
|
@ -41,21 +41,7 @@ class SdrInput(InputBase):
|
||||||
sdrProc.setStderr(open(paths.LOG_PATH + "rtl_fm.log", "a"))
|
sdrProc.setStderr(open(paths.LOG_PATH + "rtl_fm.log", "a"))
|
||||||
sdrProc.start()
|
sdrProc.start()
|
||||||
|
|
||||||
mmProc = ProcessManager(str(sdrConfig.get("mmPath", default="multimon-ng")), textMode=True)
|
mmProc = self.startmm(decoderConfig)
|
||||||
if decoderConfig.get("fms", default=0):
|
|
||||||
mmProc.addArgument("-a FMSFSK")
|
|
||||||
if decoderConfig.get("zvei", default=0):
|
|
||||||
mmProc.addArgument("-a ZVEI1")
|
|
||||||
if decoderConfig.get("poc512", default=0):
|
|
||||||
mmProc.addArgument("-a POCSAG512")
|
|
||||||
if decoderConfig.get("poc1200", default=0):
|
|
||||||
mmProc.addArgument("-a POCSAG1200")
|
|
||||||
if decoderConfig.get("poc2400", default=0):
|
|
||||||
mmProc.addArgument("-a POCSAG2400")
|
|
||||||
if sdrConfig.get("mmChar"):
|
|
||||||
mmProc.addArgument("-C " + str(sdrConfig.get("mmChar")))
|
|
||||||
mmProc.addArgument("-f alpha")
|
|
||||||
mmProc.addArgument("-t raw -")
|
|
||||||
mmProc.setStdin(sdrProc.stdout)
|
mmProc.setStdin(sdrProc.stdout)
|
||||||
mmProc.setStderr(open(paths.LOG_PATH + "multimon-ng.log", "a"))
|
mmProc.setStderr(open(paths.LOG_PATH + "multimon-ng.log", "a"))
|
||||||
mmProc.start()
|
mmProc.start()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue