Alternate containers

Hello,

I am a new user and I am looking to have a part of the screen (see example red containers) that should completely switch every 10 seconds. The containers contain text as well as OPC tags. So, to summarize, the red (2 containers) I call them A-B and C-D should appear on the screen for 10 seconds as A-B, then 10 seconds as C-D, and then back to 10 seconds as A-B, and so on. Since I am new, I am posting this question here and hopefully someone can help with this?

Its not the complete screen just a part of the screen!

Thanks in advance,
Geert

Flex repeater in carousel component would probably work. Flex repeater would show the two instances per 'page' of the carousel. Carousel would handle the switching of views every 10s.

Edit: Got me with the mention of container, thought it was perspective.

Assuming A,B,C &D are all the same display with just different tags bound to the data displays, make a single template and use indirect bindings. Then, have the red area be one template repeater with two instances of your template, and then use a timer component to manage the parameters dataset change on the repeater.

If they are not the same basic view/display, then you would need to use a template canvas and again, utilize a timer to swap driving datasets every 10s.

Use a flex column view that contains the 4 rows in your picture. Nest a flex row container as the 3rd row in your picture, the container will include two embedded views inside it.

For each embedded view, create a binding to the viewPath that changes based on whatever conditions you want, such as a timer.

For something with this level of logic, I'd suggest doing the embedded viewPath bindings as custom properties within your parent view, and put your expressions and any supporting expressions there. e.g. view.custom.embed1ViewPath and view.custom.embed2ViewPath. Then inside your embedded views, you do a property binding to those view custom properties.

@ryan.white / @msteele, the question is tagged as Vision, not Perspective. Oops?

1 Like

The simplest solution to this problem in Vision is to just have both sets of containers on the screen and bind their visible property to some toggling bit.

For example:

  1. Add a custom property to the root container of boolean type.
  2. Add an expression binding:
    getSecond(now(1000)) % 20 >= 10
    
    This will, every one second (1000ms) get the current integer second (0-59), divide it by 20 keeping the remainder (so instead of 0-60, you get 0-19, 0-19, 0-19 per minute), and then check whether that value is greater than or equal to 10. Thus, every ten seconds the output will swap from true to false and back.
  3. Bind your container's visible property to this custom property. If you want, you could even put AB and CD in a distinct container, and bind that container's visible property.
  4. Set the root container's Combine Repaints property true, so that toggling both components visible status at once doesn't cause unpleasant flashing.

ContainerSwitch.zip (4.6 KB)