Beispiel #1
0
        public override void OnTick()
        {
            if (!Manager.IsInGame)
                return;

            var greenCircle = new Circle(CIRCLE_RADIUS, Color.FromArgb(0x8f, 0, 0xff, 0), Color.FromArgb(0x8f, 0, 0xff, 0));
            var redCircle = new Circle(CIRCLE_RADIUS, Color.FromArgb(0x8f, 0xff, 0, 0), Color.FromArgb(0x8f, 0xff, 0, 0));
            var blueCircle = new Circle(CIRCLE_RADIUS, Color.Black, Color.FromArgb(0x8f, 0, 0, 0xff), isFilled: false);

            var units = Manager.Objects.Where(x => x.IsValid && (x.IsUnit || x.IsPlayer)).OfType<WoWUnit>();
            foreach (var u in units)
            {
                if (u.IsNeutral || u.IsHostile)
                    redCircle.Add(u.Location.ToVector3());
                else
                    greenCircle.Add(u.Location.ToVector3());

                blueCircle.Add(u.Location.ToVector3());

                var color = (u.InLoS ? Color.FromArgb(0x8f, 0, 0xff, 0) : Color.FromArgb(0x8f, 0xff, 0, 0));
                var line = new Line();
                line.Add(Manager.LocalPlayer.Location, color);
                line.Add(u.Location, color);
                Rendering.RegisterResource(line);
            }

            Rendering.RegisterResource(redCircle);
            Rendering.RegisterResource(greenCircle);
            Rendering.RegisterResource(blueCircle);
        }
        private void AddSeason(SeasonData season, ref int episodes)
        {
            var firstEpisode = Math.Max(1, episodes - 1);
            var seasonNumber = _seasonSeries.Count / 2 + 1;

            double ratingAverage = 0;
            var    ratedEpisodes = 0;

            foreach (var episode in season.Episodes)
            {
                if (double.IsNaN(episode.Rating))
                {
                    break;
                }

                _episodeSeries.Add(episodes, episode.Rating, GetEpisodeLabel(episode, seasonNumber));
                ratingAverage += episode.Rating;

                episodes++;
                ratedEpisodes++;
            }
            ratingAverage /= ratedEpisodes;

            _seasonSeries.Add(firstEpisode, ratingAverage);
            _seasonSeries.Add(episodes - 1, ratingAverage);

            episodes += season.Episodes.Count - ratedEpisodes;

            var label = Chart.Axes.Top.Labels.Items.Add(episodes - 1, $"Season {seasonNumber}");

            label.Font.Color = Color.FromRgb(0xFF, 0xFF, 0xFF);
            //TODO: Center season labeling

            SeasonSelector.Items.Add($"Season {seasonNumber}");
        }
Beispiel #3
0
        //라인 그리는 메소드

        public void DrawLine(float[] data, bool isClear = false)
        {
            //Draw wave Graph
            if (isClear == true)
            {
                line.Clear();
            }
            line.Add(data);
        }
Beispiel #4
0
        public void SetChartLine(Detector detector, DATA_TYPE type)
        {
            if ((detector.DataMeasurement == null) || (detector.DataMeasurement.Count == 0))
            {
                return;
            }
            try
            {
                Line line       = new Line();
                int  dataLength = detector.DataMeasurement.Count;

                tChart.AutoRepaint     = false;
                line.Legend.Visible    = true;
                line.Legend.AutoSize   = false;
                line.Marks.Visible     = false;
                line.Pointer.HorizSize = 3;
                line.Pointer.Style     = Steema.TeeChart.Styles.PointerStyles.Rectangle;
                line.Pointer.VertSize  = 3;
                line.Pointer.Visible   = true;
                line.MouseEnter       += new System.EventHandler(tChart_MouseEnter);

                line.Legend.Text = "Детектор " + detector.Name;

                switch (type)
                {
                case DATA_TYPE.BASE:
                    foreach (Measure measure in detector.DataMeasurement)
                    {
                        line.Add(measure.Time, measure.A);
                    }

                    line.Color = getLineColor(detector.Id, DATA_TYPE.BASE);
                    break;

                case DATA_TYPE.T:
                    foreach (Measure measure in detector.DataMeasurement)
                    {
                        line.Add(measure.Time, measure.T);
                    }
                    line.Color = getLineColor(detector.Id, DATA_TYPE.BASE);
                    break;
                }

                line.Legend.Color = line.Color;
                line.Tag          = type;
                tChart.Series.Add(line);

                tChart.AutoRepaint = true;
            }
            catch (Exception e)
            {
                MessageBox.Show("Error by set data to chart. " + e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Beispiel #5
0
        // Проверка построения хотябы одной линии на поле
        protected bool CanConstructLines(Field _field)
        {
            for (int i = 0; i < _field.Rows; ++i)
            {
                for (int j = 0; j < _field.Columns; ++j)
                {
                    // Если нет шара в ячейке - не строим путь а переходим к след. ячейке
                    if (_field[i * _field.Columns + j].CellColor.Equals(Colors.Transparent))
                    {
                        continue;
                    }
                    Color color      = _field[i * _field.Columns + j].CellColor;
                    Line  horizontal = new Line(color);
                    horizontal.Add(new Point(i, j));
                    // Если справа есть еще шары и цвет совпадает с текущим - пробуем построить путь
                    while (j + 1 < _field.Columns && color.Equals(_field[i * _field.Columns + (j + 1)].CellColor))
                    {
                        ++j;
                        horizontal.Add(new Point(i, j));
                    }
                    if (horizontal.GetLine().Count >= 3)
                    {
                        return(true);
                    }
                }
            }
            // Vertical lines
            for (int j = 0; j < _field.Columns; ++j)
            {
                for (int i = 0; i < _field.Rows; ++i)
                {
                    if (_field[i * _field.Columns + j].CellColor.Equals(Colors.Transparent))
                    {
                        continue;
                    }
                    Color color    = _field[i * _field.Columns + j].CellColor;
                    Line  vertical = new Line(color);
                    vertical.Add(new Point(i, j));
                    // Если снизу есть еще шары и цвет совпадает с текущим - пробуем построить путь
                    while (i + 1 < _field.Rows && color.Equals(_field[(i + 1) * _field.Columns + j].CellColor))
                    {
                        ++i;
                        vertical.Add(new Point(i, j));
                    }
                    if (vertical.GetLine().Count >= 3)
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
        /// <summary>
        /// 时间为横轴绘制曲线
        /// </summary>
        /// <param name="tChart1"></param>
        /// <param name="tmp_line"></param>
        /// <param name="tmp_Yvalue"></param>
        /// <param name="XValue"></param>
        private void AddLine(TChart tChart1, Line tmp_line, double[] tmp_Yvalue, DateTime[] XValue)
        {
            tChart1.Aspect.View3D           = false; //是否3D显示
            tmp_line.Marks.Gradient.Visible = true;  //显示网格
            tmp_line.Marks.Visible          = false;

            tmp_line.Marks.Gradient.StartColor = Color.FromArgb(255, 215, 0);//网格颜色设置
            tmp_line.Marks.Gradient.EndColor   = Color.White;
            tmp_line.Marks.Symbol.Visible      = true;

            tmp_line.Add(XValue, tmp_Yvalue);
            tmp_line.Pointer.Visible      = true;
            tmp_line.Pointer.Style        = Steema.TeeChart.Styles.PointerStyles.SmallDot;
            tmp_line.Pointer.Color        = Color.Black;
            tChart1.Axes.Left.Automatic   = false;
            tChart1.Axes.Left.Minimum     = getMin(tmp_Yvalue) - 1;
            tChart1.Axes.Left.Maximum     = getMax(tmp_Yvalue) + 1;
            tChart1.Axes.Left.Increment   = 0.4;                                                                           //纵坐标增量
            tChart1.Page.MaxPointsPerPage = 0;
            tChart1.Axes.Bottom.Increment = Steema.TeeChart.Utils.GetDateTimeStep(Steema.TeeChart.DateTimeSteps.OneMonth); //横坐标按月增量
            int len = XValue.Length;

            tChart1.Axes.Bottom.SetMinMax(XValue[0], XValue[len - 1]);
            tChart1.Refresh();
            tChart1.Axes.Bottom.Labels.MultiLine = false;
            tmp_line.XValues.DateTime            = true;
        }
Beispiel #7
0
        Line GridFill(SplineBase spline, Line line)
        {
            float offset     = spline.Offset + spline.Depth;
            Layer layer      = spline.Layer;
            float resolution = layer.resolution;

            SplineBase.SplinePattern pattern = spline.Pattern;
            Color color = new Color(pattern.extra ? 0 : 1, 0, 0, spline.IsHole ? 0.01f : 1);

            Line xy = new Line();

            for (float x = editorMin.x; x < editorMax.x; x += resolution)
            {
                for (float z = editorMin.z; z < editorMax.z; z += resolution)
                {
                    Vector3 point = new Vector3(x, 0, z);
                    if (!point.IsInside(line.points))
                    {
                        continue;
                    }

                    float y = offset;
                    xy.Add(GetPosition(new Vector2(x, z), y), GetNormal(point, Vector3.zero, Vector3.zero, new Vector2(x, z)), color);
                }
            }
            return(xy);
        }
Beispiel #8
0
        public XDocument GetTable()
        {
            if (glyphs == null)
            {
                glyphs = Compressed.GetDecompressedData();
            }

            XDocument xDoc = new XDocument();
            XElement  WT   = new XElement("RectTable");

            xDoc.Add(WT);

            XElement Line = null;
            int      k    = 0;

            for (int i = 0; i < glyphs.Count; i++)
            {
                if (i % 16 == 0)
                {
                    k++;
                    Line = new XElement("Line_" + k);
                    WT.Add(Line);
                }
                XElement Glyph = new XElement("Glyph_" + ((i % 16) + 1));
                Line.Add(Glyph);
                Glyph.Add(new XElement("X", glyphs[i][0]));
                Glyph.Add(new XElement("Y", glyphs[i][1]));
                Glyph.Add(new XElement("Width", glyphs[i][2]));
                Glyph.Add(new XElement("Height", glyphs[i][3]));
            }

            //Logging.Write("PersonaEditorLib", "Width Table was created.");
            return(xDoc);
        }
Beispiel #9
0
        public XDocument GetTable()
        {
            XDocument xDoc = new XDocument();
            XElement  WT   = new XElement("WidthTable");

            xDoc.Add(WT);

            XElement Line = null;
            int      k    = 0;

            for (int i = 0; i < WidthTable.Count; i++)
            {
                if (i % 16 == 0)
                {
                    k++;
                    Line = new XElement("Line_" + k);
                    WT.Add(Line);
                }
                XElement Glyph = new XElement("Glyph_" + ((i % 16) + 1));
                Line.Add(Glyph);
                Glyph.Add(new XElement("LeftCut", WidthTable[i]?.Left));
                Glyph.Add(new XElement("RightCut", WidthTable[i]?.Right));
            }

            //Logging.Write("PersonaEditorLib", "Width Table was created.");
            return(xDoc);
        }
 protected override Image DoCreateChartImage()
 {
     var chart = new Chart();
     var seria = new Line(chart);
     foreach (var point in Parameters.SeriaData)
         seria.Add(point.Key, point.Value);
     chart.Series.Add(seria);
     return chart.Bitmap(Parameters.ChartWidth, Parameters.ChartHeight);
 }
Beispiel #11
0
 /// <summary>
 /// Adds a point to the graph based on current UnityCurve parameter status and updates axises.
 /// </summary>
 public void AddPoint()
 {
     if (y.Active)
     {
         Line.Add(new CurvePoint(y.CurrentCurve, y.Value, y.TotalCurveTime, y.CurrentCurveTime));
         UpdateYAxisValues();
         UpdateAxisText();
     }
 }
Beispiel #12
0
        /// <summary>
        /// Shows the Line3D Chart from Minimum Temperature forecast.
        /// </summary>
        /// <param name="weather"> Weather info</param>
        private void MinTemperatureForecast(ActualWeather weather)
        {
            var tChart1 = new Chart();

            tChart1.Header.Text                       = "Min Temperature of " + App.Weather.Name;
            tChart1.Legend.Visible                    = true;
            tChart1.Legend.Alignment                  = LegendAlignments.Bottom;
            tChart1.Legend.LegendStyle                = LegendStyles.Series;
            tChart1.Legend.Transparent                = true;
            tChart1.Aspect.View3D                     = false;
            tChart1.Axes.Bottom.Labels.Angle          = 90;
            tChart1.Axes.Bottom.Labels.DateTimeFormat = "dd/MMM";

            var minTemp = new Line(tChart1.Chart);

            minTemp.Marks.Visible = false;
            double max = App.getDegScaleTemp(weather.LstWeather[0].MinTemperature);
            double min = App.getDegScaleTemp(weather.LstWeather[0].MinTemperature);

            minTemp.LinePen.Width       = 3;
            minTemp.Pointer.Visible     = true;
            minTemp.Pointer.HorizSize   = 3;
            minTemp.Pointer.VertSize    = 3;
            minTemp.Pointer.Style       = PointerStyles.Sphere;
            minTemp.Pointer.Pen.Visible = false;
            minTemp.LinePen.Color       = Color.FromRgb(27, 177, 255);
            minTemp.Color           = Color.FromRgb(27, 177, 255);
            minTemp.Title           = "Min Temperature";
            minTemp.Marks.Visible   = true;
            minTemp.Marks.DrawEvery = 4;

            AxisSettings(tChart1);
            TitleSettings(tChart1);
            //SeriesMarksSettings(minTemp);

            foreach (var item in weather.LstWeather)
            {
                if (App.getDegScaleTemp(item.MinTemperature) > max)
                {
                    max = App.getDegScaleTemp(item.MinTemperature);
                }
                if (App.getDegScaleTemp(item.MinTemperature) < min)
                {
                    min = App.getDegScaleTemp(item.MinTemperature);
                }
                minTemp.Add(item.Date, App.getDegScaleTemp(item.MinTemperature));
            }

            //tChart1.Axes.Left.SetMinMax((int)min - 5, (int)max + 5);
            tChart1.Axes.Bottom.Increment    = Steema.TeeChart.Utils.GetDateTimeStep(Steema.TeeChart.DateTimeSteps.OneDay);
            tChart1.Axes.Bottom.Grid.Visible = false;
            tChart1.Axes.Left.Increment      = 4;
            tChart1.Legend.Font.Color        = Color.FromRgb(100, 100, 100);

            ShowChart(tChart1);
        }
Beispiel #13
0
        public override async Task LoadPlots()
        {
            chart.Series.Clear();

            foreach (var trait in traits)
            {
                if (!charts.Tables.Contains($"{Treatment}_{trait}"))
                {
                    var query = new MetDataQuery {
                        TreatmentId = Treatment, TraitName = trait
                    };
                    charts.Tables.Add(await QueryManager.Request(query));
                }

                var table = charts.Tables[$"{Treatment}_{trait}"];

                var rows = table.Rows.Cast <DataRow>();

                if (!rows.Any())
                {
                    continue;
                }

                var pairs = rows.Select(r => (Convert.ToDateTime(r["Date"]), (double)r["Mean"]));

                var b = new Bar();
                var l = new Line(chart);

                b.XValues.DateTime = true;
                l.XValues.DateTime = true;
                b.Marks.Visible    = false;
                b.CustomBarWidth   = 3;

                b.Color = l.Color = Colours.Lookup(trait).colour;

                foreach (var pair in pairs)
                {
                    b.Add(pair.Item1, pair.Item2);
                    l.Add(pair.Item1, pair.Item2);
                }

                l.Legend.Text    = trait;
                b.Legend.Visible = false;

                //chart.Series.Add(b);
                chart.Series.Add(l);
            }

            chart.Axes.Bottom.Title.Text = "Date";
            chart.Axes.Left.Title.Text   = "Value";
            chart.Legend.Title.Text      = descriptions[0]?.WordWrap(18) ?? "";

            chart.Legend.Width = 120;

            chart.Header.Text = "Average annual weather data";
        }
Beispiel #14
0
 public void setAxis(TChart tChart, Line line, double horizontalAxisMin, double horizontalAxisMax,
                     double verticalAxisMin, double verticalAxisMax)
 {
     tChart.Axes.Left.SetMinMax(verticalAxisMin, verticalAxisMax);
     tChart.Axes.Bottom.SetMinMax(horizontalAxisMin, horizontalAxisMax);
     if (line != null)
     {
         line.Add(horizontalAxisMin, verticalAxisMin);
     }
 }
Beispiel #15
0
 public void LineOn2D(Vector2 start, Vector2 end, Color col, float width = 1f)
 {
     _line2D.Add(new Line.Data()
     {
         col      = col,
         width    = 1.0f / Screen.width * width * 0.5f, // pixel to viewSpace
         startPos = start,
         endPos   = end
     });
 }
Beispiel #16
0
        public void DrawVerticalLine(TChart objChart, Line lineSeries, float Value)
        {
            float[] HorizontalX = new float[2];
            float[] HorizontalY = new float[2];

            HorizontalX[0] = HorizontalX[1] = Value;
            HorizontalY[0] = (float)objChart.Axes.Left.Minimum;
            HorizontalY[1] = (float)objChart.Axes.Left.Maximum;
            lineSeries.Add(HorizontalX, HorizontalY);
        }
Beispiel #17
0
        /// <summary>
        /// Shows the Line Chart from Temperature forecast.
        /// </summary>
        /// <param name="weather"> Weather info</param>
        private void TemperatureForecast(ActualWeather weather)
        {
            try
            {
                var tChart1 = new Chart();

                tChart1.Axes.Bottom.Labels.Angle          = 90;
                tChart1.Axes.Bottom.Labels.DateTimeFormat = "dd/MMM";
                tChart1.Axes.Bottom.Increment             = Steema.TeeChart.Utils.GetDateTimeStep(Steema.TeeChart.DateTimeSteps.OneDay);
                tChart1.Axes.Left.Title.Text = "Temperature (" + (App.DegTempScale == TempScale.celsius ? "ºC" : "ºF") + ")";

                tChart1.Header.Text      = "Average temperature of " + App.Weather.Name;
                tChart1.Header.Alignment = TextAlignment.Center;
                tChart1.Header.TextAlign = TextAlignment.Center;

                double min = App.getDegScaleTemp(weather.LstWeather[0].MinTemperature);
                double max = App.getDegScaleTemp(weather.LstWeather[0].MaxTemperature);

                var avTemp = new Line(tChart1);
                foreach (var item in weather.LstWeather)
                {
                    if (App.getDegScaleTemp(item.MaxTemperature) > max)
                    {
                        max = App.getDegScaleTemp(item.MaxTemperature);
                    }
                    if (App.getDegScaleTemp(item.MinTemperature) < min)
                    {
                        min = App.getDegScaleTemp(item.MinTemperature);
                    }
                    avTemp.Add(item.Date, App.getDegScaleTemp(item.Temperature));
                }

                tChart1.Axes.Left.SetMinMax((int)min - 3, (int)max + 3);
                tChart1.Axes.Bottom.SetMinMax(tChart1.Axes.Bottom.MinXValue + 0.5, tChart1.Axes.Bottom.MaxXValue - 0.5);

                AxisSettings(tChart1);
                TitleSettings(tChart1);
                //SeriesMarksSettings(avTemp);

                ShowChart(tChart1);

                avTemp.Legend.Visible  = false;
                avTemp.LinePen.Width   = 3;
                avTemp.LinePen.EndCap  = Steema.TeeChart.Drawing.PenLineCap.Round;
                avTemp.Color           = Color.FromRgb(27, 177, 255);
                avTemp.Marks.Visible   = true;
                avTemp.Marks.DrawEvery = 4;
                tChart1.Series.Add(avTemp);
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);
            }
        }
Beispiel #18
0
 public ItemViewModel(string txt, List <ChordData> chordList)
 {
     foreach (char c in txt)
     {
         Line.Add(new KaraokeChar(c));
     }
     foreach (ChordData chord in chordList)
     {
         Line[chord.Position].Chord = chord.Chord;
     }
 }
Beispiel #19
0
        internal static void BreakLines(int iLine, int pos, TextSource ts)
        {
            Line newLine = ts.CreateLine();

            for (int i = pos; i < ts[iLine].Count; i++)
            {
                newLine.Add(ts[iLine][i]);
            }
            ts[iLine].RemoveRange(pos, ts[iLine].Count - pos);
            //
            ts.InsertLine(iLine + 1, newLine);
        }
Beispiel #20
0
        public void LineOnLocal(Vector3 start, Vector3 end, Color col, float width = 1f)
        {
            CheckValidOnView(start);
            CheckValidOnView(end);

            _line.Add(new Line.Data()
            {
                col      = col,
                width    = width,
                startPos = start,
                endPos   = end
            });
        }
        public MedianStdFunctionsChart(ChartView BaseChart)
        {
            medianFunction = new Steema.TeeChart.Functions.MedianFunction();
            line           = new Line();
            theMedianLine  = new Line();
            var            = new Variables.Variables();

            for (int i = 0; i < var.GetValorStdMedian1.Length; i++)
            {
                line.Add(i, var.GetValorStdMedian1[i]);
            }

            BaseChart.Chart.Series.Add(line);
            BaseChart.Chart.Series.Add(theMedianLine);

            theMedianLine.Function   = medianFunction;
            theMedianLine.DataSource = new object[] { line };

            line.SeriesColor          = var.GetPaletteBasic[0];
            theMedianLine.SeriesColor = var.GetPaletteBasic[2];

            line.Title         = "Data";
            line.Marks.Visible = false;
            line.LinePen.Width = 4;

            theMedianLine.Title           = "Median";
            theMedianLine.LinePen.Width   = 6;
            theMedianLine.Pointer.Visible = true;
            theMedianLine.Marks.Visible   = true;
            theMedianLine.Marks.DrawEvery = 2;

            BaseChart.Chart.Axes.Left.SetMinMax(BaseChart.Chart.Axes.Left.MinYValue, BaseChart.Chart.Axes.Left.MaxYValue + 2);
            BaseChart.Chart.Axes.Bottom.SetMinMax(BaseChart.Chart.Axes.Bottom.MinXValue, BaseChart.Chart.Axes.Bottom.MaxXValue);
            BaseChart.Chart.Axes.Left.Increment        = 10;
            BaseChart.Chart.Axes.Bottom.Labels.Visible = false;
            BaseChart.Chart.Axes.Left.Grid.Visible     = false;
            BaseChart.Chart.Axes.Left.AxisPen.Visible  = true;
            BaseChart.Chart.Header.Visible             = false;

            Themes.AplicarMarksTheme1(BaseChart);
            BaseChart.Chart.Series[0].Marks.Font.Size = 14;
            BaseChart.Chart.Series[1].Marks.Font.Size = 14;

            BaseChart.Chart.Series[0].Marks.TextAlign = TextAlignment.Center;
            BaseChart.Chart.Series[0].Marks.AutoSize  = true;
            BaseChart.Chart.Series[0].Marks.Color     = Xamarin.Forms.Color.Transparent;
            BaseChart.Chart.Series[1].Marks.TailStyle = MarksTail.None;
            BaseChart.Chart.Panel.MarginLeft          = 5;

            ImplementiOSMarks(BaseChart.Chart);
        }
Beispiel #22
0
        public override void OnTick()
        {
            if (!Manager.IsInGame)
            {
                return;
            }

            var greenCircle = new Circle(CIRCLE_RADIUS, Color.FromArgb(0x8f, 0, 0xff, 0), Color.FromArgb(0x8f, 0, 0xff, 0));
            var redCircle   = new Circle(CIRCLE_RADIUS, Color.FromArgb(0x8f, 0xff, 0, 0), Color.FromArgb(0x8f, 0xff, 0, 0));
            var blueCircle  = new Circle(CIRCLE_RADIUS, Color.Black, Color.FromArgb(0x8f, 0, 0, 0xff), isFilled: false);

            var units = Manager.Objects.Where(x => x.IsValid && (x.IsUnit || x.IsPlayer)).OfType <WoWUnit>();

            foreach (var u in units)
            {
                if (u.IsNeutral || u.IsHostile)
                {
                    redCircle.Add(u.Location.ToVector3());
                }
                else
                {
                    greenCircle.Add(u.Location.ToVector3());
                }

                blueCircle.Add(u.Location.ToVector3());

                var color = (u.InLoS ? Color.FromArgb(0x8f, 0, 0xff, 0) : Color.FromArgb(0x8f, 0xff, 0, 0));
                var line  = new Line();
                line.Add(Manager.LocalPlayer.Location, color);
                line.Add(u.Location, color);
                Rendering.RegisterResource(line);
            }

            Rendering.RegisterResource(redCircle);
            Rendering.RegisterResource(greenCircle);
            Rendering.RegisterResource(blueCircle);
        }
Beispiel #23
0
        public string Get_FTP_fileContent_inStr()
        {
            Sheet sheet = new Sheet();

            Line l1 = new Line();

            l1.Add(" ");
            if (this.ftpServerTP == FTPserverType.Production)
            {
                l1.Add('P');
            }
            else if (this.ftpServerTP == FTPserverType.Testing)
            {
                l1.Add('T');
            }
            l1.Add("PASSWD");
            l1.Add("01");
            l1.Add("02");
            l1.Add(new string(' ', 6));
            l1.Add(new string(' ', 8));
            l1.Add(this.ftp_UID.Substring(0, 5), 5);
            l1.Add('-');
            l1.Add(this.ftp_UID.Substring(5), 3);
            l1.Add(this.data_pwd, 8, leftJustified: true);
            l1.Add(this.DTCfunc, 6);
            l1.Add(++DTC_request_file.transNum % 10000, 4);
            Cell recordLen_cell = l1.Add(120, 5);//need change in the future

            Line l2 = new Line();

            l2.Add("TD");//request type
            l2.Add(this.DTCfunc, 6);
            l2.Add("01");
            l2.Add(this.headerTP, 3);
            if (this.GU_selCir == GroupUserSelCirteria.ALL)
            {
                l2.Add("All", 3);
            }
            else if (this.GU_selCir == GroupUserSelCirteria.Single)
            {
                l2.Add("001", 3);
                l2.Add(this.GroupUserParticipantNum, 5);
            }

            sheet.Add(l1);
            sheet.Add(l2);

            recordLen_cell.SetOriVal(sheet.Length);

            return(sheet.GetContent());
        }
Beispiel #24
0
        internal void resetFaceNormalColorMap(int tid)
        {
            if (currentGeometryObject == null)
            {
                MessageBox.Show("Please load a mesh");
                return;
            }
            List <int> tids = new List <int>();

            tids.Add(tid);
            colorMap = new ColorMap(currentGeometryObject.Triangles, tids);

            Triangle tri  = currentGeometryObject.Triangles[tid];
            XYZ      P0   = XYZ.Mean(tri.P0.XYZ, tri.P1.XYZ, tri.P2.XYZ);
            XYZ      P1   = XYZ.Add(P0, tri.Normal().Scale(0.1));
            Line     line = new Line();

            line.Add(P0);
            line.Add(P1);
            MarkedLines.Clear();
            MarkedLines.Add(line);

            displayMode = DisplayMode.FACECOLORMAP;
        }
Beispiel #25
0
 void AddLogChildRecursive(Line original, Line cloneParent)
 {
     foreach (Line originalChild in original)
     {
         if (originalChild.IsDone == false && cloneParent.FirstOrDefault((Line l) => l.Text == originalChild.Text) == null)
         {
             Line cloneChild = originalChild.Clone();
             cloneParent.Add(cloneChild);
             if (originalChild.Count > 0)
             {
                 AddLogChildRecursive(originalChild, cloneChild);
             }
         }
     }
 }
Beispiel #26
0
        private void btnGetRange_Click(object sender, EventArgs e)
        {
            var checkedTrends = trendCheckedListBox.CheckedItems;

            tChartTrends.Series.Clear();
            foreach (var item in checkedTrends)
            {
                Console.WriteLine(item.ToString());
                var  trend = DBController.GetSingleTrendFromTimeRange(item.ToString(), chartStartTime.Value, chartEndTime.Value);
                Line line  = new Line();
                line.Title          = item.ToString();
                line.Legend.Visible = false;
                tChartTrends.Series.Add(line);
                line.Add(trend.Select(w => w.Time).ToArray(), trend.Select(w => w.Value).ToArray());
            }
        }
Beispiel #27
0
    public void Tick(Object o, EventArgs e)
    {
        for (int i = 0; i < _sensors.Count; i++)
        {
            ISensor sensor = _sensors[i];
            Line    line   = Data[i];

            line.Add(new DatePoint(GetNowString(), (float)sensor.Value));
        }

        if (KeepHistory)
        {
            String output = JsonConvert.SerializeObject(this);
            File.WriteAllText(Path.Combine(Directory.GetCurrentDirectory(), @"History", _filename), output);
        }
    }
        private void ApplyCustomAxes()
        {
            Line line1 = new Line();
            Line line2 = new Line();

            Chart1.Aspect.View3D          = false;
            Chart1.Panel.Gradient.Visible = true;
            Chart1.Header.Text            = "TeeChart Multiple Axes";
            Chart1.Walls.Back.Transparent = true;
            Chart1.Series.Add(line1);
            Chart1.Series.Add(line2);

            for (int t = 0; t <= 10; ++t)
            {
                line1.Add(Convert.ToDouble(t), Convert.ToDouble(10 + t), UIColor.Red.CGColor);
                line2.Add(Convert.ToDouble(2 + t), Convert.ToDouble(t), UIColor.Green.CGColor);
            }

            Axis leftAxis = Chart1.Axes.Left;

            leftAxis.Grid.DrawEvery = 2;
            leftAxis.StartPosition  = 0;
            leftAxis.EndPosition    = 50;
            leftAxis.AxisPen.Color  = UIColor.Red.CGColor;
            //leftAxis.Title.Font.Color=UIColor.Red.CGColor;
            //leftAxis.Title.Font.Bold=true;
            //leftAxis.Title.Text = "1st Left Axis";

            Axis axis1 = new Axis(false, false, Chart1.Chart);

            Chart1.Axes.Custom.Add(axis1);
            line2.CustomVertAxis = axis1;

            axis1.StartPosition = 50;
            axis1.EndPosition   = 100;
            axis1.AxisPen.Color = UIColor.Green.CGColor;
            // axis1.Title.Font.Color=UIColor.Green.CGColor;
            // axis1.Title.Font.Bold=true;
            // axis1.Title.Text="Extra Axis";
            axis1.PositionUnits    = PositionUnits.Percent;
            axis1.RelativePosition = 20;
            axis1.Grid.DrawEvery   = 2;
        }
        public CrossPointsProFunctionsChart(ChartView BaseChart)
        {
            line1       = new Line();
            line2       = new Line();
            crossPoints = new Steema.TeeChart.Functions.CrossPoints();
            crossLine   = new Line();
            var         = new Variables.Variables();

            BaseChart.Chart.Title.Text          = "Cross Point";
            BaseChart.Chart.Axes.Left.Increment = 0.2;

            for (double x = -5; x < 5; x += 0.2)
            {
                line1.Add(x, Math.Sin(Math.PI / 2 * x));
                line2.Add(x, Math.Sin(Math.PI / 6 * x) - 0.25);
            }

            line1.Title         = "Wave 1";
            line1.Color         = var.GetPaletteBasic[0];
            line1.LinePen.Width = 3;

            line2.Title         = "Wave 2";
            line2.Color         = var.GetPaletteBasic[1];
            line2.LinePen.Width = 3;

            crossLine.Title           = "CrossPoints";
            crossLine.Color           = var.GetPaletteBasic[2];
            crossLine.LinePen.Width   = 3;
            crossLine.ColorEach       = false;
            crossLine.DataSource      = new object[] { line1, line2 };
            crossLine.Function        = crossPoints;
            crossLine.Pointer.Visible = true;

            BaseChart.Chart.Axes.Left.Automatic          = true;
            BaseChart.Chart.Axes.Bottom.Automatic        = true;
            BaseChart.Chart.Axes.Left.Ticks.Transparency = 100;
            BaseChart.Chart.Axes.Left.Increment          = 0.2;

            BaseChart.Chart.Series.Add(line1);
            BaseChart.Chart.Series.Add(line2);
            BaseChart.Chart.Series.Add(crossLine);
        }
        public FibonachiLine Calculate()
        {
            if (Line.Count == Length)
            {
                return(this);
            }

            for (int i = Line.Count; i < Length; i++)
            {
                if (i < 2)
                {
                    Line.Add(1);
                }
                else
                {
                    Line.Add(Line[i - 2] + Line[i - 1]);
                }
            }

            return(this);
        }
Beispiel #31
0
 public void AddNewPatient(string code = "", int order = 0)
 {
     if (string.IsNullOrEmpty(code))
     {
         //code = _officeCode;
     }
     if (order == 0)
     {
         if (Line.Count > 0)
         {
             order = Line.Last().Key;
         }
         else if (CurrentKey > 0)
         {
             order = CurrentKey;
         }
     }
     //code = $"{code}{++order}";
     code = (++order).ToString().PadLeft(2);
     Line.Add(order, code);
     OnLineChange(this, EventArgs.Empty);
 }
        private void Chart_AfterDraw(object sender, Graphics3D g)
        {
            Device.StartTimer(TimeSpan.FromMilliseconds(200), () =>
            {
                if (!stop)
                {
                    line1.Add(r.Next(0, Convert.ToInt32(line1.MaxYValue() / 2)));
                    line2.Add(r.Next(Convert.ToInt32(line2.MaxYValue() / 2), Convert.ToInt32(line2.MaxYValue())));
                    line3.Add(r.Next(Convert.ToInt32(line3.MaxYValue() / 3), Convert.ToInt32(line3.MaxYValue())));

                    if (line1.Count > 15)
                    {
                        BaseChart.Chart.Axes.Bottom.SetMinMax(line1.Count - 15, line1.Count);
                    }

                    return(false);
                }
                else
                {
                    return(true);
                }
            });
        }
Beispiel #33
0
        private void AddDataToChart(QueryResult ChartData, Line line, Line avg, Line lower, Line upper, object AlternameAvgValue)
        {
            double Value;
              DateTime Date;
              foreach (DataRow row in ChartData.Rows)
              {
            if (!DateTime.TryParse(row["Date"].ToString(), out Date))
              continue;
            if (line != null)
            {
              if (double.TryParse(row["Value"].ToString(), out Value))
            line.Add(Date, Value);
              else if (line.Count != 0)
            line.Add(Date, line.YValues[line.Count - 1], Color.Transparent);
            }

            if (avg != null && ShowAverage && ChartData.Columns.Contains("Average"))
            {
              if (AlternameAvgValue != null && double.TryParse(AlternameAvgValue.ToString(), out Value))
            avg.Add(Date, Value);
              else if (double.TryParse(row["Average"].ToString(), out Value))
            avg.Add(Date, Value);
            }

            if (lower != null && double.TryParse(row["Min"].ToString(), out Value))
              lower.Add(Date, Value);

            if (upper != null && double.TryParse(row["Max"].ToString(), out Value))
              upper.Add(Date, Value);
              }
        }