Search in sources :

Example 91 with LocoNetMessage

use of jmri.jmrix.loconet.LocoNetMessage in project JMRI by JMRI.

the class LlnmonTest method testOpcAnalogIO.

public void testOpcAnalogIO() {
    LocoNetMessage l = new LocoNetMessage(new int[] { 0xE4, 0x08, 0x01, 0x01, 0x03, 0x32, 0x11, 0x35 });
    assertEquals("OpcAnalogIO message test 1", "Lissy 3 Wheel Report: 6417 wheels moving north\n", f.displayMessage(l));
    l = new LocoNetMessage(new int[] { 0xE4, 0x08, 0x01, 0x21, 0x55, 0x01, 0x00, 0x35 });
    assertEquals("OpcAnalogIO message test ", "Lissy 85 Wheel Report: 128 wheels moving south\n", f.displayMessage(l));
    l = new LocoNetMessage(new int[] { 0xE4, 0x08, 0x02, 0x21, 0x55, 0x01, 0x00, 0x35 });
    assertEquals("Unable to parse LocoNet message.\ncontents: E4 08 02 21 55 01 00 35\n", f.displayMessage(l));
}
Also used : LocoNetMessage(jmri.jmrix.loconet.LocoNetMessage)

Example 92 with LocoNetMessage

use of jmri.jmrix.loconet.LocoNetMessage in project JMRI by JMRI.

the class LlnmonTest method textOpcPeerXfer.

public void textOpcPeerXfer() {
    LocoNetMessage l;
    l = new LocoNetMessage(new int[] { 0xE5, 0x05, 0x00, 0x00, 0x7f });
    assertEquals("PeerXfer 1", "Unable to parse LocoNet message.\ncontents: E5 05 00 00 7F\n", f.displayMessage(l));
}
Also used : LocoNetMessage(jmri.jmrix.loconet.LocoNetMessage)

Example 93 with LocoNetMessage

use of jmri.jmrix.loconet.LocoNetMessage in project JMRI by JMRI.

the class LnPr2PowerManagerTest method hearOn.

/**
     * service routines to simulate receiving on, off from interface
     */
@Override
protected void hearOn() {
    LocoNetMessage l = new LocoNetMessage(2);
    l.setOpCode(LnConstants.OPC_GPON);
    controller.sendTestMessage(l);
}
Also used : LocoNetMessage(jmri.jmrix.loconet.LocoNetMessage)

Example 94 with LocoNetMessage

use of jmri.jmrix.loconet.LocoNetMessage in project JMRI by JMRI.

the class LocoMonPaneTest method testInput.

@Test
public void testInput() throws Exception {
    pane.initComponents();
    LocoNetMessage m = new LocoNetMessage(new int[] { 0xA0, 0x07, 0x00, 0x58 });
    ((LocoMonPane) pane).message(m);
    new org.netbeans.jemmy.QueueTool().waitEmpty(100);
    Assert.assertEquals("shows message", "Set speed of loco in slot 7 to 0.\n", ((LocoMonPane) pane).getFrameText());
}
Also used : LocoNetMessage(jmri.jmrix.loconet.LocoNetMessage) Test(org.junit.Test)

Example 95 with LocoNetMessage

use of jmri.jmrix.loconet.LocoNetMessage in project JMRI by JMRI.

the class LocoMonPaneTest method testFilterSimple.

@Test
public void testFilterSimple() throws Exception {
    pane.initComponents();
    // filter A0
    pane.setFilterText("A0");
    new org.netbeans.jemmy.QueueTool().waitEmpty(100);
    Assert.assertEquals("filter set", "A0", pane.getFilterText());
    LocoNetMessage m = new LocoNetMessage(new int[] { 0xA0, 0x07, 0x00, 0x58 });
    ((LocoMonPane) pane).message(m);
    new org.netbeans.jemmy.QueueTool().waitEmpty(100);
    Assert.assertEquals("shows message", "", ((LocoMonPane) pane).getFrameText());
}
Also used : LocoNetMessage(jmri.jmrix.loconet.LocoNetMessage) Test(org.junit.Test)

Aggregations

LocoNetMessage (jmri.jmrix.loconet.LocoNetMessage)103 Test (org.junit.Test)8 JFrame (javax.swing.JFrame)3 LocoNetInterfaceScaffold (jmri.jmrix.loconet.LocoNetInterfaceScaffold)3 LocoNetSystemConnectionMemo (jmri.jmrix.loconet.LocoNetSystemConnectionMemo)3 LocoStatsPanel (jmri.jmrix.loconet.locostats.swing.LocoStatsPanel)3 JmriJFrame (jmri.util.JmriJFrame)3 LocoNetSlot (jmri.jmrix.loconet.LocoNetSlot)2 SpjFile (jmri.jmrix.loconet.spjfile.SpjFile)2 BufferedReader (java.io.BufferedReader)1 IOException (java.io.IOException)1 InputStreamReader (java.io.InputStreamReader)1 StringTokenizer (java.util.StringTokenizer)1 LnPacketizer (jmri.jmrix.loconet.LnPacketizer)1 LnReporter (jmri.jmrix.loconet.LnReporter)1 LnTrafficController (jmri.jmrix.loconet.LnTrafficController)1 LnTurnout (jmri.jmrix.loconet.LnTurnout)1