public override void ExamineFlight(ExaminerFlightRow cfr)
        {
            if (cfr == null)
            {
                throw new ArgumentNullException("cfr");
            }

            // Must be real aircraft or FFS
            if (!cfr.fIsCertifiedLanding)
            {
                return;
            }

            int cNightTakeoffs = cfr.TotalCountForPredicate(cfp => cfp.PropTypeID == (int)CustomPropertyType.KnownProperties.IDPropNightTakeoff);
            int cNightLandings = cfr.cFullStopNightLandings + cfr.TotalCountForPredicate(cfp => cfp.PropTypeID == (int)CustomPropertyType.KnownProperties.IDPropNightTouchAndGo);

            if (cNightTakeoffs > 0)
            {
                fcNightTakeoff.AddRecentFlightEvents(cfr.dtFlight, cNightTakeoffs);
            }
            if (cNightLandings > 0)
            {
                fcNightLanding.AddRecentFlightEvents(cfr.dtFlight, cNightLandings);
            }
        }
Esempio n. 2
0
        public override void ExamineFlight(ExaminerFlightRow cfr)
        {
            bool fIsMatch = CatClassMatchesRatingSought(cfr.idCatClassOverride);
            bool fIsSim   = cfr.fIsCertifiedIFR && !cfr.fIsRealAircraft;

            if (!fIsMatch || !cfr.fIsCertifiedIFR)
            {
                return;
            }

            // Night - optional
            if (cfr.Night > 0)
            {
                miNightTime.AddEvent(cfr.Night);
                decimal nightDual = Math.Min(cfr.Night, cfr.Dual);
                miNightDual.AddEvent(nightDual);
                miNightXC.AddEvent(Math.Min(nightDual, cfr.XC));

                decimal soloTime      = cfr.TotalTimeForPredicate(cfp => cfp.PropertyType.IsSolo);
                decimal nightTakeoffs = cfr.TotalCountForPredicate(cfp => cfp.PropertyType.IsNightTakeOff);

                if (soloTime > 0)
                {
                    miNightSoloTakeoffs.AddEvent(nightTakeoffs);
                    miNightSoloLandings.AddEvent(cfr.cFullStopNightLandings);
                }

                if (nightDual > 0)
                {
                    AirportList al = AirportListOfRoutes.CloneSubset(cfr.Route, true);

                    if (al == null)
                    {
                        al = AirportListOfRoutes.CloneSubset(cfr.Route, true);
                    }
                    if (al.DistanceForRoute() > (double)JAALongNightXCDistanceAirplane)
                    {
                        miNightLongXC.MatchFlightEvent(cfr);
                    }
                }
            }
        }