Skip to content

Commit d1fc31f

Browse files
committed
Add LOG file indication that default values have been selected.
1 parent 6d911d7 commit d1fc31f

File tree

1 file changed

+23
-2
lines changed
  • Source/Orts.Simulation/Simulation/RollingStocks

1 file changed

+23
-2
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/TrainCar.cs

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,6 @@ public virtual void Initialize()
820820
// called when it's time to update the MotiveForce and FrictionForce
821821
public virtual void Update(float elapsedClockSeconds)
822822
{
823-
824823
// Initialize RigidWheelBaseM in first loop if not defined in ENG file, then ignore
825824
if (RigidWheelBaseM == 0 && !RigidWheelBaseInitialised) // Calculate default values if no value in Wag File
826825
{
@@ -844,6 +843,12 @@ public virtual void Update(float elapsedClockSeconds)
844843
{
845844
RigidWheelBaseM = 3.6576f; // Assume a standard 6 wheel (3 axle) wagon - wheel base - 12' 2" (3.6576m)
846845
}
846+
847+
if (Simulator.Settings.VerboseConfigurationMessages)
848+
{
849+
Trace.TraceInformation("Rigid Wheelbase of CarID {0} set to {1} for number of axles {2}", CarID, FormatStrings.FormatVeryShortDistanceDisplay(RigidWheelBaseM, IsMetric), Axles);
850+
}
851+
847852
}
848853
else if (Bogies == 2)
849854
{
@@ -862,9 +867,15 @@ public virtual void Update(float elapsedClockSeconds)
862867
{
863868
RigidWheelBaseM = 3.6576f; // Assume a standard 6 wheel bogie (3 axle) wagon - wheel base - 12' 2" (3.6576m)
864869
}
870+
871+
if (Simulator.Settings.VerboseConfigurationMessages)
872+
{
873+
Trace.TraceInformation("Rigid Wheelbase of CarID {0} set to {1} for number of axles {2}", CarID, FormatStrings.FormatVeryShortDistanceDisplay(RigidWheelBaseM, IsMetric), BogieSize);
874+
}
875+
865876
}
866877
}
867-
if (WagonType == WagonTypes.Engine) // if car is a locomotive and either a diesel or electric then determine wheelbase
878+
else if (WagonType == WagonTypes.Engine) // if car is a locomotive and either a diesel or electric then determine wheelbase
868879
{
869880
if (EngineType != EngineTypes.Steam) // Assume that it is a diesel or electric locomotive
870881
{
@@ -876,6 +887,11 @@ public virtual void Update(float elapsedClockSeconds)
876887
{
877888
RigidWheelBaseM = 3.5052f; // Assume a standard 6 wheel bogie (3 axle) locomotive - wheel base - 11' 6" (3.5052m)
878889
}
890+
891+
if (Simulator.Settings.VerboseConfigurationMessages)
892+
{
893+
Trace.TraceInformation("Rigid Wheelbase of CarID {0} set to {1} for number of axles {2}", CarID, FormatStrings.FormatVeryShortDistanceDisplay(RigidWheelBaseM, IsMetric), BogieSize);
894+
}
879895
}
880896
else // assume steam locomotive
881897
{
@@ -889,6 +905,11 @@ public virtual void Update(float elapsedClockSeconds)
889905
// Wheelbase = 1.25 x (Loco Drive Axles - 1.0) x Drive Wheel diameter
890906

891907
RigidWheelBaseM = 1.25f * (LocoNumDrvAxles - 1.0f) * (DriverWheelRadiusM * 2.0f);
908+
909+
if (Simulator.Settings.VerboseConfigurationMessages)
910+
{
911+
Trace.TraceInformation("Rigid Wheelbase of CarID {0} set to {1} for number of axles {2}", CarID, FormatStrings.FormatVeryShortDistanceDisplay(RigidWheelBaseM, IsMetric), LocoNumDrvAxles);
912+
}
892913
}
893914
}
894915

0 commit comments

Comments
 (0)