public Loop_ObjectSequence(IStream element, int index, eTypeObjectCollection typeCollection, eTypeObjectStream type, object data = null) : base(element, index, typeCollection) { Type = type; if (typeCollection == eTypeObjectCollection._1D) { switch (Type) { case eTypeObjectStream.Table: Table = new LoopTableSequence(this); break; default: Type = eTypeObjectStream.Default; break; } } else if (Type == eTypeObjectStream.Table) { Table = new LoopTableSequence(this); } else { Type = eTypeObjectStream.Default; } }
public Loop_ObjectSequence(IStream element, int index, eTypeObjectCollection typeCollection, string text) : base(element, index, typeCollection) { string @string = text.Trim(); if (typeCollection == eTypeObjectCollection._1D) { if (@string.StartsWith("=")) { @string = @string.Substring(1).Trim(); if (IntegerValue.IsCheck(@string)) { Value = new IntegerValue(@string); } else if (CheckedVariableName(ref @string)) { Variable = new SequenceVariable(@string, new IntegerValue(1)); } else { Type = eTypeObjectStream.Default; } } else if (IntegerValue.IsCheck(@string)) { Value = new IntegerValue(@string); } else if (CheckedTableName(ref @string)) { Table = new LoopTableSequence(this, @string); } else { Type = eTypeObjectStream.Default; } } else { if (CheckedTableName(ref @string)) { Table = new LoopTableSequence(this, @string); } else { Type = eTypeObjectStream.Default; } } }
/// <summary> /// Статический метод для создания экземпляров класса на основе данных импорта /// </summary> /// <param name="table">Объект содержащий данные импорта</param> /// <returns>Объект таблицы</returns> public static TableSequence CreateInstance(SequenceTable table) { TableSequence objectTable; switch (table.typeOfTable) { case 0x00000001: objectTable = new DelayTableSequence( ); break; case 0x0000000D: objectTable = new LoopTableSequence( ); break; case 0x00004154: case 0x00004132: objectTable = new AttenuationTableSequence( ); break; case 0x00004143: objectTable = new AcquisitionTableSequence( ); break; case 0x00004741: objectTable = new RotationAngleTableSequence( ); break; case 0x00004752: case 0x00004732: objectTable = new GradientAmplitudeTableSequence( ); break; case 0x00004F31: objectTable = new FrequencyTableSequence( ); break; case 0x0000524D: case 0x00005232: objectTable = new ModulationTableSequence( ); break; case 0x00005048: case 0x00005032: case 0x00005053: objectTable = new PhaseTableSequence( ); break; case 0x00005348: objectTable = new GradientWaveformTableSequence( ); break; default: objectTable = new TableSequence( ); break; } objectTable.Name = table.name; objectTable.TypeTable = objectTable.GetTypeTable(table.dimension); objectTable.Data = new DataTable( ); objectTable.Data.Auto = table.isAuto; objectTable.Data.Steps = table.stepsPer360Cycle.ToString(); objectTable.Data.TimePoint = table.timePoint; objectTable.Text = table.entry; if (objectTable._delayAuto != null) { objectTable._delayAuto.UseDwellTime = table.useIncrementList; objectTable._delayAuto.Increment = table.incrementValue; objectTable._delayAuto.Every = table.incrementOperation == "+ Add" ? 0 : 1; objectTable._delayAuto.Add = table.incrementOperation == "Every pass" ? 0 : 1; objectTable._delayAuto.Table = objectTable; } if (objectTable._generateAuto != null) { objectTable._generateAuto.Start = table.start; objectTable._generateAuto.Increment = table.increment; objectTable._generateAuto.Number = table.number; objectTable._generateAuto.Table = objectTable; } return(objectTable); }