Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 39c3df4d authored by Stefanos DOUMPOULAKIS's avatar Stefanos DOUMPOULAKIS
Browse files

Merge branch 'trailer-issue-39' into 'trailer'

fix #39: allow all axles as steered for type DA

Closes #39

See merge request !7
parents 2ddf72b0 d08da56a
No related branches found
No related tags found
1 merge request!7fix #39: allow all axles as steered for type DA
......@@ -67,6 +67,8 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
public class DeclarationTrailerDataAdapter : AbstractSimulationDataAdapter, IDeclarationDataAdapterTrailer
{
public const int MAX_TRAILER_AXLES = 4;
public class AxleProperties
{
public AxleProperties(int axleCount)
......@@ -551,7 +553,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
}
public static void CalculateSteeredAndLiftFactor(Mission mission, LoadingType loadingType, List<AxleProperties> axles,
out double axleFcFactor)
TypeTrailer typeTrailer, out double axleFcFactor)
{
axleFcFactor = 1;
double steerBonus = 0;
......@@ -595,8 +597,20 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
//Special Case #4
if (axles.Count(x => x.Steered && !x.Liftable) == 2) {
if ((typeTrailer != TypeTrailer.DA) || (axles.Count() == 3)) {
steerBonus = 1.2 * steeredMissionImpact;
axleFcFactor = (1 + steerBonus / 100);
if (typeTrailer == TypeTrailer.DA) {
return;
}
}
}
if ((typeTrailer == TypeTrailer.DA) && (axles.Count(x => x.Steered && !x.Liftable) == 3)) {
steerBonus = 1.2 * steeredMissionImpact;
axleFcFactor = (1 + steerBonus / 100);
return;
}
// Special Case #5
......@@ -644,7 +658,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
axles[0].Steered = false;
}
CalculateSteeredAndLiftFactor(mission, loadingType, axles, out axleFcFactor);
CalculateSteeredAndLiftFactor(mission, loadingType, axles, trailerType, out axleFcFactor);
}
......@@ -1204,7 +1218,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter
case NumberOfTrailerAxles.Three when trailer.TrailerType == TypeTrailer.DB && (trailer.Axles[0].Liftable || trailer.Axles[1].Steered):
case NumberOfTrailerAxles.Three when trailer.TrailerType == TypeTrailer.DC && (trailer.Axles[1].Liftable || trailer.Axles[0].Steered || trailer.Axles[1].Steered):
case NumberOfTrailerAxles.Three when liftableCount > 2: //too many liftable
case NumberOfTrailerAxles.Three when trailer.Axles.Count(x => x.Steered) > 2:
case NumberOfTrailerAxles.Three when trailer.Axles.Count(x => x.Steered) > MAX_TRAILER_AXLES:
errors.Add("Wrong axle configuration");
error = true;
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment