private void CopyDefaultTimings()
 {
     if (App != null)
     {
         TimingParameters currentTiming = App.KWP2000CommInterface.DefaultTimingParameters;
         DefaultP1ECUInterByteTimeMaxMS    = currentTiming.P1ECUInterByteTimeMaxMs;
         DefaultP2ECUResponseTimeMinMS     = currentTiming.P2ECUResponseTimeMinMs;
         DefaultP2ECUResponseTimeMaxMS     = currentTiming.P2ECUResponseTimeMaxMs;
         DefaultP3TesterResponseTimeMinMS  = currentTiming.P3TesterResponseTimeMinMs;
         DefaultP3TesterResponseTimeMaxMS  = currentTiming.P3TesterResponseTimeMaxMs;
         DefaultP4TesterInterByteTimeMinMS = currentTiming.P4TesterInterByteTimeMinMs;
     }
 }
示例#2
0
        private CalculationParameters ParseParameters(TimingParameters timingParameters)
        {
            CalculationMethod method;

            switch (timingParameters.Method)
            {
            case "MuslimWorldLeague":
            {
                method = CalculationMethod.MUSLIM_WORLD_LEAGUE;
                break;
            }

            case "Egyptian":
            {
                method = CalculationMethod.EGYPTIAN;
                break;
            }

            case "Karachi":
            {
                method = CalculationMethod.KARACHI;
                break;
            }

            case "UmmAlQura":
            {
                method = CalculationMethod.UMM_AL_QURA;
                break;
            }

            case "Dubai":
            {
                method = CalculationMethod.DUBAI;
                break;
            }

            case "MoonsightingCommittee":
            {
                method = CalculationMethod.MOON_SIGHTING_COMMITTEE;
                break;
            }

            case "NorthAmerica":
            {
                method = CalculationMethod.NORTH_AMERICA;
                break;
            }

            case "Kuwait":
            {
                method = CalculationMethod.KUWAIT;
                break;
            }

            case "Qatar":
            {
                method = CalculationMethod.QATAR;
                break;
            }

            case "Singapore":
            {
                method = CalculationMethod.SINGAPORE;
                break;
            }

            default:
            {
                method = CalculationMethod.OTHER;
                break;
            }
            }

            CalculationParameters parameters = method.GetParameters();

            if ("Shafi".Equals(timingParameters.Madhab))
            {
                parameters.Madhab = Madhab.SHAFI;
            }
            else if ("Hanafi".Equals(timingParameters.Madhab))
            {
                parameters.Madhab = Madhab.HANAFI;
            }

            if ("SeventhOfTheNight".Equals(timingParameters.HighLatitudeRule))
            {
                parameters.HighLatitudeRule = HighLatitudeRule.SEVENTH_OF_THE_NIGHT;
            }
            else if ("TwilightAngle".Equals(timingParameters.HighLatitudeRule))
            {
                parameters.HighLatitudeRule = HighLatitudeRule.TWILIGHT_ANGLE;
            }
            else
            {
                parameters.HighLatitudeRule = HighLatitudeRule.MIDDLE_OF_THE_NIGHT;
            }

            return(parameters);
        }