Skip to content
Permalink
Browse files

Merge pull request #5848 from pabender/master

F2 is not always the horn.
  • Loading branch information...
pabender committed Sep 23, 2018
2 parents e814d4f + 80c3bab commit 001a09b52989b6f6f5cc4ca5d084a01f31df5dae
@@ -460,8 +460,6 @@ public void resetFnButtons() {
functionButton[26].setKeyCode(0xF00D);
functionButton[27].setKeyCode(0xF00E);
functionButton[28].setKeyCode(0xF00F);
// Make F2 (Horn) momentary
functionButton[2].setIsLockable(false);

alt1Button.setVisible(true);
alt2Button.setVisible(true);
@@ -60,6 +60,35 @@
public AbstractThrottle(SystemConnectionMemo memo) {
active = true;
adapterMemo = memo;
// set defaults for Momentary status.
f0Momentary = false;
f1Momentary = false;
f2Momentary = false;
f3Momentary = false;
f4Momentary = false;
f5Momentary = false;
f6Momentary = false;
f7Momentary = false;
f9Momentary = false;
f10Momentary = false;
f11Momentary = false;
f12Momentary = false;
f13Momentary = false;
f14Momentary = false;
f15Momentary = false;
f16Momentary = false;
f17Momentary = false;
f18Momentary = false;
f19Momentary = false;
f20Momentary = false;
f21Momentary = false;
f22Momentary = false;
f23Momentary = false;
f24Momentary = false;
f25Momentary = false;
f26Momentary = false;
f27Momentary = false;
f28Momentary = false;
}

protected SystemConnectionMemo adapterMemo;
@@ -53,10 +53,6 @@ public DCCppThrottle(DCCppSystemConnectionMemo memo, LocoAddress address, DCCppT
this.speedIncrement = SPEED_STEP_128_INCREMENT;
this.speedStepMode = DccThrottle.SpeedStepMode128;

f0Momentary = f1Momentary = f2Momentary = f3Momentary = f4Momentary
= f5Momentary = f6Momentary = f7Momentary = f8Momentary = f9Momentary
= f10Momentary = f11Momentary = f12Momentary = false;

requestList = new LinkedBlockingQueue<RequestMessage>();
if (log.isDebugEnabled()) {
log.debug("DCCppThrottle constructor called for address " + address);
@@ -68,10 +68,6 @@ public XNetThrottle(XNetSystemConnectionMemo memo, LocoAddress address, XNetTraf
// this.isForward=true;
setIsAvailable(false);

f0Momentary = f1Momentary = f2Momentary = f3Momentary = f4Momentary
= f5Momentary = f6Momentary = f7Momentary = f8Momentary = f9Momentary
= f10Momentary = f11Momentary = f12Momentary = false;

requestList = new LinkedBlockingQueue<RequestMessage>();
sendStatusInformationRequest();
if (log.isDebugEnabled()) {
@@ -95,6 +95,10 @@ public LocoNetThrottle(LocoNetSystemConnectionMemo memo, LocoNetSlot slot) {
this.f27 = slot.isF27();
this.f28 = slot.isF28();

// for LocoNet throttles, the default is f2 momentary (for the horn)
// all other functions are continuos (as set in AbstractThrottle).
this.f2Momentary = true;

this.address = slot.locoAddr();
this.isForward = slot.isForward();
this.slotStatus = slot.slotStatus();
@@ -402,6 +402,16 @@ public void testSendFunctionGroup4() {
public void testSendFunctionGroup5() {
}

/**
* Test of getF2Momentary method, of class AbstractThrottle.
*/
@Test
public void testGetF2Momentary() {
boolean expResult = true;
boolean result = instance.getF2Momentary();
Assert.assertEquals(expResult, result);
}

@Before
@Override
public void setUp() {
@@ -402,6 +402,15 @@ public void testSendFunctionGroup4() {
public void testSendFunctionGroup5() {
}

/**
* Test of getF2Momentary method, of class AbstractThrottle.
*/
@Test
public void testGetF2Momentary() {
boolean expResult = true;
boolean result = instance.getF2Momentary();
Assert.assertEquals(expResult, result);
}

// The minimal setup for log4J
@Before
@@ -478,6 +478,15 @@ public void testSendFunctionGroup4() {
public void testSendFunctionGroup5() {
}

/**
* Test of getF2Momentary method, of class AbstractThrottle.
*/
@Test
public void testGetF2Momentary() {
boolean expResult = true;
boolean result = instance.getF2Momentary();
Assert.assertEquals(expResult, result);
}

private LocoNetInterfaceScaffold lnis;
private SlotManager slotmanager;

0 comments on commit 001a09b

Please sign in to comment.
You can’t perform that action at this time.