Changeset 693 for BAORadio


Ignore:
Timestamp:
Sep 13, 2012, 10:00:35 PM (12 years ago)
Author:
frichard
Message:

Version 0.62

Location:
BAORadio/libindi/libindi
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • BAORadio/libindi/libindi/.kdev4/libindi.kdev4

    r492 r693  
    44[CMake]
    55BuildDirs=/home/richard/libindi/libindi_build
    6 CMakeDir=/usr/share/cmake/Modules
     6CMakeDir=/usr/share/cmake-2.8/Modules
    77Current CMake Binary=file:///usr/bin/cmake
    88CurrentBuildDir=file:///home/richard/libindi/libindi_build
  • BAORadio/libindi/libindi/BAOTest/Makefile

    r642 r693  
    2121install:
    2222        cp BAOtest /usr/bin
     23        chmod +x /usr/bin/BAOtest
  • BAORadio/libindi/libindi/BAOcontrol/BAOcontrol.pro

    r691 r693  
    11######################################################################
    2 # Automatically generated by qmake (2.01a) mer. juil. 11 05:34:37 2012
     2# Automatically generated by qmake (2.01a) Thu Sep 13 21:57:57 2012
    33######################################################################
    44
  • BAORadio/libindi/libindi/BAOcontrol/Listener.cpp

    r689 r693  
    3333
    3434using namespace std;
     35
    3536
    3637void Listener::prepareSelectFds(fd_set &read_fds,
  • BAORadio/libindi/libindi/BAOcontrol/Makefile

    r691 r693  
    11#############################################################################
    22# Makefile for building: BAOcontrol
    3 # Generated by qmake (2.01a) (Qt 4.7.4) on: mer. juil. 11 05:34:37 2012
     3# Generated by qmake (2.01a) (Qt 4.8.1) on: Thu Sep 13 21:57:57 2012
    44# Project:  BAOcontrol.pro
    55# Template: app
     
    1111CC            = gcc
    1212CXX           = g++
    13 DEFINES       = -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
     13DEFINES       = -DQT_WEBKIT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
    1414CFLAGS        = -m64 -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
    1515CXXFLAGS      = -m64 -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
    16 INCPATH       = -I/usr/share/qt4/mkspecs/default -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include -I. -I. -I.
     16INCPATH       = -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -I.
    1717LINK          = g++
    1818LFLAGS        = -m64 -Wl,-O1
    19 LIBS          = $(SUBLIBS)  -L/usr/lib64 -lQtGui -L/usr/lib64 -L/usr/X11R6/lib64 -lQtCore -lpthread
     19LIBS          = $(SUBLIBS)  -L/usr/lib/x86_64-linux-gnu -lQtGui -lQtCore -lpthread
    2020AR            = ar cqs
    2121RANLIB        =
     
    9393                moc_qledindicator.o \
    9494                moc_selectstars.o
    95 DIST          = /usr/share/qt4/mkspecs/common/g++.conf \
    96                 /usr/share/qt4/mkspecs/common/unix.conf \
     95DIST          = /usr/share/qt4/mkspecs/common/unix.conf \
    9796                /usr/share/qt4/mkspecs/common/linux.conf \
     97                /usr/share/qt4/mkspecs/common/gcc-base.conf \
     98                /usr/share/qt4/mkspecs/common/gcc-base-unix.conf \
     99                /usr/share/qt4/mkspecs/common/g++-base.conf \
     100                /usr/share/qt4/mkspecs/common/g++-unix.conf \
    98101                /usr/share/qt4/mkspecs/qconfig.pri \
    99                 /usr/share/qt4/mkspecs/modules/qt_phonon.pri \
     102                /usr/share/qt4/mkspecs/modules/qt_webkit_version.pri \
    100103                /usr/share/qt4/mkspecs/features/qt_functions.prf \
    101104                /usr/share/qt4/mkspecs/features/qt_config.prf \
     
    104107                /usr/share/qt4/mkspecs/features/release.prf \
    105108                /usr/share/qt4/mkspecs/features/default_post.prf \
     109                /usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
    106110                /usr/share/qt4/mkspecs/features/warn_on.prf \
    107111                /usr/share/qt4/mkspecs/features/qt.prf \
     
    145149        $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
    146150
    147 Makefile: BAOcontrol.pro  /usr/share/qt4/mkspecs/default/qmake.conf /usr/share/qt4/mkspecs/common/g++.conf \
    148                 /usr/share/qt4/mkspecs/common/unix.conf \
     151Makefile: BAOcontrol.pro  /usr/share/qt4/mkspecs/linux-g++-64/qmake.conf /usr/share/qt4/mkspecs/common/unix.conf \
    149152                /usr/share/qt4/mkspecs/common/linux.conf \
     153                /usr/share/qt4/mkspecs/common/gcc-base.conf \
     154                /usr/share/qt4/mkspecs/common/gcc-base-unix.conf \
     155                /usr/share/qt4/mkspecs/common/g++-base.conf \
     156                /usr/share/qt4/mkspecs/common/g++-unix.conf \
    150157                /usr/share/qt4/mkspecs/qconfig.pri \
    151                 /usr/share/qt4/mkspecs/modules/qt_phonon.pri \
     158                /usr/share/qt4/mkspecs/modules/qt_webkit_version.pri \
    152159                /usr/share/qt4/mkspecs/features/qt_functions.prf \
    153160                /usr/share/qt4/mkspecs/features/qt_config.prf \
     
    156163                /usr/share/qt4/mkspecs/features/release.prf \
    157164                /usr/share/qt4/mkspecs/features/default_post.prf \
     165                /usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
    158166                /usr/share/qt4/mkspecs/features/warn_on.prf \
    159167                /usr/share/qt4/mkspecs/features/qt.prf \
     
    165173                /usr/share/qt4/mkspecs/features/lex.prf \
    166174                /usr/share/qt4/mkspecs/features/include_source_dir.prf \
    167                 /usr/lib64/libQtGui.prl \
    168                 /usr/lib64/libQtCore.prl
     175                /usr/lib/x86_64-linux-gnu/libQtGui.prl \
     176                /usr/lib/x86_64-linux-gnu/libQtCore.prl
    169177        $(QMAKE) -o Makefile BAOcontrol.pro
    170 /usr/share/qt4/mkspecs/common/g++.conf:
    171178/usr/share/qt4/mkspecs/common/unix.conf:
    172179/usr/share/qt4/mkspecs/common/linux.conf:
     180/usr/share/qt4/mkspecs/common/gcc-base.conf:
     181/usr/share/qt4/mkspecs/common/gcc-base-unix.conf:
     182/usr/share/qt4/mkspecs/common/g++-base.conf:
     183/usr/share/qt4/mkspecs/common/g++-unix.conf:
    173184/usr/share/qt4/mkspecs/qconfig.pri:
    174 /usr/share/qt4/mkspecs/modules/qt_phonon.pri:
     185/usr/share/qt4/mkspecs/modules/qt_webkit_version.pri:
    175186/usr/share/qt4/mkspecs/features/qt_functions.prf:
    176187/usr/share/qt4/mkspecs/features/qt_config.prf:
     
    179190/usr/share/qt4/mkspecs/features/release.prf:
    180191/usr/share/qt4/mkspecs/features/default_post.prf:
     192/usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf:
    181193/usr/share/qt4/mkspecs/features/warn_on.prf:
    182194/usr/share/qt4/mkspecs/features/qt.prf:
     
    188200/usr/share/qt4/mkspecs/features/lex.prf:
    189201/usr/share/qt4/mkspecs/features/include_source_dir.prf:
    190 /usr/lib64/libQtGui.prl:
    191 /usr/lib64/libQtCore.prl:
     202/usr/lib/x86_64-linux-gnu/libQtGui.prl:
     203/usr/lib/x86_64-linux-gnu/libQtCore.prl:
    192204qmake:  FORCE
    193205        @$(QMAKE) -o Makefile BAOcontrol.pro
     
    237249                Server.hpp \
    238250                baoqt.h
    239         /usr/bin/moc $(DEFINES) $(INCPATH) baoqt.h -o moc_baoqt.cpp
     251        /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) baoqt.h -o moc_baoqt.cpp
    240252
    241253moc_liste.cpp: liste.h
    242         /usr/bin/moc $(DEFINES) $(INCPATH) liste.h -o moc_liste.cpp
     254        /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) liste.h -o moc_liste.cpp
    243255
    244256moc_map.cpp: ../communs/const.h \
    245257                map.h
    246         /usr/bin/moc $(DEFINES) $(INCPATH) map.h -o moc_map.cpp
     258        /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) map.h -o moc_map.cpp
    247259
    248260moc_qledindicator.cpp: qledindicator.h
    249         /usr/bin/moc $(DEFINES) $(INCPATH) qledindicator.h -o moc_qledindicator.cpp
     261        /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) qledindicator.h -o moc_qledindicator.cpp
    250262
    251263moc_selectstars.cpp: ui_selectstars.h \
    252264                selectstars.h
    253         /usr/bin/moc $(DEFINES) $(INCPATH) selectstars.h -o moc_selectstars.cpp
     265        /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) selectstars.h -o moc_selectstars.cpp
    254266
    255267compiler_rcc_make_all:
     
    264276        -$(DEL_FILE) ui_baoqt.h ui_liste.h ui_map.h ui_selectstars.h
    265277ui_baoqt.h: baoqt.ui
    266         /usr/bin/uic baoqt.ui -o ui_baoqt.h
     278        /usr/bin/uic-qt4 baoqt.ui -o ui_baoqt.h
    267279
    268280ui_liste.h: liste.ui
    269         /usr/bin/uic liste.ui -o ui_liste.h
     281        /usr/bin/uic-qt4 liste.ui -o ui_liste.h
    270282
    271283ui_map.h: map.ui
    272         /usr/bin/uic map.ui -o ui_map.h
     284        /usr/bin/uic-qt4 map.ui -o ui_map.h
    273285
    274286ui_selectstars.h: selectstars.ui
    275         /usr/bin/uic selectstars.ui -o ui_selectstars.h
     287        /usr/bin/uic-qt4 selectstars.ui -o ui_selectstars.h
    276288
    277289compiler_yacc_decl_make_all:
  • BAORadio/libindi/libindi/BAOcontrol/baocontrol.cpp

    r691 r693  
    2121    float a1, a2, a3;
    2222   
    23     char Version[200];
     23    char *Version;
    2424
    2525    // Le choix de la couleur des caractÚres est adapté pour une fenêtre de terminal
     
    2929
    3030    // Affichage de la version du programme
     31   
     32    Version = new char[1000];
    3133
    3234    sprintf(Version,"\n\n\n\n\n \
     
    4042   
    4143    AfficherLog(Version, true);
     44   
     45    delete [] Version;
    4246
    4347
     
    240244
    241245    Connect(true);
     246   
    242247}
    243248
     
    12911296    }
    12921297
    1293     AfficherLog("Les paramÚtres de l'alignemeent ont bien été sauvegardés.\n\n", true);
     1298    AfficherLog("Les paramÚtres de l'alignement ont bien été sauvegardés.\n\n", true);
    12941299
    12951300    return true;
  • BAORadio/libindi/libindi/BAOcontrol/baoqt.cpp

    r691 r693  
    55
    66
    7 
    87BAOqt::BAOqt(QWidget *parent) :
    98    QDialog(parent),
     
    1110    ui(new Ui::BAOqt)
    1211{
    13     QPoint pointPos;
     12 
     13  QPoint pointPos;
    1414
    1515    RechercheOptimisation = false;
     
    2121    last_pos[2] = current_pos[2] = desired_pos[2] = 0.0;
    2222    next_pos_time = -0x8000000000000000LL;
    23 
    2423
    2524    bao = new BAOcontrol();
     
    113112#endif
    114113
    115     ui->lineEditIP->setText("127.0.0.1");
    116     //ui->lineEditIP->setText("134.158.88.199");
     114    //ui->lineEditIP->setText("127.0.0.1");
     115    ui->lineEditIP->setText("134.158.88.199");
    117116   
    118117    ui->lineEdit_2->setText((QString("BAORadio, LAL, version ").append(VERSION)).toStdString().c_str());
     
    293292
    294293#ifdef JOYSTICK
     294   
    295295    joy++;
    296296
  • BAORadio/libindi/libindi/LancementBAOcontrol.sh

    r643 r693  
    44
    55xterm -ge 150x40 -e indiserver indi_BAO&
     6
    67sleep 1
    78
  • BAORadio/libindi/libindi/Makefile

    r691 r693  
    1414CFLAGS        = -m64 -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
    1515CXXFLAGS      = -m64 -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
    16 INCPATH       = -I/usr/share/qt4/mkspecs/default -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include -I. -Ilibs -IBAOcontrol -Icommuns -Ilibs/indibase -Iexamples -Idrivers/ccd -Idrivers/filter_wheel -Idrivers/focuser -Idrivers/telescope -Idrivers/video -Ilibs/webcam -IIndi_Stellarium/src -I. -I.
     16INCPATH       = -I/usr/share/qt4/mkspecs/default -I/usr/include/qt4 -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include -I. -Ilibs -IBAOcontrol -Icommuns -Ilibs/indibase -Iexamples -Idrivers/ccd -Idrivers/filter_wheel -Idrivers/focuser -Idrivers/telescope -Idrivers/video -Ilibs/webcam -IIndi_Stellarium/src -I. -I.
    1717LINK          = g++
    1818LFLAGS        = -m64 -Wl,-O1
  • BAORadio/libindi/libindi/bao.sh

    r691 r693  
    5959make
    6060cp BAOcontrol /usr/bin
     61chmod +x /usr/bin/BAOcontrol
    6162echo ;
    6263echo ;
  • BAORadio/libindi/libindi/communs/alignement.cpp

    r691 r693  
    99
    1010#include "alignement.h"
    11 #include <QtCore/qcoreevent.h>
    12 
     11//#include <QtCore/qcoreevent.h>
    1312
    1413/**************************************************************************************
     
    738737    double I2 = -2.0 * ED * sqrt( CD2pBC2 ) * sin(  ( targetAlt - Theta ) * Pidiv180 );
    739738
    740     I2 += ED * ED + CD2pBC2 - AE *AE;
     739    I2 += ED * ED + CD2pBC2 - AE * AE;
    741740
    742741    double Codalt = ( sqrt(I2) - I0 ) / CoeffMoteur;
     
    749748    double CD2pBC2 = CD * CD + BC * BC;
    750749
    751     double I2=pow((CoeffMoteur * pas + I0) ,2.0);
    752 
    753     I2 -= ED *ED + CD2pBC2 -AE*AE;
    754 
    755     double angle = asin(I2/( -2.0*ED*sqrt(CD2pBC2)))*N180divPi+Theta;
     750    double I2 = pow(( CoeffMoteur * pas + I0 ) ,2.0);
     751
     752    I2 -= ED * ED + CD2pBC2 - AE * AE;
     753
     754    double angle = asin( I2 / ( -2.0 * ED * sqrt(CD2pBC2) )) * N180divPi + Theta;
    756755
    757756    return angle;
    758757}
    759758
    760 void Alignement::OptimisationGeometrieAntenne()
     759void Alignement::OptimisationGeometrieAntenne(bool Chercher)
    761760{
    762761    Coord c1, c2, c3, c4, m1, m2, m3, mm1, mm2, mm3, mm,mmm, result;
     
    776775    double det;
    777776
    778     double maxdet= 0.1;
    779 
    780     double distmax2=1e50;
     777    double maxdet = 0.1;
     778
     779    double distmax2 = 1e50;
    781780
    782781    double pas = 1.0; //0.1
     
    784783    double interv = 20.0; //0.5
    785784
    786     InitParametresInstrument();
    787 
    788    /* for (int i=0; i<nbrcorrections; i++)
    789     {
    790         Precession(&ad[i], &de[i]);
    791        NutationEtoile(&ad[i], &de[i]);
    792 
    793         AberrationAnnuelle(&ad[i], &de[i]);
    794        
    795         Precession(&delta_ad[i], &delta_de[i]);
    796        NutationEtoile(&delta_ad[i], &delta_de[i]);
    797 
    798         AberrationAnnuelle(&delta_ad[i], &delta_de[i]);
    799     }*/
     785
     786
     787    /* for (int i=0; i<nbrcorrections; i++)
     788     {
     789         Precession(&ad[i], &de[i]);
     790        NutationEtoile(&ad[i], &de[i]);
     791
     792         AberrationAnnuelle(&ad[i], &de[i]);
     793
     794    Precession(&delta_ad[i], &delta_de[i]);
     795        NutationEtoile(&delta_ad[i], &delta_de[i]);
     796
     797         AberrationAnnuelle(&delta_ad[i], &delta_de[i]);
     798     }*/
    800799
    801800    c1.x = VerifAngle(ad[0] - tsl[0] + GetTSL());
     
    831830    m3.x = VerifAngle(delta_ad[2] - tsl[2] + GetTSL());
    832831    m3.y = delta_de[2];
    833    
    834     CoeffMoteur = CoeffMoteur0;
    835 
    836    //  for (i=-interv; i< interv; i += pas)
    837     {
    838         I0 = I00 ;//+ i ;
    839 
    840         for (j=-interv; j<interv; j += pas)
     832
     833
     834    if (Chercher)
     835    {
     836        InitParametresInstrument();
     837
     838        CoeffMoteur = CoeffMoteur0;
     839
     840        //  for (i=-interv; i< interv; i += pas)
    841841        {
    842             ED = ED0 + j;
    843 
    844             for (k=-interv; k<interv; k += pas)
     842            I0 = I00 ;//+ i ;
     843
     844            for (j=-interv; j<interv; j += pas)
    845845            {
    846                 CD = CD0 + k;
    847 
    848                 for (l=-interv; l < interv; l+= pas)
     846                ED = ED0 + j;
     847
     848                for (k=-interv; k<interv; k += pas)
    849849                {
    850                     BC = BC0 + l;
    851 
    852                     Theta = (atan(CD / BC) - atan(18.5 / ED)) * N180divPi;
    853 
    854                     for (m=-interv; m< interv; m += pas)
     850                    CD = CD0 + k;
     851
     852                    for (l=-interv; l < interv; l+= pas)
    855853                    {
    856                         AE = AE0 + m;
    857 
    858                         Azimut(m1.x, m1.y, &mm.x, &mm.y);
    859 
    860                         mm.y = Motor2Alt2(Alt2Motor(mm.y * N180divPi)) * Pidiv180;
    861 
    862                         mm1.x = cos(mm.x) * cos(mm.y);
    863                         mm1.y = sin(mm.x) * cos(mm.y);
    864                         mm1.z = sin(mm.y);
    865 
    866                         Azimut(m2.x, m2.y, &mm.x, &mm.y);
    867 
    868                         mm.y = Motor2Alt2(Alt2Motor(mm.y * N180divPi)) * Pidiv180;
    869 
    870                         mm2.x = cos(mm.x) * cos(mm.y);
    871                         mm2.y = sin(mm.x) * cos(mm.y);
    872                         mm2.z = sin(mm.y);
    873 
    874                         Azimut(m3.x, m3.y, &mm.x, &mm.y);
    875 
    876                         mm.y = Motor2Alt2(Alt2Motor(mm.y * N180divPi)) * Pidiv180;
    877 
    878                         mm3.x = cos(mm.x) * cos(mm.y);
    879                         mm3.y = sin(mm.x) * cos(mm.y);
    880                         mm3.z = sin(mm.y);
    881 
    882                         // Calcul de la matrice de correction en fonction de la méthode d'alignement
    883 
    884                         Matrice_ok = ElementsMatriceSimple(c1, c2, c3 ,mm1, mm2, mm3);
    885 
    886                         det = Determinant();
    887 
    888 
    889 
    890                         if ( fabs(det - 1.0) <= 0.08/*maxdet*/ )
     854                        BC = BC0 + l;
     855
     856                        Theta = (atan(CD / BC) - atan(18.5 / ED)) * N180divPi;
     857
     858                        for (m=-interv; m< interv; m += pas)
    891859                        {
    892 
    893                             double targetAz, targetAlt;
    894                             double distmax=0.0;
    895                             double dist;
    896 
    897                             for (int n=0; n<nbrcorrections; n++)
     860                            AE = AE0 + m;
     861
     862                            Azimut(m1.x, m1.y, &mm.x, &mm.y);
     863
     864                            mm.y = Motor2Alt2(Alt2Motor(mm.y * N180divPi)) * Pidiv180;
     865
     866                            mm1.x = cos(mm.x) * cos(mm.y);
     867                            mm1.y = sin(mm.x) * cos(mm.y);
     868                            mm1.z = sin(mm.y);
     869
     870                            Azimut(m2.x, m2.y, &mm.x, &mm.y);
     871
     872                            mm.y = Motor2Alt2(Alt2Motor(mm.y * N180divPi)) * Pidiv180;
     873
     874                            mm2.x = cos(mm.x) * cos(mm.y);
     875                            mm2.y = sin(mm.x) * cos(mm.y);
     876                            mm2.z = sin(mm.y);
     877
     878                            Azimut(m3.x, m3.y, &mm.x, &mm.y);
     879
     880                            mm.y = Motor2Alt2(Alt2Motor(mm.y * N180divPi)) * Pidiv180;
     881
     882                            mm3.x = cos(mm.x) * cos(mm.y);
     883                            mm3.y = sin(mm.x) * cos(mm.y);
     884                            mm3.z = sin(mm.y);
     885
     886                            // Calcul de la matrice de correction en fonction de la méthode d'alignement
     887
     888                            Matrice_ok = ElementsMatriceSimple(c1, c2, c3 ,mm1, mm2, mm3);
     889
     890                            det = Determinant();
     891
     892
     893
     894                            if ( fabs(det - 1.0) <= 0.08/*maxdet*/ )
    898895                            {
    899                                 Azimut(VerifAngle(ad[n] - tsl[n] + GetTSL()),  de[n], &mmm.x, &mmm.y);
    900 
    901                                 mmm.y = Motor2Alt(Alt2Motor2(mmm.y * N180divPi)) * Pidiv180;
    902 
    903                                 c4.x = cos(mmm.x) * cos(mmm.y);
    904                                 c4.y = sin(mmm.x) * cos(mmm.y);
    905                                 c4.z = sin(mmm.y);
    906 
    907                                 AppliquerMatriceCorrectionSimple(&result, c4);
    908 
    909                                 if (result.x != 0.0)
     896
     897                                double targetAz, targetAlt;
     898                                double distmax = 0.0;
     899                                double dist;
     900
     901                                for (int n=0; n<nbrcorrections; n++)
    910902                                {
    911                                     targetAz = atan( result.y / result.x );
    912 
    913                                     if (result.x < 0) targetAz += Pi;
     903                                    Azimut(VerifAngle(ad[n] - tsl[n] + GetTSL()),  de[n], &mmm.x, &mmm.y);
     904
     905                                    mmm.y = Motor2Alt(Alt2Motor2(mmm.y * N180divPi)) * Pidiv180;
     906
     907                                    c4.x = cos(mmm.x) * cos(mmm.y);
     908                                    c4.y = sin(mmm.x) * cos(mmm.y);
     909                                    c4.z = sin(mmm.y);
     910
     911                                    AppliquerMatriceCorrectionSimple(&result, c4);
     912
     913                                    if (result.x != 0.0)
     914                                    {
     915                                        targetAz = atan( result.y / result.x );
     916
     917                                        if (result.x < 0) targetAz += Pi;
     918                                    }
     919                                    else targetAz = Pidiv2;
     920
     921                                    targetAz  = VerifAngle(targetAz);
     922
     923                                    targetAlt = asin(result.z);
     924
     925
     926                                    Azimut(VerifAngle(delta_ad[n] - tsl[n] + GetTSL()),  delta_de[n], &mm.x, &mm.y);
     927
     928                                    dist = DistanceAngulaireEntre2Points(targetAz, targetAlt, mm.x, mm.y);
     929
     930                                    if (dist> distmax) distmax=dist;
    914931                                }
    915                                 else targetAz = Pidiv2;
    916 
    917                                 targetAz  = VerifAngle(targetAz);
    918 
    919                                 targetAlt = asin(result.z);
    920 
    921 
    922                                 Azimut(VerifAngle(delta_ad[n] - tsl[n] + GetTSL()),  delta_de[n], &mm.x, &mm.y);
    923 
    924                                 dist = DistanceAngulaireEntre2Points(targetAz, targetAlt, mm.x, mm.y);
    925 
    926                                 if (dist> distmax) distmax=dist;
     932
     933
     934
     935                                if (distmax< distmax2)
     936                                {
     937                                    os << "Determinant=" << det << "\n";
     938
     939                                    os << "I0=" << I0 << " CD="<< CD << " ED=" << ED << " BC=" << BC << " AE=" << AE << " Theta=" << Theta << " CoeffMoteur=" << CoeffMoteur << "\n";
     940
     941                                    os << DHMS(distmax*N180divPi, false) << "\n\n";
     942
     943                                    AfficherLog(os.str(), true);
     944                                    os.str("");
     945
     946                                    distmax2=distmax;
     947                                    //maxdet=distmax;
     948
     949                                    memCD = CD;
     950                                    memI0 = I0;
     951                                    memED = ED;
     952                                    memAE = AE;
     953                                    memBC = BC;
     954                                    memTheta = Theta;
     955                                    memCoeffMoteur = CoeffMoteur;
     956                                }
     957
     958                                maxdet = fabs(det - 1.0);
    927959                            }
    928 
    929 
    930 
    931                             if (distmax< distmax2)
    932                             {
    933                                 os << "Determinant=" << det << "\n";
    934 
    935                                 os << "I0=" << I0 << " CD="<< CD << " ED=" << ED << " BC=" << BC << " AE=" << AE << " Theta=" << Theta << " CoeffMoteur=" << CoeffMoteur << "\n";
    936 
    937                                 os << DHMS(distmax*N180divPi, false) << "\n\n";
    938 
    939                                 AfficherLog(os.str(), true);
    940                                 os.str("");
    941 
    942                                 distmax2=distmax;
    943                                 //maxdet=distmax;
    944 
    945                                 memCD = CD;
    946                                 memI0 = I0;
    947                                 memED = ED;
    948                                 memAE = AE;
    949                                 memBC = BC;
    950                                 memTheta = Theta;
    951                                 memCoeffMoteur = CoeffMoteur;
    952                             }
    953                            
    954                             maxdet = fabs(det - 1.0);
    955960                        }
    956961                    }
    957                 }             
    958             }
    959               if ((int)Arrondi((interv - j) / (2.0 * interv) * 100.0) % 10 == 0)
    960         {           
    961             os << 100.0 - (interv - j) / (2.0 * interv) * 100.0 << " %\n";
    962             AfficherLog(os.str(), true);
    963              os.str("");
     962                }
     963                if ((int)Arrondi((interv - j) / (2.0 * interv) * 100.0) % 10 == 0)
     964                {
     965                    os << 100.0 - (interv - j) / (2.0 * interv) * 100.0 << " %\n";
     966                    AfficherLog(os.str(), true);
     967                    os.str("");
     968                }
     969
     970            }
     971
    964972        }
    965        
    966         }
    967        
    968     }
    969 
    970 
    971     CD = memCD;
    972     ED = memED;
    973     AE = memAE;
    974     BC = memBC;
    975     I0 = memI0;
    976     Theta = memTheta;
    977     CoeffMoteur = memCoeffMoteur;
    978 
    979     os << "\n\nParamÚtres  : I0=" << I0 << " CD=" << CD << " ED=" << ED << " BC=" << BC << " AE=" << AE << " Theta=" << Theta << " CoeffMoteur=" << CoeffMoteur << "\n\nFin du calcul\n";
    980 
    981 
    982     AfficherLog(os.str(), true);
     973
     974
     975        CD = memCD;
     976        ED = memED;
     977        AE = memAE;
     978        BC = memBC;
     979        I0 = memI0;
     980        Theta = memTheta;
     981        CoeffMoteur = memCoeffMoteur;
     982
     983        os << "\n\nParamÚtres  : I0=" << I0 << " CD=" << CD << " ED=" << ED << " BC=" << BC << " AE=" << AE << " Theta=" << Theta << " CoeffMoteur=" << CoeffMoteur << "\n\nFin de l'optimisation\n";
     984
     985
     986        AfficherLog(os.str(), true);
     987
     988    }
    983989
    984990    Azimut(m1.x, m1.y, &mm.x, &mm.y);
     
    10451051
    10461052    CalculTSL();
     1053
     1054    if ( BC!=BC0 || CD!=CD0 || ED!=ED0 || AE!=AE0 || I0!=I00 || CoeffMoteur!=CoeffMoteur0 )
     1055    {
     1056        OptimisationGeometrieAntenne(false);
     1057
     1058        return;
     1059    }
    10471060
    10481061    switch ( MethodeAlignement )
     
    13031316    char *tsl_data = NULL;
    13041317
     1318    char *c_BC = NULL;
     1319
     1320    char *c_CD = NULL;
     1321
     1322    char *c_ED = NULL;
     1323
     1324    char *c_AE = NULL;
     1325
     1326    char *c_I0 = NULL;
     1327
     1328    char *c_CoeffMoteur = NULL;
     1329
     1330    char *c_Theta = NULL;
     1331
    13051332    if (!is_readable(fileName)) return false;
    13061333
     
    14731500
    14741501
     1502    os2 << "BC";
     1503
     1504    readINI((char*)os.str().c_str(), (char*)os2.str().c_str(), &c_BC,  (char*)fileName.c_str());
     1505
     1506    os2.str("");
     1507
     1508    os2 << "CD";
     1509
     1510    readINI((char*)os.str().c_str(), (char*)os2.str().c_str(), &c_CD,  (char*)fileName.c_str());
     1511
     1512    os2.str("");
     1513
     1514    os2 << "ED";
     1515
     1516    readINI((char*)os.str().c_str(), (char*)os2.str().c_str(), &c_ED,  (char*)fileName.c_str());
     1517
     1518    os2.str("");
     1519
     1520    os2 << "AE";
     1521
     1522    readINI((char*)os.str().c_str(), (char*)os2.str().c_str(), &c_AE,  (char*)fileName.c_str());
     1523
     1524    os2.str("");
     1525
     1526    os2 << "I0";
     1527
     1528    readINI((char*)os.str().c_str(), (char*)os2.str().c_str(), &c_I0,  (char*)fileName.c_str());
     1529
     1530    os2.str("");
     1531
     1532    os2 << "CoeffMoteur";
     1533
     1534    readINI((char*)os.str().c_str(), (char*)os2.str().c_str(), &c_CoeffMoteur,  (char*)fileName.c_str());
     1535
     1536    os2.str("");
     1537
     1538    os2 << "Theta";
     1539
     1540    readINI((char*)os.str().c_str(), (char*)os2.str().c_str(), &c_Theta,  (char*)fileName.c_str());
     1541
     1542    os2.str("");
     1543
     1544    if ( c_BC && c_CD && c_ED && c_AE && c_I0 && c_CoeffMoteur && c_Theta &&
     1545            atof(c_BC)!=0.0 && atof(c_CD)!=0.0 && atof(c_ED)!=0.0 && atof(c_AE)!=0.0 && atof(c_I0)!=0.0 && atof(c_CoeffMoteur)!=0.0 && atof(c_Theta)!=0.0 )
     1546    {
     1547        BC = atof(c_BC);
     1548
     1549        CD = atof(c_CD);
     1550
     1551        ED = atof(c_ED);
     1552
     1553        AE = atof(c_AE);
     1554
     1555        I0 = atof(c_I0);
     1556
     1557        CoeffMoteur = atof(c_CoeffMoteur);
     1558
     1559        Theta = atof(c_Theta);
     1560
     1561        IDLog("Chargement des parametres de l antenne\n", true);
     1562
     1563        modificationAlignement = true;
     1564    }
     1565
    14751566    // Si un des paramÚtres d'une antenne change pendant la procédure d'alignement ou que l'on a
    14761567    // plus de deux points d'alignement sur une antenne, alors on calcule la matrice de correction
     
    14801571        if  (nbrcorrections >=3 && AlignementEnCours == 0)
    14811572        {
    1482             // IDLog("Calcul matrice\n", true);
    14831573            CalculerMatriceCorrection(a, b);
    14841574        }
     
    14981588
    14991589    SAFEDELETE_TAB(align_data);
     1590
     1591    SAFEDELETE_TAB(c_BC);
     1592
     1593    SAFEDELETE_TAB(c_CD);
     1594
     1595    SAFEDELETE_TAB(c_ED);
     1596
     1597    SAFEDELETE_TAB(c_AE);
     1598
     1599    SAFEDELETE_TAB(c_I0);
     1600
     1601    SAFEDELETE_TAB(c_CoeffMoteur);
     1602
     1603    SAFEDELETE_TAB(c_Theta);
    15001604
    15011605    return true;
     
    16591763        }
    16601764
     1765    os << "BC";
     1766    key     = os.str();
     1767    os.str("");
     1768    os << BC;
     1769    value = os.str();
     1770    os.str("");
     1771
     1772    writeINI((char*)section.c_str(), (char*)key.c_str(), (char*)value.c_str(), (char*)fileName.c_str());
     1773
     1774    os << "CD";
     1775    key     = os.str();
     1776    os.str("");
     1777    os << CD;
     1778    value = os.str();
     1779    os.str("");
     1780
     1781    writeINI((char*)section.c_str(), (char*)key.c_str(), (char*)value.c_str(), (char*)fileName.c_str());
     1782
     1783    os << "ED";
     1784    key     = os.str();
     1785    os.str("");
     1786    os << ED;
     1787    value = os.str();
     1788    os.str("");
     1789
     1790    writeINI((char*)section.c_str(), (char*)key.c_str(), (char*)value.c_str(), (char*)fileName.c_str());
     1791
     1792
     1793    os << "AE";
     1794    key     = os.str();
     1795    os.str("");
     1796    os << AE;
     1797    value = os.str();
     1798    os.str("");
     1799
     1800    writeINI((char*)section.c_str(), (char*)key.c_str(), (char*)value.c_str(), (char*)fileName.c_str());
     1801
     1802    os << "I0";
     1803    key     = os.str();
     1804    os.str("");
     1805    os << I0;
     1806    value = os.str();
     1807    os.str("");
     1808
     1809    writeINI((char*)section.c_str(), (char*)key.c_str(), (char*)value.c_str(), (char*)fileName.c_str());
     1810
     1811    os << "CoeffMoteur";
     1812    key     = os.str();
     1813    os.str("");
     1814    os << CoeffMoteur;
     1815    value = os.str();
     1816    os.str("");
     1817
     1818    writeINI((char*)section.c_str(), (char*)key.c_str(), (char*)value.c_str(), (char*)fileName.c_str());
     1819
     1820    os << "Theta";
     1821    key     = os.str();
     1822    os.str("");
     1823    os << Theta;
     1824    value = os.str();
     1825    os.str("");
     1826
     1827    writeINI((char*)section.c_str(), (char*)key.c_str(), (char*)value.c_str(), (char*)fileName.c_str());
     1828
    16611829
    16621830    return true;
  • BAORadio/libindi/libindi/communs/alignement.h

    r691 r693  
    9696
    9797    void   AfficherMatrice();
    98     inline double Determinant();
     98    double Determinant();
    9999   
    100100    void   InitParametresInstrument();
    101     void   OptimisationGeometrieAntenne();
     101    void   OptimisationGeometrieAntenne(bool Chercher);
    102102    double Alt2Motor(double targetAlt);
    103103     double Motor2Alt(double pas);
     
    143143
    144144    double BC;                          //ParamÚtres de l'instrument
    145     // Formule de Marc
    146145    double CD;
    147146    double ED;
  • BAORadio/libindi/libindi/communs/astro.cpp

    r691 r693  
    567567***************************************************************************************/
    568568
    569  void Astro::Azimut(double Ar, double De, double *azi, double *hau)
     569void Astro::Azimut(double Ar, double De, double *azi, double *hau)
    570570{
    571571    double ah = tsl - Ar;
    572    
     572
    573573    double cosLatitude = cos(Latitude);
    574574    double sinLatitude = sin(Latitude);
    575575    double cosDe_cosAh = cos(De) * cos(ah);
    576576    double sinDe       = sin(De);
    577    
    578    
     577
     578
    579579    double zc = sinLatitude * sinDe + cosLatitude * cosDe_cosAh;
    580580    double ht = atan(zc / sqrt((-zc * zc) + 1.0));
    581    
     581
    582582    double cosHt       = cos(ht);
    583583
     
    648648***************************************************************************************/
    649649
    650 void Astro::RechercheAzimutFinSuivi(double AD, double Dec, long int *azmin, long int *azmax)
     650void Astro::RechercheAzimutFinSuivi(double AD, double Dec, int posazactuelle, int *azmin, int *azmax)
    651651{
    652652    double az, ha;
    653     double min =  10000.0;
    654     double max = -10000.0;
     653    int min =  30000;
     654    int max = -30000;
     655    int delta;
     656    int codeuraz;
    655657
    656658    CalculTSL();
     659   
     660   
     661    posazactuelle = 0;
     662   
     663    // la recherche se fait pour les 12 prochaines heures (12 * 60 = 720)
    657664
    658665    for (int i = 0; i < 720; i++)
    659666    {
    660         tsl += 1.0 / 60.0 / 24.0 * Pi2 ;
     667        // calcul de l'azimut de l'objet i minutes plus tard
    661668
    662669        Azimut( AD, Dec, &az, &ha);
    663        
     670       
     671        if ( ha < HAUTMIN * Pidiv180 ) break;
     672
    664673        az = VerifAngle(az + Pi);
    665674
    666         if ( az > max ) max = az;
    667 
    668         if ( az < min ) min = az;
    669 
    670         if ( ha < HAUTMIN * Pidiv180 || az > Pi2-0.01) break;
    671     }
    672 
    673     *azmin = (long int) Arrondi( min * (double)NBREPASCODEURSAZ / Pi2 ) -NBREPASCODEURSAZ;
    674 
    675     *azmax = (long int) Arrondi( max * (double)NBREPASCODEURSAZ / Pi2 ) ;
    676    
     675        codeuraz = (int) Arrondi( az * (double)NBREPASCODEURSAZ / Pi2 );
     676       
     677        delta = codeuraz - posazactuelle;
     678       
     679        if ( delta >=  NBREPASCODEURSAZ / 2 ) delta -= NBREPASCODEURSAZ;
     680
     681        if ( delta <= -NBREPASCODEURSAZ / 2 ) delta += NBREPASCODEURSAZ;
     682
     683        posazactuelle += delta;
     684
     685        if ( posazactuelle < min) min = posazactuelle;
     686
     687        if ( posazactuelle > max) max = posazactuelle;       
     688       
     689        tsl += 1.0 / 60.0 / 24.0 * Pi2 ;
     690    }
     691
     692    *azmin = min - 200;
     693
     694    *azmax = max + 200;
     695
    677696    CalculTSL();
    678697}
     
    728747    return fmod(angle, Pi);
    729748}
    730 
     749/*
    731750float  Astro::slaRange(float angle )
    732751{
    733752    return fmodf(angle, Pi);
    734753}
    735 
     754*/
    736755void Astro::slaRefro ( double zobs, double hm, double tdk, double pmb,
    737756                       double rh, double wl, double phi, double tlr,
  • BAORadio/libindi/libindi/communs/astro.h

    r688 r693  
    5454    void   Azimut(double Ar, double De, double *azi, double *hau);
    5555    void   AzHa2ADDe(double Az, double Ha, double *AD, double *Dec);
    56     void   RechercheAzimutFinSuivi(double AD, double Dec, long int *azmin, long int *azmax);
     56    void   RechercheAzimutFinSuivi(double AD, double Dec, int posazactuelle, int *azmin, int *azmax);
    5757    void   Precession(double *ar, double *de);
    5858    void   NutationEtoile(double *ar, double *de);
  • BAORadio/libindi/libindi/communs/const.h

    r691 r693  
    88//////////////////////////////////////////
    99
    10 #define VERSION "0.61"
    11 #define VERSION_DATE "01/08/12"
     10#define VERSION "0.62"
     11#define VERSION_DATE "14/09/12"
    1212
    1313//#define ET_UT 0.0
     
    173173#define UPDATETRANSITDELAY ( 15.0 * 60.0 )
    174174
    175 //#define JOYSTICK
     175#define JOYSTICK
    176176
    177177#define JOY_DEV "/dev/input/js0"
  • BAORadio/libindi/libindi/drivers/telescope/BAO.cpp

    r691 r693  
    130130    targetAlignmentIP     = -1;
    131131
     132    // Ces deux variables définissent un intervalle où l'azimut (exprimée en pas codeur)
     133    // de l'object pointé va évoluer au cours du suivi...
     134
     135    azmincodeur = MINAZCODEURS;
     136    azmaxcodeur = MAXAZCODEURS;
     137
    132138
    133139    // initialisation des sockets (Antennes)
     
    229235        time ( &rawtime );
    230236        timeinfo = localtime ( &rawtime );
    231         strftime (buffer,80,"%c    ",timeinfo);
    232         fprintf(pFile, buffer);
     237        strftime (buffer, 80,"%c    ",timeinfo);
     238        fprintf(pFile, "%s", buffer);
    233239
    234240        // On sauvegarde le message dans le fichier log
     
    604610        if (eqp == &CommandT[0])
    605611        {
    606             char chaine[100];
     612            char chaine[1000];
    607613
    608614            bool result = false;
     
    616622                for (int i = 1; i<=strlen(chaine); i++) chaine[i-1]=chaine[i];
    617623
    618                 IDLog(chaine);
     624                IDLog("%s", chaine);
    619625
    620626                for (int i = 1; i<SocketsNumber; i++ )
     
    646652            else if (chaine[0] == 'M')
    647653            {
     654                IDSetText(&CommandTP, "Calcul des matrices de correction\n" );
     655
    648656                if  (Sockets[targetAlignmentIP].AlignementAntenne->nbrcorrections >=3 )
    649657                {
     
    657665                    Sockets[targetAlignmentIP].AlignementAntenne->Matrice_ok = false;
    658666                }
    659 
    660                 IDSetText(&CommandTP, "Calcul des matrices de correction\n" );
    661667            }
    662668            else if (chaine[0] == 'O')
     
    666672                if (targetAlignmentIP != -1)
    667673                {
    668                     Sockets[targetAlignmentIP].AlignementAntenne->OptimisationGeometrieAntenne();
     674                    Sockets[targetAlignmentIP].AlignementAntenne->OptimisationGeometrieAntenne(true);
     675
     676                    IDSetSwitch(&AlignementOkP, "Les parametres de l alignement ont ete sauvegardes apres optimisation");
     677
     678                    Sockets[targetAlignmentIP].AlignementAntenne->EnregistrementParametresAlignement(
     679                        Sockets[targetAlignmentIP].IP,
     680                        "/home/" + (string)getenv("USER") + "/AlignementAntennes.cfg");
    669681                }
    670682            }
     
    785797                    }
    786798
    787 
    788 
    789 
    790                     IDSetText(&CommandTP, os.str().c_str() );
     799                    IDSetText(&CommandTP, "%s", os.str().c_str() );
    791800
    792801                    return;
     
    15031512                        DHMS(targetDEC, false     ).c_str());
    15041513
    1505             AfficherLog("ad1=%s de1=%s ad2=%s de2=%s\n",
     1514            AfficherLog("(ad1=%s de1=%s) -> (ad2=%s de2=%s)\n",
    15061515                        DHMS(ad  * N180divPi, true ).c_str(),
    15071516                        DHMS(de  * N180divPi, false).c_str(),
     
    17221731    Coord result, vect;
    17231732
     1733   
    17241734    // Pour toutes les antennes connectées
    17251735
     
    17951805                    newRA  = Sockets[i].AlignementAntenne->delta_ad[Sockets[i].AlignementAntenne->nbrcorrections];
    17961806                    newDEC = Sockets[i].AlignementAntenne->delta_de[Sockets[i].AlignementAntenne->nbrcorrections];
     1807                   
     1808                    // if newRA et newDEC = 0 -> on sort
     1809   
     1810                    if ( newRA == 0 && newDEC == 0) return;
    17971811
    17981812                    AfficherLog("Alignement en cours.\n", true);
     
    19331947                // On applique la formule de Marc pour convertir la hauteur en nombre de pas codeur alt
    19341948
    1935                 Sockets[i].TargetPosition.y = (long int) Arrondi( Sockets[i].AlignementAntenne->Alt2Motor( targetAlt ) );
     1949                Sockets[i].TargetPosition.y = (int) Arrondi( Sockets[i].AlignementAntenne->Alt2Motor( targetAlt ) );
    19361950
    19371951                //4000 pas pour 360° sur l'axe az
    19381952
    1939                 Sockets[i].TargetPosition.x = (long int) Arrondi( targetAz * (double)NBREPASCODEURSAZ / 360.0);
     1953                Sockets[i].TargetPosition.x = (int) Arrondi( targetAz * (double)NBREPASCODEURSAZ / 360.0);
    19401954
    19411955                // On ajoute les deltas en AZ et en HA pour la raquette hors procédure d'alignement
     
    19521966
    19531967                if ( azmincodeur < MINAZCODEURS ) {
     1968                    azmincodeur += NBREPASCODEURSAZ;
     1969                    azmaxcodeur += NBREPASCODEURSAZ;
     1970                    //  AutoriserTourComplet = true;
     1971                    AfficherLog("azmincodeur < MINAZCODEURS\n");
     1972                }
     1973
     1974                if ( azmaxcodeur > MAXAZCODEURS ) {
     1975                    azmincodeur -= NBREPASCODEURSAZ;
     1976                    azmaxcodeur -= NBREPASCODEURSAZ;
     1977                    // AutoriserTourComplet = true;
     1978                    AfficherLog("azmaxcodeur > MAXAZCODEURS\n");
     1979                }
     1980
     1981                AfficherLog("Intervalle autorise pour le suivi de l objet en azimut [%i..%i]\n", azmincodeur, azmaxcodeur );
     1982                AfficherLog("Position initiale en Az = %i\n", Sockets[i].TargetPosition.x);
     1983
     1984                if ( Sockets[i].TargetPosition.x < azmincodeur ) {
    19541985                    Sockets[i].TargetPosition.x += NBREPASCODEURSAZ;
    19551986                    AutoriserTourComplet = true;
    1956                      AfficherLog("test1\n");
    1957 
     1987                    AfficherLog("TargetPosition.x < azmincodeur\n");
    19581988                }
    19591989
    1960                 if ( azmaxcodeur > MAXAZCODEURS ) {
     1990                if ( Sockets[i].TargetPosition.x > azmaxcodeur ) {
    19611991                    Sockets[i].TargetPosition.x -= NBREPASCODEURSAZ;
    19621992                    AutoriserTourComplet = true;
    1963                     AfficherLog("test2\n");
    1964 
     1993                    AfficherLog("TargetPosition.x > azmaxcodeur\n");
    19651994                }
    19661995
    1967                  if ( Sockets[i].TargetPosition.x < MINAZCODEURS ) {
     1996                if ( Sockets[i].TargetPosition.x < MINAZCODEURS ) {
    19681997                    Sockets[i].TargetPosition.x += NBREPASCODEURSAZ;
    19691998                    AutoriserTourComplet = true;
    1970                     AfficherLog("test3\n");
    1971 
     1999                    AfficherLog("TargetPosition.x < MINAZCODEURS\n");
    19722000                }
    19732001
     
    19752003                    Sockets[i].TargetPosition.x -= NBREPASCODEURSAZ;
    19762004                    AutoriserTourComplet = true;
    1977                     AfficherLog("test4\n");
    1978 
     2005                    AfficherLog("TargetPosition.x > MAXAZCODEURS\n");
    19792006                }
    19802007
     2008                if (fabs(Sockets[i].Pos.x - Sockets[i].TargetPosition.x) > MAXAZCODEURS / 2)
     2009                {
     2010                    AutoriserTourComplet = true;
     2011                    AfficherLog("| Pos.x - TargetPosition.x | > MAXAZCODEURS / 2\n");
     2012                }
     2013
    19812014                // Message de debug
    19822015
    1983                 AfficherLog("Intervalle autorise pour le suivi de l objet [%i..%i]\n", azmincodeur, azmaxcodeur);
    1984 
    1985                 AfficherLog("Positions codeurs Az = %i  Alt = %i\n", Sockets[i].TargetPosition.x, Sockets[i].TargetPosition.y);
     2016                AfficherLog("Position finale :  Az = %i  Alt = %i\n", Sockets[i].TargetPosition.x, Sockets[i].TargetPosition.y);
    19862017            }
    19872018        }
     
    29212952bool BAO::process_coords()
    29222953{
     2954    int posaz = 0;
     2955
    29232956    switch (currentSet)
    29242957    {
     
    29402973        // les rotations inutiles
    29412974
    2942         RechercheAzimutFinSuivi(targetRA * 15.0 * Pidiv180, targetDEC * Pidiv180, &azmincodeur, &azmaxcodeur);
     2975        for (int i=1; i<SocketsNumber; i++ )
     2976        {
     2977            if ((Sockets[i].Connected) && (Sockets[i].PosValides))
     2978            {
     2979                posaz = Sockets[i].Pos.x;
     2980                break;
     2981            }
     2982        }
     2983
     2984        RechercheAzimutFinSuivi(targetRA * 15.0 * Pidiv180, targetDEC * Pidiv180, posaz, &azmincodeur, &azmaxcodeur);
    29432985
    29442986        // On prépare les antennes pour le prochain goto
     
    29903032        // les rotations inutiles
    29913033
    2992         RechercheAzimutFinSuivi(targetRA * 15.0 * Pidiv180, targetDEC * Pidiv180, &azmincodeur, &azmaxcodeur);
     3034        for (int i=1; i<SocketsNumber; i++ )
     3035        {
     3036            if ((Sockets[i].Connected) && (Sockets[i].PosValides))
     3037            {
     3038                posaz = Sockets[i].Pos.x;
     3039                break;
     3040            }
     3041        }
     3042
     3043        RechercheAzimutFinSuivi(targetRA * 15.0 * Pidiv180, targetDEC * Pidiv180, posaz, &azmincodeur, &azmaxcodeur);
    29933044
    29943045        InitAntennes();
     
    32033254
    32043255    // ne pas faire des tours complets en Az pour rien...
    3205    
    3206      // Corrections sup pour rester dans l'intervalle [-1693.. 3867]
    3207 
    3208      AfficherLog("deltaAz1=%i\n", deltaAz, true);
    3209        
     3256
     3257    // Corrections sup pour rester dans l'intervalle [-1693.. 3867]
     3258
     3259    AfficherLog("deltaAz1=%i\n", deltaAz, true);
     3260
    32103261    while (deltaAz > NBREPASCODEURSAZ) deltaAz -= NBREPASCODEURSAZ;
    32113262
    3212    
     3263
    32133264    //TODO : a verifier en details
    3214  
     3265
    32153266    if ( !AutoriserTourComplet )
    32163267    {
     
    32253276        }
    32263277    }
    3227    
     3278
    32283279    AfficherLog("deltaAz2=%i\n", deltaAz, true);
    32293280
  • BAORadio/libindi/libindi/drivers/telescope/BAO.h

    r691 r693  
    4545struct Position
    4646{
    47     long int x;
    48     long int y;
     47    int x;
     48    int y;
    4949};
    5050
     
    250250    BAO_STATUS  TrackingMode;            // Mode de suivi actuellement activé
    251251   
    252     long int azmincodeur;
    253     long int azmaxcodeur; 
     252    int azmincodeur;
     253    int azmaxcodeur; 
    254254   
    255255    int    targetAlignmentIP;
    256256   
    257     long int VitesseRaquette;
    258     long int delta_az;
    259     long int delta_ha;
     257    int VitesseRaquette;
     258    int delta_az;
     259    int delta_ha;
    260260   
    261261   
Note: See TracChangeset for help on using the changeset viewer.