Exemplo n.º 1
0
        public ShifterTableConfiguration(ShifterTableConfigurationDefault def, IDrivetrain drivetrain, int spdPerGear, float staticMass)
        {
            Mode = def;
            SpdPerGear = spdPerGear;
            Mass = staticMass;

            Air = new Ets2Aero();
            Drivetrain = drivetrain;
            MaximumSpeed = 600;

            switch (def)
            {
                case ShifterTableConfigurationDefault.PeakRpm:
                    DefaultByPeakRpm();
                    break;
                case ShifterTableConfigurationDefault.Performance:
                    DefaultByPowerPerformance();
                    break;
                case ShifterTableConfigurationDefault.Economy:
                    DefaultByPowerEconomy();
                    break;
                case ShifterTableConfigurationDefault.Efficiency:
                    DefaultByPowerEfficiency();
                    break;
                case ShifterTableConfigurationDefault.AlsEenOpa:
                    DefaultByOpa();
                    break;
                case ShifterTableConfigurationDefault.Henk:
                    DefaultByHenk();
                    break;

                case ShifterTableConfigurationDefault.PowerEfficiency:
                    DefaultByPowerEfficiency2();
                    break;
            }

            if (spdPerGear > 0)
            {
                var spdPerGearReduced = spdPerGear - staticMass/1000/1.25;
                if (spdPerGearReduced < 1) spdPerGearReduced = 1;
                Console.WriteLine("Spd per gear:"+spdPerGearReduced);
                MinimumSpeedPerGear((int)Math.Round(spdPerGearReduced));
            }

            string l = "";
            for(var r = 0; r < 2500; r+=10)
            {
                var fuel=Drivetrain.CalculateFuelConsumption(r, 1);
                var ratio = drivetrain.CalculatePower(r, 1)/fuel;

                l +=  r + "," + Drivetrain.CalculatePower(r, 1) + "," + Drivetrain.CalculatePower(r, 0) + ","+fuel+","+ratio+"\r\n";
            }
            //File.WriteAllText("./ets2engine.csv", l);
        }
        public ShifterTableConfiguration(ShifterTableConfigurationDefault def, IDrivetrain drivetrain, int spdPerGear, float staticMass)
        {
            Mode       = def;
            SpdPerGear = spdPerGear;
            Mass       = staticMass;

            Air          = new Ets2Aero();
            Drivetrain   = drivetrain;
            MaximumSpeed = 600;

            switch (def)
            {
            case ShifterTableConfigurationDefault.PeakRpm:
                DefaultByPeakRpm();
                break;

            case ShifterTableConfigurationDefault.Performance:
                DefaultByPowerPerformance();
                break;

            case ShifterTableConfigurationDefault.Economy:
                DefaultByPowerEconomy();
                break;

            case ShifterTableConfigurationDefault.Efficiency:
                DefaultByPowerEfficiency();
                break;

            case ShifterTableConfigurationDefault.AlsEenOpa:
                DefaultByOpa();
                break;

            case ShifterTableConfigurationDefault.Henk:
                DefaultByHenk();
                break;

            case ShifterTableConfigurationDefault.PowerEfficiency:
                DefaultByPowerEfficiency2();
                break;
            }

            if (spdPerGear > 0)
            {
                var spdPerGearReduced = spdPerGear - staticMass / 1000 / 1.25;
                if (spdPerGearReduced < 1)
                {
                    spdPerGearReduced = 1;
                }
                Console.WriteLine("Spd per gear:" + spdPerGearReduced);
                MinimumSpeedPerGear((int)Math.Round(spdPerGearReduced));
            }

            string l = "";

            for (var r = 0; r < 2500; r += 10)
            {
                var fuel  = Drivetrain.CalculateFuelConsumption(r, 1);
                var ratio = drivetrain.CalculatePower(r, 1) / fuel;

                l += r + "," + Drivetrain.CalculatePower(r, 1) + "," + Drivetrain.CalculatePower(r, 0) + "," + fuel + "," + ratio + "\r\n";
            }
            //File.WriteAllText("./ets2engine.csv", l);
        }