Skip to content

Commit 4a8eda5

Browse files
committed
Automatic merge of T1.5.1-411-g51d4cd969 and 15 pull requests
- Pull request #570 at de7a14f: Experimental glTF 2.0 support with PBR lighting - Pull request #757 at 2388225: Unify RailDriver code implementations - Pull request #799 at dc03850: Consolidated wind simulation - Pull request #802 at 4d198e4: Added support for activity location events to the TrackViewer - Pull request #803 at 7157e08: Various adjustments to steam adhesion - Pull request #813 at 7fdad38: Refactored garbage generators - Pull request #815 at a5cc165: chore: Add GitHub automatic release notes configuration - Pull request #818 at 745d101: Allow independent drive axles for locomotives - Pull request #821 at e0fa5a8: Adds suppression of safety valves - Pull request #823 at 5e1c03b: Select track sound volume percent retained in .eng and .wag files - Pull request #824 at f16ebed: Update Readme.md - Pull request #825 at 29ed427: 2D Cabview controls for side viewpoints https://blueprints.launchpad.net/or/+spec/2dcabview-controls-for-side-views - Pull request #829 at 434af02: Improvements for air brakes #3 - Emergency valves - Pull request #830 at b9350ff: Electric locomotive hot start - Pull request #831 at 10aa2f3: preliminary version switchpanel on tablet
17 parents 6f08535 + 51d4cd9 + de7a14f + 2388225 + dc03850 + 4d198e4 + 7157e08 + 7fdad38 + a5cc165 + 745d101 + e0fa5a8 + 5e1c03b + f16ebed + 29ed427 + 434af02 + b9350ff + 10aa2f3 commit 4a8eda5

File tree

6 files changed

+172
-74
lines changed

6 files changed

+172
-74
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/PowerSupplies/TractionCutOffRelay.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class ScriptedTractionCutOffRelay : ITractionCutOffSubsystem
3434
public Simulator Simulator => LocomotivePowerSupply.Locomotive.Simulator;
3535

3636
public bool Activated = false;
37-
string ScriptName = "Automatic";
37+
public string ScriptName { get; protected set; } = "Automatic";
3838
TractionCutOffRelay Script;
3939

4040
public float DelayS { get; protected set; } = 0f;

Source/RunActivity/Viewer3D/Viewer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ public void Update(RenderFrame frame, float elapsedRealTime)
855855

856856
WindowManager.PrepareFrame(frame, elapsedTime);
857857

858-
SwitchPanelModule.SendAllSwitchStatus();
858+
SwitchPanelModule.SendSwitchPanelIfChanged();
859859
}
860860

861861
private void LoadDefectCarSound(TrainCar car, string filename)

Source/RunActivity/Viewer3D/WebServices/SwitchPanel/SwitchOnPanel.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public void init0(UserCommand userCommand = ORTS.Common.Input.UserCommand.GamePa
3636
Definition.Button = TypeOfButton.none;
3737
Definition.UserCommand = new UserCommand[] { userCommand };
3838
Definition.Description = description;
39+
initIs();
3940
}
4041

4142
// 1 button
@@ -45,6 +46,7 @@ public void init1(UserCommand userCommand, string description, TypeOfButton type
4546
Definition.Button = typeOfButton;
4647
Definition.UserCommand = new UserCommand[] { userCommand };
4748
Definition.Description = description;
49+
initIs();
4850
}
4951

5052
// 2 buttons
@@ -54,6 +56,7 @@ public void init2(UserCommand userCommandTop, UserCommand userCommandBottom, str
5456
Definition.Button = typeOfButton;
5557
Definition.UserCommand = new UserCommand[] { userCommandTop, userCommandBottom };
5658
Definition.Description = description;
59+
initIs();
5760
}
5861

5962
public void initIs()

Source/RunActivity/Viewer3D/WebServices/SwitchPanel/SwitchPanelModule.cs

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public static bool IsPressed(UserCommand userCommand)
156156
{
157157
bool toBeReturned = false;
158158

159-
if (InitDone)
159+
if ((Connections > 0) && InitDone)
160160
{
161161
if (SwitchesOnPanel.IsPressed(userCommand))
162162
{
@@ -176,43 +176,34 @@ public static bool IsPressed(UserCommand userCommand)
176176
break;
177177
}
178178
}
179+
179180
}
180181
return toBeReturned;
181182
}
182183

183184
public static bool IsDown(UserCommand userCommand)
184185
{
185-
if (Connections > 0)
186+
if ((Connections > 0) && InitDone)
186187
{
187-
if (InitDone)
188-
{
189-
if (SwitchesOnPanel.IsDown(userCommand))
190-
{
191-
return true;
192-
}
193-
}
188+
if (SwitchesOnPanel.IsDown(userCommand))
189+
return true;
194190
}
195191
return false;
196192
}
197193

198194
public static bool IsUp(UserCommand userCommand)
199195
{
200-
if (Connections > 0)
196+
if ((Connections > 0) && InitDone)
201197
{
202-
if (InitDone)
203-
{
204-
if (SwitchesOnPanel.IsUp(userCommand))
205-
{
206-
return true;
207-
}
208-
}
198+
if (SwitchesOnPanel.IsUp(userCommand))
199+
return true;
209200
}
210201
return false;
211202
}
212203

213-
public static void SendAllSwitchStatus()
204+
public static void SendSwitchPanelIfChanged()
214205
{
215-
if ((Connections > 0) && (InitDone))
206+
if ((Connections > 0) && InitDone)
216207
{
217208
int rows = SwitchesOnPanel.GetSwitchesOnPanelArray().GetLength(0);
218209
int cols = SwitchesOnPanel.GetSwitchesOnPanelArray().GetLength(1);

0 commit comments

Comments
 (0)