Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit c661756e authored by Michael KRISPER's avatar Michael KRISPER
Browse files

CycleClutch: Corrected wrong switch statement. Now only underload is checked.

parent 34977df0
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,6 @@
* Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology
*/
using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Configuration;
......@@ -65,25 +64,21 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var retVal = NextComponent.Request(absTime, dt, outTorque, angularVelocityIn, dryRun);
if (dryRun) {
return retVal;
} else {
retVal.Switch().
Case<ResponseSuccess>().
Case<ResponseUnderload>(r => {
var angularSpeed = SearchAlgorithm.Search(angularVelocityIn, r.Delta,
Constants.SimulationSettings.EngineIdlingSearchInterval,
getYValue: result => ((ResponseDryRun)result).DeltaDragLoad,
evaluateFunction: n => NextComponent.Request(absTime, dt, outTorque, n, true),
criterion: result => ((ResponseDryRun)result).DeltaDragLoad.Value());
Log.Debug(
"Found operating point for idling in cycle clutch. absTime: {0}, dt: {1}, torque: {2}, angularSpeed: {3}",
absTime, dt,
outTorque, angularSpeed);
retVal = NextComponent.Request(absTime, dt, outTorque, angularSpeed);
}).
Default(r => { throw new UnexpectedResponseException("searching CycleClutch Idling point", r); });
}
return retVal;
var r = retVal as ResponseUnderload;
if (r != null) {
var angularSpeed = SearchAlgorithm.Search(angularVelocityIn, r.Delta,
Constants.SimulationSettings.EngineIdlingSearchInterval,
getYValue: result => ((ResponseDryRun)result).DeltaDragLoad,
evaluateFunction: n => NextComponent.Request(absTime, dt, outTorque, n, true),
criterion: result => ((ResponseDryRun)result).DeltaDragLoad.Value());
Log.Debug(
"Found operating point for idling in cycle clutch. absTime: {0}, dt: {1}, torque: {2}, angularSpeed: {3}",
absTime, dt, outTorque, angularSpeed);
retVal = NextComponent.Request(absTime, dt, outTorque, angularSpeed);
}
return retVal;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment