Skip to content

Commit

Permalink
moved 2001 event to the 2001 mode attach
Browse files Browse the repository at this point in the history
  • Loading branch information
madhephaestus committed Mar 11, 2019
1 parent 5a39819 commit 4fcff5c
Showing 1 changed file with 19 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,25 @@ private void setFieldSim(RBE2001Robot r) {
Platform.runLater(() -> useIMU.setDisable(true));
Platform.runLater(() -> useIR.setDisable(true));
robot.add2001();
robot.addEvent(2012, () -> {
WarehouseRobotStatus tmp = getRobot().getStatus();
if (status != tmp) {
status = tmp;
System.out.println(" New Status = " + status.name());
Platform.runLater(() -> {
heartBeat.setText(status.name());
});
Platform.runLater(() -> {
if (status == WarehouseRobotStatus.Waiting_for_approval_to_pickup
|| status == WarehouseRobotStatus.Waiting_for_approval_to_dropoff)
approveButton.setDisable(false);
else
approveButton.setDisable(true);

});

}
});
Platform.runLater(() ->tab2001Field.setDisable(false));
Platform.runLater(() -> {
stop.setDisable(false);
Expand Down Expand Up @@ -455,25 +474,7 @@ private void setFieldSim(RBE2001Robot r) {
ex.printStackTrace();
}
});
robot.addEvent(2012, () -> {
WarehouseRobotStatus tmp = getRobot().getStatus();
if (status != tmp) {
status = tmp;
System.out.println(" New Status = " + status.name());
Platform.runLater(() -> {
heartBeat.setText(status.name());
});
Platform.runLater(() -> {
if (status == WarehouseRobotStatus.Waiting_for_approval_to_pickup
|| status == WarehouseRobotStatus.Waiting_for_approval_to_dropoff)
approveButton.setDisable(false);
else
approveButton.setDisable(true);

});

}
});

}

Expand Down

0 comments on commit 4fcff5c

Please sign in to comment.