@@ -676,11 +676,6 @@ protected override void UpdateTractiveForce(float elapsedClockSeconds, float t,
676
676
if ( TractionMotorType == TractionMotorTypes . AC )
677
677
{
678
678
AbsTractionSpeedMpS = AbsSpeedMpS ;
679
- if ( AbsWheelSpeedMpS > 1.1 * MaxSpeedMpS )
680
- {
681
- AverageForceN = TractiveForceN = 0 ;
682
- return ;
683
- }
684
679
}
685
680
else
686
681
{
@@ -771,6 +766,53 @@ protected override void UpdateTractiveForce(float elapsedClockSeconds, float t,
771
766
SignalEvent ( Event . EnginePowerOff ) ;
772
767
DieselEngines . HandleEvent ( PowerSupplyEvent . StopEngine ) ;
773
768
}
769
+
770
+ ApplyDirectionToTractiveForce ( ) ;
771
+
772
+ // Calculate the total tractive force for the locomotive - ie Traction + Dynamic Braking force.
773
+ // Note typically only one of the above will only ever be non-zero at the one time.
774
+ // For flipped locomotives the force is "flipped" elsewhere, whereas dynamic brake force is "flipped" below by the direction of the speed.
775
+
776
+ if ( DynamicBrakePercent > 0 && DynamicBrakeForceCurves != null && AbsSpeedMpS > 0 )
777
+ {
778
+ float f = DynamicBrakeForceCurves . Get ( .01f * DynamicBrakePercent , AbsTractionSpeedMpS ) ;
779
+ if ( f > 0 && LocomotivePowerSupply . DynamicBrakeAvailable )
780
+ {
781
+ DynamicBrakeForceN = f * ( 1 - PowerReduction ) ;
782
+ TractiveForceN -= ( SpeedMpS > 0 ? 1 : SpeedMpS < 0 ? - 1 : Direction == Direction . Reverse ? - 1 : 1 ) * DynamicBrakeForceN ;
783
+ }
784
+ else
785
+ {
786
+ DynamicBrakeForceN = 0f ;
787
+ }
788
+ }
789
+ else
790
+ DynamicBrakeForceN = 0 ; // Set dynamic brake force to zero if in Notch 0 position
791
+
792
+ foreach ( var motor in TractionMotors )
793
+ {
794
+ motor . UpdateTractiveForce ( elapsedClockSeconds , t ) ;
795
+ }
796
+
797
+ if ( Simulator . UseAdvancedAdhesion && ! Simulator . Settings . SimpleControlPhysics )
798
+ {
799
+ UpdateAxleDriveForce ( ) ;
800
+ }
801
+ }
802
+
803
+ protected override void UpdateAxleDriveForce ( )
804
+ {
805
+ /* TODO: connect different engines to different axles
806
+ if (DieselEngines.HasGearBox && DieselTransmissionType == MSTSDieselLocomotive.DieselTransmissionTypes.Mechanic)
807
+ {
808
+ foreach (var de in DieselEngines)
809
+ {
810
+ }
811
+ }
812
+ else */
813
+ {
814
+ base . UpdateAxleDriveForce ( ) ;
815
+ }
774
816
}
775
817
776
818
/// <summary>
@@ -1088,7 +1130,7 @@ public string GetDpuStatus(bool dataDpu, CABViewControlUnits loadUnits = CABView
1088
1130
if ( FilteredMotiveForceN != 0 )
1089
1131
data = Math . Abs ( this . FilteredMotiveForceN ) ;
1090
1132
else
1091
- data = Math . Abs ( this . LocomotiveAxle . DriveForceN ) ;
1133
+ data = Math . Abs ( TractiveForceN ) ;
1092
1134
if ( DynamicBrakePercent > 0 )
1093
1135
{
1094
1136
data = - Math . Abs ( DynamicBrakeForceN ) ;
0 commit comments