Beispiel #1
0
        protected void StaticInfoUpdated(object sender, StaticInfoEventArgs e)
        {
            if (e.StaticInfo.MaxRpm == 0)
            {
                //auto calibrate the max rpm. Sometimes the car doesn't return this info.
                if (lastRpm < currentRpm && currentRpm > 5000)
                {
                    lastRpm = currentRpm;
                }
            }
            else
            {
                lastRpm = e.StaticInfo.MaxRpm;
            }
            firstRpm = FIRST_RPM * lastRpm;
            //calibrate shift gear light rpm
            lastRpm *= MainForm.maxRPM;
            si       = e.StaticInfo;

            flag = (int)gr.Flag;

            if (ph.PitLimiterOn > 0)
            {
                flag = (int)Constants.FLAG_TYPE.IN_PIT_FLAG;
            }
        }
Beispiel #2
0
        public void ac_StaticInfoUpdated(object sender, StaticInfoEventArgs e)
        {
            MaxRPM = e.StaticInfo.MaxRpm;

            Dispatcher.Invoke(() => {
                this.RPMmeter.Maximum = MaxRPM;
            });
        }
Beispiel #3
0
        private void AC_StaticInfoUpdated(object sender, StaticInfoEventArgs e)
        {
            this._staticInfo = e.StaticInfo;
            // Print out some data from StaticInfo

            //  Console.WriteLine("StaticInfo\r\n");
            //  Console.WriteLine("  Car Model: " + e.StaticInfo.CarModel + "\r\n");
            //  Console.WriteLine("  Track:     " + e.StaticInfo.Track + "\r\n");
            //  Console.WriteLine("  Max RPM:   " + e.StaticInfo.MaxRpm + "\r\n");
        }
Beispiel #4
0
        static void ac_StaticInfoUpdated(object sender, StaticInfoEventArgs e)
        {
            //maxRpm = (int) Math.Round(Convert.ToDouble(e.StaticInfo.MaxRpm*0.02));
            //ca.MaxRPMC = maxRpm;
            //ca.MaxRPM = e.StaticInfo.MaxRpm;
            //c

            ca.MaxRPM  = e.StaticInfo.MaxRpm;
            ca.MaxRPMC = ca.MaxRPM / 8;
        }
Beispiel #5
0
        private void OnACInfo(object sender, StaticInfoEventArgs e)
        {
            if (e.StaticInfo.Track != track || e.StaticInfo.TrackConfiguration != layout)
            {
                track  = e.StaticInfo.Track;
                layout = e.StaticInfo.TrackConfiguration;
                Console.WriteLine("Track = {0}, Config = {1}", track, layout);
                assistLineFollower.Load(e.StaticInfo.Track, e.StaticInfo.TrackConfiguration);
            }

            trackLength = e.StaticInfo.TrackSPlineLength;
            assistLineFollower.TrackLength = trackLength;
        }
        private void AcOnStaticInfoUpdated(object sender, StaticInfoEventArgs e)
        {
            var dataModel = (AssettoCorsaDataModel)DataModel;

            dataModel.StaticInfo.SMVersion = e.StaticInfo.SMVersion;
            dataModel.StaticInfo.ACVersion = e.StaticInfo.ACVersion;
            dataModel.StaticInfo.Session.NumberOfSessions   = e.StaticInfo.NumberOfSessions;
            dataModel.StaticInfo.Session.NumCars            = e.StaticInfo.NumCars;
            dataModel.StaticInfo.Session.Track              = e.StaticInfo.Track;
            dataModel.StaticInfo.Session.TrackConfiguration = e.StaticInfo.TrackConfiguration;
            dataModel.StaticInfo.Session.TrackSPlineLength  = e.StaticInfo.TrackSPlineLength;
            dataModel.StaticInfo.Session.PlayerName         = e.StaticInfo.PlayerName;
            dataModel.StaticInfo.Session.PlayerSurname      = e.StaticInfo.PlayerSurname;
            dataModel.StaticInfo.Session.PlayerNick         = e.StaticInfo.PlayerNick;
            dataModel.StaticInfo.Session.SectorCount        = e.StaticInfo.SectorCount;
            dataModel.StaticInfo.Session.PenaltiesEnabled   = e.StaticInfo.PenaltiesEnabled;
            dataModel.StaticInfo.Car.CarModel                 = e.StaticInfo.CarModel;
            dataModel.StaticInfo.Car.MaxTorque                = e.StaticInfo.MaxTorque;
            dataModel.StaticInfo.Car.MaxPower                 = e.StaticInfo.MaxPower;
            dataModel.StaticInfo.Car.MaxRpm                   = e.StaticInfo.MaxRpm;
            dataModel.StaticInfo.Car.MaxFuel                  = e.StaticInfo.MaxFuel;
            dataModel.StaticInfo.Car.SuspensionMaxTravel      = e.StaticInfo.SuspensionMaxTravel;
            dataModel.StaticInfo.Car.TyreRadius               = e.StaticInfo.TyreRadius;
            dataModel.StaticInfo.Car.MaxTurboBoost            = e.StaticInfo.MaxTurboBoost;
            dataModel.StaticInfo.Car.AidFuelRate              = e.StaticInfo.AidFuelRate;
            dataModel.StaticInfo.Car.AidTireRate              = e.StaticInfo.AidTireRate;
            dataModel.StaticInfo.Car.AidMechanicalDamage      = e.StaticInfo.AidMechanicalDamage;
            dataModel.StaticInfo.Car.AidAllowTyreBlankets     = e.StaticInfo.AidAllowTyreBlankets;
            dataModel.StaticInfo.Car.AidStability             = e.StaticInfo.AidStability;
            dataModel.StaticInfo.Car.AidAutoClutch            = e.StaticInfo.AidAutoClutch;
            dataModel.StaticInfo.Car.AidAutoBlip              = e.StaticInfo.AidAutoBlip;
            dataModel.StaticInfo.Car.HasDRS                   = e.StaticInfo.HasDRS;
            dataModel.StaticInfo.Car.HasERS                   = e.StaticInfo.HasERS;
            dataModel.StaticInfo.Car.HasKERS                  = e.StaticInfo.HasKERS;
            dataModel.StaticInfo.Car.KersMaxJoules            = e.StaticInfo.KersMaxJoules;
            dataModel.StaticInfo.Car.EngineBrakeSettingsCount = e.StaticInfo.EngineBrakeSettingsCount;
            dataModel.StaticInfo.Car.ErsPowerControllerCount  = e.StaticInfo.ErsPowerControllerCount;
        }
Beispiel #7
0
 private void PAc_StaticInfoUpdated(object sender, StaticInfoEventArgs e)
 {
     pCarStatus.FillStatic(e.StaticInfo);
 }
Beispiel #8
0
 public void StaticInfoUpdated(object sender, StaticInfoEventArgs e)
 {
     neoPixelRpm.rpm_max = e.StaticInfo.MaxRpm;
     neoPixelRpm.rpm_min = 74f * e.StaticInfo.MaxRpm / 100f;
 }
Beispiel #9
0
 static void StaticInfoUpdated(object sender, StaticInfoEventArgs e)
 {
     WriteToSerial("Max RPM: {0}", e.StaticInfo.MaxRpm);
 }
Beispiel #10
0
        // Arduino -> [0]: 'R', [1:2] rpm, [3:4] rpmmax, [5]: 'S', [6:7] speed, [8]: 'G', [9] gear - 10: reverse, 0: neutral
        // ACC -> gear - 0: reverse, 1: neutral

        static void ac_StaticInfoUpdated(object sender, StaticInfoEventArgs e)
        {
            _staticMaxRpm = (short)e.StaticInfo.MaxRpm;
        }