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!");
}
}
}
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);
}
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);
}
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);
}
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);
}
Aggregations