public SimulateUnitSeries ChangeDataType(string _datatype) { int factor = 1; switch (model.Base) { case "D": if (model is SimulateDWordModel) { factor = 2; } if (model is SimulateFloatModel) { factor = 2; } break; default: factor = 1; break; } SimulateVariableModel svmodel = SimulateVariableModel.Create(model.Name, model.Size * factor, _datatype); if (svmodel == null) { return(null); } SimulateUnitSeries ret = new SimulateUnitSeries(svmodel); ret.Name = Name; ret.Var = Var; return(ret); }
public void CreateExpand() { Match mn = Regex.Match(Name, @"\w+"); Match mi = Regex.Match(Name, @"\d+"); string basename = mn.Value; int low = int.Parse(mi.Value); mi = mi.NextMatch(); int high = int.Parse(mi.Value); string _name = String.Format("{0:s}{1:d}", basename, low); int _size = high - low + 1; model = SimulateVariableModel.Create(_name, _size); }