Changeset 684 for BAORadio/libindi/libindi/communs/alignement.cpp
- Timestamp:
- May 24, 2012, 5:38:38 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BAORadio/libindi/libindi/communs/alignement.cpp
r682 r684 51 51 for (int i=0; i< MAXALIGNEMENTANTENNE; i++) 52 52 { 53 <<<<<<< .mine54 53 ad[i] = 0.0; 55 54 de[i] = 0.0; … … 58 57 tsl[i] = 0.0; 59 58 SelectionnePourCalculMatrice[i] = false; 60 =======61 ad[i] = 0.0;62 de[i] = 0.0;63 delta_ad[i] = 0.0;64 delta_de[i] = 0.0;65 tsl[i] = 0.0;66 SelectionnePourCalculMatrice[i] = false;67 >>>>>>> .r68068 59 } 69 60 … … 183 174 double temp[4][4]; 184 175 double UnitVect[4][4]; 185 176 186 177 temp[1][1] = p2.x - p1.x; 187 178 temp[2][1] = p3.x - p1.x; … … 221 212 double EQLMN2[4][4]; 222 213 double EQMI_T[4][4]; 223 214 224 215 Coord a1, a2, a3, m1, m2, m3; 225 216 226 217 AzHa2XY(aa1.x, aa1.y, &a1.x, &a1.y); 227 218 AzHa2XY(aa2.x, aa2.y, &a2.x, &a2.y); 228 219 AzHa2XY(aa3.x, aa3.y, &a3.x, &a3.y); 229 220 230 <<<<<<< .mine231 Coord a1, a2, a3, m1, m2, m3;232 =======233 221 AzHa2XY(mm1.x, mm1.y, &m1.x, &m1.y); 234 222 AzHa2XY(mm2.x, mm2.y, &m2.x, &m2.y); 235 223 AzHa2XY(mm3.x, mm3.y, &m3.x, &m3.y); 236 224 237 225 //construit les matrices EQLMN1 & 2 238 >>>>>>> .r680 239 240 <<<<<<< .mine 241 AzHa2XY(aa1.x, aa1.y, &a1.x, &a1.y); 242 AzHa2XY(aa2.x, aa2.y, &a2.x, &a2.y); 243 AzHa2XY(aa3.x, aa3.y, &a3.x, &a3.y); 244 ======= 226 245 227 Calculer_Matrice_LMN(m1, m2, m3); 246 >>>>>>> .r680 247 248 <<<<<<< .mine 249 AzHa2XY(mm1.x, mm1.y, &m1.x, &m1.y); 250 AzHa2XY(mm2.x, mm2.y, &m2.x, &m2.y); 251 AzHa2XY(mm3.x, mm3.y, &m3.x, &m3.y); 252 ======= 228 253 229 for (int i=1; i<=3; i++) for (int j=1; j<=3; j++) EQLMN1[i][j]=GETLMN[i][j]; 254 >>>>>>> .r680255 256 <<<<<<< .mine257 //construit les matrices EQLMN1 & 2258 259 Calculer_Matrice_LMN(m1, m2, m3);260 =======261 Calculer_Matrice_LMN(a1, a2, a3);262 >>>>>>> .r680263 264 <<<<<<< .mine265 for (int i=1; i<=3; i++) for (int j=1; j<=3; j++) EQLMN1[i][j]=GETLMN[i][j];266 =======267 for (int i=1; i<=3; i++) for (int j=1; j<=3; j++) EQLMN2[i][j]=GETLMN[i][j];268 >>>>>>> .r680269 230 270 231 Calculer_Matrice_LMN(a1, a2, a3); … … 377 338 double EQMQ[4][4]; 378 339 379 <<<<<<< .mine380 340 Coord a1, a2, a3, m1, m2, m3, c1, c2; 381 ======= 382 Coord a1, a2, a3, m1, m2, m3, c1, c2; 383 341 384 342 AzHa2XY(aa1.x, aa1.y, &a1.x, &a1.y); 385 343 AzHa2XY(aa2.x, aa2.y, &a2.x, &a2.y); … … 389 347 AzHa2XY(mm2.x, mm2.y, &m2.x, &m2.y); 390 348 AzHa2XY(mm3.x, mm3.y, &m3.x, &m3.y); 391 392 /*c1.x=(a1.x+a2.x+a3.x)/3.0; 393 c1.y=(a1.y+a2.y+a3.y)/3.0; 394 395 c2.x=(m1.x+m2.x+m3.x)/3.0; 396 c2.y=(m1.y+m2.y+m3.y)/3.0; 397 398 a1.x-=c1.x; 399 a1.y-=c1.y; 400 a2.x-=c1.x; 401 a2.y-=c1.y; 402 a3.x-=c1.x; 403 a3.y-=c1.y; 404 405 m1.x-=c2.x; 406 m1.y-=c2.y; 407 m2.x-=c2.x; 408 m2.y-=c2.y; 409 m3.x-=c2.x; 410 m3.y-=c2.y;*/ 411 412 413 414 349 350 415 351 //Construit les matrices EQMP et EQMQ 416 >>>>>>> .r680 417 418 <<<<<<< .mine 419 AzHa2XY(aa1.x, aa1.y, &a1.x, &a1.y); 420 AzHa2XY(aa2.x, aa2.y, &a2.x, &a2.y); 421 AzHa2XY(aa3.x, aa3.y, &a3.x, &a3.y); 422 ======= 352 423 353 Calculer_Matrice_GETPQ(m1, m2, m3); 424 >>>>>>> .r680 425 426 <<<<<<< .mine 427 AzHa2XY(mm1.x, mm1.y, &m1.x, &m1.y); 428 AzHa2XY(mm2.x, mm2.y, &m2.x, &m2.y); 429 AzHa2XY(mm3.x, mm3.y, &m3.x, &m3.y); 430 ======= 354 431 355 for (int i=1; i<=3; i++) for (int j=1; j<=3; j++) EQMP[i][j]=GETPQ[i][j]; 432 >>>>>>> .r680433 434 <<<<<<< .mine435 436 //Construit les matrices EQMP et EQMQ437 438 Calculer_Matrice_GETPQ(m1, m2, m3);439 =======440 Calculer_Matrice_GETPQ(a1, a2, a3);441 >>>>>>> .r680442 443 <<<<<<< .mine444 for (int i=1; i<=3; i++) for (int j=1; j<=3; j++) EQMP[i][j]=GETPQ[i][j];445 =======446 for (int i=1; i<=3; i++) for (int j=1; j<=3; j++) EQMQ[i][j]=GETPQ[i][j];447 >>>>>>> .r680448 356 449 357 Calculer_Matrice_GETPQ(a1, a2, a3); … … 476 384 MATRICE[2][1] = (EQMI[2][1] * EQMQ[1][1]) + (EQMI[2][2] * EQMQ[2][1]); 477 385 MATRICE[2][2] = (EQMI[2][1] * EQMQ[1][2]) + (EQMI[2][2] * EQMQ[2][2]); 478 479 480 386 481 387 482 388 … … 486 392 VECT_OFFSET.y =0.0;//m1.y - ((a1.x * MATRICE[1][2]) + (a1.y * MATRICE[2][2])); 487 393 488 <<<<<<< .mine489 394 if (x + y == 0 ) 490 395 { … … 495 400 return PointSitueDansSurfaceTriangle(x, y, aa1.x, aa1.y, aa2.x, aa2.y, aa3.x, aa3.y); 496 401 } 497 =======498 if (x + y == 0 )499 {500 return 0;501 }502 else503 {504 return PointSitueDansSurfaceTriangle(x, y, aa1.x, aa1.y, aa2.x, aa2.y, aa3.x, aa3.y);505 }506 >>>>>>> .r680507 402 } 508 403 … … 676 571 677 572 678 <<<<<<< .mine679 573 double Alignement::Determinant() 680 574 { 681 575 double Det; 682 ======= 683 double Alignement::Determinant() 684 { 685 double Det; 686 576 687 577 Det = MATRICE[1][1] * ((MATRICE[2][2] * MATRICE[3][3]) - (MATRICE[3][2] * MATRICE[2][ 3])); 688 578 Det = Det - (MATRICE[1][2] * ((MATRICE[2][1] * MATRICE[3][3]) - (MATRICE[3][1] * MATRICE[2][3]))); 689 579 Det = Det + (MATRICE[1][3] * ((MATRICE[2][1] * MATRICE[3][2]) - (MATRICE[3][1] * MATRICE[2][2]))); 690 >>>>>>> .r680 691 692 <<<<<<< .mine 693 Det = MATRICE[1][1] * ((MATRICE[2][2] * MATRICE[3][3]) - (MATRICE[3][2] * MATRICE[2][ 3])); 694 Det = Det - (MATRICE[1][2] * ((MATRICE[2][1] * MATRICE[3][3]) - (MATRICE[3][1] * MATRICE[2][3]))); 695 Det = Det + (MATRICE[1][3] * ((MATRICE[2][1] * MATRICE[3][2]) - (MATRICE[3][1] * MATRICE[2][2]))); 696 ======= 580 697 581 return Det; 698 582 } 699 >>>>>>> .r680700 701 <<<<<<< .mine702 return Det;703 }704 583 705 584 … … 714 593 } 715 594 716 =======717 718 719 void Alignement::AzHa2XY(double az, double ha, double *x, double *y)720 {721 double r = Pidiv2 - ha;722 723 *x = r * cos(az);724 725 *y = r * sin(az);726 }727 728 >>>>>>> .r680729 595 /************************************************************************************** 730 596 ** Calcule la surface d'un triangle de coordonnées (px1,py1) (px2, py2) (px3, py3) … … 735 601 { 736 602 double ta; 737 603 738 604 double pxx1, pyy1, pxx2, pyy2, pxx3, pyy3; 739 605 740 <<<<<<< .mine741 double pxx1, pyy1, pxx2, pyy2, pxx3, pyy3;742 =======743 606 AzHa2XY(px1, py1, &pxx1, &pyy1); 744 >>>>>>> .r680745 746 <<<<<<< .mine747 AzHa2XY(px1, py1, &pxx1, &pyy1);748 607 749 608 AzHa2XY(px2, py2, &pxx2, &pyy2); … … 753 612 ta = (((pxx2 * pyy1) - (pxx1 * pyy2)) ) + (((pxx3 * pyy2) - (pxx2 * pyy3)) ) + (((pxx1 * pyy3) - (pxx3 * pyy1)) ); 754 613 755 =======756 AzHa2XY(px2, py2, &pxx2, &pyy2);757 758 AzHa2XY(px3, py3, &pxx3, &pyy3);759 760 ta = (((pxx2 * pyy1) - (pxx1 * pyy2)) ) + (((pxx3 * pyy2) - (pxx2 * pyy3)) ) + (((pxx1 * pyy3) - (pxx3 * pyy1)) );761 762 >>>>>>> .r680763 614 return fabs(ta) / 2.0; 764 615 } … … 788 639 AfficherLog(os.str().c_str(), true); 789 640 790 <<<<<<< .mine791 641 /* if ( DistanceAngulaireEntre2Points(px, py, px1, py1) > 1.2 ) return false; 792 642 if ( DistanceAngulaireEntre2Points(px, py, px2, py2) > 1.2 ) return false; 793 643 if ( DistanceAngulaireEntre2Points(px, py, px3, py3) > 1.2 ) return false;*/ 794 =======795 /* if ( DistanceAngulaireEntre2Points(px, py, px1, py1) > 1.2 ) return false;796 if ( DistanceAngulaireEntre2Points(px, py, px2, py2) > 1.2 ) return false;797 if ( DistanceAngulaireEntre2Points(px, py, px3, py3) > 1.2 ) return false;*/798 >>>>>>> .r680799 644 800 645 return ( fabs(ta - t1 - t2 - t3) < 1e-10 ); … … 1122 967 os << "Point " << map[i] << " d=" << distances[i] * N180divPi << "°\n"; 1123 968 } 1124 <<<<<<< .mine1125 969 1126 970 for (int i=0; i<nbrcorrections; i++) 1127 =======1128 1129 for (int i=0; i<nbrcorrections; i++)1130 >>>>>>> .r6801131 971 { 1132 972 for (int j=i+1; j<nbrcorrections; j++) … … 1200 1040 os << "\nUtilisation du triangle : " << map[best1] << " " << map[best2] << " " << map[best3] << "\n" ; 1201 1041 1202 <<<<<<< .mine1203 1042 // if (MethodeAlignement == SIMPLE) 1204 =======1205 // if (MethodeAlignement == SIMPLE)1206 >>>>>>> .r6801207 1043 { 1208 1044 c1.x = VerifAngle(ad[map[best1]] - tsl[map[best1]] + GetTSL()); … … 1218 1054 c3.z = 1.0; 1219 1055 } 1220 <<<<<<< .mine1221 1056 /* else 1222 1057 { … … 1224 1059 c1.y = de[map[best1]]; 1225 1060 c1.z = 1.0; 1226 ======= 1227 /* else 1228 { 1229 c1.x = VerifAngle(ad[map[best1]] - tsl[map[best1]] + GetTSL()); 1230 c1.y = de[map[best1]]; 1231 c1.z = 1.0; 1232 >>>>>>> .r680 1233 1234 <<<<<<< .mine 1061 1235 1062 c2.x = VerifAngle(ad[map[best2]] - tsl[map[best2]] + GetTSL()); 1236 1063 c2.y = de[map[best2]]; 1237 1064 c2.z = 1.0; 1238 ======= 1239 c2.x = VerifAngle(ad[map[best2]] - tsl[map[best2]] + GetTSL()); 1240 c2.y = de[map[best2]]; 1241 c2.z = 1.0; 1242 >>>>>>> .r680 1243 1244 <<<<<<< .mine 1065 1245 1066 c3.x = VerifAngle(ad[map[best3]] - tsl[map[best3]] + GetTSL()); 1246 1067 c3.y = de[map[best3]]; … … 1250 1071 m1.x = VerifAngle(delta_ad[map[best1]] - tsl[map[best1]] + GetTSL()); 1251 1072 m1.y = delta_de[map[best1]]; 1252 =======1253 c3.x = VerifAngle(ad[map[best3]] - tsl[map[best3]] + GetTSL());1254 c3.y = de[map[best3]];1255 c3.z = 1.0;1256 }*/1257 1258 m1.x = VerifAngle(delta_ad[map[best1]] - tsl[map[best1]] + GetTSL());1259 m1.y = delta_de[map[best1]];1260 >>>>>>> .r6801261 1073 m1.z = 1.0; 1262 1074 … … 1298 1110 1299 1111 1300 <<<<<<< .mine1301 1112 for (int i=0; i<nbrcorrections; i++) SelectionnePourCalculMatrice[i] = false; 1302 ======= 1303 for (int i=0; i<nbrcorrections; i++) SelectionnePourCalculMatrice[i] = false; 1304 1113 1305 1114 SelectionnePourCalculMatrice[map[best1]] = true; 1306 1115 SelectionnePourCalculMatrice[map[best2]] = true; 1307 1116 SelectionnePourCalculMatrice[map[best3]] = true; 1308 1309 >>>>>>> .r680 1310 1311 <<<<<<< .mine 1312 SelectionnePourCalculMatrice[map[best1]] = true; 1313 SelectionnePourCalculMatrice[map[best2]] = true; 1314 SelectionnePourCalculMatrice[map[best3]] = true; 1315 1316 1317 ======= 1318 //Vérifications supp 1319 /* 1320 Coord result, mm1; 1321 double targetAz, targetAlt; 1322 1323 os << "\n\n\n" << GetLatitude()*N180divPi << " " << GetLongitude()*N180divPi << "\n"; 1324 os << GetPression() << " " << GetTemperature() << "\n"; 1325 os << GetHeure() << ":" << GetMin() << ":" << GetSec() << "\n"; 1326 os << DHMS(GetTSL()*N180divPi, true) << "\n\n"; 1327 1328 Azimut(c3.x, c3.y, &mm1.x, &mm1.y); 1329 1330 os << mm1.x*N180divPi << " " << mm1.y*N180divPi << "\n"; 1331 1332 1333 Azimut(m3.x, m3.y, &mm1.x, &mm1.y); 1334 1335 os << mm1.x*N180divPi << " " << mm1.y*N180divPi << "\n"; 1336 1337 1338 Azimut(c3.x, c3.y, &mm1.x, &mm1.y); 1339 1340 double x=cos(mm1.x) * cos(mm1.y); 1341 double y=sin(mm1.x) * cos(mm1.y); 1342 double z=sin(mm1.y); 1343 mm1.x=x; 1344 mm1.y=y; 1345 mm1.z=z; 1346 1347 AppliquerMatriceCorrectionSimple(&result, mm1); 1348 1349 if (result.x != 0.0) 1350 { 1351 targetAz = atan( result.y / result.x ); 1352 1353 if (result.x < 0) targetAz+=Pi; 1354 } 1355 else targetAz = Pidiv2; 1356 1357 targetAz = VerifAngle(targetAz); 1358 1359 targetAlt = asin(result.z); 1360 1361 os << targetAz*N180divPi << " " << targetAlt*N180divPi << "\n"; 1362 */ 1363 1364 1365 1366 >>>>>>> .r680 1117 1118 1367 1119 //Afficher les messages de cette fonction 1368 1120 … … 1382 1134 1383 1135 // sauvegarder la position courante 1384 <<<<<<< .mine1385 1136 // long pos = fichier.tellg(); 1386 =======1387 // long pos = fichier.tellg();1388 >>>>>>> .r6801389 1137 // se placer en fin de fichier 1390 1138 fichier.seekg( 0 , std::ios_base::end ); … … 1438 1186 1439 1187 1440 <<<<<<< .mine1441 1188 nbrcorrections = 0; 1442 1189 1443 1190 for (int j=0; j < MAXALIGNEMENTANTENNE; j++) 1444 =======1445 nbrcorrections = 0;1446 1447 for (int j=0; j < MAXALIGNEMENTANTENNE; j++)1448 >>>>>>> .r6801449 1191 { 1450 1192 os2 << "ad " << j; … … 1485 1227 // -> on les applique... 1486 1228 1487 <<<<<<< .mine 1488 ======= 1489 1490 >>>>>>> .r680 1491 1492 <<<<<<< .mine 1229 1493 1230 1494 1231 if (delta_ad[nbrcorrections] != atof(delta_ad_data) || delta_de[nbrcorrections] != atof(delta_de_data)) 1495 =======1496 if (delta_ad[nbrcorrections] != atof(delta_ad_data) || delta_de[nbrcorrections] != atof(delta_de_data))1497 >>>>>>> .r6801498 1232 { 1499 1233 ad[nbrcorrections] = atof(ad_data); … … 1507 1241 tsl[nbrcorrections] = atof(tsl_data); 1508 1242 1509 <<<<<<< .mine1510 1243 os2 << "Correction antenne ip=" << IP << " ad=" << ad[nbrcorrections] << " de=" << de[nbrcorrections] << " deltaAD=" << 1511 1244 delta_ad[nbrcorrections] << " deltaDe=" << delta_de[nbrcorrections] << " tsl=" << tsl[nbrcorrections] << "\n"; 1512 =======1513 os2 << "Correction antenne ip=" << IP << " ad=" << ad[nbrcorrections] << " de=" << de[nbrcorrections] << " deltaAD=" <<1514 delta_ad[nbrcorrections] << " deltaDe=" << delta_de[nbrcorrections] << " tsl=" << tsl[nbrcorrections] << "\n";1515 >>>>>>> .r6801516 1245 1517 1246 AfficherLog(&os2, true); 1518 1247 1519 1248 modificationAlignement = true; 1520 <<<<<<< .mine1521 1249 1522 1250 nbrcorrections++; 1523 1251 } 1524 =======1525 1526 nbrcorrections++;1527 }1528 >>>>>>> .r6801529 1252 } 1530 1253 … … 1760 1483 } 1761 1484 1762 <<<<<<< .mine1763 1485 for (int j = 0; j < nbrcorrections; j++) if (ad[j]!=0.0 && de[j]!=0.0) 1764 1486 { … … 1771 1493 1772 1494 writeINI((char*)section.c_str(), (char*)key.c_str(), (char*)value.c_str(), (char*)fileName.c_str()); 1773 =======1774 for (int j = 0; j < nbrcorrections; j++) if (ad[j]!=0.0 && de[j]!=0.0)1775 {1776 os << "ad " << j;1777 key = os.str();1778 os.str("");1779 os << ad[j];1780 value = os.str();1781 os.str("");1782 >>>>>>> .r6801783 1495 1784 1496 os << "de " << j;
Note: See TracChangeset
for help on using the changeset viewer.