@@ -327,6 +327,25 @@ private void setFieldSim(RBE2001Robot r) {
327
327
Platform .runLater (() -> useIMU .setDisable (true ));
328
328
Platform .runLater (() -> useIR .setDisable (true ));
329
329
robot .add2001 ();
330
+ robot .addEvent (2012 , () -> {
331
+ WarehouseRobotStatus tmp = getRobot ().getStatus ();
332
+ if (status != tmp ) {
333
+ status = tmp ;
334
+ System .out .println (" New Status = " + status .name ());
335
+ Platform .runLater (() -> {
336
+ heartBeat .setText (status .name ());
337
+ });
338
+ Platform .runLater (() -> {
339
+ if (status == WarehouseRobotStatus .Waiting_for_approval_to_pickup
340
+ || status == WarehouseRobotStatus .Waiting_for_approval_to_dropoff )
341
+ approveButton .setDisable (false );
342
+ else
343
+ approveButton .setDisable (true );
344
+
345
+ });
346
+
347
+ }
348
+ });
330
349
Platform .runLater (() ->tab2001Field .setDisable (false ));
331
350
Platform .runLater (() -> {
332
351
stop .setDisable (false );
@@ -455,25 +474,7 @@ private void setFieldSim(RBE2001Robot r) {
455
474
ex .printStackTrace ();
456
475
}
457
476
});
458
- robot .addEvent (2012 , () -> {
459
- WarehouseRobotStatus tmp = getRobot ().getStatus ();
460
- if (status != tmp ) {
461
- status = tmp ;
462
- System .out .println (" New Status = " + status .name ());
463
- Platform .runLater (() -> {
464
- heartBeat .setText (status .name ());
465
- });
466
- Platform .runLater (() -> {
467
- if (status == WarehouseRobotStatus .Waiting_for_approval_to_pickup
468
- || status == WarehouseRobotStatus .Waiting_for_approval_to_dropoff )
469
- approveButton .setDisable (false );
470
- else
471
- approveButton .setDisable (true );
472
-
473
- });
474
477
475
- }
476
- });
477
478
478
479
}
479
480
0 commit comments