private void RecalculateAndScaleCurves(object sender, RoutedEventArgs e) {
double maxPower, maxTorque;
if (!FlexibleParser.TryParseDouble(PowerInput.Text, out maxPower) ||
!FlexibleParser.TryParseDouble(TorqueInput.Text, out maxTorque)) {
ShowMessage(AppStrings.CarSpecs_SpecifyPowerAndTorqueFirst, ToolsStrings.Common_CannotDo_Title, MessageBoxButton.OK);
return;
}
Lut torque;
try {
torque = TorquePhysicUtils.LoadCarTorque(Car.AcdData);
} catch (FileNotFoundException ex) {
Logging.Warning(ex);
return;
}
TorqueGraph = new GraphData(torque).ScaleTo(maxTorque);
PowerGraph = new GraphData(torque.Transform(x => x.X * x.Y)).ScaleTo(maxPower);
}