Beispiel #1
0
        /// <summary>
        /// 원하는 Chart를 빌드합니다.
        /// </summary>
        public override IChart BuildFusionChart()
        {
            var chart = new LinearGauge
            {
                Axis =
                {
                    LowerLimit        =     0,
                    UpperLimit        =   100,
                    LowerLimitDisplay = "Bad",
                    UpperLimitDisplay = "Good"
                },
                GaugeRoundRadius = 14,
                MarginAttr       = { RightMargin = 20 },
                Palette          = rnd.Next(1, 5),
                ShowValue        = true,
                NumberAttr       = { NumberSuffix = "%" },
                DataStreamUrl    = "LinearGaugeRealTime.ashx",
                RefreshInterval  = 3
            };

            // chart.TickMarkAttr.TickValueDistance = 20;

            BuildColorRange(chart);
            BuildPointers(chart);
            BuildStyles(chart);
            // BuildAnnotations(chart);
            BuildAlerts(chart);

            AddTrendPoints(chart);

            return(chart);
        }
        public LinearGaugeChart(ChartView BaseChart)
        {
            linearGauge = new LinearGauge();
            linearGauge.FillSampleValues();

            BaseChart.Chart.Series.Add(linearGauge);
            BaseChart.Chart.Header.Visible = false;
            BaseChart.Rotation             = 0;

            linearGauge.Value          = 20;
            linearGauge.Axis.Increment = 10;
            linearGauge.Maximum        = 100;
            linearGauge.Minimum        = 0;

            linearGauge.FaceBrush.Color           = Color.White;
            linearGauge.FaceBrush.ForegroundColor = Color.White;
            linearGauge.RedLine.Visible           = false;
            linearGauge.GreenLine.Visible         = false;
            linearGauge.Hand.Visible               = false;
            linearGauge.FaceBrush.Visible          = true;
            linearGauge.FaceBrush.Gradient.Visible = false;
            linearGauge.Maximum                     = 100;
            linearGauge.Minimum                     = 0;
            linearGauge.Hand.Visible                = false;
            linearGauge.Ticks.Visible               = true;
            linearGauge.Ticks.VertSize              = 60;
            linearGauge.Ticks.HorizSize             = 0.5;
            linearGauge.MinorTicks.Visible          = false;
            linearGauge.MinorTickDistance           = 0;
            linearGauge.MaxValueIndicator.VertSize  = 10;
            linearGauge.MaxValueIndicator.HorizSize = 10;
            linearGauge.MaxValueIndicator.Visible   = true;
        }
Beispiel #3
0
        public void Overflow(TickBarPlacement placement, bool isDirectionReversed, double value, string expected)
        {
            var range = new LinearIndicator
            {
                Value = value,
                Style = StyleHelper.DefaultStyle <LinearIndicator>(),
            };

            var gauge = new LinearGauge
            {
                Minimum             = 0,
                Maximum             = 100,
                Value               = value,
                Placement           = placement,
                IsDirectionReversed = isDirectionReversed,
                Content             = range,
                Style               = StyleHelper.DefaultStyle <LinearGauge>(),
            };

            gauge.Arrange(new Rect(new Size(10, 10)));
            Assert.AreEqual(expected, gauge.ContentOverflow.ToString());
            Assert.AreEqual(expected, range.Overflow.ToString());

            gauge.Measure(new Size(10, 10));
            gauge.Arrange(new Rect(new Size(10, 10)));
            Assert.AreEqual(expected, gauge.ContentOverflow.ToString());
            Assert.AreEqual(expected, range.Overflow.ToString());
        }
Beispiel #4
0
        public override void SetupGaugeCore(GaugeControl gaugeContainer)
        {
            LinearGauge linearGauge = gaugeContainer.AddLinearGauge();

            // Add the default elements (a scale, background layer and level bar).
            linearGauge.AddDefaultElements();
            // Change the background layer's paint style.
            LinearScaleBackgroundLayer backgroundLinear = linearGauge.BackgroundLayers[0];

            backgroundLinear.ShapeType = BackgroundLayerShapeType.Linear_Style3;
            // Customize the scale's settings.
            LinearScaleComponent scaleLinear = linearGauge.Scales[0];

            BindableComponent                      = scaleLinear;
            scaleLinear.MinValue                   = 0;
            scaleLinear.MaxValue                   = 100;
            scaleLinear.Value                      = 0;
            scaleLinear.MajorTickCount             = 6;
            scaleLinear.MajorTickmark.FormatString = "{0:F0}";
            scaleLinear.MajorTickmark.ShapeType    = TickmarkShapeType.Linear_Style6_3;
            scaleLinear.MinorTickCount             = 3;
            scaleLinear.MinorTickmark.ShapeType    = TickmarkShapeType.Linear_Style5_2;
            // Shift tick marks to the right.
            scaleLinear.MajorTickmark.ShapeOffset = 5f;
            scaleLinear.MinorTickmark.ShapeOffset = 5f;
            // Change the levelBar's paint style.
            LinearScaleLevelComponent levelBar = linearGauge.Levels[0];

            levelBar.ShapeType = LevelShapeSetType.Style3;
            // Shift the background layer up and to the left.
            backgroundLinear.ScaleStartPos = new PointF2D(backgroundLinear.ScaleStartPos.X - 0.005f,
                                                          backgroundLinear.ScaleStartPos.Y - 0.015f);
            backgroundLinear.ScaleEndPos = new PointF2D(backgroundLinear.ScaleEndPos.X - 0.005f,
                                                        backgroundLinear.ScaleEndPos.Y);
        }
        void ReleaseDesignerOutlets()
        {
            if (LinearGauge != null)
            {
                LinearGauge.Dispose();
                LinearGauge = null;
            }

            if (RadialGauge != null)
            {
                RadialGauge.Dispose();
                RadialGauge = null;
            }

            if (Stepper != null)
            {
                Stepper.Dispose();
                Stepper = null;
            }

            if (Switch != null)
            {
                Switch.Dispose();
                Switch = null;
            }
        }
Beispiel #6
0
 private static void SaveImage(LinearGauge gauge)
 {
     Directory.CreateDirectory($@"C:\Temp\LinearRange");
     gauge.SaveImage(
         gauge.Placement.IsHorizontal() ? new Size(100, 10) : new Size(10, 100),
         $@"C:\Temp\LinearRange\{GetFileName((LinearRange)gauge.Content)}");
 }
        public void Overflow(TickBarPlacement placement, bool isDirectionReversed, double strokeThickness, PenLineCap startLineCap, PenLineCap endLineCap, string padding, string expected)
        {
            var tickBar = new LinearLineBar
            {
                StrokeThickness     = strokeThickness,
                Minimum             = 0,
                Maximum             = 10,
                Stroke              = Brushes.Black,
                StrokeStartLineCap  = startLineCap,
                StrokeEndLineCap    = endLineCap,
                Placement           = placement,
                IsDirectionReversed = isDirectionReversed,
                Padding             = padding.AsThickness(),
            };

            var gauge = new LinearGauge {
                Content = tickBar
            };

            gauge.Arrange(new Rect(new Size(10, 10)));
            Assert.AreEqual(expected, gauge.ContentOverflow.ToString());
            Assert.AreEqual(expected, tickBar.Overflow.ToString());

            gauge.Measure(new Size(10, 10));
            gauge.Arrange(new Rect(new Size(10, 10)));
            Assert.AreEqual(expected, gauge.ContentOverflow.ToString());
            Assert.AreEqual(expected, tickBar.Overflow.ToString());
        }
Beispiel #8
0
        private void SetUpLGauge()
        {
            Axis axisH = new Axis();

            axisH.Horizontal = true;
            Axis axisV = new Axis();

            axisV.Horizontal              = false;
            lGauge                        = new LinearGauge();
            lGauge.HorizAxis              = HorizontalAxis.Custom;
            lGauge.VertAxis               = VerticalAxis.Custom;
            lGauge.Horizontal             = false;
            lGauge.Visible                = false;
            lGauge.CustomHorizAxis        = axisH;
            lGauge.CustomVertAxis         = axisV;
            lGauge.Axis.Title.Font.Size   = 7;
            lGauge.Axis.Title.Font.Color  = CustomGauge.GetGaugePaletteColor(20, lGauge.GaugeColorPalette);
            lGauge.Axis.Title.Caption     = "Independent value";
            lGauge.Axis.Labels.Font.Size  = 6;
            lGauge.Axis.Labels.Font.Color = CustomGauge.GetGaugePaletteColor(20, lGauge.GaugeColorPalette);
            lGauge.Axis.Increment         = 20;
            lGauge.RedLine.Visible        = false;
            lGauge.GreenLine.Visible      = false;
            lGauge.Frame.Visible          = false;
            lGauge.FaceBrush.Visible      = false;
        }
        public void Overflow(TickBarPlacement placement, bool isDirectionReversed, string padding, string expected)
        {
            var tickBar = new LinearTextBar
            {
                Minimum             = 0,
                Maximum             = 10,
                TickFrequency       = 1,
                Placement           = placement,
                IsDirectionReversed = isDirectionReversed,
                Padding             = padding.AsThickness(),
                FontFamily          = new FontFamily("Arial"), // Seoge UI is measured differently on Win 7 and Win 10 for some reason
                FontSize            = 12,
            };

            var gauge = new LinearGauge {
                Content = tickBar
            };

            gauge.Arrange(new Rect(new Size(10, 10)));
            Assert.AreEqual(expected, gauge.ContentOverflow.ToString());
            Assert.AreEqual(expected, tickBar.Overflow.ToString());

            gauge.Measure(new Size(10, 10));
            gauge.Arrange(new Rect(new Size(10, 10)));
            Assert.AreEqual(expected, gauge.ContentOverflow.ToString());
            Assert.AreEqual(expected, tickBar.Overflow.ToString());
        }
        public void SimpleLinearGague() {
            var gauge = new LinearGauge();

            gauge.Axis.LowerLimit = 0;
            gauge.Axis.UpperLimit = 100;
            gauge.Axis.LowerLimitDisplay = "Bad";
            gauge.Axis.UpperLimitDisplay = "Good";

            gauge.Pointer.Radius = 4;
            gauge.Pointer.Sides = 2;
            gauge.Pointer.BorderThickness = 2;

            gauge.Palette = 1;
            gauge.NumberAttr.NumberSuffix = "%";
            gauge.TickMarkAttr.TickValueDistance = 20;


            gauge.DataStreamUrl = "CPUData.ashx";
            gauge.RefreshInterval = 3;

            BuildColorRange(gauge);
            BuildPointers(gauge);

            BuildAlerts(gauge);
            BuildAnnotations(gauge);

            BuildStyles(gauge);

            ValidateChartXml(gauge);
        }
 public CustomRenderer(LinearGauge linearGauge)
 {
     m_LinearGauge      = linearGauge;
     majorTicksDistance = 0;
     m_minorTicksPixels = 0;
     start = 25;
 }
Beispiel #12
0
        void ReleaseDesignerOutlets()
        {
            if (BulletGraph != null)
            {
                BulletGraph.Dispose();
                BulletGraph = null;
            }

            if (LinearGauge != null)
            {
                LinearGauge.Dispose();
                LinearGauge = null;
            }

            if (RadialGauge != null)
            {
                RadialGauge.Dispose();
                RadialGauge = null;
            }

            if (Stepper != null)
            {
                Stepper.Dispose();
                Stepper = null;
            }

            if (ValueLabel != null)
            {
                ValueLabel.Dispose();
                ValueLabel = null;
            }
        }
Beispiel #13
0
        public void Overflow(TickBarPlacement placement, bool isDirectionReversed, double tickWidth, double strokeThickness, string padding, string expected)
        {
            var tickBar = new LinearTickBar
            {
                StrokeThickness     = strokeThickness,
                Minimum             = 0,
                Maximum             = 10,
                TickFrequency       = 1,
                TickWidth           = tickWidth,
                Stroke              = Brushes.Black,
                Fill                = Brushes.Red,
                Placement           = placement,
                IsDirectionReversed = isDirectionReversed,
                Padding             = padding.AsThickness(),
            };

            var gauge = new LinearGauge {
                Content = tickBar
            };

            gauge.Arrange(new Rect(new Size(10, 10)));
            Assert.AreEqual(expected, gauge.ContentOverflow.ToString());
            Assert.AreEqual(expected, tickBar.Overflow.ToString());

            gauge.Measure(new Size(10, 10));
            gauge.Arrange(new Rect(new Size(10, 10)));
            Assert.AreEqual(expected, gauge.ContentOverflow.ToString());
            Assert.AreEqual(expected, tickBar.Overflow.ToString());
        }
Beispiel #14
0
        void ReleaseDesignerOutlets()
        {
            if (BulletGraph != null)
            {
                BulletGraph.Dispose();
                BulletGraph = null;
            }

            if (LinearGauge != null)
            {
                LinearGauge.Dispose();
                LinearGauge = null;
            }

            if (StackView != null)
            {
                StackView.Dispose();
                StackView = null;
            }

            if (StackViewHeightContraint != null)
            {
                StackViewHeightContraint.Dispose();
                StackViewHeightContraint = null;
            }
        }
Beispiel #15
0
        void ReleaseDesignerOutlets()
        {
            if (Entry != null)
            {
                Entry.Dispose();
                Entry = null;
            }

            if (LinearGauge != null)
            {
                LinearGauge.Dispose();
                LinearGauge = null;
            }

            if (RadialGauge != null)
            {
                RadialGauge.Dispose();
                RadialGauge = null;
            }

            if (Stepper != null)
            {
                Stepper.Dispose();
                Stepper = null;
            }
        }
        public void SimpleLinearGague()
        {
            var gauge = new LinearGauge();

            gauge.Axis.LowerLimit        = 0;
            gauge.Axis.UpperLimit        = 100;
            gauge.Axis.LowerLimitDisplay = "Bad";
            gauge.Axis.UpperLimitDisplay = "Good";

            gauge.Pointer.Radius          = 4;
            gauge.Pointer.Sides           = 2;
            gauge.Pointer.BorderThickness = 2;

            gauge.Palette = 1;
            gauge.NumberAttr.NumberSuffix        = "%";
            gauge.TickMarkAttr.TickValueDistance = 20;


            gauge.DataStreamUrl   = "CPUData.ashx";
            gauge.RefreshInterval = 3;

            BuildColorRange(gauge);
            BuildPointers(gauge);

            BuildAlerts(gauge);
            BuildAnnotations(gauge);

            BuildStyles(gauge);

            ValidateChartXml(gauge);
        }
 private static void BuildPointers(LinearGauge gauge) {
     gauge.Pointers.Add(new PointerElement
                        {
                            Id = "CS",
                            Value = 12,
                            Color = "#336699".FromHtml()
                        });
 }
Beispiel #18
0
        /// <summary>
        /// Creates a LinearGauge instance with specified name and parent.
        /// </summary>
        /// <param name="name">The name of the LinearGauge instance.</param>
        /// <param name="parent">The parent of the LinearGauge instance.</param>
        /// <returns>The LinearGauge instance.</returns>
        public static LinearGauge CreateLinearGauge(string name, Base parent)
        {
            LinearGauge gauge = new LinearGauge();

            gauge.Name   = name;
            gauge.Parent = parent;
            return(gauge);
        }
 private static void BuildPointers(LinearGauge gauge)
 {
     gauge.Pointers.Add(new PointerElement
     {
         Id    = "CS",
         Value = 12,
         Color = "#336699".FromHtml()
     });
 }
Beispiel #20
0
 private static void BuildPointers(LinearGauge gauge)
 {
     gauge.Pointers.Add(new PointerElement
     {
         Id       = "CS",
         Value    = 12,
         Radius   = 10,
         ToolText = "만족도"
     });
 }
        /// <summary>
        /// Creates a LinearGauge instance with specified name and parent.
        /// </summary>
        /// <param name="name">The name of the LinearGauge instance.</param>
        /// <param name="parent">The parent of the LinearGauge instance.</param>
        /// <returns>The LinearGauge instance.</returns>
        public static LinearGauge CreateLinearGauge(string name, Base parent)
        {
            LinearGauge gauge = new LinearGauge();

            gauge.Name = name;
            if ((parent as IParent).CanContain(gauge))
            {
                gauge.Parent = parent;
            }
            return(gauge);
        }
Beispiel #22
0
        private void UpdateGaugeSize(LinearGauge gauge, SizeF containerSize, SizeF scaleProportion, float markerProportion)
        {
            float indentX    = Math.Min(containerSize.Width / scaleProportion.Width * scaleProportion.Height * markerProportion, containerSize.Height * markerProportion);
            float indentY    = containerSize.Height / 8f;
            SizeF targetArea = new SizeF(containerSize.Width - indentX * 2f, containerSize.Height - indentY * 2f);

            float proportion = Math.Max(1f, ((targetArea.Width / scaleProportion.Width) / (targetArea.Height / scaleProportion.Height)));

            gauge.Bounds = new Rectangle((int)indentX, (int)(indentY + (targetArea.Height - targetArea.Width / 2f / proportion) / 2f), (int)targetArea.Width, (int)(targetArea.Width / 2f / proportion));
            gauge.Scales[0].StartPoint = new PointF2D(62.5f, 125f * (1f + proportion));
            gauge.Scales[0].EndPoint   = new PointF2D(62.5f, 125f * (1f - proportion));
        }
Beispiel #23
0
            private LinearGauge CreateGauge(String name, GameObject component, Vector3 scale)
            {
                // create indicator
                GameObject indicator = CreateIndicator(name, component);
                // get the LinearGauge component
                LinearGauge gauge = indicator.GetComponent <LinearGauge>();

                // update gauges limits
                AdjustGaugeLimits(gauge, scale);
                // set gauge pointer.
                gauge.pointer = indicator.transform;
                // return the gauge
                return(gauge);
            }
Beispiel #24
0
        public void Render(TickBarPlacement placement, bool isDirectionReversed, double value)
        {
            var range = new LinearIndicator
            {
                Value = value,
                Style = StyleHelper.DefaultStyle <LinearIndicator>(),
            };

            var gauge = new LinearGauge
            {
                Minimum             = 0,
                Maximum             = 100,
                Value               = value,
                Placement           = placement,
                IsDirectionReversed = isDirectionReversed,
                Content             = range,
            };

            ImageAssert.AreEqual(GetFileName(range), gauge);
        }
Beispiel #25
0
        public void Render(TickBarPlacement placement, bool isDirectionReversed, double start, double end)
        {
            var range = new LinearRange
            {
                Background = Brushes.Black,
                Start      = start,
                End        = end,
            };

            var gauge = new LinearGauge
            {
                Minimum             = 0,
                Maximum             = 100,
                Placement           = placement,
                IsDirectionReversed = isDirectionReversed,
                Content             = range,
            };

            ImageAssert.AreEqual(GetFileName(range), gauge);
        }
Beispiel #26
0
            public void Init()
            {
                // try to catch any exception if compatibility issues with KSP occur
                try
                {
                    // get the original control input gauges
                    GameObject stagingQuadrant = GameObject.Find(STAGING_QUADRANT_NAME);
                    GameObject roll            = stagingQuadrant.transform.FindChild(COMPONENT_ROLL_NAME).gameObject;
                    GameObject pitch           = stagingQuadrant.transform.FindChild(COMPONENT_PITCH_NAME).gameObject;
                    GameObject yaw             = stagingQuadrant.transform.FindChild(COMPONENT_YAW_NAME).gameObject;

                    // create gauges
                    this.trimRollGauge  = CreateGauge("Roll Trim", roll, LIMIT_SCALE_ROLL);
                    this.trimPitchGauge = CreateGauge("Pitch Trim", pitch, LIMIT_SCALE_PITCH);
                    this.trimYawGauge   = CreateGauge("Yaw Trim", yaw, LIMIT_SCALE_YAW);
                }
                catch
                {
                    Log.Warning("exception caught in trim indicator init");
                    disabled = true;
                    NanoGauges.configuration.trimIndicatorsEnabled = false;
                }
            }
        public ScalesLinearChart(ChartView BaseChart)
        {
            linearGauge = new LinearGauge();

            BaseChart.Chart.Series.Add(linearGauge);
            BaseChart.Chart.Header.Visible = false;
            BaseChart.Rotation             = 0;

            linearGauge.Value          = 70;
            linearGauge.Axis.Increment = 10;
            linearGauge.Maximum        = 100;
            linearGauge.Minimum        = 0;

            linearGauge.Hand.Gradient.Visible     = true;
            linearGauge.Hand.Gradient.StartColor  = Color.FromRgb(0, 129, 206);
            linearGauge.Hand.Gradient.EndColor    = Color.FromRgb(40, 174, 225);
            linearGauge.Hand.Gradient.MiddleColor = Color.FromRgb(0, 153, 244);
            linearGauge.Hand.Gradient.Direction   = GradientDirection.BottomTop;
            linearGauge.GreenLine.Visible         = false;
            linearGauge.RedLine.Visible           = false;
            linearGauge.MinorTicks.Visible        = false;
            linearGauge.Ticks.Visible             = true;
            linearGauge.Ticks.VertSize            = 70;
            linearGauge.Ticks.HorizSize           = 0.5;
            linearGauge.Ticks.Color                 = Color.White;
            linearGauge.Ticks.Pen.Color             = Color.White;
            linearGauge.MaxValueIndicator.Visible   = true;
            linearGauge.MaxValueIndicator.VertSize  = 12;
            linearGauge.MaxValueIndicator.HorizSize = 12;
            linearGauge.MaxValueIndicator.Color     = Color.FromRgb(0, 93, 160);
            linearGauge.FaceBrush.Gradient.Visible  = false;
            linearGauge.FaceBrush.Color             = Color.White;
            linearGauge.ValueAreaBrush.Visible      = true;
            linearGauge.ValueAreaBrush.Color        = Color.FromRgb(170, 210, 240);
            linearGauge.IsoVertAxes                 = false;
            linearGauge.IsoHorizAxes                = false;
        }
Beispiel #28
0
        public void Render(TickBarPlacement placement, bool isDirectionReversed, double value)
        {
            var gauge = new LinearGauge
            {
                Minimum             = 0,
                Maximum             = 100,
                Value               = value,
                Placement           = placement,
                IsDirectionReversed = isDirectionReversed,
                MajorTickFrequency  = 25,
                MajorTicks          = new DoubleCollection {
                    15
                },
                MinorTickFrequency = 10,
                MinorTicks         = new DoubleCollection {
                    8
                },
                FontFamily = new FontFamily("Arial"), // Seoge UI is measured differently on Win 7 and Win 10 for some reason
                FontSize   = 12,
                Style      = StyleHelper.DefaultStyle <LinearGauge>(),
            };

            ImageAssert.AreEqual(GetFileName(gauge), gauge);
        }
Beispiel #29
0
 private void AdjustGaugeLimits(LinearGauge gauge, Vector3 scale)
 {
     gauge.minPos = Vector3.Scale(gauge.minPos, scale);
     gauge.maxPos = Vector3.Scale(gauge.maxPos, scale);
 }
Beispiel #30
0
        public void LoadControls(String panelName)
        {
            //Cargamos la configuracion
            var configuracion = ProyectoCraft.Base.Configuracion.Configuracion.Instance();
            var opcion = configuracion.GetValue("Semaforos_Brasil_Enabled"); //puede retornar un true, false o null

            var pathxml = "";

            Path = opcion.HasValue && opcion.Value.Equals(true) ? @"panel de control/Brasil" : @"panel de control/Chile";

            pathxml = System.IO.Path.Combine(Application.StartupPath, string.Format(
                                                 @Path + "/panel de control/{0}", panelName));

            var xmldoc = new XmlDocument();
            xmldoc.Load(pathxml);

            var panelNodes = xmldoc.SelectNodes("/panel/panel");
            foreach (XmlNode panelNode in panelNodes) {

                var size = new Size(Convert.ToInt16(panelNode.Attributes["width"].Value),
                                            Convert.ToInt16(panelNode.Attributes["heigth"].Value));
                var location = new Point(Convert.ToInt16(panelNode.Attributes["x"].Value),
                                         Convert.ToInt16(panelNode.Attributes["y"].Value));

                var panelContainer = new PanelContainer(panelNode.Attributes["title"].Value, location, size);

                var xmlnodes = panelNode.SelectNodes("control");
                foreach (XmlNode xmlnode in xmlnodes) {
                    if (!String.IsNullOrEmpty(xmlnode.InnerText.Trim())) {
                        MyControl myControl = null;
                        var xmldocControles = new XmlDocument();
                        xmldocControles.Load(System.IO.Path.Combine(Application.StartupPath, string.Format(
                            @Path + "/controles/{0}", xmlnode.InnerText.Trim())));
                        var TypeOfControl = xmldocControles.SelectSingleNode("/control").Attributes["type"].Value;
                        size = new Size(Convert.ToInt16(xmlnode.Attributes["width"].Value),
                                            Convert.ToInt16(xmlnode.Attributes["heigth"].Value));
                        location = new Point(Convert.ToInt16(xmlnode.Attributes["x"].Value),
                                                 Convert.ToInt16(xmlnode.Attributes["y"].Value));
                        switch (TypeOfControl.ToUpper()) {
                            case "DIGITALGAUGE":
                                myControl = new DigitalGauge(xmldocControles, location, size);
                                break;
                            case "LINEARGAUGE":
                                myControl = new LinearGauge(xmldocControles, location, size);
                                break;
                            case "SEMAFORO":
                                myControl = new Semaforo(xmldocControles, location, size);
                                break;
                            case "GRAFICOBARRA3D":
                                myControl = new GraficoBarra3D(xmldocControles, location, size);
                                break;
                            case "SEMAFORO_V2":
                                myControl = new SemaforoV2(xmldocControles, location, size);
                                break;
                        }
                        if (myControl != null)
                            panelContainer.Controles.Add(myControl);
                    }
                }
                PanelContainers.Add(panelContainer);
            }
        }
 public GaugeLinearPointerFactory(LinearGauge gaugeContainer)
 {
     container = gaugeContainer;
 }
Beispiel #32
0
        public BatteryLinearChart(ChartView BaseChart)
        {
            linearGauge = new LinearGauge();
            var value = Battery.ChargeLevel * 100;

            Battery.BatteryChanged += Battery_BatteryChanged;
            simulationMark          = new Annotation();
            this.BaseChart          = BaseChart;

            BaseChart.Chart.Series.Add(linearGauge);
            BaseChart.Chart.Footer.Visible   = true;
            BaseChart.Chart.Footer.Font.Size = 20;

            linearGauge.Value   = 100 - value;
            linearGauge.Maximum = 100;
            linearGauge.Minimum = 0;

            linearGauge.Axis.AxisPen.Color     = Color.Black;
            linearGauge.Axis.MinorGrid.Visible = true;
            linearGauge.Axis.Labels.Font.Size  = 12;
            linearGauge.Axis.Labels.Color      = Color.Blue;
            linearGauge.Axis.Ticks.Visible     = true;
            linearGauge.Axis.Increment         = 10;

            BaseChart.Rotation        = 90;
            BaseChart.BackgroundColor = Color.White;

            BaseChart.Chart.Axes.Bottom.Labels.Font.Size        = 16;
            BaseChart.Chart.Axes.Bottom.Labels.Font.Color       = Color.Black;
            BaseChart.Chart.Axes.Bottom.Labels.Transparency     = 100;
            BaseChart.Chart.Axes.Bottom.MinorTicks.Visible      = false;
            BaseChart.Chart.Axes.Bottom.MinorTicks.Length       = 20;
            BaseChart.Chart.Axes.Bottom.MinorTicks.Width        = 1;
            BaseChart.Chart.Axes.Bottom.MinorTicks.Transparency = 100;
            BaseChart.Chart.Axes.Bottom.Ticks.Visible           = false;

            linearGauge.Hand.Gradient.Visible = false;
            linearGauge.Hand.Color            = Color.White;
            linearGauge.Hand.Transparency     = 0;

            linearGauge.GreenLine.Visible = false;
            linearGauge.RedLine.Visible   = false;

            linearGauge.MinorTicks.Visible = false;

            linearGauge.Ticks.Visible   = true;
            linearGauge.Ticks.VertSize  = 150;
            linearGauge.Ticks.HorizSize = 2.5;
            linearGauge.Ticks.Color     = Color.White;
            linearGauge.Ticks.Pen.Color = Color.White;

            linearGauge.MaxValueIndicator.Visible = false;

            linearGauge.FaceBrush.Gradient.Visible = false;
            linearGauge.FaceBrush.Color            = Color.White;

            linearGauge.ValueAreaBrush.Visible = true;

            AddFaceBrushColor(value);

            linearGauge.IsoVertAxes  = false;
            linearGauge.IsoHorizAxes = false;

            linearGauge.Marks.Visible = false;

            Themes.AplicarMarksTheme1(BaseChart);
            linearGauge.Marks.Angle      = 90;
            linearGauge.Marks.TailStyle  = MarksTail.None;
            linearGauge.Marks.BackColor  = Color.White;
            linearGauge.Marks.Width     += 50;
            linearGauge.Marks.Font.Color = Color.Black;
            linearGauge.GetSeriesMark   += LinearGauge_GetSeriesMark;
            BaseChart.Chart.AfterDraw   += Chart_AfterDraw;
        }
Beispiel #33
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GaugeLinearScale" /> class.
 /// </summary>
 /// <value>The linear gauge.</value>
 public GaugeLinearScale(LinearGauge gauge)
     : base()
 {
     Labels      = new GaugeLinearScaleLabels();
     lienarGauge = gauge;
 }
Beispiel #34
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GaugeLinearScaleBuilder" /> class.
 /// </summary>
 /// <param name="gauge">The gauge component.</param>
 public GaugeLinearScaleBuilder(LinearGauge gauge)
     : base(gauge.Scale)
 {
     linearGauge = gauge;
 }
Beispiel #35
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GaugeLinearScale" /> class.
 /// </summary>
 /// <value>The linear gauge.</value>
 public GaugeLinearScale(LinearGauge gauge)
     : base()
 {
     Labels = new GaugeLinearScaleLabels();
     lienarGauge = gauge;
 }