Revision 417
fixed typo
trunk/code/projects/colonet/ColonetGUI/Colonet.java | ||
---|---|---|
1241 | 1241 |
dest = "" + (cmbRobotNum.getSelectedIndex()-1); |
1242 | 1242 |
|
1243 | 1243 |
if (csi != null) { |
1244 |
/* |
|
1245 |
csi.sendData(ColonetServerInterface.MOVE + " " + getSpeed() + " " + getAngle(), dest); |
|
1246 |
*/ |
|
1247 |
|
|
1248 |
//Directional commands |
|
1249 |
if (x > cx && y == cy) { //move right |
|
1250 |
csi.sendData(ColonetServerInterface.MOTOR2_SET + " 0 200", dest); |
|
1251 |
csi.sendData(ColonetServerInterface.MOTOR1_SET + " 1 200", dest); |
|
1252 |
} else if (x < cx && y == cy) { //move left |
|
1253 |
csi.sendData(ColonetServerInterface.MOTOR2_SET + " 1 200", dest); |
|
1254 |
csi.sendData(ColonetServerInterface.MOTOR1_SET + " 0 200", dest); |
|
1255 |
} else if (x == cx && y > cy) { //move forward |
|
1256 |
csi.sendData(ColonetServerInterface.MOTOR2_SET + " 0 225", dest); |
|
1257 |
csi.sendData(ColonetServerInterface.MOTOR1_SET + " 0 225", dest); |
|
1258 |
} else if (x == cx && y < cy) { //move backward |
|
1259 |
csi.sendData(ColonetServerInterface.MOTOR2_SET + " 1 225", dest); |
|
1260 |
csi.sendData(ColonetServerInterface.MOTOR1_SET + " 1 225", dest); |
|
1261 |
} else if (x == cx && y == cy) { //stop! |
|
1262 |
csi.sendData(ColonetServerInterface.MOTOR2_SET + " 1 0", dest); |
|
1263 |
csi.sendData(ColonetServerInterface.MOTOR1_SET + " 1 0", dest); |
|
1264 |
} |
|
1265 |
|
|
1244 |
/* |
|
1245 |
csi.sendData(ColonetServerInterface.MOVE + " " + getSpeed() + " " + getAngle(), dest); |
|
1246 |
*/ |
|
1247 |
|
|
1248 |
//Directional commands |
|
1249 |
if (x > cx && y == cy) { //move right |
|
1250 |
csi.sendData(ColonetServerInterface.MOTOR2_SET + " 0 200", dest); |
|
1251 |
csi.sendData(ColonetServerInterface.MOTOR1_SET + " 1 200", dest); |
|
1252 |
} else if (x < cx && y == cy) { //move left |
|
1253 |
csi.sendData(ColonetServerInterface.MOTOR2_SET + " 1 200", dest); |
|
1254 |
csi.sendData(ColonetServerInterface.MOTOR1_SET + " 0 200", dest); |
|
1255 |
} else if (x == cx && y > cy) { //move forward |
|
1256 |
csi.sendData(ColonetServerInterface.MOTOR2_SET + " 0 225", dest); |
|
1257 |
csi.sendData(ColonetServerInterface.MOTOR1_SET + " 0 225", dest); |
|
1258 |
} else if (x == cx && y < cy) { //move backward |
|
1259 |
csi.sendData(ColonetServerInterface.MOTOR2_SET + " 1 225", dest); |
|
1260 |
csi.sendData(ColonetServerInterface.MOTOR1_SET + " 1 225", dest); |
|
1261 |
} else if (x == cx && y == cy) { //stop! |
|
1262 |
csi.sendData(ColonetServerInterface.MOTOR2_SET + " 1 0", dest); |
|
1263 |
csi.sendData(ColonetServerInterface.MOTOR1_SET + " 1 0", dest); |
|
1266 | 1264 |
} |
1267 | 1265 |
} |
1268 | 1266 |
} |
Also available in: Unified diff