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

            if (!cfr.fIsRealAircraft && cfr.fIsCertifiedIFR)
            {
                miInstrument.AddTrainingEvent(cfr.IMCSim, MaxSimulator, !cfr.fIsRealAircraft);
            }

            if (!cfr.fIsRealAircraft)
            {
                return;
            }

            miTotal.AddEvent(cfr.Total);

            decimal CoPilot = cfr.SIC + cfr.TimeForProperty(CustomPropertyType.KnownProperties.IDPropMilitaryCoPilottime) + cfr.TimeForProperty(CustomPropertyType.KnownProperties.IDPropCoPilotTime);

            miNight.AddEvent(Math.Min(CoPilot + cfr.PIC, cfr.Night));

            // Can add PIC or PICUS, but only up to MinPICUSInCategory for the latter.
            // So if a flight has, say, an hour of PIC and an hour of PICUS, it's possible that they're double-logged.  Looking at the database, that seems common.
            // E.g., a 1.5 hour flight has 1.5 hours of PIC and 1.5 hours of PICUS.
            // To be conservative, we'll subtract off any PICUS from PIC; the remainder is PIC time we can use unlimited.
            // Thus we can compute total PIC time for a flight as PIC+PICUS - which will possibly undercount but never overcount.
            decimal PICUS  = cfr.TimeForProperty(CustomPropertyType.KnownProperties.IDPropPICUS);
            decimal netPIC = Math.Max(cfr.PIC - PICUS, 0.0M);

            miXCPICAdditional.AddEvent(Math.Min(cfr.PIC, cfr.XC));
            miXCSICPICAdditional.AddEvent(Math.Min(cfr.Total, Math.Min(cfr.PIC + cfr.SIC + CoPilot, cfr.XC)));

            if (cfr.szCategory.CompareCurrentCultureIgnoreCase(Category) == 0)
            {
                miCategory.AddEvent(cfr.Total);
                miXC.AddEvent(cfr.XC);

                miPIC.AddEvent(netPIC);
                miPICXC.AddEvent(Math.Min(netPIC, cfr.XC));
                miPICXCNight.AddEvent(Math.Min(netPIC, Math.Min(cfr.XC, cfr.Night)));

                miPIC.AddTrainingEvent(PICUS, MaxPICUSInCategory, true);
                miPICXC.AddTrainingEvent(Math.Min(PICUS, cfr.XC), MaxPICUSInCategory, true);
                miPICXCNight.AddTrainingEvent(Math.Min(PICUS, Math.Min(cfr.XC, cfr.Night)), MaxPICUSInCategory, true);

                miNightInCategory.AddEvent(Math.Min(CoPilot + cfr.PIC, cfr.Night));

                miInstrument.AddEvent(cfr.IMC + cfr.IMCSim);
            }
            else if (cfr.szCategory.CompareCurrentCultureIgnoreCase(AltCategory) == 0)
            {
                miInstrumentAltCategory.AddTrainingEvent(cfr.IMC + cfr.IMCSim, MaxInstrumentAlternativeCategory, true);
            }
        }
示例#2
0
        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);
                }
            }
        }