Changeset 495 for BAORadio/libindi


Ignore:
Timestamp:
Sep 21, 2010, 12:24:03 AM (15 years ago)
Author:
frichard
Message:

-Le programme envoie désormais les ordres GOTO en mode relatif
-Il est possible de modifier la fréquence d'actualisation des modes tracking/transit depuis la boite de dialogue d'INDI

Location:
BAORadio/libindi/libindi
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • BAORadio/libindi/libindi/BAOTest/Makefile

    r490 r495  
    44simple_server_objects = ServerSocket.o Socket.o simple_server_main.o
    55simple_client_objects = ClientSocket.o Socket.o simple_client_main.o
    6 BAOtest_objects = ClientSocket.o Socket.o BAOtest_main.o
     6BAOtest_objects = ClientSocket.o ServerSocket.o Socket.o BAOtest_main.o
    77
    88
  • BAORadio/libindi/libindi/BAOTest/ServerSocket.cpp

    r490 r495  
    2121      throw SocketException ( "Could not listen to socket." );
    2222    }
    23 Socket::set_non_blocking(true);
     23//Socket::set_non_blocking(true);
    2424}
    2525
     
    4545  if ( ! Socket::recv ( s ) )
    4646    {
    47       throw SocketException ( "Could not read from socket." );
     47     throw SocketException ( "Could not read from socket." );
    4848    }
    4949
     
    5858    }
    5959}
     60
     61void 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  
    1818  const ServerSocket& operator >> ( std::string& ) const;
    1919
     20  void recv( std::string& s );
     21
    2022  void accept ( ServerSocket& );
    2123
  • BAORadio/libindi/libindi/drivers/telescope/BAO.cpp

    r494 r495  
    225225    SocketsNumber  = 1;
    226226   
     227    ActualisationTM1 = 15.0*60.0;
     228   
     229    ActualisationTM2 = 5.0;
     230   
    227231    InitThreadOK=false;
    228232    LecturePosition=false;
     
    299303    IUFillNumberVector(&GeographicCoordsWNP, GeographicCoordsWN, NARRAY(GeographicCoordsWN), mydev, "GEOGRAPHIC_COORD" , "Geographic coords", OPTIONS_GROUP, IP_WO, 0, IPS_IDLE);
    300304   
     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);
    301311   
    302312    // 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);
    306316   
    307317    // 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);
    311321   
    312322  }
     
    332342   
    333343    // 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);
    336348   
    337349  }
     
    448460        if (eqp == &EquatorialCoordsWN[0])
    449461        {
    450           newRA = values[i];
     462          newRA = values[i];     
    451463          nset += newRA >= 0 && newRA <= 24.0;
    452464        }
     
    489501     
    490502      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     
    491564    } /* end EquatorialCoordsWNP */
    492565  }
     
    620693    //EquatorialCoordsRNP.s     = IPS_IDLE;
    621694    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;
    624699   
    625700    IUResetSwitch(&OnCoordSetSP);
     
    639714    //IDSetNumber(&EquatorialCoordsRNP, NULL);
    640715    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   
    643721  }
    644722 
     
    843921      //Y a-t-il de nouvelles tentatives de connexion sur le serveur ?
    844922     
    845       InitThread();
     923      InitThread();         
    846924    }
    847925   
     
    11011179        // Durée entre deux actualisations
    11021180       
    1103         double delai=15.0/60.0/24.0;   // Actualisation toutes les 15 minutes en mode transit
    1104        
    1105         if (TrackingMode==2) delai=5.0/3600.0/24.0;   //et 5 secs en mode tracking
     1181        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
    11061184         
    11071185         
     
    13631441         
    13641442          //pour tester le programme de François, on envoie ces coordonnees sur sa demande
    1365            if (!GOTO(i, 1000, -3000)) Sockets[i].sendalertes++;
    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++;
    13681446         
    13691447          Sockets[i].etape++;
     
    14871565        IDSetSwitch (&ConnectSP, "BAORadio is online. Retrieving basic data...");
    14881566       
     1567       
    14891568        break;
    14901569       
     
    15191598  {
    15201599    //  IDSetNumber (&EquatorialCoordsRNP, NULL);
     1600   
     1601     
    15211602  }
    15221603 
     
    16771758    }
    16781759   
    1679     sprintf(Params, "%c%03i%c%03i", sensAz, deltaAz, sensAlt, deltaAlt);
     1760    sprintf(Params, "%c%04i%c%04i", sensAz, deltaAz, sensAlt, deltaAlt);
    16801761   
    16811762    return COMMANDE(numsocket, (char*)"g", Params);
  • BAORadio/libindi/libindi/drivers/telescope/BAO.h

    r492 r495  
    117117    INumber EquatorialCoordsWN[2];
    118118    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];
    121124
    122125    /* Switch Vectors */
     
    130133    INumberVectorProperty EquatorialCoordsWNP;
    131134    INumberVectorProperty GeographicCoordsWNP;
    132     INumberVectorProperty SlewAccuracyNP;
    133     INumberVectorProperty TrackAccuracyNP;
     135    //INumberVectorProperty SlewAccuracyNP;
     136    //INumberVectorProperty TrackAccuracyNP;
     137    INumberVectorProperty ActualisationNP1;
     138    INumberVectorProperty ActualisationNP2;
     139   
    134140
    135141    /* Text Vectors */
     
    170176    double lastDEC;
    171177    double JJAnc;                       // Sauvegarde du jour julien de la derniÚre actualisation de la position (fct Goto)
     178    double ActualisationTM1;
     179    double ActualisationTM2;
    172180    bool   simulation;
    173181    bool   fault;
Note: See TracChangeset for help on using the changeset viewer.