¿ªÔÆÌåÓý

Locked Problem with leading spaces in a sensor "username".


 

I noticed the following message in the console log and went to remove the ¡°leading¡± space but was unable to do so.

2017-06-18 08:57:57,856 util.Log4JUtil INFO - * JMRI log ** [main]
2017-06-18 08:57:57,950 util.Log4JUtil INFO - This log is appended to file: C:\Users\Marshall\JMRI\log\messages.log [main]
2017-06-18 08:57:57,950 util.Log4JUtil INFO - This log is stored in file: C:\Users\Marshall\JMRI\log\session.log [main]
2017-06-18 08:57:57,965 apps.Apps INFO - PanelPro version 4.7.6+R570b2bc starts under Java 1.8.0_131 on Windows 7 x86 v6.1 at Sun Jun 18 08:57:57 GMT-07:00 2017 [main]
2017-06-18 08:58:10,586 profile.ProfileManagerDialog INFO - Automatically starting with profile SMRHSno_panel_loading.3cf92188 after timeout. [AWT-EventQueue-0]
2017-06-18 08:58:10,679 apps.Apps INFO - Starting with profile SMRHSno_panel_loading.3cf92188 [main]
2017-06-18 08:58:11,522 node.NodeIdentity INFO - Using jmri-4494FCE7B905-3cf92188 as the JMRI Node identity [main]
2017-06-18 08:58:12,052 simulator.SimulatorAdapter INFO - NCE Simulator Started [Nce Simulator]
2017-06-18 08:58:12,083 nce.NceConnectionStatus INFO - NCE EPROM revision = 6.2.1 [AWT-EventQueue-0]
2017-06-18 08:58:14,829 hexfile.LnHexFilePort INFO - LocoNet Simulator Started [Thread-12]
2017-06-18 08:58:19,478 util.FileUtilSupport INFO - File path program: is C:\Program Files\JMRI\ [main]
2017-06-18 08:58:19,493 util.FileUtilSupport INFO - File path preference: is C:\Users\Public\JMRI\ [main]
2017-06-18 08:58:19,493 util.FileUtilSupport INFO - File path profile: is C:\Users\Marshall\JMRI\SMRHSno_panel_loading\ [main]
2017-06-18 08:58:19,493 util.FileUtilSupport INFO - File path settings: is C:\Users\Marshall\JMRI\ [main]
2017-06-18 08:58:19,493 util.FileUtilSupport INFO - File path home: is C:\Users\Marshall\ [main]
2017-06-18 08:58:19,493 util.FileUtilSupport INFO - File path scripts: is C:\Users\Public\JMRI\MyScripts\ [main]
2017-06-18 08:58:42,519 xml.AbstractNamedBeanManagerConfigXML WARN - Requested user name " Initialize Town Turnouts" for system name "ISTOWNTO" was normalized to "Initialize Town Turnouts" [AWT-EventQueue-0]

Because JMRI ¡°normalized¡± the username by removing the leading space in memory, I was unable to correct this by editing the sensor in the sensor table. I fixed it by using a text editor.

How would you remove leading ¡°space(s)¡± using JMRI tools? And are leading spaces not allowed in usernames and system names?
This username ¡° Initialize Town Turnouts¡± has been in this panel file for about 3 years and this is the first time I have seen this warning message.

Marshall

[Non-text portions of this message have been removed]


 

Marshall,

I could be wrong but if JMRI normalized the name when the panel started, the panel should have worked the same. All you would need to do is save the panel to retain the change.

A developer may correct me or expand on it.

Peter


 

Peter,

Yes, the panel worked the same. The solution was so simple I didn¡¯t even consider it.
Saving the panel removed the leading spaces. Something to remember in the future
should I see the ¡°normalize¡± warning message again.

Thanks,

Marshall

From: mailto:jmriusers@...
Sent: Sunday, June 18, 2017 9:24 AM
To: jmriusers@...
Subject: [jmriusers] Re: Problem with leading spaces in a sensor "username".


Marshall,

I could be wrong but if JMRI normalized the name when the panel started, the panel should have worked the same. All you would need to do is save the panel to retain the change.

A developer may correct me or expand on it.

Peter

[Non-text portions of this message have been removed]


 

Marshall,



After much debate we did add the 'normalizing' of names to remove leading
and trailing spaces. We had a history of finding and fixing users panels
where things didn't work right and it traced to where they had used a space
when entering the name one place and not the other, sometimes even 3
variants. But each would refer to a different object while the display would
barely show the space (trailing completely hidden by whitespace), making it
very unclear to the user why something didn't work right. And in the table
display, the sorting would usually not show them near each other so it was
very difficult to see.



-Ken Cameron, Member JMRI Dev Team

www.jmri.org

www.fingerlakeslivesteamers.org

www.cnymod.com

www.syracusemodelrr.org


 

Ken,

Thanks for the explanation. I now know how to fix the issue without using a text editor.
Did I miss this change in the Release notes?

Marshall

From: mailto:jmriusers@...
Sent: Monday, June 19, 2017 7:23 AM
To: jmriusers@...
Subject: RE: [jmriusers] Re: Problem with leading spaces in a sensor "username".


Marshall,

After much debate we did add the 'normalizing' of names to remove leading
and trailing spaces. We had a history of finding and fixing users panels
where things didn't work right and it traced to where they had used a space
when entering the name one place and not the other, sometimes even 3
variants. But each would refer to a different object while the display would
barely show the space (trailing completely hidden by whitespace), making it
very unclear to the user why something didn't work right. And in the table
display, the sorting would usually not show them near each other so it was
very difficult to see.

-Ken Cameron, Member JMRI Dev Team

www.jmri.org

www.fingerlakeslivesteamers.org

www.cnymod.com

www.syracusemodelrr.org

[Non-text portions of this message have been removed]





[Non-text portions of this message have been removed]


 

I checked and 7.4.2 was the beginning of it, but I think there were more
changes a bit later. But I'd ask if you think you see mention of it in the
notes. Sometimes what gets entered into the notes is not the best wording.
It may have made sense to the coder but not the user. If you think it isn't
mentioned in one of those, or was poorly worded, let us know.



-Ken Cameron, Member JMRI Dev Team

www.jmri.org

www.fingerlakeslivesteamers.org

www.cnymod.com

www.syracusemodelrr.org


 

Ken,

Again thanks. I read all the release notes for 4.7.x and didn¡¯t see anything regarding normalizing names that have leading space(s). Not sure if trailing spaces are included in the process.

Marshall

From: mailto:jmriusers@...
Sent: Tuesday, June 20, 2017 12:36 PM
To: jmriusers@...
Subject: RE: [jmriusers] Re: Problem with leading spaces in a sensor "username".


I checked and 7.4.2 was the beginning of it, but I think there were more
changes a bit later. But I'd ask if you think you see mention of it in the
notes. Sometimes what gets entered into the notes is not the best wording.
It may have made sense to the coder but not the user. If you think it isn't
mentioned in one of those, or was poorly worded, let us know.

-Ken Cameron, Member JMRI Dev Team

www.jmri.org

www.fingerlakeslivesteamers.org

www.cnymod.com

www.syracusemodelrr.org

[Non-text portions of this message have been removed]





[Non-text portions of this message have been removed]


 

Ken; This is the closest I find
"JMRI applications will not load a panel file that fails XML validation; an error will be shown that should explains the error, allowing it to be fixed using an editor. (The explanations remain a work in progress.)"
from

Walt


 

Walt & Ken,

The particular situation where JMRI ¡°normalizes¡± the ¡°user names¡± and maybe the ¡°system names¡± does not prevent the panel from being loaded. There is a ¡°WARN¡± message in the console log identifying the ¡°user name¡± or ¡°system name¡± that was normalized. No indication on how to permanently fix the issue. Now I know that the ¡°fix¡± is to save the panel OR as I did use an editor to fix the problem.

Marshall

From: mailto:jmriusers@...
Sent: Tuesday, June 20, 2017 10:23 PM
To: jmriusers@...
Subject: [jmriusers] Re: Problem with leading spaces in a sensor "username".


Ken; This is the closest I find
"JMRI applications will not load a panel file that fails XML validation; an error will be shown that should explains the error, allowing it to be fixed using an editor. (The explanations remain a work in progress.)"
from

Walt


[Non-text portions of this message have been removed]