Skip to content

Commit

Permalink
core cbuseventtable update for both model + swing
Browse files Browse the repository at this point in the history
  • Loading branch information
icklesteve committed Apr 14, 2020
1 parent 9018c8b commit 0a1fff0
Show file tree
Hide file tree
Showing 30 changed files with 3,038 additions and 2,144 deletions.
40 changes: 35 additions & 5 deletions java/src/jmri/jmrix/can/cbus/CbusBundle.properties
Expand Up @@ -28,6 +28,7 @@ MenuItemSPROGBootloader = Firmware Update
# general
Byte = Byte
CanID = CAN ID
CanIDLabel = CAN ID : {0}
CbusNode = Node
CbusNodes = Nodes
CbusEvent = Event
Expand All @@ -38,9 +39,9 @@ CbusEventRequest = Request
CbusEventOnOrOff = On or Off
CbusSendOn = <html><span style="color:green">Send On</span></html>
CbusSendOff = <html><span style="color:red">Send Off</span></html>
ConfirmOverwriteFile = Do you want to replace the existing file?
ConfirmQuestion = Please Confirm
Display = Display
CbusSendOnHeader = Send On
CbusSendOffHeader = Send Off
Display = View
Options = Options
Statistics = Stats
New = New :
Expand Down Expand Up @@ -139,6 +140,7 @@ showAddressCheckBox = Address
showAddressCheckBoxTip = Hardware address to enter in Sensors, Turnouts or Lights Tables.
showCanCheckBox = CAN
showCanCheckBoxTip = Include the CAN message.
addressGrouping = [{0}]

EventHighlightTitle = Event Highlighter
EventHighlightTitleX = Highlight {0}
Expand Down Expand Up @@ -187,6 +189,9 @@ EVD0 = Event + No Data
EVD1 = Event + Data 1
EVD2 = Event + Data 2
EVD3 = Event + Data 3
Dat1 = Data 1
Dat2 = Data 2
Dat3 = Data 3
CommandStation = Command Station
LocoCommands = Acquire / Release / Consist
KeepAlive = Keep-Alive
Expand All @@ -213,6 +218,16 @@ MaxEventSet = Event must be {0} or below if set to filter.
MinNodeSet = Node must be {0} or above if set to filter.
MaxNodeSet = Node must be {0} or below if set to filter.

# CreatedNamedBeanPane
ReminderTitle = Reminder !
SavePanelReminder = Remember to save your Panel file!
HideFurtherDialog = Hide further alerts
TslDetails = Turnout / Sensor / Light Details
CreateNew = Create New
DragHereForNew = Drag an event here to create new Turnout / Sensor / Light
EditUserName = Edit UserName
EditUNameTip = Only change User Name if not being used in a panel.

# CBUS Event Table items
ColumnShowHide = Show / Hide Columns
EventTableTitle = CBUS Event Table
Expand All @@ -231,8 +246,8 @@ NodeNameAdded = Node Name {0} added.
evColMenuName = Event Columns
evStatMenuName = Stat Columns
evFbMenuName = Feedback Columns
evJmMenuName = JMRI Columns
UpdateCols = Refresh Columns
latestEvCols = Latest Columns
buttonCols = Button Columns

ColumnEventDelete = Delete
ColumnEventDeleteTip = Delete Event from Table
Expand All @@ -245,10 +260,24 @@ ColumnRequestStatusTip = Send a long or short status request message.
ColumnOnSession = On Session
ColumnOffSession = Off Session
ColumnTotalSession = Total Session
ColumnTotalAll = Total All-time
ColumnTotalOn = On All-time
ColumnTotalOff = Off All-time
ColumnTotalIn = In All-time
ColumnTotalOut = Out All-time
ColumnLastHeard = Last Heard
SendOntip = Send On Event. Long if node, Short if no node.
SendOfftip = Send Off Event. Long if node, Short if no node.
SendToggleTip = Toggle between sending On and Off events.

NewTsl = New Turnout / Sensor / Light

ExportCsvAll = Export to CSV File - Entire Table
ExportCsvView = Export to CSV File - Current View

SaveEvSession = Save / Restore Events between sessions
ResetSessionCount = Reset Session Count

NewEvent = New Event
PopupSessionConfirmDel = Hide confirmations until JMRI is closed
DelConfirmOne = Delete the event from this table?
Expand Down Expand Up @@ -313,6 +342,7 @@ Cancel = Cancel
BorderNodeNumber = Node Number
NodeNumbers = Node Numbers
WriteNVs = Write NV's
ColumnNVs = NV's
NodeVariables = Node Variables
LabelVariableNumber = Variable Number:
ToolTipVariableNumber = Enter a node variable number from 1 to 256
Expand Down
20 changes: 20 additions & 0 deletions java/src/jmri/jmrix/can/cbus/CbusNameService.java
@@ -1,8 +1,10 @@
package jmri.jmrix.can.cbus;

import java.util.HashSet;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import jmri.jmrix.can.CanSystemConnectionMemo;
import jmri.jmrix.can.cbus.eventtable.CbusEventBeanData;
import jmri.jmrix.can.cbus.eventtable.CbusEventTableDataModel;
import jmri.jmrix.can.cbus.node.CbusNodeTableDataModel;

Expand Down Expand Up @@ -97,6 +99,24 @@ public String getNodeName( int nn ){
return "";
}

/**
* Get the Sensor Turnout and Light user names associated with event on
* @param nn Node Number
* @param en Event Number
* @param state Event State, either on or off
* @return Sensor Turnout and Light Beans associated with the CBUS Event.
* @see jmri.NamedBean
*/
@Nonnull
public CbusEventBeanData getJmriBeans(int nn, int en, @Nonnull CbusEvent.EvState state){
CbusEventTableDataModel evMod = getEventModel();
if (evMod!=null) {
return evMod.getEventBeans(nn,en,state);
} else {
return new CbusEventBeanData( new HashSet<>(), new HashSet<>());
}
}

@CheckForNull
private CbusNodeTableDataModel getNodeModel(){
log.debug("memo: {}",_memo);
Expand Down
9 changes: 9 additions & 0 deletions java/src/jmri/jmrix/can/cbus/CbusSensorManager.java
@@ -1,5 +1,6 @@
package jmri.jmrix.can.cbus;

import java.beans.PropertyChangeEvent;
import java.util.Locale;
import javax.annotation.Nonnull;
import jmri.JmriException;
Expand Down Expand Up @@ -200,6 +201,14 @@ public void updateAll() {
}
});
}

@Override
public void propertyChange(PropertyChangeEvent e) {
super.propertyChange(e);
if (e.getPropertyName().equals("inverted")) {
firePropertyChange("beaninverted", null, null); //IN18N
}
}

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

Expand Down
9 changes: 9 additions & 0 deletions java/src/jmri/jmrix/can/cbus/CbusTurnoutManager.java
@@ -1,5 +1,6 @@
package jmri.jmrix.can.cbus;

import java.beans.PropertyChangeEvent;
import java.util.Locale;
import javax.annotation.Nonnull;
import jmri.JmriException;
Expand Down Expand Up @@ -192,6 +193,14 @@ public Turnout getBySystemName(@Nonnull String key) {
public String getEntryToolTip() {
return Bundle.getMessage("AddOutputEntryToolTip");
}

@Override
public void propertyChange(PropertyChangeEvent e) {
super.propertyChange(e);
if (e.getPropertyName().equals("inverted")) {
firePropertyChange("beaninverted", null, null); //IN18N
}
}

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

Expand Down

0 comments on commit 0a1fff0

Please sign in to comment.