Beispiel #1
0
        public SectionBase AddSubsection()
        {
            var subsection = new Moment();

            Moments.Add(subsection);
            return(subsection);
        }
Beispiel #2
0
 //Добавляет в Momnets мгновенное значение mv, сохраняя упорядоченность sv по времени
 public void AddMoment(Moment mv)
 {
     if (Moments == null)
     {
         Moments = new List <Moment>();
     }
     if (Moments.Count == 0 || mv.Time > Moments[Moments.Count - 1].Time)
     {
         Moments.Add(mv);
     }
     else if (mv.Time == Moments[Moments.Count - 1].Time)
     {
         Moments.Add(mv.Clone(mv.Time.AddMilliseconds(0.6)));
     }
     else
     {
         int i = Moments.Count - 1;
         while (i >= 0 && Moments[i].Time >= mv.Time)
         {
             i--;
         }
         if (mv.Time != Moments[i + 1].Time)
         {
             Moments.Insert(i + 1, mv);
         }
     }
 }
Beispiel #3
0
 public virtual void AddMoment(IForceCenter moment, bool createNewSK = false)
 {
     AddChild(moment as IScnObj);
     Moments.Add(moment);
     moment.SK = createNewSK ? this : moment.SK;
 }