Jump to content

Auto-update accessors when editing class control?


Recommended Posts

Has anyone come up with a way to auto-update the accessors for a control in the class private data when you change it's type or rename it?

I find myself doing this a lot as I re-factor code.  It means removing VIs from the project and then deleting them on disk, then building new accessors.  Or, I could manually edit the accessors but that is even slower.

I am just curious if anyone has created a scripting VI to automate this.

 

thanks for any tips.

 

-John

Link to comment
  • 8 months later...

Ok, resurrecting this one because I am in the middle of an massive bug fix re-architecture that requires me to change the name of a class data element in many classes.  After doing a few, I am back to wishing there was a tool to do this for me.

 

So, does anyone know if it exists?  If not, is it even possible via scripting?  Here are the steps:

 

Select the class private data element to change.

Rename it to the new name (I'm not even trying to change its type).

Save

Find any accessors for the element.

Rename their VIs to match the new name.

If said accessors are in a property folder, rename the folder to match the new name.

Rename the inputs and output on the accessors to match then new name.

Save everything.

 

I can handle the VI FP edits and the file name changes.  Not sure how to edit the class control or how to update the property folder name.

 

I also don't want to end up doing this:

http://xkcd.com/1319/

 

-John

Link to comment

I cannot give you a final solution, however here is a snipped to access the items in a class private data control as well as the property definition folder (I can't change the name to write, but maybe a newer version of LabVIEW can do that?). This snipped does nothing useful, but you should be able to edit the class control and property folders with that.

post-17453-0-85710800-1404386294_thumb.p

Link to comment
Yes, you are correct.  The folder name cannot be changed.  So I guess I am stuck.  Maybe I can buy some of the NI guys a few beers at NI Week and try to persuade them to open this up.

 

You could still delete the existing one and create a new one, however it might be difficult to handle all the relinking...

I remember something about an INI key to activate "hidden" functions for VI scripting (or rather node options which are considered unstable as they are still in development and thus haven't been released for public access)... Maybe someone knows what I'm talking about and could share their thoughts? :)

 

 

... or maybe I'm insane? :blink:

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.