public HandTimingVMEntry findEntry(TimingData td) { foreach (var e in _handTimings) { if (e.HandTime == td.Time) { return(e); } if (e.ATime == null) { continue; } TimeSpan?hTime = td.Time; if (hTime == null) { continue; } if (Math.Abs(((TimeSpan)hTime).Subtract((TimeSpan)e.ATime).TotalMilliseconds) < _finEntryMaxDifferenceMS) { return(e); } } return(null); }
public IEnumerable <TimingData> TimingData() { do { TagHeuerData parsedData = null; try { string dataLine = _parser.TrimNewEndLine(_serialPort.ReadLine()); if (dataLine.StartsWith("DE ")) // until "DE NN" { break; } parsedData = _parser.ParseRR(dataLine); } catch (TimeoutException) { break; // no new data } catch (Exception) { } TimingData td = new TimingData { Time = (_synchroTime + parsedData.Time).TimeOfDay }; reportProgress(td.Time.ToString()); yield return(td); } while (true); reportFinal(); }
public IEnumerable <TimingData> TimingData() { do { try { string dataLine = _serialPort.ReadLine(); if (dataLine.StartsWith(" ALGE-TIMING")) { // End of data => read two more lines _serialPort.ReadLine(); // " TIMY V 1982" _serialPort.ReadLine(); // "20-10-04 16:54" break; } _parser.Parse(dataLine); } catch (TimeoutException) { break; // no new data } catch (Exception) { } if (_parser.TimingData != null) { TimingData td = new TimingData { Time = _parser.TimingData.Time }; reportProgress(td.Time.ToString()); yield return(td); } } while (true); reportFinal(); }