Exemple #1
0
        public void AddSpans(Span[] list, double weight, double H)
        {
            Catenary last = null;

            if (Spans.Count > 0)
            {
                last   = Spans.Last();
                weight = last.CableWeight;
                H      = last.HorizontalTension;
            }
            RaiseListChangedEvents = false;
            for (int i = 0; i < list.Length; i++)
            {
                var cat = new Catenary(list[i], weight, H);
                if (last != null)
                {
                    cat.StartPosition = last.EndPosition;
                }
                Spans.Add(cat);
                last = cat;
            }
            RaiseListChangedEvents = true;

            OnRulingSpanChange(new ItemChangeEventArgs());
        }
Exemple #2
0
        // METHODS
        // -> Basic section handling:
        public void JustAddSpan()
        {
            UserSpan newSpan = new UserSpan(); // add span at the end of current section

            newSpan.PropertyChanged += OnUserSpanPropertyChanged;
            Spans.Add(newSpan);
            OrderingSection();
            SelectedUserSpan = Spans.Last();
        }
Exemple #3
0
        private void OrderingSection()
        {
            int index = 0;

            foreach (UserSpan span in Spans)
            {
                index++;
                span.OrdinalIndex = index;
                span.IsLastSpan   = false;
            }
            Spans.Last().IsLastSpan = true;
        }
Exemple #4
0
 public void JustRemoveSpan() // removes last span
 {
     if (Spans.Count <= 2)
     {
         return;
     }
     Spans.Last().PropertyChanged -= OnUserSpanPropertyChanged;
     Spans.Remove(Spans.Last());
     OrderingSection();
     if (EvaluateNeedToPerformInternalIntegrityCheck())
     {
         CheckInternalIntegrity();
     }
 }
Exemple #5
0
        public void ClearBackToBasicSection()
        {
            int      index = Spans.Count - 1;
            UserSpan span;

            if (Spans.Count > 2)
            {
                do
                {
                    span = Spans.Last();
                    span.PropertyChanged -= OnUserSpanPropertyChanged;
                    Spans.Remove(span);
                    index--;
                } while (index > 1);
            }

            foreach (UserSpan remainingSpan in Spans)
            {
                remainingSpan.Clear();
            }

            OrderingSection();
            _light = IndicatorLight.None;
        }