Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Serialize ScaleRangeFill

In short my program allows users to add / remove / edit the ScaleRangeFill on the meters displayed in my software.  This is easily done using a the property editor object included with measurement studio.   The problem comes when I want to make those changes persistent by Serialization.  

 

It would have been nice had NI implemented the ISerializable interface but that is not the case.  I must serialize the "RangeFills" by hand which is not really a big deal until you get to the "NationalInstruments.UI.ScaleRangeFillStyle".  This class appears not to have a single "getter"   You can not determine which of the three styles is used (Solid, Gradient, or FillStyle ), the one or two colors used in the style,  the gradient offset if needed, or the fill style if needed.  Why is all this hidden? 

 

Is it all possible to get any of the data NationalInstruments.UI.ScaleRangeFillStyle parameters after it has been created?  Am I going to have to write my own ScaleFillRange editor just so I get keep the raw data used to create the ScaleRangeFills.

0 Kudos
Message 1 of 3
(4,744 Views)

Maroy,

 

Which version of Measurement Studio are you working with? I'm sure you have already seen this document, but I'll post the link here for the reference of others in the community.

 

ScaleRangeFillSyle Members - http://zone.ni.com/reference/en-XX/help/372636F-01/mstudiowebhelp/html/89734fe1/

Rob S
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(4,724 Views)

Professional Version 13.0.0.242

 

The linked document illustrates my problem very well.  The ScaleRangeFillStyle class exposes three static functions to create new ScaleRangeFillStyle and not a single member / function which can be used to determine the underlying parameters of the ScaleRangeFillStyle after it has been created.  Because I am using the NI supplied PropertyEditor to allow the users to change the ScaleRangeFillStyle I don't even get to see the underlying calls to the to those static functions mentioned in the document.  The problem remains, I need to know what changes the user made so I can write those setting to a file.  I understand why NI might not want programmers to be able to change existing ScaleRangeFillStyles and I am not asking for that capability. All I need is a way to query for the underlying ScaleRangeFillStyle parameters so I can call one of the static functions when a configuration file is loaded to rebuild the user defined ScaleRangeFillStyle.

 

I am pretty sure I am going to end up having to writing  redundant classes and data structure and my own ScaleRangeFillStyle editor just so I can save the parameter.  

 

 

 

0 Kudos
Message 3 of 3
(4,722 Views)