Search in sources :

Example 6 with LocoNetInterfaceScaffold

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

the class LocoIOPanelTest method testReadAll.

public void testReadAll() {
    // prepare an interface
    LocoNetInterfaceScaffold lnis = new LocoNetInterfaceScaffold();
    LocoIOPanel f = new LocoIOPanel();
    LocoNetSystemConnectionMemo memo = new LocoNetSystemConnectionMemo();
    memo.setLnTrafficController(lnis);
    f.initComponents(memo);
    // click button
    f.readAllButton.doClick();
    // check first message of ReadAll
    Assert.assertEquals("One message sent", 1, lnis.outbound.size());
    LocoNetMessage msg = lnis.outbound.elementAt(0);
    Assert.assertEquals("message length", 16, msg.getNumDataElements());
    Assert.assertEquals("message opCode", 0xE5, msg.getOpCode());
    Assert.assertEquals("message bytes", "E5 10 50 51 01 00 02 04 00 00 10 00 00 00 00 00", msg.toString());
    // dispose and end operation
    f.dispose();
}
Also used : LocoNetMessage(jmri.jmrix.loconet.LocoNetMessage) LocoNetInterfaceScaffold(jmri.jmrix.loconet.LocoNetInterfaceScaffold) LocoNetSystemConnectionMemo(jmri.jmrix.loconet.LocoNetSystemConnectionMemo)

Example 7 with LocoNetInterfaceScaffold

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

the class LnSensorManagerTest method setUp.

// The minimal setup for log4J
@Override
@Before
public void setUp() {
    apps.tests.Log4JFixture.setUp();
    jmri.util.JUnitUtil.resetInstanceManager();
    // prepare an interface
    lnis = new LocoNetInterfaceScaffold();
    Assert.assertNotNull("exists", lnis);
    // create and register the manager object
    l = new LnSensorManager(lnis, "L");
    jmri.InstanceManager.setSensorManager(l);
}
Also used : LocoNetInterfaceScaffold(jmri.jmrix.loconet.LocoNetInterfaceScaffold) Before(org.junit.Before)

Example 8 with LocoNetInterfaceScaffold

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

the class LocoIOPanelTest method testAddrField.

public void testAddrField() {
    // make sure that the address field does a notify
    // and new address is used
    // prepare an interface
    LocoNetInterfaceScaffold lnis = new LocoNetInterfaceScaffold();
    LocoIOPanel f = new LocoIOPanel();
    LocoNetSystemConnectionMemo memo = new LocoNetSystemConnectionMemo();
    memo.setLnTrafficController(lnis);
    f.initComponents(memo);
    f.addrField.setText("1234");
    f.addrField.postActionEvent();
    // click button
    f.readAllButton.doClick();
    // check first message of readAll
    Assert.assertEquals("One message sent", 1, lnis.outbound.size());
    LocoNetMessage msg = lnis.outbound.elementAt(0);
    Assert.assertEquals("message length", 16, msg.getNumDataElements());
    Assert.assertEquals("message opCode", 0xE5, msg.getOpCode());
    Assert.assertEquals("message bytes", "E5 10 50 34 01 00 02 04 00 00 10 00 00 00 00 00", msg.toString());
    // dispose and end operation
    f.dispose();
}
Also used : LocoNetMessage(jmri.jmrix.loconet.LocoNetMessage) LocoNetInterfaceScaffold(jmri.jmrix.loconet.LocoNetInterfaceScaffold) LocoNetSystemConnectionMemo(jmri.jmrix.loconet.LocoNetSystemConnectionMemo)

Example 9 with LocoNetInterfaceScaffold

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

the class LnPr2PowerManagerTest method setUp.

// setup a default interface
@Before
@Override
public void setUp() {
    controller = new LocoNetInterfaceScaffold();
    slotmanager = new SlotManager(controller);
    PR2SystemConnectionMemo memo = new PR2SystemConnectionMemo(controller, slotmanager);
    memo.configureManagers();
    jmri.InstanceManager.setThrottleManager(memo.getPr2ThrottleManager());
    memo.getPr2ThrottleManager().requestThrottleSetup(new jmri.DccLocoAddress(3, false), true);
    p = new LnPr2PowerManager(memo);
}
Also used : SlotManager(jmri.jmrix.loconet.SlotManager) LocoNetInterfaceScaffold(jmri.jmrix.loconet.LocoNetInterfaceScaffold) Before(org.junit.Before)

Example 10 with LocoNetInterfaceScaffold

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

the class SlotMonDataModelTest method testCTor.

@Test
public void testCTor() {
    LnTrafficController lnis = new LocoNetInterfaceScaffold();
    SlotManager slotmanager = new SlotManager(lnis);
    LocoNetSystemConnectionMemo memo = new LocoNetSystemConnectionMemo(lnis, slotmanager);
    SlotMonDataModel t = new SlotMonDataModel(1, 19, memo);
    Assert.assertNotNull("exists", t);
}
Also used : SlotManager(jmri.jmrix.loconet.SlotManager) LocoNetInterfaceScaffold(jmri.jmrix.loconet.LocoNetInterfaceScaffold) LocoNetSystemConnectionMemo(jmri.jmrix.loconet.LocoNetSystemConnectionMemo) LnTrafficController(jmri.jmrix.loconet.LnTrafficController) Test(org.junit.Test)

Aggregations

LocoNetInterfaceScaffold (jmri.jmrix.loconet.LocoNetInterfaceScaffold)11 LocoNetSystemConnectionMemo (jmri.jmrix.loconet.LocoNetSystemConnectionMemo)6 LnTrafficController (jmri.jmrix.loconet.LnTrafficController)5 Test (org.junit.Test)5 SlotManager (jmri.jmrix.loconet.SlotManager)4 LocoNetMessage (jmri.jmrix.loconet.LocoNetMessage)3 UhlenbrockSlotManager (jmri.jmrix.loconet.UhlenbrockSlotManager)2 Before (org.junit.Before)2