Skip to content
Permalink
Browse files

del duplicate key

  • Loading branch information...
silverailscolo committed May 14, 2019
1 parent c21c4fc commit 75f896dc6d9d7bdd0f19fad25f546300434c3fed
@@ -23,7 +23,6 @@
* <p>
* They can also be asked to request their current status via the network,
* or toggled to the opposite state that it is currently at.
*
*/
public enum EvState{
ON, OFF, UNKNOWN, REQUEST, TOGGLE;
@@ -36,7 +35,6 @@
*
* @param nn Node Number
* @param en Event Number
*
*/
public CbusEvent( int nn, int en){
this._nn = nn;
@@ -56,12 +54,11 @@ public EvState getState() {
}

/**
* Set current state of the event
* Set current state of the event.
* <p>
* Does NOT send update to layout
* Does NOT send update to layout.
*
* @param newval the enum event state ie ON, OFF, UNKNOWN
*
*/
public void setState( EvState newval ) {
_state = newval;
@@ -78,75 +75,68 @@ public int getEn() {
}

/**
* Get event node number
* Get event node number.
*
* @return node Number
*
*/
public int getNn(){
return _nn;
}

/**
* Set event event number
* Set event event number.
*
* @param en Event Number, not restricted so can be -1 for unknown
*
*/
public void setEn ( int en ) {
_en = en;
}

/**
* Set event node number
* Set event node number.
*
* @param nn Node Number, not restricted so can be -1 for unknown
*
*/
public void setNn ( int nn ) {
_nn = nn;
}

/**
* Set event name
* Set event name.
*
* @param name Event Name
*
*/
public void setName( String name ) {
_name = name;
}

/**
* Set event name
* Get event name.
*
* @return the Event Name
*
*/
public String getName() {
return _name;
}

/**
* Get Node name
* Get Node name.
* <p>
* Helper method, node name not stored in event, retrieved via @CbusNameService
*
* @return Node Name
*
*/
public String getNodeName() {
return new CbusNameService().getNodeName( getNn() );
}

/**
* Test if a node and event number combination matches this event
* Test if a node and event number combination matches this event.
*
* @param nn Node Number
* @param en Event Number
*
* @return true on match, else false
*
*/
public boolean matches(int nn, int en) {
if ( (nn == _nn) && (en == _en) ) {
@@ -156,45 +146,42 @@ public boolean matches(int nn, int en) {
}

/**
* Send ON event CAN frame
* Send ON event CAN frame.
* <p>
* Long event if Node num greater than 0, else short
*
* Long event if Node num greater than 0, else short.
*/
public void sendOn(){
sendEvent(EvState.ON);
}

/**
* Send OFF event CAN frame
* Send OFF event CAN frame.
* <p>
* Long event if Node num greater than 0, else short
*
* Long event if Node num greater than 0, else short.
*/
public void sendOff(){
sendEvent(EvState.OFF);
}

/**
* Send event status request CAN frame
* Send event status request CAN frame.
* <p>
* Long request if Node num greater than 0, else short
*
* Long request if Node num greater than 0, else short.
*/
public void sendRequest(){
sendEvent(EvState.REQUEST);
}

/**
* Send event CAN frame via ENUM
* Send event CAN frame via ENUM.
* <p>
* Also updates the event status as per the enum value.
* <p>
* If current state unknown, toggle sends event off
* If current state unknown, toggle sends event off.
* <p>
* Long event if Node num greater than 0, else short
* @param state The enum state requested to be sent, ie ON, OFF, REQUEST, TOGGLE
* Long event if Node num greater than 0, else short.
*
* @param state The enum state requested to be sent, ie ON, OFF, REQUEST, TOGGLE
*/
public void sendEvent(EvState state) {
CanSystemConnectionMemo memo = jmri.InstanceManager.getDefault(CanSystemConnectionMemo.class);
@@ -238,11 +225,9 @@ public void sendEvent(EvState state) {
}

/**
* Get a String with event overview
* <p>
* Get a String with event overview.
*
* @return includes event name and node name if known
*
*/
@Override
public String toString() {
@@ -269,4 +254,5 @@ public String toString() {
}

// private static final Logger log = LoggerFactory.getLogger(CbusEvent.class);

}
@@ -8,7 +8,6 @@ WindowTitleRenumber = Change Grapevine Board Address
ButtonCheck = Check
TipCheck = Click to refresh Grapevine status

StatusOK = OK
StatusStart = Starting...
StatusRunning = Checking...
StatusRunningX = Checking node {0}/{1}
@@ -8,7 +8,6 @@ WindowTitleRenumber = Change Grapevine Board Address
ButtonCheck = Check
TipCheck = Click to refresh Grapevine status

StatusOK = OK
StatusStart = Starting...
StatusRunning = Checking...
StatusRunningX = Checking node {0}/{1}
@@ -9,7 +9,6 @@ WindowTitleRenumber = Cambia Indirizzo Scheda Grapevine
ButtonCheck = Controlla
TipCheck = Click per aggiornare Stato Grapevine

StatusOK = OK
StatusStart = Inizio...
StatusRunning = Controllo...
StatusRunningX = Controlle Nodo {0}/{1}
@@ -8,7 +8,6 @@ WindowTitleRenumber = Wijzig Grapevine Board-adres
ButtonCheck = Controleer
TipCheck = Klik om de Grapevine status te verversen

StatusOK = OK
StatusStart = Beginnen...
StatusRunning = Controleren...
StatusRunningX = Controleer Node {0} van {1}
@@ -1,4 +1,4 @@
package jmri.jmrix.mrc.simulator;
package jmri.jmrix.mrc.serialdriver;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Locale;
@@ -1,11 +1,9 @@
# BoosterProgBundle.properties
#
#
#
# Default properties for the jmri.jmrix.nce.boosterprog GUI elements

StatusProgramming = Programming
StatusOK = OK

StatusError = Error:

ButtonSet = Set
@@ -1,11 +1,8 @@
# BoosterProgBundle.properties
# BoosterProgBundle_da.properties
#
#
#
# Default properties for the jmri.jmrix.nce.boosterprog GUI elements
# Danish properties for the jmri.jmrix.nce.boosterprog GUI elements

StatusProgramming = Programming
StatusOK = OK
StatusError = Error:

ButtonSet = Set
@@ -1,11 +1,10 @@
# BoosterProgBundle.properties
# BoosterProgBundle_de.properties
#
#
# by Simon Ginsburg
# German properties for the jmri.jmrix.nce.boosterprog GUI elements
# by Simon Ginsburg

StatusProgramming = Programmierung
StatusOK = OK

StatusError = Fehler:

ButtonSet = Einstellung
@@ -1,13 +1,9 @@
# BoosterProgBundle_fr.properties
#
#
#
# Default properties for the jmri.jmrix.nce.boosterprog GUI elements
#
# French properties for the jmri.jmrix.nce.boosterprog GUI elements
# Translated by Herv\u00e9 BLOREC <bzh56420@yahoo.fr> le 2013-8-27

StatusProgramming = Programmation
StatusOK = OK
StatusError = Erreur:

ButtonSet = R\u00e9glage
@@ -1,13 +1,10 @@
# BoosterProgBundle.properties
#
#
#
# Default properties for the jmri.jmrix.nce.boosterprog GUI elements
#
# Italian translation: Enzo Fortuna (babbo_enzo@yahoo.com )
# BoosterProgBundle_it.properties
#
# Italian properties for the jmri.jmrix.nce.boosterprog GUI elements
# Translation: Enzo Fortuna (babbo_enzo@yahoo.com )

StatusProgramming = Sto Programmando
StatusOK = OK

StatusError = Errore:

ButtonSet = Imposta
@@ -1,11 +1,9 @@
# BoosterProgBundle.properties
# BoosterProgBundle_ja_JP.properties
#
#
#
# Default properties for the jmri.jmrix.nce.boosterprog GUI elements
# Japanese properties for the jmri.jmrix.nce.boosterprog GUI elements

StatusProgramming = Programming
StatusOK = OK

StatusError = Error:

ButtonSet = Set
@@ -26,9 +26,7 @@ public void testDefaultViaBestMode() {
((CbusDccProgrammer)programmer).getBestMode());
}


/*
@Test(expected=java.lang.IllegalArgumentException.class)
public void testSetGetMode() {
programmer.setMode(ProgrammingMode.REGISTERMODE);
@@ -71,13 +69,8 @@ public void testReadSequence() throws jmri.ProgrammerException {
Assert.assertEquals("value", 5, testListener.getRcvdValue());
}
*/


// The minimal setup for log4J
@Override
@Before
@@ -13,7 +13,6 @@
*/
public class CbusTableEventTest {


@Test
public void testCTor() {
// int,int,EvState,int,String,String,String,int,int,int,int,Date
@@ -56,7 +55,6 @@ public void testSetGet() {
Assert.assertEquals("getSessionOff 1", 1,(t.getSessionOff()) );
Assert.assertEquals("getSessionIn 1", 1,(t.getSessionIn()) );
Assert.assertEquals("getSessionOut 1", 1,(t.getSessionOut()) );

}


0 comments on commit 75f896d

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