Search in sources :

Example 1 with StateRequest

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();
}
Also used : StateRequest(com.example.commadapter.vehicle.telegrams.StateRequest)

Example 2 with StateRequest

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;
    }
}
Also used : StateRequest(com.example.commadapter.vehicle.telegrams.StateRequest)

Example 3 with StateRequest

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);
}
Also used : StateRequest(com.example.commadapter.vehicle.telegrams.StateRequest) SendRequestCommand(com.example.commadapter.vehicle.exchange.commands.SendRequestCommand)

Aggregations

StateRequest (com.example.commadapter.vehicle.telegrams.StateRequest)3 SendRequestCommand (com.example.commadapter.vehicle.exchange.commands.SendRequestCommand)1