Revision 470
more updates to colonet
ColonetServerInterface.java | ||
---|---|---|
68 | 68 |
public static final String GLOBAL_DEST = "200"; |
69 | 69 |
public static final String CLIENT_REQUEST_ROBOT_POSITIONS = "86"; |
70 | 70 |
public static final String CLIENT_ASSIGN_ROBOT_ID = "87"; |
71 |
public static final String MOVE_TO_ABSOLUTE_POSITION = "83"; //0x53 |
|
71 | 72 |
|
72 | 73 |
//Queue instructions |
73 | 74 |
public static final String COLONET_QUEUE = "100"; |
... | ... | |
271 | 272 |
String packet = ""; |
272 | 273 |
packet += ColonetServerInterface.SEND_TO_ROBOT; |
273 | 274 |
if (robotNumber != null) |
274 |
packet += " " + robotNumber; |
|
275 |
packet += " " + 7; //robotNumber;
|
|
275 | 276 |
packet += " " + ColonetServerInterface.COLONET_COMMAND; |
276 | 277 |
packet += " " + s; //add the command code here |
277 | 278 |
packet += "\n"; |
278 | 279 |
sendString(packet); |
280 |
txtMatrix.append("S:" + packet); |
|
279 | 281 |
} |
280 | 282 |
|
281 | 283 |
/** |
... | ... | |
359 | 361 |
sendString(packet); |
360 | 362 |
txtMatrix.append("ID " + oldID + " => " + newID + "\n"); |
361 | 363 |
} |
362 |
|
|
363 | 364 |
|
365 |
/** |
|
366 |
* Order a robot to move to an absolute coordinate point. |
|
367 |
*/ |
|
368 |
public void sendAbsoluteMove (int id, int x, int y) { |
|
369 |
sendData(MOVE_TO_ABSOLUTE_POSITION + " " + x + " " + y, "" + id); |
|
370 |
} |
|
371 |
|
|
364 | 372 |
/* |
365 | 373 |
* Queue management |
366 | 374 |
*/ |
... | ... | |
449 | 457 |
* @param text Text to display |
450 | 458 |
*/ |
451 | 459 |
public void msg (String text) { |
452 |
JOptionPane.showMessageDialog(null, text, "Colonet", JOptionPane.INFORMATION_MESSAGE);
|
|
460 |
JOptionPane.showMessageDialog(colonet, text, "Colonet", JOptionPane.INFORMATION_MESSAGE);
|
|
453 | 461 |
} |
454 | 462 |
|
455 | 463 |
/** |
... | ... | |
457 | 465 |
* @param text Text to display |
458 | 466 |
*/ |
459 | 467 |
public void warn (String text) { |
460 |
JOptionPane.showMessageDialog(null, text, "Colonet", JOptionPane.WARNING_MESSAGE);
|
|
468 |
JOptionPane.showMessageDialog(colonet, text, "Colonet", JOptionPane.WARNING_MESSAGE);
|
|
461 | 469 |
} |
462 | 470 |
|
463 | 471 |
/** |
... | ... | |
465 | 473 |
* @param text Text to display |
466 | 474 |
*/ |
467 | 475 |
public void err (String text) { |
468 |
JOptionPane.showMessageDialog(null, text, "Colonet", JOptionPane.ERROR_MESSAGE);
|
|
476 |
JOptionPane.showMessageDialog(colonet, text, "Colonet", JOptionPane.ERROR_MESSAGE);
|
|
469 | 477 |
} |
470 | 478 |
|
471 | 479 |
|
... | ... | |
521 | 529 |
colonet.parsePositions(line); |
522 | 530 |
// Unknown type |
523 | 531 |
else |
524 |
System.out.println("Got data:" + line);
|
|
532 |
txtMatrix.setText("Got unknown data: " + line + "\n");
|
|
525 | 533 |
|
526 | 534 |
} |
527 | 535 |
|
Also available in: Unified diff