コード例 #1
0
ファイル: Form1.cs プロジェクト: glocklueng/helocamosun
        private void setUpRPM()
        {
            RPM = new CenterDial();
            RPM.Size = new Size(guageSzStd, guageSzStd);
            RPM.Location = new Point(guageSzStd*2, 0);
            RPM.MajorLabel = "RPM";
            RPM.MinorLabel = "x1000";
            RPM.MajorTickDegrees = 18;
            RPM.MinorTickDegrees = RPM.MajorTickDegrees / 5;
            RPM.Min = 0;
            RPM.MinDisplayedValue = 0;
            RPM.Max = 20;
            RPM.MaxDisplayedValue = 10;

            RedLineRange WarningRange = new RedLineRange();
            WarningRange.LowerBound = 8;
            WarningRange.UpperBound = 10;
            WarningRange.OverrideTickLabelColor = true;
            WarningRange.MajorTickColor = Color.Red;
            WarningRange.MinorTickColor = Color.Red;
            WarningRange.TickLabelColor = Color.YellowGreen;
            RPM.AddRedLineRange(WarningRange);

            this.Controls.Add(RPM);
            RPM.Value =4.0f;
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: glocklueng/helocamosun
        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);
        }
コード例 #3
0
ファイル: AirWulf.cs プロジェクト: glocklueng/helocamosun
        private void SetUpBatteryVoltageGauge()
        {
            BatteryVoltageGauge = new CenterDial();
            BatteryVoltageGauge.MajorLabel = "Batt Voltage";
            BatteryVoltageGauge.MinorLabel = "Volts";
            BatteryVoltageGauge.Min = 14;
            BatteryVoltageGauge.Max = 20;
            BatteryVoltageGauge.MinDisplayedValue = 15;
            BatteryVoltageGauge.MaxDisplayedValue = 19;
            BatteryVoltageGauge.CounterClockWise = false;
            BatteryVoltageGauge.LowestValueAngle = 90;

            RedLineRange BatteryUnderVoltage = new RedLineRange();
            BatteryUnderVoltage.UpperBound = 16;
            BatteryUnderVoltage.LowerBound = 0;
            BatteryVoltageGauge.AddRedLineRange(BatteryUnderVoltage);
            this.Controls.Add(BatteryVoltageGauge);
            BatteryVoltageGauge.Value = 18;
        }
コード例 #4
0
ファイル: AirWulf.cs プロジェクト: glocklueng/helocamosun
        private void SetUpRPMGauge()
        {
            RPMGauge = new CenterDial();
            RPMGauge.Value = 1000;
            RPMGauge.MajorLabel = "Main Rotor";
            RPMGauge.MinorLabel = "RPM";
            RPMGauge.Min = 0;
            RPMGauge.Max = 3600;
            RPMGauge.MinDisplayedValue = 0;
            RPMGauge.MaxDisplayedValue = 3000;
            RPMGauge.LowestValueAngle = 60;

            RedLineRange GoodRPM = new RedLineRange();
            GoodRPM.LowerBound = 1400;
            GoodRPM.UpperBound = 1600;
            GoodRPM.MajorTickColor = Color.Green;
            GoodRPM.MinorTickColor = Color.Green;
            GoodRPM.TickLabelColor = Color.Green;
            RPMGauge.AddRedLineRange(GoodRPM);

            RedLineRange WarningRPM = new RedLineRange();
            WarningRPM.LowerBound = 1200;
            WarningRPM.UpperBound = 1800;
            WarningRPM.MajorTickColor = Color.Yellow;
            WarningRPM.MinorTickColor = Color.Yellow;
            WarningRPM.TickLabelColor = Color.Yellow;
            RPMGauge.AddRedLineRange(WarningRPM);

            RedLineRange OverRPM = new RedLineRange();
            OverRPM.LowerBound = 1801;
            OverRPM.UpperBound = 3600;
            RPMGauge.AddRedLineRange(OverRPM);
            this.Controls.Add(RPMGauge);
        }
コード例 #5
0
ファイル: AirWulf.cs プロジェクト: glocklueng/helocamosun
        private void SetUpBatteryLevelGauge()
        {
            BatteryLevelGauge = new CenterDial();
            BatteryLevelGauge.Size = GaugeSize;

            BatteryLevelGauge.MajorLabel = "Battery Level";
            BatteryLevelGauge.MinorLabel = "Percent";
            BatteryLevelGauge.CounterClockWise = true;
            BatteryLevelGauge.LabelColor = Color.White;
            BatteryLevelGauge.Min = 0;
            BatteryLevelGauge.Max = 120;

            BatteryLevelGauge.MinDisplayedValue = 0;
            BatteryLevelGauge.MaxDisplayedValue = 100;

            RedLineRange BatteryOK = new RedLineRange();
            BatteryOK.MajorTickColor = Color.LightGreen;
            BatteryOK.MinorTickColor = Color.LightGreen;
            BatteryOK.TickLabelColor = Color.LightGreen;
            BatteryOK.OverrideTickLabelColor = true;
            BatteryOK.LowerBound = 51;
            BatteryOK.UpperBound = 100;
            BatteryLevelGauge.AddRedLineRange(BatteryOK);

            RedLineRange BatteryLow = new RedLineRange();
            BatteryLow.TickLabelColor = Color.Yellow;
            BatteryLow.MajorTickColor = Color.Yellow;
            BatteryLow.MinorTickColor = Color.Yellow;
            BatteryLow.OverrideMajorTickColor = true;
            BatteryLow.LowerBound = 21;
            BatteryLow.UpperBound = 50;
            BatteryLevelGauge.AddRedLineRange(BatteryLow);

            RedLineRange BatteryCritical = new RedLineRange();
            BatteryCritical.TickLabelColor = Color.Red;
            BatteryCritical.OverrideTickLabelColor = true;
            BatteryCritical.LowerBound = 0;
            BatteryCritical.UpperBound = 20;
            BatteryLevelGauge.AddRedLineRange(BatteryCritical);

            this.Controls.Add(BatteryLevelGauge);
        }
コード例 #6
0
ファイル: AirWulf.cs プロジェクト: glocklueng/helocamosun
        private void SetUpBatteryTemperatureGauge()
        {
            BatteryTemperatureGauge = new CenterDial();

            BatteryTemperatureGauge.MajorLabel = "Batt Temp";
            BatteryTemperatureGauge.MinorLabel = "Degrees C";
            BatteryTemperatureGauge.MajorTickDegrees = 20;
            BatteryTemperatureGauge.MinorTickDegrees = 4;
            BatteryTemperatureGauge.Min = -60;
            BatteryTemperatureGauge.Max = 120;
            BatteryTemperatureGauge.MinDisplayedValue = -40;
            BatteryTemperatureGauge.MaxDisplayedValue = 100;
            BatteryTemperatureGauge.LowestValueAngle = 120;

            RedLineRange BatteryOverTemp = new RedLineRange();
            BatteryOverTemp.UpperBound = 120;
            BatteryOverTemp.LowerBound = 50;
            BatteryTemperatureGauge.AddRedLineRange(BatteryOverTemp);

            RedLineRange BatteryUnderTemp = new RedLineRange();
            BatteryUnderTemp.LowerBound = -60;
            BatteryUnderTemp.UpperBound = 0;
            BatteryUnderTemp.TickLabelColor = Color.Blue;
            BatteryUnderTemp.OverrideTickLabelColor = true;
            BatteryUnderTemp.MinorTickColor = Color.Blue;
            BatteryUnderTemp.MajorTickColor = Color.Blue;
            BatteryTemperatureGauge.AddRedLineRange(BatteryUnderTemp);
            this.Controls.Add(BatteryTemperatureGauge);
        }
コード例 #7
0
ファイル: AirWulf.cs プロジェクト: glocklueng/helocamosun
 private void SetUpBatteryCurrentGauge()
 {
     BatteryCurrentGauge = new CenterDial();
     BatteryCurrentGauge.MajorLabel = "Batt Current";
     BatteryCurrentGauge.MinorLabel = "Amperes";
     BatteryCurrentGauge.Min = 0;
     BatteryCurrentGauge.Max = 120;
     BatteryCurrentGauge.MinDisplayedValue = 0;
     BatteryCurrentGauge.MaxDisplayedValue = 70;
     BatteryCurrentGauge.LowestValueAngle = 15;
     RedLineRange BatteryOverCurrent = new RedLineRange();
     BatteryOverCurrent.LowerBound = 50;
     BatteryOverCurrent.UpperBound = 120;
     BatteryCurrentGauge.AddRedLineRange(BatteryOverCurrent);
     this.Controls.Add(BatteryCurrentGauge);
 }
コード例 #8
0
ファイル: CenterDial.cs プロジェクト: glocklueng/helocamosun
 /// <summary>
 /// Remove a RedLineRange
 /// </summary>
 /// <param name="r">RedLineRange to remove</param>
 public void RemoveRedLineRange(RedLineRange r)
 {
     RedLineRanges.Remove(r);
 }
コード例 #9
0
ファイル: CenterDial.cs プロジェクト: glocklueng/helocamosun
 /// <summary>
 /// Add a RedLineRange that defines values where ticks have a different color
 /// </summary>
 /// <param name="r">RedLineRange that defines tick values that have a different color</param>
 public void AddRedLineRange(RedLineRange r)
 {
     RedLineRanges.Add(r);
 }
コード例 #10
0
ファイル: CenterDial.cs プロジェクト: glocklueng/helocamosun
        /// <summary>
        /// Create a new Centerdial with specified settings
        /// </summary>
        /// <param name="MajorTickDegrees">Degrees in between major ticks</param>
        /// <param name="MajorTickLength">Length of major tick marks, in pixels, at the default control size (150 by 150)</param>
        /// <param name="MinorTickDegrees">Degrees in between minor ticks</param>
        /// <param name="MinorTickLength">Length of minor tick marks, in pixels, at the default control size (150 by 150)</param>
        /// <param name="Min">The dial's lowest value</param>
        /// <param name="MinDisplayedValue">The dial's lowest displayed value</param>
        /// <param name="Max">The dial's highest value</param>
        /// <param name="MaxDisplayedValue">The dial's highest displayed value</param>
        /// <param name="LowestValueAngle">The angle at which the lowest displayed value is rendered</param>
        /// <param name="MajorLabel">The major text label to show above the center of the gauge (e.g. Temperature)</param>
        /// <param name="MinorLabel">The minor text label to show below the major label (e.g. deg Kelvin)</param>
        /// <param name="CounterClockWise">if True the dial's value increases in the counterclockwise direction, otherwise it decreases</param>
        /// <param name="ranges">Array of RedLineRanges to define tick values that have a different color</param>
        /// <param name="needleType">Type of needle to render</param>
        /// <param name="LabelColor">Color of the Major and minor labels</param>
        /// <param name="MajorTickColor">Color of the major ticks</param>
        /// <param name="MinorTickColor">Color of the minor ticks</param>
        /// <param name="NeedleColor">Color of the needle</param>
        /// <param name="BackGroundColor">Background color of the gauge</param>
        /// <param name="GaugeRingColor">Color of ring surrounding gauge</param>
        /// <param name="ScrewColor">color of the 4 corner screws</param>
        /// <param name="GaugeSurfaceColor">Color of gauge information surface</param>
        public CenterDial(  int MajorTickDegrees, int MajorTickLength, int MinorTickDegrees, int MinorTickLength,
            int Min, int MinDisplayedValue, int Max, int MaxDisplayedValue, int LowestValueAngle,
            string MajorLabel, string MinorLabel,bool CounterClockWise, RedLineRange[] ranges, NeedleType needleType,
            Color LabelColor, Color MajorTickColor, Color MinorTickColor,Color NeedleColor, Color BackGroundColor,
            Color GaugeRingColor, Color ScrewColor, Color GaugeSurfaceColor
            )
        {
            this.MajorTickDegrees = MajorTickDegrees;
            this.MajorTickLength = MajorTickLength;
            this.MinorTickDegrees =MinorTickDegrees;
            this.MinorTickLength=MinorTickLength;
            this.Min=Min;
            this.MinDisplayedValue=MinDisplayedValue;
            this.Max=Max;
            this.MaxDisplayedValue=MaxDisplayedValue;
            this.LowestValueAngle=LowestValueAngle;
            this.MajorLabel=MajorLabel;
            this.MinorLabel=MinorLabel;
            this.CounterClockWise = CounterClockWise;
            foreach (RedLineRange r in ranges)
            {
                RedLineRanges.Add(r);
            }
            this.needleType = needleType;
            this.LabelColor = LabelColor;
            this.MajorTickColor = MajorTickColor;
            this.MinorTickColor = MinorTickColor;
            this.NeedleColor = NeedleColor;
            this.BGColor = BackGroundColor;
            this.DialOutlineColor = GaugeRingColor;
            this.ScrewColor = ScrewColor;
            this.GaugeSurfaceColor = GaugeSurfaceColor;

            ValueIndicator.SetToolTip(this, Value.ToString());
        }
コード例 #11
0
ファイル: CenterDial.cs プロジェクト: glocklueng/helocamosun
 /// <summary>
 /// Create a new Centerdial with the default color and needle style and the specified settings
 /// </summary>
 /// <param name="MajorTickDegrees">Degrees in between major ticks</param>
 /// <param name="MajorTickLength">Length of major tick marks, in pixels, at the default control size (150 by 150)</param>
 /// <param name="MinorTickDegrees">Degrees in between minor ticks</param>
 /// <param name="MinorTickLength">Length of minor tick marks, in pixels, at the default control size (150 by 150)</param>
 /// <param name="Min">The dial's lowest value</param>
 /// <param name="MinDisplayedValue">The dial's lowest displayed value</param>
 /// <param name="Max">The dial's highest value</param>
 /// <param name="MaxDisplayedValue">The dial's highest displayed value</param>
 /// <param name="LowestValueAngle">The angle at which the lowest displayed value is rendered</param>
 /// <param name="MajorLabel">The major text label to show above the center of the gauge (e.g. Temperature)</param>
 /// <param name="MinorLabel">The minor text label to show below the major label (e.g. deg Kelvin)</param>
 /// <param name="CounterClockWise">if True the dial's value increases in the counterclockwise direction, otherwise it decreases</param>
 /// <param name="ranges">Array of RedLineRanges to define tick values that have a different color</param>
 public CenterDial(int MajorTickDegrees, int MajorTickLength, int MinorTickDegrees, int MinorTickLength,
     int Min, int MinDisplayedValue, int Max, int MaxDisplayedValue, int LowestValueAngle,
     string MajorLabel, string MinorLabel, bool CounterClockWise, RedLineRange[] ranges
     )
 {
     this.MajorTickDegrees = MajorTickDegrees;
     this.MajorTickLength = MajorTickLength;
     this.MinorTickDegrees = MinorTickDegrees;
     this.MinorTickLength = MinorTickLength;
     this.Min = Min;
     this.MinDisplayedValue = MinDisplayedValue;
     this.Max = Max;
     this.MaxDisplayedValue = MaxDisplayedValue;
     this.LowestValueAngle = LowestValueAngle;
     this.MajorLabel = MajorLabel;
     this.MinorLabel = MinorLabel;
     this.CounterClockWise = CounterClockWise;
     foreach (RedLineRange r in ranges)
     {
         RedLineRanges.Add(r);
     }
     ValueIndicator.SetToolTip(this, Value.ToString());
 }