|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
White Paper Discuss: .NET (2.0) Composite Dashboard Viewer
Thread created automatically to discuss a document in the White Papers.
.NET (2.0) Composite Dashboard Viewer by seanwitte [EDIT] More than one person has asked for the source code. I need to finish putting together a guide to create new dashboard views first, but will make the source available sometime this week. My hope is that people who choose to use the software will add functionality by creating and sharing views that can be imported into the application. I'm also aware that there are many open source advocates and linux users in this community, but I chose this platform because it was the fastest means to an end because these are the tools that I use professionally. Now that Microsoft is giving away the IDE the tools are free, but Windows is still a requirement. [/EDIT] Last edited by seanwitte : 23-01-2006 at 09:49. |
|
#2
|
|||
|
|||
|
Re: White Paper Discuss: .NET (2.0) Composite Dashboard Viewer
Attached to this post is a guide for creating custom views for use with this dashboard application. If you create custom controls that other teams may find useful I encourage you to make them available.
You can download the C# solution files from the URL below. Please do not redistribute the source with or without modification. http://members.cox.net/seanwitte/FRC...ard_Source.zip |
|
#3
|
|||
|
|||
|
Re: White Paper Discuss: .NET (2.0) Composite Dashboard Viewer
This is in response to a few private messages and emails I've received. I made the source available, but the whole point of this application is that you don't need to modify the source code to add custom views. You really don't have to know anything about the dashboard data at all. You only need to follow the instructions in the previous post to create a new user control and add UI elements to display the data. There are a few custom dashboardy (thats a technical term) widgets included, including a sliding bar, LED, CMU camera FOV, and last year's field.
The dashboard views are just user controls that inherit from a base class in the FRC.Dashboard.Typelib assembly. The base class inherits from UserControl, but adds methods that are used as callbacks to notify your control when new dashboard packets are available. The dashboard application loads the controls at runtime and lays them out on tabs in the UI. When a new packet is received it calls the appropriate callback on control loaded in the active tab. When a packet of type data frame1 is received and parsed it will call ShowDataFrame1() on the active view control. Its pretty simple when you dig into the code, but the architecture allows you to extend the functionality without modifying the original source code. [EDIT] I forgot to mention that you can use any CLR 2.0 compatible language (C#, VB.NET, or Managed C++) to build custom dashboard views. The step are the same, but the syntax depends on the language. VB.NET 2005 Express Edition is available here: http://msdn.microsoft.com/vstudio/ex...b/default.aspx. I haven't used it and I'm not familiar with the syntax differences. [/EDIT] Last edited by seanwitte : 31-01-2006 at 13:43. |
|
#4
|
||||
|
||||
|
Re: White Paper Discuss: .NET (2.0) Composite Dashboard Viewer
Sean,
First of all, let me genuflect to you (and this something I rarely do). Your post is a wonderful example of structured code in a Windows environment. I did, however, notice an error today. The Team Number was not displaying. I believe that the root cause might be here (from DataFrameBase.cs): Code:
//control byte breakdowns
public int Team_Number { get { return ((data[iCTRL_A] & 0x0F) << 8) & data[iCTRL_B]; }}
public int Channel_Number { get { return (data[iCTRL_C] & 0x3F); }}
I might be off base on this... I'm more of an embedded oriented engineer. Your thoughts kind Sir? Respectfully, Mike |
|
#5
|
|||
|
|||
|
Re: White Paper Discuss: .NET (2.0) Composite Dashboard Viewer
There is an error in the type library that will cause team numbers to be incorrect. Attached is a patch to correct problem. Thanks to Mike Betts for not only finding the problem, but proposing the correct solution. Unzip the two dll's in the attachment and drop them into the folder with FRCDashboard.exe.
The controls assembly is included because I added a widget to display the robot's heading. Its very simple, looks sort of like a compass. The UpdateHeading() method does exactly what you'd think. |
|
#6
|
||||
|
||||
|
Re: White Paper Discuss: .NET (2.0) Composite Dashboard Viewer
Do you think you can release the source for the patch? My team has been working on the dashboard and the new update source code should be helpful.
I am also recieving "Cross-Thread Operation Not Valid" error messages when I run the main application. Has anyone else experienced this? Do you have a proposed solution? Thank You, Chris |
|
#7
|
|||
|
|||
|
Re: White Paper Discuss: .NET (2.0) Composite Dashboard Viewer
Quote:
public int Team_Number { get { return ((data[iCTRL_A] & 0x0F) << 8) | data[iCTRL_B]; }} I updated the source linked earlier in the thread as well if you want a fresh copy. Quote:
|
|
#8
|
|||||
|
|||||
|
Re: White Paper Discuss: .NET (2.0) Composite Dashboard Viewer
Attached is the DLL for the old version of the dashboard with the team number fix applied, for those of us with old views that we don't want to reprogram
![]() EDIT: I found an error that is probably common to both dashboards. iCTRL_B is defined as byte 10 in the dashboards, but the specification (and in real life) says it should be byte 9. I have uploaded the doubly corrected file for the older version, but do not have the tools to correct the newer version. Last edited by Eldarion : 16-02-2006 at 17:44. |
|
#9
|
|||
|
|||
|
Re: White Paper Discuss: .NET (2.0) Composite Dashboard Viewer
I added the source code to the whitepaper record.
|
|
#10
|
|||
|
|||
|
Re: White Paper Discuss: .NET (2.0) Composite Dashboard Viewer
The 2008 Control Library has a few .NET 2.0 dashboard controls. All controls are updated using the Value property. The controls will render themselves to fill space provided. If the size is invalid it may display an exception in the designer. You can clear the exception in the designer by resizing the control to valid dimensions and reopening the designer. The compass will always render as a square and the gyro will render as a rectangle with 2:1 aspect ratio.
1) CompassControl - displays a heading value. Use the MinValue and MaxValue properties to set the upper and lower bounds. Use ArrowDirection to adjust for clockwise/counter-clockwise rotation (value is 1 or -1). Use ArrowOffset property to adjust where the min value is rendered. 2) PwmControl - displays PWM value as a double-headed arrow. 3) GyroControl - displays an analog value that has a zero value centered in the total range. Use the MinValue and MaxValue properties to set the range displayed. 4) RangeControl - displays range information. Use the Invert property to display the inverse depending on the sensor being used. Use the MinValue and MaxValue properties to set the range. Last edited by seanwitte : 08-02-2008 at 09:29. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| White Paper Discuss: NEMO White Paper: 25 Ways Sponsors Can Help Your Team | Jessica Boucher | Extra Discussion | 1 | 20-11-2005 20:01 |
| White Paper Discuss: .NET Composite Dashboard Viewer | seanwitte | Extra Discussion | 8 | 06-04-2005 00:15 |
| White Paper Discuss: 2004 Visual Basic 6 Dashboard Control | CD47-Bot | Extra Discussion | 2 | 01-02-2005 01:56 |
| White Paper Discuss: 2004 .NET dashboard control dll | CD47-Bot | Extra Discussion | 7 | 13-01-2005 17:32 |
| White Paper Discuss: Team 810's 2004 Dashboard Backend | CD47-Bot | Extra Discussion | 1 | 07-03-2004 10:32 |