Jump to content


Photo
- - - - -

[CR] CaseSelect


  • Please log in to reply
28 replies to this topic

#1 jcarmody

jcarmody

    The 500 club

  • Premium Member
  • 788 posts
  • Location:North Carolina, United State, Earth
  • Version:LabVIEW 2012
  • Since:2007

Posted 08 August 2009 - 03:02 PM

*
POPULAR

Posted Image

Name: CaseSelect
Submitter: jcarmody
Submitted: 08 Aug 2009
File Updated: 03 Jan 2011
Category: JKI Right-Click Framework Plugins
LabVIEW Version: 8.2
License Type: BSD (Most common)

Copyright @ 2010, Jim Carmody
All rights reserved.

Author:
Jim Carmody
jim@jamescarmody.com


CaseSelect is a plugin for the JKI Right-Click Framework for LabVIEW and is distributed as a VIPM package.

Introduction

I make State Machines with many, many states; perhaps you do, too. I don't like scrolling through long lists of states and have wanted to have a scroll bar on the drop-down list. This plug-in launches a new panel with a Tree control (one that has a scroll bar) containing each of the Case names.


Features

  • Select a case in the CaseSelect window and it comes to the front in your Block Diagram
  • JKI State Machine states are indented in the Tree control
  • CaseSelect window floats and can be resized
  • Open multiple CaseSelect windows at the same time to work with more than one Case Structure
  • Select a case with the mouse or navigate the Tree using arrow keys
  • Insert & delete states with Insert/Delete keys or context menu (Insert suggests new name based on section header)
  • Reorder cases with drag/drop
  • Ctrl+drag/drop to duplicate a case (suggests new name based on section header)
  • Collapse/expand all tree elements with context menu
  • Sort cases alphabetically (preserving the section headers of a JKI State Machine)
New in 2.0.1
  • I'm pretty bad at keeping track, but here are a few...
  • Renaming a case triggers a search-and-replace for all instances of the old name in all String Constants
  • Select a String Constant in your VI and double-click a case in CaseSelect and that will be appended to the String Constant - build macros quickly
New in 3.0.0.4 (currently only for LabVIEW 2010)
  • I'm still pretty bad at keeping track, but I made a new package.
  • Added navigation buttons to move back and forth through the states you've visited (history) ~ still buggy
The original discussion of this can be found here.

Click here to download this file

Resistance is Mandatory

No rulers
No masters
NO CONSENT

 


#2 Ton Plomp

Ton Plomp

    How many lines per hour? Zero!

  • Premium Member
  • 1,973 posts
  • Location:Netherlands
  • Version:LabVIEW 2012
  • Since:2000

Posted 27 August 2009 - 06:34 PM

I downloaded the VIP, and VIPM tells me it is 8.6 and up...
Is that correct?

EDIT:
I found an 8.2 version, could the CR version be updated?

And while i am at it, some ideas:

Show/hide label (and edit) of the case structure
Auto-hide and show the dialog when the owning VI is not the top-level BD anymore.

Ton

#3 jcarmody

jcarmody

    The 500 club

  • Premium Member
  • 788 posts
  • Location:North Carolina, United State, Earth
  • Version:LabVIEW 2012
  • Since:2007

Posted 31 August 2009 - 11:24 PM

I downloaded the VIP, and VIPM tells me it is 8.6 and up...
Is that correct?

EDIT:
I found an 8.2 version, could the CR version be updated?

I meant to have the VIP in 8.2 but ran into a snag. I need to try repackaging it.

Auto-hide and show the dialog when the owning VI is not the top-level BD anymore.

I tried to implement this idea but couldn't figure out how to do it. Any ideas?

Resistance is Mandatory

No rulers
No masters
NO CONSENT

 


#4 Ton Plomp

Ton Plomp

    How many lines per hour? Zero!

  • Premium Member
  • 1,973 posts
  • Location:Netherlands
  • Version:LabVIEW 2012
  • Since:2000

Posted 01 September 2009 - 06:04 AM

I tried to implement this idea but couldn't figure out how to do it. Any ideas?

There is a 'VI Activation' event that you could use, however it has been a while since I used it.

Ton

#5 PJM_labview

PJM_labview

    The 500 club

  • JKI
  • 758 posts
  • Version:LabVIEW 2009
  • Since:1998

Posted 01 September 2009 - 03:23 PM

There is a 'VI Activation' event that you could use, however it has been a while since I used it.


Yes, this is what you need. This is actually what the RCF is using.

PJM

#6 jcarmody

jcarmody

    The 500 club

  • Premium Member
  • 788 posts
  • Location:North Carolina, United State, Earth
  • Version:LabVIEW 2012
  • Since:2007

Posted 02 September 2009 - 04:24 PM

Auto-hide and show the dialog when the owning VI is not the top-level BD anymore.

Here's what I came up with. I'm having trouble making an 8.2 version that works, but I have a long weekend coming up :).

Attached Files


Resistance is Mandatory

No rulers
No masters
NO CONSENT

 


#7 jcarmody

jcarmody

    The 500 club

  • Premium Member
  • 788 posts
  • Location:North Carolina, United State, Earth
  • Version:LabVIEW 2012
  • Since:2007

Posted 14 September 2009 - 01:30 PM

Here's another 8.6 version with a "Rename Case" option.

The .llb is version 8.2. I'd appreciate it if someone could test it and tell me if it works. I'd then be able to make a new VIP and update the main download.

Thanks,
Jim

Attached Files


Resistance is Mandatory

No rulers
No masters
NO CONSENT

 


#8 Ton Plomp

Ton Plomp

    How many lines per hour? Zero!

  • Premium Member
  • 1,973 posts
  • Location:Netherlands
  • Version:LabVIEW 2012
  • Since:2000

Posted 14 September 2009 - 02:20 PM

The .llb is version 8.2. I'd appreciate it if someone could test it and tell me if it works.

Nope, you set the reentrant type of the deamon VI, however LabVIEW 8.2 only supports plain reentrancy (reallocate), so you need to remove this property from you 8.2 version (I don't see any real harm done by creating a specific clone per structure, it is in a VI always active, and it will be killed when the VI is closed (I hope).

However I couldn't find the rename option (8.2), how should I do a rename? I was hoping for F2, or a right click option.

Ton

#9 jcarmody

jcarmody

    The 500 club

  • Premium Member
  • 788 posts
  • Location:North Carolina, United State, Earth
  • Version:LabVIEW 2012
  • Since:2007

Posted 15 September 2009 - 11:27 AM

However I couldn't find the rename option (8.2), how should I do a rename? I was hoping for F2, or a right click option.

It's a right-click menu option on mine. What do you see?

rename.PNG

Here's an 8.6 version implementing the F2 to rename.

I used the reentrancy I did because I was having trouble making a VIPM package that would call the vi dynamically. Perhaps I won't be able to do that for 8.2

Thanks for your help.
Jim

Attached Files


Resistance is Mandatory

No rulers
No masters
NO CONSENT

 


#10 jcarmody

jcarmody

    The 500 club

  • Premium Member
  • 788 posts
  • Location:North Carolina, United State, Earth
  • Version:LabVIEW 2012
  • Since:2007

Posted 18 September 2009 - 06:15 PM

Here's another version (for LV8.6) that sizes the panel to the size of the tree (based on the number of frames in the Case Structure) or the height of the screen, whichever is smaller. I like this so I don't have to resize it once it opens.

Attached Files


Resistance is Mandatory

No rulers
No masters
NO CONSENT

 


#11 Michael Aivaliotis

Michael Aivaliotis

    MindFreak

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

Posted 18 September 2009 - 06:55 PM

Here's another version (for LV8.6) that sizes the panel to the size of the tree (based on the number of frames in the Case Structure) or the height of the screen, whichever is smaller. I like this so I don't have to resize it once it opens.

Can you update your official downloadto reflect your latest and greatest changes? Or is it not ready for prime time yet?
Thank You
Michael Aivaliotis

VI Shots

#12 jcarmody

jcarmody

    The 500 club

  • Premium Member
  • 788 posts
  • Location:North Carolina, United State, Earth
  • Version:LabVIEW 2012
  • Since:2007

Posted 18 September 2009 - 09:11 PM

Can you update your official downloadto reflect your latest and greatest changes? Or is it not ready for prime time yet?

I'll do that when I have time to update the description with the new features. What I really want to do is make a VIP but I'm struggling to make it work in LV8.2. I've killed LabVIEW on my home computer so I can't work on it until next week.

The discussion about my troubles is a few posts up. I believe I can make it work in 8.2 but the VIP won't, or, at least that's how I remember the trouble I had making the first package.

Resistance is Mandatory

No rulers
No masters
NO CONSENT

 


#13 jcarmody

jcarmody

    The 500 club

  • Premium Member
  • 788 posts
  • Location:North Carolina, United State, Earth
  • Version:LabVIEW 2012
  • Since:2007

Posted 31 October 2009 - 11:38 PM

 

[...] I'm struggling to make it work in LV8.2.

I've tweaked the version for LV 8.2 but am not happy with it; it has fewer functions than the 8.6 version.

  • Drag-and-drop of cases doesn't work.  The image below shows how I rearrange cases; it works in 8.6 but doesn't do anything in 8.2.
  • Insert and rename a case work, but delete doesn't.  Attempting it causes an error.
nomethods.jpg  

I've attached an llb for 8.2.  I think I'm done developing this for 8.2 unless someone can help...  Please?  Thanks.

Attached Files


Resistance is Mandatory

No rulers
No masters
NO CONSENT

 


#14 Ton Plomp

Ton Plomp

    How many lines per hour? Zero!

  • Premium Member
  • 1,973 posts
  • Location:Netherlands
  • Version:LabVIEW 2012
  • Since:2000

Posted 04 January 2010 - 08:24 PM

It would be nice if we could drag and drop a case name into the VI.
For instance by selecting a case with the 'ctrl' down.
This would not show the case, but allow for a drag and drop of the case name.
If you drop this into a string constant it would contain the name of the case you selected.

Ton

#15 jcarmody

jcarmody

    The 500 club

  • Premium Member
  • 788 posts
  • Location:North Carolina, United State, Earth
  • Version:LabVIEW 2012
  • Since:2007

Posted 04 January 2010 - 11:34 PM

It would be nice if we could drag and drop a case name into the VI.
For instance by selecting a case with the 'ctrl' down.
This would not show the case, but allow for a drag and drop of the case name.
If you drop this into a string constant it would contain the name of the case you selected.

Ton

I think I understand.  It's an interesting idea that I'd probably use myself.  It would be neater, perhaps, to drop it as a String constant instead of into one (unless you're building a macro).  I've added it to my list; lemme see what I can do.  

I've never tried to control a drag-drop operation from one VI into another.  Could be fun.  :wacko:

Resistance is Mandatory

No rulers
No masters
NO CONSENT

 


#16 Jim Kring

Jim Kring

    packages everywhere!

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

Posted 08 January 2010 - 10:27 PM

Has there been any thought given to supporting the Event Structure, in addition to Case Structures? I'd like to be able to use this tool to display and navigate Event Structures, too -- that would be cool :)

I love this tool!

#17 jcarmody

jcarmody

    The 500 club

  • Premium Member
  • 788 posts
  • Location:North Carolina, United State, Earth
  • Version:LabVIEW 2012
  • Since:2007

Posted 09 January 2010 - 12:33 AM

Has there been any thought given to supporting the Event Structure, in addition to Case Structures?

I started with plans to include all multi-frame structures but immediately eliminated support for Stacked Sequences and soon found that an Event Structure's frame names aren't accessible.  I asked a question about this on NI's API community here, and it was added to a list of desired access to properties/methods here.  I thought there was another discussion with more comments, but I haven't been able to find anything.  I don't know if anything new was exposed in LV2009 because I don't have it yet.  It's on my list of features to add.

Resistance is Mandatory

No rulers
No masters
NO CONSENT

 


#18 Jim Kring

Jim Kring

    packages everywhere!

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

Posted 09 January 2010 - 12:39 AM

I started with plans to include all multi-frame structures but immediately eliminated support for Stacked Sequences and soon found that an Event Structure's frame names aren't accessible. I asked a question about this on NI's API community here, and it was added to a list of desired access to properties/methods here. I thought there was another discussion with more comments, but I haven't been able to find anything. I don't know if anything new was exposed in LV2009 because I don't have it yet. It's on my list of features to add.


Cool, thanks for the update -- I hope NI does add this to the Scripting APIs.

Also -- just a thought -- It might be worthwhile to include a Roadmap section on the main page for the this tool, so that users (like me) can see what's in the works and any related info about why certain features are not possible due to scripting limitations.

Cheers,

#19 jcarmody

jcarmody

    The 500 club

  • Premium Member
  • 788 posts
  • Location:North Carolina, United State, Earth
  • Version:LabVIEW 2012
  • Since:2007

Posted 27 April 2010 - 11:10 AM

It would be nice if we could drag and drop a case name into the VI.
For instance by selecting a case with the 'ctrl' down.
This would not show the case, but allow for a drag and drop of the case name.
If you drop this into a string constant it would contain the name of the case you selected.

Ton

Ton,

I tried this but gave up when it didn't fall into place quickly, but I have uploaded CaseSelect 2.0.0 which contains my interpretation of your suggestion. It works by selecting the String Constant you want to add new cases to, you then double-click cases in CaseSelect to add them to the String Constant. I think it's faster this way than do drag-n-drop; it sure was easier to implement. It does switch cases as you click, but you can use the right-click context menu to highlight the selected String Control when you're done.

I've also added a feature to the renaming function. It finds all instances of the case being renamed and replaces them with the new name.

Jim

Resistance is Mandatory

No rulers
No masters
NO CONSENT

 


#20 jcarmody

jcarmody

    The 500 club

  • Premium Member
  • 788 posts
  • Location:North Carolina, United State, Earth
  • Version:LabVIEW 2012
  • Since:2007

Posted 18 September 2010 - 12:33 PM

I've uploaded version 3.0.0.4. I'll make a screen cast at the intersection of free time and a functioning home computer.

Resistance is Mandatory

No rulers
No masters
NO CONSENT