Exemple #1
0
 public ValueInRangeChangedEventArgs(AGaugeRange range, Single value, bool inRange)
 {
     this.Range = range;
     this.Value = value;
     this.InRange = inRange;
 }
 public ValueInRangeChangedEventArgs(AGaugeRange range, Single value, bool inRange)
 {
     this.Range   = range;
     this.Value   = value;
     this.InRange = inRange;
 }
Exemple #3
0
 public void Insert(int index, AGaugeRange itemType)
 {
     itemType.SetOwner(Owner);
     if (string.IsNullOrEmpty(itemType.Name)) itemType.Name = GetUniqueName();
     List.Insert(index, itemType);
 }
Exemple #4
0
 public void Remove(AGaugeRange itemType)
 {
     List.Remove(itemType);
 }
Exemple #5
0
 public int IndexOf(AGaugeRange itemType)
 {
     return List.IndexOf(itemType);
 }
Exemple #6
0
 public bool Contains(AGaugeRange itemType)
 {
     return List.Contains(itemType);
 }
Exemple #7
0
 public int Add(AGaugeRange itemType)
 {
     itemType.SetOwner(Owner);
     if (string.IsNullOrEmpty(itemType.Name)) itemType.Name = GetUniqueName();
     return List.Add(itemType);
 }
Exemple #8
0
 private void OnValueInRangeChanged(AGaugeRange range, Single value)
 {
     EventHandler<ValueInRangeChangedEventArgs> e = ValueInRangeChanged;
     if (e != null) e(this, new ValueInRangeChangedEventArgs(range, value, range.InRange));
 }
 public static void GenerateCircularGauge(string file, double min, double medium, double max, double pointervalue, string name, string color)
 {
     try
     {
         AGauge Gauge = new AGauge();
         // Gauge properties
         Gauge.BaseArcColor  = Color.Gray;
         Gauge.BaseArcRadius = 80;
         Gauge.BaseArcStart  = 135;
         Gauge.BaseArcSweep  = 270;
         Gauge.BaseArcWidth  = 2;
         //Gauge.Center.X= 100;
         //Gauge.Center.Y = 100;
         Gauge.MaxValue                   = (float)max + 3;
         Gauge.MinValue                   = 0;
         Gauge.NeedleColor1               = AGaugeNeedleColor.Blue;
         Gauge.NeedleColor2               = Color.Blue;
         Gauge.NeedleRadius               = 80;
         Gauge.NeedleType                 = NeedleType.Advance;
         Gauge.NeedleWidth                = 2;
         Gauge.ScaleLinesInterColor       = Color.Black;
         Gauge.ScaleLinesInterInnerRadius = 73;
         Gauge.ScaleLinesInterOuterRadius = 80;
         Gauge.ScaleLinesInterWidth       = 1;
         Gauge.ScaleLinesMajorColor       = Color.Black;
         Gauge.ScaleLinesMajorInnerRadius = 70;
         Gauge.ScaleLinesMajorOuterRadius = 80;
         Gauge.ScaleLinesMajorStepValue   = 1;
         Gauge.ScaleLinesMajorWidth       = 2;
         Gauge.ScaleLinesMinorColor       = Color.LightGray;
         Gauge.ScaleLinesMinorInnerRadius = 75;
         Gauge.ScaleLinesMinorOuterRadius = 80;
         Gauge.ScaleLinesMinorTicks       = 9;
         Gauge.ScaleLinesMinorWidth       = 1;
         Gauge.ScaleNumbersColor          = Color.Black;
         Gauge.ScaleNumbersRadius         = 62;
         Gauge.ScaleNumbersRotation       = 0;
         Gauge.ScaleNumbersStartScaleLine = 0;
         Gauge.ScaleNumbersStepScaleLines = 1;
         Gauge.Value = (float)pointervalue;
         // Appearance
         Gauge.BackColor = Color.White;
         Gauge.Name      = "Gauge1";
         Gauge.Width     = 250;
         Gauge.Height    = 200;
         AGaugeRange range1 = new AGaugeRange();
         range1.Color      = Color.FromArgb(141, 203, 42); range1.InnerRadius = 70; range1.OuterRadius = 80;
         range1.StartValue = 0;
         range1.EndValue   = (float)min;
         AGaugeRange range2 = new AGaugeRange();
         range2.Color      = Color.FromArgb(255, 122, 0); range2.InnerRadius = 70; range2.OuterRadius = 80;
         range2.StartValue = (float)min;
         range2.EndValue   = (float)medium;
         AGaugeRange range3 = new AGaugeRange();
         range3.Color      = Color.FromArgb(194, 0, 0); range3.InnerRadius = 70; range3.OuterRadius = 80;
         range3.StartValue = (float)medium;
         range3.EndValue   = (float)max + 3;
         Gauge.GaugeRanges.Add(range1);
         Gauge.GaugeRanges.Add(range2);
         Gauge.GaugeRanges.Add(range3);
         AGaugeLabel label1 = new AGaugeLabel();
         label1.Color = Color.Black;
         label1.Text  = name; Point p1 = new Point(); p1.X = 48; p1.Y = 1; label1.Position = p1;
         Gauge.GaugeLabels.Add(label1);
         AGaugeLabel label2 = new AGaugeLabel();
         label2.Color = Color.Black;
         if (color == "Table_Rows_Green")
         {
             label2.Color = Color.FromArgb(141, 203, 42);
         }
         else if (color == "Table_Rows_orange")
         {
             label2.Color = Color.FromArgb(255, 122, 0);
         }
         else
         {
             label2.Color = Color.FromArgb(194, 0, 0);
         }
         label2.Text = pointervalue.ToString(); Point p2 = new Point(); p2.X = 85; p2.Y = 130; label2.Position = p2;
         Gauge.GaugeLabels.Add(label2);
         Bitmap bmp = new Bitmap(Gauge.Width, Gauge.Height);
         Gauge.DrawToBitmap(bmp, new Rectangle(0, 0, bmp.Width, bmp.Height));
         bmp.Save(file);
     }
     catch { }
 }