Topics

Regarding property "intermediateSignal" proposed (bug fix?) change......


wombat_rrnut
 

To the person "in charge" of DefaultSignalMastLogicManager....(and its ilk)

 

I'm fairly new to JMRI development, so far I'm only been only in my own "world"

(i.e. I'm the "new" CTC guy).

 

Now I attempt to venture forth to other JMRI worlds, only to find possibly a VERY

minor discrepancy IMHO.

 

I'm writing my own "topology" for automatic discovery of Traffic Locking

Routes/Rules (when using LayoutEditor) for my CTC "stuff", and I came across (courtesy of Dave Sand)

a property in "DefaultSignalMastLogicManager" called "intermediateSignal".

 

Issue:

IMHO, there is a piece of code missing in the statement (in 2 places in the code):

 

if (sml.getDestinationList().size() == 1 && sml.getAutoTurnouts(sml.getDestinationList().get(0)).isEmpty()) {

 

These codes forget to check "getTurnouts"isEmpty() also, in case the user put in a MANUAL turnout.

 

Am I correct?  Even if wrong, some of the below still applies (#1, #2):

 

 

Now there are three problems:

 

#1) This property "intermediateSignal" doesn't "search" in the on-line documentation

at "https://www.jmri.org/JavaDoc/doc".  So how is a person to find this unless it is

documented?  This begs the question: Where should such things be documented?

I'd suggest NOT in DefaultSignalMastLogicManager (where it is created/removed) but in

"SignalMast" where most people would use and look for it.  But I'm not smart

enough to make that determination.

 

#2) Shouldn't this property have a "constant" defined somewhere like:

public static final String SML_PROPERTY_INTERMEDIATE_SIGNAL = "intermediateSignal";

so that if this property's name changed, other source code in the wider JMRI program wouldn't

have to be changed also (such as my own similar statement in my Topology.java file)?

 

#3) Should this change happen?  How do I know if people "in the field", say coded a

.py (Python) source code to use this, and expect it to only include "auto turnouts" and NOT

"manual" turnouts?  How does one publish to the wider world that I'm

seriously mucking with something?

 

As there has been discussion about "code review techniques", this makes my asking this

of the person who knows more about these items than me MORE important still.

 

I can do the code changes if pointed in the right places, or you (the expert) can.

I'm still (however) asking for "guidance" regarding the topics mentioned, so I don't step

on toes along the way......  :-) :-) :-) And I make everyone happy by being a good

citizen of this (new) wider JMRI world....... :-) :-) :-)

 

Sincerely

Gregory Bedlek

 


Dave Sand
 

Greg,

The intermediateSignal property is only used with the intermediateSection property which is only use by Dispatcher and only occurs when the signal mast logic and related signal mast based sections are automatically generated which means manually aded turnouts are not relevant.

These properties are specific to a particular process within Dispatcher and are not part of the public API.

Dave Sand



----- Original message -----
From: wombat_rrnut <gbedlek001@...>
Subject: [jmri-developers] Regarding property "intermediateSignal" proposed (bug fix?) change......
Date: Friday, July 24, 2020 8:42 PM

To the person "in charge" of DefaultSignalMastLogicManager....(and its ilk)

 

I'm fairly new to JMRI development, so far I'm only been only in my own "world"

(i.e. I'm the "new" CTC guy).

 

Now I attempt to venture forth to other JMRI worlds, only to find possibly a VERY

minor discrepancy IMHO.

 

I'm writing my own "topology" for automatic discovery of Traffic Locking

Routes/Rules (when using LayoutEditor) for my CTC "stuff", and I came across (courtesy of Dave Sand)

a property in "DefaultSignalMastLogicManager" called "intermediateSignal".

 

Issue:

IMHO, there is a piece of code missing in the statement (in 2 places in the code):

 

if (sml.getDestinationList().size() == 1 && sml.getAutoTurnouts(sml.getDestinationList().get(0)).isEmpty()) {

 

These codes forget to check "getTurnouts"isEmpty() also, in case the user put in a MANUAL turnout.

 

Am I correct?  Even if wrong, some of the below still applies (#1, #2):

 

 

Now there are three problems:

 

#1) This property "intermediateSignal" doesn't "search" in the on-line documentation

at "https://www.jmri.org/JavaDoc/doc".  So how is a person to find this unless it is

documented?  This begs the question: Where should such things be documented?

I'd suggest NOT in DefaultSignalMastLogicManager (where it is created/removed) but in

"SignalMast" where most people would use and look for it.  But I'm not smart

enough to make that determination.

 

#2) Shouldn't this property have a "constant" defined somewhere like:

public static final String SML_PROPERTY_INTERMEDIATE_SIGNAL = "intermediateSignal";

so that if this property's name changed, other source code in the wider JMRI program wouldn't

have to be changed also (such as my own similar statement in my Topology.java file)?

 

#3) Should this change happen?  How do I know if people "in the field", say coded a

.py (Python) source code to use this, and expect it to only include "auto turnouts" and NOT

"manual" turnouts?  How does one publish to the wider world that I'm

seriously mucking with something?

 

As there has been discussion about "code review techniques", this makes my asking this

of the person who knows more about these items than me MORE important still.

 

I can do the code changes if pointed in the right places, or you (the expert) can.

I'm still (however) asking for "guidance" regarding the topics mentioned, so I don't step

on toes along the way......  :-) :-) :-) And I make everyone happy by being a good

citizen of this (new) wider JMRI world....... :-) :-) :-)

 

Sincerely

Gregory Bedlek

 



wombat_rrnut
 

Thank you Dave for that explanation.

I have learned something important.

(i.e. don’t muck with it).

 

Greg

 

 

From: jmri@jmri-developers.groups.io [mailto:jmri@jmri-developers.groups.io] On Behalf Of Dave Sand
Sent: Friday, July 24, 2020 9:50 PM
To: jmri@jmri-developers.groups.io
Subject: Re: [jmri-developers] Regarding property "intermediateSignal" proposed (bug fix?) change......

 

Greg,

 

The intermediateSignal property is only used with the intermediateSection property which is only use by Dispatcher and only occurs when the signal mast logic and related signal mast based sections are automatically generated which means manually aded turnouts are not relevant.

 

These properties are specific to a particular process within Dispatcher and are not part of the public API.

 

Dave Sand

 

 

 

----- Original message -----

From: wombat_rrnut <gbedlek001@...>

Subject: [jmri-developers] Regarding property "intermediateSignal" proposed (bug fix?) change......

Date: Friday, July 24, 2020 8:42 PM

 

To the person "in charge" of DefaultSignalMastLogicManager....(and its ilk)

 

I'm fairly new to JMRI development, so far I'm only been only in my own "world"

(i.e. I'm the "new" CTC guy).

 

Now I attempt to venture forth to other JMRI worlds, only to find possibly a VERY

minor discrepancy IMHO.

 

I'm writing my own "topology" for automatic discovery of Traffic Locking

Routes/Rules (when using LayoutEditor) for my CTC "stuff", and I came across (courtesy of Dave Sand)

a property in "DefaultSignalMastLogicManager" called "intermediateSignal".

 

Issue:

IMHO, there is a piece of code missing in the statement (in 2 places in the code):

 

if (sml.getDestinationList().size() == 1 && sml.getAutoTurnouts(sml.getDestinationList().get(0)).isEmpty()) {

 

These codes forget to check "getTurnouts"isEmpty() also, in case the user put in a MANUAL turnout.

 

Am I correct?  Even if wrong, some of the below still applies (#1, #2):

 

 

Now there are three problems:

 

#1) This property "intermediateSignal" doesn't "search" in the on-line documentation

at "https://www.jmri.org/JavaDoc/doc".  So how is a person to find this unless it is

documented?  This begs the question: Where should such things be documented?

I'd suggest NOT in DefaultSignalMastLogicManager (where it is created/removed) but in

"SignalMast" where most people would use and look for it.  But I'm not smart

enough to make that determination.

 

#2) Shouldn't this property have a "constant" defined somewhere like:

public static final String SML_PROPERTY_INTERMEDIATE_SIGNAL = "intermediateSignal";

so that if this property's name changed, other source code in the wider JMRI program wouldn't

have to be changed also (such as my own similar statement in my Topology.java file)?

 

#3) Should this change happen?  How do I know if people "in the field", say coded a

.py (Python) source code to use this, and expect it to only include "auto turnouts" and NOT

"manual" turnouts?  How does one publish to the wider world that I'm

seriously mucking with something?

 

As there has been discussion about "code review techniques", this makes my asking this

of the person who knows more about these items than me MORE important still.

 

I can do the code changes if pointed in the right places, or you (the expert) can.

I'm still (however) asking for "guidance" regarding the topics mentioned, so I don't step

on toes along the way......  :-) :-) :-) And I make everyone happy by being a good

citizen of this (new) wider JMRI world....... :-) :-) :-)

 

Sincerely

Gregory Bedlek