Skip to content

Commit 4fcff5c

Browse files
committed
moved 2001 event to the 2001 mode attach
1 parent 5a39819 commit 4fcff5c

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

src/main/java/edu/wpi/rbe/rbe2001/fieldsimulator/gui/InterfaceController.java

+19-18
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,25 @@ private void setFieldSim(RBE2001Robot r) {
327327
Platform.runLater(() -> useIMU.setDisable(true));
328328
Platform.runLater(() -> useIR.setDisable(true));
329329
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+
});
330349
Platform.runLater(() ->tab2001Field.setDisable(false));
331350
Platform.runLater(() -> {
332351
stop.setDisable(false);
@@ -455,25 +474,7 @@ private void setFieldSim(RBE2001Robot r) {
455474
ex.printStackTrace();
456475
}
457476
});
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-
});
474477

475-
}
476-
});
477478

478479
}
479480

0 commit comments

Comments
 (0)