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);
}
}
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();
}
}
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);
}
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);
}
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);
}
Aggregations