From a836a0e43874ef30c56832bd411526d9ec4f518f Mon Sep 17 00:00:00 2001 From: Marc Riera Date: Thu, 26 Dec 2024 00:36:56 +0100 Subject: [PATCH] Panel variable indices --- src/Devices/AtcDimetronic.cs | 13 ++++++------- src/Devices/DoorSelection.cs | 4 ++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Devices/AtcDimetronic.cs b/src/Devices/AtcDimetronic.cs index eff70bc..dfd2dd8 100644 --- a/src/Devices/AtcDimetronic.cs +++ b/src/Devices/AtcDimetronic.cs @@ -346,13 +346,12 @@ namespace OpenbveFcmbTrainPlugin } // Panel indicators - train.Panel[25] = DeviceState == DeviceStates.Override ? 1 : 0; - train.Panel[26] = DeviceState == DeviceStates.YARD ? 1 : 0; - train.Panel[27] = DeviceState == DeviceStates.ATP ? 1 : 0; - train.Panel[28] = DeviceState == DeviceStates.ATO ? 1 : 0; - train.Panel[34] = (int)CurrentSpeedCode.CurrentLimit.KilometersPerHour * 1000; - train.Panel[33] = 1; - train.Panel[35] = (int)CurrentSpeedCode.TargetLimit.KilometersPerHour * 1000; + train.Panel[11] = TrackState > TrackStates.Unprotected && train.PhysicalHandles.Reverser == 1 ? 1 : 0; + train.Panel[12] = AtcControlState == AtcControlStates.NoPower || AtcControlState == AtcControlStates.NoPowerAlarm ? 1 : 0; + train.Panel[13] = (int)DeviceState; + train.Panel[14] = (int)CurrentSpeedCode.CurrentLimit.KilometersPerHour * 1000; + train.Panel[15] = (int)CurrentSpeedCode.TargetLimit.KilometersPerHour * 1000; + train.Panel[16] = (int)DeviceState > 1 ? 1 : 0; // Play alarm sound if (AtcControlState == AtcControlStates.NoPowerAlarm) diff --git a/src/Devices/DoorSelection.cs b/src/Devices/DoorSelection.cs index 2249f25..151129b 100644 --- a/src/Devices/DoorSelection.cs +++ b/src/Devices/DoorSelection.cs @@ -39,8 +39,8 @@ namespace OpenbveFcmbTrainPlugin } // Update panel variables for door selection state - train.Panel[50] = (RequestedDoorInterlock == DoorInterlockStates.Left || RequestedDoorInterlock == DoorInterlockStates.Unlocked) || (((train.DoorState & DoorStates.Left) != 0) && !LeftDoorsClosing) ? 1 : 0; - train.Panel[51] = (RequestedDoorInterlock == DoorInterlockStates.Right || RequestedDoorInterlock == DoorInterlockStates.Unlocked) || (((train.DoorState & DoorStates.Right) != 0) && !RightDoorsClosing) ? 1 : 0; + train.Panel[1] = (RequestedDoorInterlock == DoorInterlockStates.Left || RequestedDoorInterlock == DoorInterlockStates.Unlocked) || (((train.DoorState & DoorStates.Left) != 0) && !LeftDoorsClosing) ? 1 : 0; + train.Panel[2] = (RequestedDoorInterlock == DoorInterlockStates.Right || RequestedDoorInterlock == DoorInterlockStates.Unlocked) || (((train.DoorState & DoorStates.Right) != 0) && !RightDoorsClosing) ? 1 : 0; } /// Is called when the state of a key changes.