use of jmri.jmrix.lenz.XNetMessage in project JMRI by JMRI.
the class Z21XNetSimulatorAdapterTest method testGenerateEmergencyStopAllReply.
@Test
public void testGenerateEmergencyStopAllReply() {
Z21XNetSimulatorAdapter a = new Z21XNetSimulatorAdapter();
Assert.assertEquals("CS Emergeny Stop All Reply", new XNetReply("81 00 81"), a.generateReply(new XNetMessage("80 80")));
}
use of jmri.jmrix.lenz.XNetMessage in project JMRI by JMRI.
the class Z21XNetSimulatorAdapterTest method testGenerateEmergencyStopLocoReplyV1V2.
@Test
public void testGenerateEmergencyStopLocoReplyV1V2() {
Z21XNetSimulatorAdapter a = new Z21XNetSimulatorAdapter();
Assert.assertEquals("CS Emergeny Stop Specific Loco (XNetV1,V2)", new XNetReply("01 04 05"), a.generateReply(new XNetMessage("91 02 93")));
}
use of jmri.jmrix.lenz.XNetMessage in project JMRI by JMRI.
the class Z21XNetSimulatorAdapterTest method testGenerateCSVersionReply.
@Test
public void testGenerateCSVersionReply() {
Z21XNetSimulatorAdapter a = new Z21XNetSimulatorAdapter();
Assert.assertEquals("CS Version Reply", new XNetReply("63 21 30 12 60"), a.generateReply(new XNetMessage("21 21 00")));
}
use of jmri.jmrix.lenz.XNetMessage in project JMRI by JMRI.
the class LZ100InternalFrame method message.
// listen for responses from the LZ100
@Override
public synchronized void message(XNetReply l) {
if (l.isOkMessage()) {
/* this was an "OK" message
We're only paying attention to it if we're
resetting the command station
*/
if (status.getText().equals(rb.getString("LZ100StatusSetMode"))) {
status.setText(rb.getString("LZ100StatusOK"));
}
if (resetMode == OFFSENT) {
XNetMessage msgon = XNetMessage.getFunctionGroup1OpsMsg(0, false, false, false, false, true);
sendCount--;
resetMode = ONSENT;
tc.sendXNetMessage(msgon, this);
} else if (resetMode == ONSENT) {
XNetMessage msgoff = XNetMessage.getFunctionGroup1OpsMsg(0, false, false, false, false, false);
if (sendCount >= 0) {
resetMode = OFFSENT;
} else {
resetMode = IDLE;
resetCSButton.setEnabled(true);
status.setText(rb.getString("LZ100ResetFinished"));
}
tc.sendXNetMessage(msgoff, this);
}
} else if (l.getElement(0) == XNetConstants.CS_REQUEST_RESPONSE && l.getElement(1) == XNetConstants.CS_STATUS_RESPONSE) {
int statusByte = l.getElement(2);
if ((statusByte & 0x04) == 0x04) {
isAutoMode.setSelected(true);
isManualMode.setSelected(false);
autoMode = true;
status.setText(rb.getString("LZ100StatusOK"));
} else {
isAutoMode.setSelected(false);
isManualMode.setSelected(true);
autoMode = false;
status.setText(rb.getString("LZ100StatusOK"));
}
}
}
use of jmri.jmrix.lenz.XNetMessage in project JMRI by JMRI.
the class LI101Frame method readLI101Settings.
//Send Information request to LI101
void readLI101Settings() {
/* First, we request setting an out of range address
to get the current value. */
XNetMessage msg = XNetMessage.getLIAddressRequestMsg(32);
//Then send to the controller
tc.sendXNetMessage(msg, this);
/* Next, we request setting an out of range speed request
to get the current value. */
XNetMessage msg2 = XNetMessage.getLISpeedRequestMsg(6);
//Then send to the controller
tc.sendXNetMessage(msg2, this);
}
Aggregations