openwebrx-clone/owrx/parser.py
2020-01-09 15:11:53 +01:00

21 lines
450 B
Python

from abc import ABC, abstractmethod
from owrx.bands import Bandplan
class Parser(ABC):
def __init__(self, handler):
self.handler = handler
self.dial_freq = None
self.band = None
@abstractmethod
def parse(self, raw):
pass
def setDialFrequency(self, freq):
self.dial_freq = freq
self.band = Bandplan.getSharedInstance().findBand(freq)
def getBand(self):
return self.band