Jump to content


Photo
* * * * * 1 votes

[CR] Insert Type Conversion RCF Plugin


  • Please log in to reply
38 replies to this topic

#1 François Normandin

François Normandin

    Son of Scotland

  • Premium Member
  • 1,081 posts
  • Location:Montréal, QC
  • Version:LabVIEW 2012
  • Since:1999

Posted 21 July 2009 - 02:33 PM

*
POPULAR

Posted Image

Name: Insert Type Conversion RCF Plugin
Submitter: François Normandin
Submitted: 21 Jul 2009
File Updated: 03 Jan 2011
Category: JKI Right-Click Framework Plugins
LabVIEW Version: 8.2
License Type: BSD (Most common)

Insert Conversion Node RCF Plugin v1.2.0.7

Copyright © 2009-2010, François Normandin
All rights reserved.


*Plugin*
Name=Insert TypeConversion
Summary=Inserts a type conversion automatically
Description=Will insert type conversion for all strings, numbers, paths, variants & enums to the right datatype.
Copyright=Copyright © 2009-2010 François Normandin
License=BSD
Developer=François Normandin
Version=1.2.0.3
*Plugin*



Author:François Normandin
Contact Info: Contact via PM on www.lavag.org

LabVIEW Versions:
Created and tested with LabVIEW 8.2
Tested with 8.6 and 2009.

Dependencies:
jki_tool_right_click_framework >= 1.0.2.208
oglib_array >= 3.0.0
oglib_lvdata >= 2.9


Description:
This package contains a plugin for the Right-Click Framework of JKI.
It consists of a first draft of a tool to automatically insert correct conversion node on a wire (or multiple wire at once).

Includes:

- Decimal String to Number.
- Float String to Number.
- Any numeric type (int, unint, floats, complex) to any numeric type.
- Variant to string or numerics.
- Numerics to Variant.
- String to Variant.
- Path to String.
- String to Path.
- Boolean to string.
- Enum to String.
- String to Enum.
- Numeric to Enum.
- Numeric to String
- Unbundle cluster to terminal indicator.



Instructions:
After installing package with VIPM, restart the RCF framework. Use the right-click on wires to automatically insert a conversion node if needed.

** VIPM 2010 or higher is required to process this package.


Known Issues:
1- Not all typecasts are implemented.
2- Wires with joints will not behave correctly yet.

Acknowledgements:
JKI for providing with this great framework.

Change Log:
v1.0.0: Initial release of the code.
v1.0.2: Added _rcf_ in package name.
v1.0.3: Changed the typecast name for proper "type conversion" name.
v1.0.9: Added readme file into .vip file package + some VI documentation
v1.1.0: Changed name of package from normandinf to lava (lava_lib_rcf_insert_typeconversion.vip)
and added some type conversions (Boolean to string; Enum to String; String to Enum)
v1.1.3: Fixed bug with conversion from Enum to Numerics.
Added conversion from Numeric to Enum using "Variant to Data" node.
Added a lame icon. (Any user suggestion will be considered for next update!)
v1.1.4: Updated the description of plugin that now shows up to date info in RCF Options menu.
v1.1.8: Fixed bug when a type conversion node was inserted in a structure where the node was inserted on the main diagram.
Saved for LV 8.2
v1.1.11: Included all files in source distribution to make compatible with LabVIEW 2009.
v1.2.0: Added Unbundle cluster to terminal and corrected problem with Numeric to String.
v1.2.0.7: Added Singular to Array & Array to Singular.



License:
Distributed under the BSD license

Support:
If you have any problems with this code or want to suggest features:
please go to www.lavag.org and Navigate to the discussion page.

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

Click here to download this file

François [frɑ̃swa], CLA


#2 Jim Kring

Jim Kring

    packages everywhere!

  • JKI
  • 1,901 posts
  • Location:Lafayette, CA
  • Version:LabVIEW 2011
  • Since:1995

Posted 21 July 2009 - 04:49 PM

VERY NICE!!!

Minor technical point: the operations inserted are not really a type cast, but a type conversion -- casting means changing the type, but not the data; whereas conversion involves changing both the data and its type.

#3 François Normandin

François Normandin

    Son of Scotland

  • Premium Member
  • 1,081 posts
  • Location:Montréal, QC
  • Version:LabVIEW 2012
  • Since:1999

Posted 21 July 2009 - 06:20 PM

VERY NICE!!!

Minor technical point: the operations inserted are not really a type cast, but a type conversion -- casting means changing the type, but not the data; whereas conversion involves changing both the data and its type.


Agreed, classes get typecast... I'll repackage it as "Type Conversion" and repost. I'll have more type conversions ready soon anyway.

François [frɑ̃swa], CLA


#4 Jim Kring

Jim Kring

    packages everywhere!

  • JKI
  • 1,901 posts
  • Location:Lafayette, CA
  • Version:LabVIEW 2011
  • Since:1995

Posted 21 July 2009 - 06:35 PM

Agreed, classes get typecast... I'll repackage it as "Type Conversion" and repost. I'll have more type conversions ready soon anyway.


Great! Also, a couple other packaging-related comments:

1) While there are no real official requirements for JKI RCF plugin packages, JKI has prefixed the Package Name with "RCF" to make them easy to find in VIPM's package list. For example, this might be preferable: normandinf_lib_rcf_insert_typecast-1.0.1-1

2) The package's homepage points to here: http://www.monpapyrus.net/ . You might want to update this to point to this discussion topic (the package's actual homepage), or put a link to this topic (and a list of your RCF plugins) on your personal homepage. I say this, because the package homepage URL should help the user find new versions of the package and obtain support.

Thanks,

#5 François Normandin

François Normandin

    Son of Scotland

  • Premium Member
  • 1,081 posts
  • Location:Montréal, QC
  • Version:LabVIEW 2012
  • Since:1999

Posted 21 July 2009 - 07:41 PM

1) While there are no real official requirements for JKI RCF plugin packages, JKI has prefixed the Package Name with "RCF" to make them easy to find in VIPM's package list. For example, this might be preferable: normandinf_lib_rcf_insert_typecast-1.0.1-1


I did put _rcf_ in the build page. I was about to report this on jkisoft.com forums. I'll try again tomorrow, but I didn't succeed in changing the package build name. Perhaps something I put in the ini file. I'll double-check.

2) The package's homepage points to here: http://www.monpapyrus.net/ . You might want to update this to point to this discussion topic (the package's actual homepage), or put a link to this topic (and a list of your RCF plugins) on your personal homepage. I say this, because the package homepage URL should help the user find new versions of the package and obtain support.

I will.

BTW, is there any way to include a readme.txt file in the VIP file? Strictly speaking, my submission doesn't conform to LAVAcr standards since I linked the VIP file directly. I guess I should just zip it with the readme file...

François [frɑ̃swa], CLA


#6 crelf

crelf

    I'm a LAVA, not a fighter.

  • V I Engineering, Inc.
  • 5,742 posts
  • Version:LabVIEW 2012
  • Since:1993

Posted 21 July 2009 - 09:33 PM

*
POPULAR

BTW, is there any way to include a readme.txt file in the VIP file? Strictly speaking, my submission doesn't conform to LAVAcr standards since I linked the VIP file directly. I guess I should just zip it with the readme file...

Here's a VIE-itnernal VI that we use (amongst others) when we're adding files to our packages (we dynamically build chm help files and link them from the VIs that we build in the package). You need to call it during the post-build phase, otherwise it will corrupt your package. As always, the code I post is at-your-risk only.

Note: I don't have any inside knowledge of the vip file format - it might change at any time, and using this VI might screw up your packages. This code is not supported by JKI, or anyone else (including me :D )

Attached Files


post-181-1170858537.png


#7 Michael Aivaliotis

Michael Aivaliotis

    MindFreak

  • JKI
  • 2,662 posts
  • Version:LabVIEW 2012
  • Since:1994

Posted 21 July 2009 - 10:48 PM

And here's a link to information on how to call post-build hook VIs in VIPM: Build Hook VIs
Thank You
Michael Aivaliotis

VI Shots

#8 Jim Kring

Jim Kring

    packages everywhere!

  • JKI
  • 1,901 posts
  • Location:Lafayette, CA
  • Version:LabVIEW 2011
  • Since:1995

Posted 22 July 2009 - 05:12 PM

I did put _rcf_ in the build page. I was about to report this on jkisoft.com forums. I'll try again tomorrow, but I didn't succeed in changing the package build name. Perhaps something I put in the ini file. I'll double-check.

Yes, let us know if you have trouble making this work. Here's how we do it with the JKI plugins in VI Package Builder:

1.png

BTW, is there any way to include a readme.txt file in the VIP file? Strictly speaking, my submission doesn't conform to LAVAcr standards since I linked the VIP file directly. I guess I should just zip it with the readme file...

crelf's utility should do the trick. Let us know if you have any trouble making this work.

#9 François Normandin

François Normandin

    Son of Scotland

  • Premium Member
  • 1,081 posts
  • Location:Montréal, QC
  • Version:LabVIEW 2012
  • Since:1999

Posted 23 July 2009 - 03:19 PM

Alright, this version 1.0.9 includes all the corrective actions mentioned above, including a proper readme file in the package...
Now, sometime in the future I'll make a nice icon for the RCF...

Here's a VIE-itnernal VI that we use (amongst others) when we're adding files to our packages (we dynamically build chm help files and link them from the VIs that we build in the package). You need to call it during the post-build phase, otherwise it will corrupt your package. As always, the code I post is at-your-risk only.

Note: I don't have any inside knowledge of the vip file format - it might change at any time, and using this VI might screw up your packages. This code is not supported by JKI, or anyone else (including me :D )


Thanks, that worked like a charm. You know you could make that available in the Code Repository, right? ;)

And here's a link to information on how to call post-build hook VIs in VIPM: Build Hook VIs


Ditto. Thanks for the demo.

Yes, let us know if you have trouble making this work. Here's how we do it with the JKI plugins in VI Package Builder:


The tree hiding the forest... :frusty:

François [frɑ̃swa], CLA


#10 crelf

crelf

    I'm a LAVA, not a fighter.

  • V I Engineering, Inc.
  • 5,742 posts
  • Version:LabVIEW 2012
  • Since:1993

Posted 23 July 2009 - 03:38 PM

Thanks, that worked like a charm. You know you could make that available in the Code Repository, right? Posted Image

I *could*, but it's actually part of an internal library that does a whole lot of VIPM pre/post build hook stuff, some of which doesn't make business sense for us to distribute. Someday I might release the post-build documentation generator that builds and adds linked chm documentation to all your package files, but that would require me to do some work, and I just don't have time pre-NI-Week. If you remind me in a couple of weeks, I'll have a look at releasing it, as well as some other stuff that supports VIPM package creation... maybe... :)

post-181-1170858537.png


#11 Jim Kring

Jim Kring

    packages everywhere!

  • JKI
  • 1,901 posts
  • Location:Lafayette, CA
  • Version:LabVIEW 2011
  • Since:1995

Posted 23 July 2009 - 03:48 PM

Thanks, that worked like a charm. You know you could make that available in the Code Repository, right? public/style_emoticons/default/wink.gif

I *could*, but it's actually part of an internal library that does a whole lot of VIPM pre/post build hook stuff, some of which doesn't make business sense for us to distribute. Someday I might release the post-build documentation generator that builds and adds linked chm documentation to all your package files, but that would require me to do some work, and I just don't have time pre-NI-Week. If you remind me in a couple of weeks, I'll have a look at releasing it, as well as some other stuff that supports VIPM package creation... maybe... :)


François: I'll try to temp crelf with lots of beer at NIWeek to convince him ;)

#12 crelf

crelf

    I'm a LAVA, not a fighter.

  • V I Engineering, Inc.
  • 5,742 posts
  • Version:LabVIEW 2012
  • Since:1993

Posted 23 July 2009 - 04:34 PM

François: I'll try to temp crelf with lots of beer at NIWeek to convince him Posted Image

Bring it on!

post-181-1170858537.png


#13 François Normandin

François Normandin

    Son of Scotland

  • Premium Member
  • 1,081 posts
  • Location:Montréal, QC
  • Version:LabVIEW 2012
  • Since:1999

Posted 23 July 2009 - 05:06 PM

François: I'll try to temp crelf with lots of beer at NIWeek to convince him ;)


Make sure he's back on his feet for the lunch.

François [frɑ̃swa], CLA


#14 crelf

crelf

    I'm a LAVA, not a fighter.

  • V I Engineering, Inc.
  • 5,742 posts
  • Version:LabVIEW 2012
  • Since:1993

Posted 23 July 2009 - 06:36 PM

Make sure he's back on his feet for the lunch.


Oh crap - I'd completely forgotten about that! Anyone got suggestions on where we could eat? I'm thinking that delicious Thai place on 6th, although I'd prefer it to be something a little more Texan... Maybe we should just grab a table in the exhibition floor lunch area?

post-181-1170858537.png


#15 Michael Aivaliotis

Michael Aivaliotis

    MindFreak

  • JKI
  • 2,662 posts
  • Version:LabVIEW 2012
  • Since:1994

Posted 24 July 2009 - 10:40 PM

I noticed the Jing video on the download page. Great idea François. This helps a lot in letting people understand what it does. I think all submission pages should include a small video.
Thank You
Michael Aivaliotis

VI Shots

#16 François Normandin

François Normandin

    Son of Scotland

  • Premium Member
  • 1,081 posts
  • Location:Montréal, QC
  • Version:LabVIEW 2012
  • Since:1999

Posted 24 July 2009 - 11:19 PM

I noticed the Jing video on the download page. Great idea François. This helps a lot in letting people understand what it does. I think all submission pages should include a small video.


But I didn't put my melodious voice on it... One step at a time! :D

François [frɑ̃swa], CLA


#17 Mark Balla

Mark Balla

    Extremely Active

  • Premium Member
  • 490 posts
  • Location:Gurnee Illinois
  • Version:LabVIEW 2011
  • Since:1997

Posted 28 July 2009 - 12:30 PM

I created a jing Video showing 3 things (For some reason it won't imbed into the post)
One kudo
One Bug
One Request.

Great RCF

Mark

#18 François Normandin

François Normandin

    Son of Scotland

  • Premium Member
  • 1,081 posts
  • Location:Montréal, QC
  • Version:LabVIEW 2012
  • Since:1999

Posted 28 July 2009 - 01:25 PM

I created a jing Video showing 3 things (For some reason it won't imbed into the post)
One kudo
One Bug
One Request.

Great RCF

Mark



Thanks Mark for the feedback. I'll upload an update in a few minutes.

PS: To embed Jing videos, you need to enable HTML (Click to configure post options) below Attachments.

<object width="474" height="280"> <param name="movie" value="http://content.scree...r.swf"></param> <param name="quality" value="high"></param> <param name="bgcolor" value="#FFFFFF"></param> <param name="flashVars" value="thumb=http://content.screencast.com/users/nrc75/folders/Jing/media/f1cd5171-7e05-4211-b946-dcf540e227c5/FirstFrame.jpg&containerwidth=474&containerheight=280&loaderstyle=jing&content=http://content.screencast.com/users/nrc75/folders/Jing/media/f1cd5171-7e05-4211-b946-dcf540e227c5/2009-07-28_0923.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.scree...27c5/"></param> <embed src="http://content.scree...gswfplayer.swf" quality="high" bgcolor="#FFFFFF" width="474" height="280" type="application/x-shockwave-flash" allowScriptAccess="always" flashVars="thumb=http://content.screencast.com/users/nrc75/folders/Jing/media/f1cd5171-7e05-4211-b946-dcf540e227c5/FirstFrame.jpg&containerwidth=474&containerheight=280&loaderstyle=jing&content=http://content.screencast.com/users/nrc75/folders/Jing/media/f1cd5171-7e05-4211-b946-dcf540e227c5/2009-07-28_0923.swf" allowFullScreen="true" base="http://content.scree...-dcf540e227c5/" scale="showall"></embed> </object>

François [frɑ̃swa], CLA


#19 François Normandin

François Normandin

    Son of Scotland

  • Premium Member
  • 1,081 posts
  • Location:Montréal, QC
  • Version:LabVIEW 2012
  • Since:1999

Posted 28 July 2009 - 02:04 PM

I've found a bug that I don't have time to check right now but will be a priority... Some conversions taking place in a frame structure react weirdly as shown on this video.

*** EDIT: This bug has been solved. For other RCF wireworkers out there, remember to use the Owner refnum instead of Owning VI refnum when placing a node on the diagram. In this case, I took the reference to the wire being selected, took a reference to its owning VI and deleted the wire. Then I placed a conversion node using the Owning VI reference. It would work well whenever the selected wire was on the main diagram but break all hell loose if the selected wire was inside a structure. By using Owner reference instead, I correctly placed the conversion node on the right diagram.

François [frɑ̃swa], CLA


#20 Bjarne Joergensen

Bjarne Joergensen

    Very Active

  • Members
  • PipPipPip
  • 88 posts
  • Version:LabVIEW 8.2
  • Since:1997

Posted 29 July 2009 - 01:05 PM

I've found a bug that I don't have time to check right now but will be a priority... Some conversions taking place in a frame structure react weirdly as shown on this video.

<object width="446" height="190"> <param name="movie" value="http://content.scree...r.swf"></param> <param name="quality" value="high"></param> <param name="bgcolor" value="#FFFFFF"></param> <param name="flashVars" value="thumb=http://content.screencast.com/users/nrc75/folders/Jing/media/6efdc068-eb0f-47bc-a28a-49317a026f2e/FirstFrame.jpg&containerwidth=446&containerheight=190&loaderstyle=jing&content=http://content.screencast.com/users/nrc75/folders/Jing/media/6efdc068-eb0f-47bc-a28a-49317a026f2e/Bug_insideMultipleFrameStructure.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.scree...6f2e/"></param> <embed src="http://content.scree...gswfplayer.swf" quality="high" bgcolor="#FFFFFF" width="446" height="190" type="application/x-shockwave-flash" allowScriptAccess="always" flashVars="thumb=http://content.screencast.com/users/nrc75/folders/Jing/media/6efdc068-eb0f-47bc-a28a-49317a026f2e/FirstFrame.jpg&containerwidth=446&containerheight=190&loaderstyle=jing&content=http://content.screencast.com/users/nrc75/folders/Jing/media/6efdc068-eb0f-47bc-a28a-49317a026f2e/Bug_insideMultipleFrameStructure.swf" allowFullScreen="true" base="http://content.scree...-49317a026f2e/" scale="showall"></embed> </object>



Hi François

Is it possible to get the plugin for LV8.2?Posted Image
I use this version and JKI RCF is supported from LV8.2.

thank in advance

Bjarne