public ActionResult UpdateGraph(String plot, String type, double param1, double param2, double param3, double param4, double endtime, double sample) { List <List <double> > signal = new List <List <double> >(); signal.Add(new List <double>()); signal.Add(new List <double>()); if (type == "Constant") { signal = graphs.GenerateConstant(param1, sample, endtime); } else if (type == "Step") { signal = graphs.GenerateStep(param1, param2, param3, sample, endtime); } else if (type == "Ramp") { signal = graphs.GenerateRamp(param1, param2, param3, sample, endtime); } else if (type == "Sinusoid") { signal = graphs.GenerateSinusoid(param1, param2, param3, param4, sample, endtime); } if (plot == "inputSpeed") { graphs.InputSpeedTrace = signal; } else if (plot == "inputTorque") { graphs.InputTorqueTrace = signal; } return(Json(new { done = true })); }