LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Re-organising LVOOP classes on disk

How do we save a class to a new location (simply moving directory)?

 

I can save the .lvclass file using the "Save As" function but the mamber VIs all get left behind.  I want to make sure that all dependencies are in memory when I do this so I don't have to manually re-link all of the new classes (which may well have changed their name).

 

I feel I must be missing something really simple here but I can't see the option anywhere.....  If I select all of the member VIs in the Project view and switch to the Files view, only the .lvclass is selected.  I would like to copy ONLY the files which actually belong to the class to a new location, thus uncluttering my files on disk.

 

OH, BTW, I'm using LV 2012 SP1.

 

Edit: I see that under the "Save As" option, the "copy" method says it copies the class AND ITS CONTENTS to a new location.  The "rename" option does not.  I would love to have a "rename" function which actually moves the class contents, not just the .lvclass file.

0 Kudos
Message 1 of 14
(3,364 Views)

The only way I can envisage of getting this job done is to

 

  1. Copy the Class to a new location
  2. Close the project
  3. Delete the "old" version
  4. Open the Project and re-link to the new location
  5. Rename the Class and again save the project

I would need to repeat this for each class in my hierarchy.  Perhaps I could copy multiple classes in one move, but my experiences from yyesterday where moving classes around caused about 6 crashes makes me want to be careful in that regard.

 

I suppose I'll just have to do it this way, it should only take about a day..... Smiley Sad

0 Kudos
Message 2 of 14
(3,341 Views)

 

Hmmm, coulda sworn I've done this before without any great pain.  I *think* maybe I first had to have the .lvclass file opened as a top-level project (right-click the .lvclass inside your .lvproj and choose "open").   Then (I think) the "Save As..." had options for saving all the member files in the new location too.

 

Did I mention, "I *think*..."?

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 3 of 14
(3,302 Views)

Yeah, save As and then choosing "Copy" does this, but it doesn't do the re-linking to the new version.  There is no version which will relocate the entire class AND update all dependencies.

 

To get this done I need to close the Project, delete the old class and re-load the project.

 

I've been doing this all day and I'm nearly finished.....  Weekend time.

0 Kudos
Message 4 of 14
(3,296 Views)

It looks like a painful lesson to learn.  (And one I've learned myself)  Much better to think the file structure through first than to clean-up later.


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 14
(3,285 Views)

Yeah, thinking the file structure is all fine and good if you know how your objects are going to be organised.  We are operating under extreme performance requirements, so the objects changed often upon benchmarking and even the object hierarchy needed to be changed (no DD, only Static calls).

 

So yeah, while it's always better to plan ahead, when doing some exploratory nuts and bolts kind of coding, some sort of clean-up is going to be needed afterwards.  I just wish the cleanup wasn't so darned painful.

0 Kudos
Message 6 of 14
(3,274 Views)

My advice is to never move libraries or classes on disk.

 

But if you *have* to, I've had decent luck using the "Move on Disk" option in the Files view of the Project Explorer..it appears to fix up linkages ok:

 

move.png

Message 7 of 14
(3,257 Views)

If I wanted the whole directry, then I would probable have been able to do this.

 

Since the testing I was doing required adding and removing sub-objects from certain other objects in order to find the optimal performance  versus usability I ended up with several orphan VIs.  VIs which are in the same directory as a class but aren't actually part of it any more.  Testing was a really hectic time and I was often not sure at all if I would be able to meed the requirements (including investigating some seemingly weird benchmark results due in part to faulty RT deploys).  So moving from this exploratory phase and trying to re-use as much of the code I have prodiced I tried to clean things up: i.e. only copy over the files which actually belong to the class, leaving the poor old orphans behind to meet their doom.

 

Even the ability to select multiple files in the project view and then switch over to the files view to move them on disk would be a cool addition.  that way I can select all of the real class members, switch view and move the files.  It's exactly this "files which are in the class and no others" part which I miss sorely.

 

So nobody else ever had this problem?  Really?

0 Kudos
Message 8 of 14
(3,244 Views)

I don't usually deal with much, so I won't comment on whether there or isn't an option for this. Instead, I would suggest that if you do this often, you should look into writing a tool to assist with doing this automatically or semi-automatically. I haven't even thought about what the necessary properties and methods are, let alone looked to see whether they exist, but I'm fairly sure they do.

 

Many moons ago, E. Blasberg put out a tool called Find Used and Unused VIs. This was long before LVOOP, but it might help you as a stepping stone and it might also work as is, since class VIs are still just VIs.


___________________
Try to take over the world!
0 Kudos
Message 9 of 14
(3,215 Views)
No its certainly not something i do often. I was investigating a very different way of organising our legacy RT code. Lots of different aspects needed exploring and clarifying. The whole thing was in a constant state of change. Only now where i have functionality and performance sorted do i want to solidify the architecture, refactoring along the way.
0 Kudos
Message 10 of 14
(3,208 Views)