Ejemplo n.º 1
0
        public bool IsSequential()
        {
            if (!Sequences.Any())
            {
                return(false);
            }

            var startsAfterFrom = Sequences[0] - From == 1;

            return(startsAfterFrom && IsCompletelySequential(Sequences));
        }
Ejemplo n.º 2
0
        public long LastEncountered()
        {
            var candidate = NextKnownSequence > 0 ? NextKnownSequence - 1 : LastKnownSequence;

            if (candidate > 0)
            {
                return(candidate);
            }

            if (Sequences.Any())
            {
                return(Sequences.Last());
            }

            return(From);
        }
Ejemplo n.º 3
0
        public List <Tuple <DateTime, Lot> > GetLotStarts()
        {
            if (!Sequences.Any())
            {
                throw new Exception("Sequences has to be filled before getting lot starts");
            }
            else if (RealLotStarts == null)
            {
                throw new Exception("WaferFabSettings does not contain real lot starts. Either run simulation without real lot starts or load them from a serialized file.");
            }

            List <Tuple <DateTime, Lot> > lotStarts = new List <Tuple <DateTime, Lot> >();

            DateTime time = InitialTime == null ? DateTime.MinValue : (DateTime)InitialTime;

            foreach (var real in RealLotStarts.Where(x => x.Item1 >= InitialTime))
            {
                lotStarts.Add(new Tuple <DateTime, Lot>(real.Item1, real.Item2.ConvertToLot(0, Sequences, true, InitialTime)));
            }

            return(lotStarts.Where(x => x.Item2 != null).ToList());
        }
Ejemplo n.º 4
0
        private async Task SelectSequenceAsync()
        {
            if (Sequences.Any())
            {
                var result = await _dialogService.ShowSelectionDialogAsync(
                    Sequences,
                    Translate("SelectSequence"),
                    Translate("Cancel"),
                    _disappearingTokenSource.Token);

                if (result.IsOk)
                {
                    Action.SequenceName = result.SelectedItem;
                }
            }
            else
            {
                await _dialogService.ShowMessageBoxAsync(
                    Translate("Warning"),
                    Translate("NoSequences"),
                    Translate("Ok"),
                    _disappearingTokenSource.Token);
            }
        }
Ejemplo n.º 5
0
 private bool GameWonBy(Mark mark)
 => Sequences.Any(sequence => SequenceFilledByMark(mark, sequence));
Ejemplo n.º 6
0
 public long Ending()
 {
     return(Sequences.Any() ? To : From);
 }