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

Skip to content
Snippets Groups Projects
Commit 1f5738ad authored by Markus QUARITSCH's avatar Markus QUARITSCH
Browse files

adding helper to get number of axles for an axleConfiguration

parent f5cc0ef2
No related branches found
No related tags found
Loading
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
* Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology
*/ */
using System;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using TUGraz.VectoCommon.Utils; using TUGraz.VectoCommon.Utils;
...@@ -68,5 +69,24 @@ namespace TUGraz.VectoCommon.Models ...@@ -68,5 +69,24 @@ namespace TUGraz.VectoCommon.Models
{ {
return (Prefix + typeString).ParseEnum<AxleConfiguration>(); return (Prefix + typeString).ParseEnum<AxleConfiguration>();
} }
public static int NumAxles(this AxleConfiguration self)
{
switch (self) {
case AxleConfiguration.AxleConfig_4x2:
case AxleConfiguration.AxleConfig_4x4:
return 2;
case AxleConfiguration.AxleConfig_6x2:
case AxleConfiguration.AxleConfig_6x4:
case AxleConfiguration.AxleConfig_6x6:
return 3;
case AxleConfiguration.AxleConfig_8x2:
case AxleConfiguration.AxleConfig_8x4:
case AxleConfiguration.AxleConfig_8x6:
case AxleConfiguration.AxleConfig_8x8:
return 4;
}
return 0;
}
} }
} }
\ No newline at end of file
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