Calendrier Astronomique de Poche avec lib suisse en datas

Programmation d'applications complexes
Avatar de l’utilisateur
kernadec
Messages : 1606
Inscription : ven. 25/avr./2008 11:14

Re: Calendrier Astronomique de Poche avec lib suisse en data

Message par kernadec »

bonjour
mise à jour du code pour PB 5.31
Mise en mode global des variables Prototype
je remercie "User_Russian" du forum english pour cette astuce

Cordialement

Code : Tout sélectionner

;################################################################
;
; Swiss Ephemeris - swedll32.LIB
;
; Interface pour Purebasic 4.0.x mis à jour PB 5.31
;
; ftp://ftp.astro.com/pub/sweph/
; http://www.astro.com/swisseph/swephprg.htm
; sites pour obtenir la lib ' swedll32.LIB '
;################################################################
;  Impression d'ephémérides sur 32 jours par Kernadec 09/2008   #
;      voila un petit calendrier astronomique de poche          #
;         maximise et minimise windows et gadgets               #
;################################################################

Declare calcul()
Global jour.l,jours.l
Global journ.s
Global mois.l,moiss.l
Global annee.l,annees.l
Global minut.d
Global heure.d 
Global Path.s
Global c.s
Global starname.s
Global hdms.s
Global mdms.s
Global sdms.s
Global PoliceID

;################################################################


Path.s="C:\Purebasic"  ;  chemin du repertoire principal


Global Dim x.d(6); déclaration du tableau x
Global Dim x2.d(6)
Global Dim cusp.d(13)
Global Dim ascmc.d(10)
Global Dim attr.d(20)
Global Dim tret.d(20)
Global Dim geopos.d(10)
Global Dim geoposx.d(10)
Global Dim xnasc.d(6)
Global Dim xndsc.d(6)
Global Dim xperi.d(6)
Global Dim xaphe.d(6)
Global Dim Position.d(22)
Global Dim retro.s(22)
Global Dim serr.s(255)
Global Dim plnam.s(255)
Global hcusps.d=0
Global pName.s=Space(256)
Global Dim signepl.l(13)
Global Dim degrepl.s(13)
Global Dim minutpl.s(13)
Global Dim seconpl.s(13)
Global Dim zod.s(11)
Global Dim coltx.s(20)


#SEFLG_SWIEPH=2
#SEFLG_SPEED=256


Enumeration 0 Step 1
  #SE_GREG_CAL
  #SE_JUL_CAL
  #ID
EndEnumeration

Enumeration 0 Step 1
  #SE_SUN
  #SE_MOON
  #SE_MERCURY
  #SE_VENUS
  #SE_MARS
  #SE_JUPITER
  #SE_SATURN
  #SE_URANUS
  #SE_NEPTUNE
  #SE_PLUTO
  #SE_MEAN_NODE
  #SE_TRUE_NODE
  #SE_MEAN_APOG
  #SE_OSCU_APOG
  #SE_EARTH
  #SE_CHIRON   
  #SE_PHOLUS
  #SE_CERES
  #SE_PALLAS
  #SE_JUNO
  #SE_VESTA
  #SE_INTP_APOG
  #SE_INTP_PERG
EndEnumeration
Procedure xcm(x.f)
  x = x * (PrinterPageWidth()/21) ; 21cm A4
  ProcedureReturn x
EndProcedure
Procedure ycm(x.f)
  x = x * (PrinterPageHeight()/29.7) ; 29,7cm A4
  ProcedureReturn x
EndProcedure 
Procedure.d Frac(x.d)
  ProcedureReturn x-Int(x)
EndProcedure
Procedure.d dms(x.d)
  ProcedureReturn Int(x)+Frac(Int(Frac(x)*60)/100)+Frac(Frac(Frac(x)*60)*0.006)
EndProcedure



Restore zodiaque
For n=0 To 11
  Read.s zod.s(n)
Next n

;################################################################
Prototype.d trueSWE_JulDay(annee.l,mois.l,jour.l,heure.d,flag.l)
Prototype.l trueSWE_RevJul(juliandate.d,flag.l,annee.l,mois.l,jour.l,heure.l)
Prototype.l trueSWE_Day_Of_Week(juliandate.d)
Prototype.d trueSWE_DegNorm(juliandate.d)
Prototype.d trueSWE_date_conversion(annee.l,mois.l,jour.l,heure.d,cal.b,tjd.d)
Prototype.l trueSWE_Calc_ut(tjd.d,ipl.l,Iflag.l,*x,serr.s)
Prototype.s trueSWE_set_ephe_path(Path.s)
Prototype.l trueSWE_get_planet_name(ipl.l,pName.s)
Prototype.d trueSWE_deltat(tjd.d)
Prototype.l trueSWE_pheno(tjd.d,ipl.l,Iflag.l,*attr,serr.s)
Prototype.l trueSWE_rise_trans(tjd.d,ipl.l,starname.s,epheflag.l,rsmi.l,*geopos,atpress.d,attemp.d,*tret,serr.s)
Prototype.l trueSWE_houses_ex(tjd.d,Iflag.l,geolat.d,geolon.d,ihsy.l,*cusp,*ascmc)
Prototype.d trueSWE_sidtime(tjd.d)
Prototype.l trueSWE_houses_armc(armc.d,geolat.d,eps.d,ihsy.l,*cusp,*ascmc)

;######Prototype.d SWE_JulDay(annee.l,mois.l,jour.l,heure.d,flag.l)
Global SWE_RevJul.trueSWE_RevJul = 0
Global SWE_Day_Of_Week.trueSWE_Day_Of_Week = 0
Global SWE_DegNorm.trueSWE_DegNorm = 0
Global SWE_date_conversion.trueSWE_date_conversion = 0
Global SWE_Calc_ut.trueSWE_Calc_ut = 0
Global SWE_set_ephe_path.trueSWE_set_ephe_path = 0
Global SWE_get_planet_name.trueSWE_get_planet_name = 0
Global SWE_deltat.trueSWE_deltat = 0
Global SWE_pheno.trueSWE_pheno = 0
Global SWE_rise_trans.trueSWE_rise_trans = 0
Global SWE_houses_ex.trueSWE_houses_ex = 0
Global SWE_sidtime.trueSWE_sidtime = 0
Global SWE_houses_armc.trueSWE_houses_armc = 0
;################### premier mode ###############################
;If OpenLibrary(1,path+"swedll32.dll")
; JulDay.SWE_JulDay = GetFunction(1,"_swe_julday@24")
; RevJul.SWE_RevJul = GetFunction(1,"_swe_revjul@28")
; Day_Of_Week.SWE_Day_Of_Week = GetFunction(1,"_swe_day_of_week@8")
; DegNorm.SWE_DegNorm = GetFunction(1,"_swe_degnorm@8")
; Date_conversion.SWE_date_conversion = GetFunction(1,"_swe_date_conversion@28")
; Calc_ut.SWE_Calc_ut= GetFunction(1,"_swe_calc_ut@24")
; set_ephe_path.SWE_set_ephe_path= GetFunction(1,"_swe_set_ephe_path@4")
; get_planet_name.SWE_get_planet_name= GetFunction(1,"_swe_get_planet_name@8")
; deltat.SWE_deltat= GetFunction(1,"_swe_deltat@8")
; pheno.SWE_pheno= GetFunction(1,"_swe_pheno@24")
; rise_trans.SWE_rise_trans= GetFunction(1,"_swe_rise_trans@52")
; houses_ex.SWE_houses_ex= GetFunction(1,"_swe_houses_ex@40")
; sidtime.SWE_sidtime= GetFunction(1,"_swe_sidtime@8")
; houses_armc.SWE_houses_armc= GetFunction(1,"_swe_houses_armc@36")
; Else
;MessageRequester("Error!","Can't open library!",#MB_ICONERROR)
;End
;;EndIf
;################################################################
;################### deuxieme mode ##############################
Import "swedll32.lib"
  julday.d(annee.l,mois.l,jour.l,heure.d,flag.l) As "_swe_julday@24"
  RevJul(juliandate.d,flag.l,annee.l,mois.l,jour.l,heure.l) As "_swe_revjul@28"
  Day_Of_Week.l(juliandate.d) As "_swe_day_of_week@8"
  DegNorm.d(juliandate.d) As "_swe_degnorm@8"
  Date_conversion.l(annee.l,mois.l,jour.l,heure.d,cal.b,tjd.d) As "_swe_date_conversion@28"
  Calc_ut.l(tjd.d,ipl.l,Iflag.l,*x,serr.s) As "_swe_calc_ut@24";il ne faut pas mettre x sous forme de tableau. ????
  set_ephe_path(Path.s) As "_swe_set_ephe_path@4"
  get_planet_name(ipl.l,pName.s) As "_swe_get_planet_name@8"
  deltat(tjd.d) As "_swe_deltat@8"
  pheno.l(tjd.d,ipl.l,Iflag.l,*attr,serr.s) As "_swe_pheno@24"
  rise_trans.l(tjd.d,ipl.l,starname.s,epheflag.l,rsmi.l,*geopos,atpress.d,attemp.d,*tret,serr.s) As "_swe_rise_trans@52"
  houses_ex.l(tjd.d,Iflag.l,geolat.d,geolon.d,ihsy.l,*cusp,*ascmc) As "_swe_houses_ex@40"
  sidtime.d(tjd.d) As "_swe_sidtime@8"
  houses_armc.l(armc.d,geolat.d,eps.d,ihsy.l,*cusp,*ascmc) As "_swe_houses_armc@36"
EndImport

;##################### date actuelle ############################
annee=Year(Date())
jour=Day(Date())
mois=Month(Date())
Global WinW.l,WinH.l,WinX.l,WinY.l,OldW.l,OldH.l

WinW=915
WinH=495
WinX=(GetSystemMetrics_(#SM_CXSCREEN)-WinW)/2
WinY=(GetSystemMetrics_(#SM_CYSCREEN)-WinH)/2
OldW=WinW
OldH=WinH

Form1_hWnd=OpenWindow (0 , WinX, WinY,WinW, WinH, " Calcul d'Ephémérides pour Oh GMT  par Périodes de 32 Jours depuis la date choisie" , #PB_Window_ScreenCentered|#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_SizeGadget )
SendMessage_(WindowID(0),#WM_SETICON,#False,CatchImage(0,?ephe_ico_Start)) ;icone dans la barre de titre
If Form1_hWnd = 0 : End : EndIf

Global OffW.f : OffW=1
Global OffH.f : OffH=1

Procedure DrawGadgets()
  PoliceID=LoadFont(1,"Arial",6*OffW) ;on peut utilise OffH mais seulement pour les ecran 16/9
  ListIconGadget (100, 5*OffW, 5*OffH, 905*OffW,440*OffH, "Js" ,21*OffW,#PB_ListIcon_GridLines)
  SetGadgetFont(100, PoliceID)
  AddGadgetColumn (100, 1, "Date 0h" , 45*OffW)
  AddGadgetColumn (100, 2, "GMT TU" , 48*OffW)
  AddGadgetColumn (100, 3, "Soleil" , 65*OffW)
  AddGadgetColumn (100, 4, "Lune" , 65*OffW)
  AddGadgetColumn (100, 5, "Mercure" , 58*OffW)
  AddGadgetColumn (100, 6, "Venus" , 58*OffW)
  AddGadgetColumn (100, 7, "Mars" , 58*OffW)
  AddGadgetColumn (100, 8, "Jupiter" , 58*OffW)
  AddGadgetColumn (100, 9, "Saturne" , 58*OffW)
  AddGadgetColumn (100, 10, "Uranus" , 58*OffW)
  AddGadgetColumn (100, 11, "Neptune" , 58*OffW)
  AddGadgetColumn (100, 12, "Pluton" , 58*OffW)
  AddGadgetColumn (100, 13, "NdnMoy" , 58*OffW)
  AddGadgetColumn (100, 14, "NdnVrai" , 58*OffW)
  AddGadgetColumn (100, 15, "LilithM" ,58*OffW)
  ComboBoxGadget(2,340*OffW,455*OffH,37*OffW,20,#PB_ComboBox_Editable)
  For x = 1 To 31
    AddGadgetItem(2,-1,Str(x))     ;Jour
  Next
  SetGadgetState(2,jour-1)
  ComboBoxGadget(3,380*OffW,455*OffH,37*OffW,20,#PB_ComboBox_Editable)
  For x = 1 To 12
    AddGadgetItem(3,-1,Str(x))     ;mois
  Next
  SetGadgetState(3,mois-1)
  ComboBoxGadget(4,420*OffW,455*OffH,48*OffW,20,#PB_ComboBox_Editable)
  For x = 1 To 2300           
    AddGadgetItem(4,-1,Str(x))    ;année
  Next
  SetGadgetState(4, Abs(annee-1))
  ;########################### boutons ############################
  ButtonGadget(5, 60*OffW, 455*OffH, 115*OffW, 25*OffH, "Quitter")
  ButtonGadget(6, 200*OffW, 455*OffH, 115*OffW, 25*OffH, "Imprimer")
  ButtonGadget(7, 500*OffW, 455*OffH, 115*OffW, 25*OffH, "Effacer")
  ButtonGadget(8, 640*OffW, 455*OffH, 115*OffW, 25*OffH, "Confirmer")
  ;########################### titres #############################
  TextGadget(22, 340*OffW, 477*OffH, 40*OffW, 20*OffH, "Jour")
  TextGadget(23, 380*OffW, 477*OffH, 40*OffW, 20*OffH, "Mois")
  TextGadget(24, 420*OffW, 477*OffH, 50*OffW, 20*OffH, "Année")
  ;################################################################
EndProcedure

DrawGadgets()

Repeat
  Event=WaitWindowEvent()
  NewW=WindowWidth(0) : NewH=WindowHeight(0)
  If NewW<>OldW Or NewH<>OldH
    OldW=NewW : OldH=NewH
    OffW=NewW/WinW : OffH=NewH/WinH
    DrawGadgets()
    jour.l=Val(GetGadgetText(2))
    mois.l=Val(GetGadgetText(3))
    annee.l=Val(GetGadgetText(4))
    calcul()
  EndIf
  If Event = #PB_Event_Gadget Or Event = #PB_Event_Menu
    
    Select EventGadget()
      Case 5
        CloseWindow(0) :  quit = 1
      Case 6
        yhaut = 300
        xleft = 200
        p=0
        If PrintRequester()
          If StartPrinting("Ephemeride ")
            Font=ycm(((4*0.090)/2.5))
            LoadFont(0,"Arial",Font)
            If StartDrawing(PrinterOutput())
              DrawingFont(FontID(0))
              For n=0 To CountGadgetItems(100)
                yhaut=yhaut+(Font*1.5)
                DrawText(xleft,yhaut,GetGadgetItemText(100,n-1,0))
                DrawText(xleft+xcm(8*0.035),yhaut,"| "+GetGadgetItemText(100,n-1,1))
                DrawText(xleft+xcm(34*0.035),yhaut,"| "+GetGadgetItemText(100,n-1,2))
                DrawText(xleft+xcm(62*0.035),yhaut,"| "+GetGadgetItemText(100,n-1,3))
                DrawText(xleft+xcm(106*0.035),yhaut,"| "+GetGadgetItemText(100,n-1,4))
                DrawText(xleft+xcm(148*0.035),yhaut,"| "+GetGadgetItemText(100,n-1,5))
                DrawText(xleft+xcm(186*0.035),yhaut,"| "+GetGadgetItemText(100,n-1,6))
                DrawText(xleft+xcm(224*0.035),yhaut,"| "+GetGadgetItemText(100,n-1,7))
                DrawText(xleft+xcm(262*0.035),yhaut,"| "+GetGadgetItemText(100,n-1,8))
                DrawText(xleft+xcm(300*0.035),yhaut,"| "+GetGadgetItemText(100,n-1,9))
                DrawText(xleft+xcm(338*0.035),yhaut,"| "+GetGadgetItemText(100,n-1,10))
                DrawText(xleft+xcm(376*0.035),yhaut,"| "+GetGadgetItemText(100,n-1,11))
                DrawText(xleft+xcm(414*0.035),yhaut,"| "+GetGadgetItemText(100,n-1,12))
                DrawText(xleft+xcm(452*0.035),yhaut,"| "+GetGadgetItemText(100,n-1,13))
                DrawText(xleft+xcm(490*0.035),yhaut,"| "+GetGadgetItemText(100,n-1,14))
                DrawText(xleft+xcm(528*0.035),yhaut,"| "+GetGadgetItemText(100,n-1,15))
                If yhaut>ycm(780*0.035)   
                  p=p+1                 ; 29.7cm/848pixels=0.035 - 21.0cm/600pixels=0.035             
                  DrawText(xcm(500*0.035),ycm(800*0.035),Str(p))  ;numero de bas page droite
                  NewPrinterPage()
                  yhaut=300
                  DrawText(xleft,yhaut,GetGadgetItemText(100,-1,0))
                  DrawText(xleft+xcm(8*0.035),yhaut,"| "+GetGadgetItemText(100,-1,1))
                  DrawText(xleft+xcm(34*0.035),yhaut,"| "+GetGadgetItemText(100,-1,2))
                  DrawText(xleft+xcm(62*0.035),yhaut,"| "+GetGadgetItemText(100,-1,3))
                  DrawText(xleft+xcm(106*0.035),yhaut,"| "+GetGadgetItemText(100,-1,4))
                  DrawText(xleft+xcm(148*0.035),yhaut,"| "+GetGadgetItemText(100,-1,5))
                  DrawText(xleft+xcm(186*0.035),yhaut,"| "+GetGadgetItemText(100,-1,6))
                  DrawText(xleft+xcm(224*0.035),yhaut,"| "+GetGadgetItemText(100,-1,7))
                  DrawText(xleft+xcm(262*0.035),yhaut,"| "+GetGadgetItemText(100,-1,8))
                  DrawText(xleft+xcm(300*0.035),yhaut,"| "+GetGadgetItemText(100,-1,9))
                  DrawText(xleft+xcm(338*0.035),yhaut,"| "+GetGadgetItemText(100,-1,10))
                  DrawText(xleft+xcm(376*0.035),yhaut,"| "+GetGadgetItemText(100,-1,11))
                  DrawText(xleft+xcm(414*0.035),yhaut,"| "+GetGadgetItemText(100,-1,12))
                  DrawText(xleft+xcm(452*0.035),yhaut,"| "+GetGadgetItemText(100,-1,13))
                  DrawText(xleft+xcm(490*0.035),yhaut,"| "+GetGadgetItemText(100,-1,14))
                  DrawText(xleft+xcm(528*0.035),yhaut,"| "+GetGadgetItemText(100,-1,15))
                EndIf 
              Next n
              p=p+1
              DrawText(xcm(500*0.035),ycm(800*0.035),Str(p))  ;numero de derniere page
              StopDrawing()
            EndIf
            StopPrinting()
          EndIf
        EndIf
      Case 7
        ClearGadgetItems(100) 
      Case 8
        jour.l=Val(GetGadgetText(2))
        mois.l=Val(GetGadgetText(3))
        annee.l=Val(GetGadgetText(4))
        calcul()
      Case #PB_Event_CloseWindow
        CloseWindow(0) :  quit = 1
    EndSelect
  EndIf
Until quit = 1
End
Procedure calcul()
  annees=annee
  moiss=mois
  jours=jour
  For ii=0 To 31
    Iflag=#SEFLG_SWIEPH+#SEFLG_SPEED
    heure=0
    tjd_ut.d=julday(annee,mois,jour,heure,#SE_JUL_CAL)
    tsidtu.d=sidtime(tjd_ut)
    For nplanete=#SE_SUN To #SE_INTP_PERG
      Calc_ut(tjd_ut, nplanete, Iflag, @x.d(0),serr.s)
      Position(nplanete)=x(0)
      If x(3) < 0
        retro(nplanete)= "r"
      Else
        retro(nplanete)= " "
      EndIf
      If nplanete<14
        signepl(nplanete)=Int(Position(nplanete)/30); nmsigne
        degrepl(nplanete)=Str(Int((Position(nplanete)-(signepl(nplanete)*30))))
        minutpl(nplanete)=Str((Position(nplanete)-Int(Position(nplanete)))*60)
        seconpl(nplanete)=Str(Int((((Position(nplanete)-Int(Position(nplanete)))*60)-Int((Position(nplanete)-Int(Position(nplanete)))*60))*60))
      EndIf
    Next nplanete
    jd1.d = julday(annee,mois,jour,heure,#SE_JUL_CAL)
    Select Day_Of_Week( jd1 )
      Case 0: ;"Lundi"
        journ="Lu"
      Case 1: ;"Mardi"
        journ="Ma"
      Case 2: ;"Mercredi"
        journ="Me"
      Case 3: ;"Jeudi"
        journ="Je"
      Case 4: ;"Vendredi"
        journ="Ve"
      Case 5: ;"Samedi"
        journ="Sa"
      Case 6: ;"Dimanche"
        journ="Di"
    EndSelect
    ; mise a jour des conversion pour petit bug sur quelques resultats du temps universel
    hdms=Str(Int(tsidtu))
    If Len(hdms)<2:hdms="0"+hdms:EndIf
    
    mdms=StrD(dms(tsidtu))
    mdms=Left(StringField(mdms,2,"."),2)
    If Len(mdms)<2:mdms="0"+mdms:EndIf
    
    sdms=StrD(dms(tsidtu),4)
    sdms=Right(StringField(sdms,2,"."),2)
    If Len(sdms)<2:sdms="0"+sdms:EndIf
    
    
    degrepl(0)=Right(Str(Val(degrepl(0)) + 100) , 2)
    minutpl(0)=Right(Str(Val(minutpl(0)) + 100) , 2)
    seconpl(0)=Right(Str(Val(seconpl(0)) + 100) , 2)
    coltx(0)=degrepl(0)+"° "+minutpl(0)+"' "+seconpl(0)+"' "+zod(signepl(0))
    degrepl(1)=Right(Str(Val(degrepl(1)) + 100) , 2)
    minutpl(1)=Right(Str(Val(minutpl(1)) + 100) , 2)
    seconpl(1)=Right(Str(Val(seconpl(1)) + 100) , 2)
    coltx(1)=degrepl(1)+"° "+minutpl(1)+"' "+seconpl(1)+"' "+zod(signepl(1))
    degrepl(2)=Right(Str(Val(degrepl(2)) + 100) , 2):minutpl(2)=Right(Str(Val(minutpl(2)) + 100) , 2)
    coltx(2)=degrepl(2)+"° "+minutpl(2)+"' "+retro(2)+" "+zod(signepl(2))
    degrepl(3)=Right(Str(Val(degrepl(3)) + 100) , 2):minutpl(3)=Right(Str(Val(minutpl(3)) + 100) , 2)
    coltx(3)=degrepl(3)+"° "+minutpl(3)+"' "+retro(3)+" "+zod(signepl(3))
    degrepl(4)=Right(Str(Val(degrepl(4)) + 100) , 2):minutpl(4)=Right(Str(Val(minutpl(4)) + 100) , 2)
    coltx(4)=degrepl(4)+"° "+minutpl(4)+"' "+retro(4)+" "+zod(signepl(4))
    degrepl(5)=Right(Str(Val(degrepl(5)) + 100) , 2):minutpl(5)=Right(Str(Val(minutpl(5)) + 100) , 2)
    coltx(5)=degrepl(5)+"° "+minutpl(5)+"' "+retro(5)+" "+zod(signepl(5))
    degrepl(6)=Right(Str(Val(degrepl(6)) + 100) , 2):minutpl(6)=Right(Str(Val(minutpl(6)) + 100) , 2)
    coltx(6)=degrepl(6)+"° "+minutpl(6)+"' "+retro(6)+" "+zod(signepl(6))
    degrepl(7)=Right(Str(Val(degrepl(7)) + 100) , 2):minutpl(7)=Right(Str(Val(minutpl(7)) + 100) , 2)
    coltx(7)=degrepl(7)+"° "+minutpl(7)+"' "+retro(7)+" "+zod(signepl(7))
    degrepl(8)=Right(Str(Val(degrepl(8)) + 100) , 2):minutpl(8)=Right(Str(Val(minutpl(8)) + 100) , 2)
    coltx(8)=degrepl(8)+"° "+minutpl(8)+"' "+retro(8)+" "+zod(signepl(8))
    degrepl(9)=Right(Str(Val(degrepl(9)) + 100) , 2):minutpl(9)=Right(Str(Val(minutpl(9)) + 100) , 2)
    coltx(9)=degrepl(9)+"° "+minutpl(9)+"' "+retro(9)+" "+zod(signepl(9))
    degrepl(10)=Right(Str(Val(degrepl(10)) + 100) , 2):minutpl(10)=Right(Str(Val(minutpl(10)) + 100) , 2)
    coltx(10)=degrepl(10)+"° "+minutpl(10)+"' "+retro(10)+" "+zod(signepl(10))
    degrepl(11)=Right(Str(Val(degrepl(11)) + 100) , 2):minutpl(11)=Right(Str(Val(minutpl(11)) + 100) , 2)
    coltx(11)=degrepl(11)+"° "+minutpl(11)+"' "+retro(11)+" "+zod(signepl(11))
    degrepl(12)=Right(Str(Val(degrepl(12)) + 100) , 2):minutpl(12)=Right(Str(Val(minutpl(12)) + 100) , 2)
    coltx(12)=degrepl(12)+"° "+minutpl(12)+"' "+retro(12)+" "+zod(signepl(12))
    coltx(13)=journ
    coltx(14)=Right(Str(jour + 100) , 2)+"/"+Right(Str(mois + 100) , 2)+"/"+Right(Str(annee) , 2)
    coltx(15)=hdms+"h"+t$+mdms+"'"+t$+sdms+"'"
    If coltx(13)="Di"
      AddGadgetItem(100, -1, ""+ Chr(10) +""+ Chr(10) + ""+ Chr(10)+""+ Chr(10) +""+ Chr(10) +""+ Chr(10) +""+ Chr(10) +""+Chr(10) +""+ Chr(10) +""+Chr(10) +""+Chr(10) +""+ Chr(10) +""+Chr(10) +""+Chr(10) +""+ Chr(10) +"")
      AddGadgetItem(100, -1, coltx(13)+ Chr(10) + coltx(14)+ Chr(10) + coltx(15)+ Chr(10)+coltx(0)+ Chr(10) + coltx(1)+ Chr(10) + coltx(2)+ Chr(10) + coltx(3)+ Chr(10) + coltx(4)+Chr(10) + coltx(5)+ Chr(10) + coltx(6)+Chr(10) + coltx(7)+Chr(10) + coltx(8)+ Chr(10) + coltx(9)+Chr(10) + coltx(10)+Chr(10) + coltx(11)+ Chr(10) + coltx(12))
    Else
      AddGadgetItem(100, -1, coltx(13)+ Chr(10) + coltx(14)+ Chr(10) + coltx(15)+ Chr(10)+coltx(0)+ Chr(10) + coltx(1)+ Chr(10) + coltx(2)+ Chr(10) + coltx(3)+ Chr(10) + coltx(4)+Chr(10) + coltx(5)+ Chr(10) + coltx(6)+Chr(10) + coltx(7)+Chr(10) + coltx(8)+ Chr(10) + coltx(9)+Chr(10) + coltx(10)+Chr(10) + coltx(11)+ Chr(10) + coltx(12))
    EndIf
    RevJul( jd1+1, #SE_JUL_CAL, @annee.l, @mois.l, @jour.l, @heure.d)
  Next ii
  annee=annees
  mois=moiss
  jour=jours
  
EndProcedure   
;################################################################
DataSection
  zodiaque:       ;  offset police des astres et objets celeste
  Data.s "Bel","Tau","Gem","Can","Lio","Vie","Bal","Sco","Sag","Cap","Ver","Poi"
EndDataSection

;################################################################
;  IncludeBinary "ephe.ico" [?ephe_ico_Start , ?ephe_ico_End]
;{ Size = 766 bytes
DataSection
  ; PureBin2Data header
  Data.l 766
  Data.b 0
  ; Data
  ephe_ico_Start:
  Data.l $00010000,$20200001,$00010010,$02E80004,$00160000,$00280000,$00200000,$00400000,$00010000,$00000004,$02800000,$00000000
  Data.l $00000000,$00000000,$00000000,$00000000,$00000000,$80000080,$80000000,$00800080,$00800000,$80800080,$80800000,$C0C00080
  Data.l $000000C0,$FF0000FF,$FF000000,$00FF00FF,$00FF0000,$FFFF00FF,$FFFF0000,$000000FF,$77770000,$77777777,$00000070,$00000000
  Data.l $70000000,$00707070,$00000070,$00000000,$07000000,$00000707,$00000070,$00000000,$70000000,$00707070,$00000070,$00000000
  Data.l $00000000,$00000000,$00000070,$00000000,$78000000,$00F0F878,$00000077,$00000000,$88780000,$F0888888,$00007007,$00000000
  Data.l $00887800,$88080000,$000077F0,$00000000,$0F008807,$0800FFFF,$0070078F,$00000000,$FF0F8078,$00FFFFF0,$0070F088,$00000000
  Data.l $FFFF0888,$FF0FFFF0,$00778008,$07000000,$0FFF0F80,$FF0FF8F0,$00078F00,$08000000,$FFFFF880,$FFFFF0FF,$700788F0,$78000000
  Data.l $FF0F8F00,$0FFF80FF,$77F008F0,$88000070,$FFFFF808,$FFFF0FFF,$008008FF,$78000077,$FF8F8F0F,$FFFF0FF8,$88F008FF,$88000007
  Data.l $FF0F0008,$00FF8F80,$0080080F,$78000007,$F8FF8F0F,$FFFF980F,$88F008FF,$88000000,$808FF808,$FF8FF9FF,$008008FF,$78000000
  Data.l $0F0F8F00,$0F98FFFF,$00F008F0,$08000000,$FFF88880,$8FF9FF8F,$000788F0,$07000000,$08F80880,$9F0F8FF0,$00008F00,$00000000
  Data.l $8F8F0888,$FFFFFFF0,$00708008,$00000000,$F8088078,$008F8F80,$0000F088,$00000000,$08008807,$0800F8F8,$00000087,$00000000
  Data.l $00887800,$88080000,$00000070,$00000000,$88780000,$70888888,$00000000,$00000000,$78000000,$00707878,$00000070,$00000000
  Data.l $00000000,$00000000,$00000070,$00000000,$70000000,$00707070,$00000070,$00000000,$07000000,$00000707,$00000070,$00000000
  Data.l $70000000,$00707070,$00000000,$00FF0000,$00FEFF07,$00FEFF07,$00FEFF07,$00FEFF07,$00FEFF07,$00FCFF03,$00F8FF01,$00F0FF00
  Data.l $00E07F00,$00E07F00,$00C03F00,$00C03F00,$00801F00,$00800700,$00800300,$00800300,$00800300,$00800700,$00800F00,$00C03F00
  Data.l $00C03F00,$00E07F00,$00E07F00,$00F0FF00,$00F8FF01,$00FCFF03,$00FEFF07,$00FEFF07,$00FEFF07,$00FEFF07,$00FEFF07
  Data.b $0F,$FF
  ephe_ico_End:
EndDataSection ;}
Dernière modification par kernadec le ven. 17/janv./2020 15:20, modifié 1 fois.
Avatar de l’utilisateur
MetalOS
Messages : 1509
Inscription : mar. 20/juin/2006 22:17
Localisation : Lorraine
Contact :

Re: Calendrier Astronomique de Poche avec lib suisse en data

Message par MetalOS »

Merci pour cet mise â jour. Super ce code.
Avatar de l’utilisateur
kernadec
Messages : 1606
Inscription : ven. 25/avr./2008 11:14

Re: Calendrier Astronomique de Poche avec lib suisse en data

Message par kernadec »

bonjour MetalOS
je suis heureux que ce code te plaise :D
pour ceux qui souhaiteraient avoir les coordonnées en Ascension Droite avec ce code

Ajouter en début de code la constante:
#SEFLG_EQUATORIAL = 2048

Puis modifier la ligne 350

Code : Tout sélectionner

 Iflag=#SEFLG_SWIEPH+#SEFLG_SPEED|#SEFLG_EQUATORIAL
Cordialement
Avatar de l’utilisateur
MetalOS
Messages : 1509
Inscription : mar. 20/juin/2006 22:17
Localisation : Lorraine
Contact :

Re: Calendrier Astronomique de Poche avec lib suisse en data

Message par MetalOS »

Nikel, j'ai un pote qui fait de l'astronomie ça va lui servir.
Répondre