Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Matrix signal mast connection #1345

Merged
merged 54 commits into from Jun 17, 2016

Conversation

silverailscolo
Copy link
Contributor

@silverailscolo silverailscolo commented May 23, 2016

I've assembled a new type of mast driver + configuration panel following up on suggestions from the list. It let's one set a logical matrix (truth table) to define a set of 1 to maximum 5 outputs for a range of Aspects.
matrixmastpanel07
An exciting experiment, from idea to code, sometimes struggling to keep an overview of things... Lots of other fine tuning still to do:

  • Add UnLit setting (but there often is an unlit Aspect in the list as well, needed?)
  • Store prefs for number of columns in matrix
  • Fix turnout instruction. Lesson learned: check your assumptions by printing values for each step.
  • Save mast as comment of output (setReference() method added, but doesn't show up)
  • Add Copy from another mast
  • Fix unlit bits not being returned
  • Hide the 10100 fields (handy for debugging) and clean up code fragments

Copy files and classes
Add imports
Option in Add Signal Mast panel
Start bitNumSpinner at 1
Adf tooltip for on/off
Correct DCC mast labels & Disabled for state (instead of 'Disable Aspect' action-like name)
Turnout names or beanhandles
Fix xml elements
(error to change turnout state)
to set bitNum/char [ ] size
Remove OK button, replaced by Apply/Create
log.debug("Empty char[] received");
}
for (int i = 0; i < BitNum; i++) {
//if (bits[i] == '1' && getTurnoutBean(i).getCommandedState() == Turnout.THROWN) { // no need to set a state already set
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point the program fails to interact with the Turnouts, so had to comment these 4 lines for the moment

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point the program fails to interact with the Turnouts, so had to comment these 4 lines for the moment

What goes wrong?

In general, it shouldn't hurt to set a ConmandedState to what it already is. Each individual implementation should handle that automatically.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the Signal Mast Panel, when I select an Aspect for a mast with this driver, the drop down doesn't pop back, and the Edit button no longer responds. Turnouts are present. The Console says:
2016-05-24 07:40:27,743 ptionhandler.UncaughtExceptionHandler ERROR - Uncaught Exception caught by jmri.util.exceptionhandler.UncaughtExceptionHandler [AWT-EventQueue-0] java.lang.NullPointerException at jmri.implementation.MatrixSignalMast.getTurnoutBean(MatrixSignalMast.java:363) at jmri.implementation.MatrixSignalMast.updateOutputs(MatrixSignalMast.java:334) at jmri.implementation.MatrixSignalMast.setAspect(MatrixSignalMast.java:139) at jmri.jmrit.beantable.signalmast.SignalMastTableDataModel.setValueAt(SignalMastTableDataModel.java:173) at jmri.util.com.sun.TableSorter.setValueAt(TableSorter.java:320) at javax.swing.JTable.setValueAt(JTable.java:2741) at javax.swing.JTable.editingStopped(JTable.java:4723) at javax.swing.AbstractCellEditor.fireEditingStopped(AbstractCellEditor.java:141) at javax.swing.DefaultCellEditor$EditorDelegate.stopCellEditing(DefaultCellEditor.java:368) at javax.swing.DefaultCellEditor$3.stopCellEditing(DefaultCellEditor.java:158) at javax.swing.DefaultCellEditor.stopCellEditing(DefaultCellEditor.java:233) at javax.swing.DefaultCellEditor$EditorDelegate.actionPerformed(DefaultCellEditor.java:385) at javax.swing.JComboBox.fireActionEvent(JComboBox.java:1258) at javax.swing.JComboBox.setSelectedItem(JComboBox.java:586) at javax.swing.JComboBox.setSelectedIndex(JComboBox.java:622) at javax.swing.plaf.basic.BasicComboPopup$Handler.mouseReleased(BasicComboPopup.java:852) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290) at java.awt.Component.processMouseEvent(Component.java:6535) at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) at com.apple.laf.AquaComboBoxPopup$1.processMouseEvent(AquaComboBoxPopup.java:157) at java.awt.Component.processEvent(Component.java:6300) at java.awt.Container.processEvent(Container.java:2236) at java.awt.Component.dispatchEventImpl(Component.java:4891) at java.awt.Container.dispatchEventImpl(Container.java:2294) at java.awt.Component.dispatchEvent(Component.java:4713) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466) at java.awt.Container.dispatchEventImpl(Container.java:2280) at java.awt.Window.dispatchEventImpl(Window.java:2750) at java.awt.Component.dispatchEvent(Component.java:4713) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.awt.EventQueue$4.run(EventQueue.java:729) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

@silverailscolo
Copy link
Contributor Author

JUnit result file not found, this does not point at commit contents but test system.

@mattharris
Copy link
Member

I've re-launched the AppVeyor build - seems as though it had a problem installing ant at the beginning of the run. (In case you're wondering, both Travis and AppVeyor start from completely fresh Virtual Machine instances on which the various dependencies have to be installed each time).

Add docs
Add @nonnull annotations
Describe code fragment blocks meant for future options
@silverailscolo
Copy link
Contributor Author

silverailscolo commented Jun 1, 2016

The Output Matrix mast hopefully will help to configure special decoders designed for signals, like the Digirails DR4018. In this first edition, only turnouts can be configured as outputs. The decoder documentation will have to explain which patterns belong to each Aspect. Will add an example for this to the help page and update the applicable screen shots. Note that the universal OK button has been replaced by either a Create new button (like the Route Table) or the Apply button when editing an existing mast config. It's not possible to change the number of outputs in the matrix once a mast hast been saved. Outputs and the Unlit row can be changed later on by clicking the Edit button in the Mast table.
After next production release seems the right moment for merge.

@silverailscolo
Copy link
Contributor Author

Here's the current interface, ready for merge after the upcoming production release:
matrixmastpanel-3t

@bobjacobsen bobjacobsen added this to the After 4.4 milestone Jun 5, 2016
@bobjacobsen bobjacobsen added the After Next Production Release Do not merge this until after the next production release label Jun 5, 2016
# Conflicts:
#	java/src/jmri/implementation/TurnoutSignalMast.java
#	java/src/jmri/jmrit/beantable/BeanTableBundle.properties
#	java/src/jmri/jmrit/beantable/BeanTableBundle_ca.properties
#	java/src/jmri/jmrit/beantable/BeanTableBundle_da.properties
#	java/src/jmri/jmrit/beantable/BeanTableBundle_de.properties
#	java/src/jmri/jmrit/beantable/BeanTableBundle_fr.properties
#	java/src/jmri/jmrit/beantable/BeanTableBundle_it.properties
#	java/src/jmri/jmrit/beantable/signalmast/AddSignalMastPanel.java
Introduced by merge
@silverailscolo
Copy link
Contributor Author

Ready for merge to master (for 4.5.1) now, please merge.

@bobjacobsen bobjacobsen modified the milestones: 4.5.1, After 4.4 Jun 17, 2016
@bobjacobsen bobjacobsen merged commit 3f5634b into JMRI:master Jun 17, 2016
@bobjacobsen
Copy link
Member

bobjacobsen commented Jun 17, 2016 via email

@rhwood rhwood removed After Next Production Release Do not merge this until after the next production release WIP labels Jun 17, 2016
@silverailscolo silverailscolo deleted the eb-signal-matrix branch June 17, 2016 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants