One of our customers would like a bubble level displayed as it is important to know X,Y tilt of the machine.
Given that an image widget's x,y position cannot be set in real time I am unsure how to address this request.
A brute force method would be to perform a DrawCircle() on layer 2 but I am sure this would have a significant impact on performance.
Another method would be to create hundreds of lamp gauges and turn on whatever one is closest to the actual x,y position. I can imagine that this would consume gobs and gobs of memory and probably worse than calling DrawCircle().
Any ideas?
Bubble Level
- dberezowski
- Posts: 65
- Joined: Wed Sep 08, 2010 4:03 pm
- ksaenz
- Enovation Controls Development
- Posts: 263
- Joined: Thu Aug 19, 2010 7:53 am
Re: Bubble Level
You can change the position of an image widget with a state mahine.
Put the position you want in the variables "UserDefinedVariable.Screen.MovePosX" and "UserDefinedVariable.Screen.MovePosY"
Execute the action "Screen->Move()"
Execute the action "Screen->Process()"
Regards,
ksaenz
Put the position you want in the variables "UserDefinedVariable.Screen.MovePosX" and "UserDefinedVariable.Screen.MovePosY"
Execute the action "Screen->Move()"
Execute the action "Screen->Process()"
Regards,
ksaenz
- dberezowski
- Posts: 65
- Joined: Wed Sep 08, 2010 4:03 pm
Re: Bubble Level
How do I specify which image widget I am changing the x,y position of?
Can I also do this with a script?
Can I also do this with a C++ program?
Thanks,
David
Can I also do this with a script?
Can I also do this with a C++ program?
Thanks,
David
- ksaenz
- Enovation Controls Development
- Posts: 263
- Joined: Thu Aug 19, 2010 7:53 am
Re: Bubble Level
When you add the Move() action to the state you will be able to select the image widget from the Data column.
You could use sendEvent() from a script to cause a transition to a state that executes the Screen-> actions.
You could use sendEvent() from a script to cause a transition to a state that executes the Screen-> actions.