Tracking Views

Discuss issues and ideas you have to configuring displays with PowerVision
andymartyn
Posts: 25
Joined: Wed Oct 29, 2014 4:51 am

Tracking Views

Post by andymartyn » Tue Jul 07, 2015 9:17 am

PV780
PowerVision: 2.7.10475

I am looking at the CPU usage for screens and I have determined that some of my overlays are increasing the CPU to over 60%. Whilst I realise this leaves some capacity it is higher than I would like so am looking to improve this.

One particular overlay that has a fair number of gauges, I put it in an overlay because it easily enables you to navigate to it from any view and then easily return to the previous view in effect. I moved it to the main layer and it dropped to 30 - 35% so quite a saving. So what I need is a straight-forward way to keep track of screens so I can move this overlay into the main layer and then upon closing it (button press) return to the previous screen. Is there a easy way to do this?

Thanks,
Andy
stalley
Enovation Controls Development
Enovation Controls Development
Posts: 618
Joined: Tue Mar 18, 2014 12:57 pm

Re: Tracking Views

Post by stalley » Thu Jul 09, 2015 7:26 am

Hi Andy,

This is an idea from one of our developers here at Enovation Controls.
What I do is make a variable that holds a value for each view in the main layer and I change the value every time I show a new view using the Advanced Page View Properties.

Then you can have a multi decision block in an activity to show the last view based on the value of the variable.

The last time I did it I actually used a script so I could put all the view IDs in an array.

Code: Select all

uint[] viewID = {
	PageViewIDs.Main_Layer_Blank_Page,
	PageViewIDs.Main_Layer_Home_Page_View,
	...	
};

void $SC_mainLayer_return$ () 
{
	int mainLayer = -1;
	
	smRead( VariableIDs.mainLayer, mainLayer );
	
	if( mainLayer > 0 && mainLayer < viewID.length() )
	{
		SendAction( ApplicationIDs.UIApp, ActionIDs.UIApp_Show_View, viewID[ mainLayer ] );
	}
}
Hope this help gets you started.
Sara Talley
Software Engineer
Enovation Controls