private Timer CreateMeasurementTimer(MeasurementSettingsEntry entry) { var timer = new MeasurementTimer(entry); timer.Interval = entry.UpdateInterval; timer.Elapsed += Timer_Elapsed; idsToTimers[entry.Id] = timer; return(timer); }
/// <summary> /// Disposes <see cref="Sonar"/> resources /// </summary> protected virtual void Dispose(bool disposing) { if (CenterSonarDevice != null) { if (disposing) { MeasurementTimer.Stop(); MeasurementTimer.Enabled = false; CenterSonarDevice.Dispose(); CenterSonarDevice = null; LeftSonarDevice.Dispose(); LeftSonarDevice = null; RightSonarDevice.Dispose(); RightSonarDevice = null; Log.Debug("Sonar disposed"); } } }