Topics

Toward a common bean-selection GUI


Bob Jacobsen
 

Short form:  The JComboBoxes used to select named beans (sensor, turnout, signal mast, etc) in the JMRI GUI use two different conventions.

Many, perhaps most, use the DISPLAYNAME convention:  "Display the user name; if the user name is null or empty, display the system name.”  Example: 


Note that the bottom three are showing their user names, and the list has been sorted by what’s displayed.

But a few use the USERNAME_SYSTEMNAME convention:  "Display the user name followed by the system name in parenthesis. If the user name is null or empty, display the system name without parenthesis.”  Example:


Here, the user names are always followed by the system name. (That doesn’t affect the sort order, as it’s always behind the user name)

It seems jarring to me to switch back and forth between these.  I would like to standardize on one format for JMRI’s selection combo boxes.

1) Is there any reason these should be so different?

2) If we’re to standardize on one, which one?  What are the arguments for one vs the other? 

Bob

Bob Jacobsen
rgj1927@...





Randall Wood <rhwood@...>
 



On 27-Jun-2020, at 21:22, Bob Jacobsen <rgj1927@...> wrote:

Short form:  The JComboBoxes used to select named beans (sensor, turnout, signal mast, etc) in the JMRI GUI use two different conventions.

Many, perhaps most, use the DISPLAYNAME convention:  "Display the user name; if the user name is null or empty, display the system name.”  Example: 

<PastedGraphic-1.png>

Note that the bottom three are showing their user names, and the list has been sorted by what’s displayed.

But a few use the USERNAME_SYSTEMNAME convention:  "Display the user name followed by the system name in parenthesis. If the user name is null or empty, display the system name without parenthesis.”  Example:

<PastedGraphic-2.png>

Here, the user names are always followed by the system name. (That doesn’t affect the sort order, as it’s always behind the user name)

It seems jarring to me to switch back and forth between these.  I would like to standardize on one format for JMRI’s selection combo boxes.

1) Is there any reason these should be so different?

I can think of no reason not to be consistent.

2) If we’re to standardize on one, which one?  What are the arguments for one vs the other?

I would prefer the USERNAME SYSTEMNAME convention; it will clearly show if a NamedBean has a UserName that matches the SystemName of another NamedBean (I think ProxyManagers can return a set of NamedBeans like that).

Bob

Bob Jacobsen
rgj1927@...






Bob M.
 

An argument for User-name-centric approach of Bean selection:

When I am doing work from an hardware-centric perspective, I prefer to focus on System Names. When I am doing work from the procedural perspective, I prefer to focus on User Names. I generally select beans when doing the procedural stuff, not hardware-centric stuff. So I'd "vote" for User-name-centric Bean selection.

My work generally focuses on LocoNet- or CMRI-based occupancy detection, switch control and feedback, and signaling; I have little/no practical experience with other JMRI features or other JMRI-supported systems, so cannot weigh-in on those aspects.

Regards,
Bob M.


Ken Cameron
 

Of the two, I think not showing the system name has the following
issues/history:

1. Many of the system generated system names, like signal heads and masts,
can be really long. Showing them requires having adequate space in the GUI.
2. At one time there was discussion (few years ago) that many of the system
names seem to confuse users and long term, we might try to wean them away,
so you only deal with them when creating things.
3. Some users enter some very long user names. Combining that with long
system names makes for awkward displays.

#1 is a clear impact on the GUI, some of them do not have enough space for
some of the user names let alone the system name too. Granted this might
point to trying to give users better guidance on how to form meaningful and
fitting user names. But how well that goes is not very predictable. I recall
working with one user and the issue was many user names over 20+ char long,
and the significant part was at the end, not the head. Picking correctly was
difficult. But I don't recall how many release cycles have passed since
then.

Main feature of showing both the user and system name is being able to spot
when they are not the right combo. Case is a user name was assigned to the
wrong system name and until seeing that listing of them together does it
become noticed. Granted this usually depends on remembering what the
underlying system values were from when it was created. Not something
frequently happening.

That's what comes to mind right now.

-Ken Cameron, Member JMRI Dev Team
www.jmri.org
www.fingerlakeslivesteamers.org
www.cnymod.org
www.syracusemodelrr.org


whmvd
 

Bob,

Why not make it a preferences setting? One size so often does not fit all... Four radio buttons:
1 User name
2 System name
3 1 then (2) = default
4 2 then (1)
With similar cleverness about missing user names added in as now.

I would be happy with 1, as I'm religious about user names, and would like that option. Many would not.

If there's reworking involved, might as well go the whole hog.



On Sun, 28 Jun 2020, 02:22 Bob Jacobsen, <rgj1927@...> wrote:
Short form:  The JComboBoxes used to select named beans (sensor, turnout, signal mast, etc) in the JMRI GUI use two different conventions.

Many, perhaps most, use the DISPLAYNAME convention:  "Display the user name; if the user name is null or empty, display the system name.”  Example: 


Note that the bottom three are showing their user names, and the list has been sorted by what’s displayed.

But a few use the USERNAME_SYSTEMNAME convention:  "Display the user name followed by the system name in parenthesis. If the user name is null or empty, display the system name without parenthesis.”  Example:


Here, the user names are always followed by the system name. (That doesn’t affect the sort order, as it’s always behind the user name)

It seems jarring to me to switch back and forth between these.  I would like to standardize on one format for JMRI’s selection combo boxes.

1) Is there any reason these should be so different?

2) If we’re to standardize on one, which one?  What are the arguments for one vs the other? 

Bob

Bob Jacobsen
rgj1927@...





Dan Boudreau
 

UserName (SystemName) convention works for me.

 

Dan

 

From: Randall Wood via groups.io
Sent: Saturday, June 27, 2020 9:41 PM
To: jmri@jmri-developers.groups.io
Subject: Re: [jmri-developers] Toward a common bean-selection GUI

 

 



On 27-Jun-2020, at 21:22, Bob Jacobsen <rgj1927@...> wrote:

 

Short form:  The JComboBoxes used to select named beans (sensor, turnout, signal mast, etc) in the JMRI GUI use two different conventions.

 

Many, perhaps most, use the DISPLAYNAME convention:  "Display the user name; if the user name is null or empty, display the system name.”  Example: 

 

<PastedGraphic-1.png>

 

Note that the bottom three are showing their user names, and the list has been sorted by what’s displayed.

 

But a few use the USERNAME_SYSTEMNAME convention:  "Display the user name followed by the system name in parenthesis. If the user name is null or empty, display the system name without parenthesis.”  Example:

 

<PastedGraphic-2.png>

 

Here, the user names are always followed by the system name. (That doesn’t affect the sort order, as it’s always behind the user name)

 

It seems jarring to me to switch back and forth between these.  I would like to standardize on one format for JMRI’s selection combo boxes.

 

1) Is there any reason these should be so different?

 

I can think of no reason not to be consistent.



2) If we’re to standardize on one, which one?  What are the arguments for one vs the other?

 

I would prefer the USERNAME SYSTEMNAME convention; it will clearly show if a NamedBean has a UserName that matches the SystemName of another NamedBean (I think ProxyManagers can return a set of NamedBeans like that).



Bob


Bob Jacobsen
rgj1927@...


 

 

 


Dave Sand
 

I prefer the user name version.  The combined names can get really long, which can create window layout problems.

Here is a portion of a typical LE tool bar:

This layout uses LCC which has really long system names.  I have removed the user name from one of them.

Now if the sensor icon combo was user name (system name) it would be even worse.  Apply that to all the combo boxes and the layout falls apart.

I have seen some of the 30+ character user names that Ken mentions.

Dave Sand


Bob Jacobsen
 

I’d prefer not to work on making it a preferences setting. That’ll spread complexity across the code, help files, etc. A complete solution would take much more time than I’m willing to spend on this.

Of course, if somebody wants to provide a _complete_ solution as a PR, I can see that as a contribution.

Bob

On Jun 28, 2020, at 12:06 AM, whmvd <@WouterVanDoorn> wrote:

Why not make it a preferences setting? One size so often does not fit all... Four radio buttons:
1 User name
2 System name
3 1 then (2) = default
4 2 then (1)
With similar cleverness about missing user names added in as now.

Bob Jacobsen
@BobJacobsen


Randall Wood <rhwood@...>
 

On 28-Jun-2020, at 14:02, Bob Jacobsen <@BobJacobsen> wrote:

I’d prefer not to work on making it a preferences setting. That’ll spread complexity across the code, help files, etc. A complete solution would take much more time than I’m willing to spend on this.

Of course, if somebody wants to provide a _complete_ solution as a PR, I can see that as a contribution.

Bob

On Jun 28, 2020, at 12:06 AM, whmvd <@WouterVanDoorn> wrote:

Why not make it a preferences setting? One size so often does not fit all... Four radio buttons:
1 User name
2 System name
3 1 then (2) = default
4 2 then (1)
With similar cleverness about missing user names added in as now.
Any option has to be able to deal with the following two scenarios:

- Multiple beans can have the same user name (a Manager is responsible only for ensuring uniqueness among the NamedBeans it manages)
- A bean has the same user name as another bean’s system name (a Manager is responsible only for ensuring uniqueness among the NamedBeans it manages; were any “global” Manager created, it would have to gracefully handle a device being added by a system connection)


Bob Jacobsen
@BobJacobsen







Ken Cameron
 

Randall,

Where or why would you mix beans from multiple managers? Is there somewhere
we do that now? It doesn't sound wise or useful to me to present a mixed
list, if anything else just to avoid these issues. Please explain.

-Ken Cameron, Member JMRI Dev Team
www.jmri.org
www.fingerlakeslivesteamers.org
www.cnymod.org
www.syracusemodelrr.org


Randall Wood <rhwood@...>
 

You mix beans from two different managers when you have a connection to a layout (e.g. when you have a LocoNet connection, the default TurnoutManager is a ProxyTurnoutManager that proxies an InternalTurnoutManager and a LocoNetTurnoutManager).

There are issues filed against JMRI for not handling this scenario well in ComboBoxes on GitHub because it came up on the users list.

Randall

On Jun 29, 2020, at 11:22, Ken Cameron <@KenC57> wrote:

Randall,

Where or why would you mix beans from multiple managers? Is there somewhere
we do that now? It doesn't sound wise or useful to me to present a mixed
list, if anything else just to avoid these issues. Please explain.

-Ken Cameron, Member JMRI Dev Team
www.jmri.org
www.fingerlakeslivesteamers.org
www.cnymod.org
www.syracusemodelrr.org






Bob Jacobsen
 

Could you point me to those issues?

There’s code in there to prevent creation and renaming operations that result in duplicate names via ProxyManagers. But perhaps it’s not working or we’ve missed a creation/renaming case.

Thanks!

Bob

On Jun 29, 2020, at 8:42 AM, Randall Wood via groups.io <rhwood=mac.com@groups.io> wrote:

You mix beans from two different managers when you have a connection to a layout (e.g. when you have a LocoNet connection, the default TurnoutManager is a ProxyTurnoutManager that proxies an InternalTurnoutManager and a LocoNetTurnoutManager).

There are issues filed against JMRI for not handling this scenario well in ComboBoxes on GitHub because it came up on the users list.

Randall
On Jun 29, 2020, at 11:22, Ken Cameron <@KenC57> wrote:

Randall,

Where or why would you mix beans from multiple managers? Is there somewhere
we do that now? It doesn't sound wise or useful to me to present a mixed
list, if anything else just to avoid these issues. Please explain.

-Ken Cameron, Member JMRI Dev Team
www.jmri.org
www.fingerlakeslivesteamers.org
www.cnymod.org
www.syracusemodelrr.org






Bob Jacobsen
@BobJacobsen


Randall Wood <rhwood@...>
 

On 29-Jun-2020, at 14:22, Bob Jacobsen <@BobJacobsen> wrote:

Could you point me to those issues?

There’s code in there to prevent creation and renaming operations that result in duplicate names via ProxyManagers. But perhaps it’s not working or we’ve missed a creation/renaming case.

Thanks!

Bob

On Jun 29, 2020, at 8:42 AM, Randall Wood via groups.io <rhwood=mac.com@groups.io> wrote:

You mix beans from two different managers when you have a connection to a layout (e.g. when you have a LocoNet connection, the default TurnoutManager is a ProxyTurnoutManager that proxies an InternalTurnoutManager and a LocoNetTurnoutManager).

There are issues filed against JMRI for not handling this scenario well in ComboBoxes on GitHub because it came up on the users list.

Randall
On Jun 29, 2020, at 11:22, Ken Cameron <@KenC57> wrote:

Randall,

Where or why would you mix beans from multiple managers? Is there somewhere
we do that now? It doesn't sound wise or useful to me to present a mixed
list, if anything else just to avoid these issues. Please explain.

-Ken Cameron, Member JMRI Dev Team
www.jmri.org
www.fingerlakeslivesteamers.org
www.cnymod.org
www.syracusemodelrr.org






Bob Jacobsen
@BobJacobsen







Bob Jacobsen
 

Thanks! I misunderstood your point. I thought you were referring to being able to set the same user name in two different systems, i.e. “My User Name” on LT1 and IT1, without the code preventing it.

#8503 is about buggy display when having the same string for a system name and user name of different beans. This is just a bug. There’s conceptually nothing that prevents a user name from being the same as a system name. They’re not in the same space. (As they should be; anybody who suggests changing that needs to spend some time thinking through the various cases, particularly with creating and renaming beans over time)

I think the bug in #8503 is due to the NamedBeanComboBox not properly handling that, see the comments there. But since no fix has been implemented, I can’t be 100% sure of that. I’ll include it with setting the default order once we settle on one.

It does say that the visual presentation in the combobox needs to distinguish these two:

provideTurnout(“IT1”, “IT3”)
provideTurnout(“IT3”)

The DISPLAYNAME format would list them both as IT3; which may be a problem (although perhaps the answer is “don’t do that, it’s confusing in many other ways too)

The USERNAME_SYSTEMNAME format would list them as

IT3 (IT1)
IT3

(For e.g. an LCC example with a 30-character user name, that first line would be much longer,)

Bob


On Jun 30, 2020, at 1:48 AM, Randall Wood via groups.io <rhwood=mac.com@groups.io> wrote:

https://github.com/JMRI/JMRI/issues/8503

On 29-Jun-2020, at 14:22, Bob Jacobsen <@BobJacobsen> wrote:

Could you point me to those issues?

There’s code in there to prevent creation and renaming operations that result in duplicate names via ProxyManagers. But perhaps it’s not working or we’ve missed a creation/renaming case.

Thanks!

Bob

On Jun 29, 2020, at 8:42 AM, Randall Wood via groups.io <rhwood=mac.com@groups.io> wrote:

You mix beans from two different managers when you have a connection to a layout (e.g. when you have a LocoNet connection, the default TurnoutManager is a ProxyTurnoutManager that proxies an InternalTurnoutManager and a LocoNetTurnoutManager).

There are issues filed against JMRI for not handling this scenario well in ComboBoxes on GitHub because it came up on the users list.

Randall
On Jun 29, 2020, at 11:22, Ken Cameron <@KenC57> wrote:

Randall,

Where or why would you mix beans from multiple managers? Is there somewhere
we do that now? It doesn't sound wise or useful to me to present a mixed
list, if anything else just to avoid these issues. Please explain.

-Ken Cameron, Member JMRI Dev Team
www.jmri.org
www.fingerlakeslivesteamers.org
www.cnymod.org
www.syracusemodelrr.org






Bob Jacobsen
@BobJacobsen









Bob Jacobsen
@BobJacobsen