Exemplo n.º 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);
        }
Exemplo n.º 2
0
        public UnitRun(SlotRun parent)
        {
            _parent = parent;

            _logLines = new ObservableCollection <LogLine>();
            _logLines.CollectionChanged += (s, e) => IsDirty = true;
        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 8
0
 public SlotRunLogLineEnumerable(SlotRun source)
 {
     _source = source ?? throw new ArgumentNullException(nameof(source));
 }
Exemplo n.º 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));
 }
Exemplo n.º 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)
 {
 }
Exemplo n.º 11
0
 private static FahClientUnitRun GetMostRecentUnitRun(SlotRun slotRun, int queueIndex)
 {
     return(slotRun.UnitRuns
            .LastOrDefault <UnitRun, FahClientUnitRun>(x => x.QueueIndex == queueIndex && !x.IsComplete));
 }
Exemplo n.º 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);
Exemplo n.º 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));
 }
Exemplo n.º 14
0
 private static UnitRun GetMostRecentUnitRun(SlotRun slotRun, int queueIndex)
 {
     return(slotRun.UnitRuns.FirstOrDefault(x => x.QueueIndex == queueIndex && !x.IsComplete));
 }