gb119 Posted March 4, 2010 Report Share Posted March 4, 2010 Name: Swap Terminals RCF Plugin 1.0.2-8 Submitter: gb119 Submitted: 04 Mar 2010 File Updated: 23 Aug 2010 Category: JKI Right-Click Framework Plugins Version: 1.0.2 LabVIEW Version: 8.6 License Type: BSD (Most common) Swap Termianls RCF Plugin - 1.0.1-7 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Copyright © 2010, Gavin Burnell All rights reserved. Author: Gavin Burnell G.Burnell@leeds.ac.uk"]G.Burnell@leeds.ac.uk[/email]"]G.Burnell@leeds.ac.uk"]G.Burnell@leeds.ac.uk[/email][/email] Distribution: This code was downloaded from the LAVA Code Repository: http://lavag.org/ind...p?app=downloads Description: This is a plugin for the JKI Right Click Framework (version 1.0.2). Ever inserted a primitive like add, subtract, greater than, or less than into a wire and manage to get LabVIEW to wire up the 'wrong' input because you right clicked one pixel the wrong side of the wire ? Ever looked at code and realised that you've got the input terminals hooked up the wrong way round on a select ? Then this plugin is for you, simply select the block diagram primitive, activate the JKI RCF plugins and select 'Swap Terminals'. This plugin will work on any primitve function or 'growable' function that has two and only two inputs and also on the 'Select' and 'In Range and Co-erce' nodes to swap the top and bottom inputs over and rewire the wires. In version 1.1 it will also handle 'Bundle' and 'Bundle by Name' which have two input elements and a special case of two wires that are wired into different terminals of the same node. Dependancies: JKI Tools Right Click Framework >=1.0.2 Support: If you have any problems with this code or want to suggest features: Change Log: 1.0.2-8 Corrected a regression in previous version with bundle/bundle by name nodes. 1.0.1-7 Rereleased as a VIPM Package File built using VIPM 2010. Should have correct package dependencies for RCF Packages 1.0.1.1 Added growable functions with special cases for bundlers and two-wires-to-the-same-node. Refactored the code to kake extending it for other GObject types easier in the future. 1.0.0.1 Initial release on LavaG License: Copyright © 2010 Gavin Burnell 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 2 Quote Link to comment
jcarmody Posted March 4, 2010 Report Share Posted March 4, 2010 Here's a wiring nugget for you. If you have a function on your block diagram with two inputs, you can switch the position of the inputs very easily. If you hover over one of the inputs with your wiring tool (this also works with the auto tool), and you hold down the Ctrl key, your wiring tool will turn into what I call the "switcheroo" tool, which kinda looks like a curly wire. Anyway, with this tool visible, if you simply left click, you'll see the inputs to your function switch places. And for you LabVIEW trivia buffs, I'm pretty sure this feature was introduced long ago by none other than Jeff Kodosky himself. From here. Is yours different? Quote Link to comment
jgcode Posted March 5, 2010 Report Share Posted March 5, 2010 From here. Is yours different? Looks like this version supports the Select and Coerce primitives too! And (from the pic) it looks like you can swap a terminal if no other terminal is yet connected. Cool, nice job Quote Link to comment
MikaelH Posted March 5, 2010 Report Share Posted March 5, 2010 For them who doesn't not it. There is a build function in LabVIEW to swap two wires connected to any 2 input function. Just use the wire tool and press Ctrl+click. //Mikael Quote Link to comment
jgcode Posted March 5, 2010 Report Share Posted March 5, 2010 For them who doesn't not it. There is a build function in LabVIEW to swap two wires connected to any 2 input function. Just use the wire tool and press Ctrl+click. //Mikael A quick note: this is only supported in the more later versions of LabVIEW. Quote Link to comment
Yair Posted March 5, 2010 Report Share Posted March 5, 2010 A quick note: this is only supported in the more later versions of LabVIEW. Such as 7.0? It should be pointed out that the JKI RCF only works in 8.2 and later. Quote Link to comment
jgcode Posted March 5, 2010 Report Share Posted March 5, 2010 Such as 7.0? No, 8.5+ methinks. Quote Link to comment
gb119 Posted March 6, 2010 Author Report Share Posted March 6, 2010 From here. Is yours different? Ok, public egg on face tine... That one had completely passed me by - clearly I don't read the release notes carefully enough when installing new versions (or wsa it only mentioned in a weekly nugget ?) Still my plugin handles the select and coerce primitives and will handle swapping terminals that aren't wired in. I'd like to add code to pick up on two wires that connect the same node and then swap ther terminals, also workign with growable nodes such as build array or bundle into cluster with two inputs might be useful. Quote Link to comment
Yair Posted March 6, 2010 Report Share Posted March 6, 2010 No, 8.5+ methinks. Well, I suggest you readjust your thinksing . It was around in 7.0. Still my plugin handles the select and coerce primitives and will handle swapping terminals that aren't wired in. I'd like to add code to pick up on two wires that connect the same node and then swap ther terminals, Here are some relevant ideas you may wish to vote for: Allow swapping the Select primitive inputs using the "switcheroo" tool Use the wiring tool to swap inputs or outputs which have been wired incorrectly Quote Link to comment
jgcode Posted March 7, 2010 Report Share Posted March 7, 2010 Well, I suggest you readjust your thinksing . It was around in 7.0. I will need to. I didn't know that feature went back that far. I try not to use 7 as much as I can, unless I have to program src for a client that won't upgrade... hmmm that topic sounds familiar.... Quote Link to comment
Falevoz Y. Posted March 8, 2010 Report Share Posted March 8, 2010 I'd like to add code to pick up on two wires that connect the same node and then swap ther terminals, also workign with growable nodes such as build array or bundle into cluster with two inputs might be useful. It would be great if it allow to do circular permutation or symmetric swap on more than 2 inputs elements. I used a few times the RCF plugin that build an array of references, and references were always in the revert order than the one I wanted. It would be great if your tool allow to reorder automatically. Yann Quote Link to comment
Yair Posted March 8, 2010 Report Share Posted March 8, 2010 I used a few times the RCF plugin that build an array of references, and references were always in the revert order than the one I wanted. This is a problem with the Selection List[] property - the elements in that list are grouped by selection (so if you made 3 consecutive selections while pressing shift, you'd have three "groups") and within each group the elements are ordered by their Z-order, for some reason (tabbing order would probably make more sense). In any case, the plugin is open source, so you can modify it to sort by label if you want. If you want it to also keep its current behavior, the RCF supports a configuration dialog, so you could have this as a boolean option. Quote Link to comment
Falevoz Y. Posted March 9, 2010 Report Share Posted March 9, 2010 This is a problem with the Selection List[] property - the elements in that list are grouped by selection (so if you made 3 consecutive selections while pressing shift, you'd have three "groups") and within each group the elements are ordered by their Z-order, for some reason (tabbing order would probably make more sense). In any case, the plugin is open source, so you can modify it to sort by label if you want. If you want it to also keep its current behavior, the RCF supports a configuration dialog, so you could have this as a boolean option. ok. Thanks for your explanation. Apart from this example, don't you think the possibility of swap and permutation on more than 2 inputs elements would be interesting? Yann Quote Link to comment
Yair Posted March 9, 2010 Report Share Posted March 9, 2010 don't you think the possibility of swap and permutation on more than 2 inputs elements would be interesting? I don't just think it would be interesting. I think it's highly desirable. That's why I created an idea in the idea exchange for this - see the link I posted in reply #9. Quote Link to comment
Falevoz Y. Posted March 9, 2010 Report Share Posted March 9, 2010 I don't just think it would be interesting. I think it's highly desirable. That's why I created an idea in the idea exchange for this - see the link I posted in reply #9. great! Quote Link to comment
gb119 Posted March 10, 2010 Author Report Share Posted March 10, 2010 New version (1.1) uploaded. This adds: 1) Handles growable nodes with 2 and only 2 inputs (e.g. build array) 2) Handles bundle/bundle by name with two input elements 3) Handles a selection of two wires which have a common destination node (thus allowing one to swap the wiring when you have more than two inputs on a node). Known issues and non-features: Won't handle the case of two wires wired into tunnels on the same structure (I need to add an extra level of indirection to check whether the two tunnels/shift registers/sequence locals are actually on the same structure). I'm still thinking about the circular permutation of input terminals and wondering how generally iseful it is. Only works on input terminals. I guess I could make it look for both inputs and outputs and generate two menu entries for each case as appropriate. Again, I don't know if I make this sort of wiring error often enough to be bothered. Quote Link to comment
Mark Balla Posted March 16, 2010 Report Share Posted March 16, 2010 Certified 3-15-2010 Placed in LabVIEW API>>JKI Right-Click Framework Plugins Quote Link to comment
gb119 Posted August 22, 2010 Author Report Share Posted August 22, 2010 Released a new build as a VIPM package. Slightly redefined the version numbering so that this really is newer than the previous build. Should have correct dependencies on the RCF packages. Quote Link to comment
Bobillier Posted August 23, 2010 Report Share Posted August 23, 2010 (edited) Thanks for your RCF plugin, but i have find one bug (LV2009) . When i want swap one bundle with two inputs, it's one input and cluster data who are swap, and not the two inputs like wish. One another request, is it possible to add cleanup wire action after each swap to have better appearance of diagram Thanks again Eric Edited August 23, 2010 by Bobillier Quote Link to comment
gb119 Posted August 23, 2010 Author Report Share Posted August 23, 2010 Thanks for your RCF plugin, but i have find one bug (LV2009) . When i want swap one bundle with two inputs, it's one input and cluster data who are swap, and not the two inputs like wish. Oops, so sorry about that. Built the package against the wrong version of the source code . New build 1.0.2-8 fixes the problem. One another request, is it possible to add cleanup wire action after each swap to have better appearance of diagram Will Add this to the TODO list. Shouldn't be very hard - just need to find the wires and then do the cleanup on them. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.