Exemple #1
0
        public override void ExamineFlight(ExaminerFlightRow cfr)
        {
            if (cfr == null)
            {
                throw new ArgumentNullException(nameof(cfr));
            }

            decimal IMCTime = cfr.IMC + cfr.IMCSim;

            if (cfr.fIsCertifiedIFR)
            {
                miMinIFRTime.AddEvent(IMCTime);
            }

            if (!cfr.fIsRealAircraft)
            {
                return;
            }

            decimal part135XC = Part135Milestones.Part135CrossCountry(cfr);

            miMinTimeAsPilot.AddEvent(cfr.Total);
            miMinXCTime.AddEvent(part135XC);
            miMinNightTime.AddEvent(cfr.Night);
            miMinIFRAircraftTime.AddEvent(IMCTime);
        }
        public override void ExamineFlight(ExaminerFlightRow cfr)
        {
            if (cfr == null)
            {
                throw new ArgumentNullException(nameof(cfr));
            }
            base.ExamineFlight(cfr);    // really only picks up the cross-country flight

            if (cfr.fIsCertifiedIFR && CatClassMatchesRatingSought(cfr.idCatClassOverride))
            {
                decimal IMCTime = cfr.IMC + cfr.IMCSim;
                if (cfr.fIsRealAircraft)
                {
                    miIMCAircraftTime.AddEvent(IMCTime);
                }
                else if (cfr.fIsCertifiedIFR)
                {
                    if (cfr.fIsCertifiedLanding)
                    {
                        miIMCFSTime.AddEvent(IMCTime);
                    }
                    else if (cfr.fIsFTD)
                    {
                        miIMCFTDTime.AddEvent(IMCTime);
                    }
                    else
                    {
                        miIMCATDTime.AddEvent(IMCTime);
                    }
                }
            }
        }
        public override void ExamineFlight(ExaminerFlightRow cfr)
        {
            if (cfr == null)
            {
                throw new ArgumentNullException(nameof(cfr));
            }

            // No training devices for sport pilots
            if (!cfr.fIsRealAircraft)
            {
                return;
            }

            // Minimum time can be in anything
            miMinTime.AddEvent(cfr.Total);

            // Everything else must be in matching category/class
            // allow perfect match or ASEL->ASES match
            if (CatClassID != cfr.idCatClassOverride && !(CatClassID == CategoryClass.CatClassID.ASEL && cfr.idCatClassOverride == CategoryClass.CatClassID.ASES))
            {
                return;
            }

            miMinInstruction.AddEvent(cfr.Dual);
            decimal soloTime = 0.0M;

            cfr.FlightProps.ForEachEvent(pf => { if (pf.PropertyType.IsSolo)
                                                 {
                                                     soloTime += pf.DecValue;
                                                 }
                                         });
            miMinSolo.AddEvent(soloTime);

            int cFSLandings = cfr.cFullStopLandings + cfr.cFullStopNightLandings;

            miMinCrossCountry.AddEvent(Math.Min(cfr.XC, cfr.Dual));
            miMinLandings.AddEvent(cFSLandings);
            if (soloTime > 0 && cFSLandings > 1)
            {
                AirportList al = AirportListOfRoutes.CloneSubset(cfr.Route, true);

                if (al.DistanceForRoute() > MinXCDistance && al.MaxSegmentForRoute() > 25)
                {
                    miSoloXCFlight.AddEvent(1);
                    miSoloXCFlight.MatchingEventID   = cfr.flightID;
                    miSoloXCFlight.MatchingEventText = String.Format(CultureInfo.CurrentCulture, Resources.MilestoneProgress.MatchingXCFlightTemplate, cfr.dtFlight.ToShortDateString(), cfr.Route);
                }
            }

            if (DateTime.Now.AddCalendarMonths(-2).CompareTo(cfr.dtFlight) <= 0)
            {
                miTestPrep.AddEvent(cfr.Dual);
            }
        }
Exemple #4
0
        public override void ExamineFlight(ExaminerFlightRow cfr)
        {
            if (cfr == null)
            {
                throw new ArgumentNullException(nameof(cfr));
            }

            if (!cfr.fIsRealAircraft)
            {
                return;
            }

            miPIC.AddEvent(cfr.PIC);
            miPICNight.AddEvent(Math.Min(cfr.PIC, cfr.Night));

            miPICInstrumentTime.AddEvent(Math.Min(cfr.PIC, cfr.IMCSim + cfr.IMC));

            if (cfr.fIsComplex)
            {
                miPICComplexTime.AddEvent(cfr.PIC);
            }

            decimal cfiiTime              = cfr.FlightProps.TimeForProperty(CustomPropertyType.KnownProperties.IDPropCFIITime);
            decimal instInstruction       = cfr.FlightProps.TimeForProperty(CustomPropertyType.KnownProperties.IDPropInstrumentInstructionTime);
            decimal instrumentInstruction = Math.Max(cfiiTime, instInstruction);

            miCFIITime.AddEvent(instrumentInstruction);

            if (cfr.szCategory.CompareOrdinalIgnoreCase(catClass.Category) == 0)
            {
                if (cfr.dtFlight.CompareTo(DateTime.Now.AddYears(-1)) >= 0)
                {
                    miPICPastYear.AddEvent(cfr.PIC);
                    miPICFlightsInPriorYear.AddEvent(1);
                }

                miPICCategory.AddEvent(cfr.PIC);
                miCFICategory.AddEvent(cfr.CFI);

                miCFIITimeInCategory.AddEvent(instrumentInstruction);

                if (cfr.idCatClassOverride == catClass.IdCatClass)
                {
                    miPICClass.AddEvent(cfr.PIC);
                    miCFIClass.AddEvent(cfr.CFI);
                }
            }
        }
Exemple #5
0
        public override void ExamineFlight(ExaminerFlightRow cfr)
        {
            if (cfr == null)
            {
                throw new ArgumentNullException(nameof(cfr));
            }
            bool fIsMatch = CatClassMatchesRatingSought(cfr.idCatClassOverride);

            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.FlightProps.TotalTimeForPredicate(cfp => cfp.PropertyType.IsSolo);
                decimal nightTakeoffs = cfr.FlightProps.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);
                    }
                }
            }
        }
Exemple #6
0
        public override void ExamineFlight(ExaminerFlightRow cfr)
        {
            if (cfr == null)
            {
                throw new ArgumentNullException(nameof(cfr));
            }

            if (!cfr.fIsRealAircraft)
            {
                return;
            }

            decimal part135XC = Part135Milestones.Part135CrossCountry(cfr);

            miMinTimeAsPilot.AddEvent(cfr.Total);
            miMinXCTime.AddEvent(part135XC);
            miMinXCNightTime.AddEvent(Math.Min(part135XC, cfr.Night));
        }
        public override void ExamineFlight(ExaminerFlightRow cfr)
        {
            base.ExamineFlight(cfr);

            if (cfr == null)
            {
                throw new ArgumentNullException(nameof(cfr));
            }

            if (!cfr.fIsRealAircraft)
            {
                return;
            }

            switch (cfr.idCatClassOverride)
            {
            case CategoryClass.CatClassID.Helicopter:
            case CategoryClass.CatClassID.ASEL:
            case CategoryClass.CatClassID.ASES:
            case CategoryClass.CatClassID.AMEL:
            case CategoryClass.CatClassID.AMES:
                miXCPIC.AddEvent(Math.Min(cfr.PIC, cfr.XC));
                break;

            default:
                break;
            }

            if (cfr.IMC + cfr.IMCSim > 0 && cfr.Dual > 0 && CatClassMatchesRatingSought(cfr.idCatClassOverride))
            {
                miIFRTrainingInCategory.AddEvent(Math.Min(cfr.Dual, cfr.IMC + cfr.IMCSim));
            }

            if (cfr.cApproaches >= 2 && cfr.Dual > 0 && cfr.IMC + cfr.IMCSim > 0)
            {
                AirportList al = AirportListOfRoutes.CloneSubset(cfr.Route);
                if (al.DistanceForRoute() >= MinXCDistance)
                {
                    miXCDualXC.AddEvent(1.0M);
                    miXCDualXC.MatchingEventText = String.Format(CultureInfo.CurrentCulture, Resources.MilestoneProgress.MatchingXCFlightTemplate, cfr.dtFlight.ToShortDateString(), cfr.Route);
                    miXCDualXC.MatchingEventID   = cfr.flightID;
                }
            }
        }
Exemple #8
0
        public override void ExamineFlight(ExaminerFlightRow cfr)
        {
            if (cfr == null)
            {
                throw new ArgumentNullException(nameof(cfr));
            }
            bool fIsHelicopter = (cfr.idCatClassOverride == CategoryClass.CatClassID.Helicopter);
            bool fIsRotorcraft = (fIsHelicopter || cfr.idCatClassOverride == CategoryClass.CatClassID.Gyroplane);
            bool fIsIFRSim     = (fIsRotorcraft && cfr.fIsFTD);
            bool fIsTotalSim   = (fIsRotorcraft && cfr.fIsFTD && cfr.fIsCertifiedLanding);

            if (fIsRotorcraft || cfr.fIsRealAircraft)
            {
                miTotal.AddTrainingEvent(cfr.Total, ATPMaxSimulator, fIsTotalSim);
                miMinInstrumentTime.AddTrainingEvent(cfr.IMC + cfr.IMCSim, ATPMaxSimulator, fIsIFRSim);
            }

            // Everything else MUST be done in a real aircraft
            if (!cfr.fIsRealAircraft)
            {
                return;
            }

            miMinXCTime.AddEvent(cfr.XC);
            miMinNightTime.AddEvent(cfr.Night);


            // And the remainder must not only be in a real aircraft, it must be in a helicopter
            if (cfr.idCatClassOverride != CategoryClass.CatClassID.Helicopter)
            {
                return;
            }

            miMinNightHelicopter.AddEvent(cfr.Night);
            miMinHeli.AddEvent(cfr.Total);
            miMinHeliPIC.AddEvent(cfr.PIC);
            miMinHeliIMC.AddEvent(cfr.IMC + cfr.IMCSim);
            miMinHeliPICIMC.AddEvent(Math.Min(cfr.PIC, cfr.IMC + cfr.IMCSim));
        }
Exemple #9
0
        public override void ExamineFlight(ExaminerFlightRow cfr)
        {
            if (cfr == null)
            {
                throw new ArgumentNullException(nameof(cfr));
            }

            if (!cfr.fIsRealAircraft)
            {
                return;
            }

            miTotal.AddEvent(cfr.Total);
            if (CategoryClass.IsPowered(cfr.idCatClassOverride))
            {
                miPICPowered.AddEvent(cfr.PIC);
            }
            if (cfr.idCatClassOverride == CategoryClass.CatClassID.ASEL)
            {
                miTotalSEL.AddEvent(cfr.Total);
                miXCSEL.AddEvent(cfr.XC);
            }
            miXC.AddEvent(cfr.XC);
        }