Example #1
0
        public MainForm()
        {
            InitializeComponent();

            label = aGauge1.GaugeLabels.FindByName("GaugeLabel1");
            alert = aGauge1.GaugeRanges.FindByName("AlertRange");
            aGauge1.ValueInRangeChanged += AGauge1_ValueInRangeChanged;
        }
 public void Remove(AGaugeLabel itemType)
 {
     List.Remove(itemType);
     if (m_Owner != null)
     {
         m_Owner.RepaintControl();
     }
 }
 public void Insert(int index, AGaugeLabel itemType)
 {
     itemType.SetOwner(m_Owner);
     if (string.IsNullOrEmpty(itemType.Name))
     {
         itemType.Name = GetUniqueName();
     }
     List.Insert(index, itemType);
     if (m_Owner != null)
     {
         m_Owner.RepaintControl();
     }
 }
        public int Add(AGaugeLabel itemType)
        {
            itemType.SetOwner(m_Owner);
            if (string.IsNullOrEmpty(itemType.Name))
            {
                itemType.Name = GetUniqueName();
            }
            var ret = List.Add(itemType);

            if (m_Owner != null)
            {
                m_Owner.RepaintControl();
            }
            return(ret);
        }
 public bool Contains(AGaugeLabel itemType)
 {
     return(List.Contains(itemType));
 }
 public int IndexOf(AGaugeLabel itemType)
 {
     return(List.IndexOf(itemType));
 }
Example #7
0
 public void Remove(AGaugeLabel itemType)
 {
     List.Remove(itemType);
 }
Example #8
0
 public void Insert(int index, AGaugeLabel itemType)
 {
     itemType.SetOwner(Owner);
     if (string.IsNullOrEmpty(itemType.Name)) itemType.Name = GetUniqueName();
     List.Insert(index, itemType);
 }
Example #9
0
 public int IndexOf(AGaugeLabel itemType)
 {
     return List.IndexOf(itemType);
 }
Example #10
0
 public bool Contains(AGaugeLabel itemType)
 {
     return List.Contains(itemType);
 }
Example #11
0
 public int Add(AGaugeLabel itemType)
 {
     itemType.SetOwner(Owner);
     if (string.IsNullOrEmpty(itemType.Name)) itemType.Name = GetUniqueName();
     return List.Add(itemType);
 }
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            AGaugeLabel aGaugeLabel1 = new System.Windows.Forms.AGaugeLabel();
            AGaugeRange aGaugeRange1 = new System.Windows.Forms.AGaugeRange();
            AGaugeLabel aGaugeLabel2 = new System.Windows.Forms.AGaugeLabel();
            AGaugeLabel aGaugeLabel3 = new System.Windows.Forms.AGaugeLabel();
            AGaugeRange aGaugeRange2 = new System.Windows.Forms.AGaugeRange();

            this.gWaterTemp                 = new System.Windows.Forms.AGauge();
            this.gFuel                      = new System.Windows.Forms.AGauge();
            this.contextMenuStrip1          = new System.Windows.Forms.ContextMenuStrip(this.components);
            this.stayOnTopToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.gMeter1                    = new GMeter();
            this.blbFuelPressure            = new LedBulb();
            this.ctlRearRight               = new WheelStatusControl();
            this.ctlFrontRight              = new WheelStatusControl();
            this.ctlFrontLeft               = new WheelStatusControl();
            this.ctlRearLeft                = new WheelStatusControl();
            this.oilControl2                = new OilControl();
            this.pedalControl1              = new PedalControl();
            this.label1                     = new System.Windows.Forms.Label();
            this.contextMenuStrip1.SuspendLayout();
            this.SuspendLayout();

            // gWaterTemp
            this.gWaterTemp.BackColor     = System.Drawing.Color.White;
            this.gWaterTemp.BaseArcColor  = System.Drawing.Color.Navy;
            this.gWaterTemp.BaseArcRadius = 80;
            this.gWaterTemp.BaseArcStart  = 135;
            this.gWaterTemp.BaseArcSweep  = 270;
            this.gWaterTemp.BaseArcWidth  = 2;
            this.gWaterTemp.Center        = new System.Drawing.Point(100, 100);
            aGaugeLabel1.Color            = System.Drawing.Color.DarkRed;
            aGaugeLabel1.Font             = new System.Drawing.Font(
                "Microsoft Sans Serif",
                9.75F,
                System.Drawing.FontStyle.Regular,
                System.Drawing.GraphicsUnit.Point,
                (byte)(0));
            aGaugeLabel1.Name     = "GaugeLabel1";
            aGaugeLabel1.Position = new System.Drawing.Point(65, 60);
            aGaugeLabel1.Text     = "Water Temp";
            this.gWaterTemp.GaugeLabels.Add(aGaugeLabel1);
            aGaugeRange1.Color       = System.Drawing.Color.Red;
            aGaugeRange1.EndValue    = 120F;
            aGaugeRange1.InnerRadius = 70;
            aGaugeRange1.InRange     = false;
            aGaugeRange1.Name        = "GaugeRange1";
            aGaugeRange1.OuterRadius = 90;
            aGaugeRange1.StartValue  = 100F;
            this.gWaterTemp.GaugeRanges.Add(aGaugeRange1);
            this.gWaterTemp.Location     = new System.Drawing.Point(255, 12);
            this.gWaterTemp.MaxValue     = 120F;
            this.gWaterTemp.MinValue     = 0F;
            this.gWaterTemp.Name         = "gWaterTemp";
            this.gWaterTemp.NeedleColor1 = System.Windows.Forms.AGaugeNeedleColor.Green;
            this.gWaterTemp.NeedleColor2 = System.Drawing.Color.FromArgb(
                (int)(((byte)(0))),
                (int)(((byte)(64))),
                (int)(((byte)(0))));
            this.gWaterTemp.NeedleRadius               = 80;
            this.gWaterTemp.NeedleType                 = System.Windows.Forms.NeedleType.Advance;
            this.gWaterTemp.NeedleWidth                = 2;
            this.gWaterTemp.ScaleLinesInterColor       = System.Drawing.Color.Black;
            this.gWaterTemp.ScaleLinesInterInnerRadius = 73;
            this.gWaterTemp.ScaleLinesInterOuterRadius = 80;
            this.gWaterTemp.ScaleLinesInterWidth       = 1;
            this.gWaterTemp.ScaleLinesMajorColor       = System.Drawing.Color.Black;
            this.gWaterTemp.ScaleLinesMajorInnerRadius = 70;
            this.gWaterTemp.ScaleLinesMajorOuterRadius = 80;
            this.gWaterTemp.ScaleLinesMajorStepValue   = 20F;
            this.gWaterTemp.ScaleLinesMajorWidth       = 2;
            this.gWaterTemp.ScaleLinesMinorColor       = System.Drawing.Color.Gray;
            this.gWaterTemp.ScaleLinesMinorInnerRadius = 75;
            this.gWaterTemp.ScaleLinesMinorOuterRadius = 80;
            this.gWaterTemp.ScaleLinesMinorTicks       = 9;
            this.gWaterTemp.ScaleLinesMinorWidth       = 1;
            this.gWaterTemp.ScaleNumbersColor          = System.Drawing.Color.Black;
            this.gWaterTemp.ScaleNumbersFormat         = null;
            this.gWaterTemp.ScaleNumbersRadius         = 60;
            this.gWaterTemp.ScaleNumbersRotation       = 90;
            this.gWaterTemp.ScaleNumbersStartScaleLine = 2;
            this.gWaterTemp.ScaleNumbersStepScaleLines = 1;
            this.gWaterTemp.Size     = new System.Drawing.Size(205, 187);
            this.gWaterTemp.TabIndex = 0;
            this.gWaterTemp.Text     = "gWaterTemp";
            this.gWaterTemp.Value    = 0F;

            // gFuel
            this.gFuel.BackColor     = System.Drawing.Color.White;
            this.gFuel.BaseArcColor  = System.Drawing.Color.Gray;
            this.gFuel.BaseArcRadius = 50;
            this.gFuel.BaseArcStart  = 225;
            this.gFuel.BaseArcSweep  = 90;
            this.gFuel.BaseArcWidth  = 2;
            this.gFuel.Center        = new System.Drawing.Point(40, 55);
            aGaugeLabel2.Color       = System.Drawing.SystemColors.WindowText;
            aGaugeLabel2.Font        = new System.Drawing.Font(
                "Microsoft Sans Serif",
                8.25F,
                System.Drawing.FontStyle.Bold,
                System.Drawing.GraphicsUnit.Point,
                (byte)(0));
            aGaugeLabel2.Name     = "GaugeLabel1";
            aGaugeLabel2.Position = new System.Drawing.Point(70, 35);
            aGaugeLabel2.Text     = "F";
            aGaugeLabel3.Color    = System.Drawing.SystemColors.WindowText;
            aGaugeLabel3.Name     = "GaugeLabel2";
            aGaugeLabel3.Position = new System.Drawing.Point(7, 35);
            aGaugeLabel3.Text     = "E";
            this.gFuel.GaugeLabels.Add(aGaugeLabel2);
            this.gFuel.GaugeLabels.Add(aGaugeLabel3);
            aGaugeRange2.Color       = System.Drawing.Color.Red;
            aGaugeRange2.EndValue    = 25F;
            aGaugeRange2.InnerRadius = 40;
            aGaugeRange2.InRange     = false;
            aGaugeRange2.Name        = "GaugeRange1";
            aGaugeRange2.OuterRadius = 50;
            aGaugeRange2.StartValue  = 0F;
            this.gFuel.GaugeRanges.Add(aGaugeRange2);
            this.gFuel.Location                   = new System.Drawing.Point(309, 176);
            this.gFuel.MaxValue                   = 100F;
            this.gFuel.MinValue                   = 0F;
            this.gFuel.Name                       = "gFuel";
            this.gFuel.NeedleColor1               = System.Windows.Forms.AGaugeNeedleColor.Red;
            this.gFuel.NeedleColor2               = System.Drawing.Color.Black;
            this.gFuel.NeedleRadius               = 40;
            this.gFuel.NeedleType                 = System.Windows.Forms.NeedleType.Advance;
            this.gFuel.NeedleWidth                = 2;
            this.gFuel.ScaleLinesInterColor       = System.Drawing.Color.Black;
            this.gFuel.ScaleLinesInterInnerRadius = 45;
            this.gFuel.ScaleLinesInterOuterRadius = 50;
            this.gFuel.ScaleLinesInterWidth       = 2;
            this.gFuel.ScaleLinesMajorColor       = System.Drawing.Color.Black;
            this.gFuel.ScaleLinesMajorInnerRadius = 40;
            this.gFuel.ScaleLinesMajorOuterRadius = 50;
            this.gFuel.ScaleLinesMajorStepValue   = 50F;
            this.gFuel.ScaleLinesMajorWidth       = 3;
            this.gFuel.ScaleLinesMinorColor       = System.Drawing.Color.Gray;
            this.gFuel.ScaleLinesMinorInnerRadius = 40;
            this.gFuel.ScaleLinesMinorOuterRadius = 60;
            this.gFuel.ScaleLinesMinorTicks       = 1;
            this.gFuel.ScaleLinesMinorWidth       = 1;
            this.gFuel.ScaleNumbersColor          = System.Drawing.Color.Black;
            this.gFuel.ScaleNumbersFormat         = null;
            this.gFuel.ScaleNumbersRadius         = 95;
            this.gFuel.ScaleNumbersRotation       = 0;
            this.gFuel.ScaleNumbersStartScaleLine = 4;
            this.gFuel.ScaleNumbersStepScaleLines = 3;
            this.gFuel.Size                       = new System.Drawing.Size(82, 73);
            this.gFuel.TabIndex                   = 3;
            this.gFuel.Text                       = "aGauge1";
            this.gFuel.Value                      = 0F;

            // contextMenuStrip1
            this.contextMenuStrip1.Items.AddRange(new ToolStripItem[] { this.stayOnTopToolStripMenuItem });
            this.contextMenuStrip1.Name            = "contextMenuStrip1";
            this.contextMenuStrip1.ShowCheckMargin = true;
            this.contextMenuStrip1.Size            = new System.Drawing.Size(162, 26);

            // stayOnTopToolStripMenuItem
            this.stayOnTopToolStripMenuItem.Name   = "stayOnTopToolStripMenuItem";
            this.stayOnTopToolStripMenuItem.Size   = new System.Drawing.Size(161, 22);
            this.stayOnTopToolStripMenuItem.Text   = "Stay On Top";
            this.stayOnTopToolStripMenuItem.Click += new System.EventHandler(this.stayOnTopToolStripMenuItem_Click);

            // gMeter1
            this.gMeter1.BackColor     = System.Drawing.Color.Transparent;
            this.gMeter1.GBallColor    = System.Drawing.Color.Green;
            this.gMeter1.GBallDiameter = 4;
            this.gMeter1.GridColor     = System.Drawing.Color.Red;
            this.gMeter1.GScale        = 1;
            this.gMeter1.HorizG        = 2D;
            this.gMeter1.Location      = new System.Drawing.Point(264, 255);
            this.gMeter1.MaxG          = 4;
            this.gMeter1.Name          = "gMeter1";
            this.gMeter1.Size          = new System.Drawing.Size(213, 190);
            this.gMeter1.TabIndex      = 10;
            this.gMeter1.VertG         = 1.5D;

            // blbFuelPressure
            this.blbFuelPressure.BackColor = System.Drawing.Color.White;
            this.blbFuelPressure.Color     = System.Drawing.Color.Red;
            this.blbFuelPressure.Location  = new System.Drawing.Point(309, 229);
            this.blbFuelPressure.Name      = "blbFuelPressure";
            this.blbFuelPressure.On        = true;
            this.blbFuelPressure.Size      = new System.Drawing.Size(20, 20);
            this.blbFuelPressure.TabIndex  = 9;

            // ctlRearRight
            this.ctlRearRight.BackColor = System.Drawing.Color.FromArgb(
                (int)(((byte)(170))),
                (int)(((byte)(170))),
                (int)(((byte)(170))));
            this.ctlRearRight.Location      = new System.Drawing.Point(243, 553);
            this.ctlRearRight.MinimumSize   = new System.Drawing.Size(218, 96);
            this.ctlRearRight.Name          = "ctlRearRight";
            this.ctlRearRight.Size          = new System.Drawing.Size(218, 96);
            this.ctlRearRight.TabIndex      = 7;
            this.ctlRearRight.WheelPosition = WheelStatusControl.WheelPositionEnum.RearRight;

            // ctlFrontRight
            this.ctlFrontRight.BackColor = System.Drawing.Color.FromArgb(
                (int)(((byte)(170))),
                (int)(((byte)(170))),
                (int)(((byte)(170))));
            this.ctlFrontRight.Location      = new System.Drawing.Point(243, 451);
            this.ctlFrontRight.MinimumSize   = new System.Drawing.Size(218, 96);
            this.ctlFrontRight.Name          = "ctlFrontRight";
            this.ctlFrontRight.Size          = new System.Drawing.Size(218, 96);
            this.ctlFrontRight.TabIndex      = 6;
            this.ctlFrontRight.WheelPosition = WheelStatusControl.WheelPositionEnum.FrontRight;

            // ctlFrontLeft
            this.ctlFrontLeft.BackColor = System.Drawing.Color.FromArgb(
                (int)(((byte)(170))),
                (int)(((byte)(170))),
                (int)(((byte)(170))));
            this.ctlFrontLeft.Location      = new System.Drawing.Point(12, 451);
            this.ctlFrontLeft.MinimumSize   = new System.Drawing.Size(218, 96);
            this.ctlFrontLeft.Name          = "ctlFrontLeft";
            this.ctlFrontLeft.Size          = new System.Drawing.Size(218, 96);
            this.ctlFrontLeft.TabIndex      = 5;
            this.ctlFrontLeft.WheelPosition = WheelStatusControl.WheelPositionEnum.FrontLeft;

            // ctlRearLeft
            this.ctlRearLeft.BackColor = System.Drawing.Color.FromArgb(
                (int)(((byte)(170))),
                (int)(((byte)(170))),
                (int)(((byte)(170))));
            this.ctlRearLeft.Location      = new System.Drawing.Point(12, 553);
            this.ctlRearLeft.MinimumSize   = new System.Drawing.Size(218, 96);
            this.ctlRearLeft.Name          = "ctlRearLeft";
            this.ctlRearLeft.Size          = new System.Drawing.Size(218, 96);
            this.ctlRearLeft.TabIndex      = 4;
            this.ctlRearLeft.WheelPosition = WheelStatusControl.WheelPositionEnum.RearLeft;

            // oilControl2
            this.oilControl2.BackColor = System.Drawing.Color.White;
            this.oilControl2.Location  = new System.Drawing.Point(12, 12);
            this.oilControl2.Name      = "oilControl2";
            this.oilControl2.Size      = new System.Drawing.Size(237, 290);
            this.oilControl2.TabIndex  = 2;

            // pedalControl1
            this.pedalControl1.BackColor = System.Drawing.Color.FromArgb(
                (int)(((byte)(5))),
                (int)(((byte)(5))),
                (int)(((byte)(5))));
            this.pedalControl1.Location = new System.Drawing.Point(466, 12);
            this.pedalControl1.Name     = "pedalControl1";
            this.pedalControl1.Size     = new System.Drawing.Size(82, 150);
            this.pedalControl1.TabIndex = 1;

            // label1
            this.label1.AutoSize = true;
            this.label1.Font     = new System.Drawing.Font(
                "Microsoft Sans Serif",
                14.25F,
                System.Drawing.FontStyle.Regular,
                System.Drawing.GraphicsUnit.Point,
                (byte)(238));
            this.label1.ForeColor = System.Drawing.Color.White;
            this.label1.Location  = new System.Drawing.Point(12, 328);
            this.label1.Name      = "label1";
            this.label1.Size      = new System.Drawing.Size(139, 24);
            this.label1.TabIndex  = 11;
            this.label1.Text      = "lblSessionTime";

            // CarStatusForm
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor           = System.Drawing.Color.Black;
            this.ClientSize          = new System.Drawing.Size(597, 769);
            this.ContextMenuStrip    = this.contextMenuStrip1;
            this.Controls.Add(this.label1);
            this.Controls.Add(this.gMeter1);
            this.Controls.Add(this.blbFuelPressure);
            this.Controls.Add(this.ctlRearRight);
            this.Controls.Add(this.ctlFrontRight);
            this.Controls.Add(this.ctlFrontLeft);
            this.Controls.Add(this.ctlRearLeft);
            this.Controls.Add(this.gFuel);
            this.Controls.Add(this.oilControl2);
            this.Controls.Add(this.pedalControl1);
            this.Controls.Add(this.gWaterTemp);
            this.Location      = new System.Drawing.Point(1930, 30);
            this.Name          = "CarStatusForm";
            this.ShowIcon      = false;
            this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
            this.Text          = "Car Status";
            this.FormClosed   += new System.Windows.Forms.FormClosedEventHandler(this.CarStatusForm_FormClosed);
            this.contextMenuStrip1.ResumeLayout(false);
            this.ResumeLayout(false);
            this.PerformLayout();
        }
Example #13
0
        private void LoadAmmeterConfigurationInfo(string aGaugeName)
        {
            AGauge aGauge1 = new AGauge();

            System.Windows.Forms.AGaugeLabel aGaugeLabel1 = new System.Windows.Forms.AGaugeLabel();
            System.Windows.Forms.AGaugeRange aGaugeRange1 = new System.Windows.Forms.AGaugeRange();
            System.Windows.Forms.AGaugeRange aGaugeRange2 = new System.Windows.Forms.AGaugeRange();
            System.Windows.Forms.AGaugeRange aGaugeRange3 = new System.Windows.Forms.AGaugeRange();
            //
            // aGauge1
            //
            aGauge1.BackColor     = System.Drawing.SystemColors.Control;
            aGauge1.BaseArcColor  = System.Drawing.Color.Gray;
            aGauge1.BaseArcRadius = 80;
            aGauge1.BaseArcStart  = 135;
            aGauge1.BaseArcSweep  = 270;
            aGauge1.BaseArcWidth  = 2;
            aGauge1.GaugeRanges.Add(aGaugeRange1);
            aGauge1.GaugeRanges.Add(aGaugeRange2);
            aGauge1.GaugeRanges.Add(aGaugeRange3);
            aGauge1.MaxValue                   = 200F;
            aGauge1.MinValue                   = 0F;
            aGauge1.Name                       = aGaugeName;
            aGauge1.NeedleColor1               = System.Windows.Forms.AGaugeNeedleColor.Yellow;
            aGauge1.NeedleColor2               = System.Drawing.Color.Olive;
            aGauge1.NeedleRadius               = 80;
            aGauge1.NeedleType                 = System.Windows.Forms.NeedleType.Advance;
            aGauge1.NeedleWidth                = 2;
            aGauge1.ScaleLinesInterColor       = System.Drawing.Color.Black;
            aGauge1.ScaleLinesInterInnerRadius = 73;
            aGauge1.ScaleLinesInterOuterRadius = 80;
            aGauge1.ScaleLinesInterWidth       = 1;
            aGauge1.ScaleLinesMajorColor       = System.Drawing.Color.Black;
            aGauge1.ScaleLinesMajorInnerRadius = 70;
            aGauge1.ScaleLinesMajorOuterRadius = 80;
            aGauge1.ScaleLinesMajorStepValue   = 20F;
            aGauge1.ScaleLinesMajorWidth       = 2;
            aGauge1.ScaleLinesMinorColor       = System.Drawing.Color.Gray;
            aGauge1.ScaleLinesMinorInnerRadius = 75;
            aGauge1.ScaleLinesMinorOuterRadius = 80;
            aGauge1.ScaleLinesMinorTicks       = 9;
            aGauge1.ScaleLinesMinorWidth       = 1;
            aGauge1.ScaleNumbersColor          = System.Drawing.Color.Black;
            aGauge1.ScaleNumbersFormat         = null;
            aGauge1.ScaleNumbersRadius         = 95;
            aGauge1.ScaleNumbersRotation       = 0;
            aGauge1.ScaleNumbersStartScaleLine = 1;
            aGauge1.ScaleNumbersStepScaleLines = 1;
            aGauge1.Size                       = new System.Drawing.Size(250, 250);
            aGauge1.TabIndex                   = 0;
            aGauge1.Text                       = "aGauge1";
            aGauge1.Value                      = 0F;

            aGaugeLabel1.Color    = System.Drawing.SystemColors.WindowText;
            aGaugeLabel1.Font     = new System.Drawing.Font("Verdana", 9.75F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            aGaugeLabel1.Name     = "GaugeLabel1";
            aGaugeLabel1.Position = new System.Drawing.Point(70, 150);
            aGaugeLabel1.Text     = aGaugeName + ":0";
            aGauge1.GaugeLabels.Add(aGaugeLabel1);
            aGaugeRange1.Color       = System.Drawing.Color.Red;
            aGaugeRange1.EndValue    = 200F;
            aGaugeRange1.InnerRadius = 70;
            aGaugeRange1.InRange     = false;
            aGaugeRange1.Name        = "AlertRange";
            aGaugeRange1.OuterRadius = 80;
            aGaugeRange1.StartValue  = 160F;
            aGaugeRange2.Color       = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
            aGaugeRange2.EndValue    = 160F;
            aGaugeRange2.InnerRadius = 70;
            aGaugeRange2.InRange     = false;
            aGaugeRange2.Name        = "GaugeRange3";
            aGaugeRange2.OuterRadius = 75;
            aGaugeRange2.StartValue  = 0F;
            aGaugeRange3.Color       = System.Drawing.Color.Lime;
            aGaugeRange3.EndValue    = 160F;
            aGaugeRange3.InnerRadius = 75;
            aGaugeRange3.InRange     = false;
            aGaugeRange3.Name        = "GaugeRange2";
            aGaugeRange3.OuterRadius = 80;
            aGaugeRange3.StartValue  = 0F;


            int x = panel1.Size.Width;
            int y = panel1.Size.Height;

            int x_interval = 10;
            int y_interval = 10;

            int x_max = (x - x_interval) / (250 + x_interval);
            int y_max = (y - y_interval) / (250 + y_interval);
            int n     = panel1.Controls.Count;

            int x_n = n % x_max;
            int y_n = n / x_max;

            aGauge1.Location = new System.Drawing.Point(250 * x_n + x_interval, 250 * y_n + y_interval);
            panel1.Controls.Add(aGauge1);
        }
Example #14
0
 public MainForm()
 {
     InitializeComponent();
     label = aGauge1.GaugeLabels.FindByName("GaugeLabel1");
     alert = aGauge1.GaugeRanges.FindByName("AlertRange");
 }
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            AGaugeLabel aGaugeLabel4 = new System.Windows.Forms.AGaugeLabel();
            AGaugeRange aGaugeRange4 = new System.Windows.Forms.AGaugeRange();

            this.gTemperature = new System.Windows.Forms.AGauge();
            this.gPressure    = new System.Windows.Forms.AGauge();
            this.lblPressure  = new LCDLabel.LcdLabel();
            this.SuspendLayout();

            // gTemperature
            this.gTemperature.BaseArcColor  = System.Drawing.Color.SteelBlue;
            this.gTemperature.BaseArcRadius = 80;
            this.gTemperature.BaseArcStart  = 150;
            this.gTemperature.BaseArcSweep  = 230;
            this.gTemperature.BaseArcWidth  = 2;
            this.gTemperature.Center        = new System.Drawing.Point(100, 100);
            aGaugeLabel4.Color = System.Drawing.Color.DarkRed;
            aGaugeLabel4.Font  = new System.Drawing.Font(
                "Microsoft Sans Serif",
                12F,
                System.Drawing.FontStyle.Regular,
                System.Drawing.GraphicsUnit.Point,
                (byte)(0));
            aGaugeLabel4.Name     = "GaugeLabel1";
            aGaugeLabel4.Position = new System.Drawing.Point(70, 50);
            aGaugeLabel4.Text     = "Oil Temp";
            this.gTemperature.GaugeLabels.Add(aGaugeLabel4);
            aGaugeRange4.Color       = System.Drawing.Color.Red;
            aGaugeRange4.EndValue    = 200F;
            aGaugeRange4.InnerRadius = 70;
            aGaugeRange4.InRange     = false;
            aGaugeRange4.Name        = "GaugeRange1";
            aGaugeRange4.OuterRadius = 80;
            aGaugeRange4.StartValue  = 150F;
            this.gTemperature.GaugeRanges.Add(aGaugeRange4);
            this.gTemperature.Location                   = new System.Drawing.Point(3, 3);
            this.gTemperature.MaxValue                   = 200F;
            this.gTemperature.MinValue                   = 0F;
            this.gTemperature.Name                       = "gTemperature";
            this.gTemperature.NeedleColor1               = System.Windows.Forms.AGaugeNeedleColor.Gray;
            this.gTemperature.NeedleColor2               = System.Drawing.Color.DimGray;
            this.gTemperature.NeedleRadius               = 80;
            this.gTemperature.NeedleType                 = System.Windows.Forms.NeedleType.Advance;
            this.gTemperature.NeedleWidth                = 2;
            this.gTemperature.ScaleLinesInterColor       = System.Drawing.Color.Black;
            this.gTemperature.ScaleLinesInterInnerRadius = 73;
            this.gTemperature.ScaleLinesInterOuterRadius = 80;
            this.gTemperature.ScaleLinesInterWidth       = 1;
            this.gTemperature.ScaleLinesMajorColor       = System.Drawing.Color.Black;
            this.gTemperature.ScaleLinesMajorInnerRadius = 70;
            this.gTemperature.ScaleLinesMajorOuterRadius = 80;
            this.gTemperature.ScaleLinesMajorStepValue   = 20F;
            this.gTemperature.ScaleLinesMajorWidth       = 2;
            this.gTemperature.ScaleLinesMinorColor       = System.Drawing.Color.Gray;
            this.gTemperature.ScaleLinesMinorInnerRadius = 75;
            this.gTemperature.ScaleLinesMinorOuterRadius = 80;
            this.gTemperature.ScaleLinesMinorTicks       = 9;
            this.gTemperature.ScaleLinesMinorWidth       = 1;
            this.gTemperature.ScaleNumbersColor          = System.Drawing.Color.Black;
            this.gTemperature.ScaleNumbersFormat         = null;
            this.gTemperature.ScaleNumbersRadius         = 95;
            this.gTemperature.ScaleNumbersRotation       = 0;
            this.gTemperature.ScaleNumbersStartScaleLine = 0;
            this.gTemperature.ScaleNumbersStepScaleLines = 1;
            this.gTemperature.Size                       = new System.Drawing.Size(214, 179);
            this.gTemperature.TabIndex                   = 0;
            this.gTemperature.Text                       = "aGauge1";
            this.gTemperature.Value                      = 0F;

            // gPressure
            this.gPressure.BaseArcColor               = System.Drawing.Color.Green;
            this.gPressure.BaseArcRadius              = 70;
            this.gPressure.BaseArcStart               = 180;
            this.gPressure.BaseArcSweep               = 180;
            this.gPressure.BaseArcWidth               = 2;
            this.gPressure.Center                     = new System.Drawing.Point(100, 100);
            this.gPressure.Location                   = new System.Drawing.Point(12, 144);
            this.gPressure.MaxValue                   = 10F;
            this.gPressure.MinValue                   = 0F;
            this.gPressure.Name                       = "gPressure";
            this.gPressure.NeedleColor1               = System.Windows.Forms.AGaugeNeedleColor.Gray;
            this.gPressure.NeedleColor2               = System.Drawing.Color.DimGray;
            this.gPressure.NeedleRadius               = 80;
            this.gPressure.NeedleType                 = System.Windows.Forms.NeedleType.Advance;
            this.gPressure.NeedleWidth                = 2;
            this.gPressure.ScaleLinesInterColor       = System.Drawing.Color.Black;
            this.gPressure.ScaleLinesInterInnerRadius = 73;
            this.gPressure.ScaleLinesInterOuterRadius = 80;
            this.gPressure.ScaleLinesInterWidth       = 1;
            this.gPressure.ScaleLinesMajorColor       = System.Drawing.Color.Black;
            this.gPressure.ScaleLinesMajorInnerRadius = 70;
            this.gPressure.ScaleLinesMajorOuterRadius = 80;
            this.gPressure.ScaleLinesMajorStepValue   = 1F;
            this.gPressure.ScaleLinesMajorWidth       = 2;
            this.gPressure.ScaleLinesMinorColor       = System.Drawing.Color.Gray;
            this.gPressure.ScaleLinesMinorInnerRadius = 75;
            this.gPressure.ScaleLinesMinorOuterRadius = 80;
            this.gPressure.ScaleLinesMinorTicks       = 2;
            this.gPressure.ScaleLinesMinorWidth       = 1;
            this.gPressure.ScaleNumbersColor          = System.Drawing.Color.Black;
            this.gPressure.ScaleNumbersFormat         = null;
            this.gPressure.ScaleNumbersRadius         = 95;
            this.gPressure.ScaleNumbersRotation       = 0;
            this.gPressure.ScaleNumbersStartScaleLine = 0;
            this.gPressure.ScaleNumbersStepScaleLines = 1;
            this.gPressure.Size                       = new System.Drawing.Size(205, 170);
            this.gPressure.TabIndex                   = 1;
            this.gPressure.Text                       = "aGauge1";
            this.gPressure.Value                      = 0F;
            this.gPressure.ValueInRangeChanged       +=
                new System.EventHandler <ValueInRangeChangedEventArgs>(this.gPressure_ValueInRangeChanged);

            // lblPressure
            this.lblPressure.BackGround         = System.Drawing.Color.Silver;
            this.lblPressure.BorderColor        = System.Drawing.Color.Black;
            this.lblPressure.BorderSpace        = 0;
            this.lblPressure.CharSpacing        = 0;
            this.lblPressure.DotMatrix          = LCDLabel.DotMatrix.mat5x7;
            this.lblPressure.ForeColor          = System.Drawing.Color.White;
            this.lblPressure.LineSpacing        = 1;
            this.lblPressure.Location           = new System.Drawing.Point(73, 252);
            this.lblPressure.Name               = "lblPressure";
            this.lblPressure.NumberOfCharacters = 4;
            this.lblPressure.PixelHeight        = 4;
            this.lblPressure.PixelOff           = System.Drawing.Color.White;
            this.lblPressure.PixelOn            = System.Drawing.Color.Red;
            this.lblPressure.PixelShape         = LCDLabel.PixelShape.Round;
            this.lblPressure.PixelSize          = LCDLabel.PixelSize.pix4x4;
            this.lblPressure.PixelSpacing       = 0;
            this.lblPressure.PixelWidth         = 4;
            this.lblPressure.Size               = new System.Drawing.Size(82, 30);
            this.lblPressure.TabIndex           = 2;
            this.lblPressure.Text               = "4.5";
            this.lblPressure.TextLines          = 1;

            // OilControl
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor           = System.Drawing.Color.White;
            this.Controls.Add(this.lblPressure);
            this.Controls.Add(this.gPressure);
            this.Controls.Add(this.gTemperature);
            this.Name = "OilControl";
            this.Size = new System.Drawing.Size(221, 318);
            this.ResumeLayout(false);
        }
Example #16
0
 public MainForm()
 {
     InitializeComponent();
     label = aGauge1.GaugeLabels.FindByName("GaugeLabel1");
     alert = aGauge1.GaugeRanges.FindByName("AlertRange");
 }