المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : برنامج برنامج الأذان المعدل بالسي شارب


__الهاوي__
2013-08-01, 18:27
السلام عليكم
سبق وأن أنجز أخانا MHDM برنامج للتذكير بالآذان باستخدام الفيبي دوت نت، ولقد ناقشنا ذلك في هذا الموضوع
http://www.djelfa.info/vb/showthread.php?t=1327951
ولقد كانت لي مشاركة هنا وأشرت أن الكلاس الموجود في النت يا إما خاطئ أو أنني لم أفهمه
http://www.djelfa.info/vb/showthread.php?p=1053621218#post1053621218
ولكن المشكلة صعبة الاكتشاف، لقد كانت في قيم خطوط الطول والعرض والموجودة في ملف xml
فالقيم موجودة دون فاصلة في حين الحقيقية موجودة بالفاصلة
مثلا قيم الطول والعرض لمستغانم في ملف xml ها هي


<city name="مستغانم">
<latitude>359170</latitude>
<longitude>1567</longitude>
</city>


لكن في الحقيقة هي صغيرة وليست كبيرة

<city name="مستغانم">
<latitude>35.9170</latitude>
<longitude>0.1567</longitude>
</city>


واكتشفت ذلك بالصدفة لعدم تعاملي مع مفهوم خطوط الطول والعرض رغم أننا درسناها في الابتدائي
بعد اكتشاف الخلل تم تصحيح البرنامج وها هو يعمل بشكل سليم
http://img39.imageshack.us/img39/4418/yhee.png

كلاس الحساب

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace athan
{
class CalcPrayerTimes
{
double Local_Noon;
double Asr_Time;
double Esha_Time;
double Fajr_Time;
double Sun_Set;
double Sun_Rise;
public CalcPrayerTimes(int Year, int Month, int Day, double Long, double Lat, double Zone)
{
double D = (367 * Year) - ((Year + (int)((Month + 9) / 12)) * 7 / 4) + (((int)(275 * Month / 9)) + Day - 730531.5);
double L = (280.461 + 0.9856474 * D) % 360;
L = LessMore360(L);
double M = (357.528 + 0.9856003 * D) % 360;
M = LessMore360(M);
double Lambda = L + 1.915 * Math.Sin(ToRadian(M)) + 0.02 * Math.Sin(ToRadian(2 * M));
Lambda = LessMore360(Lambda);
double Obliquity = 23.439 - 0.0000004 * D;
double Alpha = ToDegree(Math.Atan((Math.Cos(ToRadian(Obliquity)) * Math.Tan(ToRadian(Lambda)))));//////
Alpha = LessMore360(Alpha);
Alpha = Alpha - (360 * (int)(Alpha / 360));
Alpha = (Alpha + 90 * (Math.Floor(Lambda / 90) - Math.Floor(Alpha / 90)));
double ST = (100.46 + 0.985647352 * D) % 360;
double Dec = ToDegree(Math.Asin(Math.Sin(ToRadian(Obliquity)) * Math.Sin(ToRadian(Lambda))));
double Durinal_Arc = ToDegree(Math.Acos((Math.Sin(ToRadian(-0.8333)) - Math.Sin(ToRadian(Dec)) * Math.Sin(ToRadian(Lat))) / (Math.Cos(ToRadian(Dec)) * Math.Cos(ToRadian(Lat)))));
double Noon = Alpha - ST;
Noon = LessMore360(Noon);
double UT_Noon = Noon - Long;
Local_Noon = UT_Noon / 15 + Zone;
double Asr_Alt = ToDegree(Math.Atan(1 + Math.Tan(ToRadian(Lat - Dec))));
double Asr_Arc = ToDegree(Math.Acos((Math.Sin(ToRadian(90 - Asr_Alt)) - Math.Sin(ToRadian(Dec)) * Math.Sin(ToRadian(Lat))) / (Math.Cos(ToRadian(Dec)) * Math.Cos(ToRadian(Lat)))));
Asr_Arc = Asr_Arc / 15;
Asr_Time = Local_Noon + Asr_Arc;
Sun_Rise = Local_Noon - (Durinal_Arc / 15);
Sun_Set = Local_Noon + (Durinal_Arc / 15);
double Esha_Arc = ToDegree(Math.Acos((Math.Sin(ToRadian(-18)) - Math.Sin(ToRadian(Dec)) * Math.Sin(ToRadian(Lat))) / (Math.Cos(ToRadian(Dec)) * Math.Cos(ToRadian(Lat)))));
Esha_Time = Local_Noon + (Esha_Arc / 15);
double Fajr_Arc = ToDegree(Math.Acos((Math.Sin(ToRadian(-18)) - Math.Sin(ToRadian(Dec)) * Math.Sin(ToRadian(Lat))) / (Math.Cos(ToRadian(Dec)) * Math.Cos(ToRadian(Lat)))));
Fajr_Time = Local_Noon - (Fajr_Arc / 15);
}
public double ToRadian(double Value)
{
return (Value * Math.PI / 180);
}
public double ToDegree(double Value)
{
return (Value * 180 / Math.PI);
}
public double LessMore360(double Value)
{
if (Value <= 0 || Value > 360)
{ return (Value + 360); }
else
return Value;
}
public int LocalNoonHour
{
get
{
return ((int)(Local_Noon));
}
}
public int LocalNoonMin
{
get
{
return (int)(((Local_Noon) - (int)Local_Noon) * 60);
}
}
public int AsrHour
{
get
{
return ((int)(Asr_Time));
}
}
public int AsrMin
{
get
{
return (int)(((Asr_Time) - (int)(Asr_Time)) * 60);
}
}
public int SunRiseHour
{
get
{
return ((int)(Sun_Rise));
}
}
public int SunRiseMinr
{
get
{
return (int)(((Sun_Rise) - (int)(Sun_Rise)) * 60);
}
}
public int SunSetHour
{
get
{
return ((int)(Sun_Set));
}
}
public int SunSetMin
{
get
{
return (int)(((Sun_Set) - (int)(Sun_Set)) * 60);
}
}
public int FajrHour
{
get
{
return ((int)(Fajr_Time));
}
}
public int FajrMin
{
get
{
return (int)(((Fajr_Time) - (int)(Fajr_Time)) * 60);
}
}
public int EshaHour
{
get
{
return ((int)(Esha_Time));
}
}
public int EshaMin
{
get
{
return (int)(((Esha_Time) - (int)(Esha_Time)) * 60);
}
}
}

}



البرنامج من إنجاز العبد الضعيف

using System;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using athan;
using System.Media;
namespace athan
{
public partial class AthanForm : Form
{
DataSet ds;
CalcPrayerTimes calculator;
NotifyIcon myNotifyIcon;
ContextMenu myMenu;

public AthanForm()
{
InitializeComponent();
}

private void AthanForm_Load(object sender, EventArgs e)
{



myMenu = new ContextMenu();//إضافة قائمة قرب الساعة لأيقونة البرنامج
myMenu.MenuItems.Add(0, new MenuItem("إظهار", new System.EventHandler(Show_Click)));
myMenu.MenuItems.Add(1, new MenuItem("إخفاء", new System.EventHandler(Hide_Click)));
myMenu.MenuItems.Add(2, new MenuItem("خروج", new System.EventHandler(Exit_Click)));

myNotifyIcon = new NotifyIcon(); //إضافة أيقونة قرب الساعة
myNotifyIcon.Text = "برنامج الأذان: النسخة 1.00";
myNotifyIcon.Visible = true;
myNotifyIcon.Icon = new Icon(GetType(), "TrayIcon.ico");
myNotifyIcon.ContextMenu = myMenu; //ربط الايقونة بالقائمة السابقة

lblDay.Text = DateTime.Now.ToLongDateString(); //الحصول على تاريخ اليوم على هيئة حروف

string myXMLfile = "algeria.xml"; // متغير يحمل اسم ملف الإكس أم أل
ds = new DataSet(); // تهيئة داتاست وهي عبارة عند قاعدة بيانات في الذاكرة
ds.ReadXml(myXMLfile); //بناء الداتاسات اعتمادا على هيكل الإكس أم أل

cbWilaya.DataSource = ds.Tables[0]; // ربط الكومبوبوكس بالجدول الاول للداتاست
cbWilaya.DisplayMember = "name"; // عرض اسم الولاية في الكومبوبوكس

}

protected void Exit_Click(Object sender, System.EventArgs e)
{
Application.Exit();
}
protected void Hide_Click(Object sender, System.EventArgs e)
{
this.Hide();
}
protected void Show_Click(Object sender, System.EventArgs e)
{
this.Show();
}

private void timer1_Tick(object sender, EventArgs e)
{
lblTime.Text = DateTime.Now.ToLongTimeString();//إستخلاص الوقت الحالي
if (DateTime.Now.Second == 0) CheckEachMinute();//بعد كل دقيقة يتم التدقيق في وقت الصلاة
}

private void CheckEachMinute()
{
//تحويل الازمنة إلى دقائق لتسهيل المقارنة
int iFajr = calculator.FajrHour * 60 + calculator.FajrMin;
int iLocalNoon = calculator.LocalNoonHour * 60 + calculator.LocalNoonMin;
int iAsr = calculator.AsrHour * 60 + calculator.AsrMin;
int iSunSet = calculator.SunSetHour * 60 + calculator.SunSetMin;
int iEsha = calculator.EshaHour * 60 + calculator.EshaMin;

int iNow = DateTime.Now.Hour * 60 + DateTime.Now.Minute;

// استدعاء دالة لتنفيذ أمر الاذان
if (iNow == iFajr) playAthan("الفجر");
if (iNow == iLocalNoon) playAthan("الظهر");
if (iNow == iAsr) playAthan("العصر");
if (iNow == iSunSet) playAthan("المغرب");
if (iNow == iEsha) playAthan("العشاء");
}

private void playAthan(string sSatalTime)
{
//windows/system32/wmp.dll استخدام مكتبة الصوت الموجودة هنا
WMPLib.WindowsMediaPlayer wPlayer = new WMPLib.WindowsMediaPlayer();//استدعاء كنترول تشغيل الصوت
wPlayer.URL = "athan.wma";
wPlayer.controls.play();

DialogResult dialogResult = MessageBox.Show("أذان صلاة " + sSatalTime + "\n" + "لإيقاف الأذان إضغط على زر نعم", "الأذان", MessageBoxButtons.YesNo);
if (dialogResult == DialogResult.Yes)
{
wPlayer.controls.stop();
}

}


private void cbWilaya_SelectedIndexChanged(object sender, EventArgs e)
{
int index = cbWilaya.SelectedIndex; //الحصول على إندكس الولاية

int Year = DateTime.Now.Year; //الحصول على السنة الحالية
int Month = DateTime.Now.Month; //الحصول علي الشهر الحالي
int Day = DateTime.Now.Day; //الحصول على اليوم الحالي
double Long = Convert.ToDouble(ds.Tables[0].Rows[index]["longitude"]) / 10000; //استخلاص قيمة خط الطول للولاية
double Lat = Convert.ToDouble(ds.Tables[0].Rows[index]["latitude"]) / 10000; //استخلاص قيمة دائرة العرض للولاية
calculator = new CalcPrayerTimes(Year, Month, Day, Long, Lat, 1.0); // هنا نستدعي الكلاس الجاهز الذي يحسب أوقات الصلاة

//استخلاص وقت كل صلاة
lblFajr.Text = calculator.FajrHour.ToString("00") + ":"
+ calculator.FajrMin.ToString("00");
lblLocalNoon.Text = calculator.LocalNoonHour.ToString("00") + ":"
+ calculator.LocalNoonMin.ToString("00");
lblAsr.Text = calculator.AsrHour.ToString("00") + ":"
+ calculator.AsrMin.ToString("00");
lblSunSet.Text = calculator.SunSetHour.ToString("00") + ":"
+ calculator.SunSetMin.ToString("00");
lblEsha.Text = calculator.EshaHour.ToString("00") + ":"
+ calculator.EshaMin.ToString("00");

}


}
}




فقط للتنبيه، قد تجد فارقا بسيطا في الفجر والعشاء، وهذا لاعتماد بعض البرامج طريقة هيئة العالم الاسلامي في الحساب، في حين الكلاس المستخدم هنا يعتمد جامعة كاراتشي في الحساب، فالفرق طفيف، علما أنه يوجد العديد من طرق الحساب العالمية.

من يحتاج لمواقيت الصلاة في بلدان أخرى فما عليه إلا استبدال ملف algeria.xml مع الحفاظ على التسمية.

كما أنني استخدمت أسامي إنجليزية في تسمية المتغيرات والدوال وهذا لأنني معقد من الفرنسية :1: على اعتبارها لغة دخيلة على البرمجة.
وأثناء التسمية قاربت الأسلوب العالمي في التسمية
يعني Now من نوع interger يسمى هكذا : iNow
المتغير SalatTime من نوع string يسمى هكذا: sSalatTime
الكنترول Wilaya من نوع ComboBox يسمى هكذا: cbWilaya
Label = lbl
TextBox = txt
Button = btn
ListBox = lb
.... إلخ

وهذا هو الاسلوب المعتمد عالميا فلنعتمده.

من يجد مشكلة في تشغيل التطبيق فأرجو أن يعلمني، فلقد سبق واستخدمت dot.net 4.0 في البرمجة.
من أشكل عليه شيء فلا بأس بأن يطرح تساؤله هنا

هذه النسخة الأولى، ستحسن لاحقا إن شاء الله.

لتحميل التطبيق
http://www.gulfup.com/?MmxboL

لتحميل السورس والتعديل عليه
http://www.gulfup.com/?ruAeCv

:dj_17: :dj_17: :dj_17: :dj_17: :dj_17: :dj_17: :dj_17: :dj_17: :dj_17: :dj_17: :dj_17:

أهلا ثانية إخواني
تكملة للبرنامج، ها هي نسخة جديدة من البرنامج المخصص لولايات الجزائر فقط

http://imageshack.com/scaled/large/163/t2ku.png

التعديلات:
- إضافة أنواع مختلفة من أصوات الأذان
- حفظ البيانات للاستخدام مستقبلا
- التنبيه من خلال أيقونة شريط المهام

فقط كملاحظة: تم تحميل التطبيق السابق أكثر من 30 مرة، لكنني لا أعرف إن اشتغل عند البعض أم لا
أعلم أنه عند البعض يطلب تحميل dotnet framework 4.0
سأقوم بإعادة البرنامج على الفريموورك 2.0
لمن لم يشتغل معه أرجو أن يعلمني لأن هذا ينفعني وينفع المبرمجين في بيئة الدوت نت.

تحميل التطبيق
http://www.gulfup.com/?TKRnLn

MHDM
2013-08-02, 00:24
السلام عليكم

اخي __الهاوي__

ابداع كالعادة شكرا لطرحك مواضيع للنقاش والتعاون هذا ما ابحث عنه هو فريق من القسم لنتعاون وننجز برامج لننهض بقسم البرمجة شكرا لك مرة ثانية على تعاونك

لا لمثل هذه الردود المحبطة


برمجة سيئة جدا
وما نفعه اذا كان التغيير يدوي ؟

فل تقل خيرا او لتصمت

__الهاوي__
2013-08-02, 09:52
العفو أخي
يد الله مع الجماعة وإنما يأكل الذئب من الغنم القاصية
هي أكيد أن الاخ تسرع ولم ينتبه لشيء وهو أن أعمالك وإبداعاتك يا أخي كانت مجانية وتعليمية، فمهما فعلت أو أنقصت فأنت مشكور وإن شاء الله مأجور

عودة إلى الأذان
لم أكمل موضوعي أمس لأن سيرفر الجلفة توقف عن العمل
تم تعديل المحتوى وإضافة وصلات التنزيل

أراكم لاحقا

__الهاوي__
2013-08-02, 12:08
وهذا تطبيق آخر بالدلفي لعشاق هذه اللغة

unit hdfPrayTimesUnit;
{------------------------------------------------------------------------------
Creation Date: 2009/08/16 (1388/05/25)
Author: Ebrahim Asadi
Version: 1.0.0
Description: Prayer Times Calculator. ThdfPrayTime is a class providing a set of
functions to calculate prayer times based on a variety of conventions usually
used in Muslim communities.
Notes:
It is based on Hamid Zarrabi-Zadeh PrayTimes library which is in JavaScript.
(http://tanzil.info/praytime).
History:

Date: [Fixed:, Added:, Changed:, Improved:, Removed:]
------------------------------------------------------------------------------}

interface

uses SysUtils, DateUtils, Math;

type
// Prayer Times Record
ThdfPrayerTimes = record
Fajr: Double;
Sunrise: Double;
Dhuhr: Double;
Asr: Double;
Sunset: Double;
Maghrib: Double;
Isha: Double;
end;

// Calc Method Parameters
ThdfMethodParamRecord = record
FajrAngle: Double;
MaghribSelector: Double; // (0 = angle; 1 = minutes after sunset)
MaghribParameterValue: Double; // (in angle or minutes)
IshaSelector: Double; // (0 = angle; 1 = minutes after maghrib)
IshaParameterValue: Double; // (in angle or minutes)
end;

// Sun Position Record
ThdfSunPosition = record
Declination: Double; // declination of the Sun
EquationOfTime: Double; // The Equation of Time
DistanceFromEarth: Double; // The distance of the Sun from the Earth, in astronomical units (AU)
end;

// Calculation Methods
ThdfCalculationMethod =
(
cmJafari, // Ithna Ashari
cmKarachi, // University of Islamic Sciences, Karachi
cmISNA, // Islamic Society of North America (ISNA)
cmMWL, // Muslim World League (MWL)
cmMakkah, // Umm al-Qura, Makkah
cmEgypt, // Egyptian General Authority of Survey
cmCustom, // Custom Setting
cmTehran // Institute of Geophysics, University of Tehran
);

// Juristic Methods
ThdfJuristicMethod =
(
jmShafii, // Shafii (standard)
jmHanafi // Hanafi
);

// Adjusting Methods for Higher Latitudes
ThdfAdjustingMethodForHigherLatitudes =
(
hlNone, // No adjustment
hlMidNight, // middle of night
hlOneSeventh, // 1/7th of night
hlAngleBased // angle/60th of night
);

// Time Formats
ThdfTimeFormat =
(
tfTime24, // 24-hour format
tfTime12, // 12-hour format
tfTime12NS, // 12-hour format with no suffix
tfFloat // floating point number
);

// ThdfPrayTimes class
ThdfPrayTimes = class
private
TimeFormat: ThdfTimeFormat; // time format
NumIterations: Integer; // number of iterations needed to compute times
InvalidTime: string;

JDate: Double; // Julian date

MethodParams: array[ThdfCalculationMethod] of ThdfMethodParamRecord;

FCalcMethod: ThdfCalculationMethod;
FAsrJuristic: ThdfJuristicMethod;
FAdjustHighLats: ThdfAdjustingMethodForHigherLatitudes;
FLatitude: Double;
FLongitude: Double;
FTimeZone: Double;
FDhuhrMinutes: Integer;
FDayLightSavingTime: Boolean;

function ComputeDayTimes(): ThdfPrayerTimes; // compute prayer times at given julian date
function ComputeTimes(Times: ThdfPrayerTimes): ThdfPrayerTimes; // compute prayer times at given julian date
function ComputeTime(G: Double; Time: Double): Double; // compute time for a given angle G
function DayPortion(Times: ThdfPrayerTimes): ThdfPrayerTimes; // convert hours to day portions
function SunDeclination(AJulianDate: Double): Double; // compute declination angle of sun
function ComputeMidDay(Time: Double): Double; // compute mid-day (Dhuhr, Zawal) time
function EquationOfTime(AJulianDate: Double): Double; // compute equation of time
function SunPosition(AJulianDate: Double): ThdfSunPosition; // compute declination angle of sun and equation of time
// and distance of the Sun from the Earth, in astronomical units (AU)
function AdjustTimes(Times: ThdfPrayerTimes): ThdfPrayerTimes; // adjust times in a prayer time array
function AdjustHighLatTimes(Times: ThdfPrayerTimes): ThdfPrayerTimes; // adjust Fajr, Isha and Maghrib for ********s in higher latitudes
function TimeDiff(Time1, Time2: Double): Double; // compute the difference between two times
function NightPortion(Angle: Double): Double; // the night portion used for adjusting times in higher latitudes
function ComputeAsr(Step: Integer; T: Double): Double; // compute the time of Asr
function TwoDigitsFormat(Num: Integer): string; // add a leading 0 if necessary

procedure SetCustomParams(Params: ThdfMethodParamRecord);

//---------------------- Trigonometric Functions -----------------------
function DSin(D: Double): Double; // degree sin
function DCos(D: Double): Double; // degree cos
function DTan(D: Double): Double; // degree tan
function DArcsin(X: Double): Double; // degree arcsin
function DArccos(X: Double): Double; // degree arccos
function DArctan2(Y, X: Double): Double; // degree arctan2
function DArccot(X: Double): Double; // degree arccot
function DegreeToRadian(D: Double): Double; // degree to radian
function RadianToDegree(R: Double): Double; // radian to degree
function FixHour(A: Double): Double; // range reduce hours to 0..23
function FixAngle(A: Double): Double; // range reduce angle in degrees.
procedure SetAdjustHighLats(const Value: ThdfAdjustingMethodForHigherLatitudes);
procedure SetAsrJuristic(const Value: ThdfJuristicMethod);
procedure SetCalcMethod(const Value: ThdfCalculationMethod);
procedure SetLatitude(const Value: Double);
procedure SetLongitude(const Value: Double);
procedure SetTimeZone(const Value: Double);
procedure SetDhuhrMinutes(const Value: Integer);
procedure SetDayLightSavingTime(const Value: Boolean);
public
constructor Create;
destructor Destroy; override;

function GetDatePrayerTimes(AYear, AMonth, ADay: Word; ALatitude, ALongitude, ATimeZone: Double): ThdfPrayerTimes;
function GetPrayerTimes(ADate, ALatitude, ALongitude, ATimeZone: Double): ThdfPrayerTimes;

procedure SetFajrAngle(Angle: Double);
procedure SetMaghribAngle(Angle: Double);
procedure SetIshaAngle(Angle: Double);
procedure SetMaghribMinutes(Minutes: Double); // minutes after sunset
procedure SetIshaMinutes(Minutes: Double); // minutes after maghrib

function FloatToTime12(Time: Double; NoSuffix: Boolean = False): string;
function FloatToTime24(Time: Double): string;

// caculation method
property CalcMethod: ThdfCalculationMethod read FCalcMethod write SetCalcMethod;
// Juristic method for Asr
property AsrJuristic: ThdfJuristicMethod read FAsrJuristic write SetAsrJuristic;
// adjusting method for higher latitudes
property AdjustHighLats: ThdfAdjustingMethodForHigherLatitudes read FAdjustHighLats write SetAdjustHighLats;
// latitude
property Latitude: Double read FLatitude write SetLatitude;
// longitude
property Longitude: Double read FLongitude write SetLongitude;
// time-zone
property TimeZone: Double read FTimeZone write SetTimeZone;
// minutes after mid-day for Dhuhr
property DhuhrMinutes: Integer read FDhuhrMinutes write SetDhuhrMinutes;
// Automatically add one hour to times for daylight saving times
property DayLightSavingTime: Boolean read FDayLightSavingTime write SetDayLightSavingTime;
end;

implementation

//************************************************** ****************************
{ ThdfPrayTime }
//************************************************** ****************************

function ThdfPrayTimes.adjustHighLatTimes(Times: ThdfPrayerTimes): ThdfPrayerTimes;
var
NightTime: Double;
FajrDiff: Double;
IshaAngle: Double;
IshaDiff: Double;
MaghribAngle: Double;
MaghribDiff: Double;
begin
NightTime := timeDiff(Times.Sunset, Times.Sunrise); // sunset to sunrise

// Adjust Fajr
FajrDiff := nightPortion(MethodParams[Self.calcMethod].FajrAngle) * NightTime;

if (IsNan(Times.Fajr) or (TimeDiff(Times.Fajr, Times.Sunrise) > FajrDiff)) then
begin
Times.Fajr := Times.Sunrise - FajrDiff;
end;

// Adjust Isha
if MethodParams[Self.calcMethod].IshaSelector = 0 then
begin
IshaAngle := MethodParams[Self.calcMethod].IshaParameterValue;
end
else
begin
IshaAngle := 18;
end;

IshaDiff := nightPortion(IshaAngle) * NightTime;

if (IsNan(Times.Isha) or (timeDiff(Times.Asr, Times.Isha) > IshaDiff)) then
begin
Times.Isha := Times.Asr + IshaDiff;
end;

// Adjust Maghrib
if MethodParams[Self.calcMethod].MaghribSelector = 0 then
begin
MaghribAngle := MethodParams[Self.calcMethod].MaghribParameterValue;
end
else
begin
MaghribAngle := 4;
end;

MaghribDiff := nightPortion(MaghribAngle) * NightTime;

if (IsNan(Times.Maghrib) or (timeDiff(Times.Asr, Times.Maghrib) > MaghribDiff)) then
begin
Times.Maghrib := Times.Asr + MaghribDiff;
end;

Result := Times;
end;

//************************************************** ****************************
function ThdfPrayTimes.adjustTimes(Times: ThdfPrayerTimes): ThdfPrayerTimes;
begin
Times.Fajr := Times.Fajr + Self.timeZone - (FLongitude / 15);
Times.Sunrise := Times.Sunrise + Self.timeZone - (FLongitude / 15);
Times.Dhuhr := Times.Dhuhr + Self.timeZone - (FLongitude / 15);
Times.Sunset := Times.Sunset + Self.timeZone - (FLongitude / 15);
Times.Asr := Times.Asr + Self.timeZone - (FLongitude / 15);
Times.Maghrib := Times.Maghrib + Self.timeZone - (FLongitude / 15);
Times.Isha := Times.Isha + Self.timeZone - (FLongitude / 15);

Times.Dhuhr := Times.Dhuhr + (FDhuhrMinutes / 60);

if MethodParams[Self.calcMethod].MaghribSelector = 1 then //maghrib
begin
Times.Maghrib := Times.Asr + (MethodParams[Self.calcMethod].MaghribParameterValue / 60);
end;

if MethodParams[Self.calcMethod].IshaSelector = 1 then //Isha
begin
Times.Isha := Times.Maghrib + (MethodParams[Self.calcMethod].IshaParameterValue / 60);
end;

if Self.adjustHighLats <> hlNone then
begin
Times := adjustHighLatTimes(Times);
end;

if FDayLightSavingTime then
begin
Times.Fajr := Times.Fajr + 1;
Times.Sunrise := Times.Sunrise + 1;
Times.Dhuhr := Times.Dhuhr + 1;
Times.Asr := Times.Asr + 1;
Times.Sunset := Times.Sunset + 1;
Times.Maghrib := Times.Maghrib + 1;
Times.Isha := Times.Isha + 1;
end;

Result := Times;
end;

//************************************************** ****************************
function ThdfPrayTimes.computeAsr(step: Integer; t: Double): Double;
var
D: Double;
G: Double;
begin
D := sunDeclination(Self.JDate + t);
G := - DArccot(step + Self.DTan(abs(FLatitude - D)));
Result := computeTime(G, t);
end;

//************************************************** ****************************
function ThdfPrayTimes.ComputeDayTimes: ThdfPrayerTimes;
var
Times: ThdfPrayerTimes;
I: Integer;
begin
//default Times
Times.Fajr := 5;
Times.Sunrise := 6;
Times.Dhuhr := 12;
Times.Asr := 13;
Times.Sunset := 18;
Times.Maghrib := 18;
Times.Isha := 18;

for I := 0 to Self.NumIterations - 1 do
begin
Times := computeTimes(Times);
end;

Times := adjustTimes(Times);
Result := Times;
end;

//************************************************** ****************************
function ThdfPrayTimes.ComputeMidDay(time: Double): Double;
var
T: Double;
begin
T := EquationOfTime(Self.JDate + time);
Result := FixHour(12 - T);
end;

//************************************************** ****************************
function ThdfPrayTimes.ComputeTime(G, Time: Double): Double;
var
D: Double;
Z: Double;
V: Double;
begin
D := SunDeclination(Self.JDate + Time);
Z := computeMidDay(Time);
V := 1/15 * DArccos((- DSin(G)- DSin(D)* DSin(FLatitude)) / (DCos(D)* DCos(FLatitude)));

if G > 90 then
begin
V := -V;
end;

Result := Z + V;
end;

//************************************************** ****************************
function ThdfPrayTimes.ComputeTimes(Times: ThdfPrayerTimes): ThdfPrayerTimes;
var
T: ThdfPrayerTimes;
Step: Integer;
begin
T := dayPortion(Times);

Result.Fajr := computeTime(180 - MethodParams[calcMethod].FajrAngle, T.Fajr);
Result.Sunrise := computeTime(180 - 0.833, T.Sunrise);
Result.Dhuhr := computeMidDay(T.Dhuhr);
Step := 1;
case AsrJuristic of
jmShafii: Step := 1;
jmHanafi: Step := 2;
end;
Result.Asr := computeAsr(Step, T.Asr);
Result.Sunset := computeTime(0.833, T.Sunset);;
Result.Maghrib := computeTime(MethodParams[calcMethod].MaghribParameterValue, T.Maghrib);
Result.Isha := computeTime(MethodParams[calcMethod].IshaParameterValue, T.Isha);
end;

//************************************************** ****************************
constructor ThdfPrayTimes.Create;
begin
calcMethod := cmJafari; // caculation method
asrJuristic := jmShafii; // Juristic method for Asr
adjustHighLats := hlMidNight; // adjusting method for higher latitudes
TimeFormat := tfTime24; // time format
dhuhrMinutes := 0; // minutes after mid-day for Dhuhr
NumIterations := 1; // number of iterations needed to compute Times
InvalidTime := '-----';

MethodParams[cmJafari].FajrAngle := 16;
MethodParams[cmJafari].MaghribSelector := 0;
MethodParams[cmJafari].MaghribParameterValue := 4;
MethodParams[cmJafari].IshaSelector := 0;
MethodParams[cmJafari].IshaParameterValue := 14;

MethodParams[cmKarachi].FajrAngle := 18;
MethodParams[cmKarachi].MaghribSelector := 1;
MethodParams[cmKarachi].MaghribParameterValue := 0;
MethodParams[cmKarachi].IshaSelector := 0;
MethodParams[cmKarachi].IshaParameterValue := 18;

MethodParams[cmISNA].FajrAngle := 15;
MethodParams[cmISNA].MaghribSelector := 1;
MethodParams[cmISNA].MaghribParameterValue := 0;
MethodParams[cmISNA].IshaSelector := 0;
MethodParams[cmISNA].IshaParameterValue := 15;

MethodParams[cmMWL].FajrAngle := 18;
MethodParams[cmMWL].MaghribSelector := 1;
MethodParams[cmMWL].MaghribParameterValue := 0;
MethodParams[cmMWL].IshaSelector := 0;
MethodParams[cmMWL].IshaParameterValue := 17;

MethodParams[cmMakkah].FajrAngle := 19;
MethodParams[cmMakkah].MaghribSelector := 1;
MethodParams[cmMakkah].MaghribParameterValue := 0;
MethodParams[cmMakkah].IshaSelector := 1;
MethodParams[cmMakkah].IshaParameterValue := 90;

MethodParams[cmEgypt].FajrAngle := 19.5;
MethodParams[cmEgypt].MaghribSelector := 1;
MethodParams[cmEgypt].MaghribParameterValue := 0;
MethodParams[cmEgypt].IshaSelector := 0;
MethodParams[cmEgypt].IshaParameterValue := 17.5;

MethodParams[cmTehran].FajrAngle := 17.7;
MethodParams[cmTehran].MaghribSelector := 0;
MethodParams[cmTehran].MaghribParameterValue := 4.5;
MethodParams[cmTehran].IshaSelector := 0;
MethodParams[cmTehran].IshaParameterValue := 15;

MethodParams[cmCustom].FajrAngle := 18;
MethodParams[cmCustom].MaghribSelector := 1;
MethodParams[cmCustom].MaghribParameterValue := 0;
MethodParams[cmCustom].IshaSelector := 0;
MethodParams[cmCustom].IshaParameterValue := 17;
end;

//************************************************** ****************************
function ThdfPrayTimes.DArccos(X: Double): Double;
begin
Result := RadianToDegree(ArcCos(X));
end;

//************************************************** ****************************
function ThdfPrayTimes.DArccot(X: Double): Double;
begin
Result := RadianToDegree(ArcTan(1/X));
end;

//************************************************** ****************************
function ThdfPrayTimes.DArcsin(X: Double): Double;
begin
Result := RadianToDegree(ArcSin(X));
end;

//************************************************** ****************************
function ThdfPrayTimes.DArctan2(Y, X: Double): Double;
begin
Result := RadianToDegree(ArcTan2(Y, X));
end;

//************************************************** ****************************
function ThdfPrayTimes.DayPortion(Times: ThdfPrayerTimes): ThdfPrayerTimes;
begin
Times.Fajr := Times.Fajr / 24;
Times.Sunrise := Times.Sunrise / 24;
Times.Dhuhr := Times.Dhuhr / 24;
Times.Asr := Times.Asr / 24;
Times.Sunset := Times.Sunset / 24;
Times.Maghrib := Times.Maghrib / 24;
Times.Isha := Times.Isha / 24;

Result := Times;
end;

//************************************************** ****************************
function ThdfPrayTimes.DCos(D: Double): Double;
begin
Result := Cos(DegreeToRadian(D));
end;

//************************************************** ****************************
destructor ThdfPrayTimes.Destroy;
begin

inherited;
end;

//************************************************** ****************************
function ThdfPrayTimes.DSin(D: Double): Double;
begin
Result := Sin(DegreeToRadian(D));
end;

//************************************************** ****************************
function ThdfPrayTimes.DTan(D: Double): Double;
begin
Result := Tan(DegreeToRadian(D));
end;

//************************************************** ****************************
function ThdfPrayTimes.DegreeToRadian(D: Double): Double;
begin
Result := (D * Pi) / 180.0;
end;

//************************************************** ****************************
function ThdfPrayTimes.EquationOfTime(AJulianDate: Double): Double;
begin
Result := sunPosition(AJulianDate).EquationOfTime;
end;

//************************************************** ****************************
function ThdfPrayTimes.FixAngle(A: Double): Double;
begin
A := A - 360.0 * (Floor(A / 360.0));

if A < 0 then
begin
A := A + 360.0;
end;

Result := A;
end;

//************************************************** ****************************
function ThdfPrayTimes.FixHour(A: Double): Double;
begin
A := A - 24.0 * (Floor(A / 24.0));

if A < 0 then
begin
A := A + 24.0;
end;

Result := A;
end;

//************************************************** ****************************
function ThdfPrayTimes.FloatToTime12(Time: Double; NoSuffix: Boolean): string;
var
Hours: Integer;
Minutes: Integer;
Seconds: Integer;
Suffix: string;
begin
if (IsNan(Time)) then
begin
Result := Self.InvalidTime;
Exit;
end;

Hours := Math.Floor(Time);
Minutes := Math.Floor((Time - Hours) * 60);
Seconds := Math.Floor((Time - Hours) * 3600 - Minutes * 60);

if Hours >= 12 then
begin
Suffix := ' PM';
end
else
begin
Suffix := ' PM';
end;

Hours := ((Hours + 12 - 1) mod 12) + 1;
Result := IntToStr(hours) + ':' + TwoDigitsFormat(Minutes) + ':' + TwoDigitsFormat(Seconds);

if not NoSuffix then
begin
Result := Result + Suffix;
end;
end;

//************************************************** ****************************
function ThdfPrayTimes.FloatToTime24(Time: Double): string;
var
Hours: Integer;
Minutes: Integer;
Seconds: Integer;
begin
if IsNan(Time) then
begin
Result := Self.InvalidTime;
Exit;
end;

Hours := Math.Floor(Time);
Minutes := Math.Floor((Time - Hours) * 60);
Seconds := Math.Floor((Time - Hours) * 3600 - Minutes * 60);
Result := twoDigitsFormat(Hours) + ':' + TwoDigitsFormat(Minutes) + ':' + TwoDigitsFormat(Seconds);
end;

//************************************************** ****************************
function ThdfPrayTimes.getDatePrayerTimes(AYear, AMonth, ADay: Word; ALatitude, ALongitude, ATimeZone: Double): ThdfPrayerTimes;
var
ADateTime: TDateTime;
begin
FLatitude := ALatitude;
FLongitude := ALongitude;
FTimeZone := ATimeZone;

ADateTime := EncodeDate(AYear, AMonth, ADay);
Self.JDate := DateTimeToJulianDate(ADateTime) - FLongitude / (15 * 24);
Result := computeDayTimes();
end;

//************************************************** ****************************
function ThdfPrayTimes.GetPrayerTimes(ADate, ALatitude, ALongitude, ATimeZone: Double): ThdfPrayerTimes;
var
Year: Word;
Month: Word;
Day: Word;
begin
DecodeDate(ADate, Year, Month, Day);
Result := getDatePrayerTimes(Year, Month, Day, ALatitude, ALongitude, ATimeZone);
end;

//************************************************** ****************************
function ThdfPrayTimes.nightPortion(Angle: Double): Double;
begin
Result := 0;

case Self.AdjustHighLats of
hlAngleBased:
begin
Result := 1/60 * Angle;
end;

hlMidNight:
begin
Result := 1/2;
end;

hlOneSeventh:
begin
Result := 1/7;
end;
end;
end;

//************************************************** ****************************
function ThdfPrayTimes.RadianToDegree(R: Double): Double;
begin
Result := (R * 180.0) / Pi;
end;

//************************************************** ****************************
procedure ThdfPrayTimes.SetAdjustHighLats(const Value: ThdfAdjustingMethodForHigherLatitudes);
begin
FAdjustHighLats := Value;
end;

//************************************************** ****************************
procedure ThdfPrayTimes.SetAsrJuristic(const Value: ThdfJuristicMethod);
begin
FAsrJuristic := Value;
end;

//************************************************** ****************************
procedure ThdfPrayTimes.SetCalcMethod(const Value: ThdfCalculationMethod);
begin
FCalcMethod := Value;
end;

//************************************************** ****************************
procedure ThdfPrayTimes.setCustomParams(Params: ThdfMethodParamRecord);
begin
if Params.FajrAngle = 0 then
begin
MethodParams[cmCustom].FajrAngle := MethodParams[calcMethod].FajrAngle;
end
else
begin
MethodParams[cmCustom].FajrAngle := Params.FajrAngle;
end;

if Params.MaghribSelector = 0 then
begin
MethodParams[cmCustom].MaghribSelector := MethodParams[calcMethod].MaghribSelector;
end
else
begin
MethodParams[cmCustom].MaghribSelector := Params.MaghribSelector;
end;

if Params.MaghribParameterValue = 0 then
begin
MethodParams[cmCustom].MaghribParameterValue := MethodParams[calcMethod].MaghribParameterValue;
end
else
begin
MethodParams[cmCustom].MaghribParameterValue := Params.MaghribParameterValue;
end;

if Params.IshaSelector = 0 then
begin
MethodParams[cmCustom].IshaSelector := MethodParams[calcMethod].IshaSelector;
end
else
begin
MethodParams[cmCustom].IshaSelector := Params.IshaSelector;
end;

if Params.IshaParameterValue = 0 then
begin
MethodParams[cmCustom].IshaParameterValue := MethodParams[calcMethod].IshaParameterValue;
end
else
begin
MethodParams[cmCustom].IshaParameterValue := Params.IshaParameterValue;
end;

calcMethod := cmCustom;
end;

//************************************************** ****************************
procedure ThdfPrayTimes.SetDayLightSavingTime(const Value: Boolean);
begin
FDayLightSavingTime := Value;
end;

//************************************************** ****************************
procedure ThdfPrayTimes.SetDhuhrMinutes(const Value: Integer);
begin
FDhuhrMinutes := Value;
end;

//************************************************** ****************************
procedure ThdfPrayTimes.SetFajrAngle(Angle: Double);
var
MethodParamRecord: ThdfMethodParamRecord;
begin
MethodParamRecord.FajrAngle := Angle;
MethodParamRecord.MaghribSelector := 0;
MethodParamRecord.MaghribParameterValue := 0;
MethodParamRecord.IshaSelector := 0;
MethodParamRecord.IshaParameterValue := 0;

SetCustomParams(MethodParamRecord);
end;

//************************************************** ****************************
procedure ThdfPrayTimes.SetIshaAngle(Angle: Double);
var
MethodParamRecord: ThdfMethodParamRecord;
begin
MethodParamRecord.FajrAngle := 0;
MethodParamRecord.MaghribSelector := 0;
MethodParamRecord.MaghribParameterValue := 0;
MethodParamRecord.IshaSelector := 0;
MethodParamRecord.IshaParameterValue := Angle;

SetCustomParams(MethodParamRecord);
end;

//************************************************** ****************************
procedure ThdfPrayTimes.SetIshaMinutes(Minutes: Double);
var
MethodParamRecord: ThdfMethodParamRecord;
begin
MethodParamRecord.FajrAngle := 0;
MethodParamRecord.MaghribSelector := 0;
MethodParamRecord.MaghribParameterValue := 0;
MethodParamRecord.IshaSelector := 1;
MethodParamRecord.IshaParameterValue := Minutes;

SetCustomParams(MethodParamRecord);
end;

//************************************************** ****************************
procedure ThdfPrayTimes.SetLatitude(const Value: Double);
begin
FLatitude := Value;
end;

//************************************************** ****************************
procedure ThdfPrayTimes.SetLongitude(const Value: Double);
begin
FLongitude := Value;
end;

//************************************************** ****************************
procedure ThdfPrayTimes.SetMaghribAngle(Angle: Double);
var
MethodParamRecord: ThdfMethodParamRecord;
begin
MethodParamRecord.FajrAngle := 0;
MethodParamRecord.MaghribSelector := 0;
MethodParamRecord.MaghribParameterValue := Angle;
MethodParamRecord.IshaSelector := 0;
MethodParamRecord.IshaParameterValue := 0;

SetCustomParams(MethodParamRecord);
end;

//************************************************** ****************************
procedure ThdfPrayTimes.SetMaghribMinutes(minutes: Double);
var
MethodParamRecord: ThdfMethodParamRecord;
begin
MethodParamRecord.FajrAngle := 0;
MethodParamRecord.MaghribSelector := 1;
MethodParamRecord.MaghribParameterValue := Minutes;
MethodParamRecord.IshaSelector := 0;
MethodParamRecord.IshaParameterValue := 0;

SetCustomParams(MethodParamRecord);
end;

//************************************************** ****************************
procedure ThdfPrayTimes.SetTimeZone(const Value: Double);
begin
FTimeZone := Value;
end;

//************************************************** ****************************
function ThdfPrayTimes.SunDeclination(AJulianDate: Double): Double;
begin
Result := SunPosition(AJulianDate).Declination;
end;

//************************************************** ****************************
function ThdfPrayTimes.SunPosition(AJulianDate: Double): ThdfSunPosition;
var
D: Double;
g: Double;
q: Double;
L: Double;
R: Double;
e: Double;
RA: Double;
EqT: Double;
Declination: Double;
begin
D := AJulianDate - 2451545.0; // jd is the given Julian date
g := FixAngle(357.529 + 0.98560028 * D);
q := FixAngle(280.459 + 0.98564736 * D);
L := FixAngle(q + 1.915 * DSin(g) + 0.020 * DSin(2 * g)); // L is an approximation to the Sun's geocentric
// apparent ecliptic longitude (adjusted for aberration)
R := 1.00014 - 0.01671 * DCos(g) - 0.00014 * DCos(2 * g); // The distance of the Sun from the Earth, in astronomical units (AU)
e := 23.439 - 0.00000036 * D; // mean obliquity of the ecliptic, in degrees

Declination := DArcsin(DSin(e) * DSin(L));
RA := DArctan2(DCos(e) * DSin(L), DCos(L)) / 15; // the Sun's right ascension
RA := FixHour(RA);
EqT := q/15 - RA; // The Equation of Time

Result.Declination := Declination;
Result.EquationOfTime := EqT;
Result.DistanceFromEarth := R;
end;

//************************************************** ****************************
function ThdfPrayTimes.timeDiff(Time1, Time2: Double): Double;
begin
Result := FixHour(Time2 - Time1);
end;

//************************************************** ****************************
function ThdfPrayTimes.TwoDigitsFormat(Num: Integer): string;
begin
Result := IntToStr(Num);
if Num < 10 then
begin
Result := '0' + Result;
end;
end;

//************************************************** ****************************
end.

louisa20
2013-08-21, 11:20
بارك الله فيك

~أمة الله~
2013-08-24, 18:47
اللهم بارك ، تم التحميل
والبرنامج طيب ...جعله الله في ميزان حسناتكم...

__الهاوي__
2013-08-25, 10:16
العفو لكم إخوتي
في الحقيق كنت قيد تحسين البرنامج وضبطه لكن الاحداث في مصر الشقيقة جعلتني أتابع التلفاز وأترك البرمجة مؤقتا
للأسف، لما أرى إخواني يقتلون ويظلمون لا أستطيع التركيز في المشاريع والبرامج
سنعود إن شاء الله قريبا جدا.

__الهاوي__
2013-08-27, 21:55
تم إضافة نسخة جديدة مع تحسينات
أرجو ممن جرب البرنامج أن يعلمني إن اشتغل أم لا

arba7na
2013-08-28, 10:58
شكرا لك أخي

MHDM
2013-08-28, 17:41
السلام عليكم

اهنئك على برنامجك الجديد

البرنامج شغال

كما قلت يحتاج

net framework 4.0

شكرا لك بانتضار جديدك

ASKme
2013-09-11, 08:26
السلام عليكم

اخي __الهاوي__

ابداع كالعادة شكرا لطرحك مواضيع للنقاش والتعاون هذا ما ابحث عنه هو فريق من القسم لنتعاون وننجز برامج لننهض بقسم البرمجة شكرا لك مرة ثانية على تعاونك

لا لمثل هذه الردود المحبطة




فل تقل خيرا او لتصمت
ارايت ردي هو الذي حفزك للتطوير
برغم هذا مازال فيه بعض النقائص

ASKme
2013-09-11, 10:25
قمت بتحويل الوحدة CalcPrayerTimes.cs وقمت بتغيير بعض المتغيرات الى الدلفي وقمت بتجربتها
لاكني ساضيف المزيد لها


function CalcPrayerTimes(anydate:TDateTime;Long, Lat, Zone:Real):TPraytime;
var D,L,M,Lambda,Obliquity,Alpha,ST,Dec,Durinal_Arc,No on,UT_Noon,Local_Noon,Asr_Alt,Asr_Arc
,Asr_Time,Sun_Rise,Sun_Set,Esha_Arc,Esha_Time,Fajr _Arc,Fajr_Time:Real;
Year, Month,Day:Word;
begin

DecodeDate(anydate, Year, Month, Day);
D := (367 * Year) - Trunc((Year + ((Month + 9) / 12)) * 7 / 4) + ((Trunc(275 * Month / 9)) + Day - 730531.5);
L := RealMod((280.461 + 0.9856474 * D) , 360);
L := LessMore360(L);
M := RealMod((357.528 + 0.9856003 * D) , 360);
M := LessMore360(M);
Lambda := L + 1.915 * Sin(ToRadian(M)) + 0.02 * Sin(ToRadian(2 * M));
Lambda := LessMore360(Lambda);
Obliquity := 23.439 - 0.0000004 * D;
Alpha := ToDegree(Arctan((Cos(ToRadian(Obliquity)) * Tan(ToRadian(Lambda)))));//////
Alpha := LessMore360(Alpha);
Alpha := Alpha - (360 * Trunc(Alpha / 360));
Alpha := (Alpha + 90 * (Floor(Lambda / 90) - Floor(Alpha / 90)));
ST := RealMod((100.46 + 0.985647352 * D) , 360);
Dec := ToDegree(Arcsin(Sin(ToRadian(Obliquity)) * Sin(ToRadian(Lambda))));
Durinal_Arc := ToDegree(ArcCos((Sin(ToRadian(-0.8333)) - Sin(ToRadian(Dec)) * Sin(ToRadian(Lat))) / (Cos(ToRadian(Dec)) * Cos(ToRadian(Lat)))));
Noon := Alpha - ST;
Noon := LessMore360(Noon);
UT_Noon := Noon - Long;
Local_Noon := UT_Noon / 15 + Zone;
Asr_Alt := ToDegree(Arctan(1 + Tan(ToRadian(Lat - Dec))));
Asr_Arc := ToDegree(Arccos((Sin(ToRadian(90 - Asr_Alt)) - Sin(ToRadian(Dec)) * Sin(ToRadian(Lat))) / (Cos(ToRadian(Dec)) * Cos(ToRadian(Lat)))));
Asr_Arc := Asr_Arc / 15;
Asr_Time := Local_Noon + Asr_Arc;
Sun_Rise := Local_Noon - (Durinal_Arc / 15);
Sun_Set := Local_Noon + (Durinal_Arc / 15);
Esha_Arc := ToDegree(Arccos((Sin(ToRadian(-18)) - Sin(ToRadian(Dec)) * Sin(ToRadian(Lat))) / (Cos(ToRadian(Dec)) * Cos(ToRadian(Lat)))));
Esha_Time := Local_Noon + (Esha_Arc / 15);
Fajr_Arc := ToDegree(Arccos((Sin(ToRadian(-18)) - Sin(ToRadian(Dec)) * Sin(ToRadian(Lat))) / (Cos(ToRadian(Dec)) * Cos(ToRadian(Lat)))));
Fajr_Time := Local_Noon - (Fajr_Arc / 15);

ASKme
2013-09-11, 23:47
على كل حال هناك اخطاء بسيطة


الجولاني يوم ((Year + (int)((Month + 9) / 12)) * 7 / 4) الشرط ان لاتكون عشرية اضف لها int
طريقة حساب البرنامج حسب جامعة العلوم الإسلامية بكراتشي والاصح رابطة

العالم الإسلامي اي تغير 18 الى 17

اهم خاصية الوقت المتبقي للصلاة المتقبلة غير موجودة

حرهوب
2014-06-28, 21:34
أشكرك على البرنامج الرائع والله اشكرك على مجهودك الجميل
انا مهتم بالبرمجة و برمجة برنامج اسمه دليلك في شهر رمضان
ناقصي الجزء الاهم منه الي هو مواقيت الاذان
ياليت طلباً وليس امراً ابي شرح منك فيديو كيف اسوي برنامج مواقيت
انا خذيت السورس حقك ماعرفت كيف اعدله وانا مبتدأ في البرمجة
وابي ابرمج برنامج الاذان لدول السعوديه وياليت تساعدني جزاك الله خير وشكرا...!

__الهاوي__
2014-07-01, 18:08
أخي حرهوب
أنا متعب هذه الأيام
سأوافيك بشرح للبرنامج قريبا
رمضان كريم

ahmed.zako
2014-07-07, 11:55
اللهم بارك ، تم التحميل
والبرنامج طيب ...جعله الله في ميزان حسناتكم..

ahmed.zako
2014-07-07, 12:00
اللهم بارك ، تم التحميل
والبرنامج طيب ...جعله الله في ميزان حسناتكم..

faiz msila
2014-07-09, 19:51
بارك الله فيك ....وشكرا جزيلا

mohamed bouzid
2016-03-20, 18:29
يعطيك العافية اخي

Southpaw
2016-03-24, 22:45
بارك الله فيك أخي

aminereda90
2016-03-25, 16:20
بارك االله فيك اخي

souhil05
2016-06-21, 23:58
بارك الله فيك

IhabZad
2016-07-03, 01:02
بارك الله فيك خويا على المشاركة
.
.
و ان شاء الله نستفادو كلنا

إبراهيم01
2016-08-14, 01:38
مشكوووووووووووووور
بارك الله فيك

Hammar
2018-08-31, 18:02
شكرا على الموضوع المهم

yasshalamadrid
2018-11-15, 08:55
مشكوور اخي على الموضوع الجميل