Changeset 697 for BAORadio/libindi/libindi/drivers/telescope
- Timestamp:
- Oct 22, 2012, 4:20:40 PM (12 years ago)
- Location:
- BAORadio/libindi/libindi/drivers/telescope
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
BAORadio/libindi/libindi/drivers/telescope/BAO.cpp
r695 r697 652 652 else if (chaine[0] == 'M') 653 653 { 654 IDSetText(&CommandTP, "Calcul des matrices de correction\n" ); 655 656 if (Sockets[targetAlignmentIP].AlignementAntenne->nbrcorrections >=3 ) 654 if (targetAlignmentIP != -1) 657 655 { 658 Sockets[targetAlignmentIP].AlignementAntenne->AlignementEnCours = 0; 659 660 Sockets[targetAlignmentIP].AlignementAntenne->InitParametresInstrument(); 661 662 Sockets[targetAlignmentIP].AlignementAntenne->CalculerMatriceCorrection(targetRA, targetDEC); 663 664 Sockets[targetAlignmentIP].AlignementAntenne->EnregistrementParametresAlignement( 656 IDSetText(&CommandTP, "Calcul des matrices de correction\n" ); 657 658 if (Sockets[targetAlignmentIP].AlignementAntenne->nbrcorrections >=3 ) 659 { 660 Sockets[targetAlignmentIP].AlignementAntenne->AlignementEnCours = 0; 661 662 Sockets[targetAlignmentIP].AlignementAntenne->InitParametresInstrument(); 663 664 Sockets[targetAlignmentIP].AlignementAntenne->CalculerMatriceCorrection(targetRA, targetDEC); 665 666 Sockets[targetAlignmentIP].AlignementAntenne->EnregistrementParametresAlignement( 667 Sockets[targetAlignmentIP].IP, 668 "/home/" + (string)getenv("USER") + "/AlignementAntennes.cfg"); 669 } 670 else 671 { 672 Sockets[targetAlignmentIP].AlignementAntenne->Identity(); 673 674 Sockets[targetAlignmentIP].AlignementAntenne->Matrice_ok = false; 675 } 676 } 677 } 678 else if (chaine[0] == 'R') 679 { 680 if (targetAlignmentIP != -1) 681 { 682 IDSetText(&CommandTP, "Reinitialisation de la matrice de correction\n" ); 683 684 Sockets[targetAlignmentIP].AlignementAntenne->InitParametresInstrument(); 685 686 Sockets[targetAlignmentIP].AlignementAntenne->Identity(); 687 688 Sockets[targetAlignmentIP].AlignementAntenne->Matrice_ok = false; 689 690 Sockets[targetAlignmentIP].AlignementAntenne->EnregistrementParametresAlignement( 665 691 Sockets[targetAlignmentIP].IP, 666 692 "/home/" + (string)getenv("USER") + "/AlignementAntennes.cfg"); 667 693 } 668 else 669 { 670 Sockets[targetAlignmentIP].AlignementAntenne->Identity(); 671 672 Sockets[targetAlignmentIP].AlignementAntenne->Matrice_ok = false; 673 } 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 } 694 } 689 695 else if (chaine[0] == 'O') 690 696 { 691 IDSetText(&CommandTP, "Optimisation de la geometrie de l antenne\n" );692 693 697 if (targetAlignmentIP != -1) 694 698 { 699 IDSetText(&CommandTP, "Optimisation de la geometrie de l antenne\n" ); 700 695 701 Sockets[targetAlignmentIP].AlignementAntenne->OptimisationGeometrieAntenne(true); 696 702 … … 1798 1804 1799 1805 double az, ha, ad, de; 1800 1806 1801 1807 int num = Sockets[i].AlignementAntenne->nbrcorrections; 1802 1808 -
BAORadio/libindi/libindi/drivers/telescope/celestrongps.cpp
r642 r697 447 447 448 448 if (IUUpdateSwitch(&OnCoordSetSP, states, names, n) < 0) return; 449 OnCoordSetSP.s = IPS_OK; 450 IDSetSwitch(&OnCoordSetSP, NULL); 449 451 currentSet = getOnSwitch(&OnCoordSetSP); 450 452 } … … 524 526 last_move = getOnSwitch(&MovementNSSP); 525 527 526 if (IUUpdateSwitch(&MovementNSSP, states, names, n) < 0) 527 IDLog("fixme!!! - IUUpdateSwitch MovementNSSP\n"); 528 // return; 528 IUUpdateSwitch(&MovementNSSP, states, names, n); 529 529 530 530 current_move = getOnSwitch(&MovementNSSP); -
BAORadio/libindi/libindi/drivers/telescope/lx200basic.cpp
r501 r697 45 45 46 46 const int POLLMS = 1000; // Period of update, 1 second. 47 c onst char *mydev = "LX200 Basic";// Name of our device.47 char *mydev; // Name of our device. 48 48 49 49 const char *BASIC_GROUP = "Main Control"; // Main Group … … 151 151 LX200Basic::LX200Basic() 152 152 { 153 mydev = new char[MAXINDIDEVICE]; 154 155 char *envDev = getenv("INDIDEV"); 156 157 if (envDev != NULL) 158 strncpy(mydev, envDev, MAXINDIDEVICE); 159 else 160 strncpy(mydev, "LX200 Basic", MAXINDIDEVICE); 161 153 162 init_properties(); 154 163 -
BAORadio/libindi/libindi/drivers/telescope/lx200fs2.cpp
r646 r697 64 64 65 65 IDLog("Initilizing from LX200 FS2 device...\n"); 66 IDLog("Driver Version: 201 1-01-02\n");66 IDLog("Driver Version: 2012-07-22\n"); 67 67 68 68 //enableSimulation(true); … … 151 151 152 152 if (FirmwareVerNP.np[0].value < 1.19) 153 return getLX200RA(fd, &x); // Version 1.18 and below don't support ACK command 153 { 154 getLX200RA(fd, &x); 155 return getLX200DEC(fd, &x); // Version 1.18 and below don't support ACK command 156 } 154 157 else 155 158 return check_lx200_connection(fd); … … 216 219 void LX200Fs2::getBasicData() 217 220 { 218 219 // process parent first 220 LX200Generic::getBasicData(); 221 //LX200Generic::getBasicData() 221 222 // Make sure short 222 223 //checkLX200Format(fd); -
BAORadio/libindi/libindi/drivers/telescope/lx200generic.cpp
r642 r697 507 507 508 508 } 509 509 IEAddTimer (POLLMS, ISPoll, NULL); 510 510 } 511 511 512 512 void ISGetProperties (const char *dev) 513 { ISInit(); telescope->ISGetProperties(dev); IEAddTimer (POLLMS, ISPoll, NULL);}513 { ISInit(); telescope->ISGetProperties(dev);} 514 514 void ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n) 515 515 { ISInit(); telescope->ISNewSwitch(dev, name, states, names, n);} … … 555 555 IDLog("INDI Library v%g\n", INDI_LIBV); 556 556 IDLog("initilizaing from generic LX200 device...\n"); 557 IDLog("Driver Version: 20 08-05-21\n");557 IDLog("Driver Version: 2012-07-27\n"); 558 558 559 //enableSimulation(true); 559 //enableSimulation(true); 560 560 } 561 561 … … 1750 1750 mountSim(); 1751 1751 return; 1752 1752 } 1753 1753 1754 1754 if ( (err = getLX200RA(fd, ¤tRA)) < 0 || (err = getLX200DEC(fd, ¤tDEC)) < 0) … … 1777 1777 break; 1778 1778 1779 1779 case IPS_BUSY: 1780 1780 dx = targetRA - currentRA; 1781 1781 dy = targetDEC - currentDEC; … … 1789 1789 EquatorialCoordsWNP.s = IPS_OK; 1790 1790 IDSetNumber(&EquatorialCoordsWNP, "Slew is complete, target locked..."); 1791 1792 1791 } 1792 break; 1793 1793 1794 1794 case IPS_OK: … … 1801 1801 } 1802 1802 1803 } 1803 1804 1804 // wildi nothing changed in LX200Generic::mountSim 1805 1805 void LX200Generic::mountSim () … … 2117 2117 } 2118 2118 2119 tty_disconnect(fd); // Close if already open 2119 2120 if (tty_connect(PortTP.tp[0].text, 9600, 8, 0, 1, &fd) != TTY_OK) 2120 2121 { -
BAORadio/libindi/libindi/drivers/telescope/magellan1.cpp
r646 r697 98 98 void ISInit() 99 99 { 100 static int isInit=0; 101 102 if (isInit) 103 return; 100 104 if (telescope == NULL) 101 105 { … … 104 108 telescope->setCurrentDeviceName(mydev); 105 109 } 110 111 isInit = 1; 112 IEAddTimer (POLLMS, ISPoll, NULL); 106 113 } 107 114 108 115 void ISGetProperties (const char *dev) 109 { ISInit(); telescope->ISGetProperties(dev); IEAddTimer (POLLMS, ISPoll, NULL);}116 { ISInit(); telescope->ISGetProperties(dev);} 110 117 111 118 void ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n) -
BAORadio/libindi/libindi/drivers/telescope/synscanmount.cpp
r642 r697 119 119 void SynscanMount::ISGetProperties (const char *dev) 120 120 { 121 //if (isDebug())122 IDLog("Enter SynscanMount::ISGetProperties %s\n",dev);123 124 121 // First we let our parent class do it's thing 125 122 INDI::Telescope::ISGetProperties(dev); … … 147 144 // this is not a correct echo 148 145 //if (isDebug()) 149 IDLog("ReadStatus Echo Fail \n");150 IDMessage( deviceName(),"Mount Not Responding");146 IDLog("ReadStatus Echo Fail. %s\n", str); 147 IDMessage(getDeviceName(),"Mount Not Responding"); 151 148 return false; 152 149 } … … 183 180 ParkSV->s=IPS_OK; 184 181 IDSetSwitch(ParkSV,NULL); 185 IDMessage( deviceName(),"Telescope is Parked.");182 IDMessage(getDeviceName(),"Telescope is Parked."); 186 183 } 187 184 … … 276 273 277 274 TrackState=SCOPE_PARKING; 278 IDMessage( deviceName(),"Parking Telescope...");279 return true; 280 } 275 IDMessage(getDeviceName(),"Parking Telescope..."); 276 return true; 277 } -
BAORadio/libindi/libindi/drivers/telescope/telescope_simulator.cpp
r642 r697 9 9 #include "telescope_simulator.h" 10 10 #include "indicom.h" 11 12 #include <memory> 11 13 12 14 // We declare an auto pointer to ScopeSim. … … 126 128 IUFillNumber(&GuideNSN[GUIDE_NORTH], "TIMED_GUIDE_N", "North (sec)", "%g", 0, 10, 0.001, 0); 127 129 IUFillNumber(&GuideNSN[GUIDE_SOUTH], "TIMED_GUIDE_S", "South (sec)", "%g", 0, 10, 0.001, 0); 128 IUFillNumberVector(GuideNSNP, GuideNSN, 2, deviceName(), "TELESCOPE_TIMED_GUIDE_NS", "Guide North/South", MOTION_TAB, IP_RW, 0, IPS_IDLE);130 IUFillNumberVector(GuideNSNP, GuideNSN, 2, getDeviceName(), "TELESCOPE_TIMED_GUIDE_NS", "Guide North/South", MOTION_TAB, IP_RW, 0, IPS_IDLE); 129 131 130 132 /* Property for guider support. How many seconds to guide either westward or eastward? */ 131 133 IUFillNumber(&GuideWEN[GUIDE_WEST], "TIMED_GUIDE_W", "West (sec)", "%g", 0, 10, 0.001, 0); 132 134 IUFillNumber(&GuideWEN[GUIDE_EAST], "TIMED_GUIDE_E", "East (sec)", "%g", 0, 10, 0.001, 0); 133 IUFillNumberVector(GuideWENP, GuideWEN, 2, deviceName(), "TELESCOPE_TIMED_GUIDE_WE", "Guide West/East", MOTION_TAB, IP_RW, 0, IPS_IDLE);135 IUFillNumberVector(GuideWENP, GuideWEN, 2, getDeviceName(), "TELESCOPE_TIMED_GUIDE_WE", "Guide West/East", MOTION_TAB, IP_RW, 0, IPS_IDLE); 134 136 135 137 /* Simulated periodic error in RA, DEC */ 136 138 IUFillNumber(&EqPECN[RA_AXIS],"RA_PEC","RA (hh:mm:ss)","%010.6m",0,24,0,15.); 137 139 IUFillNumber(&EqPECN[DEC_AXIS],"DEC_PEC","DEC (dd:mm:ss)","%010.6m",-90,90,0,15.); 138 IUFillNumberVector(EqPECNV,EqPECN,2, deviceName(),"EQUATORIAL_PEC","Periodic Error",MOTION_TAB,IP_RO,60,IPS_IDLE);140 IUFillNumberVector(EqPECNV,EqPECN,2,getDeviceName(),"EQUATORIAL_PEC","Periodic Error",MOTION_TAB,IP_RO,60,IPS_IDLE); 139 141 140 142 /* Enable client to manually add periodic error northward or southward for simulation purposes */ 141 143 IUFillSwitch(&PECErrNSS[MOTION_NORTH], "PEC_N", "North", ISS_OFF); 142 144 IUFillSwitch(&PECErrNSS[MOTION_SOUTH], "PEC_S", "South", ISS_OFF); 143 IUFillSwitchVector(PECErrNSSP, PECErrNSS, 2, deviceName(),"PEC_NS", "PE N/S", MOTION_TAB, IP_RW, ISR_1OFMANY, 60, IPS_IDLE);145 IUFillSwitchVector(PECErrNSSP, PECErrNSS, 2, getDeviceName(),"PEC_NS", "PE N/S", MOTION_TAB, IP_RW, ISR_1OFMANY, 60, IPS_IDLE); 144 146 145 147 /* Enable client to manually add periodic error westward or easthward for simulation purposes */ 146 148 IUFillSwitch(&PECErrWES[MOTION_WEST], "PEC_W", "West", ISS_OFF); 147 149 IUFillSwitch(&PECErrWES[MOTION_EAST], "PEC_E", "East", ISS_OFF); 148 IUFillSwitchVector(PECErrWESP, PECErrWES, 2, deviceName(),"PEC_WE", "PE W/E", MOTION_TAB, IP_RW, ISR_1OFMANY, 60, IPS_IDLE);150 IUFillSwitchVector(PECErrWESP, PECErrWES, 2, getDeviceName(),"PEC_WE", "PE W/E", MOTION_TAB, IP_RW, ISR_1OFMANY, 60, IPS_IDLE); 149 151 150 152 /* How fast do we guide compared to sideral rate */ 151 153 IUFillNumber(&GuideRateN[RA_AXIS], "GUIDE_RATE_WE", "W/E Rate", "%g", 0, 1, 0.1, 0.3); 152 154 IUFillNumber(&GuideRateN[DEC_AXIS], "GUIDE_RATE_NS", "N/S Rate", "%g", 0, 1, 0.1, 0.3); 153 IUFillNumberVector(GuideRateNP, GuideRateN, 2, deviceName(), "GUIDE_RATE", "Guiding Rate", MOTION_TAB, IP_RW, 0, IPS_IDLE); 155 IUFillNumberVector(GuideRateNP, GuideRateN, 2, getDeviceName(), "GUIDE_RATE", "Guiding Rate", MOTION_TAB, IP_RW, 0, IPS_IDLE); 156 157 // Let's simulate it to be an F/10 8" telescope 158 ScopeParametersN[0].value = 203; 159 ScopeParametersN[1].value = 2000; 160 161 TrackState=SCOPE_IDLE; 154 162 155 163 /* Add debug controls so we may debug driver if necessary */ … … 197 205 deleteProperty(EqPECNV->name); 198 206 deleteProperty(PECErrNSSP->name); 199 deleteProperty(PECErr NSSP->name);207 deleteProperty(PECErrWESP->name); 200 208 deleteProperty(GuideRateNP->name); 201 209 } … … 218 226 } 219 227 220 bool ScopeSim::Connect(char * )221 { 222 228 bool ScopeSim::Connect(char *port) 229 { 230 return true; 223 231 } 224 232 … … 292 300 switch (TrackState) 293 301 { 294 case SCOPE_IDLE:302 /*case SCOPE_IDLE: 295 303 EqNV->s = IPS_IDLE; 296 break; 304 break;*/ 297 305 case SCOPE_SLEWING: 298 306 case SCOPE_PARKING: … … 340 348 341 349 EqNV->s = IPS_OK; 342 IDMessage( deviceName(), "Telescope slew is complete. Tracking...");350 IDMessage(getDeviceName(), "Telescope slew is complete. Tracking..."); 343 351 } 344 352 else … … 346 354 TrackState = SCOPE_PARKED; 347 355 EqNV->s = IPS_IDLE; 348 IDMessage( deviceName(), "Telescope parked successfully.");356 IDMessage(getDeviceName(), "Telescope parked successfully."); 349 357 } 350 358 } … … 352 360 break; 353 361 362 case SCOPE_IDLE: 354 363 case SCOPE_TRACKING: 355 364 /* tracking */ … … 491 500 EqNV->s = IPS_BUSY; 492 501 493 IDMessage( deviceName(), "Slewing to RA: %s - DEC: %s", RAStr, DecStr);502 IDMessage(getDeviceName(), "Slewing to RA: %s - DEC: %s", RAStr, DecStr); 494 503 return true; 504 } 505 506 bool ScopeSim::Sync(double ra, double dec) 507 { 508 currentRA = ra; 509 currentDEC = dec; 510 511 EqPECN[RA_AXIS].value = ra; 512 EqPECN[DEC_AXIS].value = dec; 513 IDSetNumber(EqPECNV, NULL); 514 515 IDMessage(getDeviceName(), "Sync is successful."); 516 517 TrackState = SCOPE_IDLE; 518 EqReqNV->s = IPS_OK; 519 EqNV->s = IPS_OK; 520 521 522 NewRaDec(currentRA, currentDEC); 495 523 } 496 524 … … 501 529 Parked=true; 502 530 TrackState = SCOPE_PARKING; 503 IDMessage( deviceName(), "Parking telescope in progress...");531 IDMessage(getDeviceName(), "Parking telescope in progress..."); 504 532 return true; 505 533 } … … 509 537 // first check if it's for our device 510 538 511 if(strcmp(dev, deviceName())==0)539 if(strcmp(dev,getDeviceName())==0) 512 540 { 513 541 // This is for our device … … 517 545 518 546 // Unless we're in track mode, we don't obey guide commands. 519 if (TrackState != SCOPE_TRACKING)520 {521 GuideNSNP->s = IPS_IDLE;522 IDSetNumber(GuideNSNP, NULL);523 return true;524 }547 //if (TrackState != SCOPE_TRACKING) 548 //{ 549 // GuideNSNP->s = IPS_IDLE; 550 //IDSetNumber(GuideNSNP, NULL); 551 //return true; 552 //} 525 553 526 554 IUUpdateNumber(GuideNSNP, values, names, n); … … 532 560 { 533 561 // Unless we're in track mode, we don't obey guide commands. 534 if (TrackState != SCOPE_TRACKING)535 {536 GuideWENP->s = IPS_IDLE;537 IDSetNumber(GuideWENP, NULL);538 return true;539 }562 //if (TrackState != SCOPE_TRACKING) 563 //{ 564 //GuideWENP->s = IPS_IDLE; 565 //IDSetNumber(GuideWENP, NULL); 566 //return true; 567 //} 540 568 541 569 IUUpdateNumber(GuideWENP, values, names, n); … … 566 594 //} 567 595 568 if(strcmp(dev, deviceName())==0)596 if(strcmp(dev,getDeviceName())==0) 569 597 { 570 598 if(strcmp(name,"PEC_NS")==0) -
BAORadio/libindi/libindi/drivers/telescope/telescope_simulator.h
r642 r697 18 18 INumber GuideNSN[2]; 19 19 INumberVectorProperty *GuideNSNP; 20 21 20 22 21 INumber GuideWEN[2]; … … 56 55 bool Goto(double,double); 57 56 bool Park(); 57 bool Sync(double ra, double dec); 58 58 59 59 }; -
BAORadio/libindi/libindi/drivers/telescope/temmadriver.c
r642 r697 34 34 #include <config.h> 35 35 36 #include <libnova.h> 36 //le fichier include était à l'origine <libnova.h> 37 #include <libnova/libnova.h> 37 38 38 39 #include "indicom.h"
Note: See TracChangeset
for help on using the changeset viewer.