Jump to content

state machines with very many states


Recommended Posts

I added a menu to the Tree to facilitate expanding & contracting.

Nice work! This tool has quickly become a thing of beauty :)

The only thing I would add is to remove the tree's column header -- this just takes up space.

This has got to be it for today or I'm just going to get annoying...

These changes are all awesome! I won't get annoyed ;)

Link to comment

More improvement request:

  • You should probably disable drag and drop tree item
or, make it able to rearrange states! I hate the built-in method. I'll make it prompt the user in case the drag/drop was an accident.

  • The navigation key (while navigating the tree) do not change the visible frame

I thought about that, too.

I was thinking about making it handle Event Structures as well. I've got some work ahead of me. Thanks for the input.

Link to comment

or, make it able to rearrange states! I hate the built-in method. I'll make it prompt the user in case the drag/drop was an accident.

I was thinking about making it handle Event Structures as well. I've got some work ahead of me. Thanks for the input.

This tool is going to rock (even more)!

Link to comment

or, make it able to rearrange states! I hate the built-in method. I'll make it prompt the user in case the drag/drop was an accident.

I was thinking about making it handle Event Structures as well. I've got some work ahead of me. Thanks for the input.

It rearranges states now, but without prompting the user. (I thought it would get annoying; I can add it later if it's needed/wanted; perhaps as a configurable item.)

I had trouble implementing Undo for this operation so it's not in there. Also, it seems that there's not enough of the Event Structure exposed to let me include that yet.

You can download it here.

PS - I rewrote it using a better State Machine.

Edited by jcarmody
Link to comment

I may be having too much fun with this. Here's another iteration.

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
  • Reorder cases with drag/drop
  • Ctrl+drag/drop to duplicate a case
  • Collapse/expand all tree elements with context men

CaseSelect.zip

Link to comment

Folks, there are problems with the latest version - it's giving me errors at the office that it didn't give me at home. Stay tuned...

EDIT - I've fixed the issues I'm aware of, and added another feature (see below).

Edited by jcarmody
Link to comment

Folks, there are problems with the latest version - it's giving me errors at the office that it didn't give me at home. Stay tuned...

Hi jcarmody

It works fine for me, thank you.

There is a little thing about the vertical scroll. If you scroll down and then resize the window then you can't see the top cases!

Another one. when I close the VI where I use the CaseSelector, hte CaseSelector window don't close! Is that the right behavior?

Regards Bjarne

post-7489-124869558628_thumb.png

Edited by Bjarne Joergensen
  • Like 1
Link to comment

There is a little thing about the vertical scroll. If you scroll down and then resize the window then you can't see the top cases!

Good catch. I had handled similar situations, but not that one.

Another one. when I close the VI where I use the CaseSelector, hte CaseSelector window don't close! Is that the right behavior?

I wanted to avoid polling, but I guess it's worse to have a useless panel floating around. It doesn't do that anymore. Thanks for the feedback.

I've also fixed the issues I mentioned in my previous post.

Jim

CaseSelect8.2.zip

Link to comment

Jim,

I encountered some issues with the latest version (I tried the LV 8.2 version):

  • The delete method is not implemented (instead use this post-121-12487111922_thumb.png)
  • The code is initially broken because the property used in the timeout frame (in 8.2) has a different name than 8.6 (probably)
  • The drag and drop does not work well (sometime it does, sometime frame are swapped [for instance the "exit" frame become the "Event Structure" frame)

Suggestion for improvement:

  • When you duplicate a state, you could pre-populate the new name with the old state name (or ,may be even better, use the prefix such as if the state is "Macro: Initialize" the new state pre-populate name is "Macro:")
  • You may want to consider building the "parse state queue.vi" and "add state to queue.vi" in your llb for people attempting to use this on their own styled state machine.

I noticed that you have no glyph for this plugin yet, so I quickly put one together. Feel free to use it (or not if you don't like it).

post-121-124871173319_thumb.png

Overall this is getting better and better!

Keep up the good work!

PJM

  • Like 1
Link to comment

Wow! I love the drag and drop reordering feature. This is super cool :worshippy:

Here's are new features I'd like to see:

Rearrange Cases >> Alphabetically: I'd love to have a context menu item (in the tree) for "Rearrange Cases >> Alphabetically" (or similar). Note that this should ideally preserve the separators and groupings as are standard in the JKI State Machine.

Link to comment

I encountered some issues with the latest version (I tried the LV 8.2 version):

  • The code is initially broken because the property used in the timeout frame (in 8.2) has a different name than 8.6 (probably)
I've changed this to look at the FP.State.
  • The drag and drop does not work well (sometime it does, sometime frame are swapped [for instance the "exit" frame become the "Event Structure" frame)

I fixed this. I wasn't updating the list so it looked like it wasn't working.

Suggestion for improvement:

  • When you duplicate a state, you could pre-populate the new name with the old state name (or ,may be even better, use the prefix such as if the state is "Macro: Initialize" the new state pre-populate name is "Macro:")
  • You may want to consider building the "parse state queue.vi" and "add state to queue.vi" in your llb for people attempting to use this on their own styled state machine.

These are good ideas. Stay tuned.

I noticed that you have no glyph for this plugin yet, so I quickly put one together. Feel free to use it (or not if you don't like it).

post-121-124871173319_thumb.png

Thanks, it's perfect.

I don't have LV 8.2 to test on and really appreciate your feedback.

The latest version is here.

Jim

  • Like 1
Link to comment
  • 2 weeks later...

Cool! Let me know if you need any help.

I need help.

I'm having trouble with the VI I'm calling dynamically. What's the trick to building it into a package?

Thanks,

Jim

PS - this doesn't feel like the right place to be asking for help with VIPM...

Link to comment

Any easy way to add dynamic VI into a VI that is calling it is placing the VI inside a Static VI Reference Node:

staticviref.gif.

This might be what you're after.

Ton

This is the way I normally do it.

Thought I would mention that Sciware likes to do it this way with the advantage being you will know straight away if the dynamic VI is broken - this way makes a lot of sense.

  • Like 1
Link to comment

You can make it reentrant using the Execution.IsReentrant property. Then don't forget to set the Options terminal to 0x08 on the "Open VI reference" node.

Two things:

  1. That worked. Thank you.
  2. VI Snippets are meaningless to me because we decided that there was no benefit in maintaining our SLA. I'll be working in 8.6.1 FOREVER...

Link to comment

VI Snippets are meaningless to me because we decided that there was no benefit in maintaining our SLA. I'll be working in 8.6.1 FOREVER...

Well, the snippet is still useful as an image even though you don't have LV2009. My gripe is that NI could have added a text heading to indicate what LV version was used to create the snippet.

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.