def set_timestamps(self, timestamps: common.TimingPayload) -> "Xyz": """ Sets the timestamps. :param timestamps: Timestamps to set. :return: A modified instance of self. """ common.check_type(timestamps, [common.TimingPayload]) self.get_proto().timestamps.CopyFrom(timestamps.get_proto()) self._timestamps = common.TimingPayload(self.get_proto().timestamps) return self
def set_timestamps_gps(self, timestamps_gps: common.TimingPayload) -> "Location": """ Sets the GPS timing samples. :param timestamps_gps: Payload to set. :return: A modified instance of self. """ common.check_type(timestamps_gps, [common.TimingPayload]) self.get_proto().timestamps_gps.CopyFrom(timestamps_gps.get_proto()) self._timestamps_gps = common.TimingPayload( self.get_proto().timestamps_gps) return self
def __init__(self, proto: RedvoxPacketM.Sensors.Location): super().__init__(proto) self._timestamps: common.TimingPayload = common.TimingPayload( proto.timestamps) self._timestamps_gps: common.TimingPayload = common.TimingPayload( proto.timestamps_gps) self._latitude_samples: common.SamplePayload = common.SamplePayload( proto.latitude_samples) self._longitude_samples: common.SamplePayload = common.SamplePayload( proto.longitude_samples) self._altitude_samples: common.SamplePayload = common.SamplePayload( proto.altitude_samples) self._speed_samples: common.SamplePayload = common.SamplePayload( proto.speed_samples) self._bearing_samples: common.SamplePayload = common.SamplePayload( proto.bearing_samples) self._horizontal_accuracy_samples: common.SamplePayload = common.SamplePayload( proto.horizontal_accuracy_samples) self._vertical_accuracy_samples: common.SamplePayload = common.SamplePayload( proto.vertical_accuracy_samples) self._speed_accuracy_samples: common.SamplePayload = common.SamplePayload( proto.speed_accuracy_samples) self._bearing_accuracy_samples: common.SamplePayload = common.SamplePayload( proto.bearing_accuracy_samples) self._last_best_location: BestLocation = BestLocation( proto.last_best_location) self._overall_best_location: BestLocation = BestLocation( proto.overall_best_location) # noinspection Mypy # pylint: disable=E1101 self._location_providers: ProtoRepeatedMessage = ProtoRepeatedMessage( proto, proto.location_providers, "location_providers", LocationProvider.from_proto, LocationProvider.into_proto, )
def __init__(self, proto: redvox_api_m_pb2.RedvoxPacketM.Sensors.Xyz): super().__init__(proto) self._timestamps: common.TimingPayload = common.TimingPayload(proto.timestamps) self._x_samples: common.SamplePayload = common.SamplePayload(proto.x_samples) self._y_samples: common.SamplePayload = common.SamplePayload(proto.y_samples) self._z_samples: common.SamplePayload = common.SamplePayload(proto.z_samples)
def __init__(self, proto: redvox_api_m_pb2.RedvoxPacketM.Sensors.Image): super().__init__(proto) self._timestamps: common.TimingPayload = common.TimingPayload( proto.timestamps)
def __init__( self, station_metrics_proto: redvox_api_m_pb2.RedvoxPacketM.StationInformation.StationMetrics, ): super().__init__(station_metrics_proto) self._timestamps = common.TimingPayload( station_metrics_proto.timestamps ).set_default_unit() # pylint: disable=E1101 self._network_type: redvox.api1000.common.generic.ProtoRepeatedMessage = ( redvox.api1000.common.generic.ProtoRepeatedMessage( station_metrics_proto, station_metrics_proto.network_type, _NETWORK_TYPE_FIELD_NAME, NetworkType.from_proto, NetworkType.into_proto, ) ) # pylint: disable=E1101 self._cell_service_state: redvox.api1000.common.generic.ProtoRepeatedMessage = ( redvox.api1000.common.generic.ProtoRepeatedMessage( station_metrics_proto, station_metrics_proto.cell_service_state, _CELL_SERVICE_STATE_FIELD_NAME, CellServiceState.from_proto, CellServiceState.into_proto, ) ) # noinspection PyTypeChecker self._network_strength: common.SamplePayload = common.SamplePayload( station_metrics_proto.network_strength ).set_unit(common.Unit.DECIBEL) # noinspection PyTypeChecker self._temperature: common.SamplePayload = common.SamplePayload( station_metrics_proto.temperature ).set_unit(common.Unit.DEGREES_CELSIUS) # noinspection PyTypeChecker self._battery: common.SamplePayload = common.SamplePayload( station_metrics_proto.battery ).set_unit(common.Unit.PERCENTAGE) # noinspection PyTypeChecker self._battery_current: common.SamplePayload = common.SamplePayload( station_metrics_proto.battery_current ).set_unit(common.Unit.MICROAMPERES) # noinspection PyTypeChecker self._available_ram: common.SamplePayload = common.SamplePayload( station_metrics_proto.available_ram ).set_unit(common.Unit.BYTE) # noinspection PyTypeChecker self._available_disk: common.SamplePayload = common.SamplePayload( station_metrics_proto.available_disk ).set_unit(common.Unit.BYTE) # noinspection PyTypeChecker self._cpu_utilization: common.SamplePayload = common.SamplePayload( station_metrics_proto.cpu_utilization ).set_unit(common.Unit.PERCENTAGE) # pylint: disable=E1101 self._power_state: redvox.api1000.common.generic.ProtoRepeatedMessage = ( redvox.api1000.common.generic.ProtoRepeatedMessage( station_metrics_proto, station_metrics_proto.power_state, _POWER_STATE_FIELD_NAME, PowerState.from_proto, PowerState.into_proto, ) ) # pylint: disable=E1101 self._wifi_wake_loc: redvox.api1000.common.generic.ProtoRepeatedMessage = ( redvox.api1000.common.generic.ProtoRepeatedMessage( station_metrics_proto, station_metrics_proto.wifi_wake_lock, _WIFI_WAKE_LOCK_FIELD_NAME, WifiWakeLock.from_proto, WifiWakeLock.into_proto, ) ) # pylint: disable=E1101 self._screen_state: redvox.api1000.common.generic.ProtoRepeatedMessage = ( redvox.api1000.common.generic.ProtoRepeatedMessage( station_metrics_proto, station_metrics_proto.screen_state, _SCREEN_STATE_FIELD_NAME, ScreenState.from_proto, ScreenState.into_proto, ) ) # noinspection PyTypeChecker self._screen_brightness: common.SamplePayload = common.SamplePayload( station_metrics_proto.screen_brightness ).set_unit(common.Unit.PERCENTAGE)