public HandTimingCalc(HandTimingVMEntry entry, IEnumerable <HandTimingVMEntry> sortedEntries) { _usedEntries = new List <HandTimingVMEntry>(); _entryToCalculate = entry; findAndStoreEntriesToUse(new List <HandTimingVMEntry>(sortedEntries)); calculateHandTime(); }
public void Dissolve(HandTimingVMEntry entry) { // Only split if there is something to split if (entry.HandTime != null && entry.StartNumber != null) { // Create entry for handtime HandTimingVMEntry entryHT = new HandTimingVMEntry(entry.TimeModus, null, entry.HandTime); entry.SetHandTime(null); _handTimings.InsertSorted(entryHT, _handTimingsSorter); } }
public void AssignStartNumber(HandTimingVMEntry entry, uint startNumber) { // Find entry with correct startnumber HandTimingVMEntry entrySN = _handTimings.FirstOrDefault(x => x.StartNumber == startNumber); if (entrySN != null) { // Merge entrys entrySN.SetHandTime(entry.HandTime); _handTimings.Remove(entry); } else { entry.StartNumber = startNumber; } _handTimings.Sort(_handTimingsSorter); }
public void AddHandTimings(IEnumerable <TimingData> handTimings) { foreach (var ht in handTimings) { HandTimingVMEntry e = findEntry(ht); if (e != null && e.HandTime == ht.Time) { // Do nothing } else if (e != null && e.HandTime == null) { e.SetHandTime(ht.Time); } else { _handTimings.InsertSorted(new HandTimingVMEntry(_timeModus, null, ht.Time), _handTimingsSorter); } } _handTimings.Sort(_handTimingsSorter); }
public void AddRunResults(IEnumerable <RunResult> runResults) { foreach (var rr in runResults) { HandTimingVMEntry e = findEntry(rr); if (e != null && e.OriginalRunResult == rr) { // Do nothing } else if (e != null && e.ATime == null) { e.SetRunResult(rr); } else { _handTimings.InsertSorted(new HandTimingVMEntry(_timeModus, rr, null), _handTimingsSorter); } } _handTimings.Sort(_handTimingsSorter); }
protected void addLineToTable(Table table, HandTimingVMEntry data, int i) { Color bgColor = ColorConstants.WHITE;// new DeviceRgb(0.97f, 0.97f, 0.97f); if (i % 2 == 1) { bgColor = PDFHelper.ColorRHBG1; } bool bManuallyAdjustedEntry = data.ManuallyAdjustedFinishTime || data.ManuallyAdjustedStartTime; // Startnumber var pStNr = createCellParagraphForTable(formatStartNumber((uint)data.StartNumber)); if (bManuallyAdjustedEntry) { pStNr.SetItalic(); } table.AddCell(createCellForTable(TextAlignment.CENTER).SetBackgroundColor(bgColor).Add(pStNr)); // StartTime var pStartTime = createCellParagraphForTable(data.StartTime.ToRaceTimeString()); if (bManuallyAdjustedEntry) { pStartTime.SetItalic(); } if (data.ManuallyAdjustedStartTime) { pStartTime.SetBold(); } table.AddCell(createCellForTable(TextAlignment.CENTER).SetBackgroundColor(bgColor).Add(pStartTime)); // FinishTime var pFinishTime = createCellParagraphForTable(data.FinishTime.ToRaceTimeString()); if (bManuallyAdjustedEntry) { pFinishTime.SetItalic(); } if (data.ManuallyAdjustedFinishTime) { pFinishTime.SetBold(); } table.AddCell(createCellForTable(TextAlignment.CENTER).SetBackgroundColor(bgColor).Add(pFinishTime)); // RunTime var pRunTime = createCellParagraphForTable(data.RunTime.ToRaceTimeString()); if (bManuallyAdjustedEntry) { pRunTime.SetItalic().SetBold(); } table.AddCell(createCellForTable(TextAlignment.CENTER).SetBackgroundColor(bgColor).Add(pRunTime)); // HandTime var pHandTime = createCellParagraphForTable(data.HandTime.ToRaceTimeString()); if (bManuallyAdjustedEntry) { pHandTime.SetItalic(); } table.AddCell(createCellForTable(TextAlignment.CENTER).SetBackgroundColor(bgColor).Add(pHandTime)); // Difference var pHandDiff = createCellParagraphForTable(data.HandTimeDiff.ToRaceTimeString()); if (bManuallyAdjustedEntry) { pHandDiff.SetItalic().SetBold(); } table.AddCell(createCellForTable(TextAlignment.CENTER).SetBackgroundColor(bgColor).Add(pHandDiff)); }