robotics company robot company  

Go Back   Trossen Robotics Community > TRC Data Center > Demos, Example Code, Widgets

Home Submit File What's New What's Popular Search

Phidgets Control Relations with GDI+ and C# .NET
Old 08-16-2008 11:47 PM
Semicton
Semicton is offline
Banned
 
Views: 1,022
Replies: 0
Phidgets Control Relations with GDI+ and C# .NET
Here is an example for all the Phidget users out there. This is a C# solution. All of my posts are a work in progress and source code is open to any need or use.

Minimum Requirements:
  • Visual Studio 2008 C#
  • .NET Framework 3.5

This project does not require any Phidgets Hardware.

This is an example of how to create a visual representation of a relationship between two controls placed on a windows form.

For example, A robotic arm normally requires two servos at the shoulder to lift not only itself, the elbow, and wrist, but also any object it intends to pick up. One possible solution is to synchronize two servos to work together as one programmable object. But to do so, It is a good idea to show both objects (servos) and their relationship as a singular working unit, if you provide a Graphical User Interface. GUI.

Screenshot:



Here is a video of the project: http://www.youtube.com/watch?v=Dvghyw0bkhg

What I like to do, is try to create one method to drive both servos at once. This decreases the complexity, and while doing so, I like to show the relationship visually on the form as well.

This example code shows how to do exactly that. It also shows how you can move controls around on a form and always display the relationship between the two servos (controls).

The controls in this example are only buttons, but you can expand it to accommodate any custom control you create. For example, my custom drawn servo control I posted on a different thread here on Trossen.

If you want to get creative: Allow drag and drop of controls at design time in Visual Studio 2008 and create properties to Sync the two controls. Even better, allow yourself, or users of your software to drag controls around on a form to create a 2D representation of a robot's servos.

This is part of my main Hobby project I am working on that I've posted here http://forums.trossenrobotics.com/do...do=file&id=107

This is my contribution to the great robotics community of Trossen Robotics.

Please visit my site: www.husko.net and rate or comment on my youtube channel: http://www.youtube.com/user/huskodotnet

Good luck and have fun!

-Husko
Attached Files
File Type: zip 48447-controlRelation (71.44 KB, 101 views)
Tags: None




 


All times are GMT -5. The time now is 10:26 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.