Skip to content

Commit 7919243

Browse files
committed
Merge branch 'master' into simple-adhesion-axle
2 parents 9fdade0 + ede96ba commit 7919243

File tree

37 files changed

+2707
-2559
lines changed

37 files changed

+2707
-2559
lines changed

Source/Contrib/ContentManager/ContentManagerGUI.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ void searchBox_TextChanged(object sender, EventArgs e)
286286
finds.Add(new SearchResult(content, path));
287287

288288
foreach (var child in ((ContentType[])Enum.GetValues(typeof(ContentType))).SelectMany(ct => content.Get(ct)))
289-
pending.Add(path + " / " + child.Name, child);
289+
if (!pending.ContainsKey(path + " / " + child.Name))
290+
pending.Add(path + " / " + child.Name, child);
290291

291292
foreach (var child in ContentLink.Matches(ContentInfo.GetText(content)).Cast<Match>().Select(linkMatch => content.Get(linkMatch.Groups[1].Value, (ContentType)Enum.Parse(typeof(ContentType), linkMatch.Groups[2].Value))).Where(linkContent => linkContent != null))
292293
if (!pending.ContainsKey(path + " -> " + child.Name))

Source/Contrib/TrackViewer/Drawing/DrawTrackDB.cs

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -107,37 +107,14 @@ public RouteData(string routePath, MessageDelegate messageDelegate)
107107
//sigcfgFile = null; // default initialization
108108
}
109109

110-
// read the activity location events and store them in the TrackDB.TrItemTable
110+
// read the activity location events and add them to the TrackDB.TrItemTable
111111

112112
ActivityNames.Clear();
113113
var directory = System.IO.Path.Combine(routePath, "ACTIVITIES");
114114
if (System.IO.Directory.Exists(directory))
115115
{
116-
// counting
117-
int cnt = 0;
118-
119-
foreach (var file in Directory.GetFiles(directory, "*.act"))
120-
{
121-
try
122-
{
123-
var activityFile = new ActivityFile(file);
124-
Events events = activityFile.Tr_Activity.Tr_Activity_File.Events;
125-
if (events != null)
126-
{
127-
for (int i = 0; i < events.EventList.Count; i++)
128-
{
129-
if (events.EventList[i].GetType() == typeof(EventCategoryLocation))
130-
{
131-
cnt++;
132-
}
133-
}
134-
}
135-
}
136-
catch { }
137-
}
138-
139-
// adding
140-
uint index = 0;
116+
int index = TrackDB.TrItemTable.Length;
117+
List<TrItem> eventItems = new List<TrItem>();
141118
foreach (var file in Directory.GetFiles(directory, "*.act"))
142119
{
143120
try
@@ -157,8 +134,8 @@ public RouteData(string routePath, MessageDelegate messageDelegate)
157134
eventCategoryLocation.Outcomes.DisplayMessage,
158135
eventCategoryLocation.TileX, eventCategoryLocation.TileZ,
159136
eventCategoryLocation.X, 0, eventCategoryLocation.Z,
160-
index);
161-
TrackDB.TrItemTable[index] = eventItem;
137+
(uint)index);
138+
eventItems.Add(eventItem);
162139
index++;
163140
found = true;
164141
}
@@ -168,9 +145,18 @@ public RouteData(string routePath, MessageDelegate messageDelegate)
168145
ActivityNames.Add(activityFile.Tr_Activity.Tr_Activity_Header.Name);
169146
}
170147
}
171-
catch { }
148+
catch { /* just ignore activity files with problems */ }
172149
}
173150

151+
// extend the track items array and append the event items
152+
if (eventItems.Count > 0)
153+
{
154+
int oldSize = TrackDB.TrItemTable.Length;
155+
Array.Resize<TrItem>(ref TrackDB.TrItemTable, index);
156+
int newSize = TrackDB.TrItemTable.Length;
157+
int eventSize = eventItems.Count;
158+
for (int toIdx = oldSize, fromIdx = 0; toIdx < newSize && fromIdx < eventSize; toIdx++, fromIdx++) { TrackDB.TrItemTable[toIdx] = eventItems[fromIdx]; }
159+
}
174160
}
175161
}
176162

Source/Contrib/TrackViewer/Editing/Charts/DrawPathChart.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ public class DrawPathChart
5454

5555
private bool ChartWindowIsOpen { get { return chartWindow.Visibility == Visibility.Visible; } }
5656

57+
// save window title from properies, so that the window's title can be changed when the selected path is changed
58+
private readonly String WindowTitle;
59+
5760
/// <summary>
5861
/// Constructor
5962
/// </summary>
@@ -64,6 +67,7 @@ public DrawPathChart()
6467
OnJsonSaveClick = OnJsonSave
6568
};
6669
TrackViewer.Localize(chartWindow);
70+
if (WindowTitle == null) WindowTitle = chartWindow.Title;
6771
}
6872

6973
/// <summary>
@@ -113,6 +117,7 @@ public void Open()
113117
{ // it path is broken, OnPathChanged performed a close
114118
return;
115119
}
120+
chartWindow.Title = String.Format("{0}: {1}", WindowTitle, pathEditor.CurrentTrainPath.PathName);
116121
chartWindow.Show();
117122

118123
}
@@ -160,6 +165,7 @@ private void OnPathChanged()
160165
return;
161166
}
162167
pathData.Update(trainpath);
168+
chartWindow.Title = String.Format("{0}: {1}", WindowTitle, pathEditor.CurrentTrainPath.PathName);
163169
chartWindow.Draw();
164170
}
165171

Source/Documentation/Manual/features-rollingstock.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ Detailed spec
345345
no changes are done to the .eng file.
346346
2) In such folder there is also an ``ORTSLightGlow.png``, which is maybe more realistic.
347347
3) adding a line within the .eng file it is possible to select either ORTSLightGlow.png or any other picture
348-
with extension ``.png, .jpg, bmp, .gif, .ace, or .dds``.
348+
with extension ``.ace`` or ``.dds``.
349349

350350

351351
Here an example for the legacy Acela loco::
@@ -357,13 +357,13 @@ Detailed spec
357357
Type ( 1 )
358358
Conditions (...
359359

360-
The code first searches for the .png file by building its directory starting from the directory of
360+
The code first searches for the file by building its directory starting from the directory of
361361
the .eng file; in this case the line could be e.g.::
362362

363-
ORTSGraphic ( "ORTSAcelaLightGlow.png" )
363+
ORTSGraphic ( "ORTSAcelaLightGlow.dds" )
364364

365365
4) The ``ORTSGraphic`` line can be added also for one or more ``Light()`` blocks. In that case the
366-
.png file is used only for the related Light block. Here an example::
366+
file is used only for the related Light block. Here an example::
367367

368368
Light (
369369
comment( Head light outer right bright )
@@ -386,7 +386,7 @@ Detailed spec
386386
Elevation ( -50 -50 -50 )
387387
)
388388
)
389-
ORTSGraphic (BigLightGlow.png)
389+
ORTSGraphic (BigLightGlow.dds)
390390
)
391391

392392
OR searches for the file as it does for the general file for all lights, as explained above.

Source/Documentation/Manual/options.rst

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -863,21 +863,23 @@ are a problem for OR, which has a more sophisticated braking model. The
863863
problem usually is that the train brakes require a long time to release,
864864
and in some times do not release at all.
865865

866-
.. index::
867-
single: AirBrakesAirCompressorPowerRating
868-
869866
The following checks and corrections are performed if the option is
870-
checked (only for single-pipe brake system):
867+
checked:
871868

872869
- if the compressor restart pressure is smaller or very near to the max
873870
system pressure, the compressor restart pressure and if necessary the max
874-
main reservoir pressure are increased;
871+
main reservoir pressure are increased (single pipe air brakes only)
875872
- if the main reservoir volume is smaller than 0.3 m\ :sup:`3` and the
876873
engine mass is higher than 20 tons, the reservoir volume is raised to 0.78
877-
m\ :sup:`3`;
878-
- the charging rate of the reservoir is derived from the .eng parameter
879-
``AirBrakesAirCompressorPowerRating`` (if this generates a value greater
880-
than 0.5 psi/s) instead of using a default value.
874+
m\ :sup:`3`
875+
- the maximum brake cylinder pressure will be reduced to the maximum pressure
876+
possible from a full service train brake application if it was set above this
877+
amount
878+
- any brake pipe leakage specified by ``TrainPipeLeakRate`` is limited to 2.5 psi/minute
879+
- the dynamic brake delay on electric locomotives is reduced to 2 seconds
880+
if it was defined to be above 4 seconds
881+
- dynamic brake force left at the default value of 20kN will be increased to
882+
half the locomotive's continuous force, or 150kN, whichever is lower
881883

882884
For a full list of parameters, see :ref:`Developing ORTS Content - Parameters and Tokens<parameters_and_tokens>`
883885

Source/Locales/Contrib/es.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
msgid ""
22
msgstr ""
33
"Project-Id-Version: \n"
4-
"POT-Creation-Date: 2024-11-29 18:44:39+0000\n"
5-
"PO-Revision-Date: 2024-12-02 18:04+0100\n"
4+
"POT-Creation-Date: 2025-07-22 20:54:33+0100\n"
5+
"PO-Revision-Date: 2025-07-25 18:15+0200\n"
66
"Last-Translator: \n"
77
"Language-Team: \n"
88
"Language: es\n"
@@ -637,11 +637,11 @@ msgstr "Cancelar"
637637
msgid "&Finish"
638638
msgstr "&Final"
639639

640-
#: ../../Contrib/ContentManager/ContentManagerGUI.cs:92
640+
#: ../../Contrib/ContentManager/ContentManagerGUI.cs:103
641641
msgid "Loading..."
642642
msgstr "Cargando..."
643643

644-
#: ../../Contrib/ContentManager/ContentManagerGUI.Designer.cs:115
644+
#: ../../Contrib/ContentManager/ContentManagerGUI.Designer.cs:116
645645
msgid "Open Rails Content Manager"
646646
msgstr "Administrador Contenido Open Rails"
647647

0 commit comments

Comments
 (0)