public SH_ObjectSequence(IStream element, int index, eTypeObjectCollection typeCollection, string text) : base(element, index, typeCollection) { string @string = text.Trim(); 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), new DoubleValue(-100), new DoubleValue(100), null); } else { Type = eTypeObjectStream.Default; } } else if (DoubleValue.IsCheck(@string)) { Value = new DoubleValue(@string); } else if (CheckedTableName(ref @string)) { Table = new GradientWaveformTableSequence(this, @string); } else { Type = eTypeObjectStream.Default; } }
/// <summary> /// Устанавливает спискок значений для таблицы /// </summary> /// <param name="text">Текст содержаший значения</param> public virtual void SetListValues(string text) { _valueList.Clear( ); foreach (Match match in Regex.Matches(text, DoubleValue.stringRegex, RegexOptions.IgnoreCase)) { if (!DoubleValue.IsCheck(match.Value)) { continue; } Value valueObject = new DoubleValue(match.Value); _valueList.Add(valueObject); } }
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; } } }
public override void SetListValues(string text) { _valueList.Clear( ); foreach (Match match in Regex.Matches(text, DoubleValue.stringRegex, RegexOptions.IgnoreCase)) { if (!DoubleValue.IsCheck(match.Value)) { continue; } Value valueObject = new DoubleValue(match.Value); double value = Convert.ToDouble(valueObject.Data); if (value < -100.0) { valueObject.Data = -100.0; } if (value > 100.0) { valueObject.Data = 100.0; } _valueList.Add(valueObject); } }