Antoine Chalons Posted February 7, 2009 Report Share Posted February 7, 2009 I'd like to be able to detect a "ROI change" event on an image display control. I can't get exactly what I want with the mouse down and mouse up events so at the moment the only solution I found is to check the ROI at a constant rate and see if it has changed. It sucks ! (submitted as well here) Quote Link to comment
shoneill Posted February 7, 2009 Report Share Posted February 7, 2009 QUOTE (Antoine Châlons @ Feb 6 2009, 11:11 AM) I'd like to be able to detect a "ROI change" event on an image display control.I can't get exactly what I want with the mouse down and mouse up events so at the moment the only solution I found is to check the ROI at a constant rate and see if it has changed. It sucks ! (submitted as well http://digital.ni.com/applications/psc.nsf/default?openform' target="_blank">here) The mouse up event works fine for me unless you want to do some work WHILE resizing the ROI. Shane. Quote Link to comment
Antoine Chalons Posted February 7, 2009 Author Report Share Posted February 7, 2009 QUOTE (shoneill @ Feb 6 2009, 01:15 PM) The mouse up event works fine for me unless you want to do some work WHILE resizing the ROI.Shane. Well, that's also what I did, but it turns out that customer really complain about that because if you release the mouse button when the pointer is not over the image display, there is no event although the ROI has changed. I also tried to with a mouse up event on the pane instead of the image display control but then again when you release the mouse button with the pointer out of the pane.. no mouse up event, but the ROI yes have changed ! Quote Link to comment
bmoyer Posted February 7, 2009 Report Share Posted February 7, 2009 QUOTE (Antoine Châlons @ Feb 6 2009, 07:46 AM) Well, that's also what I did, but it turns out that customer really complain about that because if you release the mouse button when the pointer is not over the image display, there is no event although the ROI has changed.I also tried to with a mouse up event on the pane instead of the image display control but then again when you release the mouse button with the pointer out of the pane.. no mouse up event, but the ROI yes have changed ! I just realized that my application has the same "bug". It's pretty obvious that it didn't work - because I automatically popup a dialog when the ROI change event occurs - but to a new user this could be confusing. Bruce Quote Link to comment
Antoine Chalons Posted February 7, 2009 Author Report Share Posted February 7, 2009 QUOTE (bmoyer @ Feb 6 2009, 01:59 PM) I just realized that my application has the same "bug". It's pretty obvious that it didn't work - because I automatically popup a dialog when the ROI change event occurs - but to a new user this could be confusing.Bruce In the same kind of feedback from customers, there is the slide control that will fire a value change event BEFORE you release the mouse button ! Here again the mouse up event will only work if the pointer is still over the slide when you release it , and add to that that if the slide in on "2", move it without releasing, bring it back to "2" and release, the event is fired... I can't remember exactly how but someone from NI showed me a workaround to that one. For the ROI change, I'm still looking. Quote Link to comment
shoneill Posted February 7, 2009 Report Share Posted February 7, 2009 What version of LV (or is it Vision?) has the "ROI Change Event"? I'm using 8.2 at the moment and I don't seem to be able to find it..... Sounds like a neat idea, but if it doesn't work then..... :headbang: Shane. Quote Link to comment
Antoine Chalons Posted February 7, 2009 Author Report Share Posted February 7, 2009 QUOTE (shoneill @ Feb 6 2009, 02:23 PM) What version of LV (or is it Vision?) has the "ROI Change Event"? I'm using 8.2 at the moment and I don't seem to be able to find it.....Sounds like a neat idea, but if it doesn't work then..... :headbang: Shane. Well.. This is the "Wish List" forum.. As far as I know there is no "ROI change" event in any version, that's why I'm asking for it ! Quote Link to comment
shoneill Posted February 7, 2009 Report Share Posted February 7, 2009 QUOTE (Antoine Châlons @ Feb 6 2009, 02:27 PM) Well.. This is the "Wish List" forum.. As far as I know there is no "ROI change" event in any version, that's why I'm asking for it ! Ah Ok. I see where I misinterpreted this. The "mouse up" event problem when the mouse has left the control is a general problem, not just for this application. I really wish there was an easier way to manage this. It's a real pain to try to compensate for. Some functionality is basically impossible to implement (forcing a "mouse up" event to fire in LV. Shane. Quote Link to comment
Neville D Posted February 7, 2009 Report Share Posted February 7, 2009 How about you add a "Done" boolean that the user clicks when they have finished selecting the ROI? Or else set the Done to be a double-click on the front panel? Neville. Quote Link to comment
Bab Posted February 7, 2009 Report Share Posted February 7, 2009 QUOTE (Antoine Châlons @ Feb 6 2009, 01:46 PM) Well, that's also what I did, but it turns out that customer really complain about that because if you release the mouse button when the pointer is not over the image display, there is no event although the ROI has changed.I also tried to with a mouse up event on the pane instead of the image display control but then again when you release the mouse button with the pointer out of the pane.. no mouse up event, but the ROI yes have changed ! Hi Antoine, what about using the "Mouse Leave" event? If the mouse button was down as the mouse left the image control, then it is likely the ROI was being modified. Just my thoughts on your issue... A+ BaB. Quote Link to comment
Yair Posted February 8, 2009 Report Share Posted February 8, 2009 There are generic workarounds for handling continuous events. You can see a couple in this thread (Ton's post followed by mine). In the CCT, we used a separate loop with a notifier. The event loop sent a notification with each event firing. The processing loop had an explicit wait (which forces the loop to wait) and a wait on the notifier (to get the current data): The other option is doing the actual work in the timeout event and passing the actual timeout in a shift register. Quote Link to comment
shoneill Posted February 9, 2009 Report Share Posted February 9, 2009 QUOTE (Bab @ Feb 6 2009, 10:40 PM) Hi Antoine,what about using the "Mouse Leave" event? If the mouse button was down as the mouse left the image control, then it is likely the ROI was being modified. Just my thoughts on your issue... A+ BaB. Doesn't the ROI continue to be modified after the mouse has "left the building" so to speak? This prevents being able to use the "Mouse leave" as an interaction termination. Shane. Quote Link to comment
Antoine Chalons Posted February 11, 2009 Author Report Share Posted February 11, 2009 QUOTE (shoneill @ Feb 8 2009, 12:41 PM) Doesn't the ROI continue to be modified after the mouse has "left the building" so to speak?This prevents being able to use the "Mouse leave" as an interaction termination. Shane. Indeed ! And that's something to think about because the global rectangle (left, top, right, bottom) can have values "outside of the image" I mean.. when the image display control is displaying a 1000*1000 image, you can set a ROI with negative top and left, and right and bottom can be greater than 1000. That's something to know about to avoid problems. Quote Link to comment
Francois Normandin Posted February 11, 2009 Report Share Posted February 11, 2009 I ran into the same problem this morning and I investigated the "Get Last Event" Method for the image control. I need to poll repeatedly to get the last event fired (but at 25Hz I don't think I'll have a problem for user clicking too fast!). I monitor the "Draw Event". The method returns the tool used (rectangle, circle, etc.) and the coordinates. If you don't use it to actually allow the user to DRAW something, then I think it could work for you. Quote Link to comment
Antoine Chalons Posted February 11, 2009 Author Report Share Posted February 11, 2009 QUOTE (normandinf @ Feb 10 2009, 05:00 PM) I ran into the same problem this morning and I investigated the "Get Last Event" Method for the image control. I need to poll repeatedly to get the last event fired (but at 25Hz I don't think I'll have a problem for user clicking too fast!).I monitor the "Draw Event". The method returns the tool used (rectangle, circle, etc.) and the coordinates. If you don't use it to actually allow the user to DRAW something, then I think it could work for you. http://lavag.org/old_files/monthly_02_2009/post-10515-1234281573.png' target="_blank"> Hmm.. that looks like a better workaround than the one I have now, I'll have a look into it ! Thanks for sharing :thumbup: Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.