02-14-2011 11:53 PM
I am attaching something I wrote up today. I think this is a long overdue feature (heck, maybe it's in LabVIEW already and I don't know about it.) Furthermore, I'd be willing to bet it's in the JKI right-click framework already. But, anyways, hopefully some people can find this useful. This QD shortcut will alphabetize all cases in your case structure. Let me know if there are any scenarios where it's not working as expected. I haven't done much testing with it.
02-15-2011 05:21 AM
02-15-2011 11:19 AM
wah wahhhhhhhhhh
02-15-2011 11:35 AM
@for(imstuck) wrote:
(heck, maybe it's in LabVIEW already and I don't know about it.)
With three or more Cases (or Events or Subdiagrams), Right-Click -> Rearrange Cases -> Sort (Button)
Don't be dismayed, the ability to go from "I wish LabVIEW would to this" to making it happen via QD,RCF the Tools menu, or whatever should serve you well.
02-15-2011 12:50 PM
Firing up LV10, the code looks pretty good (helps to have a nice template). Let me help you in the marketing department instead. You left out an important detail, your shortcut performs a case insensitive sort which I actually find to be useful. As Ben would say, create the need, then fill it.
"Who in their right mind would do a simple ascii sort when you really want to alphabetize your cases? Nobody, now with this spiffy QD shortcut you can quickly and easily do the sensible thing in just a couple of clicks."
Now I am starting to wonder how I got along without it. Well done.
(Now just update the undo transaction name).
02-15-2011 03:22 PM - edited 02-15-2011 03:24 PM
@Darin.K wrote:
(Now just update the undo transaction name).
Thanks for pointing this out. Actually I did do this but forgot to set as default before saving. I assume this is something most people can do on their own though so I'll leave that up to you
I also like the ability that I can hit ctrl+A to select everything and it will sort all case structures on the diagram rather than right clicking every one.
02-15-2011 03:33 PM
@for(imstuck) wrote:
I also like the ability that I can hit ctrl+A to select everything and it will sort all case structures on the diagram rather than right clicking every one.
Careful with that move, just remember that numerical order can be different than alphabetical order, as can enum order. What happens when you try it with True/False cases?
I am a little worried about your apparent fondness for String based Case Structures....
And a final tidbit of advice based on my experience: Doing 98% of the work for us in no way spares you from complaints that we still have to do the remaining 2% (ie. change the transaction name).
02-15-2011 04:27 PM
Great shortcut! I've added it to the List of Community Quick Drop Keyboard Shortcuts page.
02-15-2011 06:37 PM - edited 02-15-2011 06:38 PM
@Darin.K wrote:
Careful with that move, just remember that numerical order can be different than alphabetical order, as can enum order. What happens when you try it with True/False cases?
I am a little worried about your apparent fondness for String based Case Structures....
And a final tidbit of advice based on my experience: Doing 98% of the work for us in no way spares you from complaints that we still have to do the remaining 2% (ie. change the transaction name).
Acccctually, I never use string based for state machines, but let's not start that argument!
I'm a bit confused what the order has to do with it, it seems to work for string based, enum, and True/False structures. If you sort True/False it will put False first. If you use enum, it gets the enum text and sorts based on that.Can you give an example?
02-15-2011 06:46 PM
I do not doubt that it 'alphabetizes' properly, only that I find the natural ordering for enums to be enum order and for numbers to be numerical order. That is why I would be hesitant to Ctrl-a Ctrl-space Ctrl-whatever. Do you actually get False then True for a boolean case, I do not think you can do that by hand?
Are you going to extend to Event Structures?