Changeset 688 for BAORadio


Ignore:
Timestamp:
Jun 8, 2012, 4:05:59 PM (12 years ago)
Author:
frichard
Message:
 
Location:
BAORadio/libindi/libindi
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • BAORadio/libindi/libindi/BAOTest/BAOtest_main.cpp

    r677 r688  
    125125***************************************************************************************/
    126126
    127 #define ERREURS 50
     127#define ERREURS 10
    128128
    129129int main ( int argc, char *argv[] )
  • BAORadio/libindi/libindi/BAOcontrol/BAOcontrol.pro

    r685 r688  
    11######################################################################
    2 # Automatically generated by qmake (2.01a) jeu. mai 24 18:43:53 2012
     2# Automatically generated by qmake (2.01a) ven. juin 8 16:03:28 2012
    33######################################################################
    44
     
    1111HEADERS += baocontrol.h \
    1212           baoqt.h \
     13           Connection.hpp \
     14           Joystick.h \
    1315           liste.h \
     16           Listener.hpp \
     17           LogFile.hpp \
    1418           map.h \
     19           qledindicator.h \
    1520           selectstars.h \
     21           Server.hpp \
     22           Socket2.hpp \
    1623           ../communs/const.h \
    1724           ../communs/logs.h \
     
    2633SOURCES += baocontrol.cpp \
    2734           baoqt.cpp \
     35           Connection.cpp \
     36           Joystick.cpp \
    2837           liste.cpp \
     38           Listener.cpp \
     39           LogFile.cpp \
    2940           main.cpp \
    3041           map.cpp \
     42           qledindicator.cpp \
    3143           selectstars.cpp \
     44           Server.cpp \
     45           Socket2.cpp \
    3246           ../communs/logs.cpp \
    3347           ../communs/ClientSocket.cpp \
  • BAORadio/libindi/libindi/BAOcontrol/Makefile

    r685 r688  
    11#############################################################################
    22# Makefile for building: BAOcontrol
    3 # Generated by qmake (2.01a) (Qt 4.7.4) on: jeu. mai 24 18:43:53 2012
     3# Generated by qmake (2.01a) (Qt 4.7.4) on: ven. juin 8 16:03:29 2012
    44# Project:  BAOcontrol.pro
    55# Template: app
     
    4646SOURCES       = baocontrol.cpp \
    4747                baoqt.cpp \
     48                Connection.cpp \
     49                Joystick.cpp \
    4850                liste.cpp \
     51                Listener.cpp \
     52                LogFile.cpp \
    4953                main.cpp \
    5054                map.cpp \
     55                qledindicator.cpp \
    5156                selectstars.cpp \
     57                Server.cpp \
     58                Socket2.cpp \
    5259                ../communs/logs.cpp \
    5360                ../communs/ClientSocket.cpp \
     
    5966                moc_liste.cpp \
    6067                moc_map.cpp \
     68                moc_qledindicator.cpp \
    6169                moc_selectstars.cpp
    6270OBJECTS       = baocontrol.o \
    6371                baoqt.o \
     72                Connection.o \
     73                Joystick.o \
    6474                liste.o \
     75                Listener.o \
     76                LogFile.o \
    6577                main.o \
    6678                map.o \
     79                qledindicator.o \
    6780                selectstars.o \
     81                Server.o \
     82                Socket2.o \
    6883                logs.o \
    6984                ClientSocket.o \
     
    7691                moc_liste.o \
    7792                moc_map.o \
     93                moc_qledindicator.o \
    7894                moc_selectstars.o
    7995DIST          = /usr/share/qt4/mkspecs/common/g++.conf \
     
    179195dist:
    180196        @$(CHK_DIR_EXISTS) .tmp/BAOcontrol1.0.0 || $(MKDIR) .tmp/BAOcontrol1.0.0
    181         $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/BAOcontrol1.0.0/ && $(COPY_FILE) --parents baocontrol.h baoqt.h liste.h map.h selectstars.h ../communs/const.h ../communs/logs.h ../communs/ClientSocket.h ../communs/Socket.h ../communs/SocketException.h ../communs/astro.h ../communs/alignement.h ../communs/filetools.h ../communs/exception.h .tmp/BAOcontrol1.0.0/ && $(COPY_FILE) --parents baocontrol.cpp baoqt.cpp liste.cpp main.cpp map.cpp selectstars.cpp ../communs/logs.cpp ../communs/ClientSocket.cpp ../communs/Socket.cpp ../communs/astro.cpp ../communs/alignement.cpp ../communs/filetools.cpp ../communs/exception.cpp .tmp/BAOcontrol1.0.0/ && $(COPY_FILE) --parents baoqt.ui liste.ui map.ui selectstars.ui .tmp/BAOcontrol1.0.0/ && (cd `dirname .tmp/BAOcontrol1.0.0` && $(TAR) BAOcontrol1.0.0.tar BAOcontrol1.0.0 && $(COMPRESS) BAOcontrol1.0.0.tar) && $(MOVE) `dirname .tmp/BAOcontrol1.0.0`/BAOcontrol1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/BAOcontrol1.0.0
     197        $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/BAOcontrol1.0.0/ && $(COPY_FILE) --parents baocontrol.h baoqt.h Connection.hpp Joystick.h liste.h Listener.hpp LogFile.hpp map.h qledindicator.h selectstars.h Server.hpp Socket2.hpp ../communs/const.h ../communs/logs.h ../communs/ClientSocket.h ../communs/Socket.h ../communs/SocketException.h ../communs/astro.h ../communs/alignement.h ../communs/filetools.h ../communs/exception.h .tmp/BAOcontrol1.0.0/ && $(COPY_FILE) --parents baocontrol.cpp baoqt.cpp Connection.cpp Joystick.cpp liste.cpp Listener.cpp LogFile.cpp main.cpp map.cpp qledindicator.cpp selectstars.cpp Server.cpp Socket2.cpp ../communs/logs.cpp ../communs/ClientSocket.cpp ../communs/Socket.cpp ../communs/astro.cpp ../communs/alignement.cpp ../communs/filetools.cpp ../communs/exception.cpp .tmp/BAOcontrol1.0.0/ && $(COPY_FILE) --parents baoqt.ui liste.ui map.ui selectstars.ui .tmp/BAOcontrol1.0.0/ && (cd `dirname .tmp/BAOcontrol1.0.0` && $(TAR) BAOcontrol1.0.0.tar BAOcontrol1.0.0 && $(COMPRESS) BAOcontrol1.0.0.tar) && $(MOVE) `dirname .tmp/BAOcontrol1.0.0`/BAOcontrol1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/BAOcontrol1.0.0
    182198
    183199
     
    200216mocables: compiler_moc_header_make_all compiler_moc_source_make_all
    201217
    202 compiler_moc_header_make_all: moc_baoqt.cpp moc_liste.cpp moc_map.cpp moc_selectstars.cpp
     218compiler_moc_header_make_all: moc_baoqt.cpp moc_liste.cpp moc_map.cpp moc_qledindicator.cpp moc_selectstars.cpp
    203219compiler_moc_header_clean:
    204         -$(DEL_FILE) moc_baoqt.cpp moc_liste.cpp moc_map.cpp moc_selectstars.cpp
     220        -$(DEL_FILE) moc_baoqt.cpp moc_liste.cpp moc_map.cpp moc_qledindicator.cpp moc_selectstars.cpp
    205221moc_baoqt.cpp: selectstars.h \
    206222                ui_selectstars.h \
     
    217233                ../communs/filetools.h \
    218234                ../communs/exception.h \
     235                qledindicator.h \
     236                Joystick.h \
     237                Server.hpp \
    219238                baoqt.h
    220239        /usr/bin/moc $(DEFINES) $(INCPATH) baoqt.h -o moc_baoqt.cpp
     
    226245                map.h
    227246        /usr/bin/moc $(DEFINES) $(INCPATH) map.h -o moc_map.cpp
     247
     248moc_qledindicator.cpp: qledindicator.h
     249        /usr/bin/moc $(DEFINES) $(INCPATH) qledindicator.h -o moc_qledindicator.cpp
    228250
    229251moc_selectstars.cpp: ui_selectstars.h \
     
    290312                ../communs/filetools.h \
    291313                ../communs/exception.h \
     314                qledindicator.h \
     315                Joystick.h \
     316                Server.hpp \
    292317                ui_baoqt.h
    293318        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o baoqt.o baoqt.cpp
     319
     320Connection.o: Connection.cpp Connection.hpp \
     321                Socket2.hpp \
     322                Server.hpp \
     323                LogFile.hpp
     324        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Connection.o Connection.cpp
     325
     326Joystick.o: Joystick.cpp ../communs/const.h \
     327                Joystick.h
     328        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Joystick.o Joystick.cpp
    294329
    295330liste.o: liste.cpp liste.h \
    296331                ui_liste.h
    297332        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o liste.o liste.cpp
     333
     334Listener.o: Listener.cpp Listener.hpp \
     335                Socket2.hpp \
     336                Connection.hpp \
     337                Server.hpp \
     338                LogFile.hpp
     339        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Listener.o Listener.cpp
     340
     341LogFile.o: LogFile.cpp LogFile.hpp
     342        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o LogFile.o LogFile.cpp
    298343
    299344main.o: main.cpp baoqt.h \
     
    312357                ../communs/filetools.h \
    313358                ../communs/exception.h \
     359                qledindicator.h \
     360                Joystick.h \
     361                Server.hpp \
    314362                ui_baoqt.h
    315363        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
     
    319367                ui_map.h
    320368        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o map.o map.cpp
     369
     370qledindicator.o: qledindicator.cpp qledindicator.h
     371        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o qledindicator.o qledindicator.cpp
    321372
    322373selectstars.o: selectstars.cpp selectstars.h \
    323374                ui_selectstars.h
    324375        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o selectstars.o selectstars.cpp
     376
     377Server.o: Server.cpp Server.hpp \
     378                Socket2.hpp \
     379                Listener.hpp
     380        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Server.o Server.cpp
     381
     382Socket2.o: Socket2.cpp Socket2.hpp
     383        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Socket2.o Socket2.cpp
    325384
    326385logs.o: ../communs/logs.cpp ../communs/logs.h \
     
    364423        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_map.o moc_map.cpp
    365424
     425moc_qledindicator.o: moc_qledindicator.cpp
     426        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_qledindicator.o moc_qledindicator.cpp
     427
    366428moc_selectstars.o: moc_selectstars.cpp
    367429        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_selectstars.o moc_selectstars.cpp
  • BAORadio/libindi/libindi/BAOcontrol/baocontrol.cpp

    r681 r688  
    4141    // pour la signification des variables, voir baocontrol.h
    4242
    43 
     43    //BAOcontrol
    4444
    4545    delaitransit           = 0;
     
    222222
    223223
    224 
    225224    // Ouverture du socket avec indi_BAO
    226225
     
    230229
    231230    Connect(true);
    232 
    233231}
    234232
     
    261259    delete client_socket;
    262260}
    263 
    264261
    265262
     
    298295    }
    299296
    300 
    301297    //affichage de la date et de l'heure
    302298
     
    306302
    307303
    308 
    309304    // En cas d'exécution d'un fichier de mouvements, on affiche la durée avant la prochaine étape
    310305
     
    313308//       sprintf(chaine, "Prochaine etape dans %4.1fs", (objets[runnum].JJ - JJ) * 3600.0 * 24.0);
    314309
    315 
    316     }
    317     /*
    318 
    319         // affichage des cercles d'état des antennes
    320         // vert = l'antenne fonctionne
    321         // rouge = problÚme détecté sur l'antenne
    322         // gris = antenne non connectée
    323 
    324         for (int i=0; i <20; i++)
    325         {
    326             for (int j=0; j<2; j++)
    327             {
    328                 switch (Antennes[20*j+i].ok)
    329                 {
    330                 case 1 :
    331                     color=vert;
    332                     break;
    333                 case 2 :
    334                     color=rouge;
    335                     break;
    336                 default:
    337                     color=gris;
    338                     break;
    339                 }
    340 
    341                 XFillArc(d, db ,color, 10 + i * 30, 20 + j * 30, 15, 15, 0, 360 * 64);
    342 
    343                 XDrawArc(d, db ,noir,  10 + i * 30, 20 + j * 30, 15, 15, 0, 360 * 64);
    344             }
    345         }
    346 
    347 
    348         // Affichage des messages venant du serveur indi_BAO et récupérés par la fonction LireReponse()
    349         // Les messages d'erreurs sont affichés en rouge
    350 
    351         for (int i=0; i<lognum; i++)
    352         {
    353             if (i>lognum-11)
    354             {
    355                 if ((logs[i].find("Err")!=string::npos)
    356                         || (logs[i].find("ALERTE")!=string::npos)) color=rouge;
    357                 else color=vert;
    358                 XDrawString(d, db, color, 10, (lognum>10)?9*12+(i-lognum+10)*12:9*12+i*12,
    359                             logs[i].c_str(), strlen(logs[i].c_str()));
    360             }
    361         }
    362 
    363 
    364         // On n'affiche la fenêtre graphique que lorsque tous les éléments ont été dessinés à l'intérieur
    365         // On évite ainsi le scintillement de la fenêtre...
    366 
    367         XCopyArea(d, db, w, noir, 0, 0, larg_fenetre, haut_fenetre, 0, 0);
    368 
    369 
    370         // On force le rafraîchissement de l'écran
    371 
    372         XFlush(d);
    373 
    374         delete [] chaine;*/
     310    }
    375311}
    376312
     
    485421
    486422    Dessiner();
    487  
     423
    488424}
    489425
     
    583519    struct tm date;
    584520    struct timeval tv;
    585 
     521 
    586522    // On récupÚre la date et l'heure depuis l'horloge du systÚme
    587523
     
    604540    // On lance les calculs (Temps sidéral local etc...)
    605541
    606     CalculTSL();
     542    CalculTSL(); 
    607543}
    608544
     
    705641
    706642        LireReponse();
    707 
    708         Dessiner();
    709643
    710644        // pause de 100 ms
     
    1050984            return true;
    1051985        }
    1052        
     986
    1053987        if (commande == "O")
    1054988        {
     
    21622096                commande[0]='M';
    21632097                break;
    2164                 case 'o' :
     2098            case 'o' :
    21652099                commande[0]='O';
    21662100                break;
    21672101            }
    2168        
    2169 
    2170 
    2171         string Message;
    2172 
    2173         if (!EnvoyerCommande((string)commande, &Message))
    2174         {
    2175             ErreurLog("Erreur ! La commande n'a pas un format correct !\n\n");
     2102
     2103
     2104
     2105            string Message;
     2106
     2107            if (!EnvoyerCommande((string)commande, &Message))
     2108            {
     2109                ErreurLog("Erreur ! La commande n'a pas un format correct !\n\n");
     2110            }
     2111            else
     2112            {
     2113                AfficherLog(Message +"\n\n", true);
     2114
     2115                return Message;
     2116            }
     2117        }
     2118    }
     2119
     2120
     2121
     2122// correction de l'alignement d'une antenne par rapport à l'objet visé
     2123
     2124    if (chaine.find("align")!=string::npos)
     2125    {
     2126        string ip;
     2127
     2128        CommandeOK = true;
     2129
     2130        if (DecompositionCommande(chaine, "align", &ip, NULL))
     2131        {
     2132            AlignementAntenneIP(ip);
    21762133        }
    21772134        else
    21782135        {
    2179             AfficherLog(Message +"\n\n", true);
    2180 
    2181             return Message;
    2182         }
    2183     }
    2184 }
    2185 
    2186 
    2187 
    2188 // correction de l'alignement d'une antenne par rapport à l'objet visé
    2189 
    2190 if (chaine.find("align")!=string::npos)
    2191 {
    2192     string ip;
    2193 
    2194     CommandeOK = true;
    2195 
    2196     if (DecompositionCommande(chaine, "align", &ip, NULL))
    2197     {
    2198         AlignementAntenneIP(ip);
    2199     }
    2200     else
    2201     {
    2202         ErreurLog("Erreur align : la commande align doit être suivie par l'ip de l'antenne qui faut aligner.\n\n");
    2203     }
    2204 }
     2136            ErreurLog("Erreur align : la commande align doit être suivie par l'ip de l'antenne qui faut aligner.\n\n");
     2137        }
     2138    }
    22052139
    22062140
    22072141// Réinitialisation de l'alignement d'une antenne
    22082142
    2209 if (chaine.find("reset")!=string::npos)
    2210 {
    2211     string ip;
    2212 
    2213     CommandeOK = true;
    2214 
    2215     if (DecompositionCommande(chaine, "reset", &ip, NULL))
    2216     {
    2217         if (SelectionIP(ip))
    2218         {
    2219             ResetAlignement();
    2220             return "";
    2221         }
    2222 
    2223         ErreurLog("Erreur reset : la commande reset doit être suivie par l'ip de l'antenne qu'il faut aligner.\n\n");
    2224     }
    2225 }
     2143    if (chaine.find("reset")!=string::npos)
     2144    {
     2145        string ip;
     2146
     2147        CommandeOK = true;
     2148
     2149        if (DecompositionCommande(chaine, "reset", &ip, NULL))
     2150        {
     2151            if (SelectionIP(ip))
     2152            {
     2153                ResetAlignement();
     2154                return "";
     2155            }
     2156
     2157            ErreurLog("Erreur reset : la commande reset doit être suivie par l'ip de l'antenne qu'il faut aligner.\n\n");
     2158        }
     2159    }
    22262160
    22272161
    22282162// Commande set
    22292163
    2230 if (chaine.find("set") != string::npos)
    2231 {
    2232     string commande, commande2, commande3;
    2233 
    2234     // est-ce que la commande commande par set ! -> si oui, la variable commande contient alors le reste de
    2235     // la phrase saisie par l'utilisateur
    2236 
    2237     if (DecompositionCommande(chaine, "set", &commande, NULL))
    2238     {
    2239         // A-t-on set transit xxxx ?
    2240 
    2241         if (DecompositionCommande(commande, "transit", &commande2, &commande3))
    2242         {
    2243             //at-ton set transit delay xxx ?
    2244 
    2245             if (commande2 == "delay")
     2164    if (chaine.find("set") != string::npos)
     2165    {
     2166        string commande, commande2, commande3;
     2167
     2168        // est-ce que la commande commande par set ! -> si oui, la variable commande contient alors le reste de
     2169        // la phrase saisie par l'utilisateur
     2170
     2171        if (DecompositionCommande(chaine, "set", &commande, NULL))
     2172        {
     2173            // A-t-on set transit xxxx ?
     2174
     2175            if (DecompositionCommande(commande, "transit", &commande2, &commande3))
    22462176            {
    2247                 if (atoi(commande3.c_str()) > 0)
     2177                //at-ton set transit delay xxx ?
     2178
     2179                if (commande2 == "delay")
     2180                {
     2181                    if (atoi(commande3.c_str()) > 0)
     2182                    {
     2183                        CommandeOK = true;
     2184
     2185                        delaitransit = atoi(commande3.c_str());
     2186
     2187                        EnvoyerDelaisModesTransitEtTracking();
     2188
     2189                        AfficherLog("Delai entre deux actualisations en mode transit : " + commande3 + "\n\n" , true);
     2190                    }
     2191                    else
     2192                    {
     2193                        AfficherLog("Le nombre qui suit le mot clé delay doit être entier et > 0  \n\n" , true);
     2194                    }
     2195                }
     2196
     2197                // Active le mode de suivi "transit"
     2198
     2199                if (commande2 == "on")
    22482200                {
    22492201                    CommandeOK = true;
    22502202
    2251                     delaitransit = atoi(commande3.c_str());
    2252 
    2253                     EnvoyerDelaisModesTransitEtTracking();
    2254 
    2255                     AfficherLog("Delai entre deux actualisations en mode transit : " + commande3 + "\n\n" , true);
     2203                    AfficherLog("Mode transit activé.\n\n", true);
     2204
     2205                    Transit = true;
     2206                }
     2207            }
     2208
     2209            // a-t-on set tracking xxxx ?
     2210
     2211            if (DecompositionCommande(commande, "tracking", &commande2,  &commande3))
     2212            {
     2213                // a-ton set tracking delay xxx ?
     2214
     2215                if (commande2 == "delay")
     2216                {
     2217                    if (atoi(commande3.c_str())>0)
     2218                    {
     2219                        CommandeOK = true;
     2220
     2221                        delaitracking = atoi(commande3.c_str());
     2222
     2223                        EnvoyerDelaisModesTransitEtTracking();
     2224
     2225                        AfficherLog("Delai entre deux actualisations en mode tracking : " + commande3 + "\n\n" , true);
     2226                    }
     2227                    else
     2228                    {
     2229                        AfficherLog("Le nombre qui suit le mot clé delay doit être entier et > 0  \n\n" , true);
     2230                    }
     2231                }
     2232
     2233                // Active le mode de suivi "transit"
     2234
     2235                if (commande2 == "on")
     2236                {
     2237                    CommandeOK = true;
     2238
     2239                    AfficherLog("Mode tracking activé.\n\n", true);
     2240
     2241                    Transit = false;
     2242                }
     2243            }
     2244
     2245            // A-t-on set alignment ?
     2246
     2247            if (DecompositionCommande(commande, "alignment", &commande2,  &commande3))
     2248            {
     2249
     2250                // A-ton set alignment method xxx ?
     2251
     2252                if (commande2 == "method")
     2253                {
     2254                    MethodeAlignement = NONE;
     2255
     2256                    if (commande3 == "simple") MethodeAlignement = SIMPLE;
     2257
     2258                    if (commande3 == "affine") MethodeAlignement = AFFINE;
     2259
     2260                    if (commande3 == "taki")   MethodeAlignement = TAKI;
     2261
     2262                    if (MethodeAlignement == NONE )
     2263                    {
     2264                        MethodeAlignement = SIMPLE;
     2265
     2266                        AfficherLog("Erreur: la syntaxe doit être 'set alignment method x' avec x = simple/affine/taki)\n\n" , true);
     2267                    }
     2268                    else
     2269                    {
     2270                        CommandeOK = true;
     2271
     2272                        EnvoyerMethodeAlignement();
     2273
     2274                        switch (MethodeAlignement)
     2275                        {
     2276                        case  SIMPLE :
     2277                            AfficherLog("Activation de la méthode d'alignement simple\n\n", true);
     2278                            break;
     2279                        case  AFFINE :
     2280                            AfficherLog("Activation de la méthode d'alignement affine\n\n", true);
     2281                            break;
     2282                        case  TAKI :
     2283                            AfficherLog("Activation de la méthode d'alignement taki\n\n", true);
     2284                            break;
     2285                        }
     2286                    }
    22562287                }
    22572288                else
    22582289                {
    2259                     AfficherLog("Le nombre qui suit le mot clé delay doit être entier et > 0  \n\n" , true);
    2260                 }
    2261             }
    2262 
    2263             // Active le mode de suivi "transit"
    2264 
    2265             if (commande2 == "on")
    2266             {
    2267                 CommandeOK = true;
    2268 
    2269                 AfficherLog("Mode transit activé.\n\n", true);
    2270 
    2271                 Transit = true;
    2272             }
    2273         }
    2274 
    2275         // a-t-on set tracking xxxx ?
    2276 
    2277         if (DecompositionCommande(commande, "tracking", &commande2,  &commande3))
    2278         {
    2279             // a-ton set tracking delay xxx ?
    2280 
    2281             if (commande2 == "delay")
    2282             {
    2283                 if (atoi(commande3.c_str())>0)
    2284                 {
    2285                     CommandeOK = true;
    2286 
    2287                     delaitracking = atoi(commande3.c_str());
    2288 
    2289                     EnvoyerDelaisModesTransitEtTracking();
    2290 
    2291                     AfficherLog("Delai entre deux actualisations en mode tracking : " + commande3 + "\n\n" , true);
    2292                 }
    2293                 else
    2294                 {
    2295                     AfficherLog("Le nombre qui suit le mot clé delay doit être entier et > 0  \n\n" , true);
    2296                 }
    2297             }
    2298 
    2299             // Active le mode de suivi "transit"
    2300 
    2301             if (commande2 == "on")
    2302             {
    2303                 CommandeOK = true;
    2304 
    2305                 AfficherLog("Mode tracking activé.\n\n", true);
    2306 
    2307                 Transit = false;
    2308             }
    2309         }
    2310 
    2311         // A-t-on set alignment ?
    2312 
    2313         if (DecompositionCommande(commande, "alignment", &commande2,  &commande3))
    2314         {
    2315 
    2316             // A-ton set alignment method xxx ?
    2317 
    2318             if (commande2 == "method")
    2319             {
    2320                 MethodeAlignement = NONE;
    2321 
    2322                 if (commande3 == "simple") MethodeAlignement = SIMPLE;
    2323                
    2324                 if (commande3 == "affine") MethodeAlignement = AFFINE;
    2325                
    2326                 if (commande3 == "taki")   MethodeAlignement = TAKI;
    2327 
    2328                 if (MethodeAlignement == NONE )
    2329                 {
    2330                     MethodeAlignement = SIMPLE;
    2331 
    23322290                    AfficherLog("Erreur: la syntaxe doit être 'set alignment method x' avec x = simple/affine/taki)\n\n" , true);
    23332291                }
    2334                 else
    2335                 {
    2336                     CommandeOK = true;
    2337 
    2338                     EnvoyerMethodeAlignement();
    2339 
    2340                     switch (MethodeAlignement)
    2341                     {
    2342                     case  SIMPLE :
    2343                         AfficherLog("Activation de la méthode d'alignement simple\n\n", true);
    2344                         break;
    2345                     case  AFFINE :
    2346                         AfficherLog("Activation de la méthode d'alignement affine\n\n", true);
    2347                         break;
    2348                     case  TAKI :
    2349                         AfficherLog("Activation de la méthode d'alignement taki\n\n", true);
    2350                         break;
    2351                     }
    2352                 }
    2353             }
    2354             else
    2355             {
    2356                 AfficherLog("Erreur: la syntaxe doit être 'set alignment method x' avec x = simple/affine/taki)\n\n" , true);
    2357             }
    2358         }
    2359     }
    2360 }
     2292            }
     2293        }
     2294    }
    23612295
    23622296
     
    23672301// Aide du programme
    23682302
    2369 if (chaine.find("help") != string::npos)
    2370 {
    2371     CommandeOK = true;
    2372 
    2373     cout << endl;
    2374 
    2375     cout << "connect :                Se connecte au pilote indi_BAO." << endl;
    2376     cout << "disconnect :             Se déconnecte du pilote indi_BAO." << endl;
    2377     cout << "goto AD Dec :            Pointe l'objet situé aux coordonnées apparentes AD Dec." << endl;
    2378     cout << "                         AD doit être au format xx:yy:zz et dec au format +/-xx:yy:zz" << endl;
    2379     cout << "                         exemple goto 12:10:05 -05:10:11 permettra de pointer l'objet" << endl;
    2380     cout << "                         situé aux coordonnées AD=12h10m5s et dec=-5°10'11''" << endl;
    2381     cout << "goto AD Dec J2000 :      Pointe l'objet situé aux coordonnées AD Dec dans le repÚre J2000." << endl;
    2382     cout << "                         Avant de pointer l'objet, le programme calcule la précession, la nutation et l'aberration" << endl;
    2383     cout << "                         pour ramener les coordonnées à l'écliptique et à l'équinoxe de l'observation." << endl;
    2384     cout << "goto nom_objet :         Interroge la base NED pour trouver les coordonnées de l'objet puis le pointe." << endl;
    2385     cout << "                         exemples: goto m 31, goto messier 1, goto ngc 175, goto ic 434 etc..." << endl;
    2386     cout << "                         Dans ce mode, les coordonnées sont automatiquement rapportées" << endl;
    2387     cout << "                         Ã  l'écliptique et à l'équinoxe de l'observation." << endl;
    2388     cout << "                         Aussi, merci de ne pas faire suivre les coordonnées de l'indication J2000."<< endl;
    2389     cout << "                         Goto sun permet de suivre le soleil." << endl;
    2390     cout << "search nom_objet :       Interroge le serveur NED sur internet et retourne les coordonnées de l'objet." << endl;
    2391     cout << "align ip :               Lance la procédure d'alignement de l'antenne d'adresse ip." << endl;
    2392     cout << "reset ip :               Réinitialise les paramÚtres d'alignement de l'antenne d'adresse ip." << endl;
    2393     cout << "send comm :              Envoie la commande 'comm' aux antennes." << endl;
    2394     cout << "                         exemples : send P, send A, send Gf1000f1000" << endl;
    2395     cout << "set transit on :         Active le mode de suivi transit." << endl;
    2396     cout << "set transit delay x :    Fixe la durée entre deux actualisations à x seconde(s) dans le mode transit" << endl;
    2397     cout << "set tracking on :        Active le mode de suivi tracking." << endl;
    2398     cout << "set tracking delay x :   Fixe la durée entre deux actualisations à x seconde(s) dans le mode tracking" << endl;
    2399     cout << "set alignment method x : Aligne les antennes en utilisant la méthode x (simple/affine/taki)" << endl;
    2400     cout << "status :                 Liste les paramÚtres du programme." << endl;
    2401     cout << "run filename :           Exécute le fichier de mouvements filename." << endl;
    2402     cout << "abort run :              Annule l'exécution du fichier de mouvements." << endl;
    2403     cout << "abort :                  Annule le mouvement en cours." << endl;
    2404     cout << "park :                   Place les antennes en position de repos." << endl;
    2405     cout << "updatetime :             Synchronise l'horloge du PC avec un serveur de temps." << endl;
    2406     cout << "exit :                   Sortir de BAOControl." << endl;
    2407 
    2408     cout << endl;
    2409 }
     2303    if (chaine.find("help") != string::npos)
     2304    {
     2305        CommandeOK = true;
     2306
     2307        cout << endl;
     2308
     2309        cout << "connect :                Se connecte au pilote indi_BAO." << endl;
     2310        cout << "disconnect :             Se déconnecte du pilote indi_BAO." << endl;
     2311        cout << "goto AD Dec :            Pointe l'objet situé aux coordonnées apparentes AD Dec." << endl;
     2312        cout << "                         AD doit être au format xx:yy:zz et dec au format +/-xx:yy:zz" << endl;
     2313        cout << "                         exemple goto 12:10:05 -05:10:11 permettra de pointer l'objet" << endl;
     2314        cout << "                         situé aux coordonnées AD=12h10m5s et dec=-5°10'11''" << endl;
     2315        cout << "goto AD Dec J2000 :      Pointe l'objet situé aux coordonnées AD Dec dans le repÚre J2000." << endl;
     2316        cout << "                         Avant de pointer l'objet, le programme calcule la précession, la nutation et l'aberration" << endl;
     2317        cout << "                         pour ramener les coordonnées à l'écliptique et à l'équinoxe de l'observation." << endl;
     2318        cout << "goto nom_objet :         Interroge la base NED pour trouver les coordonnées de l'objet puis le pointe." << endl;
     2319        cout << "                         exemples: goto m 31, goto messier 1, goto ngc 175, goto ic 434 etc..." << endl;
     2320        cout << "                         Dans ce mode, les coordonnées sont automatiquement rapportées" << endl;
     2321        cout << "                         Ã  l'écliptique et à l'équinoxe de l'observation." << endl;
     2322        cout << "                         Aussi, merci de ne pas faire suivre les coordonnées de l'indication J2000."<< endl;
     2323        cout << "                         Goto sun permet de suivre le soleil." << endl;
     2324        cout << "search nom_objet :       Interroge le serveur NED sur internet et retourne les coordonnées de l'objet." << endl;
     2325        cout << "align ip :               Lance la procédure d'alignement de l'antenne d'adresse ip." << endl;
     2326        cout << "reset ip :               Réinitialise les paramÚtres d'alignement de l'antenne d'adresse ip." << endl;
     2327        cout << "send comm :              Envoie la commande 'comm' aux antennes." << endl;
     2328        cout << "                         exemples : send P, send A, send Gf1000f1000" << endl;
     2329        cout << "set transit on :         Active le mode de suivi transit." << endl;
     2330        cout << "set transit delay x :    Fixe la durée entre deux actualisations à x seconde(s) dans le mode transit" << endl;
     2331        cout << "set tracking on :        Active le mode de suivi tracking." << endl;
     2332        cout << "set tracking delay x :   Fixe la durée entre deux actualisations à x seconde(s) dans le mode tracking" << endl;
     2333        cout << "set alignment method x : Aligne les antennes en utilisant la méthode x (simple/affine/taki)" << endl;
     2334        cout << "status :                 Liste les paramÚtres du programme." << endl;
     2335        cout << "run filename :           Exécute le fichier de mouvements filename." << endl;
     2336        cout << "abort run :              Annule l'exécution du fichier de mouvements." << endl;
     2337        cout << "abort :                  Annule le mouvement en cours." << endl;
     2338        cout << "park :                   Place les antennes en position de repos." << endl;
     2339        cout << "updatetime :             Synchronise l'horloge du PC avec un serveur de temps." << endl;
     2340        cout << "exit :                   Sortir de BAOControl." << endl;
     2341
     2342        cout << endl;
     2343    }
    24102344
    24112345// Bye !
    24122346
    2413 if (chaine.find("exit") != string::npos)
    2414 {
    2415     CommandeOK = true;
    2416 
    2417     if ( numAntennes > 0 ) Abort();
    2418 
    2419     usleep(500000);
    2420 
    2421     Connect(false);
    2422 
    2423     NoExit = false;
    2424 
    2425     //  pthread_join(th1 ,NULL);
    2426 }
     2347    if (chaine.find("exit") != string::npos)
     2348    {
     2349        CommandeOK = true;
     2350
     2351        if ( numAntennes > 0 ) Abort();
     2352
     2353        usleep(500000);
     2354
     2355        Connect(false);
     2356
     2357        NoExit = false;
     2358
     2359        //  pthread_join(th1 ,NULL);
     2360    }
    24272361
    24282362// La commande n'a pas été identifiée !
    24292363
    2430 if (!CommandeOK) ErreurLog("Commande inconnue... Tapez help pour obtenir la liste des commandes disponibles.\n\n");
    2431 
    2432 return "";
     2364    if (!CommandeOK) ErreurLog("Commande inconnue... Tapez help pour obtenir la liste des commandes disponibles.\n\n");
     2365
     2366    return "";
    24332367}
    24342368
  • BAORadio/libindi/libindi/BAOcontrol/baocontrol.h

    r681 r688  
    2727#include "../communs/astro.h"
    2828#include "../communs/alignement.h"
    29 
    30 
    31 
    32 
    33 
    3429
    3530
     
    113108    void Dessiner();
    114109
    115     //communications entre les antennes et le micro-contrÃŽleur
     110    // communications entre les antennes et le micro-contrÃŽleur
    116111
    117112    void LireReponse();
    118113    bool VerifReponse(string reponseattendue, string *reponse);
    119114    void UpdateTime();
    120 
    121115
    122116    // commandes disponibles
     
    213207    GC noir, vert, rouge, gris;                 // couleurs utilisées dans la fenêtre graphique
    214208   
    215    
     209 
     210 
    216211};
    217212
  • BAORadio/libindi/libindi/BAOcontrol/baoqt.cpp

    r681 r688  
    88BAOqt::BAOqt(QWidget *parent) :
    99    QDialog(parent),
     10    Server2(STELLARIUM_PORT),
    1011    ui(new Ui::BAOqt)
    1112{
    1213    QPoint pointPos;
    13    
    14     RechercheOptimisation = false;
     14
     15    RechercheOptimisation = false;
     16
     17    //Stellarium
     18
     19    last_pos[0] = current_pos[0] = desired_pos[0] = 1.0;
     20    last_pos[1] = current_pos[1] = desired_pos[1] = 0.0;
     21    last_pos[2] = current_pos[2] = desired_pos[2] = 0.0;
     22    next_pos_time = -0x8000000000000000LL;
     23
    1524
    1625    bao = new BAOcontrol();
     
    1928
    2029    ui->setupUi(dialog);
     30
     31    for(int i=0; i<4; i++) {
     32        leds.append(new QLedIndicator(this));
     33    }
     34
     35    for(int i=0; i<leds.size(); i++) {
     36        ui->layoutIndependent->addWidget(leds[i]);
     37    }
    2138
    2239    pointPos.setX(1);
     
    2744    dialog->show();
    2845
     46
    2947    connect(ui->pushButtonPark, SIGNAL(clicked()), this, SLOT(on_pushButtonPark_clicked()));
    3048
     
    6886
    6987    connect(ui->pushButtonScript, SIGNAL(clicked()), this, SLOT(on_pushButtonScript_clicked()));
    70    
     88
    7189    connect(ui->pushButtonCalculMatrices, SIGNAL(clicked()), this, SLOT(on_pushButtonCalculMatrices_clicked()));
    72    
     90
    7391    connect(ui->pushButtonOptGeom, SIGNAL(clicked()), this, SLOT(on_pushButtonOptGeom_clicked()));
     92
     93    connect(ui->pushButtonRetryGoto, SIGNAL(clicked()), this, SLOT(on_pushButtonRetryGoto_clicked()));
     94
     95
     96
     97#ifdef JOYSTICK
     98    joystick = new Joystick();
     99
     100    if (joystick) joystick->init();
     101#endif
     102
     103    ui->lineEditIP->setText("127.0.0.1");
     104
     105    // On laisse le temps au serveur de Stellarium de démarrer dans de bonnes conditions
     106
     107    sleep(1);
     108
     109    //Timer
    74110
    75111    DisableButtons(true);
     
    83119
    84120    timer->start(100);
    85 
    86     ui->lineEditIP->setText("127.0.0.1");
    87121}
    88122
    89123BAOqt::~BAOqt()
    90124{
     125    close();
     126
     127    timer->stop();
     128
     129    delete timer;
     130
    91131    delete ui;
    92132    delete dialog;
    93133    delete bao;
    94134
    95     delete timer;
     135#ifdef JOYSTICK
     136    if (joystick)
     137    {
     138        joystick->close();
     139
     140        delete joystick;
     141    }
     142#endif
     143
     144
     145}
     146
     147
     148void BAOqt::step(long long int timeout_micros)
     149{
     150    if (last_pos[0]!=current_pos[0] || last_pos[1]!=current_pos[1] || last_pos[2]!=current_pos[2])
     151    {
     152        current_pos[0] = desired_pos[0];
     153        current_pos[1] = desired_pos[1];
     154        current_pos[2] = desired_pos[2];
     155
     156        const double ra = atan2(current_pos[1],current_pos[0]);
     157        const double dec = atan2(current_pos[2],
     158                                 sqrt(current_pos[0]*current_pos[0]+current_pos[1]*current_pos[1]));
     159
     160        // On passe les coordonnées aux antennes
     161
     162        ui->lineEditEtoileSelectionneeAD->setText(QString(DHMS(VerifAngle(ra)*180.0/M_PI, true).c_str()));
     163        ui->lineEditEtoileSelectionneeDec->setText(QString(DHMS(dec*180.0/M_PI, false).c_str()));
     164
     165        bao->Goto(DHMS(VerifAngle(ra)*180.0/M_PI, true), DHMS(dec*180.0/M_PI, false), bao->Transit, false);
     166
     167        last_pos[0] = current_pos[0];
     168        last_pos[1] = current_pos[1];
     169        last_pos[2] = current_pos[2];
     170
     171    }
     172
     173    Server2::step(timeout_micros);
     174}
     175
     176void BAOqt::gotoReceived(unsigned int ra_int, int dec_int)
     177{
     178    const double ra = ra_int*(M_PI/(unsigned int)0x80000000);
     179    const double dec = dec_int*(M_PI/(unsigned int)0x80000000);
     180    const double cdec = cos(dec);
     181
     182    desired_pos[0] = cos(ra)*cdec;
     183    desired_pos[1] = sin(ra)*cdec;
     184    desired_pos[2] = sin(dec);
     185
     186    last_pos[0] = -1000000L;
    96187}
    97188
    98189void BAOqt::DisableButtons(bool b)
    99190{
     191    RechercheOptimisation = false;
     192
    100193    ui->pushButtonChoisir->setDisabled(b);
    101194
     
    113206
    114207    ui->pushButton1pt->setDisabled(b);
    115    
     208
    116209    ui->pushButtonCalculMatrices->setDisabled(b);
    117    
     210
    118211    ui->pushButtonOptGeom->setDisabled(b);
    119212}
     
    121214void BAOqt::updateCaption()
    122215{
     216    static int StartStellariumServer = 0;
     217    static int joy = 0;
     218
    123219    if (RechercheOptimisation) return;
    124    
     220
    125221    bao->thread_process();
    126222
     
    152248        }
    153249    }
     250
     251    // affichage des cercles d'état des antennes
     252    // vert = l'antenne fonctionne
     253    // rouge = problÚme détecté sur l'antenne
     254    // gris = antenne non connectée
     255
     256    for (int i=0; i <4; i++)
     257    {
     258        switch (bao->Antennes[i].ok)
     259        {
     260        case 1 :
     261            leds[i]->red = false;
     262            leds[i]->setChecked( true );
     263            break;
     264        case 2 :
     265
     266            leds[i]->red = true;
     267            leds[i]->setChecked( true );
     268
     269            break;
     270        default:
     271            leds[i]->red = false;
     272            leds[i]->setChecked( false );
     273            break;
     274        }
     275    }
     276
     277    dialog->repaint();
     278
     279#ifdef JOYSTICK
     280    joy++;
     281
     282    int max = 2000;
     283
     284    if (joy>1)
     285    {
     286        joy = 0;
     287
     288        JoystickStatus js;
     289
     290        if (joystick)
     291        {
     292            if (joystick->GetStatus( js))
     293            {
     294                if (js.x < -max) on_pushButtonAzM_clicked();
     295                if (js.x > max)  on_pushButtonAzP_clicked();
     296                if (js.y < -max) on_pushButtonHaP_clicked();
     297                if (js.y > max)  on_pushButtonHaM_clicked();
     298                if (js.button1)
     299                {
     300                    on_pushButton1x_clicked();
     301                    ui->pushButton1x->setDown(true);
     302                    ui->pushButton10x->setDown(false);
     303                }
     304                if (js.button2)
     305                {
     306                    on_pushButton10x_clicked();
     307                    ui->pushButton1x->setDown(false);
     308                    ui->pushButton10x->setDown(true);
     309                }
     310            }
     311        }
     312    }
     313#endif
     314
     315
     316    if (StartStellariumServer < 10)
     317    {
     318        StartStellariumServer++;
     319    }
     320    else
     321    {
     322        step(1000);
     323    }
    154324}
    155325
    156326void BAOqt::on_pushButtonPark_clicked()
    157327{
     328    RechercheOptimisation = false;
     329
    158330    bao->DecodageEntreesUtilisateur("park");
    159331}
     
    161333void BAOqt::on_pushButtonAbort_clicked()
    162334{
     335    RechercheOptimisation = false;
     336
    163337    bao->DecodageEntreesUtilisateur("abort");
    164338}
     
    166340void BAOqt::on_pushButtonCommande_clicked()
    167341{
     342    RechercheOptimisation = false;
     343
    168344    QString chaine = ui->lineEditCommande->text();
    169345
     
    173349void BAOqt::on_pushButtonAzM_clicked()
    174350{
     351    RechercheOptimisation = false;
     352
    175353    bao->AlignementDelta("-1", true);
    176354}
     
    178356void BAOqt::on_pushButtonAzP_clicked()
    179357{
     358    RechercheOptimisation = false;
     359
    180360    bao->AlignementDelta("1", true);
    181361}
     
    183363void BAOqt::on_pushButtonHaM_clicked()
    184364{
     365    RechercheOptimisation = false;
     366
    185367    bao->AlignementDelta("-1", false);
    186368}
     
    188370void BAOqt::on_pushButtonHaP_clicked()
    189371{
     372    RechercheOptimisation = false;
     373
    190374    bao->AlignementDelta("1", false);
    191375}
     
    193377void BAOqt::on_pushButton1x_clicked()
    194378{
     379    RechercheOptimisation = false;
     380
    195381    bao->VitesseAlignement(1);
    196382
     
    201387void BAOqt::on_pushButton10x_clicked()
    202388{
     389    RechercheOptimisation = false;
     390
    203391    bao->VitesseAlignement(10);
    204392
     
    209397void BAOqt::on_pushButtonIP_clicked()
    210398{
     399    RechercheOptimisation = false;
     400
    211401    QString chaine = ui->lineEditIP->text();
    212402
     
    225415void BAOqt::on_pushButtonChoisir_clicked()
    226416{
     417    RechercheOptimisation = false;
     418
    227419    bao->AlignementAntenneIP(ui->lineEditIP->text().toStdString());
    228420
     
    284476void BAOqt::on_pushButtonSelectionner_clicked()
    285477{
     478    RechercheOptimisation = false;
     479
    286480    bao->Goto( ui->lineEditEtoileSelectionneeAD->text().toStdString(), ui->lineEditEtoileSelectionneeDec->text().toStdString(), bao->Transit, false);
    287481}
     
    289483void BAOqt::on_pushButtonValider_clicked()
    290484{
     485    RechercheOptimisation = false;
     486
    291487    bao->ValidationAlignement();
    292488}
     
    294490void BAOqt::on_pushButtonSauvegarder_clicked()
    295491{
     492    RechercheOptimisation = false;
     493
    296494    bao->SauvegardeAlignement();
    297495}
     
    300498{
    301499    QMessageBox::StandardButton reply;
     500
     501    RechercheOptimisation = false;
    302502
    303503    reply = QMessageBox::question(this, tr("Reset alignement"),
     
    311511{
    312512    Liste liste;
     513
     514    RechercheOptimisation = false;
    313515
    314516    stringstream os;
     
    346548    Map map1;
    347549
     550    RechercheOptimisation = false;
     551
    348552    string str = bao->DecodageEntreesUtilisateur("send C");
    349553
     
    358562{
    359563    static int etape = 1;
     564
     565    RechercheOptimisation = false;
    360566
    361567    switch (etape)
     
    429635                dx = atol( str2.substr(0, pos).c_str() );
    430636
    431                 x += dx;
     637                x -= dx;
    432638
    433639                dy = atol( str2.substr(pos + 1).c_str() );
    434640
    435                 y += dy;
     641                y -= dy;
    436642
    437643                if ( x < 0 ) {
     
    447653                char chaine[100];
    448654
    449                 sprintf(chaine, "send g%c%04d%c%04d", a1, x, a2, y);
     655                sprintf(chaine, "send g%c%04df0000", a1, x);
    450656
    451657                str = bao->DecodageEntreesUtilisateur(string(chaine));
    452658
     659                QMessageBox::information(this, tr("Alignement 1pt de l antenne"), tr("Attendez la fin du mouvement avant de cliquer sur OK."));
     660
     661
     662                sprintf(chaine, "send gf0000%c%04d", a2, y);
     663
     664                str = bao->DecodageEntreesUtilisateur(string(chaine));
    453665                QMessageBox::information(this, tr("Alignement 1pt de l antenne"), tr("Appuyez sur les deux boutons places dans la boite de l'antenne."));
    454                
    455                  str = bao->DecodageEntreesUtilisateur("send p");
    456                
    457                 QMessageBox::StandardButton reply;
    458                
    459                 reply = QMessageBox::question(this, tr("Alignement 1pt de l antenne"),
    460                                   "Voulez-vous reinitialiser les codeurs de l'antenne en envoyant la c ommande Park ?",
    461                                   QMessageBox::Yes | QMessageBox::No );
    462 
    463                if (reply == QMessageBox::Yes)
    464                {
    465 
    466                 str = bao->DecodageEntreesUtilisateur("send z");
    467 
    468                 sleep(1);
    469 
    470                 str = bao->DecodageEntreesUtilisateur("send p");
    471                }
    472                QMessageBox::information(this, tr("Alignement 1pt de l antenne"), tr("Fin de la procedure."));
     666
     667                QMessageBox::StandardButton reply;
     668
     669                reply = QMessageBox::question(this, tr("Alignement 1pt de l antenne"),
     670                                              "Voulez-vous reinitialiser les codeurs de l'antenne en envoyant la c ommande Park ?",
     671                                              QMessageBox::Yes | QMessageBox::No );
     672
     673                if (reply == QMessageBox::Yes)
     674                {
     675
     676                    str = bao->DecodageEntreesUtilisateur("send z");
     677
     678                    sleep(1);
     679
     680                    str = bao->DecodageEntreesUtilisateur("send p");
     681                }
     682                QMessageBox::information(this, tr("Alignement 1pt de l antenne"), tr("Fin de la procedure."));
    473683            }
    474684        }
     
    482692{
    483693    bool ok;
     694
     695    RechercheOptimisation = false;
     696
    484697    QString text = QInputDialog::getText(this, tr("Goto"),
    485698                                         tr("Entrez le nom ou les coordonnees de l'objet a suivre"), QLineEdit::Normal,
     
    492705void BAOqt::on_pushButtonTo00_clicked()
    493706{
     707    RechercheOptimisation = false;
     708
    494709    string str = bao->DecodageEntreesUtilisateur("send X");
    495710
     
    537752void BAOqt::on_pushButtonCalculMatrices_clicked()
    538753{
    539    bao->DecodageEntreesUtilisateur("send m");
     754    RechercheOptimisation = false;
     755
     756    bao->DecodageEntreesUtilisateur("send m");
    540757}
    541758
     
    547764void BAOqt::on_pushButtonOptGeom_clicked()
    548765{
    549   RechercheOptimisation=true;
    550  
     766    RechercheOptimisation = true;
     767
    551768    bao->DecodageEntreesUtilisateur("send o");
    552769}
     770
     771void BAOqt::on_pushButtonRetryGoto_clicked()
     772{
     773    RechercheOptimisation = true;
     774
     775    RechercheOptimisation = false;
     776
     777    bao->Goto( ui->lineEditEtoileSelectionneeAD->text().toStdString(), ui->lineEditEtoileSelectionneeDec->text().toStdString(), bao->Transit, false);
     778}
  • BAORadio/libindi/libindi/BAOcontrol/baoqt.h

    r681 r688  
    1515#include "baocontrol.h"
    1616
     17#include "qledindicator.h"
     18
     19#include "Joystick.h"
     20
     21#include "Server.hpp"
     22
     23#include "../communs/astro.h"
     24
    1725namespace Ui {
    18     class BAOqt;
     26class BAOqt;
    1927}
    2028
    21 class BAOqt : public QDialog
     29class BAOqt : public QDialog, public Server2, public Astro
    2230{
    2331    Q_OBJECT
     
    2634    explicit BAOqt(QWidget *parent = 0);
    2735    ~BAOqt();
    28    
     36
    2937    void DisableButtons(bool b);
    30    
     38
     39    void step(long long int timeout_micros);
     40
     41    QList<QLedIndicator*> leds;
     42    QButtonGroup   *group;
     43
    3144    QDialog *dialog;
    32    
     45
    3346    BAOcontrol *bao;
    34        
     47
    3548    QTimer *timer;
    36    
     49
    3750    bool RechercheOptimisation;
    3851
    39        
     52    Joystick *joystick;
     53
     54
    4055private slots :
    41    void on_pushButtonPark_clicked();
    42    void on_pushButtonCommande_clicked();
    43    void on_pushButtonAbort_clicked();
    44    void on_pushButtonAzM_clicked();
    45    void on_pushButtonAzP_clicked();
    46    void on_pushButtonHaM_clicked();
    47    void on_pushButtonHaP_clicked();
    48    void on_pushButton1x_clicked();
    49    void on_pushButton10x_clicked();
    50    void on_pushButtonIP_clicked();
    51    void on_pushButtonChoisir_clicked();
    52    void on_pushButtonSelectionner_clicked();
    53    void on_pushButtonValider_clicked();
    54    void on_pushButtonSauvegarder_clicked();
    55    void on_pushButtonReset_clicked();
    56    void on_pushButtonListe_clicked();
    57    void on_pushButtonMap_clicked();
    58    void on_pushButton1pt_clicked();
    59    void on_pushButtonGoto_clicked();
    60    void on_pushButtonTo00_clicked();
    61    void on_pushButtonScript_clicked();
    62    void on_pushButtonCalculMatrices_clicked();
    63    void on_pushButtonOptGeom_clicked();
    64    void updateCaption();
     56    void on_pushButtonPark_clicked();
     57    void on_pushButtonCommande_clicked();
     58    void on_pushButtonAbort_clicked();
     59    void on_pushButtonAzM_clicked();
     60    void on_pushButtonAzP_clicked();
     61    void on_pushButtonHaM_clicked();
     62    void on_pushButtonHaP_clicked();
     63    void on_pushButton1x_clicked();
     64    void on_pushButton10x_clicked();
     65    void on_pushButtonIP_clicked();
     66    void on_pushButtonChoisir_clicked();
     67    void on_pushButtonSelectionner_clicked();
     68    void on_pushButtonValider_clicked();
     69    void on_pushButtonSauvegarder_clicked();
     70    void on_pushButtonReset_clicked();
     71    void on_pushButtonListe_clicked();
     72    void on_pushButtonMap_clicked();
     73    void on_pushButton1pt_clicked();
     74    void on_pushButtonGoto_clicked();
     75    void on_pushButtonTo00_clicked();
     76    void on_pushButtonScript_clicked();
     77    void on_pushButtonCalculMatrices_clicked();
     78    void on_pushButtonOptGeom_clicked();
     79    void on_pushButtonRetryGoto_clicked();
     80    void updateCaption();
    6581
    6682private:
    6783    Ui::BAOqt *ui;
     84
     85private:
     86    void gotoReceived(unsigned int ra_int,int dec_int);
     87    double current_pos[3];
     88    double desired_pos[3];
     89    double last_pos[3];
     90    long long int next_pos_time;
    6891};
    6992
  • BAORadio/libindi/libindi/BAOcontrol/baoqt.ui

    r681 r688  
    88    <y>0</y>
    99    <width>630</width>
    10     <height>396</height>
     10    <height>403</height>
    1111   </rect>
    1212  </property>
     
    2121    <rect>
    2222     <x>230</x>
    23      <y>145</y>
     23     <y>155</y>
    2424     <width>151</width>
    2525     <height>27</height>
     
    3434    <rect>
    3535     <x>450</x>
    36      <y>180</y>
     36     <y>190</y>
    3737     <width>161</width>
    3838     <height>191</height>
     
    120120    </property>
    121121   </widget>
     122   <widget class="QPushButton" name="pushButtonRetryGoto">
     123    <property name="geometry">
     124     <rect>
     125      <x>65</x>
     126      <y>76</y>
     127      <width>31</width>
     128      <height>27</height>
     129     </rect>
     130    </property>
     131    <property name="text">
     132     <string>R</string>
     133    </property>
     134   </widget>
    122135  </widget>
    123136  <widget class="QLineEdit" name="lineEditCommande">
     
    125138    <rect>
    126139     <x>20</x>
    127      <y>147</y>
     140     <y>157</y>
    128141     <width>201</width>
    129142     <height>24</height>
     
    135148    <rect>
    136149     <x>20</x>
    137      <y>180</y>
     150     <y>190</y>
    138151     <width>101</width>
    139152     <height>191</height>
     
    238251    <rect>
    239252     <x>140</x>
    240      <y>180</y>
     253     <y>190</y>
    241254     <width>291</width>
    242255     <height>191</height>
     
    424437    <rect>
    425438     <x>30</x>
    426      <y>370</y>
     439     <y>380</y>
    427440     <width>161</width>
    428441     <height>24</height>
     
    446459    <rect>
    447460     <x>541</x>
    448      <y>49</y>
     461     <y>82</y>
    449462     <width>80</width>
    450      <height>71</height>
     463     <height>70</height>
    451464    </rect>
    452465   </property>
     
    459472    <rect>
    460473     <x>20</x>
    461      <y>28</y>
     474     <y>38</y>
    462475     <width>511</width>
    463476     <height>115</height>
     
    467480    <string notr="true">font: 7pt &quot;Sans Serif&quot;;</string>
    468481   </property>
     482  </widget>
     483  <widget class="QGroupBox" name="groupIndependent">
     484   <property name="geometry">
     485    <rect>
     486     <x>536</x>
     487     <y>10</y>
     488     <width>92</width>
     489     <height>51</height>
     490    </rect>
     491   </property>
     492   <property name="title">
     493    <string>Status</string>
     494   </property>
     495   <layout class="QGridLayout" name="gridLayout">
     496    <item row="0" column="0">
     497     <layout class="QHBoxLayout" name="layoutIndependent">
     498      <property name="spacing">
     499       <number>4</number>
     500      </property>
     501     </layout>
     502    </item>
     503   </layout>
    469504  </widget>
    470505 </widget>
  • BAORadio/libindi/libindi/BAOcontrol/liste.cpp

    r681 r688  
    2727 
    2828    delete ui;
     29   
     30    close();
    2931}
    3032
  • BAORadio/libindi/libindi/BAOcontrol/map.cpp

    r681 r688  
    1616{
    1717    delete ui;
     18   
     19    close();
    1820}
    1921
  • BAORadio/libindi/libindi/BAOcontrol/selectstars.cpp

    r681 r688  
    1818{
    1919    delete ui;
     20   
     21    close();
    2022}
    2123
  • BAORadio/libindi/libindi/Makefile

    r678 r688  
    11#############################################################################
    22# Makefile for building: libindi
    3 # Generated by qmake (2.01a) (Qt 4.7.4) on: mar. mai 15 01:36:10 2012
     3# Generated by qmake (2.01a) (Qt 4.7.4) on: sam. mai 26 03:17:23 2012
    44# Project:  libindi.pro
    55# Template: app
     
    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. -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.
    1717LINK          = g++
    1818LFLAGS        = -m64 -Wl,-O1
     
    5050                indidrivermain.c \
    5151                indiserver.c \
    52                 BAOControl/baocontrol.cpp \
    53                 BAOControl/baoqt.cpp \
    54                 BAOControl/main.cpp \
     52                BAOcontrol/baocontrol.cpp \
     53                BAOcontrol/baoqt.cpp \
     54                BAOcontrol/Connection.cpp \
     55                BAOcontrol/Joystick.cpp \
     56                BAOcontrol/liste.cpp \
     57                BAOcontrol/Listener.cpp \
     58                BAOcontrol/LogFile.cpp \
     59                BAOcontrol/main.cpp \
     60                BAOcontrol/map.cpp \
     61                BAOcontrol/qledindicator.cpp \
     62                BAOcontrol/selectstars.cpp \
     63                BAOcontrol/Server.cpp \
     64                BAOcontrol/Socket2.cpp \
    5565                BAOTest/BAOtest_main.cpp \
    5666                communs/alignement.cpp \
     
    142152                libs/webcam/v4l2_base.cpp \
    143153                libindi_build/CMakeFiles/CompilerIdC/CMakeCCompilerId.c \
    144                 libindi_build/CMakeFiles/CompilerIdCXX/CMakeCXXCompilerId.cpp moc_baoqt.cpp
     154                libindi_build/CMakeFiles/CompilerIdCXX/CMakeCXXCompilerId.cpp moc_baoqt.cpp \
     155                moc_liste.cpp \
     156                moc_map.cpp \
     157                moc_qledindicator.cpp \
     158                moc_selectstars.cpp
    145159OBJECTS       = base64.o \
    146160                eventloop.o \
     
    151165                baocontrol.o \
    152166                baoqt.o \
     167                Connection.o \
     168                Joystick.o \
     169                liste.o \
     170                Listener.o \
     171                LogFile.o \
    153172                main.o \
     173                map.o \
     174                qledindicator.o \
     175                selectstars.o \
     176                Server.o \
     177                Socket2.o \
    154178                BAOtest_main.o \
    155179                alignement.o \
     
    242266                CMakeCCompilerId.o \
    243267                CMakeCXXCompilerId.o \
    244                 moc_baoqt.o
     268                moc_baoqt.o \
     269                moc_liste.o \
     270                moc_map.o \
     271                moc_qledindicator.o \
     272                moc_selectstars.o
    245273DIST          = /usr/share/qt4/mkspecs/common/g++.conf \
    246274                /usr/share/qt4/mkspecs/common/unix.conf \
     
    292320all: Makefile $(TARGET)
    293321
    294 $(TARGET): ui_baoqt.h $(OBJECTS) 
     322$(TARGET): ui_baoqt.h ui_liste.h ui_map.h ui_selectstars.h $(OBJECTS) 
    295323        $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
    296324
     
    345373dist:
    346374        @$(CHK_DIR_EXISTS) .tmp/libindi1.0.0 || $(MKDIR) .tmp/libindi1.0.0
    347         $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/libindi1.0.0/ && $(COPY_FILE) --parents base64.h config.h eventloop.h fq.h indiapi.h indidevapi.h indidriver.h BAOControl/baocontrol.h BAOControl/baoqt.h communs/alignement.h communs/alt2motor.h communs/astro.h communs/ClientSocket.h communs/const.h communs/exception.h communs/filetools.h communs/logs.h communs/ServerSocket.h communs/Socket.h communs/SocketException.h examples/tutorial_client.h examples/tutorial_four.h libindi_build/config.h libs/indicom.h libs/lilxml.h drivers/ccd/ccd_simulator.h drivers/filter_wheel/filter_simulator.h drivers/focuser/robofocus.h drivers/focuser/robofocusdriver.h drivers/focuser/tcfs.h drivers/telescope/BAO.h drivers/telescope/celestrongps.h drivers/telescope/celestronprotocol.h drivers/telescope/ieq45.h drivers/telescope/ieq45driver.h drivers/telescope/lx200_16.h drivers/telescope/lx200ap.h drivers/telescope/lx200apdriver.h drivers/telescope/lx200aplib.h drivers/telescope/lx200autostar.h drivers/telescope/lx200basic.h drivers/telescope/lx200classic.h drivers/telescope/lx200driver.h drivers/telescope/lx200fs2.h drivers/telescope/lx200generic.h drivers/telescope/lx200gps.h drivers/telescope/magellan1.h drivers/telescope/magellandriver.h drivers/telescope/orionatlas.h drivers/telescope/synscanmount.h drivers/telescope/telescope_simulator.h drivers/telescope/temmadriver.h drivers/video/stvdriver.h drivers/video/v4ldriver.h drivers/video/v4lphilips.h Indi_Stellarium/src/Connection.hpp Indi_Stellarium/src/Listener.hpp Indi_Stellarium/src/LogFile.hpp Indi_Stellarium/src/Server.hpp Indi_Stellarium/src/ServerBAO.hpp Indi_Stellarium/src/Socket2.hpp libs/indibase/baseclient.h libs/indibase/basedriver.h libs/indibase/defaultdriver.h libs/indibase/indibase.h libs/indibase/indiccd.h libs/indibase/indidevice.h libs/indibase/indifilterinterface.h libs/indibase/indifilterwheel.h libs/indibase/indifocuser.h libs/indibase/indiguiderinterface.h libs/indibase/inditelescope.h libs/indibase/indiusbdevice.h libs/webcam/ccvt.h libs/webcam/ccvt_types.h libs/webcam/port.h libs/webcam/PPort.h libs/webcam/pwc-ioctl.h libs/webcam/v4l1_base.h libs/webcam/v4l1_pwc.h libs/webcam/v4l2_base.h libs/webcam/vcvt.h libs/webcam/videodev.h libs/webcam/videodev2.h .tmp/libindi1.0.0/ && $(COPY_FILE) --parents base64.c eventloop.c fq.c indidriver.c indidrivermain.c indiserver.c BAOControl/baocontrol.cpp BAOControl/baoqt.cpp BAOControl/main.cpp BAOTest/BAOtest_main.cpp communs/alignement.cpp communs/astro.cpp communs/ClientSocket.cpp communs/exception.cpp communs/filetools.cpp communs/logs.cpp communs/ServerSocket.cpp communs/Socket.cpp examples/tutorial_ccdpreview.c examples/tutorial_client.cpp examples/tutorial_dome.c examples/tutorial_four.cpp examples/tutorial_one.c examples/tutorial_rain.c examples/tutorial_three.c examples/tutorial_two.c libs/indicom.c libs/lilxml.c tools/compiler.c tools/evalINDI.c tools/getINDIproperty.c tools/setINDIproperty.c drivers/ccd/ccd_simulator.cpp drivers/ccd/fli_ccd.c drivers/filter_wheel/filter_simulator.cpp drivers/filter_wheel/fli_wheel.c drivers/filter_wheel/trutech_wheel.c drivers/focuser/fli_pdf.c drivers/focuser/robofocus.c drivers/focuser/robofocus.cpp drivers/focuser/robofocusdriver.c drivers/focuser/tcfs.cpp drivers/telescope/BAO.cpp drivers/telescope/celestrongps.cpp drivers/telescope/celestronprotocol.c drivers/telescope/ieq45.cpp drivers/telescope/ieq45driver.c drivers/telescope/intelliscope.c drivers/telescope/lx200_16.cpp drivers/telescope/lx200ap.cpp drivers/telescope/lx200apdriver.c drivers/telescope/lx200autostar.cpp drivers/telescope/lx200basic.cpp drivers/telescope/lx200classic.cpp drivers/telescope/lx200driver.c drivers/telescope/lx200fs2.cpp drivers/telescope/lx200generic.cpp drivers/telescope/lx200gps.cpp drivers/telescope/magellan1.cpp drivers/telescope/magellandriver.c drivers/telescope/orionatlas.cpp drivers/telescope/skycommander.c drivers/telescope/synscanmount.cpp drivers/telescope/telescope_simulator.cpp drivers/telescope/temmadriver.c drivers/video/indi_lpi.cpp drivers/video/indi_philips.cpp drivers/video/indi_v4l.cpp drivers/video/stv.c drivers/video/stvdriver.c drivers/video/v4ldriver.cpp drivers/video/v4lphilips.cpp Indi_Stellarium/src/Connection.cpp Indi_Stellarium/src/Listener.cpp Indi_Stellarium/src/LogFile.cpp Indi_Stellarium/src/MainBAO.cpp Indi_Stellarium/src/Server.cpp Indi_Stellarium/src/ServerBAO.cpp Indi_Stellarium/src/Socket2.cpp libs/indibase/baseclient.cpp libs/indibase/basedriver.cpp libs/indibase/defaultdriver.cpp libs/indibase/indiccd.cpp libs/indibase/indidevice.cpp libs/indibase/indifilterinterface.cpp libs/indibase/indifilterwheel.cpp libs/indibase/indifocuser.cpp libs/indibase/indiguiderinterface.cpp libs/indibase/inditelescope.cpp libs/indibase/indiusbdevice.cpp libs/webcam/ccvt_c2.c libs/webcam/ccvt_misc.c libs/webcam/port.cpp libs/webcam/PPort.cpp libs/webcam/v4l1_base.cpp libs/webcam/v4l1_pwc.cpp libs/webcam/v4l2_base.cpp libindi_build/CMakeFiles/CompilerIdC/CMakeCCompilerId.c libindi_build/CMakeFiles/CompilerIdCXX/CMakeCXXCompilerId.cpp .tmp/libindi1.0.0/ && $(COPY_FILE) --parents BAOControl/baoqt.ui .tmp/libindi1.0.0/ && (cd `dirname .tmp/libindi1.0.0` && $(TAR) libindi1.0.0.tar libindi1.0.0 && $(COMPRESS) libindi1.0.0.tar) && $(MOVE) `dirname .tmp/libindi1.0.0`/libindi1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/libindi1.0.0
     375        $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/libindi1.0.0/ && $(COPY_FILE) --parents base64.h config.h eventloop.h fq.h indiapi.h indidevapi.h indidriver.h BAOcontrol/baocontrol.h BAOcontrol/baoqt.h BAOcontrol/Connection.hpp BAOcontrol/Joystick.h BAOcontrol/liste.h BAOcontrol/Listener.hpp BAOcontrol/LogFile.hpp BAOcontrol/map.h BAOcontrol/qledindicator.h BAOcontrol/selectstars.h BAOcontrol/Server.hpp BAOcontrol/Socket2.hpp communs/alignement.h communs/astro.h communs/ClientSocket.h communs/const.h communs/exception.h communs/filetools.h communs/logs.h communs/ServerSocket.h communs/Socket.h communs/SocketException.h examples/tutorial_client.h examples/tutorial_four.h libindi_build/config.h libs/indicom.h libs/lilxml.h drivers/ccd/ccd_simulator.h drivers/filter_wheel/filter_simulator.h drivers/focuser/robofocus.h drivers/focuser/robofocusdriver.h drivers/focuser/tcfs.h drivers/telescope/BAO.h drivers/telescope/celestrongps.h drivers/telescope/celestronprotocol.h drivers/telescope/ieq45.h drivers/telescope/ieq45driver.h drivers/telescope/lx200_16.h drivers/telescope/lx200ap.h drivers/telescope/lx200apdriver.h drivers/telescope/lx200aplib.h drivers/telescope/lx200autostar.h drivers/telescope/lx200basic.h drivers/telescope/lx200classic.h drivers/telescope/lx200driver.h drivers/telescope/lx200fs2.h drivers/telescope/lx200generic.h drivers/telescope/lx200gps.h drivers/telescope/magellan1.h drivers/telescope/magellandriver.h drivers/telescope/orionatlas.h drivers/telescope/synscanmount.h drivers/telescope/telescope_simulator.h drivers/telescope/temmadriver.h drivers/video/stvdriver.h drivers/video/v4ldriver.h drivers/video/v4lphilips.h Indi_Stellarium/src/Connection.hpp Indi_Stellarium/src/Listener.hpp Indi_Stellarium/src/LogFile.hpp Indi_Stellarium/src/Server.hpp Indi_Stellarium/src/ServerBAO.hpp Indi_Stellarium/src/Socket2.hpp libs/indibase/baseclient.h libs/indibase/basedriver.h libs/indibase/defaultdriver.h libs/indibase/indibase.h libs/indibase/indiccd.h libs/indibase/indidevice.h libs/indibase/indifilterinterface.h libs/indibase/indifilterwheel.h libs/indibase/indifocuser.h libs/indibase/indiguiderinterface.h libs/indibase/inditelescope.h libs/indibase/indiusbdevice.h libs/webcam/ccvt.h libs/webcam/ccvt_types.h libs/webcam/port.h libs/webcam/PPort.h libs/webcam/pwc-ioctl.h libs/webcam/v4l1_base.h libs/webcam/v4l1_pwc.h libs/webcam/v4l2_base.h libs/webcam/vcvt.h libs/webcam/videodev.h libs/webcam/videodev2.h .tmp/libindi1.0.0/ && $(COPY_FILE) --parents base64.c eventloop.c fq.c indidriver.c indidrivermain.c indiserver.c BAOcontrol/baocontrol.cpp BAOcontrol/baoqt.cpp BAOcontrol/Connection.cpp BAOcontrol/Joystick.cpp BAOcontrol/liste.cpp BAOcontrol/Listener.cpp BAOcontrol/LogFile.cpp BAOcontrol/main.cpp BAOcontrol/map.cpp BAOcontrol/qledindicator.cpp BAOcontrol/selectstars.cpp BAOcontrol/Server.cpp BAOcontrol/Socket2.cpp BAOTest/BAOtest_main.cpp communs/alignement.cpp communs/astro.cpp communs/ClientSocket.cpp communs/exception.cpp communs/filetools.cpp communs/logs.cpp communs/ServerSocket.cpp communs/Socket.cpp examples/tutorial_ccdpreview.c examples/tutorial_client.cpp examples/tutorial_dome.c examples/tutorial_four.cpp examples/tutorial_one.c examples/tutorial_rain.c examples/tutorial_three.c examples/tutorial_two.c libs/indicom.c libs/lilxml.c tools/compiler.c tools/evalINDI.c tools/getINDIproperty.c tools/setINDIproperty.c drivers/ccd/ccd_simulator.cpp drivers/ccd/fli_ccd.c drivers/filter_wheel/filter_simulator.cpp drivers/filter_wheel/fli_wheel.c drivers/filter_wheel/trutech_wheel.c drivers/focuser/fli_pdf.c drivers/focuser/robofocus.c drivers/focuser/robofocus.cpp drivers/focuser/robofocusdriver.c drivers/focuser/tcfs.cpp drivers/telescope/BAO.cpp drivers/telescope/celestrongps.cpp drivers/telescope/celestronprotocol.c drivers/telescope/ieq45.cpp drivers/telescope/ieq45driver.c drivers/telescope/intelliscope.c drivers/telescope/lx200_16.cpp drivers/telescope/lx200ap.cpp drivers/telescope/lx200apdriver.c drivers/telescope/lx200autostar.cpp drivers/telescope/lx200basic.cpp drivers/telescope/lx200classic.cpp drivers/telescope/lx200driver.c drivers/telescope/lx200fs2.cpp drivers/telescope/lx200generic.cpp drivers/telescope/lx200gps.cpp drivers/telescope/magellan1.cpp drivers/telescope/magellandriver.c drivers/telescope/orionatlas.cpp drivers/telescope/skycommander.c drivers/telescope/synscanmount.cpp drivers/telescope/telescope_simulator.cpp drivers/telescope/temmadriver.c drivers/video/indi_lpi.cpp drivers/video/indi_philips.cpp drivers/video/indi_v4l.cpp drivers/video/stv.c drivers/video/stvdriver.c drivers/video/v4ldriver.cpp drivers/video/v4lphilips.cpp Indi_Stellarium/src/Connection.cpp Indi_Stellarium/src/Listener.cpp Indi_Stellarium/src/LogFile.cpp Indi_Stellarium/src/MainBAO.cpp Indi_Stellarium/src/Server.cpp Indi_Stellarium/src/ServerBAO.cpp Indi_Stellarium/src/Socket2.cpp libs/indibase/baseclient.cpp libs/indibase/basedriver.cpp libs/indibase/defaultdriver.cpp libs/indibase/indiccd.cpp libs/indibase/indidevice.cpp libs/indibase/indifilterinterface.cpp libs/indibase/indifilterwheel.cpp libs/indibase/indifocuser.cpp libs/indibase/indiguiderinterface.cpp libs/indibase/inditelescope.cpp libs/indibase/indiusbdevice.cpp libs/webcam/ccvt_c2.c libs/webcam/ccvt_misc.c libs/webcam/port.cpp libs/webcam/PPort.cpp libs/webcam/v4l1_base.cpp libs/webcam/v4l1_pwc.cpp libs/webcam/v4l2_base.cpp libindi_build/CMakeFiles/CompilerIdC/CMakeCCompilerId.c libindi_build/CMakeFiles/CompilerIdCXX/CMakeCXXCompilerId.cpp .tmp/libindi1.0.0/ && $(COPY_FILE) --parents BAOcontrol/baoqt.ui BAOcontrol/liste.ui BAOcontrol/map.ui BAOcontrol/selectstars.ui .tmp/libindi1.0.0/ && (cd `dirname .tmp/libindi1.0.0` && $(TAR) libindi1.0.0.tar libindi1.0.0 && $(COMPRESS) libindi1.0.0.tar) && $(MOVE) `dirname .tmp/libindi1.0.0`/libindi1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/libindi1.0.0
    348376
    349377
     
    366394mocables: compiler_moc_header_make_all compiler_moc_source_make_all
    367395
    368 compiler_moc_header_make_all: moc_baoqt.cpp
     396compiler_moc_header_make_all: moc_baoqt.cpp moc_liste.cpp moc_map.cpp moc_qledindicator.cpp moc_selectstars.cpp
    369397compiler_moc_header_clean:
    370         -$(DEL_FILE) moc_baoqt.cpp
    371 moc_baoqt.cpp: BAOControl/baoqt.h
    372         /usr/bin/moc $(DEFINES) $(INCPATH) BAOControl/baoqt.h -o moc_baoqt.cpp
     398        -$(DEL_FILE) moc_baoqt.cpp moc_liste.cpp moc_map.cpp moc_qledindicator.cpp moc_selectstars.cpp
     399moc_baoqt.cpp: BAOcontrol/selectstars.h \
     400                BAOcontrol/ui_selectstars.h \
     401                BAOcontrol/liste.h \
     402                BAOcontrol/map.h \
     403                communs/const.h \
     404                BAOcontrol/baocontrol.h \
     405                communs/logs.h \
     406                communs/ClientSocket.h \
     407                communs/Socket.h \
     408                communs/SocketException.h \
     409                communs/astro.h \
     410                communs/alignement.h \
     411                communs/filetools.h \
     412                communs/exception.h \
     413                BAOcontrol/Server.hpp \
     414                BAOcontrol/qledindicator.h \
     415                BAOcontrol/Joystick.h \
     416                BAOcontrol/baoqt.h
     417        /usr/bin/moc $(DEFINES) $(INCPATH) BAOcontrol/baoqt.h -o moc_baoqt.cpp
     418
     419moc_liste.cpp: BAOcontrol/liste.h
     420        /usr/bin/moc $(DEFINES) $(INCPATH) BAOcontrol/liste.h -o moc_liste.cpp
     421
     422moc_map.cpp: communs/const.h \
     423                BAOcontrol/map.h
     424        /usr/bin/moc $(DEFINES) $(INCPATH) BAOcontrol/map.h -o moc_map.cpp
     425
     426moc_qledindicator.cpp: BAOcontrol/qledindicator.h
     427        /usr/bin/moc $(DEFINES) $(INCPATH) BAOcontrol/qledindicator.h -o moc_qledindicator.cpp
     428
     429moc_selectstars.cpp: BAOcontrol/ui_selectstars.h \
     430                BAOcontrol/selectstars.h
     431        /usr/bin/moc $(DEFINES) $(INCPATH) BAOcontrol/selectstars.h -o moc_selectstars.cpp
    373432
    374433compiler_rcc_make_all:
     
    379438compiler_moc_source_make_all:
    380439compiler_moc_source_clean:
    381 compiler_uic_make_all: ui_baoqt.h
     440compiler_uic_make_all: ui_baoqt.h ui_liste.h ui_map.h ui_selectstars.h
    382441compiler_uic_clean:
    383         -$(DEL_FILE) ui_baoqt.h
    384 ui_baoqt.h: BAOControl/baoqt.ui
    385         /usr/bin/uic BAOControl/baoqt.ui -o ui_baoqt.h
     442        -$(DEL_FILE) ui_baoqt.h ui_liste.h ui_map.h ui_selectstars.h
     443ui_baoqt.h: BAOcontrol/baoqt.ui
     444        /usr/bin/uic BAOcontrol/baoqt.ui -o ui_baoqt.h
     445
     446ui_liste.h: BAOcontrol/liste.ui
     447        /usr/bin/uic BAOcontrol/liste.ui -o ui_liste.h
     448
     449ui_map.h: BAOcontrol/map.ui
     450        /usr/bin/uic BAOcontrol/map.ui -o ui_map.h
     451
     452ui_selectstars.h: BAOcontrol/selectstars.ui
     453        /usr/bin/uic BAOcontrol/selectstars.ui -o ui_selectstars.h
    386454
    387455compiler_yacc_decl_make_all:
     
    427495        $(CC) -c $(CFLAGS) $(INCPATH) -o indiserver.o indiserver.c
    428496
    429 baocontrol.o: BAOControl/baocontrol.cpp BAOControl/baocontrol.h \
    430                 communs/const.h \
    431                 communs/logs.h \
    432                 communs/ClientSocket.h \
    433                 communs/Socket.h \
    434                 communs/SocketException.h \
    435                 communs/astro.h \
    436                 communs/alignement.h \
    437                 communs/filetools.h \
    438                 communs/exception.h
    439         $(CXX) -c $(CXXFLAGS) $(INCPATH) -o baocontrol.o BAOControl/baocontrol.cpp
    440 
    441 baoqt.o: BAOControl/baoqt.cpp BAOControl/baoqt.h \
    442                 BAOControl/baocontrol.h \
     497baocontrol.o: BAOcontrol/baocontrol.cpp BAOcontrol/baocontrol.h \
    443498                communs/const.h \
    444499                communs/logs.h \
     
    450505                communs/filetools.h \
    451506                communs/exception.h \
    452                 BAOControl/ui_baoqt.h
    453         $(CXX) -c $(CXXFLAGS) $(INCPATH) -o baoqt.o BAOControl/baoqt.cpp
    454 
    455 main.o: BAOControl/main.cpp BAOControl/baoqt.h \
    456                 BAOControl/baocontrol.h \
     507                BAOcontrol/Server.hpp
     508        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o baocontrol.o BAOcontrol/baocontrol.cpp
     509
     510baoqt.o: BAOcontrol/baoqt.cpp BAOcontrol/baoqt.h \
     511                BAOcontrol/selectstars.h \
     512                BAOcontrol/ui_selectstars.h \
     513                BAOcontrol/liste.h \
     514                BAOcontrol/map.h \
    457515                communs/const.h \
     516                BAOcontrol/baocontrol.h \
    458517                communs/logs.h \
    459518                communs/ClientSocket.h \
     
    464523                communs/filetools.h \
    465524                communs/exception.h \
    466                 BAOControl/ui_baoqt.h
    467         $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o BAOControl/main.cpp
     525                BAOcontrol/Server.hpp \
     526                BAOcontrol/qledindicator.h \
     527                BAOcontrol/Joystick.h \
     528                BAOcontrol/ui_baoqt.h
     529        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o baoqt.o BAOcontrol/baoqt.cpp
     530
     531Connection.o: BAOcontrol/Connection.cpp BAOcontrol/Connection.hpp \
     532                BAOcontrol/Socket2.hpp \
     533                BAOcontrol/Server.hpp \
     534                BAOcontrol/LogFile.hpp
     535        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Connection.o BAOcontrol/Connection.cpp
     536
     537Joystick.o: BAOcontrol/Joystick.cpp
     538        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Joystick.o BAOcontrol/Joystick.cpp
     539
     540liste.o: BAOcontrol/liste.cpp BAOcontrol/liste.h \
     541                BAOcontrol/ui_liste.h
     542        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o liste.o BAOcontrol/liste.cpp
     543
     544Listener.o: BAOcontrol/Listener.cpp BAOcontrol/Listener.hpp \
     545                BAOcontrol/Socket2.hpp \
     546                BAOcontrol/Connection.hpp \
     547                BAOcontrol/Server.hpp \
     548                BAOcontrol/LogFile.hpp
     549        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Listener.o BAOcontrol/Listener.cpp
     550
     551LogFile.o: BAOcontrol/LogFile.cpp BAOcontrol/LogFile.hpp
     552        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o LogFile.o BAOcontrol/LogFile.cpp
     553
     554main.o: BAOcontrol/main.cpp BAOcontrol/baoqt.h \
     555                BAOcontrol/selectstars.h \
     556                BAOcontrol/ui_selectstars.h \
     557                BAOcontrol/liste.h \
     558                BAOcontrol/map.h \
     559                communs/const.h \
     560                BAOcontrol/baocontrol.h \
     561                communs/logs.h \
     562                communs/ClientSocket.h \
     563                communs/Socket.h \
     564                communs/SocketException.h \
     565                communs/astro.h \
     566                communs/alignement.h \
     567                communs/filetools.h \
     568                communs/exception.h \
     569                BAOcontrol/Server.hpp \
     570                BAOcontrol/qledindicator.h \
     571                BAOcontrol/Joystick.h \
     572                BAOcontrol/ui_baoqt.h
     573        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o BAOcontrol/main.cpp
     574
     575map.o: BAOcontrol/map.cpp BAOcontrol/map.h \
     576                communs/const.h \
     577                BAOcontrol/ui_map.h
     578        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o map.o BAOcontrol/map.cpp
     579
     580qledindicator.o: BAOcontrol/qledindicator.cpp BAOcontrol/qledindicator.h
     581        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o qledindicator.o BAOcontrol/qledindicator.cpp
     582
     583selectstars.o: BAOcontrol/selectstars.cpp BAOcontrol/selectstars.h \
     584                BAOcontrol/ui_selectstars.h
     585        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o selectstars.o BAOcontrol/selectstars.cpp
     586
     587Server.o: BAOcontrol/Server.cpp BAOcontrol/Server.hpp \
     588                BAOcontrol/Socket2.hpp \
     589                BAOcontrol/Listener.hpp
     590        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Server.o BAOcontrol/Server.cpp
     591
     592Socket2.o: BAOcontrol/Socket2.cpp BAOcontrol/Socket2.hpp
     593        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Socket2.o BAOcontrol/Socket2.cpp
    468594
    469595BAOtest_main.o: BAOTest/BAOtest_main.cpp communs/ClientSocket.h \
     
    706832                communs/filetools.h \
    707833                communs/exception.h \
    708                 communs/logs.h \
    709                 communs/alt2motor.h
     834                communs/logs.h
    710835        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o BAO.o drivers/telescope/BAO.cpp
    711836
     
    11921317        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_baoqt.o moc_baoqt.cpp
    11931318
     1319moc_liste.o: moc_liste.cpp
     1320        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_liste.o moc_liste.cpp
     1321
     1322moc_map.o: moc_map.cpp
     1323        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_map.o moc_map.cpp
     1324
     1325moc_qledindicator.o: moc_qledindicator.cpp
     1326        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_qledindicator.o moc_qledindicator.cpp
     1327
     1328moc_selectstars.o: moc_selectstars.cpp
     1329        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_selectstars.o moc_selectstars.cpp
     1330
    11941331####### Install
    11951332
  • BAORadio/libindi/libindi/communs/alignement.cpp

    r685 r688  
    125125    MATRICE[2][3] = 0.0;
    126126    MATRICE[3][3] = 1.0;
     127}
     128
     129void Alignement::AfficherMatrice()
     130{
     131    stringstream os;
     132
     133    os.str("");
     134
     135    // Affiche de la matrice pour vérif
     136
     137    os << "\nCalcul de la matrice de correction:\n";
     138    os.width(15);
     139    os << MATRICE[1][1];
     140    os.width(15);
     141    os << MATRICE[2][1];
     142    os.width(15);
     143    os << MATRICE[3][1];
     144    os << "\n";
     145    os.width(15);
     146    os << MATRICE[1][2];
     147    os.width(15);
     148    os << MATRICE[2][2];
     149    os.width(15);
     150    os << MATRICE[3][2];
     151    os << "\n";
     152    os.width(15);
     153    os << MATRICE[1][3];
     154    os.width(15);
     155    os << MATRICE[2][3];
     156    os.width(15);
     157    os << MATRICE[3][3];
     158    os << "\n\nDeterminant :" << Determinant() << "\n";
     159
     160    AfficherLog(os.str(), true);
    127161}
    128162
     
    388422    // Calcul du vecteur offset sur le ciel
    389423
    390     VECT_OFFSET.x =0.0;//m1.x - ((a1.x * MATRICE[1][1]) + (a1.y * MATRICE[2][1]));
    391     VECT_OFFSET.y =0.0;//m1.y - ((a1.x * MATRICE[1][2]) + (a1.y * MATRICE[2][2]));
     424    VECT_OFFSET.x =m1.x - ((a1.x * MATRICE[1][1]) + (a1.y * MATRICE[2][1]));
     425    VECT_OFFSET.y =m1.y - ((a1.x * MATRICE[1][2]) + (a1.y * MATRICE[2][2]));
    392426
    393427    if (x + y == 0 )
     
    417451inline int Alignement::ElementsMatriceSimple(Coord aa1, Coord aa2, Coord aa3, Coord mm1, Coord mm2, Coord mm3)
    418452{
    419 // On se retouvre à devoir résoudre les equations:
    420 
    421453    // mm1 = aa1 * MATRICE_Correction
    422454    // mm2 = aa2 * MATRICE_Correction
    423455    // mm3 = aa3 * MATRICE_Correction
    424456
    425     // et donc à trouver les éléments de la matrice MATRICE_Correction en fonction des paramÚtres x, y, z des vecteurs
     457    // On doit donc trouver les éléments de la matrice MATRICE_Correction en fonction des paramÚtres x, y, z des vecteurs
    426458    // aa1, aa2, aa3, mm1, mm2, mm3
    427459
    428     // Les éléments de la matrice se trouvent aisément
     460    // Les éléments de la matrice se trouvent aisément :
    429461
    430462    double div= aa1.z*aa2.y*aa3.x - aa1.y*aa2.z*aa3.x - aa1.z*aa2.x*aa3.y +
     
    582614
    583615
     616/**************************************************************************************
     617** Projection simple d'un point situé aux coordonnées (az, ha) dans un cercle de
     618** rayon Pi / 2
     619**
     620***************************************************************************************/
    584621
    585622void Alignement::AzHa2XY(double az, double ha, double *x, double *y)
     
    591628    *y = r * sin(az);
    592629}
     630
    593631
    594632/**************************************************************************************
     
    645683}
    646684
     685
     686/**************************************************************************************
     687** Initialise les cotes de l'instrument
     688**
     689***************************************************************************************/
    647690
    648691void Alignement::InitParametresInstrument()
     
    655698    AE          = AE0;
    656699    I0          = I00;
    657     Thau        = Thau0;
     700    Theta       = Theta0;
    658701    CoeffMoteur = CoeffMoteur0;
    659702}
    660703
    661704
     705
     706/**************************************************************************************
     707** Convertit un nombre de pas en hauteur en un angle exprimé en degrés
     708**
     709***************************************************************************************/
     710
    662711double Alignement::Motor2Alt(double pas)
    663712{
    664     return asin(( - pow( ( pas * CoeffMoteur0 ) + I00, 2.0 ) + 128279.4) / 129723.4 ) * N180divPi + Thau0;
    665 }
     713    return asin(( - pow( ( pas * CoeffMoteur0 ) + I00, 2.0 ) + 128279.4) / 129723.4 ) * N180divPi + Theta0;
     714}
     715
     716
     717/**************************************************************************************
     718** Convertit une hauteur (exprimée en degrés) en nombre de pas codeur
     719**
     720***************************************************************************************/
    666721
    667722double Alignement::Alt2Motor(double targetAlt)
     
    679734    double CD2pBC2 = CD * CD + BC * BC;
    680735
    681     double I2 = -2.0 * ED * sqrt( CD2pBC2 ) * sin(  ( targetAlt - Thau ) * Pidiv180 );
     736    double I2 = -2.0 * ED * sqrt( CD2pBC2 ) * sin(  ( targetAlt - Theta ) * Pidiv180 );
    682737
    683738    I2 += ED * ED + CD2pBC2 - AE *AE;
     
    702757    // double memI0 = I00;
    703758    double memCoeffMoteur = CoeffMoteur0;
    704     double memThau = Thau0;
     759    double memTheta = Theta0;
    705760
    706761    stringstream os;
     
    715770
    716771    InitParametresInstrument();
    717 
    718772
    719773
     
    752806
    753807
    754     os << "m1=" << delta_de[0] << "   m11=" <<  Motor2Alt(Alt2Motor(delta_de[0])) << "\n";
    755 
    756     AfficherLog(os.str(), true);
    757     os.str("");
    758 
     808    /*  os << "m1=" << delta_de[0] << "   m11=" <<  Motor2Alt(Alt2Motor(delta_de[0])) << "\n";
     809
     810      AfficherLog(os.str(), true);
     811      os.str("");
     812    */
    759813    for (i=-interv; i< interv; i += pas)
    760814    {
    761         CoeffMoteur = CoeffMoteur0 + i/100.0;
     815        CoeffMoteur = CoeffMoteur0 + i / 100.0;
    762816
    763817        for (j=-interv; j<interv; j += pas)
     
    773827                    BC = BC0 + l;
    774828
    775                     Thau = (atan(CD / BC) - atan(18.5 / ED))* N180divPi;
     829                    Theta = (atan(CD / BC) - atan(18.5 / ED))* N180divPi;
    776830
    777831                    for (m=-interv; m< interv; m += pas)
     
    810864                            os << "Determinant=" << det << "\n";
    811865
    812                             os << "CD=" << CD << " ED=" << ED << " BC=" << BC << " AE=" << AE << " Thau=" << Thau << " CoeffMoteur=" << CoeffMoteur << "\n\n";
     866                            os << "CD=" << CD << " ED=" << ED << " BC=" << BC << " AE=" << AE << " Theta=" << Theta << " CoeffMoteur=" << CoeffMoteur << "\n\n";
    813867
    814868                            AfficherLog(os.str(), true);
     
    820874                            memAE = AE;
    821875                            memBC = BC;
    822                             memThau = Thau;
     876                            memTheta = Theta;
    823877                            memCoeffMoteur = CoeffMoteur;
    824878                        }
     
    828882        }
    829883
    830         AfficherLog("*\n", true);
     884        if ((int)Arrondi((interv - i) / (2.0 * interv) * 100.0) % 10 == 0)
     885        {
     886            os.str("");
     887            os << 100.0 - (interv - i) / (2.0 * interv) * 100.0 << " %\n";
     888            AfficherLog(os.str(), true);
     889        }
    831890    }
    832891
     
    838897    AE = memAE;
    839898    BC = memBC;
    840     Thau = memThau;
     899    Theta = memTheta;
    841900    CoeffMoteur = memCoeffMoteur;
    842901
     
    866925    Matrice_ok = ElementsMatriceSimple(c1, c2, c3 ,mm1, mm2, mm3);
    867926
    868     det = Determinant();
    869 
    870 
    871 
    872     os << "Determinant=" << det << "\n";
    873 
    874 
    875     AfficherLog(os.str(), true);
    876 
    877 
    878 
     927    AfficherMatrice();
    879928}
    880929
     
    932981        distances = new double [nbrcorrections+1];
    933982
    934         os << "Coordonnées visees : ad=" << DHMS(ar * 15.0,true) << "  de=" << DHMS(dec,false) << "\n";
     983        os << "Coordonnées visees : ad=" << DHMS(ar * 15.0
     984
     985
     986                ,true) << "  de=" << DHMS(dec,false) << "\n";
    935987
    936988        Azimut(ar * 15.0 * Pidiv180, dec * Pidiv180, &a2, &b2);
     
    10991151    }
    11001152
    1101 
    1102     // Affiche de la matrice pour vérif
    1103 
    1104     os << "\nCalcul de la matrice de correction:\n";
    1105     os << MATRICE[1][1] << "   \t" << MATRICE[2][1] << "    \t" << MATRICE[3][1] << "\n";
    1106     os << MATRICE[1][2] << "   \t" << MATRICE[2][2] << "    \t" << MATRICE[3][2] << "\n";
    1107     os << MATRICE[1][3] << "   \t" << MATRICE[2][3] << "    \t" << MATRICE[3][3] << "\n";
    1108     os << "\nDeterminant :" << Determinant() << "\n";
     1153    //Afficher les messages de cette fonction
     1154
     1155    AfficherLog(os.str(), true);
     1156
     1157    AfficherMatrice();
    11091158
    11101159
     
    11141163    SelectionnePourCalculMatrice[map[best2]] = true;
    11151164    SelectionnePourCalculMatrice[map[best3]] = true;
    1116 
    1117 
    1118     //Afficher les messages de cette fonction
    1119 
    1120     AfficherLog(os.str(), true);
    11211165}
    11221166
  • BAORadio/libindi/libindi/communs/alignement.h

    r684 r688  
    9595    bool   PointSitueDansSurfaceTriangle(double px, double py, double px1, double py1, double px2, double py2, double px3, double py3);
    9696
     97    void   AfficherMatrice();
    9798    inline double Determinant();
     99   
    98100    void   InitParametresInstrument();
    99101    void   OptimisationGeometrieAntenne();
     
    145147    double I0;
    146148    double CoeffMoteur;
    147     double Thau;
     149    double Theta;
    148150
    149151};
  • BAORadio/libindi/libindi/communs/astro.cpp

    r682 r688  
    528528double Astro::TSL(double JJ, double HeureSiderale, double Longitude)
    529529{
    530     double T = (JJ /*- 66.185/3600.0/24.0*/ - 2415020.0 ) / 36525.0;
     530    double T = (JJ - ET_UT / 3600.0 / 24.0 - 2415020.0 ) / 36525.0;
    531531    double rd = 0.276919398 + ( 100.0021359 + 0.000001075 * T ) * T;
    532532    rd += HeureSiderale;
     
    656656    CalculTSL();
    657657
    658     for (int i=0; i < 120; i++)
    659     {
    660         tsl += i * 5.0 / 60.0 / 24.0 ;
     658    for (int i = 0; i < 120; i++)
     659    {
     660        tsl += (double)i * 5.0 / 60.0 / 24.0 ;
    661661
    662662        Azimut( AD, Dec, &az, &ha);
     
    687687    double gamma, R0, a, b, PressionTempCalc, tanHT;
    688688
    689     if (Pression != 0.0)
     689    if (Pression != 0.0 && ht > 0.0)
    690690    {
    691691        PressionTempCalc = (Pression / 1013.25) * 273.0 / (273.0 + Temp);
     
    694694        {
    695695            gamma = 2.6;
    696             a = 7.5262;
    697             b = -2.2204;
     696            a     = 7.5262;
     697            b     = -2.2204;
    698698
    699699            if (ht >= 4.0 * Pidiv180)
    700700            {
    701                 gamma=-1.1;
    702                 a=4.4010;
    703                 b=-0.9603;
     701                gamma = -1.1;
     702                a     = 4.4010;
     703                b     = -0.9603;
    704704            }
    705705
    706             R0 = (pow((a+b*log(ht*N180divPi+gamma)), 2.0)) / 60.0 * Pidiv180;
     706            R0 = (pow(( a + b * log( ht * N180divPi + gamma)), 2.0)) / 60.0 * Pidiv180;
    707707            ht += R0 * PressionTempCalc;
    708708        }
     
    710710        {
    711711            tanHT = fabs(tan(Pidiv2 - ht));
    712             R0 = (0.0161877777777777777777-0.000022888888888888888 * tanHT * tanHT)
     712            R0 = ( 0.0161877777777777777777 - 0.000022888888888888888 * tanHT * tanHT )
    713713                 * tanHT * Pidiv180;
    714714            ht += R0 * PressionTempCalc;
  • BAORadio/libindi/libindi/communs/astro.h

    r685 r688  
    6464    double CalculLongitudeSoleil();
    6565    double TSL(double JJ,double HeureSiderale,double Longitude);
    66     bool    Decomposition(string chaine, char type, float *a1, float *a2, float *a3);
     66    bool   Decomposition(string chaine, char type, float *a1, float *a2, float *a3);
    6767    void   Nutation();
    6868    void   Obliquite(double JJ);
  • BAORadio/libindi/libindi/communs/const.h

    r682 r688  
    99
    1010
     11#define ET_UT 0.0
     12//#define 66.185
     13
    1114// ParamÚtres de l'instrument
    1215
     
    1720#define I00 81.0
    1821#define CoeffMoteur0 0.078947
    19 #define Thau0 20.2345
     22#define Theta0 20.2345
     23
    2024
    2125// dimensions des tableaux
     
    2529#define MAXETOILES 250
    2630#define MAXANTENNES 50
    27 #define MAXALIGNEMENTANTENNE 40
     31#define MAXALIGNEMENTANTENNE 20
    2832#define TAILLEMAXLOGS 3000000
    2933
     
    142146#define BAO_PORT 8000
    143147
     148#define STELLARIUM_PORT 8001
     149
    144150// Délai maximum en ms d'attente de la réponse des micro-contrÎleurs
    145151
     
    166172#define UPDATETRANSITDELAY ( 15.0 * 60.0 )
    167173
     174#define JOYSTICK
     175
     176#define JOY_DEV "/dev/input/js1"
     177//#define JOY_DEV "/dev/js0"
     178
    168179
    169180
  • BAORadio/libindi/libindi/drivers/telescope/BAO.cpp

    r682 r688  
    13591359
    13601360        IDSetSwitch(&AlignementAltpP, "Delta en azimut = %s  delta en hauteur = %s  az = %s  ha = %s (Vitesse raquette = %d)\n",
    1361                     DHMS(delta_az * PasDeltaAz, false).c_str(),
    1362                     DHMS(delta_ha * PasDeltaHa, false).c_str(),
     1361                    DHMS(delta_az * PasDeltaAz * N180divPi, false).c_str(),
     1362                    DHMS(delta_ha * PasDeltaHa * N180divPi, false).c_str(),
    13631363                    DHMS(az * N180divPi, false).c_str(),
    13641364                    DHMS(ha * N180divPi, false).c_str(),
     
    13851385
    13861386        IDSetSwitch(&AlignementAltnP, "Delta en azimut = %s  delta en hauteur = %s  az = %s  ha = %s (Vitesse raquette = %d)\n",
    1387                     DHMS(delta_az * PasDeltaAz, false).c_str(),
    1388                     DHMS(delta_ha * PasDeltaHa, false).c_str(),
     1387                    DHMS(delta_az * PasDeltaAz * N180divPi, false).c_str(),
     1388                    DHMS(delta_ha * PasDeltaHa * N180divPi, false).c_str(),
    13891389                    DHMS(az * N180divPi, false).c_str(),
    13901390                    DHMS(ha * N180divPi, false).c_str(),
     
    18051805                // AprÚs s'être assurer que nous utilisons la méthode SIMPLE et que la matrice de rotation est ok
    18061806
    1807                 AfficherLog("Application de la matrice SIMPLE\n", true);
     1807                AfficherLog("Application de la matrice SIMPLE (det=%10.8f)\n", Sockets[i].AlignementAntenne->Determinant(), true);
    18081808                AfficherLog("Coordonnees initiales: Azi = %s  Haut = %s\n", DHMS(targetAz*N180divPi, false ).c_str(),
    18091809                            DHMS(targetAlt*N180divPi, false ).c_str());
     
    22752275                                    // Message d'erreur
    22762276
    2277                                     IDSetSwitch(&OnCoordSetSP, "ALERTE antenne %s : Erreur NACK GOTO !\nRetour : %s\n",  Sockets[i].IP.c_str(), reponse.c_str());
    2278                                     AfficherLog("ALERTE antenne %s : Erreur NACK GOTO !\nRetour : %s\n",  Sockets[i].IP.c_str(), reponse.c_str());
     2277                                    IDSetSwitch(&OnCoordSetSP, "ALERTE antenne %s : Erreur NACK GOTO ! (Retour : %s)\n",  Sockets[i].IP.c_str(), reponse.c_str());
     2278                                    AfficherLog("ALERTE antenne %s : Erreur NACK GOTO ! (Retour : %s)\n",  Sockets[i].IP.c_str(), reponse.c_str());
    22792279                                    // On déconnecte l'antenne. Elle ne semble pas en mesure d'exécuter les ordres goto
    22802280
  • BAORadio/libindi/libindi/libindi.pro

    r678 r688  
    11######################################################################
    2 # Automatically generated by qmake (2.01a) mar. mai 15 01:36:08 2012
     2# Automatically generated by qmake (2.01a) sam. mai 26 03:17:24 2012
    33######################################################################
    44
     
    66TARGET =
    77DEPENDPATH += . \
    8               BAOControl \
     8              BAOcontrol \
    99              BAOTest \
    1010              communs \
     
    2525INCLUDEPATH += . \
    2626               libs \
    27                BAOControl \
     27               BAOcontrol \
    2828               communs \
    2929               libs/indibase \
     
    4545           indidevapi.h \
    4646           indidriver.h \
    47            BAOControl/baocontrol.h \
    48            BAOControl/baoqt.h \
     47           BAOcontrol/baocontrol.h \
     48           BAOcontrol/baoqt.h \
     49           BAOcontrol/Connection.hpp \
     50           BAOcontrol/Joystick.h \
     51           BAOcontrol/liste.h \
     52           BAOcontrol/Listener.hpp \
     53           BAOcontrol/LogFile.hpp \
     54           BAOcontrol/map.h \
     55           BAOcontrol/qledindicator.h \
     56           BAOcontrol/selectstars.h \
     57           BAOcontrol/Server.hpp \
     58           BAOcontrol/Socket2.hpp \
    4959           communs/alignement.h \
    50            communs/alt2motor.h \
    5160           communs/astro.h \
    5261           communs/ClientSocket.h \
     
    122131           libs/webcam/videodev.h \
    123132           libs/webcam/videodev2.h
    124 FORMS += BAOControl/baoqt.ui
     133FORMS += BAOcontrol/baoqt.ui \
     134         BAOcontrol/liste.ui \
     135         BAOcontrol/map.ui \
     136         BAOcontrol/selectstars.ui
    125137SOURCES += base64.c \
    126138           eventloop.c \
     
    129141           indidrivermain.c \
    130142           indiserver.c \
    131            BAOControl/baocontrol.cpp \
    132            BAOControl/baoqt.cpp \
    133            BAOControl/main.cpp \
     143           BAOcontrol/baocontrol.cpp \
     144           BAOcontrol/baoqt.cpp \
     145           BAOcontrol/Connection.cpp \
     146           BAOcontrol/Joystick.cpp \
     147           BAOcontrol/liste.cpp \
     148           BAOcontrol/Listener.cpp \
     149           BAOcontrol/LogFile.cpp \
     150           BAOcontrol/main.cpp \
     151           BAOcontrol/map.cpp \
     152           BAOcontrol/qledindicator.cpp \
     153           BAOcontrol/selectstars.cpp \
     154           BAOcontrol/Server.cpp \
     155           BAOcontrol/Socket2.cpp \
    134156           BAOTest/BAOtest_main.cpp \
    135157           communs/alignement.cpp \
Note: See TracChangeset for help on using the changeset viewer.