Code Capture Tool
From LabVIEW Wiki
The Code Capture Tool (or CCT) is a LabVIEW development tool targeted at LabVIEW users to capture images of their code and make it easier to share those images in online forums.
- Captures of Front Panel
- Captures of Block Diagram
- Comment an Annotate your caputre
- Creation of LabVIEW Snippets in any LabVIEW version
- Save the snippet as anoter (older) version
- Upload the capture to Imgur.com and copy the URL to he clipboard (LabVIEW 2010 and later)
- Plugins for altering the image or text returned to clipboard
The CCT is based on an idea and earlier versions originally released by Chilly Charly on the NI Forums as starware.
Later, it evolved to a multiple OS and LabVIEW versions tool for creating code-shots and documentation shots.
A collaboration between Yair Neeman and Ton Plomp resulted in the 1.0 version of the CCT that is currently available through the LAVA CR at this site.
Version 2.0 added the possibility to add text and drawings to the captured image, while version 2.1 added an altered GUI, a border around the snippet and better key-handling. Version 2.1.2 added the option upload the image to Imgur.com and save the snippet in an older version of LabVIEW.
Version 3.2 added a plugin architecture and a new GUI layout.
A series of videos is available at Screencast.
A short how to is in the here available
An extensive discussion and demo of the CCT is here.
Click [vipm://lava_lib_code_capture_tool here] to download the tool using VIPM.
To check the source you can explore your <user.lib>\_Code Capture Tool folder or download it from Sourceforge.net.
The user interface of the CCT allows the user to select which parts of a Front Panel or Block Diagram should be captured. The resulting image will be stored on disc and optionally the image or the path can be copied to the OS clipboard.
Front panel settings
The Front Panel listbox supplies the following options:
|Selected||All selected parts and items in between|
|Visible||Everything visible in the current panel view|
|All||Everything on the front panel|
Block diagram settings
The Block Diagram listbox supplies the following options:
|Selected||All selected parts and items in between|
|Visible||Everything visible in the current block diagram view|
|All||Everything on the block diagram|
The creation of a snippet can only be done when the Block Diagram is set to selected.
The header-text of the snippet is dynamically and has the following options which are accessible with the config button:
| Token|| Meaning|
| $VERSION$|| Inserts the saved LabVIEW version|
| $NAME$|| Name of the captured VI, retrieved from the VI.VI Name property|
| $TITLE$|| Title of the front panel of the captured VI|
| $IMAGENAME$|| Name of image on disk without the PNG extension|
| $IMAGE$|| Name of image on disk without the PNG extension (a duplicate of $IMAGENAME$|
| $DATE:xxx$|| Date/Time formatter, xxx must be replaced by a valid timestring formatter|
Per default the header string is LV: $VERSION$ $DATE:%c$, %c inserts the localized date.
The clipboard listbox supplies the following options:
|Path||Path of the captured image||Not on all platforms|
|Image||The captured image||Only on Windows|
|Imgur||The URL of the Imgur image||Selecting this will upload the image to Imgur.com|
Additional plugins are listed here as well.
The Layout picture ring supplies the following layout options:
|Front panel in top, block diagram below|
|Block diagram in top, front panel below|
|Front panel in left, block diagram on the right|
|Block diagram in left, front panel on the right|
The file settings consists of two controls, the string control to name the file (a .png extension is added to the name automatically) and a browse button to set the folder where the file should be stored. To detect which folder is currently used hover over one of the two controls and the tip-strip will show the folder.
Resetting the folder
By default the storage folder is the LabVIEW temp folder (which by default is the same as the OS temp folder), and can be changed with the browse for folder button. To revert to the temp folder use this button .
The zoom slider allows the user to zoom in and out on the captured image and inspect it in detail. This only affects the preview image and will not change the stored image.
The annotation/sketch toolbars are used to add annotations and sketches/drawings to the capture.
Rectangle: Use shift to draw a square
Oval: Use shift to draw a circle
Arrow: Use shift to limit drawing to one axis (X or Y)
It's possible to alter the color of the annotation (sketch or text), when editing text changing the line coler takes effect immediatly.
The font of the annotation text cannot be altered and is fixed on Arial , the size however can be altered easily.
| || Starts editing text|
Use shift-enter to add anew-line
Use arrow keys to move the positioning of the text around
| || Use this to move the preview window around, this is the default tool of the Annotation Sketch toolbar. It does not change the captured image.|
| || Use this to undo the last edit on the annotation/sketch (4 steps possible), use <ctrl-z> on and and <cmd-z> on .|
| Clear the annotation layer.|
The clean up button will clean up the whole BD (if 'whole' is set as BD option) or the current selection (if 'Selections' is set as BD option). This button is only visible if this option is active (correct LabVIEW version).
The CCT has several key shortcuts for easier access:
|Enter|| Applies the current settings and does a capture or finishes a current text edit|
|F1||Loads the about window centered on the help tab|
|F5||Refreshes the current image|
|Escape|| Closes the CCT without performing a capture or finishes a current text/graph edit|
The API provides an interface to the various functions of the CCT. Its palette is accessible under User.lib\Code Capture Tool.
These VIs are used to activate methods for the CCT.
Create CCT Instance
This VI must be called for every instance of the CCT, it creates a GOOP dataspace that will contain the data of the instance. Calling this VI must be done with a valid VI reference.
This VI will apply the current settings and store the captured image in the CCT instance, additionally it returns the image itself.
This VI will save the image to the path specified by a folder and filename stored in the CCT instance.
Copy to Clipboard
This VI will store the data specified by the clipboard settings to the clipboard.
Destroy CCT Instance
This VI must be called to close the CCT Instance and will free up used memory resources.
Generate File Name
This VI will generate a default filename based on the captured parts and VI name. This filename will not be stored inside the CCT session.
These VIs are used to change properties for the CCT instance.
Set Front Panel Mode
This VI will change the current front panel capture mode.
Set Block Diagram Mode
This VI will change the current block diagram capture mode.
Set Layout Mode
This VI will change the current layout orientation.
Set Clipboard Mode
This VI will change the current clipboard mode.
Set VI Ref
This VI sets the reference of the VI that needs to be captured
This VI will change the folder where the images will be saved.
This VI will change the filename of the stored image.
These VIs are used to retrieve properties from the CCT instance.
Get Front Panel Mode
This VI will read the current front panel capture mode.
Get Block Diagram Mode
This VI will read the current block diagram capture mode.
Get Layout Mode
This VI will read the current layout orientation.
Get Clipboard Mode
This VI will read the current clipboard mode.
Get VI Ref
This VI returns a reference to the that is currently captured in this isntance
This VI will read the folder where the images will be saved.
This VI will read the filename of the stored image.
This submenu shows additional low level functions of the CCT.
Capture Front panel
Use this VI to have direct access to the capturing of a front panel.
Capture Block diagram
Use this VI to have direct access to the capturing of a block diagram.
Show CCT GUI
Use this VI to show the user interface of the CCT.
7.0 container VI
Use this VI if you want to build a source distribution or an executable and need to make sure all dynamic VIs are included. For LabVIEW 7.0 and up.
8.0 container VI (deprecated in version 2.0)
Use this VI if you want to build a source distribution or an executable and need to make sure all dynamic VIs are included. For LabVIEW 8.0 and up, don't forget to include the 7.0 container.
Version 2.0 of the Code Capture Tool installer will automatically select the correct container VI, so an additional 8.x container isn't needed anymore.
|After using a non-default path and resetting it to the default, the new setting (temp) is not used||Solved in version 1.0|
|Installing on Linux fails due to case sensitivity||Solved in version 1.0|
|Capturing a non-visible part on a multi-pane front panel fails||A limitation due to the LabVIEW implementation of panes, most-likely not fixable|
|Saving an empty image returns an error||Solved in version 1.0|
|Opening the CCT from the Getting Started Window locks up LabVIEW||Solved in version 1.0|
|Possible High use of memory||Investigating|
|Impossible to capture FP of locked VI||Investigating|
Release date 1 februari 2013
- Altered GUI
- Added resizable User interface
- Added scroll wheel control of the image
- Added plugin feature
Release date 2 december 2010
- Fixed bug #3121172 for locked VIs (without password protection)
- Added a message dialogue after the Capture button was activated
Release date 29 September 2010
- Fixed a bug that didn't show the images properly on initialization
Release date 20 September 2010
- Added Imgur.com upload
- Added 'Save for Previous Version' snippet function
Release date 15 February 2010
- Added a border around a snippet
- Altered GUI (Preview window is bigger)
- Better key handling with text annotation, support for HOME and END.
- Movement of text annotation with ctrl-left, ctrl-right, up and down
- Movement in a text annotation with left and right
Release date 28 November 2009
- Bugfix release for bug 2905411.
Release date 24 November 2009
- Support for VI snippet creation
- Support for adding comments and drawings
Release date 27 February 2008
- Support for panning of the preview
Release date 7 November 2007
- Support for LabVIEW 7.x and up
- Support for all OS'es
- Support for orientation
- Support for selection
- Support for customized naming
- Support for customized folder
The CCT is licensed under the BSD license