use of com.example.commadapter.vehicle.telegrams.StateRequest in project opentcs-integration-example by openTCS.
the class ExampleCommAdapter method onConnect.
@Override
public void onConnect() {
if (!isEnabled()) {
return;
}
LOG.debug("{}: connected", getName());
getProcessModel().setCommAdapterConnected(true);
// Request the vehicle's current state (preparation for the state requester task)
requestResponseMatcher.enqueueRequest(new StateRequest(Telegram.ID_DEFAULT));
// Check for resending last request
requestResponseMatcher.checkForSendingNextRequest();
}
use of com.example.commadapter.vehicle.telegrams.StateRequest in project opentcs-integration-example by openTCS.
the class ExampleCommAdapter method requestStateFromVehicle.
private void requestStateFromVehicle() {
if (expectingStateResponse) {
LOG.warn("No response to previous state request, yet - not sending another one.");
} else {
requestResponseMatcher.enqueueRequest(new StateRequest(Telegram.ID_DEFAULT));
expectingStateResponse = true;
}
}
use of com.example.commadapter.vehicle.telegrams.StateRequest in project opentcs-integration-example by openTCS.
the class StatusPanel method buttonGetStateActionPerformed.
// GEN-LAST:event_chkBoxEnablePeriodicGetStateActionPerformed
private void buttonGetStateActionPerformed(java.awt.event.ActionEvent evt) {
// GEN-FIRST:event_buttonGetStateActionPerformed
SendRequestCommand command = new SendRequestCommand(new StateRequest(0));
sendAdapterCommand(command);
}
Aggregations