public static void getMethod(int n, Method conf) { int i; conf.fajrInv = 0; conf.ishaaInv = 0; conf.imsaakInv = 0; conf.mathhab = 1; conf.round = 2; conf.nearestLat = DEF_NEAREST_LATITUDE; conf.imsaakAng = DEF_IMSAAK_ANGLE; conf.extreme = GOOD_INVALID; conf.offset = 0; for (i = 0; i < 6; i++) { conf.offList[i] = 0; } switch (n) { case NONE: conf.fajrAng = 0.0; conf.ishaaAng = 0.0; break; case EGYPT_SURVEY: conf.fajrAng = 19.5; conf.ishaaAng = 17.5; break; case KARACHI_SHAF: conf.fajrAng = 18; conf.ishaaAng = 18; break; case KARACHI_HANAF: conf.fajrAng = 18; conf.ishaaAng = 18; conf.mathhab = 2; break; case NORTH_AMERICA: conf.fajrAng = 15; conf.ishaaAng = 15; break; case MUSLIM_LEAGUE: conf.fajrAng = 18; conf.ishaaAng = 17; break; case UMM_ALQURRA: conf.fajrAng = 19; conf.ishaaAng = 0.0; conf.ishaaInv = 90; break; case FIXED_ISHAA: conf.fajrAng = 19.5; conf.ishaaAng = 0.0; conf.ishaaInv = 90; break; } }
public static void getImsaak( final Location loc, final Method conf, final Date date, Prayer[] pt) { Method tmpConf; int[] lastDay = new int[1]; double[] julianDay = new double[1]; Prayer[] temp = new Prayer[6]; for (int i = 0; i < temp.length; i++) { temp[i] = new Prayer(); } tmpConf = new Method(conf); if (conf.fajrInv != 0) { if (conf.imsaakInv == 0) tmpConf.fajrInv += DEF_IMSAAK_INTERVAL; else tmpConf.fajrInv += conf.imsaakInv; } else if (conf.imsaakInv != 0) { /* use an inv even if al-Fajr is computed (Indonesia?) */ tmpConf.offList[0] += (conf.imsaakInv * -1); tmpConf.offset = 1; } else { tmpConf.fajrAng += conf.imsaakAng; } getDayInfo(date, loc.gmtDiff, lastDay, julianDay); getPrayerTimesByDay(loc, tmpConf, lastDay[0], julianDay[0], temp, IMSAAK); /* FIXIT: We probably need to check whether it's possible to compute * Imsaak normally for some extreme methods first */ /* In case of an extreme Fajr time calculation use intervals for Imsaak and * compute again */ if (temp[0].isExtreme != 0) { tmpConf = new Method(conf); if (conf.imsaakInv == 0) { tmpConf.offList[0] -= DEF_IMSAAK_INTERVAL; tmpConf.offset = 1; } else { tmpConf.offList[0] -= conf.imsaakInv; tmpConf.offset = 1; } getPrayerTimesByDay(loc, tmpConf, lastDay[0], julianDay[0], temp, IMSAAK); } pt[0] = temp[0]; }