Пример #1
0
        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);
        }
Пример #2
0
        public UnitRun(SlotRun parent)
        {
            _parent = parent;

            _logLines = new ObservableCollection <LogLine>();
            _logLines.CollectionChanged += (s, e) => IsDirty = true;
        }
Пример #3
0
        /// <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;
        }
Пример #4
0
        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;
        }
Пример #5
0
        private static SlotRunData GetSlotRunDataFahClient(SlotRun slotRun)
        {
            var slotRunData = new SlotRunData();

            foreach (var unitRun in slotRun.UnitRuns)
            {
                AddWorkUnitResult(slotRunData, unitRun.Data.WorkUnitResult);
            }

            return(slotRunData);
        }
Пример #6
0
        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);
        }
Пример #8
0
 public SlotRunLogLineEnumerable(SlotRun source)
 {
     _source = source ?? throw new ArgumentNullException(nameof(source));
 }
Пример #9
0
 /// <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));
 }
Пример #10
0
 /// <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)
 {
 }
Пример #11
0
 private static FahClientUnitRun GetMostRecentUnitRun(SlotRun slotRun, int queueIndex)
 {
     return(slotRun.UnitRuns
            .LastOrDefault <UnitRun, FahClientUnitRun>(x => x.QueueIndex == queueIndex && !x.IsComplete));
 }
Пример #12
0
 /// <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);
Пример #13
0
 /// <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));
 }
Пример #14
0
 private static UnitRun GetMostRecentUnitRun(SlotRun slotRun, int queueIndex)
 {
     return(slotRun.UnitRuns.FirstOrDefault(x => x.QueueIndex == queueIndex && !x.IsComplete));
 }