refactor parsers; introduce new pocsag parser

This commit is contained in:
Jakob Ketterl
2020-01-09 15:11:53 +01:00
parent 0f8c86a26c
commit 0e528c9267
6 changed files with 49 additions and 34 deletions

View File

@ -2,6 +2,7 @@ from owrx.kiss import KissDeframer
from owrx.map import Map, LatLngLocation
from owrx.bands import Bandplan
from owrx.metrics import Metrics, CounterMetric
from owrx.parser import Parser
from datetime import datetime, timezone
import re
import logging
@ -148,18 +149,15 @@ class AprsLocation(LatLngLocation):
return res
class AprsParser(object):
class AprsParser(Parser):
def __init__(self, handler):
super().__init__(handler)
self.ax25parser = Ax25Parser()
self.deframer = KissDeframer()
self.dial_freq = None
self.band = None
self.handler = handler
self.metric = self.getMetric()
def setDialFrequency(self, freq):
self.dial_freq = freq
self.band = Bandplan.getSharedInstance().findBand(freq)
super().setDialFrequency(freq)
self.metric = self.getMetric()
def getMetric(self):