Code development platform for open source projects from the European Union institutions

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

Merge remote-tracking branch 'origin/develop' into update-net6

parents c01d4109 5a149604
No related tags found
No related merge requests found
......@@ -74,7 +74,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
public GearList(GearshiftPosition[] gearList) => Entries = gearList;
public bool HasPredecessor(GearshiftPosition cur) => cur.Gear != 0 && cur != Entries[0];
public bool HasPredecessor(GearshiftPosition cur) => cur.Gear != 0 && !Entries[0].Equals(cur);
public GearshiftPosition Predecessor(GearshiftPosition cur)
{
......@@ -82,7 +82,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
return idx <= 0 ? null : Entries[idx - 1];
}
public bool HasSuccessor(GearshiftPosition cur) => cur.Gear != 0 && cur != Entries[Entries.Length-1];
public bool HasSuccessor(GearshiftPosition cur) => cur.Gear != 0 && !Entries[Entries.Length-1].Equals(cur);
public GearshiftPosition Successor(GearshiftPosition cur)
{
......
......@@ -71,6 +71,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox
public bool IsBelowDownshiftCurve(NewtonMeter inTorque, PerSecond inAngularVelocity)
{
if (!Downshift.Any()) {
return false;}
var section = Downshift.GetSection(entry => entry.AngularSpeed < inAngularVelocity);
if (section.Item2.AngularSpeed < inAngularVelocity) {
return false;
......@@ -99,6 +101,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Gearbox
public bool IsAboveUpshiftCurve(NewtonMeter inTorque, PerSecond inAngularVelocity)
{
if (!Upshift.Any()) {
return false;
}
var section = Upshift.GetSection(entry => entry.AngularSpeed < inAngularVelocity);
if (section.Item2.AngularSpeed < inAngularVelocity) {
......
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