add js8 decoding if available

This commit is contained in:
Jakob Ketterl
2020-04-12 13:10:23 +02:00
parent 0e8715b5a1
commit ddfd85c586
7 changed files with 72 additions and 15 deletions

32
owrx/js8.py Normal file
View File

@ -0,0 +1,32 @@
from .wsjt import WsjtChopper
from .parser import Parser
import re
import logging
logger = logging.getLogger(__name__)
class Js8Chopper(WsjtChopper):
def getInterval(self):
return 15
def getFileTimestampFormat(self):
return "%y%m%d_%H%M%S"
def decoder_commandline(self, file):
return ["js8", "--js8", "-d", str(self.decoding_depth("js8")), file]
class Js8Parser(Parser):
decoderRegex = re.compile(" ?<Decode(Started|Debug|Finished)>")
def parse(self, raw):
freq, raw_msg = raw
self.setDialFrequency(freq)
msg = raw_msg.decode().rstrip()
if Js8Parser.decoderRegex.match(msg):
return
if msg.startswith(" EOF on input file"):
return
logger.debug(msg)