LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Panel ATTR_HEIGHT limitation

I am using LabWindows/CVI version 7.1 My application populates a panel with a bunch of string controls at run time. The panel is scrollable so the operator only sees a fraction of the controls at a time. The spacing between the controls on the panel is 16 pixels, so at 2048 controls I exceed the panel ATTR_HEIGHT limit of 32767 pixels (eg 2048 * 16 = 32768).  How can I get around this limit? Or do you have another suggestion for doing what I am trying to do?
 
Thanks,
Jim Vander Werp
Smiths Aerospace
Grand Rapids, MI
0 Kudos
Message 1 of 6
(3,496 Views)

Rather than have a huge panel which is scrollable, can you not have a scrollable list control which contains all your strings but only shows a reasonable number at any one time? I've used list controls with over 7 thousand lines without difficulty - I don't know if there is a limit.

JR

0 Kudos
Message 2 of 6
(3,494 Views)

Hi JR,

Thanks for your reply. I have used list controls before but I'm not sure that it will work in this case. I left out some of the details in my original message. On my scrollable panel I populate it with 2 controls on each line: a text box control and a text message control. The operator can scroll down through the lines and edit and change the values in the text box controls. I don't think this would be very easy to implement using the list control. Let me give you an example of what would be on a single display line on the panel:

Airspeed  120.5 Knots

The airspeed and its associated value is the text box control. The text message control just displays the units associated with the parameter. The operator is allowed to edit the value. So he could scroll the panel until he found the airspeed line and then change its value to 100 knots for example. If there is a way to implement this with a list control then I'm not smart enough to figure out how to do it.

Thanks,
Jim

 

 

0 Kudos
Message 3 of 6
(3,493 Views)
Hi Jim.

You could try this approach:
  • Set the panel size to fit within the display area.
  • Populate it with 3 columns of controls (string, numeric, string). Use however many rows (nRows) look good.
  • Place a vertical Toolslib scrollbar control on one side (see the ScrollSample project).
  • Store all your values in a list (see ListCreate(), etc in Programmer's Toolbox). Each item in the list would hold the name, value and units of one variable, and whatever else you might need.
  • Populate the list when your app starts. The data could be held in an "ini" file (see the CVI IniFile instrument driver), or a regular text file.
  • At the appropriate time, display the first nRows of data on the panel, and set the scrollbar properties appropriately.
  • When the user operates the scrollbar, update all the data controls with the appropriate range of values from the list.
  • Store any changes back into the list.
  • On exit, or whenever, regenerate the data file on disk with the current data.
Good luck.

Regards,
Colin.
Message 4 of 6
(3,474 Views)
Hi Colin,
 
I like your idea. It's a whole different way of looking at the problem. I don't even have to create a list because all of the parameter data is already stored in an internal data structure in my application. As the operator changes a parameter value the corresponding value in my data structure is updated in the control callback function. All I have to do is keep track of which parameters in the structure are currently visible then as the operator changes a value in one of the controls make sure that it updates the correct parameter value in the structure, and repopulate the controls on the panel from the data structure as the operator moves the scroll bar. There are a number of other details to work out since the panel is re-sizable by the operator but I like the concept.
 
Thanks,
Jim
0 Kudos
Message 5 of 6
(3,466 Views)
Hi Jim.

Glad I could help. 🙂

Cheers,
Colin.
0 Kudos
Message 6 of 6
(3,460 Views)