/// <summary> /// Handle new measurement data from the Proximity Board. /// </summary> /// <param name="measurement">Measurement Data</param> void SonarMeasurementHandler(SonarData measurement) { //Tracer.Trace("TrackRoamerBrickProximityBoardService::SonarMeasurementHandler()"); try { _state.LastSampleTimestamp = new DateTime(measurement.TimeStamp); _state.MostRecentSonar = new SonarDataDssSerializable(measurement); _state.LinkState = "receiving Sonar Data"; // // Inform subscribed services that the state has changed. // _submgrPort.Post(new submgr.Submit(_state, DsspActions.ReplaceRequest)); UpdateSonarData usd = new UpdateSonarData(); usd.Body = _state.MostRecentSonar; //Tracer.Trace(" ========= sending UpdateSonarData notification =================="); base.SendNotification(_submgrPort, usd); } catch (Exception e) { _state.LinkState = "Error while receiving Sonar Data"; LogError(e); } }
/// <summary> /// Handle new measurement data from the Proximity Board. /// </summary> /// <param name="measurement">Measurement Data</param> void SonarMeasurementHandler(SonarData measurement) { //Tracer.Trace("TrackRoamerBrickProximityBoardService::SonarMeasurementHandler()"); try { _state.LastSampleTimestamp = new DateTime(measurement.TimeStamp); _state.MostRecentSonar = new SonarDataDssSerializable(measurement); _state.LinkState = "receiving Sonar Data"; // // Inform subscribed services that the state has changed. // _submgrPort.Post(new submgr.Submit(_state, DsspActions.ReplaceRequest)); UpdateSonarData usd = new UpdateSonarData(); usd.Body = _state.MostRecentSonar; //Tracer.Trace(" ========= sending UpdateSonarData notification =================="); base.SendNotification(_submgrPort, usd); } catch (Exception e) { _state.LinkState = "Error while receiving Sonar Data"; LogError(e); } }