public AbstractMotor ParamsToMotor(ParametersCollection pc) { AbstractMotor motor = GetSampleMotor();//new default Dictionary <String, object> objs = new Dictionary <string, object>(); objs.Add("Motor\\General(" + motor.GeneralParams.GetType().Name + ")", motor.GeneralParams); objs.Add("Motor\\Rotor(" + motor.Rotor.GetType().Name + ")", motor.Rotor); objs.Add("Motor\\Stator(" + motor.Stator.GetType().Name + ")", motor.Stator); //objs.Add("Motor\\Materials", motor.MaterialParams); objs.Add("Motor\\Airgap(" + motor.Airgap.GetType().Name + ")", motor.Airgap); foreach (String objname in objs.Keys) { pc.putValuesToObject(objname, objs[objname]); } return(motor); }
private AbstractMotor ParamsToMotor(ParametersCollection pc) { ProjectManager pm = ProjectManager.GetInstance(); AbstractMotor motor = pm.GetSampleMotor();//new default Dictionary <String, object> objs = new Dictionary <string, object>(); objs.Add("Motor\\General", motor.GeneralParams); objs.Add("Motor\\Rotor", motor.Rotor); objs.Add("Motor\\Stator", motor.Stator); //objs.Add("Motor\\Materials", motor.MaterialParams); objs.Add("Motor\\Airgap", motor.Airgap); foreach (String objname in objs.Keys) { pc.putValuesToObject(objname, objs[objname]); } return(motor); }