Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
199 commits
Select commit Hold shift + click to select a range
42ea7ad
Added a scale of 280 km/h used in Switzerland
pzgulyas Dec 5, 2023
c27f32d
Some clean up
pzgulyas Dec 10, 2023
041bca2
Added voltage and pantograph selectors
Sharpe49 Aug 2, 2022
b2474a3
Small change in order to use the service retention button both as a s…
Sharpe49 Oct 23, 2022
895aab6
Added an event for the power supply to be able to request to open the…
Sharpe49 Oct 23, 2022
5f57526
Refactored the power supplies in order to use the same design pattern…
Sharpe49 Oct 24, 2022
a15e618
Added INI parameters file for power supplies
Sharpe49 Oct 24, 2022
b032739
Added service retention active variable to power supplies
Sharpe49 Oct 24, 2022
5d5aa83
Added pantograph voltage to circuit breakers
Sharpe49 Nov 11, 2022
3694956
Added separated voltmeters for AC and DC pantograph voltages
Sharpe49 Nov 16, 2022
4f4c5e8
Fixed incomplete INI parameter file path for power supplies
Sharpe49 May 2, 2023
01d07b7
Fixed conflict in the event IDs
Sharpe49 Jul 11, 2023
ae3ff17
Add built-in scripts for standard selectors
cesarBLG May 22, 2024
882a33f
Allow limiting max dynamic brake power
cesarBLG Jun 15, 2024
a7afc7e
Handle power on for passenger supply
cesarBLG Jun 22, 2024
16a53ea
Support brake for neutral sections
cesarBLG Jun 22, 2024
9d38fe2
Generic power supply buttons
cesarBLG Jun 22, 2024
c34b9ee
SteamEngine cleanup
cesarBLG Jun 22, 2024
e323123
Access custom buttons from all power supply scripts
cesarBLG Jun 22, 2024
b281a8b
Better handling of QuickPowerOn for circuit breaker
cesarBLG Jun 22, 2024
d94f4b6
Voltage selector initialized to line voltage
cesarBLG Jun 24, 2024
de17c56
Signal power converter status when auxiliary power is on
cesarBLG Jun 24, 2024
b58156a
Reduce allocations
cesarBLG Jun 24, 2024
4150185
Signal events from non-leading locomotives
cesarBLG Jun 25, 2024
889d53f
Configurable minimum RPM for auxiliaries
cesarBLG Jun 26, 2024
3a4bb19
Individual pantograph state
cesarBLG Jun 26, 2024
c577bbb
Electric train supply power
cesarBLG Jun 27, 2024
3d90668
Handle diesel engine hot startup via QuickPowerOn mechanism
cesarBLG Jun 28, 2024
46bf8a6
Get circuit breaker closing authorization
cesarBLG Jun 29, 2024
b5d21b4
Send TCS pantograph orders via power supply events
cesarBLG Jun 29, 2024
b79f408
Max throttle percent allowed by power supply
cesarBLG Jun 30, 2024
fecb56f
Null pointer check
cesarBLG Jul 1, 2024
9aecb14
PushButtons traction cut off relay
cesarBLG Jul 1, 2024
00a89a0
Handle power limitation for diesels
cesarBLG Jul 2, 2024
6559a09
Add information about available power
cesarBLG Jul 6, 2024
3186040
Add battery subsystem
cesarBLG Jul 6, 2024
5823f2e
Signal events for AI trains
cesarBLG Jul 14, 2024
47e7732
Add entries for the manual
cesarBLG Oct 24, 2024
c064a55
Add useful train information to all scripts
cesarBLG Oct 27, 2024
d5ae4a7
Fix bug with service retention cancellation
cesarBLG Oct 28, 2024
386b83c
Update docs for battery voltage
cesarBLG Oct 28, 2024
ac836f1
Include reverser information in power supply script
cesarBLG Nov 2, 2024
705ec65
Fix null pointer when saving selectors
cesarBLG Nov 2, 2024
dfe18e6
Demand reduced throttle by power supply
cesarBLG Nov 2, 2024
8a9c8f9
Use quick power on for AI trains
cesarBLG Nov 7, 2024
c0785d2
Updated translations up to 2024 Nov 2-nd
Weter-ORTS Dec 1, 2024
e2dd24e
Rebasing...
Csantucci Dec 1, 2024
101db21
Update Menu with new Superelevation.
Weter-ORTS Dec 1, 2024
b0a57d3
ORTS.Simulation locale updated up to 2024 Dec 1-st
Weter-ORTS Dec 1, 2024
60c60ce
Updated RunActivity up to 2024 Dec 1-st
Weter-ORTS Dec 1, 2024
71e21a6
Add first hooks for Timetable Mode
Csantucci Dec 2, 2024
9ca77b6
Add documentation in OR manual
Csantucci Dec 3, 2024
26f569b
Bypass merge conflict
Csantucci Dec 3, 2024
838c314
Redefine sound triggers after selection of a new player train
Csantucci Dec 3, 2024
db032e7
Extend checks to state what triggers are enabled
Csantucci Dec 4, 2024
801ad4a
Extend to all timetable mode setting of specific sound triggers
Csantucci Dec 5, 2024
f1681df
Add end of loco being lead of an AI train
Csantucci Dec 13, 2024
2759c59
Enhancements for EP brakes
cesarBLG Dec 19, 2024
5859cc9
Implement EP_single_pipe brake
cesarBLG Dec 21, 2024
266e9ca
Update docs
cesarBLG Dec 21, 2024
284e804
Fix null value for equipment
cesarBLG Jan 3, 2025
514a046
Set brake equipment strings from copied locomotive
cesarBLG Jan 3, 2025
4ae3ec5
Merge branch 'openrails:master' into master
Weter-ORTS Jan 4, 2025
b9ffac2
Updated Menu strings
Weter-ORTS Jan 4, 2025
ad60314
Updated Common strings
Weter-ORTS Jan 4, 2025
759b1a1
Add support for DynaTrax
SteelFill Jan 6, 2025
76ec9e2
Changes needed for exporter.
rwf-rr Jan 10, 2025
5cb9f46
Make path expansion consistent.
rwf-rr Jan 10, 2025
ccd1b48
Add SettingsExporter (contrib).
rwf-rr Jan 10, 2025
defd9fd
Merge branch 'refactor-user-settings-location' into refactor-user-set…
rwf-rr Jan 11, 2025
802ff4c
Merge branch 'refactor-user-settings-location' into refactor-user-set…
rwf-rr Jan 11, 2025
1dd8133
Multiplayer Server, forked from Open Rails Ultimate; blueprint https:…
Csantucci Jan 11, 2025
9ca1642
Modify package references
Csantucci Jan 11, 2025
242f603
Remove package reference trying to get Appveyor success
Csantucci Jan 11, 2025
55db46f
Add docs for missing cabview controls
cesarBLG Jan 23, 2025
eb9c601
Improve battery voltage handling
cesarBLG Jan 23, 2025
ac798e9
Fix superelevation animating when it shouldn't on some rolling stock
SteelFill Jan 24, 2025
88838fb
Merge branch 'refactor-user-settings-location' into refactor-user-set…
rwf-rr Jan 30, 2025
e275f68
Merge branch 'refactor-user-settings-location' into refactor-user-set…
rwf-rr Jan 30, 2025
52c2523
Add more error handling and info.
rwf-rr Jan 31, 2025
94cc8db
Force limit on complexity of dynamic track sections to prevent overfl…
SteelFill Feb 6, 2025
3ee3108
Merge branch 'master' into electrical-braking-enhancement
cesarBLG Feb 11, 2025
1f21bdb
Fix for start time field.
rwf-rr Feb 11, 2025
606e6bd
Refactor to make more readable.
rwf-rr Feb 12, 2025
a9316c7
Use ContentRoute settings only for Explore in Activity Mode.
rwf-rr Feb 13, 2025
14c132b
Do not release EP brakes if holding wire is active
cesarBLG Feb 13, 2025
f9cf2e8
Fix loading from Menu Selection and Content Routes.
rwf-rr Feb 14, 2025
cc4d53c
Fix typo, minor formatting change.
rwf-rr Feb 14, 2025
b7152dc
Docs: adds translation docs
Feb 15, 2025
6670026
fix: Allow multi-player server to build on VS2019
twpol Feb 15, 2025
34aa23a
fix: Update multi-player server build to match others
twpol Feb 15, 2025
f5eef67
Make the 3d texture actually working. Usage in s file e.g.: image ( s…
pzgulyas Feb 16, 2025
fb94fb5
Added a scale of 150
pzgulyas Feb 19, 2025
a4b1aa5
Changed to be configured via the cvf file
pzgulyas Feb 20, 2025
b3679ba
Add some antialiasing
pzgulyas Feb 24, 2025
14ebc8d
Move files
Feb 25, 2025
792d23a
Add number of axles. Also lowest derail force (wheel load).
rwf-rr Mar 1, 2025
4148bea
Force RPM at simulation start to circunvent gearbox bug
cesarBLG Mar 3, 2025
35839a7
Fix calculation of axles for mic of ORTS Axles and MSTS Wheels.
rwf-rr Mar 3, 2025
b54024b
Added documentation
pzgulyas Mar 4, 2025
232abee
Add paths under the route category (after the activities).
rwf-rr Mar 4, 2025
31fd7d2
Stop bogies from rotating while on a turntable
SteelFill Mar 5, 2025
2ed071e
Merge remote-tracking branch 'upstream/master' into docs-move-online
Mar 11, 2025
f3b41bb
Adds action to open website page
Mar 11, 2025
25a098f
fix: Remove unused class
twpol Mar 14, 2025
a5e13ed
refactor: Separate common value property for notification items
twpol Mar 14, 2025
be6e80e
fix: Remove unused properties
twpol Mar 15, 2025
626ebed
feat: Improved notification parameter parsing
twpol Mar 15, 2025
ffccb2e
Merge branch 'master' into powersupply-scripts
cesarBLG Mar 15, 2025
eb8027b
Fix bad weblink
Mar 15, 2025
1ade99e
Disable triple valve inhibition if emergency braking is detected
cesarBLG Mar 15, 2025
bb16c92
Merge branch 'refactor-user-settings-location' into refactor-user-set…
rwf-rr Mar 15, 2025
57abd7b
Fix bug in refactoring of user settings.
rwf-rr Mar 15, 2025
c097fd2
Addo standalone multiplayer server documentation in the OR manual
Csantucci Mar 16, 2025
bf32411
Merge remote-tracking branch 'upstream/master' into docs-move-online
cjakeman Mar 16, 2025
4dd8c4f
Adds separator to dropdown
cjakeman Mar 16, 2025
313f795
Fix F9 powersupply crashes
mbm-OR Mar 17, 2025
ed0ab31
Update de.po
deringenieur71 Mar 17, 2025
1330afa
Update de.po
deringenieur71 Mar 17, 2025
05d5892
Merge pull request #1058 from twpol/refactor/notification-parameters
cjakeman Mar 17, 2025
f75dc71
Fix F9 Web-page conflict.
mbm-OR Mar 17, 2025
d22a001
Merge pull request #1031 from Csantucci/multiplayer-server-official
Csantucci Mar 17, 2025
53e9ed1
Merge pull request #1060 from deringenieur71/master
cjakeman Mar 17, 2025
383755b
Merge pull request #1061 from mbm-OR/bugfix/Fix-F9-Webpage-conflict
mbm-OR Mar 17, 2025
6e1bdff
Add Max Dynamic Brake Force to consist info.
rwf-rr Mar 19, 2025
90cae11
Merge pull request #1059 from mbm-OR/bugfix/Fix-F9-powersupply-crashes
mbm-OR Mar 21, 2025
f342440
Merge pull request #1047 from cjakeman/docs-add-online-only
cjakeman Mar 23, 2025
6c23191
Make tsection.dat error more descriptive
SteelFill Mar 23, 2025
92c74ef
Clean up DecomposeStaticSuperElevation, improve support for unusual t…
SteelFill Mar 24, 2025
382ea6d
Add TpEPA and TpEDBA, when units are imperial.
rwf-rr Mar 24, 2025
eb49b25
Move PantographToggle sound event to the right place
cesarBLG Mar 28, 2025
409064d
Modify manual
cesarBLG Mar 28, 2025
62c89c1
Log derailment, using TraceWarning.
rwf-rr Mar 26, 2025
f88b8b9
Merge pull request #961 from cesarBLG/powersupply-scripts
cesarBLG Mar 29, 2025
902506c
Initial support for power supplies on control cars
cesarBLG Jul 7, 2024
b429cf5
Cab controls from active locomotive in control car
cesarBLG Nov 5, 2024
4263b21
Add locomotive status to driving info
cesarBLG Nov 6, 2024
d8d9709
Set receivers for control car
cesarBLG Nov 6, 2024
af08e2c
feat: Improve build directory creation and clean-up
twpol Mar 29, 2025
d6e1f83
feat: Add build for online-only documentation files
twpol Mar 29, 2025
0cd8cb8
Merge pull request #1063 from SteelFill/error_messages
SteelFill Mar 30, 2025
72674c9
Merge pull request #1015 from cesarBLG/electrical-braking-enhancement
cesarBLG Mar 31, 2025
4629736
Doc changes
pzgulyas Mar 31, 2025
17c8d18
Made Axle Count corrections suggested in the PR review.
rwf-rr Apr 1, 2025
d3f00a1
Delete accidentially commited json file.
rwf-rr Apr 2, 2025
5bbc476
Clarify where the summing of Drive and Idle Axles comes from.
rwf-rr Apr 2, 2025
ffd1af4
Mouse wheel control only with Alt
pzgulyas Apr 4, 2025
8b2dd97
Merge pull request #1068 from twpol/feature/build-online-documentation
cjakeman Apr 5, 2025
3f153f0
Slowed down wheel movement
pzgulyas Apr 6, 2025
ade0195
Merge pull request #1065 from cesarBLG/pantograph-toggle
cesarBLG Apr 7, 2025
3a66597
Fix a NullReferenceException in TCS scripts
pzgulyas Apr 7, 2025
f818e40
Try to fix it at another place
pzgulyas Apr 8, 2025
79cd5f8
Update calculation of Operative Brakes and Tons per Operative Brake.
rwf-rr Apr 11, 2025
3b5cb90
Make changes discussed in PR.
rwf-rr Apr 12, 2025
335f998
Update documentation
Csantucci Apr 17, 2025
248b8d5
Clean up gravity calculations and fix gradient display in rear cab
SteelFill Apr 19, 2025
6a0c471
Update Source/Documentation/Use this folder to store.txt
cjakeman Apr 19, 2025
40c988b
Change cover image for v1.6
Apr 19, 2025
722dd3f
Replace photo with contributed simulation
Apr 20, 2025
95e36ea
Merge pull request #896 from Csantucci/AI-Train-Sound-official
cesarBLG Apr 24, 2025
44e5919
Merge pull request #1045 from rwf-rr/explore-start-time
twpol Apr 24, 2025
da57f73
Merge pull request #1029 from SteelFill/multi_track_profiles
twpol Apr 24, 2025
7e73abd
Fix SME brakes not working
cesarBLG Apr 25, 2025
959de23
Merge pull request #1000 from cesarBLG/control-car-controls
cesarBLG Apr 25, 2025
fdbea15
DMI in 3D cab + two more dials
pzgulyas Apr 25, 2025
9ab642e
Default script for steam locomotives
cesarBLG Mar 29, 2025
b4ac31a
Removed cancel button from the "Auto Installed" tab. On the "Manually…
sweiland-openrails Apr 25, 2025
2c05031
Cancel button only enabled when changes made in the "Manually Install…
sweiland-openrails Apr 25, 2025
9aedc7c
Removed buttonCancel.enabled from "Auto Installed" tab
sweiland-openrails Apr 25, 2025
1a402dc
Message box pops up after pressing the cancel button or closing the f…
sweiland-openrails Apr 26, 2025
0237cda
Added Cancel functionality for adding "Manual Installed" tab entries
sweiland-openrails Apr 26, 2025
fe65f08
Adds Polish translations
Apr 26, 2025
5e37059
Build updates .pot files
Apr 26, 2025
a637cb8
arranges Options > System tab for longer texts
Apr 26, 2025
d230655
Merge remote-tracking branch 'upstream/master'
Apr 26, 2025
f80cfb5
Merge pull request #1007 from Weter-ORTS/master
cjakeman Apr 26, 2025
99fc9ac
Slowed down further
pzgulyas Apr 27, 2025
4b5b7ab
Create unique route name by adding (1), (2) etc to the name. This is …
sweiland-openrails Apr 27, 2025
6380c71
When in the "Manual Installed" tab a route is added or changed for wh…
sweiland-openrails Apr 27, 2025
7e6fb60
During upgrade OR from 1.5.1 to 1.6 automatic routes are imported. Na…
sweiland-openrails Apr 29, 2025
d06e05d
Merge pull request #1030 from rwf-rr/refactor-user-settings-location
twpol Apr 30, 2025
5e2423c
Merge pull request #1052 from rwf-rr/content-manager-more
twpol Apr 30, 2025
9a00900
Merge pull request #1080 from cjakeman/adjust-menu-for-russian-text2
twpol Apr 30, 2025
9295cb9
Merge pull request #1071 from cjakeman/manual-update-cover-image
twpol Apr 30, 2025
a440b33
Merge pull request #1049 from cjakeman/docs-move-online
twpol Apr 30, 2025
39c4437
Mouse wheel control only with Alt – Followup for #1051
pzgulyas May 1, 2025
77a649f
Merge pull request #1077 from cesarBLG/sme-regression-fix
cesarBLG May 1, 2025
dee7900
Leading and traling spaces removed from route when leaving the field
sweiland-openrails May 2, 2025
592e054
Merge remote-tracking branch 'upstream/master' into translate-po
May 3, 2025
6d0e99c
Determine unique name for the last row also
sweiland-openrails May 3, 2025
a4b51ce
Merge pull request #1066 from rwf-rr/log-derailment-and-more
cjakeman May 3, 2025
fc8adf7
Empty manual form fixes.
sweiland-openrails May 3, 2025
f7ec809
Merge pull request #1079 from cjakeman/translate-po
twpol May 3, 2025
0e66a4f
Merge pull request #1083 from sweiland-openrails/MenuRouteNameClash
cjakeman May 4, 2025
4fdacd5
Merge pull request #1070 from pzgulyas/scriptfix
cjakeman May 4, 2025
5522fc5
Merge pull request #1078 from cesarBLG/steam-locomotive-script
cjakeman May 8, 2025
f34a04c
Merge branch 'master' into refactor-user-settings-loc/export-settings
rwf-rr May 11, 2025
862913e
Fix minor formatting issues.
rwf-rr May 11, 2025
e10390b
Update user manual for Settings Exporter.
rwf-rr May 12, 2025
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
15 changes: 9 additions & 6 deletions Build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ FOR /F "usebackq tokens=1* delims==" %%A IN (`CALL GetVersion.cmd %Mode%`) DO SE
REM Restore NuGet packages.
nuget restore Source\ORTS.sln || GOTO :error

REM Recreate Program directory for output.
REM Recreate Program directory for output and delete previous build files.
CALL :recreate "Program" || GOTO :error
CALL :delete "OpenRails-%Mode%*" || GOTO :error

REM Build main program.
REM Disable warning CS1591 "Missing XML comment for publicly visible type or member".
Expand Down Expand Up @@ -126,11 +127,14 @@ IF NOT "%Mode%" == "Unstable" (
NET stop ClickToRunSvc
NET start ClickToRunSvc

REM Recreate Documentation folder for output.
CALL :recreate "Program\Documentation" || GOTO :error
REM Create the documentation folders for output.
CALL :create "Program\Documentation" || GOTO :error
CALL :create "Program\Documentation\Online" || GOTO :error
CALL :create "Program\Documentation\es" || GOTO :error

REM Compile the documentation.
FOR %%E IN (doc docx docm xls xlsx xlsm odt) DO FOR %%F IN ("Source\Documentation\*.%%E") DO ECHO %%~F && OfficeToPDF.exe /bookmarks /print "%%~F" "Program\Documentation\%%~nF.pdf" || GOTO :error
FOR %%E IN (doc docx docm xls xlsx xlsm odt) DO FOR %%F IN ("Source\Documentation\Online\*.%%E") DO ECHO %%~F && OfficeToPDF.exe /bookmarks /print "%%~F" "Program\Documentation\Online\%%~nF.pdf" || GOTO :error
>"Source\Documentation\Manual\version.py" ECHO version = '%OpenRails_Version%' || GOTO :error
>>"Source\Documentation\Manual\version.py" ECHO release = '%OpenRails_Revision%' || GOTO :error
PUSHD "Source\Documentation\Manual" && CALL make.bat clean & POPD || GOTO :error
Expand All @@ -139,13 +143,13 @@ IF NOT "%Mode%" == "Unstable" (
REM Copy the documentation.
FOR %%F IN ("Source\Documentation\*.pdf") DO CALL :copy "%%~F" "Program\Documentation\%%~nF.pdf" || GOTO :error
CALL :copy "Source\Documentation\Manual\_build\latex\Manual.pdf" "Program\Documentation\Manual.pdf" || GOTO :error
CALL :create "Program\Documentation\es"
CALL :copy "Source\Documentation\Manual\es\Manual.pdf" "Program\Documentation\es\Manual.pdf" || GOTO :error
ROBOCOPY /MIR /NJH /NJS "Source\Documentation\SampleFiles" "Program\Documentation\SampleFiles"
IF %ERRORLEVEL% GEQ 8 GOTO :error

REM Copy the documentation separately.
FOR %%F IN ("Program\Documentation\*.pdf") DO CALL :copy "%%~F" "OpenRails-%Mode%-%%~nxF" || GOTO :error
FOR %%F IN ("Program\Documentation\Online\*.pdf") DO CALL :copy "%%~F" "OpenRails-%Mode%-%%~nxF" || GOTO :error
)

IF "%Mode%" == "Stable" (
Expand All @@ -161,8 +165,7 @@ IF "%Mode%" == "Stable" (
)

REM Create binary and source zips.
CALL :delete "OpenRails-%Mode%*.zip" || GOTO :error
PUSHD "Program" && 7za.exe a -r -tzip -x^^!*.xml "..\OpenRails-%Mode%.zip" . && POPD || GOTO :error
PUSHD "Program" && 7za.exe a -r -tzip -x^^!*.xml -x^^!Online "..\OpenRails-%Mode%.zip" . && POPD || GOTO :error
7za.exe a -r -tzip -x^^!.* -x^^!obj -x^^!lib -x^^!_build -x^^!*.bak "OpenRails-%Mode%-Source.zip" "Source" || GOTO :error

ENDLOCAL
Expand Down
68 changes: 51 additions & 17 deletions Source/Contrib/ContentManager/ContentInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,24 @@ public static string GetText(Content content)
details.AppendFormat("Name:\t{1}{0}", Environment.NewLine, data.Name);
details.AppendFormat("NumEngines:\t{1}{0}", Environment.NewLine, data.NumEngines);
details.AppendFormat("NumCars:\t{1}{0}", Environment.NewLine, data.NumCars);
details.AppendFormat("MaxSpeed:\t{1}{0}", Environment.NewLine, FormatStrings.FormatSpeedLimit(data.MaxSpeedMps, IsMetric));
details.AppendFormat("Weight:\t{1}{0}", Environment.NewLine, FormatStrings.FormatLargeMass(data.MassKG, IsMetric, IsUK));
details.AppendFormat("Axles:\t{1}{0}", Environment.NewLine, data.NumAxles);
details.AppendFormat("Weight:\t{1} (trailing: {2}){0}", Environment.NewLine, FormatStrings.FormatLargeMass(data.MassKG, IsMetric, IsUK),
FormatStrings.FormatLargeMass(data.TrailingMassKG, IsMetric, IsUK));
details.AppendFormat("Length:\t{1}{0}", Environment.NewLine, FormatStrings.FormatShortDistanceDisplay(data.LengthM, IsMetric));
details.AppendFormat("Power:\t{1}{0}", Environment.NewLine, FormatStrings.FormatPower(data.MaxPowerW, IsMetric, IsImperialBHP, IsImperialBTUpS));
details.AppendFormat("MaxPower:\t{1}{0}", Environment.NewLine, FormatStrings.FormatPower(data.MaxPowerW, IsMetric, IsImperialBHP, IsImperialBTUpS));
details.AppendFormat("MaxTE:\t{1}{0}", Environment.NewLine, FormatStrings.FormatForce(data.MaxTractiveForceN, IsMetric));
details.AppendFormat("MaxContTE:\t{1}{0}", Environment.NewLine, FormatStrings.FormatForce(data.MaxContinuousTractiveForceN, IsMetric));
details.AppendFormat("MaxDynBrk:\t{1}{0}", Environment.NewLine, FormatStrings.FormatForce(data.MaxDynamicBrakeForceN, IsMetric));
if (!IsMetric && !IsUK)
{
details.AppendFormat("HPT:\t{1}{0}", Environment.NewLine, FormatHPT(data.MaxPowerW, data.TrailingMassKG));
details.AppendFormat("TpOB:\t{1}{0}", Environment.NewLine, FormatTPOB(data.TrailingMassKG, data.NumOperativeBrakes));
details.AppendFormat("TpEPA:\t{1}{0}", Environment.NewLine, FormatTonsPerEPA(data.TrailingMassKG, data.MaxContinuousTractiveForceN));
details.AppendFormat("TpEDBA:\t{1}{0}", Environment.NewLine, FormatTonsPerEDBA(data.TrailingMassKG, data.MaxDynamicBrakeForceN));
}
details.AppendFormat("MaxSpeed:\t{1}{0}", Environment.NewLine, FormatStrings.FormatSpeedLimit(data.MaxSpeedMps, IsMetric));
details.AppendFormat("MinCouplerStrength:\t{1}{0}", Environment.NewLine, FormatStrings.FormatForce(data.MinCouplerStrengthN, IsMetric));
if (!IsMetric && !IsUK) { details.AppendFormat("HPT:\t{1}{0}", Environment.NewLine, FormatHPT(data.MaxPowerW, data.MassKG)); }
if (!IsMetric && !IsUK) { details.AppendFormat("TPOB:\t{1}{0}", Environment.NewLine, FormatTPOB(data.MassKG, data.NumOperativeBrakes)); }
details.AppendFormat("MinDerailForce:\t{1}{0}", Environment.NewLine, FormatStrings.FormatForce(data.MinDerailForceN, IsMetric));
details.AppendLine();
details.AppendFormat("Car ID:\tDirection:\tWeight:\tName:\t{0}", Environment.NewLine);
foreach (var car in data.Cars)
Expand All @@ -208,16 +218,24 @@ public static string GetText(Content content)
details.AppendFormat("Type:\t{1}{0}", Environment.NewLine, data.Type);
details.AppendFormat("SubType:\t{1}{0}", Environment.NewLine, data.SubType);
details.AppendFormat("Name:\t{1}{0}", Environment.NewLine, data.Name);
details.AppendFormat("Weight:\t{1} ({2}){0}", Environment.NewLine, FormatStrings.FormatMass(data.MassKG, IsMetric), FormatStrings.FormatLargeMass(data.MassKG, IsMetric, IsUK));
details.AppendFormat("Weight:\t{1} ({2}){0}", Environment.NewLine, FormatStrings.FormatMass(data.MassKG, IsMetric), FormatStrings.FormatLargeMass(data.MassKG, IsMetric, IsUK));
details.AppendFormat("Length:\t{1}{0}", Environment.NewLine, FormatStrings.FormatShortDistanceDisplay(data.LengthM, IsMetric));
if (data.Type == CarType.Engine)
if (data.Type != CarType.Engine)
{
details.AppendFormat("MaxPowerW:\t{1}{0}", Environment.NewLine, FormatStrings.FormatPower(data.MaxPowerW, IsMetric, IsImperialBHP, IsImperialBTUpS));
details.AppendFormat("MaxForce:\t{1}{0}", Environment.NewLine, FormatStrings.FormatForce(data.MaxForceN, IsMetric));
details.AppendFormat("MaxSpeed:\t{1}{0}", Environment.NewLine, FormatStrings.FormatSpeedLimit(data.MaxSpeedMps, IsMetric));
details.AppendFormat("Axles:\t{1}{0}", Environment.NewLine, data.NumAllAxles);
}
details.AppendFormat("MaxBrakeF:\t{1}{0}", Environment.NewLine, FormatStrings.FormatForce(data.MaxBarkeForceN, IsMetric));
else
{
details.AppendFormat("Axles:\t{1}+{2}{0}", Environment.NewLine, data.NumDriveAxles, data.NumAllAxles - data.NumDriveAxles);
details.AppendFormat("MaxPower:\t{1}{0}", Environment.NewLine, FormatStrings.FormatPower(data.MaxPowerW, IsMetric, IsImperialBHP, IsImperialBTUpS));
details.AppendFormat("MaxTE:\t{1}{0}", Environment.NewLine, FormatStrings.FormatForce(data.MaxForceN, IsMetric));
details.AppendFormat("MaxContTE:\t{1}{0}", Environment.NewLine, FormatStrings.FormatForce(data.MaxContinuousForceN, IsMetric));
details.AppendFormat("MaxDynBrk:\t{1}{0}", Environment.NewLine, FormatStrings.FormatForce(data.MaxDynamicBrakeForceN, IsMetric));
}
details.AppendFormat("MaxBrakeF:\t{1}{0}", Environment.NewLine, FormatStrings.FormatForce(data.MaxBrakeForceN, IsMetric));
if (data.MaxSpeedMps > 0f) { details.AppendFormat("MaxSpeed:\t{1}{0}", Environment.NewLine, FormatStrings.FormatSpeedLimit(data.MaxSpeedMps, IsMetric)); }
details.AppendFormat("MinCouplerStrength:\t{1}{0}", Environment.NewLine, FormatStrings.FormatForce(data.MinCouplerStrengthN, IsMetric));
details.AppendFormat("MinDerailForce:\t{1}{0}", Environment.NewLine, FormatStrings.FormatForce(data.MinDerailForceN, IsMetric));
details.AppendLine();
details.AppendFormat("Description:\t{0}{0}{1}{0}{0}", Environment.NewLine, data.Description);
}
Expand Down Expand Up @@ -264,9 +282,6 @@ static string FormatMassBar(float massKg)
/// <summary>
/// Calculate and format horsepower per ton for consist, rounded to one decimal.
/// </summary>
/// <param name="consistPowerW"></param>
/// <param name="consistMassKG"></param>
/// <returns>horsepower-per-ton formated to one decimal.</returns>
//TODO: implement UK and metric version
static string FormatHPT(float consistPowerW, float consistMassKG)
{
Expand All @@ -277,14 +292,33 @@ static string FormatHPT(float consistPowerW, float consistMassKG)
/// <summary>
/// Calculate and format tons per operative brake for consist, rounded to an integer.
/// </summary>
/// <param name="consistMassKG"></param>
/// <param name="consistNumOpBrakes"></param>
/// <returns>tons-per-operative-brake formated to an integer.</returns>
//TODO: implement UK and metric version
static string FormatTPOB(float consistMassKG, float consistNumOpBrakes)
{
var tpob = consistNumOpBrakes > 0 ? Kg.ToTUS(consistMassKG) / consistNumOpBrakes : 0;
return string.Format("{0:0}", tpob);
}

/// <summary>
/// Calculate and format tons per equivalent powered axle, rounded to an integer.
/// Based on UP convention, of 10k lbf counting as one axle.
/// Strictly, EPA should be defined in the eng file. May be done in future.
/// </summary>
static string FormatTonsPerEPA(float consistMassKG, float consistMaxTractiveEffortN)
{
var tpepa = consistMaxTractiveEffortN > 0 ? Kg.ToTUS(consistMassKG) / (N.ToLbf(consistMaxTractiveEffortN) / 10000f) : 0;
return string.Format("{0:0}", tpepa);
}

/// <summary>
/// Calculate and format tons per equivalent dynamic brake axle, rounded to an integer.
/// Based on UP convention, of 10k lbf counting as one axle.
/// Strictly, EDBA should be defined in the eng file. May be done in future.
/// </summary>
static string FormatTonsPerEDBA(float consistMassKG, float consistMaxDynamicBrakeForceN)
{
var tpedba = consistMaxDynamicBrakeForceN > 0 ? Kg.ToTUS(consistMassKG) / (N.ToLbf(consistMaxDynamicBrakeForceN) / 10000f) : 0;
return string.Format("{0:0}", tpedba);
}
}
}
7 changes: 7 additions & 0 deletions Source/Contrib/ContentManager/ContentMSTS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ public override IEnumerable<Content> Get(ContentType type)
foreach (var item in Enumerable.Concat(Directory.GetFiles(pathOR, "*.timetable_or"), Directory.GetFiles(pathOR, "*.timetable-or")))
yield return new ContentORTimetableActivity(this, Path.Combine(pathOR, item));
}
else if (type == ContentType.Path)
{
var path = Path.Combine(PathName, "Paths");
if (Directory.Exists(path))
foreach (var item in Directory.GetFiles(path, "*.pat"))
yield return new ContentMSTSPath(this, Path.Combine(path, item));
}
}

public override Content Get(string name, ContentType type)
Expand Down
51 changes: 46 additions & 5 deletions Source/Contrib/ContentManager/Models/Car.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@
// You should have received a copy of the GNU General Public License
// along with Open Rails. If not, see <http://www.gnu.org/licenses/>.

// MSTS Wheels and ORTS Axles
// * ORTS uses unpowered and drive axles. Eg. 2 and 4 for an ES44C4
// * MSTS uses a mix of wheels and axle. The Wagon section has the total,
// the Engine section the driven only.
// Values greater than 6 are wheels, less than 6 are axles. Some are
// intentionally wrong to work around MSTS issues.

using Orts.Formats.Msts;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;

namespace ORTS.ContentManager.Models
{
Expand All @@ -38,24 +42,32 @@ public class Car
public readonly string Description;
public readonly float MassKG;
public readonly float LengthM;
public readonly float MaxBarkeForceN;
public readonly int NumDriveAxles;
public readonly int NumIdleAxles;
public readonly int NumAllAxles;
public readonly float MaxBrakeForceN;
public readonly float MaxPowerW;
public readonly float MaxForceN;
public readonly float MaxContinuousForceN;
public readonly float MaxDynamicBrakeForceN;
public readonly float MaxSpeedMps;
public readonly float MinCouplerStrengthN;
public readonly float MinDerailForceN;

public Car(Content content)
{
Debug.Assert(content.Type == ContentType.Car);

const float GravitationalAccelerationMpS2 = 9.80665f;

// .eng files also have a wagon block
var wagFile = new WagonFile(content.PathName);
Type = CarType.Wagon;
SubType = wagFile.WagonType;
Name = wagFile.Name;
MassKG = wagFile.MassKG;
LengthM = wagFile.WagonSize.LengthM;
MaxBarkeForceN = wagFile.MaxBrakeForceN;
MaxBrakeForceN = wagFile.MaxBrakeForceN;
MinCouplerStrengthN = wagFile.MinCouplerStrengthN;

if (System.IO.Path.GetExtension(content.PathName).Equals(".eng", StringComparison.OrdinalIgnoreCase))
Expand All @@ -66,9 +78,38 @@ public Car(Content content)
Name = engFile.Name;
MaxPowerW = engFile.MaxPowerW;
MaxForceN = engFile.MaxForceN;
MaxContinuousForceN = engFile.MaxContinuousForceN;
MaxDynamicBrakeForceN = engFile.MaxDynamicBrakeForceN;
MaxSpeedMps = engFile.MaxSpeedMps;
Description = engFile.Description;

// see MSTSLocomotive.Initialize()
NumDriveAxles = engFile.NumDriveAxles;
if (NumDriveAxles == 0)
{
if (engFile.NumEngWheels != 0 && engFile.NumEngWheels < 7) { NumDriveAxles = (int)engFile.NumEngWheels; }
else { NumDriveAxles = 4; }
}
}

// see MSTSWagon.LoadFromWagFile()
NumIdleAxles = wagFile.NumWagAxles;
if ((NumIdleAxles == 0) && Type != CarType.Engine)
{
if (wagFile.NumWagWheels != 0 && wagFile.NumWagWheels < 6) { NumIdleAxles = (int)wagFile.NumWagWheels; }
else { NumIdleAxles = 4; }
}

// correction for steam engines; see TrainCar.Update()
// this is not always correct as TrainCar uses the WheelAxles array for the count; that is too complex to do here
if (SubType.Equals("Steam") && NumDriveAxles >= (NumDriveAxles + NumIdleAxles)) { NumDriveAxles /= 2; }

// see TrainCar.UpdateTrainDerailmentRisk(), ~ line 1609
NumAllAxles = NumDriveAxles + NumIdleAxles;

// see TrainCar.UpdateTrainDerailmentRisk()
var numWheels = NumAllAxles * 2;
if (numWheels > 0) { MinDerailForceN = MassKG / numWheels * GravitationalAccelerationMpS2; }
}
}
}
Loading