Jump to content

[CR] Generate Palettes


Recommended Posts

index.php?app=downloads&module=display&section=screenshot&id=84

Name: Generate Palettes

Submitter: gb119

Submitted: 21 Jul 2009

File Updated: 15 Oct 2009

Category: LabVIEW IDE

Version: 1.0.04

LabVIEW Version: 8.6

License Type: BSD (Most common)

Generate Palettes-1.0.0.04.zip

~~~~~~~~~~~~~~~~~~~~~~~~~~

Copyright © 2007-2009, University of Leeds, UK

All rights reserved.

Author:

Gavin Burnell

G.Burnell@leeds.ac.uk

Distribution:

This code was downloaded from the LAVA Code Repository: http://lavag.org/index.php?app=downloads

Description:

This is a utility for automatically creating palette menu files from a library or LabVIEW class.

LabVIEW offers the option of including palette files in .lvlib or .lvclass files and for setting one of these palettes to be the default palette file when the user right-clicks by a member vi or class wire. This is very useful, but the LabVIEW project manager has some flaws when it comes to

having multiple palette files with the same name in a project that can easily result in a corrupt xml file. This utility gets around this problem by creating uniquely named palette files that reflect the project structure of the class or library.

In the case of class files, if the class is a child class the utility will attempt to lcoate a palette file for the parent class. This makes it easier to have all parent methods readily to hand when right clicking on a class wire. Couple with the option to work out the complete class parentage and create all necessary palettes it is quite easy to setup a chain of palettes through a long descendent list of classes.

Todo:

I've got various ideas to implement in future versions:

1) Look for gone away or moved items in the palette files and attempt to relocate them.

2) See if I can access Endevo Goop Developer class properties to use different icons for public/private/protected class folders.

3) LabVIEW project file support (should be quite easy to find all class, library files within a project)

Dependancies:

OpenG File Tools

Support:

If you have any problems with this code or want to suggest features:

<LAVAG forum here>

h

Change Log:

1.0.04 Fixed silly bug where default palette was set after the library was saved. Sorted out relative paths somemore.

1.0.03 Added code to set default palette file (thanks to Ton Plomp !) and move refresh palettes to only run once.

1.0.02 Added some more documentation to the sub-vis.

1.0.01 Original release

License:

Copyright © 2007-2009, University of Leeds

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

* Neither the name of the University of Leeds nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS

"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT

LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR

A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR

CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,

EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,

PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR

PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF

LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING

NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS

SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Click here to download this file

Link to comment

index.php?app=downloads&module=display&section=screenshot&id=84

Name: Generate Palettes

Submitter: gb119

Submitted: 21 Jul 2009

File Updated: 22 Jul 2009

Category: *Uncertified*

LabVIEW Version: 8.6

Version: 1.0.02

License Type: BSD (Most common)

Make this available on the VI Package Network?: Yes

Generate Palettes-1.0.02.zip

~~~~~~~~~~~~~~~~~~~~~~~~~~

Copyright © 2007-2009, University of Leeds, UK

All rights reserved.

Author:

Gavin Burnell

G.Burnell@leeds.ac.uk

Hi Gavin

I am seeing some issues with the 1.0.2 version.

  1. With the new CR we are asking that the .zp file also include the labview version EX: Mycode_LV86_V10
  2. I am also seeing many issues with conflicts and missing vilib below are some screen shots

post-584-124853453536_thumb.png

post-584-124853453919_thumb.png

post-584-124853454645_thumb.png

post-584-124853454978_thumb.png

It looks like a vilib is missing and that the project is trying to link back to your user lib

Documentation, Readme text, Licence all look good.

Link to comment
  • 2 months later...

Hi,

here is some code that should set the mnu file as the default palette:

post-2399-125554170475_thumb.png

One thing to speed it up, it is good that you refresh the palettes however I don't think this is needed after every library, you can place it outside the main while loop in the Process event.

Ton

Link to comment

Hi,

here is some code that should set the mnu file as the default palette:

[..]

One thing to speed it up, it is good that you refresh the palettes however I don't think this is needed after every library, you can place it outside the main while loop in the Process event.

Thanks for the tip. Strangely, I'd thought about using the Get tag method to read the Endevo Goop tags but it didn't occur to me to use the Set tag method to set the default palette file. Duh !

The misplaced refresh palettes invoke node was just that - the whole code got wrapped in the for loop at a late stage and I had been too lazy to move the invoke node back.

I've also fixed up the dependency problems - it was caused by the .lvlib file getting a bunch of absolute paths in it. What I'm not sure about is how to force LabVIEW to recalculate the relative paths (or why they got turned into absolute paths anyway) - in the end I manually hacked the xml which is not really very satisfactory.

Link to comment

Thanks for the tip. Strangely, I'd thought about using the Get tag method to read the Endevo Goop tags but it didn't occur to me to use the Set tag method to set the default palette file. Duh !

I see now that you placed the code I showed, however you placet it after saving the library, thus thwowing away the info.

I have checked your lvlib, but it fully uses realitive paths (../foo.vi), so I can easily open the lvlib without errors, but when I open the main VI (Make Palettes for Library) it tries to load the subVIs from user.lib/lavacr/.....

What probably would work is saving the tool outside user.lib and submitting that.

Ton

Link to comment

I see now that you placed the code I showed, however you placet it after saving the library, thus thwowing away the info.

I have checked your lvlib, but it fully uses realitive paths (../foo.vi), so I can easily open the lvlib without errors, but when I open the main VI (Make Palettes for Library) it tries to load the subVIs from user.lib/lavacr/.....

What probably would work is saving the tool outside user.lib and submitting that.

Ton

:frusty:Ok that's my comeuppance for coding when too tired. 1.0.04 sets the palette berore saving the library.

I think everything is now relativised properly - after a certain amount of pain moving and conflict dependency fixing. I'm still very hazy on when LabVIEW uses absolute paths and relative paths in the xml files - I had always though that it would use relative paths by preference, then paths relative to 'well-known' directories and then absolute paths. but this experience would suggest otherwise.

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
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.