private void setUpAltimeter() { Altitude = new CenterDial(); Altitude.Size = new Size(guageSzStd, guageSzStd); Altitude.MajorLabel = "Altitude"; Altitude.MinorLabel = "meters"; Altitude.MajorTickDegrees = 30; Altitude.CounterClockWise = true; Altitude.MinorTickDegrees = Altitude.MajorTickDegrees / 5; Altitude.Min = 0; Altitude.MinDisplayedValue = 0; Altitude.Max = 720; Altitude.MaxDisplayedValue = 600; this.Controls.Add(Altitude); Altitude.SetValue(100); }
private void setUpBatteryLife() { BatteryLife = new CenterDial(); BatteryLife.Size = new Size(guageSzStd, guageSzStd); BatteryLife.Location = new Point(guageSzStd, 0); BatteryLife.GaugeSurfaceColor = Color.WhiteSmoke; BatteryLife.DialOutlineColor = Color.Black; BatteryLife.MajorLabel = "BatteryLife"; BatteryLife.LabelColor = Color.Black; BatteryLife.TickLabelColor = Color.Black; BatteryLife.MinorLabel = "%"; BatteryLife.MajorTickDegrees = 30; BatteryLife.MajorTickColor = Color.Black; BatteryLife.MinorTickDegrees = BatteryLife.MajorTickDegrees / 5; BatteryLife.MinorTickColor = Color.Black; BatteryLife.NeedleColor = Color.Black; BatteryLife.Min = 0; BatteryLife.MinDisplayedValue = 0; BatteryLife.Max = 120; BatteryLife.MaxDisplayedValue = 100; RedLineRange CriticalRange = new RedLineRange(); CriticalRange.LowerBound = 0; CriticalRange.UpperBound = 30; CriticalRange.OverrideTickLabelColor = true; CriticalRange.MajorTickColor = Color.Red; CriticalRange.MinorTickColor = Color.Red; CriticalRange.TickLabelColor = Color.Black; BatteryLife.AddRedLineRange(CriticalRange); RedLineRange WarningRange = new RedLineRange(); WarningRange.LowerBound = 30; WarningRange.UpperBound = 50; WarningRange.OverrideTickLabelColor = true; WarningRange.MajorTickColor = Color.DarkGoldenrod; WarningRange.MinorTickColor = Color.DarkGoldenrod; WarningRange.TickLabelColor = Color.Black; BatteryLife.AddRedLineRange(WarningRange); RedLineRange OkRange = new RedLineRange(); OkRange.LowerBound = 50; OkRange.UpperBound = 100; OkRange.OverrideTickLabelColor = true; OkRange.MajorTickColor = Color.Green; OkRange.MinorTickColor = Color.Green; OkRange.TickLabelColor = Color.Black; BatteryLife.AddRedLineRange(OkRange); this.Controls.Add(BatteryLife); BatteryLife.SetValue(78.7f); }