Search in sources :

Example 1 with LnTrafficController

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

the class PR3SystemConnectionMemo method configureManagersPR2.

/**
     * Configure the subset of LocoNet managers valid for the PR3 in PR2 mode.
     */
public void configureManagersPR2() {
    mode = PR3MODE;
    InstanceManager.store(getPowerManager(), jmri.PowerManager.class);
    InstanceManager.setThrottleManager(getThrottleManager());
    jmri.InstanceManager.setProgrammerManager(getProgrammerManager());
    // Finally, create and register a shutdown task to ensure clean exit
    if (restoreToLocoNetInterfaceModeTask == null) {
        restoreToLocoNetInterfaceModeTask = new // NOI18N
        QuietShutDownTask(// NOI18N
        "Restore PR3 to LocoNet Interface Mode") {

            @Override
            public boolean execute() {
                if (mode == PR3MODE) {
                    // try to change from "standalone programmer" to "LocoNet interface" mode
                    LnTrafficController tc;
                    tc = getLnTrafficController();
                    if (tc != null) {
                        LocoNetMessage msg = new LocoNetMessage(6);
                        msg.setOpCode(0xD3);
                        msg.setElement(1, 0x10);
                        // set MS100, no power
                        msg.setElement(2, 0);
                        msg.setElement(3, 0);
                        msg.setElement(4, 0);
                        tc.sendLocoNetMessage(msg);
                        // NOI18N
                        log.info("Configuring PR3 for 'LocoNet Interface' mode");
                    }
                }
                return true;
            }
        };
        if (InstanceManager.getNullableDefault(jmri.ShutDownManager.class) != null) {
            InstanceManager.getDefault(jmri.ShutDownManager.class).register(restoreToLocoNetInterfaceModeTask);
        } else {
            // NOI18N
            log.warn("The PR3 will not be automatically returned to 'LocoNet interface' mode upon quit!");
        }
    }
}
Also used : LocoNetMessage(jmri.jmrix.loconet.LocoNetMessage) LnTrafficController(jmri.jmrix.loconet.LnTrafficController)

Example 2 with LnTrafficController

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

the class UhlenbrockProgrammerManagerTest method testCTor.

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

Example 3 with LnTrafficController

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

the class LocoNetMenuTest method testCTor.

@Test
public void testCTor() {
    LnTrafficController lnis = new LocoNetInterfaceScaffold();
    SlotManager slotmanager = new SlotManager(lnis);
    LocoNetSystemConnectionMemo memo = new LocoNetSystemConnectionMemo(lnis, slotmanager);
    LocoNetMenu t = new LocoNetMenu(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)

Example 4 with LnTrafficController

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

the class UhlenbrockLnThrottleManagerTest method testCTor.

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

Example 5 with LnTrafficController

use of jmri.jmrix.loconet.LnTrafficController 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

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