holoride
Search Results for

    Show / Hide Table of Contents

    Class StateReceiverBackend

    Backend implementation for the StateReceiver.

    Implementations of this class represent connections to actual underlying data sources for vehicle localization etc. These may either we be annotated with StateReceiverBackendAttribute to be automatically added to the StateReceiver, or can be added via the inspector.

    Inheritance
    object
    StateReceiverBackend
    FixedPositionStateReceiverBackend
    NullStateReceiverBackend
    ReplayStateReceiverBackend
    ServiceStateReceiverBackend
    Implements
    INotifyPropertyChanged
    Namespace: Holoride.ElasticSDK
    Assembly: Holoride.ElasticSDK.Library.Runtime.dll
    Syntax
    public abstract class StateReceiverBackend : ScriptableObject, INotifyPropertyChanged

    Fields

    AllListeners

    Declaration
    protected readonly HashSet<object> AllListeners
    Field Value
    Type Description
    HashSet<><object>

    LocalizationListeners

    Declaration
    protected readonly List<IStateReceiverLocalizationEventListener> LocalizationListeners
    Field Value
    Type Description
    List<><IStateReceiverLocalizationEventListener>

    Properties

    IsEnabled

    Declaration
    public bool IsEnabled { get; }
    Property Value
    Type Description
    bool

    IsInteractable

    Gets or sets a value indicating whether this backend is interactable in the UI.

    Declaration
    public bool IsInteractable { get; set; }
    Property Value
    Type Description
    bool

    Pivot

    Gets the pivot, used as reference point for the mapping between real world GeoCoordinate and the coordinate system in Unity.

    Declaration
    public SharedGeoCoordinate Pivot { get; }
    Property Value
    Type Description
    SharedGeoCoordinate

    Route

    Gets or sets the current route.

    Declaration
    public virtual IRoute Route { get; protected set; }
    Property Value
    Type Description
    IRoute

    State

    Gets or sets the current state of this backend, indicating if it is ready for use.

    Declaration
    public StateReceiverState State { get; protected set; }
    Property Value
    Type Description
    StateReceiverState

    TravelInformationState

    Gets the travel information based on the current position along the Route.

    Declaration
    public virtual TravelInformationState TravelInformationState { get; }
    Property Value
    Type Description
    TravelInformationState

    VehicleSensorState

    Gets or sets the most recently received state.

    This may be updated from worker threads, so when using the value in conditionals it is recommended to store the value in a local variable.

    Declaration
    public virtual VehicleSensorState VehicleSensorState { get; protected set; }
    Property Value
    Type Description
    VehicleSensorState

    Methods

    AddListener(IStateReceiverListener)

    Declaration
    public void AddListener(IStateReceiverListener listener)
    Parameters
    Type Name Description
    IStateReceiverListener listener

    Disable()

    Called when this backend was the active one and another backend is made the active backend in the StateReceiver.

    Backend should dispose underlying connections and state and release unmanaged resources when this is called.

    Declaration
    public virtual void Disable()

    Enable()

    Called when this backend is made the active backend in the StateReceiver.

    Backend (re)initialization should be started when this is called.

    Declaration
    public virtual void Enable()

    GetInterface<T>()

    Gets the implementation of the specified interface type T, which may be this backend instance or a delegated proxy/composed object.

    Declaration
    public virtual T GetInterface<T>() where T : class
    Returns
    Type Description
    T

    The instance implementing T, or null if not supported.

    Type Parameters
    Name Description
    T

    The interface type to retrieve.

    NotifyListenerConfigurationChanged()

    Declaration
    public virtual void NotifyListenerConfigurationChanged()

    OnApplicationResume()

    Declaration
    public virtual void OnApplicationResume()

    OnDestroy()

    Declaration
    protected virtual void OnDestroy()

    OnListenerAdded(IStateReceiverListener)

    Declaration
    protected virtual void OnListenerAdded(IStateReceiverListener listener)
    Parameters
    Type Name Description
    IStateReceiverListener listener

    OnListenerRemoved(IStateReceiverListener)

    Declaration
    protected virtual void OnListenerRemoved(IStateReceiverListener listener)
    Parameters
    Type Name Description
    IStateReceiverListener listener

    OnMapAccessTokenReceived(string)

    Declaration
    protected void OnMapAccessTokenReceived(string token)
    Parameters
    Type Name Description
    string token

    OnPropertyChanged(string)

    Declaration
    protected void OnPropertyChanged(string propertyName = null)
    Parameters
    Type Name Description
    string propertyName

    OnRouteChanged()

    Notifies the listeners that the route has changed.

    Declaration
    protected void OnRouteChanged()

    OnStateReceivedAsync(VehicleSensorState)

    Fires the OnVehicleLocalizationReceivedAsync(VehicleSensorState) event. Should be called directly and as soon as possible whenever new state is received, even if this call happens from a separate thread.

    Declaration
    protected void OnStateReceivedAsync(VehicleSensorState state)
    Parameters
    Type Name Description
    VehicleSensorState state

    The received state.

    OnStateUpdated()

    Updates the state. Should be called once per physics update.

    Declaration
    protected void OnStateUpdated()

    RemoveListener(IStateReceiverListener)

    Declaration
    public void RemoveListener(IStateReceiverListener listener)
    Parameters
    Type Name Description
    IStateReceiverListener listener

    Update()

    Declaration
    public virtual void Update()

    UpdatePivot(GeoCoordinate)

    This method allows us to update the pivot.

    Declaration
    public virtual void UpdatePivot(GeoCoordinate geoCoordinate)
    Parameters
    Type Name Description
    GeoCoordinate geoCoordinate

    The new pivot position.

    Events

    PropertyChanged

    Declaration
    public event PropertyChangedEventHandler PropertyChanged
    Event Type
    Type Description
    PropertyChangedEventHandler

    Implements

    INotifyPropertyChanged
    In This Article

    Back to top
    ©   holoride
    Privacy   Imprint