copperpen, on 16 June 2014 - 11:57 AM, said:
I am not in disagreement, just pointing out the way it is currently set up. As for BTU values for fuel, this is adjustable by the end user within the eng file by using either of these entries,
ORTSFuelCalorific ( 13700btu/lb ) or ORTSFuelCalorific ( 33400kj/kg )
One thing I wish to make clear it is not my intention to even appear to be attacking anyone one on the development team but OR is being pushed in the end to be an accurate sim. As has already been said its good the code has defaults as it least it gives a chance to those with little knowledge to produce something that is at least reasonably driveable. But the steam code ___MUST___ be able to be tuned by those of us with a real passion for acccurate behavior.
Two items in particular need to be targeted, the cylinders effective pressure, whats called in engineering circles Brake Mean Effective Pressure (bmep). This is essentially a "goodness" factor for the cylinders and valve gear. This is catered for in the code by "ForceFactor1" and particularly "ForceFactor2" parameters
The second is pressure drop between the boiler and the cylinders. From Chaplelon's work it is clear this is where a lot of Tractive effort was lost. Chapelon being apparently the first railway engineer to think of testing things like gas flow. This is catered by the "CylinderPressureDropLBpStoPSI" parameter.
The three parameters mentioned are all "Interpolator"'s
All three these are in the code to parse the eng/wag file.
Now as stated I am no expert in C# by I think the items below are correct.
Code exerpt from MSTSSteamLocomtive.cs
line 667
/// <summary>
/// Parse the wag file parameters required for the simulator and viewer classes
/// </summary>
public override void Parse(string lowercasetoken, STFReader stf)
{
switch (lowercasetoken)
{
A lot of parameters cutout for clarity.......
line 707
case "engine(ortsforcefactor1": ForceFactor1Npcutoff = new Interpolator(stf); break;
case "engine(ortsforcefactor2": ForceFactor2Npcutoff = new Interpolator(stf); break;
case "engine(ortscylinderpressuredrop": CylinderPressureDropLBpStoPSI = new Interpolator(stf); break;
case "engine(ortsbackpressure": BackPressureLBpStoPSI = new Interpolator(stf); break;
So all the effectvely needs done to be is to find out how the data for new Interpolator(stf) is arranged and prove that this function works. This is NOT part of the steam code but part of the stf (structured text file code, I assume).
I have had a study of this code as mentioned previously to try and figure it out but found it more obscure than is usual for C#.
The actual parsing of the text line is done in .........
I think anyway........
trunk/Source/RunActivity/Common/Interpolator.cs
starting line 57
public Interpolator(STFReader stf)
{
List<float> list = new List<float>();
stf.MustMatch("(");
while (!stf.EndOfBlock())
list.Add(stf.ReadFloat(STFReader.UNITS.Any, null));
if (list.Count % 2 == 1)
STFException.TraceWarning(stf, "Ignoring extra odd value in Interpolator list.");
int n = list.Count/2;
if (n < 2)
STFException.TraceWarning(stf, "Interpolator must have at least two value pairs.");
X = new float[n];
Y = new float[n];
Size = n;
for (int i = 0; i < n; i++)
{
X[i] = list[2*i];
Y[i] = list[2*i+1];
if (i > 0 && X[i - 1] >= X[i])
STFException.TraceWarning(stf, "Interpolator x values must be increasing.");
}
}
This appears to have the data in pairs the whole line enclosed in braces eg
( x1 y1 x2 y2 x3 y3 etc in pairs )
I you separate the pairs by comas OR throws an error.
I do not believe this section of the code is rocket science (mind you it is ____ANOTHER_____ thing to do,ssssiiiiggghhhh).
Putting this section of the code through a debugger may prove interesting.
I have not been just sitting down wingeing :pleasantry:.
Lindsay