- Timestamp:
- Sep 28, 2012, 2:14:03 PM (12 years ago)
- Location:
- BAORadio/libindi/libindi
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
BAORadio/libindi/libindi/.directory
r502 r695 1 1 [Dolphin] 2 Timestamp=201 0,11,5,21,27,52 Timestamp=2012,9,13,22,1,51 3 3 4 4 [Settings] 5 HiddenFilesShown=true 5 6 ShowDotFiles=false -
BAORadio/libindi/libindi/BAOTest/BAOtest_main.cpp
r691 r695 18 18 #include <netinet/in.h> 19 19 20 //#define POSITIONS_DIRECT 21 20 22 using namespace std; 23 21 24 22 25 … … 74 77 result.y=atoi(str.substr(7, 4).c_str()); 75 78 76 79 if (str[1]=='f') result.x=-result.x; 77 80 78 81 if (str[6]=='f') result.y=-result.y; … … 129 132 int main ( int argc, char *argv[] ) 130 133 { 131 Position Pos, NouvPos;134 Position Pos, Pos2, NouvPos; 132 135 char cIP; 133 136 char IP[20]; … … 188 191 strcpy(chaine, ""); 189 192 190 193 #ifndef POSITIONS_DIRECT 191 194 if (abs(Pos.x - NouvPos.x) < 5 ) 192 195 { … … 208 211 Pos.y -= (NouvPos.y - Pos.y) / 6.0; 209 212 } 213 #endif 214 210 215 211 216 if (ErreursAleatoires) Aleat=rand()%ERREURS != 1; … … 235 240 if (asks.find("G")!=string::npos) 236 241 { 237 238 242 #ifndef POSITIONS_DIRECT 243 NouvPos = ExtractPosition2(asks); 239 244 240 245 NouvPos.x += Pos.x; 241 246 NouvPos.y += Pos.y; 242 243 247 #else 248 249 Pos2 = ExtractPosition2(asks); 250 Pos.x-=Pos2.x; 251 Pos.y-=Pos2.y; 252 #endif 244 253 strcpy(chaine,"ACK/GOTO/\n"); 245 254 client_socket << chaine; -
BAORadio/libindi/libindi/BAOcontrol/BAOcontrol.pro
r693 r695 1 1 ###################################################################### 2 # Automatically generated by qmake (2.01a) Thu Sep 13 21:57:5720122 # Automatically generated by qmake (2.01a) Thu Sep 27 14:47:45 2012 3 3 ###################################################################### 4 4 -
BAORadio/libindi/libindi/BAOcontrol/Makefile
r693 r695 1 1 ############################################################################# 2 2 # Makefile for building: BAOcontrol 3 # Generated by qmake (2.01a) (Qt 4.8.1) on: Thu Sep 13 21:57:5720123 # Generated by qmake (2.01a) (Qt 4.8.1) on: Thu Sep 27 14:47:45 2012 4 4 # Project: BAOcontrol.pro 5 5 # Template: app -
BAORadio/libindi/libindi/BAOcontrol/baocontrol.cpp
r693 r695 20 20 { 21 21 float a1, a2, a3; 22 22 23 23 char *Version; 24 24 … … 29 29 30 30 // Affichage de la version du programme 31 31 32 32 Version = new char[1000]; 33 33 … … 40 40 * franckrichard033@gmail.com *\n \ 41 41 ******************************************\n\n\n", VERSION, VERSION_DATE); 42 42 43 43 AfficherLog(Version, true); 44 44 45 45 delete [] Version; 46 46 … … 145 145 146 146 147 148 147 // Transfert de la latitude, longitude, pression, température à la classe Astro 149 148 … … 154 153 155 154 156 157 //DefinirDateHeure(2012.0, 6.0, 29.0, 21.0, 56.0, 48.0); 158 155 //DefinirDateHeure(2012.0, 6.0, 29.0, 22.0, 39.0, 40.0); 156 //DefinirDateHeure(2012.0, 6.0, 29.0, 22.0, 49.0, 18.0); 157 //DefinirDateHeure(2012.0, 6.0, 29.0, 22.0, 57.0, 52.0); 158 //DefinirDateHeure(2012.0, 6.0, 29.0, 20.0, 59.0, 8.0); 159 //DefinirDateHeure(2012.0, 6.0, 29.0, 21.0, 55.0, 57.0); 159 160 160 161 … … 164 165 CalculTSL(); 165 166 166 167 /*double c,d; 168 double e,f; 169 stringstream os; 170 171 os << "tsl=" << DHMS(GetTSL()*N180divPi, true)<< " " << GetTSL() << "\n"; 172 173 AfficherLog(os.str(), true); 174 os.str(""); 175 176 // double a=15.0*(5.0+55.0/60.0+10.3/3600.0)*Pidiv180; 177 // double b=(7.0+24.0/60.0+25.0/3600.0)*Pidiv180; 178 179 // double a=15.0*(6.0+45.0/60.0+8.7/3600.0)*Pidiv180; 180 //double b=-(16.0+43.0/60.0+0.3/3600.0)*Pidiv180; 181 182 //double a=15.0*(5.0+55.0/60.0+50.0/3600.0)*Pidiv180; 183 //double b=(7.0+24.0/60.0+30.0/3600.0)*Pidiv180; 184 185 // double a=15.0*(23.0+7.0/60.0+8.0/3600.0)*Pidiv180; 186 // double b=(59.0+29.0/60.0+12.0/3600.0)*Pidiv180; 187 188 double a=15.0*(14.0+15.0/60.0+39.5/3600.0)*Pidiv180; 189 double b=(19.0+10.0/60.0+46.7/3600.0)*Pidiv180; 190 191 //CoordonneesHorairesDouble Soleil; 192 193 //CalculARDecSoleil(&Soleil); 194 195 //a=Soleil.ar; 196 //b=Soleil.dec; 197 // Precession(&a, &b); 198 // NutationEtoile(&a, &b); 199 200 // AberrationAnnuelle(&a, &b); 201 202 os << "ad=" << a << " de=" << b << "\n"; 203 204 Azimut(a,b,&c,&d); 205 206 c += 2.91488 * Pidiv180; 207 d -= 8.08241 * Pidiv180; 208 209 AzHa2ADDe(c, d, &a, &b); 210 211 os << "ad=" << DHMS(a*N180divPi, true) << " de=" << DHMS(b*N180divPi, false) << "\n"; 212 os << "ad=" << a << " de=" << b << "\n"; 213 214 AfficherLog(os.str(), true); 215 216 Azimut(a,b,&c,&d); 217 218 os.str(""); 219 220 os << "az=" << DHMS(c*N180divPi, false)<< " ha=" << DHMS(d*N180divPi, false) << "\n"; 221 222 AfficherLog(os.str(), true);*/ 223 224 167 /* 168 double a, b, c,d, a22, b22, c22, d22; 169 double e,f; 170 stringstream os; 171 172 os << "tsl=" << DHMS(GetTSL()*N180divPi, true)<< " " << GetTSL() << "\n"; 173 174 AfficherLog(os.str(), true); 175 os.str(""); 176 177 a=15.0*(18.0+36.0/60.0+56.3/3600.0)*Pidiv180; 178 b=(38.0+47.0/60.0+3.1/3600.0)*Pidiv180; 179 180 a= 3.61082; 181 b=0.860677; 182 a22=3.39278; 183 b22=0.844504; 184 185 a= 4.87356; 186 b=0.676912; 187 a22=4.94645; 188 b22=0.577727; 189 190 a= 5.41677; 191 b=0.790291; 192 a22=5.55106; 193 b22=0.699053; 194 195 a=4.87356; 196 b=0.676912; 197 a22=4.97375; 198 b22=0.579795; 199 200 201 a=3.73351; 202 b=0.334748; 203 a22=3.61661; 204 b22=0.241758; 205 206 207 //a=15.0*(18.0+37.0/60.0+22.0/3600.0)*Pidiv180; 208 //b=(38.0+47.0/60.0+43.0/3600.0)*Pidiv180; 209 210 //CoordonneesHorairesDouble Soleil; 211 212 //CalculARDecSoleil(&Soleil); 213 214 //a=Soleil.ar; 215 //b=Soleil.dec; 216 //Precession(&a, &b); 217 //NutationEtoile(&a, &b); 218 219 //AberrationAnnuelle(&a, &b); 220 221 os << "ad=" << DHMS(a*N180divPi, true) << " de=" << DHMS(b*N180divPi, false) << "\n"; 222 os << "ad=" << a << " de=" << b << "\n"; 223 224 Alignement *al; 225 226 al=new Alignement(); 227 228 Azimut(a, b, &c, &d); 229 Azimut(a22, b22, &c22, &d22); 230 231 double ec1 = (c-c22)/PasDeltaAz; 232 double ec2= (d-d22)/PasDeltaHa; 233 234 os << "nb de pas az=" << ec1 << " ha=" << ec2 << "\n"; 235 236 double c3= VerifAngle((c * N180divPi * 4000.0/360.0 + ec1) * (360.0 / 4000.0) * Pidiv180 ); 237 238 double d3 = al->Motor2Alt(al->Alt2Motor(d * N180divPi) + ec2) * Pidiv180; 239 240 double sp=DistanceAngulaireEntre2Points(c, d, c3, d3) *N180divPi; 241 242 os << "sep=" << sp << "° dist haut=" << (d-d3)*N180divPi <<"\n"; 243 244 AzHa2ADDe(c3, d3, &a, &b); 245 246 os << "ad=" << DHMS(a*N180divPi, true) << " de=" << DHMS(b*N180divPi, false) << "\n"; 247 os << "ad=" << a << " de=" << b << "\n"; 248 249 AfficherLog(os.str(), true); 250 251 Azimut(a,b,&c,&d); 252 253 os.str(""); 254 255 os << "az=" << DHMS(c*N180divPi, false)<< " ha=" << DHMS(d*N180divPi, false) << "\n"; 256 257 delete al; 258 259 AfficherLog(os.str(), true); 260 */ 261 225 262 226 263 … … 244 281 245 282 Connect(true); 246 283 247 284 } 248 285 … … 535 572 struct tm date; 536 573 struct timeval tv; 537 574 538 575 // On récupÚre la date et l'heure depuis l'horloge du systÚme 539 576 … … 556 593 // On lance les calculs (Temps sidéral local etc...) 557 594 558 CalculTSL(); 595 CalculTSL(); 559 596 } 560 597 … … 1012 1049 return true; 1013 1050 } 1051 1052 if (commande == "R") 1053 { 1054 if (!VerifReponse("Reinitialisation de la matrice de correction", Message)) 1055 { 1056 ErreurLog("Pas de réponse de l'antenne à la requête R.\n\n"); 1057 1058 return false; 1059 } 1060 1061 return true; 1062 } 1014 1063 1015 1064 if (!VerifReponse("name=\"COMMAND_SET\" state=\"Ok\"", NULL)) … … 1655 1704 // et donc la magnitude < MAGNITUDEMAXETOILESCALIBRATION 1656 1705 1657 if ( Etoiles[i].selectionnee = ((Etoiles[i].ha > (HAUTMIN + 5.0 ) * Pidiv180) && (Etoiles[i].mag < MAGNITUDEMAXETOILESCALIBRATION)) )1706 if ( Etoiles[i].selectionnee = ((Etoiles[i].ha > (HAUTMIN + 5.0 ) * Pidiv180) && (Etoiles[i].mag < MAGNITUDEMAXETOILESCALIBRATION)) ) 1658 1707 { 1659 1708 os.width(20); … … 2114 2163 case 'o' : 2115 2164 commande[0]='O'; 2165 break; 2166 case 'r' : 2167 commande[0]='R'; 2116 2168 break; 2117 2169 } -
BAORadio/libindi/libindi/BAOcontrol/baoqt.cpp
r693 r695 10 10 ui(new Ui::BAOqt) 11 11 { 12 13 QPoint pointPos;12 13 QPoint pointPos; 14 14 15 15 RechercheOptimisation = false; … … 95 95 96 96 #ifdef JOYSTICK 97 97 98 98 joystick = new Joystick(); 99 99 100 100 if (joystick) 101 101 { 102 if (!joystick->init())103 {104 105 106 107 108 109 }110 } 111 102 if (!joystick->init()) 103 { 104 delete joystick; 105 106 joystick = NULL; 107 108 QMessageBox::information(this, tr("Jostick"), tr("Joystick inaccessible. Verifiez que le recepteur est bien branche sur un port USB.")); 109 } 110 } 111 112 112 #endif 113 113 114 //ui->lineEditIP->setText("127.0.0.1");115 ui->lineEditIP->setText("134.158.88.199");116 114 ui->lineEditIP->setText("127.0.0.1"); 115 //ui->lineEditIP->setText("134.158.88.199"); 116 117 117 ui->lineEdit_2->setText((QString("BAORadio, LAL, version ").append(VERSION)).toStdString().c_str()); 118 118 … … 126 126 127 127 ui->pushButton1x->setDown(false); 128 128 129 129 ui->pushButton10x->setDown(true); 130 130 … … 292 292 293 293 #ifdef JOYSTICK 294 294 295 295 joy++; 296 296 … … 576 576 void BAOqt::on_pushButton1pt_clicked() 577 577 { 578 static int etape = 1; 579 580 RechercheOptimisation = false; 581 582 switch (etape) 583 { 584 case 1: 585 { 586 etape=2; 587 588 QMessageBox::information(this, tr("Alignement 1pt de l antenne"), tr("Choisissez un objet facile a pointer")); 589 590 on_pushButtonGoto_clicked(); 591 592 QMessageBox::information(this, tr("Alignement 1pt de l antenne"), tr("Attendez la fin du pointage. Centrez l'objet dans le viseur et rappuyez sur le bouton 'alignement 1pt' pour terminer.")); 593 594 }; 595 break; 596 597 case 2: 598 { 599 etape=1; 600 601 QMessageBox::information(this, tr("Alignement 1pt de l antenne"), tr("Annulation du mouvement en cours.")); 602 603 bao->Abort(); 604 605 sleep(1); 606 607 string str = bao->DecodageEntreesUtilisateur("send X"); 608 609 string str2; 610 611 int x = 0; 612 int y = 0; 613 614 char a1='b'; 615 char a2='b'; 616 617 size_t pos = str.find("/"); 618 619 if (pos != string::npos) 620 { 621 str2 = str.substr(pos + 1); 622 623 pos = str2.find("/"); 624 625 if (pos != string::npos) 626 { 627 x = atol( str2.substr(0, pos).c_str() ); 628 629 y = atol( str2.substr(pos + 1).c_str() ); 630 } 631 } 632 633 sleep(1); 634 635 str = bao->DecodageEntreesUtilisateur("send D"); 636 637 int dx = 0; 638 int dy = 0; 639 640 pos = str.find("/"); 641 642 if (pos != string::npos) 643 { 644 str2 = str.substr(pos + 1); 645 646 pos = str2.find("/"); 647 648 if (pos != string::npos) 649 { 650 dx = atol( str2.substr(0, pos).c_str() ); 651 652 x -= dx; 653 654 dy = atol( str2.substr(pos + 1).c_str() ); 655 656 y -= dy; 657 658 if ( x < 0 ) { 659 a1 = 'f'; 660 x = -x; 661 } 662 663 if ( y < 0 ) { 664 a2 = 'f'; 665 y = -y; 666 } 667 668 char chaine[100]; 669 670 sprintf(chaine, "send g%c%04df0000", a1, x); 671 672 str = bao->DecodageEntreesUtilisateur(string(chaine)); 673 674 QMessageBox::information(this, tr("Alignement 1pt de l antenne"), tr("Attendez la fin du mouvement avant de cliquer sur OK.")); 675 676 677 sprintf(chaine, "send gf0000%c%04d", a2, y); 678 679 str = bao->DecodageEntreesUtilisateur(string(chaine)); 680 QMessageBox::information(this, tr("Alignement 1pt de l antenne"), tr("Appuyez sur les deux boutons places dans la boite de l'antenne.")); 681 682 QMessageBox::StandardButton reply; 683 684 reply = QMessageBox::question(this, tr("Alignement 1pt de l antenne"), 685 "Voulez-vous reinitialiser les codeurs de l'antenne en envoyant la c ommande Park ?", 686 QMessageBox::Yes | QMessageBox::No ); 687 688 if (reply == QMessageBox::Yes) 689 { 690 691 str = bao->DecodageEntreesUtilisateur("send z"); 692 693 sleep(1); 694 695 str = bao->DecodageEntreesUtilisateur("send p"); 696 } 697 QMessageBox::information(this, tr("Alignement 1pt de l antenne"), tr("Fin de la procedure.")); 698 } 699 } 700 } 701 break; 702 } 578 RechercheOptimisation = false; 579 580 bao->DecodageEntreesUtilisateur("send r"); 581 582 583 /* 584 static int etape = 1; 585 586 RechercheOptimisation = false; 587 588 switch (etape) 589 { 590 case 1: 591 { 592 etape=2; 593 594 QMessageBox::information(this, tr("Alignement 1pt de l antenne"), tr("Choisissez un objet facile a pointer")); 595 596 on_pushButtonGoto_clicked(); 597 598 QMessageBox::information(this, tr("Alignement 1pt de l antenne"), tr("Attendez la fin du pointage. Centrez l'objet dans le viseur et rappuyez sur le bouton 'alignement 1pt' pour terminer.")); 599 600 }; 601 break; 602 603 case 2: 604 { 605 etape=1; 606 607 QMessageBox::information(this, tr("Alignement 1pt de l antenne"), tr("Annulation du mouvement en cours.")); 608 609 bao->Abort(); 610 611 sleep(1); 612 613 string str = bao->DecodageEntreesUtilisateur("send X"); 614 615 string str2; 616 617 int x = 0; 618 int y = 0; 619 620 char a1='b'; 621 char a2='b'; 622 623 size_t pos = str.find("/"); 624 625 if (pos != string::npos) 626 { 627 str2 = str.substr(pos + 1); 628 629 pos = str2.find("/"); 630 631 if (pos != string::npos) 632 { 633 x = atol( str2.substr(0, pos).c_str() ); 634 635 y = atol( str2.substr(pos + 1).c_str() ); 636 } 637 } 638 639 sleep(1); 640 641 str = bao->DecodageEntreesUtilisateur("send D"); 642 643 int dx = 0; 644 int dy = 0; 645 646 pos = str.find("/"); 647 648 if (pos != string::npos) 649 { 650 str2 = str.substr(pos + 1); 651 652 pos = str2.find("/"); 653 654 if (pos != string::npos) 655 { 656 dx = atol( str2.substr(0, pos).c_str() ); 657 658 x -= dx; 659 660 dy = atol( str2.substr(pos + 1).c_str() ); 661 662 y -= dy; 663 664 if ( x < 0 ) { 665 a1 = 'f'; 666 x = -x; 667 } 668 669 if ( y < 0 ) { 670 a2 = 'f'; 671 y = -y; 672 } 673 674 char chaine[100]; 675 676 sprintf(chaine, "send g%c%04df0000", a1, x); 677 678 str = bao->DecodageEntreesUtilisateur(string(chaine)); 679 680 QMessageBox::information(this, tr("Alignement 1pt de l antenne"), tr("Attendez la fin du mouvement avant de cliquer sur OK.")); 681 682 683 sprintf(chaine, "send gf0000%c%04d", a2, y); 684 685 str = bao->DecodageEntreesUtilisateur(string(chaine)); 686 QMessageBox::information(this, tr("Alignement 1pt de l antenne"), tr("Appuyez sur les deux boutons places dans la boite de l'antenne.")); 687 688 QMessageBox::StandardButton reply; 689 690 reply = QMessageBox::question(this, tr("Alignement 1pt de l antenne"), 691 "Voulez-vous reinitialiser les codeurs de l'antenne en envoyant la c ommande Park ?", 692 QMessageBox::Yes | QMessageBox::No ); 693 694 if (reply == QMessageBox::Yes) 695 { 696 697 str = bao->DecodageEntreesUtilisateur("send z"); 698 699 sleep(1); 700 701 str = bao->DecodageEntreesUtilisateur("send p"); 702 } 703 QMessageBox::information(this, tr("Alignement 1pt de l antenne"), tr("Fin de la procedure.")); 704 } 705 } 706 } 707 break; 708 } 709 710 711 */ 703 712 } 704 713 … … 786 795 void BAOqt::on_pushButtonRetryGoto_clicked() 787 796 { 788 RechercheOptimisation = true;789 790 797 RechercheOptimisation = false; 791 798 -
BAORadio/libindi/libindi/BAOcontrol/baoqt.ui
r691 r695 117 117 </property> 118 118 <property name="text"> 119 <string> 10x</string>119 <string>3x</string> 120 120 </property> 121 121 </widget> … … 166 166 </property> 167 167 <property name="text"> 168 <string>Reset codeurs</string> 169 </property> 170 </widget> 171 <widget class="QPushButton" name="pushButtonTo00"> 172 <property name="geometry"> 173 <rect> 174 <x>10</x> 175 <y>60</y> 176 <width>85</width> 177 <height>27</height> 178 </rect> 179 </property> 180 <property name="text"> 168 181 <string>Park</string> 169 </property>170 </widget>171 <widget class="QPushButton" name="pushButtonTo00">172 <property name="geometry">173 <rect>174 <x>10</x>175 <y>60</y>176 <width>85</width>177 <height>27</height>178 </rect>179 </property>180 <property name="text">181 <string>(0,0) codeurs</string>182 182 </property> 183 183 </widget> … … 344 344 </property> 345 345 <property name="text"> 346 <string> Align. 1 pt</string>346 <string>Reset matrice</string> 347 347 </property> 348 348 </widget> … … 472 472 <rect> 473 473 <x>20</x> 474 <y>3 8</y>474 <y>32</y> 475 475 <width>511</width> 476 <height>1 15</height>476 <height>121</height> 477 477 </rect> 478 478 </property> -
BAORadio/libindi/libindi/LancementBAOcontrol.sh
r693 r695 3 3 echo "Lancement du serveur indiserver indi_BAO..." 4 4 5 xterm - ge 150x40 -e indiserver indi_BAO&5 xterm -sb -rightbar -sl 3000 -ge 150x40 -e indiserver indi_BAO& 6 6 7 7 sleep 1 -
BAORadio/libindi/libindi/communs/alignement.cpp
r693 r695 21 21 22 22 InitAlignement(); 23 24 23 24 AlignementEnCours = 0; 25 25 26 // initialisation des paramÚtres géométriques de l'antenne 26 27 … … 80 81 // Est-ce que l'antenne est en cours d'alignement ? 81 82 82 AlignementEnCours = 0;83 // AlignementEnCours = 0; 83 84 84 85 // La matrice de correction a-t-elle été calculée ? -
BAORadio/libindi/libindi/communs/astro.cpp
r693 r695 690 690 } 691 691 692 *azmin = min - 200;693 694 *azmax = max + 200;692 *azmin = min - 300; 693 694 *azmax = max + 300; 695 695 696 696 CalculTSL(); -
BAORadio/libindi/libindi/communs/const.h
r693 r695 8 8 ////////////////////////////////////////// 9 9 10 #define VERSION "0.6 2"11 #define VERSION_DATE " 14/09/12"10 #define VERSION "0.63" 11 #define VERSION_DATE "28/09/12" 12 12 13 13 //#define ET_UT 0.0 -
BAORadio/libindi/libindi/drivers/telescope/BAO.cpp
r693 r695 127 127 delta_az = 0; 128 128 delta_ha = 0; 129 VitesseRaquette = 10;129 VitesseRaquette = 3; 130 130 targetAlignmentIP = -1; 131 131 … … 568 568 // est-ce que l'adresse ip correspond à l'adresse d'une antenne connectée ? 569 569 570 for ( i=1; i<SocketsNumber; i++) if ( Sockets[i].Connected)570 for ( i=1; i<SocketsNumber; i++) if ( Sockets[i].Connected ) 571 571 { 572 572 if (Sockets[i].IP == ip) { … … 657 657 { 658 658 Sockets[targetAlignmentIP].AlignementAntenne->AlignementEnCours = 0; 659 660 Sockets[targetAlignmentIP].AlignementAntenne->InitParametresInstrument(); 661 659 662 Sockets[targetAlignmentIP].AlignementAntenne->CalculerMatriceCorrection(targetRA, targetDEC); 663 664 Sockets[targetAlignmentIP].AlignementAntenne->EnregistrementParametresAlignement( 665 Sockets[targetAlignmentIP].IP, 666 "/home/" + (string)getenv("USER") + "/AlignementAntennes.cfg"); 660 667 } 661 668 else … … 666 673 } 667 674 } 675 else if (chaine[0] == 'R') 676 { 677 IDSetText(&CommandTP, "Reinitialisation de la matrice de correction\n" ); 678 679 Sockets[targetAlignmentIP].AlignementAntenne->InitParametresInstrument(); 680 681 Sockets[targetAlignmentIP].AlignementAntenne->Identity(); 682 683 Sockets[targetAlignmentIP].AlignementAntenne->Matrice_ok = false; 684 685 Sockets[targetAlignmentIP].AlignementAntenne->EnregistrementParametresAlignement( 686 Sockets[targetAlignmentIP].IP, 687 "/home/" + (string)getenv("USER") + "/AlignementAntennes.cfg"); 688 } 668 689 else if (chaine[0] == 'O') 669 690 { … … 1315 1336 case 1 : 1316 1337 IUResetSwitch(&RaquetteNP); 1317 IDSetSwitch(&RaquetteNP, "La vitesse de la raquette est fixee a 10x");1318 VitesseRaquette = 10;1338 IDSetSwitch(&RaquetteNP, "La vitesse de la raquette est fixee a 3x"); 1339 VitesseRaquette = 3; 1319 1340 break; 1320 1341 } … … 1474 1495 double az, ha, ad, de, ad2, de2; 1475 1496 1476 int num; 1477 1478 num = Sockets[targetAlignmentIP].AlignementAntenne->nbrcorrections; 1479 1480 ad = targetRA * 15.0 * Pidiv180; 1481 1482 Sockets[targetAlignmentIP].AlignementAntenne->ad[num] = ad; 1483 1484 de = targetDEC * Pidiv180; 1485 1486 Sockets[targetAlignmentIP].AlignementAntenne->de[num] = de; 1487 1488 CalculTSL(); 1489 1490 Sockets[targetAlignmentIP].AlignementAntenne->tsl[num] = GetTSL(); 1491 1492 Azimut(ad, de, &az, &ha); 1493 1494 //ha = RefractionAtmospherique(ha) ; 1495 1496 az = VerifAngle(az + (double)delta_az * PasDeltaAz); 1497 1498 ha += (double)delta_ha * PasDeltaHa; 1499 1500 AzHa2ADDe(az, ha, &ad2, &de2); 1501 1502 1503 Sockets[targetAlignmentIP].AlignementAntenne->delta_ad[num] = ad2; 1504 1505 Sockets[targetAlignmentIP].AlignementAntenne->delta_de[num] = de2; 1497 int num = Sockets[targetAlignmentIP].AlignementAntenne->nbrcorrections; 1498 1499 1506 1500 1507 1501 stringstream os; … … 1513 1507 1514 1508 AfficherLog("(ad1=%s de1=%s) -> (ad2=%s de2=%s)\n", 1515 DHMS(ad * N180divPi, true ).c_str(), 1516 DHMS(de * N180divPi, false).c_str(), 1517 DHMS(ad2 * N180divPi, true ).c_str(), 1518 DHMS(de2 * N180divPi, false).c_str()); 1519 1520 AfficherLog("delta_az=%s delta_ha=%s\n", 1521 DHMS(delta_az * PasDeltaAz, false).c_str(), 1522 DHMS(delta_ha * PasDeltaHa, false).c_str()); 1509 DHMS(Sockets[targetAlignmentIP].AlignementAntenne->ad[num] * N180divPi, true ).c_str(), 1510 DHMS(Sockets[targetAlignmentIP].AlignementAntenne->de[num] * N180divPi, false).c_str(), 1511 DHMS(Sockets[targetAlignmentIP].AlignementAntenne->delta_ad[num] * N180divPi, true ).c_str(), 1512 DHMS(Sockets[targetAlignmentIP].AlignementAntenne->delta_de[num] * N180divPi, false).c_str()); 1513 1514 AfficherLog("delta_az=%i delta_ha=%i\n", delta_az, delta_ha); 1523 1515 1524 1516 Sockets[targetAlignmentIP].AlignementAntenne->nbrcorrections++; … … 1536 1528 case 1 : 1537 1529 { 1538 if (Sockets[targetAlignmentIP].AlignementAntenne->nbrcorrections >=3 )1530 /*if (Sockets[targetAlignmentIP].AlignementAntenne->nbrcorrections >=3 ) 1539 1531 { 1540 1532 // IDLog("Calcul matrice\n", true); … … 1547 1539 1548 1540 Sockets[targetAlignmentIP].AlignementAntenne->Matrice_ok = false; 1549 } 1541 }*/ 1550 1542 1551 1543 IDSetSwitch(&AlignementOkP, "Les parametres de l alignement ont ete sauvegardes"); … … 1727 1719 double newRA2 = newRA * 15.0 * Pidiv180; 1728 1720 double newDEC2 = newDEC * Pidiv180; 1721 double hautmin = HAUTMIN; 1729 1722 char AzStr[32]; 1730 1723 char AltStr[32]; 1731 1724 Coord result, vect; 1732 1725 1733 1726 1734 1727 // Pour toutes les antennes connectées 1735 1728 … … 1792 1785 DHMS(newDEC*N180divPi, false ).c_str()); 1793 1786 }*/ 1787 1794 1788 } 1795 1789 else … … 1803 1797 // entre les deux programmes 1804 1798 1805 newRA = Sockets[i].AlignementAntenne->delta_ad[Sockets[i].AlignementAntenne->nbrcorrections]; 1806 newDEC = Sockets[i].AlignementAntenne->delta_de[Sockets[i].AlignementAntenne->nbrcorrections]; 1799 double az, ha, ad, de; 1807 1800 1808 // if newRA et newDEC = 0 -> on sort 1809 1801 int num = Sockets[i].AlignementAntenne->nbrcorrections; 1802 1803 Sockets[i].AlignementAntenne->ad[num] = newRA2; 1804 1805 Sockets[i].AlignementAntenne->de[num] = newDEC2; 1806 1807 //CalculTSL(); 1808 1809 Sockets[i].AlignementAntenne->tsl[num] = GetTSL(); 1810 1811 Azimut(newRA2, newDEC2, &az, &ha); 1812 1813 //ha = RefractionAtmospherique(ha) ; 1814 1815 az = VerifAngle(az + (double)delta_az * PasDeltaAz); 1816 1817 ha += (double)delta_ha * PasDeltaHa; 1818 1819 AzHa2ADDe( az, ha, &ad, &de ); 1820 1821 Sockets[i].AlignementAntenne->delta_ad[num] = ad; 1822 1823 Sockets[i].AlignementAntenne->delta_de[num] = de; 1824 1825 newRA = ad; 1826 newDEC = de; 1827 1828 // if newRA et newDEC = 0 -> on sort 1829 1810 1830 if ( newRA == 0 && newDEC == 0) return; 1811 1831 … … 1845 1865 //TODO :: à vérifier en détails 1846 1866 1867 // Calcul de la hauteur minimale accessible par l'inbstrument lorsque la matrice de correction est activée 1868 1869 double targetAltL = Sockets[i].AlignementAntenne->Motor2Alt(Sockets[i].AlignementAntenne->Alt2Motor2(HAUTMIN)) * Pidiv180; 1870 1871 vect.x = cos(targetAltL); 1872 vect.y = 0.0; 1873 vect.z = sin(targetAltL); 1874 1875 Sockets[i].AlignementAntenne->AppliquerMatriceCorrectionSimple(&result, vect); 1876 1877 hautmin = asin(result.z) * N180divPi; 1878 1879 AfficherLog("Hauteur %5.0f\n", hautmin); 1880 1881 // Calcul de la hauteur de l'objet suivi aprÚs application de la matrice de correction 1882 1847 1883 double targetAltC = Sockets[i].AlignementAntenne->Motor2Alt(Sockets[i].AlignementAntenne->Alt2Motor2(targetAlt * N180divPi)) * Pidiv180; 1848 1884 … … 1918 1954 // Conversion des deux angles en pas codeurs 1919 1955 1920 if ( targetAlt < HAUTMIN)1956 if ( targetAlt < hautmin ) 1921 1957 { 1922 1958 // L'objet est trop bas ( < 30°). On annule le suivi... … … 1943 1979 } 1944 1980 1945 if ( targetAlt < HAUTMIN ) targetAlt = HAUTMIN;1981 if ( targetAlt < hautmin ) targetAlt = hautmin; 1946 1982 1947 1983 // On applique la formule de Marc pour convertir la hauteur en nombre de pas codeur alt … … 1955 1991 // On ajoute les deltas en AZ et en HA pour la raquette hors procédure d'alignement 1956 1992 1957 Sockets[i].TargetPosition.x += delta_az; 1958 1959 Sockets[i].TargetPosition.y += delta_ha; 1960 1961 //TODO : solution à trouver pour maintenir efficacement l'antenne dans l'intervalle 1993 1994 if (Sockets[i].AlignementAntenne->AlignementEnCours == 0) 1995 { 1996 Sockets[i].TargetPosition.x += delta_az; 1997 1998 Sockets[i].TargetPosition.y += delta_ha; 1999 2000 //Sockets[i].TargetPosition.x = (int) Arrondi( VerifAngle( targetAz * Pidiv180 + (double)delta_az * PasDeltaAz ) * N180divPi * (double)NBREPASCODEURSAZ / 360.0); 2001 2002 //Sockets[i].TargetPosition.y = (int) Arrondi( Sockets[i].AlignementAntenne->Alt2Motor( targetAlt + (double)delta_ha * PasDeltaHa * N180divPi) ); 2003 } 2004 2005 2006 //TODO : à vérifier 1962 2007 1963 2008 // est-ce que le transit de l'objet suivi va nous emmener à sortir de l'intervalle [MINAZCODEURS..MAXAZCODEURS] ?
Note: See TracChangeset
for help on using the changeset viewer.