public PS_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 PhaseTableSequence(this); break; default: Type = eTypeObjectStream.Default; break; } } else if (Type == eTypeObjectStream.Table) { Table = new PhaseTableSequence(this); } else { Type = eTypeObjectStream.Default; } }
public PH_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: case eTypeObjectStream.Table1D2D: Table = new PhaseTableSequence(this); break; case eTypeObjectStream.TableShape: if (data != null) { Table = (PhaseTableSequence)data; } else { Table = new PhaseTableSequence(this); } break; case eTypeObjectStream.Continue: break; case eTypeObjectStream.AsynchronousStart: Asynchronus = new AsynchronusObject((string)data); break; case eTypeObjectStream.AsynchronousStop: case eTypeObjectStream.Asynchronous: break; default: Type = eTypeObjectStream.Default; break; } } else if (Type == eTypeObjectStream.Table) { Table = new PhaseTableSequence(this); } else { Type = eTypeObjectStream.Default; } }
public PS_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 (DoubleValue.IsCheck(@string)) { Value = new DoubleValue(@string); } else if (CheckedVariableName(ref @string)) { Variable = new SequenceVariable(@string, new DoubleValue(0)); } else { Type = eTypeObjectStream.Default; } } else if (DoubleValue.IsCheck(@string)) { Value = new DoubleValue(@string); } else if (CheckedTableName(ref @string)) { Table = new PhaseTableSequence(this, @string); } else { Type = eTypeObjectStream.Default; } } else { if (CheckedTableName(ref @string)) { Table = new PhaseTableSequence(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); }