11-20-2009 03:07 PM
In my spare time I have written a little tool to help me wire the connector pane, similar in spirit to the icon editor. The eyestrain and wrist pain from going back and forth across the FP was one thing, but all of my mice seem to be junky making it very hard to hit some of the small connectors. Enter LV scripting again. My question is, how can I tie this into the LV IDE. Right now I put an LLB into my project folder and I can call the editor from the 'Tools' menu. This is not bad, but my dream would be to hook into the right-click menu used to launch the icon editor. Is this possible? I thought of editing the icon editor to give me a choice, but that seems clunky.
If you want to play with my editor, I have attached a copy. Put this LLB into your project folder (LV8.6 up) and after you relaunch LV, you should have an 'Edit Connector Pane...' entry in the tools menu. Select this item to edit that VIs connector pane. Still a work-in-progress, but I am never going back to the old-fashioned way. Before I take it to the next level, I'd like to know how to tie it in.
I may add rotation, but the next connector pane I rotate will be my first. This version is password protected since I don't want anybody who may take the CLD exam seeing how I stuff a QSM into the Timeout event case to save an extra loop.
The basics: On the left you have an image of the FP, you can select the target control by clicking in the image (if you like doing it the hard way). In the connector pane on the right, clicking drops the target into a connection, and auto-increments the target. You can use up and down arrows to select the target control. If you click an existing connection, the target is dropped and the old connection becomes the new target. Shift-clicking will grab an existing connection. Left and right arrows change the wire rule. Commit makes the changes to the VI. If the button says 'Close' all changes are commited and the VI will exit when you press it, if it says 'Cancel' pressing it will discard the last set of changes. Notice that you can also add descriptions to the controls.
11-20-2009 05:16 PM - edited 11-20-2009 05:18 PM
11-20-2009 06:51 PM
The RCF is on my hit-list of things to master, but in this case I feel that the Tools menu is a better option (can't seem to add a keyboard shortcut though). I do have a few tools that I think will make very interesting plug-ins.
Along those lines, I am a little torn between Quick-Drop plug-ins and RCF plug-ins. I think I know two user's opinions, but I am also curious how widely adopted either or both approaches are. I feel like they both add that one extra step that doesn't feel quite right, but perhaps it becomes natural. Granted, they both can still be timesavers with the right plug-ins even with the extra clicks.
11-20-2009 06:52 PM
In case your interested in pursuing your own solution for right click integration, here is a snippet that gets the mouse button, coordinates and modifier using .Net. Sometimes I like to solve my own problems to expand my own knowledge, never know where it might come in handy.
I guess the JKI right click framework is great, but having to install that package delivery system really gets under my skin personally. But then again, it probably has its perks too. To each their own I guess. :manwink:
Bear in mind this snippet is a proof of concept only, the MSDN API, I stumbled across looking to solve another problem. So no error handling or even proper coding technique. The next step would be to actually get the mouse button to fire a call back event, so you do not need to continuously monitor, but then again, I am filing this in the sandbox to play with another day.
11-21-2009 04:45 AM
You know there are native LabVIEW crossplatform functions to get the button status and location:
Ton
11-21-2009 05:10 AM
Yes, but none that trip events! You must continually poll the device. Not always a good solution.
Additionally using the windows API, you can perform filter events, thus 'ignoring' the action if you choose.