Jump to content

[CR] Swap Terminals RCF Plugin 1.0.2-8


Recommended Posts

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

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

  • Like 2
Link to comment

 

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? 

Link to comment

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.

Link to comment

From here. Is yours different?

Ok, public egg on face tine... :oops:

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.

Link to comment

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

Link to comment

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

Link to comment

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.

Link to comment

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

Link to comment

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.

Link to comment

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.

Link to comment
  • 5 months later...

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.

post-5178-041611800 1282551244_thumb.jpg

One another request, is it possible to add cleanup wire action after each swap to have better appearance of diagram

Thanks again

Eric

Edited by Bobillier
Link to comment

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.

post-5178-041611800 1282551244_thumb.jpg

Oops, so sorry about that. Built the package against the wrong version of the source code :wacko:.

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.

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.