Search in sources :

Example 46 with CanMessage

use of jmri.jmrix.can.CanMessage in project JMRI by JMRI.

the class CbusTurnout method forwardCommandChangeToLayout.

/**
     * Handle a request to change state by sending CBUS events.
     *
     * @param s new state value
     */
@Override
protected void forwardCommandChangeToLayout(int s) {
    CanMessage m;
    if (s == Turnout.THROWN) {
        m = addrThrown.makeMessage(tc.getCanid());
        tc.sendCanMessage(m, this);
    } else if (s == Turnout.CLOSED) {
        m = addrClosed.makeMessage(tc.getCanid());
        tc.sendCanMessage(m, this);
    }
}
Also used : CanMessage(jmri.jmrix.can.CanMessage)

Example 47 with CanMessage

use of jmri.jmrix.can.CanMessage in project JMRI by JMRI.

the class CanSendPane method sendNextItem.

/**
     * Send next item; may be used for the first item or when a delay has
     * elapsed.
     */
void sendNextItem() {
    // check if still running
    if (!mRunButton.isSelected()) {
        return;
    }
    // have we run off the end?
    if (mNextSequenceElement >= MAXSEQUENCE) {
        // past the end, go back
        mNextSequenceElement = 0;
    }
    // is this one enabled?
    if (mUseField[mNextSequenceElement].isSelected()) {
        // make the packet
        CanMessage m = createPacket(mPacketField[mNextSequenceElement].getText());
        // send it
        tc.sendCanMessage(m, this);
        startSequenceDelay();
    } else {
        // ask for the next one
        mNextSequenceElement++;
        sendNextItem();
    }
}
Also used : CanMessage(jmri.jmrix.can.CanMessage)

Example 48 with CanMessage

use of jmri.jmrix.can.CanMessage in project JMRI by JMRI.

the class CanSendPane method sendButtonActionPerformed.

public void sendButtonActionPerformed(java.awt.event.ActionEvent e) {
    CanMessage m = createPacket(packetTextField.getText());
    log.debug("sendButtonActionPerformed: " + m);
    tc.sendCanMessage(m, this);
}
Also used : CanMessage(jmri.jmrix.can.CanMessage)

Example 49 with CanMessage

use of jmri.jmrix.can.CanMessage in project JMRI by JMRI.

the class OpenLcbCanSendPane method sendCimPerformed.

public void sendCimPerformed(java.awt.event.ActionEvent e) {
    // NOI18N
    String data = "[10700" + srcAliasField.getText() + "]";
    log.debug("|" + data + "|");
    CanMessage m = createPacket(data);
    log.debug("sendCimPerformed");
    tc.sendCanMessage(m, this);
}
Also used : CanMessage(jmri.jmrix.can.CanMessage)

Example 50 with CanMessage

use of jmri.jmrix.can.CanMessage in project JMRI by JMRI.

the class OpenLcbCanSendPane method sendButtonActionPerformed.

public void sendButtonActionPerformed(java.awt.event.ActionEvent e) {
    CanMessage m = createPacket(packetTextField.getText());
    log.debug("sendButtonActionPerformed: " + m);
    tc.sendCanMessage(m, this);
}
Also used : CanMessage(jmri.jmrix.can.CanMessage)

Aggregations

CanMessage (jmri.jmrix.can.CanMessage)63 Test (org.junit.Test)4 CanReply (jmri.jmrix.can.CanReply)3 CanListener (jmri.jmrix.can.CanListener)2 CbusAddress (jmri.jmrix.can.cbus.CbusAddress)2 DccLocoAddress (jmri.DccLocoAddress)1 AbstractMRMessage (jmri.jmrix.AbstractMRMessage)1 CanSystemConnectionMemo (jmri.jmrix.can.CanSystemConnectionMemo)1 TestTrafficController (jmri.jmrix.can.TestTrafficController)1 TrafficControllerScaffold (jmri.jmrix.can.TrafficControllerScaffold)1 GridConnectMessage (jmri.jmrix.can.adapters.gridconnect.GridConnectMessage)1 GridConnectReply (jmri.jmrix.can.adapters.gridconnect.GridConnectReply)1 LoaderClient (org.openlcb.LoaderClient)1 OlcbInterface (org.openlcb.OlcbInterface)1 AliasMap (org.openlcb.can.AliasMap)1 CanInterface (org.openlcb.can.CanInterface)1 MessageBuilder (org.openlcb.can.MessageBuilder)1 Hub (org.openlcb.hub.Hub)1