Search in sources :

Example 36 with LocoNetMessage

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

the class LlnmonTest method testSv1Messages.

public void testSv1Messages() {
    LocoNetMessage l;
    l = new LocoNetMessage(new int[] { 0xe5, 0x10, 0x50, 0x51, 0x01, 0x00, 0x01, 0x02, 0x13, 0x04, 0x10, 0x05, 0x06, 0x07, 0x08, 0x00 });
    assertEquals("SV1 test 1", "LocoBuffer => LocoIO@51/5 Write SV2=0x4 Firmware rev 1.9.\n", f.displayMessage(l));
    l = new LocoNetMessage(new int[] { 0xE5, 0x10, 0x50, 0x04, 0x01, 0x00, 0x01, 0x10, 0x07, 0x14, 0x10, 0x05, 0x06, 0x07, 0x08, 0x12 });
    assertEquals("SV1 test 2", "LocoBuffer => LocoIO@4/5 Write SV16=0x14 Firmware rev 7.\n", f.displayMessage(l));
    l = new LocoNetMessage(new int[] { 0xE5, 0x10, 0x50, 0x04, 0x01, 0x00, 0x01, 0x10, 0x78, 0x24, 0x1F, 0x05, 0x06, 0x07, 0x08, 0x12 });
    assertEquals("SV1 test 3", "LocoBuffer => LocoIO@4/85 Write SV16=0x24 Firmware rev 1.2.0.\n", f.displayMessage(l));
}
Also used : LocoNetMessage(jmri.jmrix.loconet.LocoNetMessage)

Example 37 with LocoNetMessage

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

the class LocoMonPaneTest method testFilterMultiple.

@Test
public void testFilterMultiple() throws Exception {
    pane.initComponents();
    // filter A0
    pane.setFilterText("B1 A0");
    new org.netbeans.jemmy.QueueTool().waitEmpty(100);
    Assert.assertEquals("filter set", "B1 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", "", pane.getFrameText());
}
Also used : LocoNetMessage(jmri.jmrix.loconet.LocoNetMessage) Test(org.junit.Test)

Example 38 with LocoNetMessage

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

the class LocoMonPaneTest method testFilterNot.

@Test
public void testFilterNot() throws Exception {
    pane.initComponents();
    // filter not match
    pane.setFilterText("A1");
    new org.netbeans.jemmy.QueueTool().waitEmpty(100);
    Assert.assertEquals("filter set", "A1", ((LocoMonPane) 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", "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 39 with LocoNetMessage

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

the class LoaderEngineTest method testGetStartWavDataMessage2.

public void testGetStartWavDataMessage2() {
    LoaderEngine l = new LoaderEngine(null);
    LocoNetMessage m = l.getStartDataMessage(LoaderEngine.TYPE_WAV, 0x17, 512);
    Assert.assertEquals("contents", "D3 04 17 02 00 3D", m.toString());
    Assert.assertEquals("checksum", true, m.checkParity());
}
Also used : LocoNetMessage(jmri.jmrix.loconet.LocoNetMessage)

Example 40 with LocoNetMessage

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

the class LoaderEngineTest method testGetStartWavDataMessage1.

public void testGetStartWavDataMessage1() {
    LoaderEngine l = new LoaderEngine(null);
    LocoNetMessage m = l.getStartDataMessage(LoaderEngine.TYPE_WAV, 0x17, 128);
    Assert.assertEquals("contents", "D3 04 17 01 00 3E", m.toString());
    Assert.assertEquals("checksum", true, m.checkParity());
}
Also used : LocoNetMessage(jmri.jmrix.loconet.LocoNetMessage)

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