Jump to content

Scaling problem in LV8


Mads

Recommended Posts

Controls are scaled "live" in LV8, they do not wait until you have released the window handle (the grab handle is not there anymore by the way...consistent with the OS so that's good).

The algorithm behind seems to have a bug though...just widen the attached VI front panel and you'll see that the controls will expand too much to the right and move outside the visible front panel...This did not happen in LV7.1.

Download File:post-1777-1130421408.vi

Link to comment

Part of the problem here is that LabVIEW uses integer calculations when scaling. These round to the nearest pixel. I usually set a dominant control to "scale object with pane", and let the other controls move along with it.

However. repeatedly resizing a front panel causes the controls and indicators to slowly creep in random-walk fashion as the rounding errors accumulate, particularly when resizing by small increments so that the nearest-pixel rounding error is large relative to the scaling movement.

As you noticed, under LabVIEW 8 the scaling already happens while dragging the window corner or border, before releasing it. Thus, what used to be a single scaling event with typically a large size difference, and thus relatively small rounding errors, has been turned in many small scaling events, with lots of relatively large rounding errors. Thus the problem becomes visually detectable much sooner than before.

Obviously, all this could have been avoided by using a (hidden/internal) floating-point representation for the control positions. That this has been plaguing LabVIEW for at least three releases, and has just been made much worse, boggles the mind.

Link to comment

This is not a problem specific to LV8. This is a general problem that has been there for many revisions. You have grouped two front panel controls and decided to scale them. You can't do this. You can only enable scaling on a single front panel control. Ungroup the controls and enable scaling on the large top text box. You will see that the scaling works properly without drifting. Here is another thread on some more front panel scaling tips:

http://forums.lavausergroup.org/index.php?showtopic=1717

Link to comment

I wonder if this could be solved by storage of the baseline/default control sizes, locations, layout, etc. Then scaling could be done on the fly, but always with the ability to restore to defaults. I would think a nifty subVI with this built in that manages its caller, or a given VI reference would be very useful. I once did something like this just for a subset of the characteristics of booleans about 3-4 versions ago, but never as general as an all purpose FP manager.

Has anyone done anything like this?

Link to comment
I wonder if this could be solved by storage of the baseline/default control sizes, locations, layout, etc. Then scaling could be done on the fly, but always with the ability to restore to defaults.

That'd be an even better solution: no rounding errors (not even small ones) can accumulate that way.

I would think a nifty subVI with this built in that manages its caller, or a given VI reference would be very useful. I once did something like this just for a subset of the characteristics of booleans about 3-4 versions ago, but never as general as an all purpose FP manager.

Has anyone done anything like this?

Not that I know of. But really, layout management should be built into LabVIEW. Modern widget toolkits all handle that task for the programmer, and often allow selection of the layout management policy. See for example here .

Link to comment
This is not a problem specific to LV8. This is a general problem that has been there for many revisions. You have grouped two front panel controls and decided to scale them. You can't do this. You can only enable scaling on a single front panel control. Ungroup the controls and enable scaling on the large top text box. You will see that the scaling works properly without drifting. Here is another thread on some more front panel scaling tips:

http://forums.lavausergroup.org/index.php?showtopic=1717

Well that's the thing you see - you can (obviously) and you should be able to (off course, it's 2005 after all!).

It might be there in LV7 as well. I tried recreating the problem in 7.1.1 and could not get it to happen, maybe it is possible to get the same problem there, but at least it was more difficult...;-)

No matter what angle you see it from it is still a bug. I've made the same mistake myself when doing rescaling by code, if you use the original size of the controls and the front panel as fixed references to calculate your scaling factor you can avoid the problem.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.