03-20-2012 08:29 PM
I have a VI A that I programmatically place in a subpanel in a main VI. Meters on VI A are then made visible and then modified according to property parameters from an XML file. This is all done programmatically. The scale does not display properly for the HousingSize read from the XML file for meters.
If I call VI B to change the HousingSize of the meter to a new value and then again to the original value, the scale displays perfectly. What I mean by 'displays perfectly' is that the scale looks proportionally correct for the HousingSize. VI B changes HousingSize by setting a property node using the meter's CtrRef.
This behavior occurs on all computers (Windows XP).
What exactly (events, methods, property settings) is happening to make the scale change when the HousingSize changes?
03-21-2012 01:01 PM
Hi there, seems to me that you need to work on the parameters from the XML file for VI A. Another piece of advice, if you believe is something from the code itself take a look at the shipping examples, just open the NI Example Finder and search for "subpanels".
By the way, I don't find references of "HousingSize" under the subpanels class. If you can post the code to see what are you are talking about it would be of great help.
03-21-2012 07:07 PM
well I don't have code but enclosed are some screen shots
03-23-2012 11:27 AM
I would suggest a simple test. Open a new VI, drop a Slide control and write the HousingSize to a XML file an then read it back. With this filtered to one simple and RAW VI you get the expected data? If not, it would be easier to debug and track the piece of code that needs a tweak. Remember that HousingSize is a cluster of two elements: Width & Height.
04-05-2012 05:39 PM
I'm sure it has to do with the meter housing and the scale object. Enclosed is a sample VI. If I change the house size, how can I keep the Scale correctly proportioned?
04-08-2012 11:56 PM
Hi faustina,
I was able to duplicate your issue of the scale and marker not adjusting proportionally to the meter while adjusting the dimensions of the housing programmatically. I can understand that your expectation for the scale and marker would be to adjust and center automatically. As you have no doubt seen, this happens as expected when adjusting the size of the meter in development mode. However, I will have to continue to research to see whether or not this is the intended behavior at runtime. In the meantime, I have a potential work around for you. You will have to do a couple of things:
1. The height and width of the housing has to remain at a constant ratio. I would use a multiplier and a constant to feed both the height and the width instead of giving the user access to each. Also, I would coerce the values so that the dimensions of the scale cannot be set too big or too small.
2. You will have to use property node to adjust the Scale.Position and the Scale.Marker.Position to match the housing dimensions.
Best Regards,
Andrew S.