Interroga Posted April 30, 2018 Report Share Posted April 30, 2018 Hi, How to function the layer in HMI screen? Is it possible to change visible images with layer? Quote Link to comment Share on other sites More sharing options...
Saragani Posted April 30, 2018 Report Share Posted April 30, 2018 No, The Layer is just a feature for creating layered UI (for example, you an element above another element). This feature allows you to hide a specific layer, so then you can see and edit the elements behind it. Feature like this exists in Siemens Step 7, Photoshop, and other UI designing softwares. You cannot control the layer visibility in code. If you want to do that, then you can submit a feature request and maybe it will be implemented in the future. For now, you can place the elements you want, inside a Custom Control, and use that custom control inside your screen. Then you can hide the entire custom control by linking it to a visibility bit. Quote Link to comment Share on other sites More sharing options...
Interroga Posted May 7, 2018 Author Report Share Posted May 7, 2018 ok , tks for explanation. I would like this tool for layer control, if possible. Regards. Mauro Quote Link to comment Share on other sites More sharing options...
Saragani Posted May 8, 2018 Report Share Posted May 8, 2018 Please try to be specific with information / definition like: * How you define the initial state of the layers visibility for a screen when it loads (where you define it and how? Note: this is not possible with Custom Controls, since they have layers too, so if placed in a screen, then there would be layers inside layers (so controlling visibility would affect only the screen). * How would you change the visibility for one or more layers when after a screen already loaded. I can't promise that it will be added to the features list (but it is worth trying) Quote Link to comment Share on other sites More sharing options...
Interroga Posted May 9, 2018 Author Report Share Posted May 9, 2018 * How would you change the visibility for one or more layers when after a screen already loaded. A: I use bollean variable in each layer, or put one index for active through value... Quote Link to comment Share on other sites More sharing options...
Saragani Posted May 9, 2018 Report Share Posted May 9, 2018 OK. But the index suggestion makes it that only one layer is visible (and this most likely not the case when people use layers). Some people use the layer in order to make a Message Box (or a popup window). It pops over the screen content, while the content below stays visible. Defining a set to Booleans (in this case 8), also requires a lot of Boolean tags to be defined, and it is hard to handle. Here is my suggestion (I'm still not saying that it will be implemented, it is just a suggestion). Each screen will have an optional tag, which is a "bitmap" of the visible layers. Assuming there are only 8 layers, then an 8 bit number is enough. If that tag is not set, or it's value is -1 (on a signed Int 8), or 255 (on an unsigned int 8), then all layers are visible. Value = 0 means no layer is visible (since all bits are 0). 1 -> Layer 0 is visible 2 -> Layer 1 is visible 3 -> Layer 0 and 1 are visible (Each layer visibility is depended on the value of the related bit in that tag value). This makes it easy enough to handle and understand without defining a start state and several other states that you defines the layers visibility. What do you think? Quote Link to comment Share on other sites More sharing options...
curtharrington1 Posted June 9, 2021 Report Share Posted June 9, 2021 On 5/9/2018 at 3:24 AM, Saragani said: OK. But the index suggestion makes it that only one layer is visible (and this most likely not the case when people use layers). Some people use the layer in order to make a Message Box (or a popup window). It pops over the screen content, while the content below stays visible. Defining a set to Booleans (in this case 8), also requires a lot of Boolean tags to be defined, and it is hard to handle. Here is my suggestion (I'm still not saying that it will be implemented, it is just a suggestion). Each screen will have an optional tag, which is a "bitmap" of the visible layers. Assuming there are only 8 layers, then an 8 bit number is enough. If that tag is not set, or it's value is -1 (on a signed Int 8), or 255 (on an unsigned int 8), then all layers are visible. Value = 0 means no layer is visible (since all bits are 0). 1 -> Layer 0 is visible 2 -> Layer 1 is visible 3 -> Layer 0 and 1 are visible (Each layer visibility is depended on the value of the related bit in that tag value). This makes it easy enough to handle and understand without defining a start state and several other states that you defines the layers visibility. What do you think? HMI screen should have a generic structure which should include the following: isActive bit isLocked bit Hide_Layer[MAX_LAYERS] array of bits Layer_Opacity[MAX_LAYERS] array of integers isHourGlass bit This struct would ideally be configurable from the HMI properties screen or be an array of structs. I know you can't define an array of structs but it would be nice if you could Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.