Ejemplo n.º 1
0
        /// <summary>
        /// Параметризованный конструктор
        /// </summary>
        /// <param name="sequenceRow">Импортируемые данные</param>
        public StreamSequence(SequenceRow sequenceRow)
            : this(new sStreamData(sequenceRow))
        {
            for (int i = 0; i < sequenceRow.sequenceEvent.Length; i++)
            {
                SequenceEvent obj = sequenceRow.sequenceEvent[i];
                if (i == 0)
                {
                    Name = obj.dataString;
                    continue;
                }

                ObjectSequence @object = (ObjectSequence)GetNewObject(eTypeObjectCollection._1D, i - 1);
                if (obj.isTable0D)
                {
                    if (i > 1 && (this[eTypeObjectCollection._1D][i - 2].Type == eTypeObjectStream.TableShape ||
                                  this[eTypeObjectCollection._1D][i - 2].Type == eTypeObjectStream.Continue))
                    {
                        @object.Type = eTypeObjectStream.Continue;
                    }
                    else
                    {
                        @object.Type      = eTypeObjectStream.TableShape;
                        @object.TableName = obj.tableName0D;
                    }
                }
                else if (obj.isTable1D)
                {
                    @object.Type      = eTypeObjectStream.Table;
                    @object.TableName = obj.tableName1D;
                }
                else if (obj.isTable5D)
                {
                    @object.Type      = eTypeObjectStream.Table1D2D;
                    @object.TableName = obj.tableName5D;
                }
                else if (obj.isAqustion)
                {
                    @object.Type        = eTypeObjectStream.Acquisition;
                    @object.Acquisition = new AcquisitionObject(obj.sequenceAcquation, i);
                }
                else if (obj.fileAsynchronus != null && obj.dataString == "@AS")
                {
                    @object.Type        = eTypeObjectStream.AsynchronousStart;
                    @object.Asynchronus = new AsynchronusObject(obj.fileAsynchronus);
                }
                else if (sequenceRow.defalut != obj.dataString)
                {
                    @object.LoadText(obj.dataString);
                }

                ((ObjectCollection)this[eTypeObjectCollection._1D]).Add(@object);

                if (_collectionHash.Count == 1)
                {
                    continue;
                }

                @object = (ObjectSequence)GetNewObject(eTypeObjectCollection._2D, i - 1);
                if (obj.isTable2D)
                {
                    @object.Type      = eTypeObjectStream.Table;
                    @object.TableName = obj.tableName2D;
                }
                ((ObjectCollection)this[eTypeObjectCollection._2D]).Add(@object);

                @object = (ObjectSequence)GetNewObject(eTypeObjectCollection._3D, i - 1);
                if (obj.isTable3D)
                {
                    @object.Type      = eTypeObjectStream.Table;
                    @object.TableName = obj.tableName3D;
                }
                ((ObjectCollection)this[eTypeObjectCollection._3D]).Add(@object);

                @object = (ObjectSequence)GetNewObject(eTypeObjectCollection._4D, i - 1);
                if (obj.isTable4D)
                {
                    @object.Type      = eTypeObjectStream.Table;
                    @object.TableName = obj.tableName4D;
                }
                ((ObjectCollection)this[eTypeObjectCollection._4D]).Add(@object);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Клонирует общие данные объектов
 /// </summary>
 /// <param name="obj">Клонируемый объект</param>
 protected void CloneData(ObjectSequence obj)
 {
     obj._type          = _type;
     obj._object        = (ObjectSequence)_object.Clone( );
     obj.TypeCollection = TypeCollection;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Добавляет объект в коллекцию
 /// </summary>
 /// <param name="@object">Вставляемый объект</param>
 public void Add(ObjectSequence @object)
 {
     _objects.Add(@object);
 }