Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
1976e1a
Merge pull request #1 from openrails/master
cjakeman3 Sep 7, 2019
56c2ae5
Merge branch 'master' of git://github.com/openrails/openrails
cjakeman3 Oct 6, 2019
8c4e16e
Merge branch 'master' of git://github.com/openrails/openrails
cjakeman3 Oct 8, 2019
cf3d038
Show both DynamicBrakeForce and MotiveForce values in Locomotive HUD
peternewell Oct 14, 2019
3436d36
Bug fix for https://bugs.launchpad.net/or/+bug/1848878 AI train WP re…
Csantucci Oct 19, 2019
feaf1d7
Bug fix for https://bugs.launchpad.net/or/+bug/1848915 Crash by switc…
Csantucci Oct 20, 2019
6346470
Merge pull request #113 from Csantucci/WP_save_adjust. Bug fix for ht…
Csantucci Oct 23, 2019
eaca83c
Merge pull request #112 from Csantucci/fix-multiple-passenger-views
Csantucci Nov 11, 2019
a5d4112
Bug fix for https://bugs.launchpad.net/or/+bug/1852843 Digital displa…
Csantucci Nov 16, 2019
8f128e4
Merge remote-tracking branch 'upstream/master' before working on new …
cjakeman3 Nov 16, 2019
413d098
Merge pull request #115 from Csantucci/show-digital-displays-in-3Dcabs
Csantucci Nov 17, 2019
147facd
To correct Cabview - http://www.elvastower.com/forums/index.php?/topi…
peternewell Nov 17, 2019
1b5c311
Bug fix for https://bugs.launchpad.net/or/+bug/1853154 2Dcab digital …
Csantucci Nov 19, 2019
15d0667
Corrected sign issue with Traction_Braking cab view - now +ve
peternewell Nov 19, 2019
ee7d6a2
Corrected issue with Traction_Braking
peternewell Nov 20, 2019
5d6bab3
Merge remote-tracking branch 'upstream/master'
cjakeman3 Nov 21, 2019
7578ce8
Merge pull request #111 from peternewell/dynamicbrakeforce-refactor
peternewell Nov 21, 2019
5513192
Merge pull request #116 from Csantucci/cvf-digital-boundaries. Bug fi…
Csantucci Nov 22, 2019
505f5bd
Trick to bring Dispatch Window to the front, even though invisible, …
cjakeman3 Nov 22, 2019
19abd9b
Correction of bug fix for https://bugs.launchpad.net/or/+bug/1848878 …
Csantucci Nov 26, 2019
0b201d2
Merge pull request #118 from Csantucci/Correct-WP-save-bug
Csantucci Nov 27, 2019
4ee4c2d
Bug fix for https://bugs.launchpad.net/or/+bug/1854381 Bell plays for…
Csantucci Nov 28, 2019
48541ec
Update manual for bug fix https://bugs.launchpad.net/or/+bug/1854381
Csantucci Nov 28, 2019
f8eb17c
Merge pull request #117 from cjakeman3/runactivity/dispatch-window-on…
Csantucci Dec 4, 2019
63e1f8f
Merge pull request #119 from Csantucci/terminate-bell-play
Csantucci Dec 7, 2019
897c968
Bug fix for https://bugs.launchpad.net/or/+bug/1208960 Wrong warning …
Csantucci Dec 10, 2019
2b78dba
Merge pull request #120 from Csantucci/no-automation-for-speedposts-w…
Csantucci Dec 13, 2019
881662c
Updated Dan Reynolds (HighAspect). to 2019 OrUnstable branch WebServ…
wjcurrey Dec 20, 2019
5a6a677
Correct issue with dynamic brake where it doesn't go to zero in Nothc 0.
peternewell Dec 21, 2019
cf5bbe9
Changed to IPAddress.Any in WebServer.cs to accept any address on the…
wjcurrey Dec 21, 2019
8a855ef
force update of code change
peternewell Dec 21, 2019
85be760
Merge pull request #125 from peternewell/dynamicbrakeforce-refactor
peternewell Dec 22, 2019
acf11db
Move code out of WatchDog; Had hanging process on termination; Using …
wjcurrey Dec 23, 2019
15e95d8
Place test's in running code, to enable/disable WebServer display
wjcurrey Dec 23, 2019
0b6bd87
Added check box in options windows form to enable/disable WebServer d…
wjcurrey Dec 23, 2019
014556e
Added selectable port, cleaned out comments on WatchDog
wjcurrey Dec 24, 2019
0675bdf
Merge https://github.com/openrails/openrails into WSLocalContent
wjcurrey Dec 25, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions Source/Documentation/Manual/driving.rst
Original file line number Diff line number Diff line change
Expand Up @@ -676,20 +676,17 @@ Dispatcher Window
=================

The dispatcher window is a very useful tool to monitor and control train
operation. The :ref:`Dispatcher window <options-dispatcher>` option
must be selected.

The dispatcher window is actually created by pressing ``<Ctrl+9>``. The
window is created in a minimized state, so to display it in front of the OR
window you must click on ``<Alt+Tab>`` and select the dispatcher window
icon, or click on one of the OR icons in the taskbar. If you are running OR
in full-screen mode, you must also have the :ref:`Fast full screen Alt+Tab
<options-fullscreen>` option selected to have both the OR and the
dispatcher windows displayed at the same time. After the dispatcher window
has been selected with ``<Alt+Tab>``, successive Alt_Tabs will toggle
between the OR window and the dispatcher window.
operation. operation. To use it, select the :ref:`Dispatcher window
<options-dispatcher>` option before you start the route.

Open the dispatcher window by pressing ``<Ctrl+9>``. You can toggle
between the OR window and the dispatcher window by pressing ``<Alt+Tab>`` .

If you have unchecked the option ``Windowed``, then the game window opens
full screen and the dispatch window opens out of sight behind it. You can
prevent this by checking the option Fast full-screen alt-tab in Options > Video.

The dispatcher window is resizable and can also be maximized, e.g. on a
The dispatcher window is not resizable but can be maximized, e.g. on a
second display. You can define the level of zoom either by changing the
value within the ``Res`` box or by using the mouse wheel. You can pan
through the route by moving the mouse while pressing the left button. You
Expand Down
8 changes: 8 additions & 0 deletions Source/Documentation/Manual/operation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1800,6 +1800,10 @@ On the other hand, a horn blow waiting point may be positioned just after a
normal WP (thus achieving the effect that the train blows the horn when it
restarts).

If the lead locomotive of the AI train has parameter DoesHornTriggerBell
set to 1 in the .eng file, the bell is played for further 30 seconds after
the end of the horn blow.

To implement this feature it is not necessary to proceed as described in the
first three paragraphs of this chapter. It is enough to insert the waiting
points within the paths with either the MSTS AE or through TrackViewer.
Expand All @@ -1824,6 +1828,10 @@ the route with TrackViewer allows identification of the true level crossings.
If a horn blow is also desired for a *simple* road crossing, the feature *AI
Train Horn Blow* described above must be used.

If the lead locomotive of the AI train has parameter DoesHornTriggerBell
set to 1 in the .eng file, the bell is played for further 30 seconds after
the end of the horn blow.

.. _operation-event-triggered-by-ai-train:

Location Event triggered by AI Train
Expand Down
52 changes: 52 additions & 0 deletions Source/Menu/Options.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Source/Menu/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,11 @@ public OptionsForm(UserSettings settings, UpdateManager updateManager, bool init
comboPressureUnit.Text = Settings.PressureUnit;
comboBoxOtherUnits.Text = settings.Units;
checkDisableTCSScripts.Checked = Settings.DisableTCSScripts;

checkEnableWebServer.Checked = Settings.WebServer;
numericWebServerPort.Value = Settings.WebServerPort;

// Audio tab

checkMSTSBINSound.Checked = Settings.MSTSBINSound;
numericSoundVolumePercent.Value = Settings.SoundVolumePercent;
numericSoundDetailLevel.Value = Settings.SoundDetailLevel;
Expand Down Expand Up @@ -436,6 +438,7 @@ void buttonOK_Click(object sender, EventArgs e)
Settings.PressureUnit = comboPressureUnit.SelectedValue.ToString();
Settings.Units = comboBoxOtherUnits.SelectedValue.ToString();
Settings.DisableTCSScripts = checkDisableTCSScripts.Checked;
Settings.WebServer = checkEnableWebServer.Checked;

// Audio tab
Settings.MSTSBINSound = checkMSTSBINSound.Checked;
Expand Down Expand Up @@ -739,5 +742,6 @@ private void checkPerformanceTuner_Click(object sender, EventArgs e)
numericPerformanceTunerTarget.Enabled = checkPerformanceTuner.Checked;
labelPerformanceTunerTarget.Enabled = checkPerformanceTuner.Checked;
}

}
}
10 changes: 5 additions & 5 deletions Source/Menu/Options.resx
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,18 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="bindingSourceContent.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<metadata name="bindingSourceContent.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>114, 17</value>
</metadata>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
6 changes: 6 additions & 0 deletions Source/ORTS.Settings/UserSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ public enum Menu_SelectionIndex
public int Multiplayer_Port { get; set; }

// General settings:

[Default(false)]
public bool WebServer { get; set; }
[Default(2150)]
public int WebServerPort { get; set; }

[Default(false)]
public bool Alerter { get; set; }
[Default(true)]
Expand Down
70 changes: 53 additions & 17 deletions Source/Orts.Simulation/Simulation/AIs/AIAuxAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,44 @@ public void Save(BinaryWriter outf, int currentClock)
{

if (ThisTrain is AITrain && ((aiTrain.MovementState == AITrain.AI_MOVEMENT_STATE.HANDLE_ACTION && aiTrain.nextActionInfo != null &&
aiTrain.nextActionInfo.NextAction == AIActionItem.AI_ACTION_TYPE.AUX_ACTION && aiTrain.nextActionInfo != null && aiTrain.nextActionInfo is AuxActionWPItem)
aiTrain.nextActionInfo.NextAction == AIActionItem.AI_ACTION_TYPE.AUX_ACTION && aiTrain.nextActionInfo is AuxActionWPItem)
|| ( aiTrain.AuxActionsContain.SpecAuxActions.Count > 0 &&
aiTrain.AuxActionsContain.SpecAuxActions[0] is AIActionWPRef && (aiTrain.AuxActionsContain.SpecAuxActions[0] as AIActionWPRef).keepIt != null &&
(aiTrain.AuxActionsContain.SpecAuxActions[0] as AIActionWPRef).keepIt.currentMvmtState == AITrain.AI_MOVEMENT_STATE.HANDLE_ACTION)))
// WP is running
{
int remainingDelay;
if (aiTrain.nextActionInfo != null && aiTrain.nextActionInfo is AuxActionWPItem) remainingDelay = ((AuxActionWPItem)aiTrain.nextActionInfo).ActualDepart - currentClock;
else remainingDelay = ((AIActionWPRef)SpecAuxActions[0]).keepIt.ActualDepart - currentClock;
((AIActionWPRef)SpecAuxActions[0]).SetDelay(remainingDelay);
// Do nothing if it is an absolute WP
if (!(aiTrain.AuxActionsContain.SpecAuxActions.Count > 0 && aiTrain.AuxActionsContain.SpecAuxActions[0] is AIActionWPRef &&
(aiTrain.AuxActionsContain.SpecAuxActions[0] as AIActionWPRef).Delay >= 30000 && (aiTrain.AuxActionsContain.SpecAuxActions[0] as AIActionWPRef).Delay < 40000))
{
int remainingDelay;
if (aiTrain.nextActionInfo != null && aiTrain.nextActionInfo is AuxActionWPItem) remainingDelay = ((AuxActionWPItem)aiTrain.nextActionInfo).ActualDepart - currentClock;
else remainingDelay = ((AIActionWPRef)SpecAuxActions[0]).keepIt.ActualDepart - currentClock;
((AIActionWPRef)SpecAuxActions[0]).SetDelay(remainingDelay);
}
}
}
// check for horn actions
if (ThisTrain is AITrain && aiTrain.AuxActionsContain.specRequiredActions.Count > 0)
{
foreach (AITrain.DistanceTravelledItem specRequiredAction in aiTrain.AuxActionsContain.specRequiredActions)
{
if (specRequiredAction is AuxActionHornItem)
{
if (SpecAuxActions.Count > 0)
{
foreach (AuxActionRef specAuxAction in SpecAuxActions)
{
if (specAuxAction is AIActionHornRef)
{
(specAuxAction as AIActionHornRef).Delay = (specRequiredAction as AuxActionHornItem).ActualDepart - currentClock;
break;
}
}
break;
}
else break;
}
}
}
foreach (var action in SpecAuxActions)
Expand Down Expand Up @@ -1901,6 +1929,7 @@ public class AuxActionHornItem : AuxActionItem
int Delay;
[JsonIgnore]
public int ActualDepart;
private const int BellPlayTime = 30;


//================================================================================================//
Expand Down Expand Up @@ -1977,36 +2006,43 @@ public override AITrain.AI_MOVEMENT_STATE InitAction(Train thisTrain, int presen
Processing = true;
int correctedTime = presentTime;
ActualDepart = correctedTime + Delay;
if (!Triggered)
{
#if WITH_PATH_DEBUG
File.AppendAllText(@"C:\temp\checkpath.txt", "Do Horn for AITRain " + thisTrain.Number + " , mvt state " + movementState.ToString() + " at " + presentTime + "\n");
#endif
TrainCar locomotive = thisTrain.FindLeadLocomotive();
((MSTSLocomotive)locomotive).ManualHorn = true;
Triggered = true;
}
return AITrain.AI_MOVEMENT_STATE.HANDLE_ACTION;
}

public override AITrain.AI_MOVEMENT_STATE HandleAction(Train thisTrain, int presentTime, float elapsedClockSeconds, AITrain.AI_MOVEMENT_STATE movementState)
{
if (ActualDepart >= presentTime)
{
if (!Triggered)
{
#if WITH_PATH_DEBUG
File.AppendAllText(@"C:\temp\checkpath.txt", "Do Horn for AITRain " + thisTrain.Number + " , mvt state " + movementState.ToString() + " at " + presentTime + "\n");
#endif
TrainCar locomotive = thisTrain.FindLeadLocomotive();
((MSTSLocomotive)locomotive).ManualHorn = true;
Triggered = true;
}
movementState = AITrain.AI_MOVEMENT_STATE.HANDLE_ACTION;
}
else
{
thisTrain.AuxActionsContain.Remove(this);

TrainCar locomotive = thisTrain.FindLeadLocomotive();
if (Triggered)
{
#if WITH_PATH_DEBUG
File.AppendAllText(@"C:\temp\checkpath.txt", "Stop Horn for AITRain " + thisTrain.Number + " : mvt state " + movementState.ToString() + " at " + presentTime + "\n");
#endif
TrainCar locomotive = thisTrain.FindLeadLocomotive();
((MSTSLocomotive)locomotive).ManualHorn = false;
Triggered = false;
}
if (((MSTSLocomotive)locomotive).DoesHornTriggerBell && ActualDepart + BellPlayTime >= presentTime)
{
movementState = AITrain.AI_MOVEMENT_STATE.HANDLE_ACTION;
return movementState;
}
else if (((MSTSLocomotive)locomotive).DoesHornTriggerBell && ActualDepart + BellPlayTime < presentTime)
((MSTSLocomotive)locomotive).BellState = MSTSLocomotive.SoundState.Stopped;
thisTrain.AuxActionsContain.Remove(this);
return currentMvmtState; // Restore previous MovementState
}
return movementState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1403,6 +1403,7 @@ public override void Update(float elapsedClockSeconds)

ApplyDirectionToMotiveForce();

// Update dynamic brake force
if (DynamicBrakePercent > 0 && DynamicBrakeForceCurves != null && AbsSpeedMpS > 0)
{
float f = DynamicBrakeForceCurves.Get(.01f * DynamicBrakePercent, AbsSpeedMpS);
Expand All @@ -1415,7 +1416,8 @@ public override void Update(float elapsedClockSeconds)
DynamicBrakeForceN = 0f;
}
}
// else if (DynamicBrakePercent == -1) DynamicBrakeForceN = 0;
else
DynamicBrakeForceN = 0; // Set dynamic brake force to zero if in Notch 0 position

UpdateFrictionCoefficient(elapsedClockSeconds); // Find the current coefficient of friction depending upon the weather

Expand Down Expand Up @@ -3796,6 +3798,10 @@ public virtual float GetDataOf(CabViewControl cvc)
data = this.FilteredMotiveForceN;
else
data = this.LocomotiveAxle.AxleForceN;
if (DynamicBrakePercent > 0)
{
data = DynamicBrakeForceN;
}
data = Math.Abs(data);
switch (cvc.Units)
{
Expand Down
Loading