Current page for Scripting

Discuss issues and ideas you have to configuring displays with PowerVision
drphil69
Posts: 139
Joined: Wed Mar 02, 2011 5:59 pm

Current page for Scripting

Post by drphil69 » Tue May 10, 2011 9:59 am

hello,

I am trying to show a warning on a screen when a variable changes from 0 to 1 but only if user is on that particular screen, i.e. I do not want to jump to the screen. The warning is to be a red square behind the text, and if possible I would like it to "blink." (So IF (user on view X) AND (var = 1) THEN (show view Y).

Initially I tried using a Lamp Gauge, thinking this would be easy - however, I cannot "send to back" for the Lamp Gauge. i.e. the text gets covered by the red square, and it appears that it is not possible to have that behind the text. (If this worked it would be trivial to do what I want).

So I think I need to use a script - which means I need to see the variable change from 0 to 1 AND current view has to be "Aux Fns View." I do not know how to reference this using scripts or any other way to work it in. I tried looking at the standard PV750 configuration (w/J1939), but the page changing scripts were much more complex that I am using - I just use button pushes to navigate from page to page directly. The "Scripting Guide" is not any help with this.

Thanks!
Phil
bseidl

Re: Current page for Scripting

Post by bseidl » Tue May 10, 2011 10:58 am

Hi drphil69

One way you could do it is look at the variable when the user goes to the page, rather than reacting when the variable changes. So when a user goes to page x, you look at the variable, if it's 1 then you display the warning.

To make the red square blink, you can use a state machine that uses timers to show and hide the square. This can be integrated with the state machine that looks at the variable when the user goes to page x to determine if the warning should be shown.

Let us know if you have any other questions. Thanks!

Brad Seidl
Test Engineer
FW Murphy
ksaenz
Enovation Controls Development
Enovation Controls Development
Posts: 263
Joined: Thu Aug 19, 2010 7:53 am

Re: Current page for Scripting

Post by ksaenz » Tue May 10, 2011 12:49 pm

Hi drphil69,

I think you can still make it work with the lamp gauge if you want to.

The reason why the lamp gauge covers the text is probably because the lamp gauge is "dynamic" and the text widget is not.

If you check the "dynamic" box for the text widget you should be able to bring it in front of the lamp gauge. Lamp gauges need to stay "dynamic".

Regards,

ksaenz
drphil69
Posts: 139
Joined: Wed Mar 02, 2011 5:59 pm

Re: Current page for Scripting

Post by drphil69 » Fri May 13, 2011 11:31 am

Thanks! I used ksaenz' solution since it was easy!

Phil