Ignore:
Timestamp:
Sep 28, 2012, 2:14:03 PM (12 years ago)
Author:
frichard
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • BAORadio/libindi/libindi/BAOTest/BAOtest_main.cpp

    r691 r695  
    1818#include <netinet/in.h>
    1919
     20//#define POSITIONS_DIRECT 
     21
    2022using namespace std;
     23
    2124
    2225
     
    7477        result.y=atoi(str.substr(7, 4).c_str());
    7578
    76         if (str[1]=='f') result.x=-result.x;
     79        if (str[1]=='f') result.x=-result.x;
    7780
    7881        if (str[6]=='f') result.y=-result.y;
     
    129132int main ( int argc, char *argv[] )
    130133{
    131     Position Pos, NouvPos;
     134    Position Pos, Pos2, NouvPos;
    132135    char cIP;
    133136    char IP[20];
     
    188191                strcpy(chaine, "");
    189192
    190 
     193#ifndef POSITIONS_DIRECT
    191194                if (abs(Pos.x - NouvPos.x) < 5 )
    192195                {
     
    208211                    Pos.y -= (NouvPos.y - Pos.y) / 6.0;
    209212                }
     213#endif
     214               
    210215
    211216                if (ErreursAleatoires) Aleat=rand()%ERREURS != 1;
     
    235240                if (asks.find("G")!=string::npos)
    236241                {
    237 
    238                     NouvPos = ExtractPosition2(asks);
     242#ifndef POSITIONS_DIRECT
     243                 NouvPos = ExtractPosition2(asks);
    239244
    240245                        NouvPos.x += Pos.x;
    241246                        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
    244253                    strcpy(chaine,"ACK/GOTO/\n");
    245254                    client_socket << chaine;
Note: See TracChangeset for help on using the changeset viewer.