DataSource class Sensor Data Source
Provides access to sensor and log data from various sources.
A DataSource represents a provider of sensing data — this can be a live sensor feed, a log file (playback), a simulated route, or an external source. It exposes methods to start/stop the source, query available data types, push mock or custom data, and register listeners to receive updates.
Use the dataSourceType property to determine whether the instance supports playback operations and access playback when applicable.
Constructors
- DataSource.init(int id)
Properties
-
availableDataTypes
→ List<
DataType> -
The list of data types this data source provides.
no setter
- dataSourceType → DataSourceType
-
The type of this data source.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasRegisteredAutoReleaseObject ↔ bool
-
getter/setter pairinherited
- isSDKInstance → bool
-
Whether this DataSource is backed by a real SDK instance.
no setter
- isStopped → bool
-
Whether the data source is stopped/paused.
no setter
- origin → Origin
-
The origin of this data source.
no setter
- playback → Playback?
-
Access playback controls for playback-capable data sources.
no setter
- pointerId → int
-
The pointer ID of the native object
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addListener(
{required DataSourceListener listener, required DataType dataType, ParameterList? parameters}) → GemError - Register a DataSourceListener to receive updates for a specific data type.
-
dispose(
) → void -
Disposes the native object.
inherited
-
getConfiguration(
DataType type) → PositionSensorConfiguration - Get the current sensor configuration for a data type.
-
getDataTypeDescription(
DataType type) → String - Get a textual description for a data type produced by this source.
-
getLatestData(
DataType type) → SenseData? - Retrieve the latest produced data for a specific data type.
-
isDataTypeAvailable(
DataType dataType) → bool - Check whether the data source produces a specific data type.
-
isMockData(
DataType type) → bool - Check whether mock data is enabled for a given data type.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pushData(
SenseData senseData) → bool - Push a SenseData instance into the data source.
-
registerAutoReleaseObject(
int pointerId) → void -
Registers an object for auto release.
inherited
-
removeListener(
{required DataSourceListener listener, required DataType dataType}) → GemError - Unregister a listener for a specific data type.
-
removeListenerAllDataTypes(
DataSourceListener listener) → void - Unregister all listeners associated with a listener object.
-
setConfiguration(
{DataType type = DataType.position, required PositionSensorConfiguration config}) → GemError - Update the sensor configuration for a specific data type.
-
setMockData(
SenseData senseData) → GemError - Set mock data for this data source.
-
start(
) → GemError - Start the data source.
-
stop(
) → GemError - Stop the data source.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
createExternalDataSource(
List< DataType> dataTypes) → DataSource? - Create a new external data source.
-
createLiveDataSource(
) → DataSource? - Create a new live data source.
-
createLogDataSource(
String logPath) → DataSource? - Create a log-based data source from a log file.
-
createSimulationDataSource(
Route route) → DataSource? - Create a simulated data source from a Route.