Jump to content

Graphical Manipulation Programmatically


Yair

Recommended Posts

Hi,

I was wondering if anyone could help me with two questions I have regarding the front panel display. I have searched and searched for answers to these questions - all to no avail.

Is it at all possible to -

1. Rotate an object in LabVIEW?

2. Create/edit decorations programmatically (from within the block diagram)?

Thanks so much.

Link to comment

You can't rotate objects and you can't modify objects programmatically.

Practically speaking, there are several ways to get more-or-less dynamic UIs -

  • Subpanels
  • Picture Rings
  • Hidden controls, controlled through Visible properties
  • XControls?
  • Picture Control

The last one is the only one which will allow you to have a truly dynamic UI, but that would require that you do everything yourself. If you want some examples, go to this thread.

Link to comment

Hi,

Thanks for the fast reply. I wont lie that i am not disappointed to hear that it is not possible to do in LabVIEW. However, i am still a bit heartened that we might be able to do so using a picturebox. I am a bit sceptical because there would be a lot of work involved but i will check out the link that you have given and then try it out.

Actually i have two needs which are prompting me to explore this issue.

In one, our clients need to be able to rotate the XControls that i have created. However, making separate objects and setting the visible property etc will cause a decent amount of overhead for each XControl (large number of constituent controls and indicators). Not to mention the extra work required to make the resizing work properly. To extend this to all the 40 over types of XControls will be a pain in the neck. This remains so even in the use of subpanels. Hence picture control seems viable but then again i am not sure if i will be able to abstract out the steps and create sub VIs to automate the tasks for me so that if i do it for one XControl - i have done it for all the rest.

In the other need, we would actually need tracing lines from a control to a popup VI that comes up when the control is clicked. As and when the Popup VI is moved about, the tracing lines need to appropriately adjust. I think using a picture box would have done the trick for this but for the following two facts:

- We will not be creating an exe since the clients will have the capability to edit many of the VIs we develop

- The clients will only have the base package installed and since Picture Functions VIs are not available in the base package, we wont be able to use those.

Thus, i am currently exploring the idea (incl. amount of overhead involved) of having a transparent cluster with several small square LEDs which i will position dynamically based on the popup's position to create the tracing line...

Hope it all goes well and works out favourably.

Link to comment
:blink::blink::wacko::wacko: Too many negations...

Good luck. If you come up with a cool example, please upload it. It might give people ideas.

Hi Shinni,

Yen gave you a good link to get started with the picture control.

I do have to admit that solutions that require the picture control are not for the tame of heart. They do "let you break all of the rules" in LV.

Rather than list everything that I have done with it in the hopes that one will be close to what you want, could you post some images so we can visualize what you are attempting?

We may be able to help you develop something by harnessing the "wistles and bells" built into the other LV objects.

Ben

Link to comment
Too many negations...

Good luck. If you come up with a cool example, please upload it. It might give people ideas.

Haha... Sorry about that. I guess i should follow the KISS ideology in my language too. :laugh:

Sure. If i am able to come up with one, i will definitely upload it. By the way, thanks for the great link! :)

Rather than list everything that I have done with it in the hopes that one will be close to what you want, could you post some images so we can visualize what you are attempting? We may be able to help you develop something by harnessing the "wistles and bells" built into the other LV objects.

Hi Ben,

I did look at what you guys did and was impressed. With regards to rotation for my XControls, you can have a look at the first Picture attachment

post-4299-1144377179.jpg?width=400

This is how i need the orientations of the individual components to change when the overall thing is rotated. While some components might change, some might not - for example string indicators should not change orientation within the XControl no matter what. Only then will they remain readable.

As regards the issue about tracing lines, have a look at the following picture.

post-4299-1144375403.jpg?width=400

As the Popup VI is moved about on the screen, the tracing lines will have to readjust and keep pointing to the popup. The reason is that several popups (each represents the details of one XControl) might be opened at one time by the user. Thus, we need the tracing lines to tell them explicitly which one belongs to which.

So far I am still trying to brainstorm. Thanks. :)

Link to comment
Haha... Sorry about that. I guess i should follow the KISS ideology in my language too. :laugh:

Sure. If i am able to come up with one, i will definitely upload it. By the way, thanks for the great link! :)

Hi Ben,

I did look at what you guys did and was impressed. With regards to rotation for my XControls, you can have a look at the first Picture attachment

post-4299-1144377179.jpg?width=400

This is how i need the orientations of the individual components to change when the overall thing is rotated. While some components might change, some might not - for example string indicators should not change orientation within the XControl no matter what. Only then will they remain readable.

As regards the issue about tracing lines, have a look at the following picture.

post-4299-1144375403.jpg?width=400

As the Popup VI is moved about on the screen, the tracing lines will have to readjust and keep pointing to the popup. The reason is that several popups (each represents the details of one XControl) might be opened at one time by the user. Thus, we need the tracing lines to tell them explicitly which one belongs to which.

So far I am still trying to brainstorm. Thanks. :)

Yes, I'd be looking at using the picture control to help this out.

I'd use the picture control to display your widgets and rotate the image as required.

Christian example will show you how to rotate images.

You'll have to trachk the position of interesting points within the image so you know where the lines should be drawn.

Mouse down events on the picture could trigger making an off-screen control visable and postion it over the picture control.

You may want to concider using complex notation to track your widget postitions as well as the X-controls that you position over the picture control. It may make you math easier.

If you can specify a max number of "floatin controls" then have enough off-screen controls to allow all to be shown. If you can not specify a mix number, then only use the ""floaters" when the user is interacting with the control. Once they click outside it, do a "invoke node >>> Get Image" (NOTE: This technique was originall suggested by Jean-Pierre Drolet on the NI Dev-Exchange were he received 5 5-star ratings for that idea!) and insert the image of the control in the picture where the control had been. Hide the control until the user clicks and makes another active.

I used a variation on this technique in my model railroad. Since I did not want to have to re-write my code when my buddy decided to change the layout, I wrote it to draw the track plan based a configuration file. Foe each part of the layout, I had to provide different options. When an operator clicked on a track segment, an off-screen ring was populated with a list of options and then positioned over the picture control at the location the user clicked. They can then make the appropriate selection and the the ring was hidden and put away until next time.

So how does that sound to you?

As you work through this, pleas share some demo's of your results. That is how we managed to build that list in the first place.

Ben

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.