Jump to content

[CR] Polymorphic VI Editor v1.0.1 LV2011


Recommended Posts

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

Name: Polymorphic VI Editor v1.0.1 LV2011

Submitter: Ton Plomp

Submitted: 12 Jun 2010

File Updated: 27 Dec 2012

Category: LabVIEW IDE

LabVIEW Version: 2011

License Type: BSD (Most common)

Polymorphic VI Editor v1.0.1

Copyright © 2012 Ton Plomp

All rights reserved.

Author: Ton Plomp

LAVA Name: TCPlomp

Contact Info: Contact via PM on lavag.org

LabVIEW Versions:

2009

Dependencies:

OpenG:

oglib_array

oglib_error

oglib_file

oglib_string

JKI:

jki_lib_state_machine

Description:

A GUI for easily editing polymorphic VIs and creating good-looking menu trees.

Installation and instructions:

A: Open the ZIP file and install the OGP file with OpenG builder

B: run the 'Polymorphic Editor.vi' in the 'Build' folder

Examples:

Look in the LAVA discussion for this entry for some videos on this tool

<object id="scPlayer" width="1027" height="517"> <param name="movie" value="http://content.screencast.com/users/TonPlomp/folders/Jing/media/389dc546-26c4-499f-8702-0ffea3faf50d/jingswfplayer.swf"></param>'>http://content.screencast.com/users/TonPlomp/folders/Jing/media/389dc546-26c4-499f-8702-0ffea3faf50d/jingswfplayer.swf"></param> <param name="quality" value="high"></param> <param name="bgcolor" value="#FFFFFF"></param> <param name="flashVars" value="thumb=http://content.screencast.com/users/TonPlomp/folders/Jing/media/389dc546-26c4-499f-8702-0ffea3faf50d/FirstFrame.jpg&containerwidth=1027&containerheight=517&content=http://content.screencast.com/users/TonPlomp/folders/Jing/media/389dc546-26c4-499f-8702-0ffea3faf50d/Polymorphic%20Editor.swf"></param> <param name="allowFullScreen" value="true"></param> <param name="scale" value="showall"></param> <param name="allowScriptAccess" value="always"></param> <param name="base" value="http://content.screencast.com/users/TonPlomp/folders/Jing/media/389dc546-26c4-499f-8702-0ffea3faf50d/"></param>'>http://content.screencast.com/users/TonPlomp/folders/Jing/media/389dc546-26c4-499f-8702-0ffea3faf50d/"></param> <embed src="http://content.screencast.com/users/TonPlomp/folders/Jing/media/389dc546-26c4-499f-8702-0ffea3faf50d/jingswfplayer.swf" quality="high" bgcolor="#FFFFFF" width="1027" height="517" type="application/x-shockwave-flash" allowScriptAccess="always" flashVars="thumb=http://content.screencast.com/users/TonPlomp/folders/Jing/media/389dc546-26c4-499f-8702-0ffea3faf50d/FirstFrame.jpg&containerwidth=1027&containerheight=517&content=http://content.screencast.com/users/TonPlomp/folders/Jing/media/389dc546-26c4-499f-8702-0ffea3faf50d/Polymorphic%20Editor.swf" allowFullScreen="true" base="http://content.screencast.com/users/TonPlomp/folders/Jing/media/389dc546-26c4-499f-8702-0ffea3faf50d/" scale="showall"></embed> </object>

Known Issues:

Acknowledgements:

OpenG.org for showing the power of polymorphic VIs

JKI for providing an easy to use State Machine framework

Version History:

v1.0.0: Initial release of the code.

License:

Copyright © 2010, TC Plomp

All rights reserved.

Redistribution and use in source and binary forms, with or without

modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright

notice, this list of conditions and the following disclaimer.

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

3. All advertising materials mentioning features or use of this software

must display the following acknowledgement:

This product includes software developed by the <organization>.

4. Neither the name of the <organization> 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 TC Plomp ''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 TC PLOMP 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.

Distributed under the Creative Commons Attribution 3.0 (http://creativecommo.../about/licenses)

See link for a full description of the license.

Support:

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

please go to lavag.org and Navigate to LAVA > Resources > Code Repository (Certified) and

search for the "Polymorphic VI Editor" support page.

Distribution:

This code was downloaded from the LAVA Code Repository found at lavag.org

Click here to download this file

Edited by Ton Plomp
Added video
Link to comment

Nice work, I really appreciate this. A few comments and suggestions:

  1. It seems to reverse the order of the polymorphic entries when reading a PolyVI. As well as retaining the original order, it would be nice to be able to sort by any of the columns (menu/selector/filename) before writing.
  2. Why is the file marked as "changed" when it has just been read in, but nothing has yet been done to it?
  3. It should probably ask to save when the window is being closed too.
  4. A wonderful addition would be the ability to populate a PolyVI from a "template" by changing controls/indicators to various types. There is an old tool called Create Polymorphic Instances, I think written by PJM ~5 years ago, which did this fairly well. I'm not sure where it was posted - I can't find it online now. But having something like that integrated into the Editor would automate a lot of what PolyVIs are used for (by me anyway!). A nice extension to that would be to be able to automatically create VIs for different array dimensions.

Maybe I'll have a go at #4 if I get some spare time, but my knowledge of scripting is pretty basic.

Link to comment

Nice work, I really appreciate this. A few comments and suggestions:

  1. It seems to reverse the order of the polymorphic entries when reading a PolyVI. As well as retaining the original order, it would be nice to be able to sort by any of the columns (menu/selector/filename) before writing.
  2. Why is the file marked as "changed" when it has just been read in, but nothing has yet been done to it?
  3. It should probably ask to save when the window is being closed too.
  4. A wonderful addition would be the ability to populate a PolyVI from a "template" by changing controls/indicators to various types. There is an old tool called Create Polymorphic Instances, I think written by PJM ~5 years ago, which did this fairly well. I'm not sure where it was posted - I can't find it online now. But having something like that integrated into the Editor would automate a lot of what PolyVIs are used for (by me anyway!). A nice extension to that would be to be able to automatically create VIs for different array dimensions.

Maybe I'll have a go at #4 if I get some spare time, but my knowledge of scripting is pretty basic.

Hi Greg,

I found a little bug that caused the VI to become dirty when opening a fresh VI.

It should indeed ask to save the VI when you want to close the dialog.

I'll have to look into the 'ordering' when reading.

Yes the auto-naming and expanding would be great.

The code you mention by PJM I had a copy of that and it is indeed stored in the history of the Mercurial code in Sourceforge.

Ton

Link to comment
  • 8 years later...

Hmm.  When trying this out an doing a save after an Edit - I am given Error 42.

 

Error 42 Occured at Property Node (arg 1) in Polymorphic Editor.lvlib:Apply Changes.vi->Polymorphic Editor.lvlib:PolymorphicGUIEditor.vi

 

Edited by Ryan Vallieu
add full error text
Link to comment

I should have thought to check that, but since the LabVIEW Editor was saving it fine it didn't occur to me.  I will check.

 

EDIT:  It won't even let me save a new copy in the Documents folder - same error.  Windows 7 evidently doesn't let Administrators remove Read Only from the Microsoft description - odd, even using the cmd prompt to attrib -r c:/<folder> on the folder and trying again to save yielded error 42.

 

I will try a separate version of the Polymorphic Scripting node in some test code in LabVIEW to see if I can replicate the issue.

Edited by Ryan Vallieu
Link to comment
5 hours ago, Ryan Vallieu said:

I should have thought to check that, but since the LabVIEW Editor was saving it fine it didn't occur to me.  I will check.

 

EDIT:  It won't even let me save a new copy in the Documents folder - same error.  Windows 7 evidently doesn't let Administrators remove Read Only from the Microsoft description - odd, even using the cmd prompt to attrib -r c:/<folder> on the folder and trying again to save yielded error 42.

 

I will try a separate version of the Polymorphic Scripting node in some test code in LabVIEW to see if I can replicate the issue.

I created a separate VI with the Scripting node and got the same Error 42 when modifying the INstanceInfo.  

I believe it was because there was just something wrong with the original PolyVI - I recreated it programmatically with scripting code, then used the tool, and now I am not getting an error on modify/save in the tool.  Something must have been corrupt.

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.