New Matrix signal mast connection #1345

Merged
merged 54 commits into from Jun 17, 2016

Conversation

Projects
None yet
4 participants
@silverailscolo
Contributor

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
@silverailscolo

This comment has been minimized.

Show comment
Hide comment
@silverailscolo

silverailscolo May 16, 2016

Contributor

A screen shot at this stage:
matrixmast add_pane5tooltip

  • a When selected from the list, the panel lets you set
  • b the number of logic outputs (3 in the screen shot, changed this into a drop down list). The panel is redrawn when you change this number, showing as many
  • c Output selection boxes. An option in the works would be choosing between plain turnouts and more advanced direct packets.
  • d check boxes allow you to set and view the matrix.
  • e The “bits” are displayed here just for debugging purposes, stored behind the scenes as a character array

All that has to be saved to recreate this mast are the outputs (in order) and the strings of 0’s and 1’s, with the aspect as their attribute, plus the usual stuff like name and signal type.
One thing I’m planning to add is displaying a Dark aspect to the panel if the ‘Mast can be Unlit' option is checked.

Contributor

silverailscolo commented on 037a2f4 May 16, 2016

A screen shot at this stage:
matrixmast add_pane5tooltip

  • a When selected from the list, the panel lets you set
  • b the number of logic outputs (3 in the screen shot, changed this into a drop down list). The panel is redrawn when you change this number, showing as many
  • c Output selection boxes. An option in the works would be choosing between plain turnouts and more advanced direct packets.
  • d check boxes allow you to set and view the matrix.
  • e The “bits” are displayed here just for debugging purposes, stored behind the scenes as a character array

All that has to be saved to recreate this mast are the outputs (in order) and the strings of 0’s and 1’s, with the aspect as their attribute, plus the usual stuff like name and signal type.
One thing I’m planning to add is displaying a Dark aspect to the panel if the ‘Mast can be Unlit' option is checked.

This comment has been minimized.

Show comment
Hide comment
@bobjacobsen

bobjacobsen May 17, 2016

Member

Not seeing this attached to a PR. Did it accidentally get committed directly to GitHub?

Member

bobjacobsen replied May 17, 2016

Not seeing this attached to a PR. Did it accidentally get committed directly to GitHub?

This comment has been minimized.

Show comment
Hide comment
@silverailscolo

silverailscolo May 17, 2016

Contributor

In fact this was not expected. Might be caused by me pasting the URL inside a developers-group mail.
Didn't make a PR yet; will do that as soon as I have things running.

Contributor

silverailscolo replied May 17, 2016

In fact this was not expected. Might be caused by me pasting the URL inside a developers-group mail.
Didn't make a PR yet; will do that as soon as I have things running.

+ 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

This comment has been minimized.

@silverailscolo

silverailscolo May 23, 2016

Contributor

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

@silverailscolo

silverailscolo May 23, 2016

Contributor

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

This comment has been minimized.

@bobjacobsen

bobjacobsen May 24, 2016

Member

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.

@bobjacobsen

bobjacobsen May 24, 2016

Member

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.

This comment has been minimized.

@silverailscolo

silverailscolo May 24, 2016

Contributor

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

silverailscolo May 24, 2016

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@silverailscolo

silverailscolo May 24, 2016

Contributor

WIP label may be removed

Contributor

silverailscolo commented May 24, 2016

WIP label may be removed

@bobjacobsen bobjacobsen added the WIP label May 24, 2016

silverailscolo added some commits May 26, 2016

Add unLit option
Still to investigate double registration of bits in xml
Fix setting CommandedState for turnout outputs
Add Reset previous Aspect option
Add Reset previous Aspect
not Appearance
set protected mast fields
Remove unused methods in mast
Fix isTurnoutUsed()

silverailscolo added some commits May 30, 2016

Add Output Matrix help
New screenshots for DCC and Matrix
@silverailscolo

This comment has been minimized.

Show comment
Hide comment
@silverailscolo

silverailscolo Jun 1, 2016

Contributor

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

Contributor

silverailscolo commented Jun 1, 2016

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

@mattharris

This comment has been minimized.

Show comment
Hide comment
@mattharris

mattharris Jun 1, 2016

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).

Member

mattharris commented Jun 1, 2016

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).

Fix storing unLitBits
Add docs
Add @nonnull annotations
Describe code fragment blocks meant for future options
@silverailscolo

This comment has been minimized.

Show comment
Hide comment
@silverailscolo

silverailscolo Jun 1, 2016

Contributor

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.

Contributor

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 added some commits Jun 1, 2016

Update help screens
Add tip for unLit config from Suzie x
Move Signal Mast help images to images folder
Fix <img src=> links
Add Signal Driver <a name=> tags in help
Hide AspectBitsField
(debug tool, marked in code)
Add SetReference()
Alignment of panel checkboxes improved
Hide MatrixAspectDetails field
Add matrix mast settings screen shot for DR4018
@silverailscolo

This comment has been minimized.

Show comment
Hide comment
@silverailscolo

silverailscolo Jun 5, 2016

Contributor

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

Contributor

silverailscolo commented Jun 5, 2016

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

silverailscolo added some commits Jun 16, 2016

Merge remote-tracking branch 'JMRI/master' into eb-signal-matrix
# 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
Remove duplicate key
Introduced by merge
@silverailscolo

This comment has been minimized.

Show comment
Hide comment
@silverailscolo

silverailscolo Jun 17, 2016

Contributor

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

Contributor

silverailscolo commented Jun 17, 2016

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

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@bobjacobsen

This comment has been minimized.

Show comment
Hide comment
@bobjacobsen

bobjacobsen Jun 17, 2016

Member
Member

bobjacobsen commented Jun 17, 2016

@silverailscolo silverailscolo deleted the silverailscolo:eb-signal-matrix branch Jun 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment