Skip to content

Commit

Permalink
feat: Remove old loading progress indicator logging
Browse files Browse the repository at this point in the history
  • Loading branch information
twpol committed Nov 23, 2024
1 parent 55d340c commit c734592
Show file tree
Hide file tree
Showing 17 changed files with 1 addition and 65 deletions.
5 changes: 0 additions & 5 deletions Source/Orts.Formats.Msts/SignalScripts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,6 @@ public void sigscrRead(string scrFileName, StreamReader scrStream, IDictionary<s
{
readInfo.Scriptname = scriptname;
ScriptLines.Add(readInfo);

if (readInfo.Linenumber % 1000 == 1)
{
Trace.Write("s");
}
}
}
}
Expand Down
1 change: 0 additions & 1 deletion Source/Orts.Formats.Msts/WorldSoundFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public void Read(string wsfilename, TrItem[] trItems)
{
if (File.Exists(wsfilename))
{
Trace.Write("$");
using (STFReader stf = new STFReader(wsfilename, false))
{
stf.ParseFile(new STFReader.TokenProcessor[] {
Expand Down
2 changes: 0 additions & 2 deletions Source/Orts.Formats.OR/AESignals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ public AESignals(MSTSData data, SignalConfigurationFile sigcfg)

// read SIGSCR files

Trace.Write(" SIGSCR ");
//scrfile = new SIGSCRfile(data.RoutePath, sigcfg.ScriptFiles, sigcfg.SignalTypes);

// build list of signal world file information
Expand Down Expand Up @@ -286,7 +285,6 @@ private void BuildSignalWorld(MSTSData data, SignalConfigurationFile sigcfg)

// read w-file, get SignalObjects only

Trace.Write("W");
WorldFile WFile;
try
{
Expand Down
14 changes: 0 additions & 14 deletions Source/Orts.Simulation/Simulation/AIs/AI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -327,18 +327,13 @@ private void PrerunAI(CancellationToken cancellation)
float firstAITime = StartList.GetNextTime();
if (firstAITime > 0 && firstAITime < Simulator.ClockTime)
{
Trace.Write("\n Run AI : " + StartList.Count.ToString() + " ");

// Perform update for AI trains upto actual start time
clockTime = firstAITime - 1.0f;
localTime = true;
Simulator.PreUpdate = true;

for (double runTime = firstAITime; runTime < Simulator.ClockTime; runTime += 5.0) // Update with 5 secs interval
{
int fullsec = Convert.ToInt32(runTime);
if (fullsec % 3600 == 0) Trace.Write(" " + (fullsec / 3600).ToString("00") + ":00 ");

AIUpdate((float)(runTime - clockTime), Simulator.PreUpdate);
Simulator.Signals.Update(true);
clockTime = runTime;
Expand All @@ -355,8 +350,6 @@ private void PrerunAI(int playerTrainOriginalTrain, TTTrain.FormCommand playerTr
float firstAITime = StartList.GetNextTime();
if (firstAITime > 0 && firstAITime < Simulator.ClockTime)
{
Trace.Write("\n Run AI : " + StartList.Count.ToString() + " ");

// Perform update for AI trains upto actual start time
clockTime = firstAITime - 1.0f;
localTime = true;
Expand All @@ -367,9 +360,6 @@ private void PrerunAI(int playerTrainOriginalTrain, TTTrain.FormCommand playerTr
var loaderSpan = (float)TimetableInfo.PlayerTrainOriginalStartTime - firstAITime;
Simulator.TimetableLoadedFraction = ((float)runTime - firstAITime) / loaderSpan;

int fullsec = Convert.ToInt32(runTime);
if (fullsec % 3600 < 5) Trace.Write(" " + (fullsec / 3600).ToString("00") + ":00 ");

endPreRun = AITTUpdate((float)(runTime - clockTime), Simulator.PreUpdate, ref activeTrains);

if (activeTrains)
Expand Down Expand Up @@ -539,9 +529,6 @@ private void PrerunAI(int playerTrainOriginalTrain, TTTrain.FormCommand playerTr
if (cancellation.IsCancellationRequested) // Ping loader watchdog
return;

int fullsec = Convert.ToInt32(runTime);
if (fullsec % 3600 == 0) Trace.Write(" " + (fullsec / 3600).ToString("00") + ":00 ");

if (runTime >= 24 * 3600) // End of day reached
{
if (playerTrainOriginalTrain > 0)
Expand Down Expand Up @@ -614,7 +601,6 @@ private void PrerunAI(int playerTrainOriginalTrain, TTTrain.FormCommand playerTr
clockTime = Simulator.ClockTime = playerTTTrain.StartTime.Value;
}

Trace.Write("\n");
Simulator.PreUpdate = false;
}

Expand Down
2 changes: 0 additions & 2 deletions Source/Orts.Simulation/Simulation/Signalling/Signals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ public Signals(Simulator simulator, SignalConfigurationFile sigcfg, Cancellation
tdbfile = Simulator.TDB;

// read SIGSCR files
Trace.Write(" SIGSCR ");
scrfile = new SIGSCRfile(new SignalScripts(sigcfg.ScriptPath, sigcfg.ScriptFiles, sigcfg.SignalTypes, sigcfg.SignalFunctions, sigcfg.ORTSNormalSubtypes));
CsSignalScripts = new CsSignalScripts(Simulator);

Expand Down Expand Up @@ -423,7 +422,6 @@ private void BuildSignalWorld(Simulator simulator, SignalConfigurationFile sigcf

// read w-file, get SignalObjects only

Trace.Write("W");
WorldFile WFile;
try
{
Expand Down
14 changes: 0 additions & 14 deletions Source/Orts.Simulation/Simulation/Simulator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,6 @@ public Simulator(UserSettings settings, string activityPath, bool useOpenRailsDi

string ORfilepath = System.IO.Path.Combine(RoutePath, "OpenRails");

Trace.Write("Loading ");

Trace.Write(" TRK");
TRK = new RouteFile(MSTS.MSTSPath.GetTRKFileName(RoutePath));
RouteName = TRK.Tr_RouteFile.Name;
MilepostUnitsMetric = TRK.Tr_RouteFile.MilepostUnitsMetric;
Expand All @@ -307,21 +304,17 @@ public Simulator(UserSettings settings, string activityPath, bool useOpenRailsDi
else if (TRK.Tr_RouteFile.SuperElevation.Count > 0 && !TRK.Tr_RouteFile.SuperElevation[0].DefaultStandard)
UseSuperElevation = true; // Custom superelevation standard entered, force enable superelevation

Trace.Write(" TDB");
TDB = new TrackDatabaseFile(RoutePath + @"\" + TRK.Tr_RouteFile.FileName + ".tdb");

if (File.Exists(ORfilepath + @"\sigcfg.dat"))
{
Trace.Write(" SIGCFG_OR");
SIGCFG = new SignalConfigurationFile(ORfilepath + @"\sigcfg.dat", true);
}
else
{
Trace.Write(" SIGCFG");
SIGCFG = new SignalConfigurationFile(RoutePath + @"\sigcfg.dat", false);
}

Trace.Write(" DAT");
if (Directory.Exists(RoutePath + @"\Openrails") && File.Exists(RoutePath + @"\Openrails\TSECTION.DAT"))
TSectionDat = new TrackSectionsFile(RoutePath + @"\Openrails\TSECTION.DAT");
else if (Directory.Exists(RoutePath + @"\GLOBAL") && File.Exists(RoutePath + @"\GLOBAL\TSECTION.DAT"))
Expand All @@ -337,20 +330,16 @@ public Simulator(UserSettings settings, string activityPath, bool useOpenRailsDi
orRouteConfig.SetTraveller(TSectionDat, TDB);
#endif

Trace.Write(" ACT");

var rdbFile = RoutePath + @"\" + TRK.Tr_RouteFile.FileName + ".rdb";
if (File.Exists(rdbFile))
{
Trace.Write(" RDB");
RDB = new RoadDatabaseFile(rdbFile);
}

var carSpawnFile = RoutePath + @"\carspawn.dat";
if (File.Exists(carSpawnFile))
{
CarSpawnerLists = new List<CarSpawnerList>();
Trace.Write(" CARSPAWN");
CarSpawnerFile = new CarSpawnerFile(RoutePath + @"\carspawn.dat", RoutePath + @"\shapes\", CarSpawnerLists);
}

Expand All @@ -359,22 +348,19 @@ public Simulator(UserSettings settings, string activityPath, bool useOpenRailsDi
if (File.Exists(extCarSpawnFile))
{
if (CarSpawnerLists == null) CarSpawnerLists = new List<CarSpawnerList>();
Trace.Write(" EXTCARSPAWN");
ExtCarSpawnerFile = new ExtCarSpawnerFile(RoutePath + @"\openrails\carspawn.dat", RoutePath + @"\shapes\", CarSpawnerLists);
}

// Load animated clocks if file "animated.clocks-or" exists --------------------------------------------------------
var clockFile = RoutePath + @"\animated.clocks-or";
if (File.Exists(clockFile))
{
Trace.Write(" CLOCKS");
new ClocksFile(clockFile, ClockShapeList, RoutePath + @"\shapes\");
}

// Generate a list of EOTs that may be used to attach at end of train
if (Directory.Exists(EOTPath))
{
Trace.Write(" EOT");
FullEOTPaths = new FullEOTPaths(EOTPath);
}

Expand Down
2 changes: 0 additions & 2 deletions Source/Orts.Simulation/Simulation/Timetables/PoolInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,9 @@ public Dictionary<string, TimetablePool> ProcessPools(string[] arguments, Cancel
filenames = GetFilenames(arguments[0]);

// Get file contents as strings
Trace.Write("\n");
foreach (string filePath in filenames)
{
// Get contents as strings
Trace.Write("Pool File : " + filePath + "\n");
var poolInfo = new TimetableReader(filePath);

// Read lines from input until 'Name' definition is found
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,9 @@ public List<TTTrain> ProcessTimetable(string[] arguments, CancellationToken canc
filenames = GetFilenames(arguments[0]);

// Get file contents as strings
Trace.Write("\n");
foreach (string filePath in filenames)
{
// Get contents as strings
Trace.Write("TT File : " + filePath + "\n");
var fileContents = new TimetableReader(filePath);

#if DEBUG_TIMETABLE
Expand All @@ -128,9 +126,7 @@ public List<TTTrain> ProcessTimetable(string[] arguments, CancellationToken canc
}

// Read and pre-process routes
Trace.Write(" TTROUTES:" + Paths.Count.ToString() + " ");
loadPathNoFailure = PreProcessRoutes(cancellation);
Trace.Write(" TTTRAINS:" + trainInfoList.Count.ToString() + " ");

// Get startinfo for player train
playerTrain = GetPlayerTrain(ref trainInfoList, arguments);
Expand Down
2 changes: 0 additions & 2 deletions Source/Orts.Simulation/Simulation/Timetables/TurntableInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,9 @@ public Dictionary<string, TimetableTurntablePool> ProcessTurntables(string[] arg
filenames = GetTurntableFilenames(arguments[0]);

// Get file contents as strings
Trace.Write("\n");
foreach (string filePath in filenames)
{
// Get contents as strings
Trace.Write("Turntable File : " + filePath + "\n");
var turntableInfo = new TimetableReader(filePath);

// Read lines from input until 'Name' definition is found
Expand Down
2 changes: 0 additions & 2 deletions Source/Orts.Simulation/Simulation/Turntables.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ public TurntableFile(string filePath, string shapePath, List<MovingTable> moving
return;
}

Trace.Write(" TURNTBL");

using (STFReader stf = new STFReader(filePath, false))
{
var count = stf.ReadInt(null);
Expand Down
5 changes: 0 additions & 5 deletions Source/RunActivity/Viewer3D/DynamicTrack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -420,14 +420,12 @@ public TRPFile(Viewer viewer, string filespec)
{
// No track profile provided, use default
TrackProfile = new TrProfile(viewer);
Trace.Write("(default)");
return;
}
FileInfo fileInfo = new FileInfo(filespec);
if (!fileInfo.Exists)
{
TrackProfile = new TrProfile(viewer); // Default profile if no file
Trace.Write("(default)");
}
else
{
Expand Down Expand Up @@ -465,7 +463,6 @@ public TRPFile(Viewer viewer, string filespec)
}
}
}
Trace.Write("(.STF)");
break;

case ".XML": // XML-style
Expand Down Expand Up @@ -498,13 +495,11 @@ public TRPFile(Viewer viewer, string filespec)
{
TrackProfile = new TrProfile(viewer, reader);
}
Trace.Write("(.XML)");
break;

default:
// File extension not supported; create a default track profile
TrackProfile = new TrProfile(viewer);
Trace.Write("(default)");
break;
}
}
Expand Down
1 change: 0 additions & 1 deletion Source/RunActivity/Viewer3D/Scenery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ public void PrepareFrame(RenderFrame frame, ElapsedTime elapsedTime)

WorldFile LoadWorldFile(int tileX, int tileZ, bool visible)
{
Trace.Write("W");
try
{
return new WorldFile(Viewer, tileX, tileZ, visible);
Expand Down
1 change: 0 additions & 1 deletion Source/RunActivity/Viewer3D/Shapes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1998,7 +1998,6 @@ public SharedShape(Viewer viewer, string filePath)
/// </summary>
void LoadContent()
{
Trace.Write("S");
var filePath = FilePath;
// commented lines allow reading the animation block from an additional file in an Openrails subfolder
// string dir = Path.GetDirectoryName(filePath);
Expand Down
1 change: 0 additions & 1 deletion Source/RunActivity/Viewer3D/Terrain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ public class TerrainTile

public TerrainTile(Viewer viewer, TileManager tileManager, Tile tile)
{
Trace.Write(tile.Size > 2 ? "L" : "T");
TileX = tile.TileX;
TileZ = tile.TileZ;
Size = tile.Size;
Expand Down
1 change: 0 additions & 1 deletion Source/RunActivity/Viewer3D/Trains.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ public void PrepareFrame(RenderFrame frame, ElapsedTime elapsedTime)

TrainCarViewer LoadCar(TrainCar car)
{
Trace.Write("C");
TrainCarViewer carViewer =
car is MSTSDieselLocomotive ? new MSTSDieselLocomotiveViewer(Viewer, car as MSTSDieselLocomotive) :
car is MSTSElectricLocomotive ? new MSTSElectricLocomotiveViewer(Viewer, car as MSTSElectricLocomotive) :
Expand Down
7 changes: 0 additions & 7 deletions Source/RunActivity/Viewer3D/Viewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -327,22 +327,17 @@ public Viewer(Simulator simulator, Orts.Viewer3D.Processes.Game game)

string ORfilepath = System.IO.Path.Combine(Simulator.RoutePath, "OpenRails");
ContentPath = Game.ContentPath;
Trace.Write(" ENV");
ENVFile = new EnvironmentFile(Simulator.RoutePath + @"\ENVFILES\" + Simulator.TRK.Tr_RouteFile.Environment.ENVFileName(Simulator.Season, Simulator.WeatherType));

Trace.Write(" SIGCFG");
if (File.Exists(ORfilepath + @"\sigcfg.dat"))
{
Trace.Write(" SIGCFG_OR");
SIGCFG = new SignalConfigurationFile(ORfilepath + @"\sigcfg.dat", true);
}
else
{
Trace.Write(" SIGCFG");
SIGCFG = new SignalConfigurationFile(Simulator.RoutePath + @"\sigcfg.dat", false);
}

Trace.Write(" TTYPE");
TrackTypes = new TrackTypesFile(Simulator.RoutePath + @"\TTYPE.DAT");

Tiles = new TileManager(Simulator.RoutePath + @"\TILES\", false);
Expand Down Expand Up @@ -370,7 +365,6 @@ public Viewer(Simulator simulator, Orts.Viewer3D.Processes.Game game)
var speedpostDatFile = Simulator.RoutePath + @"\speedpost.dat";
if (File.Exists(speedpostDatFile))
{
Trace.Write(" SPEEDPOST");
SpeedpostDatFile = new SpeedpostDatFile(Simulator.RoutePath + @"\speedpost.dat", Simulator.RoutePath + @"\shapes\");
}
}
Expand Down Expand Up @@ -530,7 +524,6 @@ internal void Initialize()
InfoDisplay = new InfoDisplay(this);

// Load track profiles before considering the world/scenery
Trace.Write(" TRP");
// Creates profile(s) and loads materials into SceneryMaterials
if (TRPFile.CreateTrackProfile(this, Simulator.RoutePath, out TRPs))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ public static void getStatus(UserCommand userCommand, ref SwitchOnPanelStatus sw
// exception not yet logged
ExceptionForCommand.Add(userCommand);

Trace.Write("Error in Switch Panel function \"getStatus\" getting status for " + userCommand + ":");
Trace.WriteLine("Error in Switch Panel function \"getStatus\" getting status for " + userCommand + ":");
Trace.WriteLine(ex);
}
}
Expand Down

0 comments on commit c734592

Please sign in to comment.