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

Display: Move IP address and port to the same line #151

Open
FrightRisk opened this issue May 18, 2021 · 4 comments
Open

Display: Move IP address and port to the same line #151

FrightRisk opened this issue May 18, 2021 · 4 comments
Assignees
Labels
Enhancement New feature or request

Comments

@FrightRisk
Copy link
Member

FrightRisk commented May 18, 2021

image

@FrightRisk FrightRisk added the Enhancement New feature or request label May 18, 2021
@FrightRisk
Copy link
Member Author

FrightRisk commented May 18, 2021

in EthernetInterface.cpp

//LCD(4,F("IP:%d.%d.%d.%d"), ip[0], ip[1], ip[2], ip[3]);
//LCD(5,F("Port:%d"), IP_PORT);

LCD(3, F("%d.%d.%d.%d:%d"), ip[0], ip[1], ip[2], ip[3], IP_PORT);

Or is this the correct way:

"#define MAX_MSG_SIZE 20" to config.h to extend the width from 16.
So compile time test for 20 lines could allow the alternate display to be made - for example

#if defined(MAX_MSG_SIZE) && MAX_MSG_SIZE > 18
LCD(3, F("%d.%d.%d.%d:%d"), ip[0], ip[1], ip[2], ip[3], IP_PORT);
#else
LCD(4,F("IP:%d.%d.%d.%d"), ip[0], ip[1], ip[2], ip[3]);
LCD(5,F("Port:%d"), IP_PORT);
#endif

@Neil-McK
Copy link
Contributor

Neil-McK commented May 19, 2021 via email

@tz3p9v
Copy link

tz3p9v commented May 20, 2021

The compile time test of MAX_MSG_SIZE does check for size of display as MAX_MSG_SIZE = 20 is defined in config.h as the size of the display -- true max IP and Port could be 21. So test could be added to ensure display length < MAX_MSG_SIZE, but would need to be run-time. As typical display is 18 as shown in picture of my display, I suggest no need for run time test. User can correct by removing MAX_MSG_SIZE from config.h, which will default to 16 and a two line display.

@FrightRisk
Copy link
Member Author

There's always a caveat ;) What do you think Neil?

daniviga pushed a commit to daniviga/CommandStation-EX that referenced this issue Mar 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants