def setup(self, fields: Tuple[str]): super().setup(fields) time_utc = empty_None(fields[1]) latitude = empty_None(fields[3]) latitude_ns = empty_None(fields[4]) longitude = empty_None(fields[5]) longitude_ew = empty_None(fields[6]) date_utc = empty_None(fields[9]) self._time_utc = None self._status = empty_None(fields[2]) self._latitude = None self._longitude = None self._speed_knots = empty_None(fields[7], float) self._true_course = empty_None(fields[8], float) self._date_utc = None self._mode = empty_None(fields[12]) if time_utc is not None: self._time_utc = self.calc_time_utc(time_utc) if latitude is not None and latitude_ns is not None: self._latitude = self.calc_latitude(latitude, latitude_ns) if longitude is not None and longitude_ew is not None: self._longitude = self.calc_longitude(longitude, longitude_ew) if date_utc is not None: self._date_utc = self.calc_date_utc(date_utc)
def setup(self, fields: Tuple[str]): super().setup(fields) self._num_message = empty_None(fields[1], int) self._seq_num = empty_None(fields[2], int) self._satellites_in_view = empty_None(fields[3], int) self._satellite_1 = None self._satellite_2 = None self._satellite_3 = None self._satellite_4 = None # NOTE a length of the GSV format is changable. if len(fields) > 8: self._satellite_1 = self.SatelliteProperty(fields[4], fields[5], fields[6], fields[7]) else: self._satellite_1 = self.SatelliteProperty() if len(fields) > 12: self._satellite_2 = self.SatelliteProperty(fields[8], fields[9], fields[10], fields[11]) else: self._satellite_2 = self.SatelliteProperty() if len(fields) > 16: self._satellite_3 = self.SatelliteProperty(fields[12], fields[13], fields[14], fields[15]) else: self._satellite_3 = self.SatelliteProperty() if len(fields) > 20: self._satellite_4 = self.SatelliteProperty(fields[16], fields[17], fields[18], fields[19]) else: self._satellite_4 = self.SatelliteProperty()
def setup(self, fields: Tuple[str]): super().setup(fields) self._true_course = empty_None(fields[1], float) self._mag_course = empty_None(fields[3], float) self._speed_knots = empty_None(fields[5], float) self._speed_km = empty_None(fields[7], float) self._mode = empty_None(fields[9])
def setup(self, fields: Tuple[str]): super().setup(fields) self._mode = empty_None(fields[1]) self._fix_type = empty_None(fields[2]) self._satellite_id = tuple([empty_None(id, int) for id in fields[3:15]]) self._PDOP = empty_None(fields[15], float) self._HDOP = empty_None(fields[16], float) self._VDOP = empty_None(fields[17], float)
def setup(self, fields: Tuple[str]): super().setup(fields) time_utc = empty_None(fields[1]) day = empty_None(fields[2], int) month = empty_None(fields[3]) year = empty_None(fields[4][2:]) self._time_utc = None self._date_utc = None self._local_zone_hour = empty_None(fields[5], int) self._local_zone_min = empty_None(fields[6], int) if time_utc is not None: self._time_utc = self.calc_time_utc(time_utc) if day is not None and month is not None and year is not None: self._date_utc = (day, month, year)
def setup(self, fields: Tuple[str]): super().setup(fields) latitude = empty_None(fields[1]) latitude_ns = empty_None(fields[2]) longitude = empty_None(fields[3]) longitude_ew = empty_None(fields[4]) time_utc = empty_None(fields[5]) self._latitude: Optional[float] = None self._longitude: Optional[float] = None self._time_utc: Optional[Tuple[Union[int, float]]] = None self._status = empty_None(fields[6]) if latitude is not None and latitude_ns is not None: self._latitude = self.calc_latitude(latitude, latitude_ns) if longitude is not None and longitude_ew is not None: self._longitude = self.calc_longitude(longitude, longitude_ew) if time_utc is not None: self._time_utc = self.calc_time_utc(time_utc)
def setup(self, fields: Tuple[str]): super().setup(fields) time_utc = empty_None(fields[1]) latitude = empty_None(fields[2]) latitude_ns = empty_None(fields[3]) longitude = empty_None(fields[4]) longitude_ew = empty_None(fields[5]) self._time_utc: Optional[Tuple[Union[int, float]]] = None self._latitude: Optional[float] = None self._longitude: Optional[float] = None self._quality: Optional[int] = empty_None(fields[6], int) self._satellites_used: Optional[int] = empty_None(fields[7], int) self._HDOP: Optional[float] = empty_None(fields[8], float) self._altitude: Optional[float] = empty_None(fields[9], float) self._geoidal_separation: Optional[float] = empty_None(fields[11], float) self._station_id: Optional[float] = empty_None(fields[14], int) if time_utc is not None: self._time_utc = self.calc_time_utc(time_utc) if latitude is not None and latitude_ns is not None: self._latitude = self.calc_latitude(latitude, latitude_ns) if longitude is not None and longitude_ew is not None: self._longitude = self.calc_longitude(longitude, longitude_ew)
def __init__(self, id: str = "", elev: str = "", azim: str = "", SNR: str = "") -> None: self._id = empty_None(id, int) self._elev = empty_None(elev, int) self._azim = empty_None(azim, int) self._SNR= empty_None(SNR, int)
def setup(self, fields: Tuple[str]): self._talker = fields[0][:2] self._type = fields[0][2:] self._checksum = empty_None(fields[-1])