Loading...
Searching...
No Matches

Walks a polyline at a constant speed for demos and guidance QA. More...

#include <com/navigine/idl/objc/NCRouteSimulator.h>

Inherits NSObject.

Instance Methods

(BOOL) - setGeometry:
 Geometry in walk order. A later polyline may be on another floor.
 
(void) - setSpeed:
 Walking speed in meters per second. Default is 1.4. Zero pauses motion.
 
(float) - speed
 Current speed in meters per second.
 
(BOOL) - start
 Starts from the beginning, or continues when already active.
 
(void) - stop
 Stops and rewinds to the start. Does not emit onFinished.
 
(BOOL) - active
 True while a walk is in progress.
 
(nullable NCRouteSimulatorSample *) - sample
 Latest sample, or null before the first tick.
 
(void) - addListener:
 
(void) - removeListener:
 

Properties

BOOL valid
 

Detailed Description

Walks a polyline at a constant speed for demos and guidance QA.

Distinct from MeasurementManager signal generators. Does not publish a navigation position and does not move the user-location layer. Hosts apply sample to an icon or other preview.

Created with NavigineSdk getRouteSimulator.

Definition at line 26 of file NCRouteSimulator.h.

Method Documentation

◆ active

- (BOOL) active

True while a walk is in progress.

◆ addListener:

- (void) addListener: (nullable id< NCRouteSimulatorListener >) listener

◆ removeListener:

- (void) removeListener: (nullable id< NCRouteSimulatorListener >) listener

◆ sample

- (nullable NCRouteSimulatorSample *) sample

Latest sample, or null before the first tick.

Swift code snippet:

if let sample = routeSimulator.sample() {
print("Walk advance: \‍(sample.advance) m")
}

Objective C code snippet:

NCRouteSimulatorSample *sample = [routeSimulator sample];
if (sample) {
NSLog(@"Walk advance: %f m", sample.advance);
}

◆ setGeometry:

- (BOOL) setGeometry: (nonnull NSArray< NCLocationPolyline * > *) polylines

Geometry in walk order. A later polyline may be on another floor.

Returns
false when fewer than two distinct points were given.

Swift code snippet:

let walk = NCLocationPolyline(points: [
NCGlobalPoint(latitude: 55.751, longitude: 37.618),
NCGlobalPoint(latitude: 55.752, longitude: 37.618),
], sublocationId: nil)
_ = routeSimulator.setGeometry([walk])

Objective C code snippet:

NCLocationPolyline *walk = [[NCLocationPolyline alloc] initWithPoints:@[
[[NCGlobalPoint alloc] initWithLatitude:55.751 longitude:37.618],
[[NCGlobalPoint alloc] initWithLatitude:55.752 longitude:37.618],
] sublocationId:nil];
[routeSimulator setGeometry:@[walk]];

◆ setSpeed:

- (void) setSpeed: (float) metersPerSecond

Walking speed in meters per second. Default is 1.4. Zero pauses motion.

Swift code snippet:

routeSimulator.setSpeed(1.4)

Objective C code snippet:

[routeSimulator setSpeed:1.4f];

◆ speed

- (float) speed

Current speed in meters per second.

◆ start

- (BOOL) start

Starts from the beginning, or continues when already active.

Returns
false when geometry is missing.

Swift code snippet:

let started = routeSimulator.start()
print("Route walk started: \‍(started)")

Objective C code snippet:

BOOL started = [routeSimulator start];
NSLog(@"Route walk started: %@", started ? @"YES" : @"NO");

◆ stop

- (void) stop

Stops and rewinds to the start. Does not emit onFinished.

Property Documentation

◆ valid

- (BOOL) valid
readnonatomicassign

Tells if this object is valid or not. Any method called on an invalid object will throw an exception. The object becomes invalid only on UI thread, and only when its implementation depends on objects already destroyed by now.

Definition at line 118 of file NCRouteSimulator.h.


The documentation for this class was generated from the following file: