From 3af9c88516543659002f5303d703f32579b45d6f Mon Sep 17 00:00:00 2001 From: schodet Date: Sun, 25 Apr 2004 20:48:52 +0000 Subject: Modification de Goto. --- 2004/i/nono/src/motor/test_motor.cc | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to '2004/i/nono/src/motor/test_motor.cc') diff --git a/2004/i/nono/src/motor/test_motor.cc b/2004/i/nono/src/motor/test_motor.cc index 27d4e68..42130bf 100644 --- a/2004/i/nono/src/motor/test_motor.cc +++ b/2004/i/nono/src/motor/test_motor.cc @@ -45,7 +45,8 @@ syntax (void) " b \n" " mouvement basique\n" " t va en (x, y)\n" - " r se dirige vers l'angle a en degrées\n" + " r se dirige vers l'angle a en degrés\n" + " c Suis un arc de rayon r et d'angle a en degrés\n" " attend un certain temps (qui augmente avec timeout)\n" " ? cet ecran d'aide" << std::endl; } @@ -62,17 +63,17 @@ main (int argc, char **argv) switch (argv[i][0]) { case 'g': - cout << "go" << endl; + cout << "test: go" << endl; i++; m.go (); break; case 'G': - cout << "ungo" << endl; + cout << "test: ungo" << endl; i++; m.go (false); break; case 'w': - cout << "wait stop" << endl; + cout << "test: wait stop" << endl; i++; m.waitStopped (); break; @@ -85,7 +86,7 @@ main (int argc, char **argv) speed = atof (argv[i++]); if (i >= argc) break; len = atof (argv[i++]); - cout << "basic " << speed << ' ' << len << endl; + cout << "test: basic " << speed << ' ' << len << endl; Movement *mov = new MovementBasic (speed, len); m.setMovement (mov); } @@ -98,7 +99,7 @@ main (int argc, char **argv) dX = atof (argv[i++]); if (i >= argc) break; dY = atof (argv[i++]); - cout << "goto " << dX << ' ' << dY << endl; + cout << "test: goto " << dX << ' ' << dY << endl; Goto *g = new GotoSimple (dX, dY); Movement *mov = new MovementGoto (g); m.setMovement (mov); @@ -110,12 +111,26 @@ main (int argc, char **argv) double dA; if (i >= argc) break; dA = atof (argv[i++]); - cout << "rotation " << dA << endl; + cout << "test: rotation " << dA << endl; Movement *mov = new MovementRotation (dA * 2 * M_PI / 360); m.setMovement (mov); } break; + case 'c': + { + i++; + double r, a; + if (i >= argc) break; + r = atof (argv[i++]); + if (i >= argc) break; + a = atof (argv[i++]); + cout << "test: circle " << r << ' ' << a << endl; + Goto *g = new GotoCircle (r, a * 2 * M_PI / 360); + Movement *mov = new MovementGoto (g); + m.setMovement (mov); + } + break; case '?': syntax (); return 0; @@ -127,7 +142,7 @@ main (int argc, char **argv) syntax (); return 1; } - cout << "sleep " << s << endl; + cout << "test: sleep " << s << endl; for (int j = 0; j < s * 1000 / 50; ++j) { m.ok (); -- cgit v1.2.3