Jump to content


Photo
- - - - -

state machines with very many states


  • Please log in to reply
65 replies to this topic

#21 jcarmody

jcarmody

    The 500 club

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

Posted 22 July 2009 - 02:05 PM

*
POPULAR

Done.


Fixed issue where letting go of the scroll bar inside the tree acts the same as a selection. I didn't like that behavior.

Attached Files


Resistance is Mandatory

No rulers
No masters
NO CONSENT

 


#22 PJM_labview

PJM_labview

    The 500 club

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

Posted 22 July 2009 - 04:12 PM

*
POPULAR

Fixed issue where letting go of the scroll bar inside the tree acts the same as a selection. I didn't like that behavior.


I have a couple of comments:

  • I think that using system controls would look a lot better than 3D control
RCF JC Plugin1 image1.png --> RCF JC Plugin1 image2.png

  • When you create your custom menu you have:
> CaseSelector : My_Menu_Tag
<
  • Instead use this (because the ">" and "<" are only needed if you have SubMenu(s))
CaseSelector : My_Menu_Tag
  • Additionally, it is recommend that you use some meaningful tag, so replace "My_Menu_Tag" by "Case_Selector_Tag" for example.
Otherwise this look pretty good!

PJM

#23 Jim Kring

Jim Kring

    packages everywhere!

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

Posted 22 July 2009 - 04:25 PM

Fixed issue where letting go of the scroll bar inside the tree acts the same as a selection. I didn't like that behavior.


Hi Jim. Thanks for keeping the new versions coming! I'm sorry for not commenting more on the code. The UI is so much easier and more fun to critique. Along those lines:

* I'd get rid of the big "OK" button -- move it off screen and just let the user press the Close Window button to close the window. This will really stream-line the usability, IMO.
* It would be nice if the vertical scroll bar would auto-hide itself if it is not needed -- there is a VI that can do this automatically for you, but I can't recall off-hand where it is located (somewhere in vi.lib perhaps)

#24 jcarmody

jcarmody

    The 500 club

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

Posted 22 July 2009 - 05:22 PM

I have a couple of comments:

  • I think that using system controls would look a lot better than 3D control
  • Instead use this (because the ">" and "<" are only needed if you have SubMenu(s))
CaseSelector : My_Menu_Tag
  • Additionally, it is recommend that you use some meaningful tag, so replace "My_Menu_Tag" by "Case_Selector_Tag" for example.

Done, thanks for the feedback.

* I'd get rid of the big "OK" button
* It would be nice if the vertical scroll bar would auto-hide itself if it is not needed

Done. I had added the OK button because I had always considered it bad practice to stop your program that way; it wasn't in the early versions. I agree though, it is nicer without it.

Attached Files


Resistance is Mandatory

No rulers
No masters
NO CONSENT

 


#25 jcarmody

jcarmody

    The 500 club

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

Posted 22 July 2009 - 06:16 PM

I added a menu to the Tree to facilitate expanding & contracting. This has got to be it for today or I'm just going to get annoying...

Attached Files


Resistance is Mandatory

No rulers
No masters
NO CONSENT

 


#26 Jim Kring

Jim Kring

    packages everywhere!

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

Posted 22 July 2009 - 06:59 PM

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 ;)

#27 jcarmody

jcarmody

    The 500 club

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

Posted 22 July 2009 - 08:04 PM

*
POPULAR

I won't get annoyed ;)

In that case, here's another iteration.

Attached Files


Resistance is Mandatory

No rulers
No masters
NO CONSENT

 


#28 Jim Kring

Jim Kring

    packages everywhere!

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

Posted 22 July 2009 - 08:10 PM

In that case, here's another iteration.


Beautiful and simple :)

#29 jgcode

jgcode

    LabVIEW Renegade

  • OpenG
  • PipPipPipPipPipPip
  • 2,397 posts
  • Location:Australia
  • Version:LabVIEW 2009
  • Since:2005

Posted 23 July 2009 - 01:45 AM

In that case, here's another iteration.


Awesome plugin - well done :thumbup1:

#30 PJM_labview

PJM_labview

    The 500 club

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

Posted 23 July 2009 - 03:33 PM

In that case, here's another iteration.


More improvement request:

  • You should probably disable drag and drop tree item
  • The navigation key (while navigating the tree) do not change the visible frame
PJM

#31 jcarmody

jcarmody

    The 500 club

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

Posted 23 July 2009 - 04:16 PM

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.

Resistance is Mandatory

No rulers
No masters
NO CONSENT

 


#32 Jim Kring

Jim Kring

    packages everywhere!

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

Posted 23 July 2009 - 09:47 PM

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)!

#33 jcarmody

jcarmody

    The 500 club

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

Posted 25 July 2009 - 07:15 PM

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, 25 July 2009 - 09:23 PM.

Resistance is Mandatory

No rulers
No masters
NO CONSENT

 


#34 jcarmody

jcarmody

    The 500 club

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

Posted 26 July 2009 - 11:54 PM

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

Attached Files


Resistance is Mandatory

No rulers
No masters
NO CONSENT

 


#35 Bjarne Joergensen

Bjarne Joergensen

    Very Active

  • Members
  • PipPipPip
  • 89 posts
  • Version:LabVIEW 8.2
  • Since:1997

Posted 27 July 2009 - 09:04 AM

Hi

I would like to use this tool, but I am using LV8.2.1 and the tool is in 8.6.
The RCF supports LV from 8.2.0 so it would be wonderful if plugins was distributed in that version, pleasePosted Image

best regards
Bjarne

Edited by Bjarne Joergensen, 27 July 2009 - 09:08 AM.


#36 jcarmody

jcarmody

    The 500 club

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

Posted 27 July 2009 - 09:58 AM

Hi

I would like to use this tool, but I am using LV8.2.1 and the tool is in 8.6.
The RCF supports LV from 8.2.0 so it would be wonderful if plugins was distributed in that version, pleasePosted Image

best regards
Bjarne


Try this. Thanks for pointing that out.

Attached Files


Resistance is Mandatory

No rulers
No masters
NO CONSENT

 


#37 jcarmody

jcarmody

    The 500 club

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

Posted 27 July 2009 - 11:26 AM

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, 27 July 2009 - 01:36 PM.

Resistance is Mandatory

No rulers
No masters
NO CONSENT

 


#38 Bjarne Joergensen

Bjarne Joergensen

    Very Active

  • Members
  • PipPipPip
  • 89 posts
  • Version:LabVIEW 8.2
  • Since:1997

Posted 27 July 2009 - 11:53 AM

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

Attached Thumbnails

  • CaseSelector.png

Edited by Bjarne Joergensen, 27 July 2009 - 12:05 PM.


#39 jcarmody

jcarmody

    The 500 club

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

Posted 27 July 2009 - 01:35 PM

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

Attached Files


Resistance is Mandatory

No rulers
No masters
NO CONSENT

 


#40 PJM_labview

PJM_labview

    The 500 club

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

Posted 27 July 2009 - 04:24 PM

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 rcf remove case.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).

rcf case selector glyph.png

Overall this is getting better and better!

Keep up the good work!

PJM