/// <summary> /// Initializes a new instance of the <see cref="NavMapComponent" /> class. /// </summary> /// <param name="robot">The robot.</param> internal NavMapComponent(Robot robot) : base(robot) { this.navMapFeed = new AsyncEventLoop <NavMapFeedResponse>( (token) => robot.StartStream(client => client.NavMapFeed(new NavMapFeedRequest() { Frequency = Frequency }, cancellationToken: token)), (response) => { var navMapUpdateEventArgs = new NavMapUpdateEventArgs(response); LatestNavMap = navMapUpdateEventArgs.NavMap; NavMapUpdate?.Invoke(this, navMapUpdateEventArgs); }, () => OnPropertyChanged(nameof(IsFeedActive)), robot.PropagateException ); }
/// <summary> /// Initializes a new instance of the <see cref="NavMapUpdateEventArgs" /> class. /// </summary> /// <param name="response">The response.</param> internal NavMapUpdateEventArgs(ExternalInterface.NavMapFeedResponse response) { NavMap = new NavMapGrid(response); }