コード例 #1
0
ファイル: IFRRatings.cs プロジェクト: KayRJay/MyFlightbookWeb
        public override void ExamineFlight(ExaminerFlightRow cfr)
        {
            if (cfr == null)
            {
                throw new ArgumentNullException("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);
                    }
                }
            }
        }
コード例 #2
0
        public override void ExamineFlight(ExaminerFlightRow cfr)
        {
            if (cfr == null)
            {
                throw new ArgumentNullException("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);
        }
コード例 #3
0
        public override void ExamineFlight(ExaminerFlightRow cfr)
        {
            if (cfr == null)
            {
                throw new ArgumentNullException("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.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);
            }
        }
コード例 #4
0
ファイル: DPE.cs プロジェクト: knugent09/MyFlightbookWeb
        public override void ExamineFlight(ExaminerFlightRow cfr)
        {
            if (cfr == null)
            {
                throw new ArgumentNullException("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.TimeForProperty(CustomPropertyType.KnownProperties.IDPropCFIITime);
            decimal instInstruction       = cfr.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);
                }
            }
        }
コード例 #5
0
        public override void ExamineFlight(ExaminerFlightRow cfr)
        {
            if (cfr == null)
            {
                throw new ArgumentNullException("cfr");
            }

            if (!cfr.fIsRealAircraft)
            {
                return;
            }

            miMinTimeAsPilot.AddEvent(cfr.Total);
            miMinXCTime.AddEvent(cfr.XC);
            miMinXCNightTime.AddEvent(Math.Min(cfr.XC, cfr.Night));
        }
コード例 #6
0
        public override void ExamineFlight(ExaminerFlightRow cfr)
        {
            if (cfr == null)
            {
                throw new ArgumentNullException("cfr");
            }

            if (!cfr.fIsRealAircraft)
            {
                return;
            }

            decimal part135XC = Part135Milestones.Part135CrossCountry(cfr);

            miMinTimeAsPilot.AddEvent(cfr.Total);
            miMinXCTime.AddEvent(part135XC);
            miMinXCNightTime.AddEvent(Math.Min(part135XC, cfr.Night));
        }
コード例 #7
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);
                    }
                }
            }
        }
コード例 #8
0
        public override void ExamineFlight(ExaminerFlightRow cfr)
        {
            if (cfr == null)
            {
                throw new ArgumentNullException("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));
        }