Changeset 695 for BAORadio/libindi/libindi/BAOTest/BAOtest_main.cpp
- Timestamp:
- Sep 28, 2012, 2:14:03 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BAORadio/libindi/libindi/BAOTest/BAOtest_main.cpp
r691 r695 18 18 #include <netinet/in.h> 19 19 20 //#define POSITIONS_DIRECT 21 20 22 using namespace std; 23 21 24 22 25 … … 74 77 result.y=atoi(str.substr(7, 4).c_str()); 75 78 76 79 if (str[1]=='f') result.x=-result.x; 77 80 78 81 if (str[6]=='f') result.y=-result.y; … … 129 132 int main ( int argc, char *argv[] ) 130 133 { 131 Position Pos, NouvPos;134 Position Pos, Pos2, NouvPos; 132 135 char cIP; 133 136 char IP[20]; … … 188 191 strcpy(chaine, ""); 189 192 190 193 #ifndef POSITIONS_DIRECT 191 194 if (abs(Pos.x - NouvPos.x) < 5 ) 192 195 { … … 208 211 Pos.y -= (NouvPos.y - Pos.y) / 6.0; 209 212 } 213 #endif 214 210 215 211 216 if (ErreursAleatoires) Aleat=rand()%ERREURS != 1; … … 235 240 if (asks.find("G")!=string::npos) 236 241 { 237 238 242 #ifndef POSITIONS_DIRECT 243 NouvPos = ExtractPosition2(asks); 239 244 240 245 NouvPos.x += Pos.x; 241 246 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 244 253 strcpy(chaine,"ACK/GOTO/\n"); 245 254 client_socket << chaine;
Note: See TracChangeset
for help on using the changeset viewer.