LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

limitting the bounds of a circular screen?

HOW WOULD I LIMIT THE BOUNDS OF MY VI IN MY CASE I HAVE A RADAR SCREEN AND I WANT TO LIMIT ALL MOVEMENTS WITHIN THE SCREEN?
0 Kudos
Message 1 of 19
(3,517 Views)
From the VI's menu bar, goto File >> VI Properties >> Category >> Window Appearance >> Custom >> Customize. Then deselect "Show scroll bars" and "Allow user to resize window".
0 Kudos
Message 2 of 19
(3,517 Views)
Thank you AIS for your answer but in my application I wanted to limit bounds inside a screen that's inside the VI which is the thing I am trying to solve now...
so do you have any idea after running the VI and looking close to what I mean.
0 Kudos
Message 3 of 19
(3,517 Views)
If you want to make sure your object is within the circle radar display, use trigonometry and/or Pythagorean's Principle.
The x,y center of the circle is based on the control's bounds: x =left + width/2; y = top + height/2. For a control that bounds a circle, the radius of the circle = width/2 = height/2.
To place an object using trig, pick an angle and the distance away from the center. (The max distance will be the circle's radius).
x,y is the circle's center.
r is the circle's radius.
z is the desired distance from the center.
z must be less than r.
a is the desired angle.
x1, y1 are the coordinates of the object.
x1 = x + z * cosine(a)
y1 = y - z * sine(a)
y1 uses - not + because 0 is at the top of the screen and y increases as you go
down.
0 Kudos
Message 4 of 19
(3,517 Views)
To add to ALS, you will need to get the location of the circle decoration. I recommend doing this programatically so that you can resize your front panel. To get the referernce in LabVIEW 7, open a VI reference to your VI wire it to the property node set to front panel. This outputs a reference that can be sent to another property node for decorations[]. Index the decoration array (you will probably need to experiment to find the one that is the circle) and get the size of the image. Now you can establish your bounds with some math.

The next thing is to find the mouse location. LabVIEW 7 has a VI for finding a mouse location. It is on the functions >> advanced >> input device control >> acquire input data.
0 Kudos
Message 5 of 19
(3,517 Views)
I think ADEEB is actually using a modified gauge as his radar screen. He's already getting the location and size of that indicator using a property node. I think that's OK.
0 Kudos
Message 6 of 19
(3,517 Views)
I HAVE ANOTHER PROBLEM THAT IS ALL OBJECTS I CAN HAVE ARE OREGINATED FROM LEFT SIDE BECAUSE IN THE PROPERTY NODE THE POSITION SETTINGS ARE ONLY LEFT AND TOP SO HOW CAN HAVE OBJECTS THAT START FROM RIGHT OR BOTTOM.
0 Kudos
Message 7 of 19
(3,517 Views)
The right edge = left + width. Bottom = top + height. To get a object to move right to left, start at the right edge and reduce its position from one iteration to the next until it hits the left edge.
0 Kudos
Message 8 of 19
(3,517 Views)
Thank you Al S. In my haste to help, I assumed the circle was a decoration without actually looking at the block diagram.
0 Kudos
Message 9 of 19
(3,416 Views)
what do you think is the best way to have one of the planes disapear in the center of the scree?
0 Kudos
Message 10 of 19
(3,517 Views)