menghuihantang Posted August 4, 2009 Report Share Posted August 4, 2009 Trying to make a clock interface. In the image, the Pendulum and clock needles are controls. I try to make the Pendulum move as a real clock, but how to rotate the control. I can move its position from right to left, but doesn't seem like a clock anymore. So can I rotate the angle of a control? A control doesn't have a property about its own angle. 1 Quote Link to comment
ESST Posted August 4, 2009 Report Share Posted August 4, 2009 Hi, I tried to do something similar. I did not find a way to use a user control part to rotate a full image. (Not saying it’s impossible, but looks that way). Way I would make the clock would be rotating pngs. Check out this thread Quote Link to comment
Rolf Kalbermatter Posted August 8, 2009 Report Share Posted August 8, 2009 Hi, I tried to do something similar. I did not find a way to use a user control part to rotate a full image. (Not saying it’s impossible, but looks that way). Way I would make the clock would be rotating pngs. Check out this thread If the clock arms do not need to look exactly like this you could use a gauge. Otherwise it will not really work anyhow in LabVIEW. The arms would need to be imported as graphics and doing that as vector graphic would be difficult to impossible in all versions of LabVIEW so far, but rotating bitmaps is a very ugly thing to do. Rolf Kalbermatter Quote Link to comment
ShaunR Posted August 23, 2009 Report Share Posted August 23, 2009 Trying to make a clock interface. In the image, the Pendulum and clock needles are controls. I try to make the Pendulum move as a real clock, but how to rotate the control. I can move its position from right to left, but doesn't seem like a clock anymore. So can I rotate the angle of a control? A control doesn't have a property about its own angle. Animated "Gif" image. Quote Link to comment
Aristos Queue Posted August 24, 2009 Report Share Posted August 24, 2009 Animated "Gif" image. Unfortunately, you can't time an animated gif well enough. The animations have too loose a time slice to be reliable, and anytime the UI thread gets tied up, they can hang. Further you have no ability to reset it in LabVIEW -- whenever you launched the VI, that would be the time displayed. Quote Link to comment
Clio75 Posted August 24, 2009 Report Share Posted August 24, 2009 Just a idea, (I have not tested this) A array of diffrent image(yes I know that will be many ). and some code in the back that select the correct image based on the local time. Quote Link to comment
bmoyer Posted August 24, 2009 Report Share Posted August 24, 2009 Just a idea, (I have not tested this) A array of diffrent image(yes I know that will be many ). and some code in the back that select the correct image based on the local time. This isn't easy but you would have to make a picture for each state of the needle (with a transparent background) and then import it into a transparent picture ring. You would need 4 picture rings. Hours, minutes, seconds, and pendulum. I've create a VI to prove the concept but it's nowhere near complete. If you have a gif of what you want to do you could probably extract the pictures and then import them into the picture ring. Good luck, Bruce Clock.vi Quote Link to comment
hooovahh Posted August 24, 2009 Report Share Posted August 24, 2009 (raises hand) Pick me! I know this one. As luck would have it I already made a clock program when I was first learning about how to use LabVIEW and its draw features. Here's a clock that works with the OS time, or user specified time. http://brian-hoover....k%20Program.zip I do have a disclaimer. I made this code several years ago and while it works, there are several coding advancements that I did not know about and did not use. First I would have created a state machine, and an event structure instead of polling every 200ms. In any case hope this works for you, here's a screen shot. EDIT: I'm sorry I didn't read the post closely enough, what I provided is not what you are looking for, but it still may be useful. 1 Quote Link to comment
ShaunR Posted August 24, 2009 Report Share Posted August 24, 2009 (edited) Unfortunately, you can't time an animated gif well enough. The animations have too loose a time slice to be reliable, and anytime the UI thread gets tied up, they can hang. Further you have no ability to reset it in LabVIEW -- whenever you launched the VI, that would be the time displayed. A pendulum swinging is just eye candy. You don't need to synchronise it.KISS. Edited August 24, 2009 by ShaunR Quote Link to comment
PaulG. Posted August 24, 2009 Report Share Posted August 24, 2009 A pendulum swinging is just eye candy. Obviously someone who has never been in a room with an authentic cuckoo clock. I had a great aunt who had over a dozen of them. On the hour every hour all hell broke loose. Quote Link to comment
ShaunR Posted August 24, 2009 Report Share Posted August 24, 2009 (edited) On the hour every hour all hell broke loose. Sounds like my workplace Edited August 24, 2009 by ShaunR Quote Link to comment
RalcoBe Posted April 23, 2010 Report Share Posted April 23, 2010 The way I did it: ( I don't understand Xcontrols ) Image of the clock on the frontpanel without Pendulum Pendulum in a gif file. My 1st vi rotates the pendulum.gif 360 times one degree, these 360 images are saved in an image array. The 2nd vi just uses this image array. Depending on the value (ex43), it shows the 43d element (picture) of the array. Border of the array is made transparent, background of pendulum.gif also. 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.