コード例 #1
0
ファイル: InfoDisplay.cs プロジェクト: yinwuu/openrails
        static void DataLoggerStart(UserSettings settings)
        {
            using (StreamWriter file = File.AppendText(Path.Combine(settings.LoggingPath, "OpenRailsDump.csv")))
            {
                DataLogger.Separators separator = (DataLogger.Separators)Enum.Parse(typeof(DataLogger.Separators), settings.DataLoggerSeparator);
                string headerLine = "";
                if (settings.DataLogPerformance)
                {
                    headerLine = String.Join(Convert.ToString((char)separator),
                                             new string[]
                    {
                        "SVN",
                        "Frame",
                        "Memory",
                        "Memory (Managed)",
                        "Gen 0 GC",
                        "Gen 1 GC",
                        "Gen 2 GC",
                        "Processors",
                        "Frame Rate",
                        "Frame Time",
                        "Shadow Primitives",
                        "Render Primitives",
                        "Render Process",
                        "Updater Process",
                        "Loader Process",
                        "Sound Process"
                    }
                                             );
                }
                if (settings.DataLogPhysics)
                {
                    if (settings.DataLogPerformance)
                    {
                        headerLine += Convert.ToString((char)separator);
                    }

                    headerLine += String.Join(Convert.ToString((char)separator),
                                              new string[]
                    {
                        "Time",
                        "Player Direction",
                        "Player Reverser [%]",
                        "Player Throttle [%]",
                        "Player Motive Force [N]",
                        "Player Brake Force [N]",
                        "Player Axle Force [N]",
                        "Player Wheelslip",
                        "Player Speed [" + settings.DataLogSpeedUnits + "]",
                        "Distance [m]",
                        "Player Gravity Force [N]",
                        "Train Brake",
                        "Engine Brake",
                        "Player Cylinder PSI",
                        "Player Main Res PSI",
                        "Player Compressor On",
                        "D:Real RPM / E:panto 1 / S:Blower usage LBpS",
                        "D:Demanded RPM / E:panto 2 / S:Boiler PSI",
                        "D:Load % / E:panto 3 / S:Cylinder Cocks open",
                        "D:Gearbox Current Gear / E:panto 4 / S:Evaporation LBpS",
                        "D:Gearbox Next Gear / E:null / S:Fire Mass KG",
                        "D:Clutch % / E:null / S:Steam usage LBpS",
                        "D:Fuel Flow Lps / E:null / S:Blower",
                        "D:Fuel level L / E:null / S:Damper",
                        "D:null / E:null / S:Firing Rate",
                        "D:null / E:null / S:Injector 1",
                        "D:null / E:null / S:Injector 2"
                    }
                                              );
                }
                //Ready to use...
                //if (settings.DataLogMisc)
                //{
                //    if (settings.DataLogPerformance || settings.DataLogPhysics)
                //        headerLine += Convert.ToString((char)separator);
                //    headerLine += String.Join(Convert.ToString((char)separator),
                //        new string[] {"null",
                //        "null"});
                //}

                if (settings.DataLogSteamPerformance)
                {
                    headerLine = String.Join(Convert.ToString((char)separator),
                                             new string[]
                    {
                        "Speed (mph)",
                        "Time (M)",
                        "Throttle (%)",
                        "Cut-off (%)",
                        "ITE (MotiveForce - lbf)",
                        "IHP (hp)",
                        "Drawbar TE (lbf)",
                        "Drawbar HP (hp)",
                        "Coupler Force (lbf)",
                        "Loco & Tender Resistance (lbf)",
                        "Train Resistance (lbf)",
                        "Train Load (t-uk)",
                        "Boiler Pressure (psi)",
                        "Steam Chest Pressure (psi)",
                        "Initial Pressure (psi)",
                        "Cutoff Pressure (psi)",
                        "Release Pressure (psi)",
                        "Back Pressure (psi)",
                        "MEP (psi)",
                        "Superheat Temp (F)",
                        "Steam consumption (lbs/h)",
                        "Water consumption (lbs/h)",
                        "Coal consumption (lbs/h)",
                        "Cylinder Thermal Efficiency",
                        "Cumulative Steam (lbs)",
                        "Cumulative Water (lbs)",
                        "Cutoff pressure Ratio",

                        "HP MEP (psi)",
                        "LPInitial Pressure (psi)",
                        "LPCutoff Pressure (psi)",
                        "LPRelease Pressure (psi)",
                        "LPBack Pressure (psi)",
                        "LPCutoff pressure Ratio",
                        "LP MEP (psi)"
                    }
                                             );
                }

#if DEBUG_DUMP_STEAM_POWER_CURVE
                if (!settings.DataLogPerformance &&
                    !settings.DataLogPhysics &&
                    !settings.DataLogMisc &&
                    !settings.DataLogSteamPerformance)
                {
                    headerLine = String.Join(Convert.ToString((char)separator),
                                             new string[]
                    {
                        "speed (mph)",
                        "power (hp)",
                        "throttle (%)",
                        "cut-off (%)"
                    });
                }
#endif
                file.WriteLine(headerLine);
            }
        }
コード例 #2
0
ファイル: InfoDisplay.cs プロジェクト: robwor/openrails
        static void DataLoggerStart(UserSettings settings)
        {
            using (StreamWriter file = File.AppendText(Path.Combine(settings.LoggingPath, "OpenRailsDump.csv")))
            {
                DataLogger.Separators separator = (DataLogger.Separators)Enum.Parse(typeof(DataLogger.Separators), settings.DataLoggerSeparator);
                string headerLine = "";
                if (settings.DataLogPerformance)
                {
                    headerLine = String.Join(Convert.ToString((char)separator),
                                             new string[]
                    {
                        "SVN",
                        "Frame",
                        "Memory",
                        "Memory (Managed)",
                        "Gen 0 GC",
                        "Gen 1 GC",
                        "Gen 2 GC",
                        "Processors",
                        "Frame Rate",
                        "Frame Time",
                        "Shadow Primitives",
                        "Render Primitives",
                        "Render Process",
                        "Updater Process",
                        "Loader Process",
                        "Sound Process"
                    }
                                             );
                }
                if (settings.DataLogPhysics)
                {
                    if (settings.DataLogPerformance)
                    {
                        headerLine += Convert.ToString((char)separator);
                    }

                    headerLine += String.Join(Convert.ToString((char)separator),
                                              new string[]
                    {
                        "Time",
                        "Player Direction",
                        "Player Reverser [%]",
                        "Player Throttle [%]",
                        "Player Motive Force [N]",
                        "Player Brake Force [N]",
                        "Player Axle Force [N]",
                        "Player Wheelslip",
                        "Player Speed [" + settings.DataLogSpeedUnits + "]",
                        "Distance [m]",
                        "Player Gravity Force [N]",
                        "Train Brake",
                        "Engine Brake",
                        "Player Cylinder PSI",
                        "Player Main Res PSI",
                        "Player Compressor On",
                        "D:Real RPM / E:panto 1 / S:Blower usage LBpS",
                        "D:Demanded RPM / E:panto 2 / S:Boiler PSI",
                        "D:Load % / E:null / S:Cylinder Cocks open",
                        "D:Gearbox Current Gear / E:null / S:Evaporation LBpS",
                        "D:Gearbox Next Gear / E:null / S:Fire Mass KG",
                        "D:Clutch % / E:null / S:Steam usage LBpS",
                        "D:Fuel Flow Lps / E:null / S:Blower",
                        "D:Fuel level L / E:null / S:Damper",
                        "D:null / E:null / S:Firing Rate",
                        "D:null / E:null / S:Injector 1",
                        "D:null / E:null / S:Injector 2"
                    }
                                              );
                }
                //Ready to use...
                //if (settings.DataLogMisc)
                //{
                //    if (settings.DataLogPerformance || settings.DataLogPhysics)
                //        headerLine += Convert.ToString((char)separator);
                //    headerLine += String.Join(Convert.ToString((char)separator),
                //        new string[] {"null",
                //        "null"});
                //}

#if DEBUG_DUMP_STEAM_POWER_CURVE
                if (!settings.DataLogPerformance &&
                    !settings.DataLogPhysics &&
                    !settings.DataLogMisc)
                {
                    headerLine = String.Join(Convert.ToString((char)separator),
                                             new string[]
                    {
                        "speed (mph)",
                        "power (hp)",
                        "throttle (%)",
                        "cut-off (%)"
                    });
                }
#endif
                file.WriteLine(headerLine);
            }
        }