Changeset 495 for BAORadio/libindi
- Timestamp:
- Sep 21, 2010, 12:24:03 AM (15 years ago)
- Location:
- BAORadio/libindi/libindi
- Files:
-
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
BAORadio/libindi/libindi/BAOTest/Makefile
r490 r495 4 4 simple_server_objects = ServerSocket.o Socket.o simple_server_main.o 5 5 simple_client_objects = ClientSocket.o Socket.o simple_client_main.o 6 BAOtest_objects = ClientSocket.o Socket.o BAOtest_main.o6 BAOtest_objects = ClientSocket.o ServerSocket.o Socket.o BAOtest_main.o 7 7 8 8 -
BAORadio/libindi/libindi/BAOTest/ServerSocket.cpp
r490 r495 21 21 throw SocketException ( "Could not listen to socket." ); 22 22 } 23 Socket::set_non_blocking(true);23 //Socket::set_non_blocking(true); 24 24 } 25 25 … … 45 45 if ( ! Socket::recv ( s ) ) 46 46 { 47 47 throw SocketException ( "Could not read from socket." ); 48 48 } 49 49 … … 58 58 } 59 59 } 60 61 void ServerSocket::recv( std::string& s ) 62 { 63 if ( ! Socket::recv ( s ) ) 64 { 65 throw SocketException ( "Could not read from socket." ); 66 } 67 } -
BAORadio/libindi/libindi/BAOTest/ServerSocket.h
r490 r495 18 18 const ServerSocket& operator >> ( std::string& ) const; 19 19 20 void recv( std::string& s ); 21 20 22 void accept ( ServerSocket& ); 21 23 -
BAORadio/libindi/libindi/drivers/telescope/BAO.cpp
r494 r495 225 225 SocketsNumber = 1; 226 226 227 ActualisationTM1 = 15.0*60.0; 228 229 ActualisationTM2 = 5.0; 230 227 231 InitThreadOK=false; 228 232 LecturePosition=false; … … 299 303 IUFillNumberVector(&GeographicCoordsWNP, GeographicCoordsWN, NARRAY(GeographicCoordsWN), mydev, "GEOGRAPHIC_COORD" , "Geographic coords", OPTIONS_GROUP, IP_WO, 0, IPS_IDLE); 300 304 305 // Actualisation - SET 306 IUFillNumber(&ActualisationN1[0], "DELAY", "Transit mode delay (Sec)", "%10.6m", 0., 3600., 0., 0.); 307 IUFillNumberVector(&ActualisationNP1, ActualisationN1, NARRAY(ActualisationN1), mydev, "DELAY1" , "", OPTIONS_GROUP, IP_WO, 0, IPS_IDLE); 308 309 IUFillNumber(&ActualisationN2[0], "DELAY", "Tracking mode delay (Sec)", "%10.6m", 0., 3600., 0., 0.); 310 IUFillNumberVector(&ActualisationNP2, ActualisationN2, NARRAY(ActualisationN2), mydev, "DELAY2" , "", OPTIONS_GROUP, IP_WO, 0, IPS_IDLE); 301 311 302 312 // Transit threshold 303 IUFillNumber(&SlewAccuracyN[0], "TransitRA", "RA (arcmin)", "%10.6m", 0., 60., 1., 3.0);304 IUFillNumber(&SlewAccuracyN[1], "TransitDEC", "Dec (arcmin)", "%10.6m", 0., 60., 1., 3.0);305 IUFillNumberVector(&SlewAccuracyNP, SlewAccuracyN, NARRAY(SlewAccuracyN), mydev, "Transit Accuracy", "", OPTIONS_GROUP, IP_RW, 0, IPS_IDLE);313 //IUFillNumber(&SlewAccuracyN[0], "TransitRA", "RA (arcmin)", "%10.6m", 0., 60., 1., 3.0); 314 //IUFillNumber(&SlewAccuracyN[1], "TransitDEC", "Dec (arcmin)", "%10.6m", 0., 60., 1., 3.0); 315 //IUFillNumberVector(&SlewAccuracyNP, SlewAccuracyN, NARRAY(SlewAccuracyN), mydev, "Transit Accuracy", "", OPTIONS_GROUP, IP_RW, 0, IPS_IDLE); 306 316 307 317 // Tracking threshold 308 IUFillNumber(&TrackAccuracyN[0], "TrackingRA", "RA (arcmin)", "%10.6m", 0., 60., 1., 3.0);309 IUFillNumber(&TrackAccuracyN[1], "TrackingDEC", "Dec (arcmin)", "%10.6m", 0., 60., 1., 3.0);310 IUFillNumberVector(&TrackAccuracyNP, TrackAccuracyN, NARRAY(TrackAccuracyN), mydev, "Tracking Accuracy", "", OPTIONS_GROUP, IP_RW, 0, IPS_IDLE);318 //IUFillNumber(&TrackAccuracyN[0], "TrackingRA", "RA (arcmin)", "%10.6m", 0., 60., 1., 3.0); 319 //IUFillNumber(&TrackAccuracyN[1], "TrackingDEC", "Dec (arcmin)", "%10.6m", 0., 60., 1., 3.0); 320 //IUFillNumberVector(&TrackAccuracyNP, TrackAccuracyN, NARRAY(TrackAccuracyN), mydev, "Tracking Accuracy", "", OPTIONS_GROUP, IP_RW, 0, IPS_IDLE); 311 321 312 322 } … … 332 342 333 343 // Options 334 IDDefNumber(&SlewAccuracyNP, NULL); 335 IDDefNumber(&TrackAccuracyNP, NULL); 344 //IDDefNumber(&SlewAccuracyNP, NULL); 345 //IDDefNumber(&TrackAccuracyNP, NULL); 346 IDDefNumber(&ActualisationNP1, NULL); 347 IDDefNumber(&ActualisationNP2, NULL); 336 348 337 349 } … … 448 460 if (eqp == &EquatorialCoordsWN[0]) 449 461 { 450 newRA = values[i]; 462 newRA = values[i]; 451 463 nset += newRA >= 0 && newRA <= 24.0; 452 464 } … … 489 501 490 502 return; 503 } 504 505 // =================================== 506 // Actualisation 507 // =================================== 508 if (!strcmp (name, ActualisationNP1.name)) 509 { 510 int i=0, nset=0, error_code=0; 511 double newAct1 =0; 512 513 for (nset = i = 0; i < n; i++) 514 { 515 INumber *eqp = IUFindNumber (&ActualisationNP1, names[i]); 516 if (eqp == &ActualisationN1[0]) 517 { 518 newAct1 = values[i]; 519 520 if (newAct1 >= 0.0 && newAct1 <= 3600.0) 521 { 522 ActualisationTM1=newAct1; 523 524 ActualisationNP1.s = IPS_OK; 525 IDSetNumber(&ActualisationNP1, NULL); 526 } 527 else 528 { 529 ActualisationNP1.s = IPS_ALERT; 530 IDSetNumber(&ActualisationNP1, "Delay invalid"); 531 } 532 } 533 } 534 535 } 536 537 if (!strcmp (name, ActualisationNP2.name)) 538 { 539 int i=0, nset=0, error_code=0; 540 double newAct2 =0; 541 542 for (nset = i = 0; i < n; i++) 543 { 544 INumber *eqp = IUFindNumber (&ActualisationNP2, names[i]); 545 if (eqp == &ActualisationN2[0]) 546 { 547 newAct2 = values[i]; 548 549 if (newAct2 >= 0.0 && newAct2 <= 3600.0) 550 { 551 ActualisationTM2=newAct2; 552 553 ActualisationNP2.s = IPS_OK; 554 IDSetNumber(&ActualisationNP2, NULL); 555 } 556 else 557 { 558 ActualisationNP2.s = IPS_ALERT; 559 IDSetNumber(&ActualisationNP2, "Delay invalid"); 560 } 561 } 562 } 563 491 564 } /* end EquatorialCoordsWNP */ 492 565 } … … 620 693 //EquatorialCoordsRNP.s = IPS_IDLE; 621 694 GeographicCoordsWNP.s = IPS_IDLE; 622 SlewAccuracyNP.s = IPS_IDLE; 623 TrackAccuracyNP.s = IPS_IDLE; 695 //SlewAccuracyNP.s = IPS_IDLE; 696 //TrackAccuracyNP.s = IPS_IDLE; 697 ActualisationNP1.s = IPS_IDLE; 698 ActualisationNP2.s = IPS_IDLE; 624 699 625 700 IUResetSwitch(&OnCoordSetSP); … … 639 714 //IDSetNumber(&EquatorialCoordsRNP, NULL); 640 715 IDSetNumber(&GeographicCoordsWNP, NULL); 641 IDSetNumber(&SlewAccuracyNP, NULL); 642 IDSetNumber(&TrackAccuracyNP, NULL); 716 //IDSetNumber(&SlewAccuracyNP, NULL); 717 //IDSetNumber(&TrackAccuracyNP, NULL); 718 IDSetNumber(&ActualisationNP1, NULL); 719 IDSetNumber(&ActualisationNP2, NULL); 720 643 721 } 644 722 … … 843 921 //Y a-t-il de nouvelles tentatives de connexion sur le serveur ? 844 922 845 InitThread(); 923 InitThread(); 846 924 } 847 925 … … 1101 1179 // Durée entre deux actualisations 1102 1180 1103 double delai= 15.0/60.0/24.0; // Actualisation toutes les 15 minutes en mode transit1104 1105 if (TrackingMode==2) delai= 5.0/3600.0/24.0; //et 5 secs en mode tracking1181 double delai=ActualisationTM1/3600.0/24.0; // Actualisation toutes les 15 minutes en mode transit 1182 1183 if (TrackingMode==2) delai=ActualisationTM2/3600.0/24.0; //et 5 secs en mode tracking 1106 1184 1107 1185 … … 1363 1441 1364 1442 //pour tester le programme de François, on envoie ces coordonnees sur sa demande 1365 1366 1367 //if (!GOTO(i, TargetPosition.x, TargetPosition.y)) Sockets[i].sendalertes++;1443 //if (!GOTO(i, 1000, -3000)) Sockets[i].sendalertes++; 1444 1445 if (!GOTO(i, Sockets[i].Pos.x - TargetPosition.x, Sockets[i].Pos.y - TargetPosition.y )) Sockets[i].sendalertes++; 1368 1446 1369 1447 Sockets[i].etape++; … … 1487 1565 IDSetSwitch (&ConnectSP, "BAORadio is online. Retrieving basic data..."); 1488 1566 1567 1489 1568 break; 1490 1569 … … 1519 1598 { 1520 1599 // IDSetNumber (&EquatorialCoordsRNP, NULL); 1600 1601 1521 1602 } 1522 1603 … … 1677 1758 } 1678 1759 1679 sprintf(Params, "%c%0 3i%c%03i", sensAz, deltaAz, sensAlt, deltaAlt);1760 sprintf(Params, "%c%04i%c%04i", sensAz, deltaAz, sensAlt, deltaAlt); 1680 1761 1681 1762 return COMMANDE(numsocket, (char*)"g", Params); -
BAORadio/libindi/libindi/drivers/telescope/BAO.h
r492 r495 117 117 INumber EquatorialCoordsWN[2]; 118 118 INumber GeographicCoordsWN[2]; 119 INumber SlewAccuracyN[2]; 120 INumber TrackAccuracyN[2]; 119 INumber ActualisationN1[1]; 120 INumber ActualisationN2[1]; 121 122 //INumber SlewAccuracyN[2]; 123 //INumber TrackAccuracyN[2]; 121 124 122 125 /* Switch Vectors */ … … 130 133 INumberVectorProperty EquatorialCoordsWNP; 131 134 INumberVectorProperty GeographicCoordsWNP; 132 INumberVectorProperty SlewAccuracyNP; 133 INumberVectorProperty TrackAccuracyNP; 135 //INumberVectorProperty SlewAccuracyNP; 136 //INumberVectorProperty TrackAccuracyNP; 137 INumberVectorProperty ActualisationNP1; 138 INumberVectorProperty ActualisationNP2; 139 134 140 135 141 /* Text Vectors */ … … 170 176 double lastDEC; 171 177 double JJAnc; // Sauvegarde du jour julien de la derniÚre actualisation de la position (fct Goto) 178 double ActualisationTM1; 179 double ActualisationTM2; 172 180 bool simulation; 173 181 bool fault;
Note:
See TracChangeset
for help on using the changeset viewer.