The Car Dashboard sample (under Gauge Applications → Car Dashboard) demonstrates using the gauge as a dynamic car dashboard. A single data source is used to populate several elements, and the odometer is controlled by calculating the integral of the velocity data.
The sample's Overview describes the Car Dashboard's architecture and behavior.
The source code snippets demonstrate attaching several elements to the same data source and show how the ValueChanged event is used to keep the odometer element up to date based on the velocity.
C#
using Dundas.Gauges.WinControl; … // Set the pointer value using the Values collection. gaugeContainer1.CircularGauges["Speedometer"].Pointers["Default"].ValueSource = "Velocity"; // Set the numeric indicator value using the Values collection. gaugeContainer1.NumericIndicators["NumericVelocity"].ValueSource = "Velocity"; // Set the value of state indicator for Gear #1 using the Values collection. // All other state indicators on the dashboard can be set in the same way. gaugeContainer1.StateIndicators["Gear1"].ValueSource = "Velocity"; … // The ValueChanged event occurs when there is a change in the value of // any Input Value contained in the Values collection. private void gaugeContainer1_ValueChanged(object sender, Dundas.Gauges.WinControl.ValueChangedEventArgs e) { … }
VisualBasic.NET
Imports Dundas.Gauges.WinControl … ' Set the pointer value using the Values collection. gaugeContainer1.CircularGauges("Speedometer").Pointers("Default").ValueSource = "Velocity" ' Set the numeric indicator value using the Values collection. gaugeContainer1.NumericIndicators("NumericVelocity").ValueSource = "Velocity" ' Set the value of state indicator for Gear #1 using the Values collection. ' All other state indicators on the dashboard can be set in the same way. gaugeContainer1.StateIndicators("Gear1").ValueSource = "Velocity" … ' The ValueChanged event occurs when there is a change in the value of ' any Input Value contained in the Values collection. Private Sub gaugeContainer1_ValueChanged(ByVal sender As Object, ByVal e As Dundas.Gauges.WinControl.ValueChangedEventArgs) Handles gaugeContainer1.ValueChanged … End Sub
For information on DUNDAS's products and services, please send e-mail to sales@dundas.com, phone us at 416-467-5100, 800-463-1492, or FAX your request to 416-422-4801.
Copyright © 2007 Dundas Data Visualization, Inc. and others. Please observe our terms of use.