Beispiel #1
0
 public void AddAt(int idx, CaptureSequence s)
 {
     Items.Insert(idx, s);
     if (Items.Count(i => i.Enabled) == 1)
     {
         ActiveSequence = Items.First(i => i.Enabled);
     }
 }
Beispiel #2
0
        public CaptureSequence Clone()
        {
            CaptureSequence clone = new CaptureSequence(ExposureTime, ImageType, FilterType, Binning, TotalExposureCount);

            clone.Gain         = Gain;
            clone.Dither       = Dither;
            clone.DitherAmount = DitherAmount;
            clone.Offset       = Offset;
            return(clone);
        }
Beispiel #3
0
 public void Add(CaptureSequence s)
 {
     Items.Add(s);
     if (Items.Count(i => i.Enabled) == 1)
     {
         ActiveSequence = Items.First(i => i.Enabled);
     }
     HasChanged         = true;
     s.PropertyChanged += Sequence_Item_PropertyChanged;
 }
Beispiel #4
0
        public CaptureSequence GetNextSequenceItem(CaptureSequence currentItem)
        {
            if (Items.Count == 0)
            {
                return(null);
            }

            CaptureSequence seq = currentItem;

            if (Mode == SequenceMode.STANDARD)
            {
                if (seq?.ProgressExposureCount == seq?.TotalExposureCount)
                {
                    //No exposures remaining. Get next Sequence
                    var idx = Items.IndexOf(seq) + 1;
                    seq = Items.Skip(idx).Where(i => i.Enabled).FirstOrDefault();
                    if (seq != null)
                    {
                        return(GetNextSequenceItem(seq));
                    }
                }
            }
            else if (Mode == SequenceMode.ROTATE)
            {
                //Check if all sequences are done
                if (Items.Where(x => x.Enabled).Count() == Items.Where(x => x.ProgressExposureCount == x.TotalExposureCount && x.Enabled).Count())
                {
                    //All sequences done
                    return(null);
                }

                if (seq == Items.FirstOrDefault(i => i.Enabled) && seq?.ProgressExposureCount == 0 && seq?.TotalExposureCount > 0)
                {
                    //first sequence active
                    seq = Items.First(i => i.Enabled);
                }
                else
                {
                    do
                    {
                        var idx = (Items.IndexOf(seq) + 1) % Items.Count;
                        seq = Items[idx];
                    } while (!seq.Enabled);
                }

                if (seq.ProgressExposureCount == seq.TotalExposureCount)
                {
                    return(this.GetNextSequenceItem(seq)); //Search for next sequence where exposurecount > 0
                }
            }

            return(seq);
        }
Beispiel #5
0
 public CaptureSequenceList(CaptureSequence seq) : this()
 {
     Add(seq);
     HasChanged = false;
 }