# Path: ogn/parser/pattern.py
# PATTERN_RECEIVER_POSITION_COMMENT = re.compile(r"""
#     (?:(?P<user_comment>.+))?
# """, re.VERBOSE | re.MULTILINE)
# 
# PATTERN_RECEIVER_STATUS_COMMENT = re.compile(r"""
#     (?:
#         v(?P<version>\d+\.\d+\.\d+)
#         (?:\.(?P<platform>.+?))?
#     \s)?
#     CPU:(?P<cpu_load>[\d.]+)\s
#     RAM:(?P<ram_free>[\d.]+)/(?P<ram_total>[\d.]+)MB\s
#     NTP:(?P<ntp_offset>[\d.]+)ms/(?P<ntp_correction>[+-][\d.]+)ppm\s
#     (?:(?P<voltage>[\d.]+)V\s)?
#     (?:(?P<amperage>[\d.]+)A\s)?
#     (?:(?P<cpu_temperature>[+-][\d.]+)C\s*)?
#     (?:(?P<visible_senders>\d+)/(?P<senders>\d+)Acfts\[1h\]\s*)?
#     (?:RF:
#         (?:
#             (?P<rf_correction_manual>[+-][\d]+)
#             (?P<rf_correction_automatic>[+-][\d.]+)ppm/
#         )?
#         (?P<signal_quality>[+-][\d.]+)dB
#         (?:/(?P<senders_signal_quality>[+-][\d.]+)dB@10km\[(?P<senders_messages>\d+)\])?
#         (?:/(?P<good_senders_signal_quality>[+-][\d.]+)dB@10km\[(?P<good_senders>\d+)/(?P<good_and_bad_senders>\d+)\])?
#     )?
# """, re.VERBOSE | re.MULTILINE)
# 
# Path: ogn/parser/aprs_comment/base.py
# class BaseParser():
#     def __init__(self):
#         self.beacon_type = 'unknown'
# 
#     def parse(self, aprs_comment, aprs_type):
#         if aprs_type.startswith('position'):
#             data = self.parse_position(aprs_comment)
#         elif aprs_type.startswith('status'):
#             data = self.parse_status(aprs_comment)
#         else:
#             raise ValueError("aprs_type {} unknown".format(aprs_type))
#         data.update({'beacon_type': self.beacon_type})
#         return data
# 
#     def parse_position(self, aprs_comment):
#         raise NotImplementedError("Position parser for parser '{}' not yet implemented".format(self.beacon_type))
# 
#     def parse_status(self, aprs_comment):
#         raise NotImplementedError("Status parser for parser '{}' not yet implemented".format(self.beacon_type))


from ogn.parser.pattern import PATTERN_RECEIVER_POSITION_COMMENT, PATTERN_RECEIVER_STATUS_COMMENT
from .base import BaseParser



class ReceiverParser(BaseParser):
    def __init__(self):
        self.beacon_type = 'receiver'
        self.position_pattern = PATTERN_RECEIVER_POSITION_COMMENT
        self.status_pattern = PATTERN_RECEIVER_STATUS_COMMENT

    def parse_position(self, aprs_comment):
        if aprs_comment is None:
            return {}
        else:

# Path: ogn/parser/pattern.py
# PATTERN_RECEIVER_POSITION_COMMENT = re.compile(r"""
#     (?:(?P<user_comment>.+))?
# """, re.VERBOSE | re.MULTILINE)
# 
# PATTERN_RECEIVER_STATUS_COMMENT = re.compile(r"""
#     (?:
#         v(?P<version>\d+\.\d+\.\d+)
#         (?:\.(?P<platform>.+?))?
#     \s)?
#     CPU:(?P<cpu_load>[\d.]+)\s
#     RAM:(?P<ram_free>[\d.]+)/(?P<ram_total>[\d.]+)MB\s
#     NTP:(?P<ntp_offset>[\d.]+)ms/(?P<ntp_correction>[+-][\d.]+)ppm\s
#     (?:(?P<voltage>[\d.]+)V\s)?
#     (?:(?P<amperage>[\d.]+)A\s)?
#     (?:(?P<cpu_temperature>[+-][\d.]+)C\s*)?
#     (?:(?P<visible_senders>\d+)/(?P<senders>\d+)Acfts\[1h\]\s*)?
#     (?:RF:
#         (?:
#             (?P<rf_correction_manual>[+-][\d]+)
#             (?P<rf_correction_automatic>[+-][\d.]+)ppm/
#         )?
#         (?P<signal_quality>[+-][\d.]+)dB
#         (?:/(?P<senders_signal_quality>[+-][\d.]+)dB@10km\[(?P<senders_messages>\d+)\])?
#         (?:/(?P<good_senders_signal_quality>[+-][\d.]+)dB@10km\[(?P<good_senders>\d+)/(?P<good_and_bad_senders>\d+)\])?
#     )?
# """, re.VERBOSE | re.MULTILINE)
# 
# Path: ogn/parser/aprs_comment/base.py
# class BaseParser():
#     def __init__(self):
#         self.beacon_type = 'unknown'
# 
#     def parse(self, aprs_comment, aprs_type):
#         if aprs_type.startswith('position'):
#             data = self.parse_position(aprs_comment)
#         elif aprs_type.startswith('status'):
#             data = self.parse_status(aprs_comment)
#         else:
#             raise ValueError("aprs_type {} unknown".format(aprs_type))
#         data.update({'beacon_type': self.beacon_type})
#         return data
# 
#     def parse_position(self, aprs_comment):
#         raise NotImplementedError("Position parser for parser '{}' not yet implemented".format(self.beacon_type))
# 
#     def parse_status(self, aprs_comment):
#         raise NotImplementedError("Status parser for parser '{}' not yet implemented".format(self.beacon_type))


# Path: ogn/parser/aprs_comment/receiver_parser.py
from ogn.parser.pattern import PATTERN_RECEIVER_POSITION_COMMENT, PATTERN_RECEIVER_STATUS_COMMENT
from .base import BaseParser




class ReceiverParser(BaseParser):
    def __init__(self):
        self.beacon_type = 'receiver'
        self.position_pattern = PATTERN_RECEIVER_POSITION_COMMENT
        self.status_pattern = PATTERN_RECEIVER_STATUS_COMMENT

    def parse_position(self, aprs_comment):
        if aprs_comment is None:
            return {}
        else:

            match = self.position_pattern.match(aprs_comment)