LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to move control in front panel at run time


Sonali wrote:

If I want to rotate one more control over it (obviously Train), how to do it?              


You can use a Picture ring to do a motion picture kind of thing.

 

See the attached VI.

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 11 of 23
(2,005 Views)

Yes its moving but in my application if the main pict control contain 1 Km track and I want 2 Km long track, then I need to drag the track ( image inside the pict control) twice anywhere* in FP to make it 2 Km. Is it possible? 

                                                        - thank you

0 Kudos
Message 12 of 23
(2,002 Views)

"Sonali" <x@no.email> wrote in message
news:1235646628340-860808@exchange.ni.com...
> Yes its moving but in my application if the main pict control contain 1 Km
track and I want 2 Km long track, then I need to drag the track ( image
inside the pict control) twice anywhere* in FP to make it 2 Km. Is it
possible?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- thank you

You should really look into the picture control.

Regards,

Wiebe.


0 Kudos
Message 13 of 23
(1,991 Views)

In reply #12 of this thread I posted a mod of Ton's example that let you drop an image when you click on a Picture control.

 

THis thread has a collection of links to posting with Picture examples.

 

Post #33 of this thread has an example I posted where I determine which object in a picture control was clicked.

 

Comment:

 

Application that involve the Picture control are seldom trivial.

 

Ben

 

 

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 14 of 23
(1,975 Views)

Thanks all,

      If I use Large Picture Control( in attach file) How to drag the Ring control image anywhere on pict control. I'm new for LabVIEW, I want to know if it is possible, so that I can use it in future application.

                                                -      Thanks. 

0 Kudos
Message 15 of 23
(1,958 Views)

Sonali,

 

Everything, almost everything except creating the GOD, is possible in LabVIEW.

 

But, you need to dig deeper for this...

 

I understand that for a beginner, this kind of animation/motion picture project is a too much (t)ask, but you have to live with it.

 

If you read & study Ben's post about using the LV Picture Control totally, then I m sure that you can jumpstart your task somewhat with ease.

 

Try it out & post here back...

 

The most important thing in LabVIEW code development:

 

Always put a small Wait timer inside the while loop. Else it ll spin infinitely & consume all your CPU resource.

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 16 of 23
(1,950 Views)

Thank You parthabe,

         I gone through examples of drag n drop and tried to drag the same ring image to pict control but could not get it. I want to ask can I use same control to drop the image from different ring indicators? As of now I used only one ring indicator. Please help me.

                                                   - Thank You in advance

                                         

Download All
0 Kudos
Message 17 of 23
(1,934 Views)

Sonali,

 

I have never used the Picture control to a very greater extent. So, I may not be able to give you an example.

 

But I m pretty sure that we can drop many objects [controls/indicators] into one Picture control in different places inside it, by looking for the non-white spaces in it, which means that there exists already an object in that location.

 

This is what Ben has suggested in the Picture Control thread, I think...

 

Anybody please correctc if my understanding is wrong.

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 18 of 23
(1,927 Views)

Sonali,

 

Parthabe gave you good advice.

 

1) Your example is using a proprty node that is a bug meaning it should not exist for the Pictu ring.

 

2) PLEASE look at the example I linked that uses Ton's dynamic event example. It pulls the IMAGE (not the data) from the ring and places where ever you click in the picture.

 

3) To extend that example so you can see the dragging, then you can watch for mouse moves (after they have started the drag). The coordinates of the mouse can then be used to position the ring control (property node >>> position) to have the pict ring follow the mouse.

 

4) Whn you see Mouse up, grab the image (see example in Ton's thread) hide the pict ring and insert the image in the picture.

 

So you will have to track mouse down up move etc. There is also some postion translation required to convert screen coordinates to picture but those are "just details".

 

Have fun, post your code whne you get stuck. Since it is train realted, I may even look at it this week-end. Smiley Wink

 

Ben

 

PS see post about my LabVIEW controlled model railroad in this thread. Here is a preview (please note LV GUI on Laptop).

 

Message Edited by Ben on 02-27-2009 06:15 AM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 19 of 23
(1,909 Views)

"parthabe" <x@no.email> wrote in message
news:1235733026190-861671@exchange.ni.com...
> Sonali,&nbsp;I have never used the Picture control to a very greater
extent. So, I may not be able to give you an example.&nbsp;But I m pretty
sure that we can drop many objects [controls/indicators] into one Picture
control in different places inside it, by looking for the non-white spaces
in it, which means that there exists already an object in that
location.&nbsp;This is what Ben has suggested in the Picture Control thread,
I think...&nbsp;Anybody please correctc if my understanding is wrong.

You don't "drop" stuff on a picture control. You draw in it. And you have to
handle events (for instance a drop event), and respond to that by drawing
the appropiate stuff in the picture control. Not sure if that's what you
ment.

Regards,

Wiebe.


0 Kudos
Message 20 of 23
(1,901 Views)