private static SlotRunData GetSlotRunDataLegacy(SlotRun slotRun) { var slotRunData = new SlotRunData(); foreach (var unitRun in slotRun.UnitRuns) { AddWorkUnitResult(slotRunData, unitRun.Data.WorkUnitResult); if (slotRunData.TotalCompletedUnits == null) { slotRunData.TotalCompletedUnits = unitRun.Data.TotalCompletedUnits; } } // try to get the status from the most recent unit run var lastUnitRun = slotRun.UnitRuns.FirstOrDefault(); if (lastUnitRun != null) { slotRunData.Status = GetSlotRunDataStatusLegacy(lastUnitRun.LogLines); } else { // otherwise, get the status from the parent ClientRun slotRunData.Status = GetSlotRunDataStatusLegacy(slotRun.Parent.LogLines); } return(slotRunData); }
public UnitRun(SlotRun parent) { _parent = parent; _logLines = new ObservableCollection <LogLine>(); _logLines.CollectionChanged += (s, e) => IsDirty = true; }
/// <summary> /// Initializes a new instance of the <see cref="UnitRun"/> class. /// </summary> /// <param name="parent">The parent <see cref="SlotRun"/> object.</param> /// <param name="queueIndex">The queue index.</param> /// <param name="startIndex">The log line index for the starting line of this unit run.</param> public UnitRun(SlotRun parent, int queueIndex, int startIndex) { Parent = parent; QueueIndex = queueIndex; StartIndex = startIndex; _logLines = new ObservableCollection <LogLine>(); _logLines.CollectionChanged += (s, e) => IsDirty = true; }
internal UnitRun(SlotRun parent, int?queueIndex, int?startIndex, int?endIndex) { _parent = parent; QueueIndex = queueIndex; StartIndex = startIndex; EndIndex = endIndex; _logLines = new ObservableCollection <LogLine>(); _logLines.CollectionChanged += (s, e) => IsDirty = true; }
private static SlotRunData GetSlotRunDataFahClient(SlotRun slotRun) { var slotRunData = new SlotRunData(); foreach (var unitRun in slotRun.UnitRuns) { AddWorkUnitResult(slotRunData, unitRun.Data.WorkUnitResult); } return(slotRunData); }
internal static SlotRunData GetSlotRunData(SlotRun slotRun) { switch (slotRun.Parent.Parent.FahLogType) { case FahLogType.Legacy: return(GetSlotRunDataLegacy(slotRun)); case FahLogType.FahClient: return(GetSlotRunDataFahClient(slotRun)); } throw new ArgumentException("SlotRun FahLogType unknown", "slotRun"); }
/// <summary> /// Creates a new <see cref="SlotRunData"/> object from the information contained in the <see cref="SlotRun"/> object. /// </summary> protected override SlotRunData OnGetSlotRunData(SlotRun slotRun) { var slotRunData = new FahClientSlotRunData(); int count = slotRun.UnitRuns.Count; for (int i = 0; i < count; i++) { var unitRun = slotRun.UnitRuns[i]; Internal.CommonRunDataAggregator.IncrementCompletedOrFailedUnitCount(slotRunData, unitRun.Data); } return(slotRunData); }
public SlotRunLogLineEnumerable(SlotRun source) { _source = source ?? throw new ArgumentNullException(nameof(source)); }
/// <summary> /// Creates and returns a <see cref="LogLineEnumerable"/> from an <see cref="SlotRun"/> source. /// </summary> /// <param name="source">The enumeration source.</param> /// <returns>A <see cref="LogLineEnumerable"/> from an <see cref="SlotRun"/> source.</returns> public static LogLineEnumerable Create(SlotRun source) { return(new SlotRunLogLineEnumerable(source)); }
/// <summary> /// Initializes a new instance of the <see cref="FahClientUnitRun"/> class. /// </summary> /// <param name="parent">The parent <see cref="SlotRun"/> object.</param> /// <param name="queueIndex">The queue index.</param> /// <param name="startIndex">The log line index for the starting line of this unit run.</param> internal FahClientUnitRun(SlotRun parent, int queueIndex, int startIndex) : base(parent, queueIndex, startIndex) { }
private static FahClientUnitRun GetMostRecentUnitRun(SlotRun slotRun, int queueIndex) { return(slotRun.UnitRuns .LastOrDefault <UnitRun, FahClientUnitRun>(x => x.QueueIndex == queueIndex && !x.IsComplete)); }
/// <summary> /// Creates a new <see cref="SlotRunData"/> object from the information contained in the <see cref="SlotRun"/> object. /// </summary> protected abstract SlotRunData OnGetSlotRunData(SlotRun slotRun);
/// <summary> /// Creates a new <see cref="SlotRunData"/> object from the information contained in the <see cref="SlotRun"/> object. /// </summary> public SlotRunData GetSlotRunData(SlotRun slotRun) { return(OnGetSlotRunData(slotRun)); }
private static UnitRun GetMostRecentUnitRun(SlotRun slotRun, int queueIndex) { return(slotRun.UnitRuns.FirstOrDefault(x => x.QueueIndex == queueIndex && !x.IsComplete)); }