PLUS+1 User Forum

PLUS+1 Software => Displays => Topic started by: andslat on January 25, 2019, 02:09:43 AM

Title: Multiple screens for DP570
Post by: andslat on January 25, 2019, 02:09:43 AM
I am trying to have 7 different screens for the monitor. One main menu screen plus 6 screens that you navigate to via one of the 6 buttons. When I go to one of the sub screens, I don't want to be able to switch to another screen from there. I want to disable the code to switch to any other screen so that I can use the buttons for new things in that sub screen. The button I used to get to one screen will be the button that takes me back to the main screen. I hope that all makes sense. Here is my sample code for trying to switch to any screen and then disable them.
Title: Re: Multiple screens for DP570
Post by: acmall on January 25, 2019, 10:15:46 AM
While you could make your code work I think it will be difficult to scale and maintain.

I would suggest taking a different approach of assigning each screen an ID and putting a variable containing the ID of the active screen on a bus. You can then compare the screen ID with the active screen ID and show the screen if they match. This allows grouping the logic for each screen and will also make it easier to have different functions for the buttons on each screen as you can test if the screen is active in the button logic. Value Connect components can be used to set the variable for the active screen from anywhere in the application making it easy to switch screens.

You could also take this a stage further and have screen groups where screen share the same button functions. The concept would be the same where each group has an ID and the active group ID is stored in a variable on the same bus as the active screen ID

Here are a few screens captures that will hopefully show the idea.
Title: Re: Multiple screens for DP570
Post by: jashom1 on February 05, 2019, 12:30:35 AM
Acmall has shown an excellent way to control screens, I use this method with a slight twist by adding constants and signal names to stop any confusion switching between lots of screens.