Paolo, on 07 June 2020 - 04:31 AM, said:
I created two new commands to simulate the start of the batteries and the cab desk activation key. Both controls are equipped with sound triggers. The commands are called ORTS_BATTERY activated by the combination "ctrl + b" and ORTS_POWERKEY activated by the combination "ctrl + k". The first command simulates the switch usually located in the rear of the cabs, which powers all the train services at 24v.
The ORTS_POWERKEY command simulates the insertion of the key that unlocks the cabin desk. Usually, the switching on of the diagnostic monitors is also connected to this function.
I thank Carlo for the support in the development. I have provided him the code changes so that they can be included in the realase of OR and in future versions of the Monogame.
Paolo
In my personal code + NewYearNowd this i have this too, in my version it calls CabinePowerSwitch, becauze POWERKEY is nog right context.
// SDC Experimental (BEGIN) ORTS_TOGGLE_COMPRESSOR, ORTS_TOGGLE_SOSCOMPRESSOR, ORTS_TOGGLE_AUXCOMPRESSOR, ORTS_TOGGLE_MANUAL_VENTILATION, ORTS_TOGGLE_TEST_VENTILATION, ORTS_TOGGLE_TRAIN_HEATING, ORTS_TOGGLE_CABINE_CLIMATISATION, ORTS_TOGGLE_TRAIN_CLIMATISATION, ORTS_MANUAL_VENTILATION, ORTS_TEST_VENTILATION, ORTS_TRAIN_HEATING, ORTS_CABINE_CLIMATISATION, ORTS_TRAIN_CLIMATISATION, HORN2, HORN3, [color="#FF0000"]ORTS_CABINE_POWER_SWITCH[/color], ORTS_CABINE_IN_SERVICE_BUTTON, ORTS_CABINECLIMATECONTROL, ORTS_TRAINCLIMATECONTROL, ORTS_MANUALVENTILATION, ORTS_TESTVENTILATION, ORTS_CABSIGNAL1, ORTS_CABSIGNAL2, ORTS_CABSIGNAL3, ORTS_CABSIGNAL4, ORTS_CABSIGNAL5, ORTS_CABSIGNAL6, ORTS_CABSIGNAL7, ORTS_CABSIGNAL8, ORTS_MANUALSIGNALLIGHT1, ORTS_MANUALSIGNALLIGHT2, ORTS_MANUALSIGNALLIGHT3, ORTS_MANUALSIGNALLIGHT4, ORTS_CABSCREEN, ORTS_TRAINHEATING, ORTS_NEUTRAL_BRAKE_SWITCH, ORTS_WHEELSLIP, ORTS_EMERGENCY_LIGHTS, ORTS_EPP_SWITCH, ORTS_IMMOBILIZATION_BRAKE, ORTS_QUICK_TRAIN_BRAKE_RELEASE, ORTS_TOGGLE_OVERCHARGE_BRAKE_PIPE, ORTS_CABRADIOBUTTON, ORTS_HANDBRAKE, ORTS_TOGGLE_ALERTERTEST,
A locomotive is only power on, after close circuitbreaker.
For moment my Cabinepowerkey have this code:
MSTSLocomotive.cs :
public void ToggleCabinePowerSwitch(bool newState)
{
if (this is MSTSSteamLocomotive)
return;
SignalEvent(newState ? Event.CabinePowerSwitchOn : Event.CabinePowerSwitchOff);
CabinePowerSwitch = newState;
if (CabinePowerSwitchOn == CabinePowerSwitchOn)
{
if (CabinePowerSwitchOn)
SetTrainBrakeValue(100.0f);
SetEmergency(false);
}
Simulator.Confirmer.Confirm(CabControl.CabinePowerSwitch, CabinePowerSwitchOn ? CabSetting.On : CabSetting.Off);
if (CabinePowerSwitchOff == CabinePowerSwitchOff)
{
if (CabinePowerSwitchOff)
SetEmergency(true);
}
CabinePowerSwitchOff = newState;
Simulator.Confirmer.Confirm(CabControl.CabinePowerSwitch, CabinePowerSwitchOff ? CabSetting.On : CabSetting.Off);
}
What it do now is just sound & cabviewanimation when power on, but when it power off, there comes TCS braking in combination with: MonitoringDeviceAppliesEmergencyBrake ( 1 ) (.eng file)
I know this can be better, and it needs more expansion, becauze not every cabinepowerkey is same.
Cabinepowerkey off position type 1: Circuit open, pantographs down, emergencybrake
Cabinepowerkey off position type 2: Circuit open, pantograps stay in position of pantoselector, emergencybrake
Cabinepowerkey off position type 3: Circuit closed, pantograps stay in position of pantoselector, emergencybrake
...
For CabinePowerSwitch i think it is better too have a script system (.ini file) or .eng file tokens.
The ORTS_BATTERY code in my personal program is code of Jindrich (developper):
MSTSLocomotive.cs:
public void SetBattery(bool ToState) { Simulator.Confirmer.Information("Battery is " + (Battery ? "off." : "on.")); Battery = ToState; SignalEvent(ToState ? Event.BatteryOn : Event.BatteryOff); }
Batterysound can used too for typical underground sounds too, like Siemens ES64U2/ES64U4 platforms. And much other electric locomotives...
Greetz,
Stijn