Skip to content

Commit d8d9709

Browse files
committed
Set receivers for control car
1 parent 4263b21 commit d8d9709

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

Source/Orts.Simulation/Common/Commands.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2155,7 +2155,7 @@ public override void Redo()
21552155
[Serializable()]
21562156
public sealed class TogglePlayerEngineCommand : Command
21572157
{
2158-
public static MSTSDieselLocomotive Receiver { get; set; }
2158+
public static MSTSLocomotive Receiver { get; set; }
21592159

21602160
public TogglePlayerEngineCommand(CommandLog log)
21612161
: base(log)

Source/Orts.Simulation/Simulation/Simulator.cs

+17
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,23 @@ public void SetCommandReceivers()
694694
VacuumExhausterCommand.Receiver = dieselLocomotive;
695695
}
696696

697+
if (PlayerLocomotive is MSTSControlTrailerCar controlCar)
698+
{
699+
VoltageSelectorCommand.Receiver = controlCar.LocomotivePowerSupply;
700+
PantographSelectorCommand.Receiver = controlCar.LocomotivePowerSupply;
701+
PowerLimitationSelectorCommand.Receiver = controlCar.LocomotivePowerSupply;
702+
CircuitBreakerClosingOrderCommand.Receiver = controlCar.LocomotivePowerSupply;
703+
CircuitBreakerClosingOrderButtonCommand.Receiver = controlCar.LocomotivePowerSupply;
704+
CircuitBreakerOpeningOrderButtonCommand.Receiver = controlCar.LocomotivePowerSupply;
705+
CircuitBreakerClosingAuthorizationCommand.Receiver = controlCar.LocomotivePowerSupply;
706+
707+
TractionCutOffRelayClosingOrderCommand.Receiver = controlCar.LocomotivePowerSupply;
708+
TractionCutOffRelayClosingOrderButtonCommand.Receiver = controlCar.LocomotivePowerSupply;
709+
TractionCutOffRelayOpeningOrderButtonCommand.Receiver = controlCar.LocomotivePowerSupply;
710+
TractionCutOffRelayClosingAuthorizationCommand.Receiver = controlCar.LocomotivePowerSupply;
711+
TogglePlayerEngineCommand.Receiver = controlCar;
712+
}
713+
697714
ToggleOdometerCommand.Receiver = (MSTSLocomotive)PlayerLocomotive;
698715
ResetOdometerCommand.Receiver = (MSTSLocomotive)PlayerLocomotive;
699716
ToggleOdometerDirectionCommand.Receiver = (MSTSLocomotive)PlayerLocomotive;

Source/RunActivity/Viewer3D/RollingStock/MSTSLocomotiveViewer.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
using Orts.Simulation.RollingStocks;
3232
using Orts.Simulation.RollingStocks.SubSystems;
3333
using Orts.Simulation.RollingStocks.SubSystems.Controllers;
34+
using Orts.Simulation.RollingStocks.SubSystems.PowerSupplies;
3435
using Orts.Viewer3D.Common;
3536
using Orts.Viewer3D.Popups;
3637
using Orts.Viewer3D.RollingStock.SubSystems;
@@ -39,7 +40,6 @@
3940
using ORTS.Common.Input;
4041
using ORTS.Scripting.Api;
4142
using Event = Orts.Common.Event;
42-
using Orts.Simulation.RollingStocks.SubSystems.PowerSupplies;
4343

4444
namespace Orts.Viewer3D.RollingStock
4545
{

0 commit comments

Comments
 (0)