コード例 #1
0
        public void DrawTeam()
        {
            //XyDataSeries<double, double> lidarPts = new XyDataSeries<double, double>();
            ObjectsPolygonSeries.Clear();

            foreach (var r in TeamMatesDisplayDictionary)
            {
                //Affichage des robots
                RobotGhostSeries.AddOrUpdatePolygonExtended(r.Key + (int)Caracteristique.Ghost, TeamMatesDisplayDictionary[r.Key].GetRobotGhostPolygon());
                PolygonSeries.AddOrUpdatePolygonExtended(r.Key + (int)Caracteristique.Speed, TeamMatesDisplayDictionary[r.Key].GetRobotSpeedArrow());
                PolygonSeries.AddOrUpdatePolygonExtended(r.Key + (int)Caracteristique.Destination, TeamMatesDisplayDictionary[r.Key].GetRobotDestinationArrow());
                PolygonSeries.AddOrUpdatePolygonExtended(r.Key + (int)Caracteristique.WayPoint, TeamMatesDisplayDictionary[r.Key].GetRobotWaypointArrow());

                //On trace le robot en dernier pour l'avoir en couche de dessus
                RobotShapesSeries.AddOrUpdatePolygonExtended(r.Key, TeamMatesDisplayDictionary[r.Key].GetRobotPolygon());

                AddOrUpdateTextAnnotation(r.Key.ToString(), r.Value.robotName, TeamMatesDisplayDictionary[r.Key].GetRobotLocation().X, TeamMatesDisplayDictionary[r.Key].GetRobotLocation().Y);
                AddOrUpdateTextAnnotation(r.Key.ToString() + "Role", r.Value.robotRole.ToString(), TeamMatesDisplayDictionary[r.Key].GetRobotLocation().X, TeamMatesDisplayDictionary[r.Key].GetRobotLocation().Y - 1.4);
                AddOrUpdateTextAnnotation(r.Key.ToString() + "Console", r.Value.DisplayMessage.ToString(), TeamMatesDisplayDictionary[r.Key].GetRobotLocation().X, TeamMatesDisplayDictionary[r.Key].GetRobotLocation().Y - 1.9);

                ////Rendering des objets Lidar
                //foreach (var polygonObject in TeamMatesDisplayDictionary[r.Key].GetRobotLidarObjects())
                //    ObjectsPolygonSeries.AddOrUpdatePolygonExtended(ObjectsPolygonSeries.Count(), polygonObject);
            }

            foreach (var r in OpponentDisplayDictionary)
            {
                //Affichage des robots adverses
                PolygonSeries.AddOrUpdatePolygonExtended(r.Key, OpponentDisplayDictionary[r.Key].GetRobotPolygon());
            }
        }
コード例 #2
0
        public void DrawGhost()
        {
            XyDataSeries <double, double> lidarPts = new XyDataSeries <double, double>();

            ObjectsPolygonSeries.Clear();

            //Affichage du robot
            PolygonSeries.AddOrUpdatePolygonExtended(4, GhostDisplay.GetRobotPolygon());
            PolygonSeries.AddOrUpdatePolygonExtended(5, GhostDisplay.GetRobotSpeedArrow());
            PolygonSeries.AddOrUpdatePolygonExtended(6, GhostDisplay.GetRobotDestinationArrow());
            PolygonSeries.AddOrUpdatePolygonExtended(7, GhostDisplay.GetRobotWaypointArrow());

            //Rendering des points Lidar
            lidarPts.AcceptsUnsortedData = true;
            var lidarData = GhostDisplay.GetRobotLidarPoints();

            lidarPts.Append(lidarData.XValues, lidarData.YValues);

            //Rendering des objets Lidar
            foreach (var polygonObject in GhostDisplay.GetRobotLidarObjects())
            {
                ObjectsPolygonSeries.AddOrUpdatePolygonExtended(ObjectsPolygonSeries.Count(), polygonObject);
            }

            //Affichage des points lidar
            LidarPoints.DataSeries = lidarPts;
        }
コード例 #3
0
        public void DrawTeam()
        {
            XyDataSeries <double, double> lidarPts = new XyDataSeries <double, double>();

            foreach (var r in TeamMatesDisplayDictionary)
            {
                if (TeamMatesDisplayDictionary.Count > 1)
                {
                    int toto = 0;
                }
                //Affichage des robots
                PolygonSeries.AddOrUpdatePolygonExtended(r.Key, TeamMatesDisplayDictionary[r.Key].GetRobotPolygon());
                PolygonSeries.AddOrUpdatePolygonExtended(r.Key + (int)Caracteristique.Speed, TeamMatesDisplayDictionary[r.Key].GetRobotSpeedArrow());
                PolygonSeries.AddOrUpdatePolygonExtended(r.Key + (int)Caracteristique.Destination, TeamMatesDisplayDictionary[r.Key].GetRobotDestinationArrow());
                PolygonSeries.AddOrUpdatePolygonExtended(r.Key + (int)Caracteristique.WayPoint, TeamMatesDisplayDictionary[r.Key].GetRobotWaypointArrow());

                //Rendering des points Lidar
                lidarPts.AcceptsUnsortedData = true;
                var lidarData = TeamMatesDisplayDictionary[r.Key].GetRobotLidarPoints();
                lidarPts.Append(lidarData.XValues, lidarData.YValues);
            }

            foreach (var r in OpponentDisplayDictionary)
            {
                //Affichage des robots
                PolygonSeries.AddOrUpdatePolygonExtended(r.Key, OpponentDisplayDictionary[r.Key].GetRobotPolygon());
                //PolygonSeries.AddOrUpdatePolygonExtended(r.Key + (int)Caracteristique.Speed, OpponentDisplayDictionary[r.Key].GetRobotSpeedArrow());
                //PolygonSeries.AddOrUpdatePolygonExtended(r.Key + (int)Caracteristique.Destination, TeamMatesDictionary[r.Key].GetRobotDestinationArrow());
                //PolygonSeries.AddOrUpdatePolygonExtended(r.Key + (int)Caracteristique.WayPoint, TeamMatesDictionary[r.Key].GetRobotWaypointArrow());
            }
            //Affichage des points lidar
            LidarPoints.DataSeries = lidarPts;
        }
 private void DispatcherTimer_Tick(object sender, EventArgs e)
 {
     //Routine de mise à jour de l'affichage en fonction de ce qui a été reçu
     PolygonSeries.AddOrUpdatePolygonExtended((int)PolygonId.GhostPolygonId, GetRobotGhostPolygon());
     PolygonSeries.AddOrUpdatePolygonExtended((int)PolygonId.RobotPolygonId, GetRobotPolygon());
     PolygonSeries.RedrawAll();
 }
コード例 #5
0
 public void UpdateWorldMapDisplay()
 {
     DrawBalls();
     DrawTeam();
     PolygonSeries.RedrawAll();
     RobotGhostSeries.RedrawAll();
     RobotShapesSeries.RedrawAll();
     ObjectsPolygonSeries.RedrawAll();
     BallPolygon.RedrawAll();
 }
コード例 #6
0
 private void TimerAffichage_Tick(object sender, EventArgs e)
 {
     DrawBall();
     DrawRobot();
     DrawGhost();
     DrawLidar();
     PolygonSeries.RedrawAll();
     ObjectsPolygonSeries.RedrawAll();
     BallPolygon.RedrawAll();
 }
コード例 #7
0
 private void TimerAffichage_Tick(object sender, EventArgs e)
 {
     DrawBall();
     DrawTeam();
     if (TeamMatesDisplayDictionary.Count == 1) //Cas d'un affichage de robot unique (localWorldMap)
     {
         DrawHeatMap(TeamMatesDisplayDictionary.First().Key);
     }
     PolygonSeries.RedrawAll();
     BallPolygon.RedrawAll();
 }
コード例 #8
0
        public void DrawLidar()
        {
            ObjectsPolygonSeries = new PolygonRenderableSeries();
            int i = 0;

            foreach (var r in ObjectDisplayList)
            {
                //Affichage des objets détectés par le Lidar
                PolygonSeries.AddOrUpdatePolygonExtended(i++, r);
            }
        }
コード例 #9
0
        public void Add(ChartControl chart, Pane ownerPane)
        {
            owner   = chart;
            tencan  = new TrendLineSeries(string.Format("{0} - {1}", Localizer.GetString("TitleIchimokuIndicator"), Localizer.GetString("TitleTenkanLineSmall")));
            kijyn   = new TrendLineSeries(string.Format("{0} - {1}", Localizer.GetString("TitleIchimokuIndicator"), Localizer.GetString("TitleKijunLineSmall")));
            senkouA = new TrendLineSeries(string.Format("{0} - {1}", Localizer.GetString("TitleIchimokuIndicator"), Localizer.GetString("TitleSenkouALineSmall")));
            senkouB = new TrendLineSeries(string.Format("{0} - {1}", Localizer.GetString("TitleIchimokuIndicator"), Localizer.GetString("TitleSenkouBLineSmall")));
            chikou  = new TrendLineSeries(string.Format("{0} - {1}", Localizer.GetString("TitleIchimokuIndicator"), Localizer.GetString("TitleChikouSmall")));
            cloud   = new PolygonSeries(string.Format("{0} - {1}", Localizer.GetString("TitleIchimokuIndicator"), Localizer.GetString("TitleKumoSmall")))
            {
                colorCloudA = ColorCloudA,
                colorCloudB = ColorCloudB
            };

            SeriesResult = new List <Series.Series> {
                tencan, kijyn, senkouA, senkouB, chikou, cloud
            };
            EntitleIndicator();
        }
コード例 #10
0
        void InitRoboCupSoccerField()
        {
            double TerrainLowerX = -11;
            double TerrainUpperX = 11;
            double TerrainLowerY = -7;
            double TerrainUpperY = 7;

            int             fieldLineWidth = 2;
            PolygonExtended p = new PolygonExtended();

            p.polygon.Points.Add(new System.Windows.Point(-12, -8));
            p.polygon.Points.Add(new System.Windows.Point(12, -8));
            p.polygon.Points.Add(new System.Windows.Point(12, 8));
            p.polygon.Points.Add(new System.Windows.Point(-12, 8));
            p.polygon.Points.Add(new System.Windows.Point(-12, -8));
            p.borderWidth     = fieldLineWidth;
            p.borderColor     = System.Drawing.Color.FromArgb(0x00, 0x00, 0x00, 0x00);
            p.backgroundColor = System.Drawing.Color.FromArgb(0xFF, 0x22, 0x22, 0x22);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.ZoneProtegee, p);

            p = new PolygonExtended();
            p.polygon.Points.Add(new System.Windows.Point(11, -7));
            p.polygon.Points.Add(new System.Windows.Point(0, -7));
            p.polygon.Points.Add(new System.Windows.Point(0, 7));
            p.polygon.Points.Add(new System.Windows.Point(11, 7));
            p.polygon.Points.Add(new System.Windows.Point(11, -7));
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.FromArgb(0xFF, 0x00, 0x66, 0x00);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.DemiTerrainDroit, p);

            p = new PolygonExtended();
            p.polygon.Points.Add(new System.Windows.Point(-11, -7));
            p.polygon.Points.Add(new System.Windows.Point(0, -7));
            p.polygon.Points.Add(new System.Windows.Point(0, 7));
            p.polygon.Points.Add(new System.Windows.Point(-11, 7));
            p.polygon.Points.Add(new System.Windows.Point(-11, -7));
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.FromArgb(0xFF, 0x00, 0x66, 0x00);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.DemiTerrainGauche, p);


            p = new PolygonExtended();
            p.polygon.Points.Add(new System.Windows.Point(-11, -1.95));
            p.polygon.Points.Add(new System.Windows.Point(-10.25, -1.95));
            p.polygon.Points.Add(new System.Windows.Point(-10.25, 1.95));
            p.polygon.Points.Add(new System.Windows.Point(-11.00, 1.95));
            p.polygon.Points.Add(new System.Windows.Point(-11.00, -1.95));
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.FromArgb(0x00, 0x00, 0xFF, 0x00);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.SurfaceButGauche, p);

            p = new PolygonExtended();
            p.polygon.Points.Add(new System.Windows.Point(11.00, -1.95));
            p.polygon.Points.Add(new System.Windows.Point(10.25, -1.95));
            p.polygon.Points.Add(new System.Windows.Point(10.25, 1.95));
            p.polygon.Points.Add(new System.Windows.Point(11.00, 1.95));
            p.polygon.Points.Add(new System.Windows.Point(11.00, -1.95));
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.FromArgb(0x00, 0x00, 0xFF, 0x00);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.SurfaceButDroit, p);

            p = new PolygonExtended();
            p.polygon.Points.Add(new System.Windows.Point(11.00, -3.45));
            p.polygon.Points.Add(new System.Windows.Point(8.75, -3.45));
            p.polygon.Points.Add(new System.Windows.Point(8.75, 3.45));
            p.polygon.Points.Add(new System.Windows.Point(11.00, 3.45));
            p.polygon.Points.Add(new System.Windows.Point(11.00, -3.45));
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.FromArgb(0x00, 0x00, 0xFF, 0x00);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.SurfaceReparationDroit, p);

            p = new PolygonExtended();
            p.polygon.Points.Add(new System.Windows.Point(-11.00, -3.45));
            p.polygon.Points.Add(new System.Windows.Point(-8.75, -3.45));
            p.polygon.Points.Add(new System.Windows.Point(-8.75, 3.45));
            p.polygon.Points.Add(new System.Windows.Point(-11.00, 3.45));
            p.polygon.Points.Add(new System.Windows.Point(-11.00, -3.45));
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.FromArgb(0x00, 0x00, 0xFF, 0x00);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.SurfaceReparationGauche, p);

            p = new PolygonExtended();
            p.polygon.Points.Add(new System.Windows.Point(-11.00, -1.20));
            p.polygon.Points.Add(new System.Windows.Point(-11.00, 1.20));
            p.polygon.Points.Add(new System.Windows.Point(-11.50, 1.20));
            p.polygon.Points.Add(new System.Windows.Point(-11.50, -1.20));
            p.polygon.Points.Add(new System.Windows.Point(-11.00, -1.20));
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.FromArgb(0x00, 0x00, 0xFF, 0x00);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.ButGauche, p);

            p = new PolygonExtended();
            p.polygon.Points.Add(new System.Windows.Point(11.00, -1.20));
            p.polygon.Points.Add(new System.Windows.Point(11.00, 1.20));
            p.polygon.Points.Add(new System.Windows.Point(11.50, 1.20));
            p.polygon.Points.Add(new System.Windows.Point(11.50, -1.20));
            p.polygon.Points.Add(new System.Windows.Point(11.00, -1.20));
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.FromArgb(0x00, 0x00, 0xFF, 0x00);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.ButDroit, p);


            p = new PolygonExtended();
            p.polygon.Points.Add(new System.Windows.Point(-12.00, -8.00));
            p.polygon.Points.Add(new System.Windows.Point(-12.00, -9.00));
            p.polygon.Points.Add(new System.Windows.Point(-4.00, -9.00));
            p.polygon.Points.Add(new System.Windows.Point(-4.00, -8.00));
            p.polygon.Points.Add(new System.Windows.Point(-12.00, -8.00));
            p.borderWidth     = fieldLineWidth;
            p.borderColor     = System.Drawing.Color.FromArgb(0x00, 0x00, 0x00, 0x00);
            p.backgroundColor = System.Drawing.Color.FromArgb(0xFF, 0x00, 0x00, 0xFF);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.ZoneTechniqueGauche, p);

            p = new PolygonExtended();
            p.polygon.Points.Add(new System.Windows.Point(+12.00, -8.00));
            p.polygon.Points.Add(new System.Windows.Point(+12.00, -9.00));
            p.polygon.Points.Add(new System.Windows.Point(+4.00, -9.00));
            p.polygon.Points.Add(new System.Windows.Point(+4.00, -8.00));
            p.polygon.Points.Add(new System.Windows.Point(+12.00, -8.00));
            p.borderWidth     = fieldLineWidth;
            p.borderColor     = System.Drawing.Color.FromArgb(0x00, 0x00, 0x00, 0x00);
            p.backgroundColor = System.Drawing.Color.FromArgb(0xFF, 0x00, 0x00, 0xFF);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.ZoneTechniqueDroite, p);

            p = new PolygonExtended();
            int nbSteps = 30;

            for (int i = 0; i < nbSteps + 1; i++)
            {
                p.polygon.Points.Add(new System.Windows.Point(1.0f * Math.Cos((double)i * (2 * Math.PI / nbSteps)), 1.0f * Math.Sin((double)i * (2 * Math.PI / nbSteps))));
            }
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.FromArgb(0x00, 0x00, 0xFF, 0x00);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.RondCentral, p);

            p = new PolygonExtended();
            for (int i = 0; i < (int)(nbSteps / 4) + 1; i++)
            {
                p.polygon.Points.Add(new System.Windows.Point(-11.00 + 0.75 * Math.Cos((double)i * (2 * Math.PI / nbSteps)), -7.0 + 0.75 * Math.Sin((double)i * (2 * Math.PI / nbSteps))));
            }
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.FromArgb(0x00, 0x00, 0xFF, 0x00);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.CornerBasGauche, p);

            p = new PolygonExtended();
            for (int i = (int)(nbSteps / 4) + 1; i < (int)(2 * nbSteps / 4) + 1; i++)
            {
                p.polygon.Points.Add(new System.Windows.Point(11 + 0.75 * Math.Cos((double)i * (2 * Math.PI / nbSteps)), -7 + 0.75 * Math.Sin((double)i * (2 * Math.PI / nbSteps))));
            }
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.FromArgb(0x00, 0x00, 0xFF, 0x00);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.CornerBasDroite, p);

            p = new PolygonExtended();
            for (int i = (int)(2 * nbSteps / 4); i < (int)(3 * nbSteps / 4) + 1; i++)
            {
                p.polygon.Points.Add(new System.Windows.Point(11 + 0.75 * Math.Cos((double)i * (2 * Math.PI / nbSteps)), 7 + 0.75 * Math.Sin((double)i * (2 * Math.PI / nbSteps))));
            }
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.FromArgb(0x00, 0x00, 0xFF, 0x00);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.CornerHautDroite, p);

            p = new PolygonExtended();
            for (int i = (int)(3 * nbSteps / 4) + 1; i < (int)(nbSteps) + 1; i++)
            {
                p.polygon.Points.Add(new System.Windows.Point(-11 + 0.75 * Math.Cos((double)i * (2 * Math.PI / nbSteps)), 7 + 0.75 * Math.Sin((double)i * (2 * Math.PI / nbSteps))));
            }
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.FromArgb(0x00, 0x00, 0xFF, 0x00);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.CornerHautGauche, p);

            p = new PolygonExtended();
            for (int i = 0; i < (int)(nbSteps) + 1; i++)
            {
                p.polygon.Points.Add(new System.Windows.Point(-7.4 + 0.075 * Math.Cos((double)i * (2 * Math.PI / nbSteps)), 0.075 * Math.Sin((double)i * (2 * Math.PI / nbSteps))));
            }
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.FromArgb(0x00, 0x00, 0xFF, 0x00);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.PtAvantSurfaceGauche, p);

            p = new PolygonExtended();
            for (int i = 0; i < (int)(nbSteps) + 1; i++)
            {
                p.polygon.Points.Add(new System.Windows.Point(7.4 + 0.075 * Math.Cos((double)i * (2 * Math.PI / nbSteps)), 0.075 * Math.Sin((double)i * (2 * Math.PI / nbSteps))));
            }
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.FromArgb(0x00, 0x00, 0xFF, 0x00);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.PtAvantSurfaceDroit, p);
        }
コード例 #11
0
        //void InitTeam()
        //{
        //    //Team1
        //    for (int i = 0; i < 1; i++)
        //    {
        //        PolygonExtended robotShape = new PolygonExtended();
        //        robotShape.polygon.Points.Add(new Point(-0.25, -0.25));
        //        robotShape.polygon.Points.Add(new Point(0.25, -0.25));
        //        robotShape.polygon.Points.Add(new Point(0.2, 0));
        //        robotShape.polygon.Points.Add(new Point(0.25, 0.25));
        //        robotShape.polygon.Points.Add(new Point(-0.25, 0.25));
        //        robotShape.polygon.Points.Add(new Point(-0.25, -0.25));
        //        RobotDisplay rd = new RobotDisplay(robotShape);
        //        rd.SetPosition((float)(i * 0.50), (float)(Math.Pow(i, 1.3) * 0.50), (float)Math.PI / 4 * i);
        //        robotDictionary.Add((int)TeamId.Team1+i, rd);
        //    }
        //}

        void InitSoccerField()
        {
            int             fieldLineWidth = 2;
            PolygonExtended p = new PolygonExtended();

            //p.polygon.Points.Add(new Point(-8, -4));
            //p.polygon.Points.Add(new Point(8, -4));
            ////p.polygon.Points.Add(new Point(12, 8));
            ////p.polygon.Points.Add(new Point(-12, 8));
            ////p.polygon.Points.Add(new Point(-12, -8));
            //p.borderWidth = fieldLineWidth;
            //p.borderColor = System.Drawing.Color.FromArgb(0xFF, 0xFF, 0xFF, 0xFF);
            //p.backgroundColor = System.Drawing.Color.FromArgb(0xFF, 0x22, 0x22, 0x22);
            //PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.ZoneProtegee, p);

            p = new PolygonExtended();
            p.polygon.Points.Add(new Point(-0.335, 0));
            p.polygon.Points.Add(new Point(-0.335, 1.5));
            p.polygon.Points.Add(new Point(-1.815, 1.5));
            p.polygon.Points.Add(new Point(-1.815, 0));
            p.polygon.Points.Add(new Point(-0.335, 0));
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.FromArgb(0xFF, 46, 49, 146);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.CarreServiceHautGauche, p);

            p = new PolygonExtended();
            p.polygon.Points.Add(new Point(-0.335, 0));
            p.polygon.Points.Add(new Point(-0.335, -1.5));
            p.polygon.Points.Add(new Point(-1.815, -1.5));
            p.polygon.Points.Add(new Point(-1.815, 0));
            p.polygon.Points.Add(new Point(-0.335, 0));
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.FromArgb(0xFF, 46, 49, 146);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.CarreServiceBasGauche, p);

            p = new PolygonExtended();
            p.polygon.Points.Add(new Point(0.335, 0));
            p.polygon.Points.Add(new Point(0.335, 1.5));
            p.polygon.Points.Add(new Point(1.815, 1.5));
            p.polygon.Points.Add(new Point(1.815, 0));
            p.polygon.Points.Add(new Point(0.335, 0));
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.FromArgb(0xFF, 46, 49, 146);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.CarreServiceHautDroit, p);

            p = new PolygonExtended();
            p.polygon.Points.Add(new Point(0.335, 0));
            p.polygon.Points.Add(new Point(0.335, -1.5));
            p.polygon.Points.Add(new Point(1.815, -1.5));
            p.polygon.Points.Add(new Point(1.815, 0));
            p.polygon.Points.Add(new Point(0.335, 0));
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.FromArgb(0xFF, 46, 49, 146);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.CarreServiceBasDroit, p);


            p = new PolygonExtended();
            p.polygon.Points.Add(new Point(-0.335, -2));
            p.polygon.Points.Add(new Point(0.335, -2));
            p.polygon.Points.Add(new Point(0.335, 2));
            p.polygon.Points.Add(new Point(-0.335, 2));
            p.polygon.Points.Add(new Point(-0.335, -2));
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.FromArgb(0xFF, 0xFF, 0xFF, 0xFF);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.LigneMediane, p);

            p = new PolygonExtended();
            p.polygon.Points.Add(new Point(0.019, -2));
            p.polygon.Points.Add(new Point(0.019, 2));
            p.polygon.Points.Add(new Point(-0.019, 2));
            p.polygon.Points.Add(new Point(-0.019, -2));
            p.polygon.Points.Add(new Point(0.019, -2));
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.Black;
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.LigneNoirCentrale, p);

            p = new PolygonExtended();
            p.polygon.Points.Add(new Point(-0.335, -1.5));
            p.polygon.Points.Add(new Point(-4, -1.5));
            p.polygon.Points.Add(new Point(-4, -2));
            p.polygon.Points.Add(new Point(-0.335, -2));
            p.polygon.Points.Add(new Point(-0.335, -1.5));
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.FromArgb(0xFF, 46, 49, 146);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.CouloirBasGauche, p);


            p = new PolygonExtended();
            p.polygon.Points.Add(new Point(-0.335, 1.5));
            p.polygon.Points.Add(new Point(-4, 1.5));
            p.polygon.Points.Add(new Point(-4, 2));
            p.polygon.Points.Add(new Point(-0.335, 2));
            p.polygon.Points.Add(new Point(-0.335, 1.5));
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.FromArgb(0xFF, 46, 49, 146);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.CouloirHautGauche, p);


            p = new PolygonExtended();
            p.polygon.Points.Add(new Point(0.335, 1.5));
            p.polygon.Points.Add(new Point(4, 1.5));
            p.polygon.Points.Add(new Point(4, 2));
            p.polygon.Points.Add(new Point(0.335, 2));
            p.polygon.Points.Add(new Point(0.335, 1.5));
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.FromArgb(0xFF, 46, 49, 146);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.CouloirHautDroit, p);


            p = new PolygonExtended();
            p.polygon.Points.Add(new Point(0.335, -1.5));
            p.polygon.Points.Add(new Point(4, -1.5));
            p.polygon.Points.Add(new Point(4, -2));
            p.polygon.Points.Add(new Point(0.335, -2));
            p.polygon.Points.Add(new Point(0.335, -1.5));
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.FromArgb(0xFF, 46, 49, 146);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.CouloirBasDroit, p);


            p = new PolygonExtended();
            p.polygon.Points.Add(new Point(-1.815, 1.5));
            p.polygon.Points.Add(new Point(-4, 1.5));
            p.polygon.Points.Add(new Point(-4, -1.5));
            p.polygon.Points.Add(new Point(-1.815, -1.5));
            p.polygon.Points.Add(new Point(-1.815, 1.5));
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.FromArgb(0xFF, 46, 49, 146);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.FontDeCourtGauche, p);

            p = new PolygonExtended();
            p.polygon.Points.Add(new Point(1.815, 1.5));
            p.polygon.Points.Add(new Point(4, 1.5));
            p.polygon.Points.Add(new Point(4, -1.5));
            p.polygon.Points.Add(new Point(1.815, -1.5));
            p.polygon.Points.Add(new Point(1.815, 1.5));
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.FromArgb(0xFF, 46, 49, 146);
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.FontDeCourtDroit, p);

            p = new PolygonExtended();
            p.polygon.Points.Add(new Point(-4, -0.1));
            p.polygon.Points.Add(new Point(-4.2, -0.1));
            p.polygon.Points.Add(new Point(-4.2, 0.1));
            p.polygon.Points.Add(new Point(-4, 0.1));
            p.polygon.Points.Add(new Point(-4, -0.1));
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.Brown;
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.BaliseGaucheFontDeCourt, p);

            p = new PolygonExtended();
            p.polygon.Points.Add(new Point(-0.9, -2));
            p.polygon.Points.Add(new Point(-0.9, -2.2));
            p.polygon.Points.Add(new Point(-1.1, -2.2));
            p.polygon.Points.Add(new Point(-1.1, -2));
            p.polygon.Points.Add(new Point(-0.9, -2));
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.Brown;
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.BaliseGaucheBas, p);


            p = new PolygonExtended();
            p.polygon.Points.Add(new Point(-0.9, 2));
            p.polygon.Points.Add(new Point(-0.9, 2.2));
            p.polygon.Points.Add(new Point(-1.1, 2.2));
            p.polygon.Points.Add(new Point(-1.1, 2));
            p.polygon.Points.Add(new Point(-0.9, 2));
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.Brown;
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.BaliseGaucheHaut, p);

            p = new PolygonExtended();
            p.polygon.Points.Add(new Point(4, -0.1));
            p.polygon.Points.Add(new Point(4.2, -0.1));
            p.polygon.Points.Add(new Point(4.2, 0.1));
            p.polygon.Points.Add(new Point(4, 0.1));
            p.polygon.Points.Add(new Point(4, -0.1));
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.Brown;
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.BaliseDroitFontDeCourt, p);

            p = new PolygonExtended();
            p.polygon.Points.Add(new Point(0.9, -2));
            p.polygon.Points.Add(new Point(0.9, -2.2));
            p.polygon.Points.Add(new Point(1.1, -2.2));
            p.polygon.Points.Add(new Point(1.1, -2));
            p.polygon.Points.Add(new Point(0.9, -2));
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.Brown;
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.BaliseDroitBas, p);


            p = new PolygonExtended();
            p.polygon.Points.Add(new Point(0.9, 2));
            p.polygon.Points.Add(new Point(0.9, 2.2));
            p.polygon.Points.Add(new Point(1.1, 2.2));
            p.polygon.Points.Add(new Point(1.1, 2));
            p.polygon.Points.Add(new Point(0.9, 2));
            p.borderWidth     = fieldLineWidth;
            p.backgroundColor = System.Drawing.Color.Brown;
            PolygonSeries.AddOrUpdatePolygonExtended((int)Terrain.BaliseDroitHaut, p);
        }
コード例 #12
0
        private List <Hashtable> SeriesToHashtables(List <Series> listOfSeries)
        {
            List <Hashtable> hashtableList = new List <Hashtable>();

            foreach (Series series in listOfSeries)
            {
                List <object> dataList  = new List <object>();
                Hashtable     hashtable = new Hashtable();
                if (series is LineSeries)
                {
                    LineSeries lineSeries = series as LineSeries;
                    lineSeries.Data.ForEach(
                        (Action <LineSeriesData>)(data => dataList.Add((object)data.ToHashtable())));
                    lineSeries.Type = LineSeriesType.Line;
                    hashtable       = lineSeries.ToHashtable();
                }
                if (series is SplineSeries)
                {
                    SplineSeries splineSeries = series as SplineSeries;
                    splineSeries.Data.ForEach((Action <SplineSeriesData>)(data =>
                                                                          dataList.Add((object)data.ToHashtable())));
                    splineSeries.Type = SplineSeriesType.Spline;
                    hashtable         = splineSeries.ToHashtable();
                }
                if (series is AreaSeries)
                {
                    AreaSeries areaSeries = series as AreaSeries;
                    areaSeries.Data.ForEach(
                        (Action <AreaSeriesData>)(data => dataList.Add((object)data.ToHashtable())));
                    areaSeries.Type = AreaSeriesType.Area;
                    hashtable       = areaSeries.ToHashtable();
                }
                if (series is AreasplineSeries)
                {
                    AreasplineSeries areasplineSeries = series as AreasplineSeries;
                    areasplineSeries.Data.ForEach(
                        (Action <AreasplineSeriesData>)(data => dataList.Add((object)data.ToHashtable())));
                    areasplineSeries.Type = AreasplineSeriesType.Areaspline;
                    hashtable             = areasplineSeries.ToHashtable();
                }
                if (series is ArearangeSeries)
                {
                    ArearangeSeries arearangeSeries = series as ArearangeSeries;
                    arearangeSeries.Data.ForEach(
                        (Action <ArearangeSeriesData>)(data => dataList.Add((object)data.ToHashtable())));
                    arearangeSeries.Type = ArearangeSeriesType.Arearange;
                    hashtable            = arearangeSeries.ToHashtable();
                }
                if (series is ColumnrangeSeries)
                {
                    ColumnrangeSeries columnrangeSeries = series as ColumnrangeSeries;
                    columnrangeSeries.Data.ForEach(
                        (Action <ColumnrangeSeriesData>)(data => dataList.Add((object)data.ToHashtable())));
                    columnrangeSeries.Type = ColumnrangeSeriesType.Columnrange;
                    hashtable = columnrangeSeries.ToHashtable();
                }
                if (series is BarSeries)
                {
                    BarSeries barSeries = series as BarSeries;
                    barSeries.Data.ForEach((Action <BarSeriesData>)(data => dataList.Add((object)data.ToHashtable())));
                    barSeries.Type = BarSeriesType.Bar;
                    hashtable      = barSeries.ToHashtable();
                }
                if (series is ColumnSeries)
                {
                    ColumnSeries columnSeries = series as ColumnSeries;
                    columnSeries.Data.ForEach((Action <ColumnSeriesData>)(data =>
                                                                          dataList.Add((object)data.ToHashtable())));
                    columnSeries.Type = ColumnSeriesType.Column;
                    hashtable         = columnSeries.ToHashtable();
                }
                if (series is PieSeries)
                {
                    PieSeries pieSeries = series as PieSeries;
                    pieSeries.Data.ForEach((Action <PieSeriesData>)(data => dataList.Add((object)data.ToHashtable())));
                    pieSeries.Type = PieSeriesType.Pie;
                    hashtable      = pieSeries.ToHashtable();
                }
                if (series is ScatterSeries)
                {
                    ScatterSeries scatterSeries = series as ScatterSeries;
                    scatterSeries.Data.ForEach(
                        (Action <ScatterSeriesData>)(data => dataList.Add((object)data.ToHashtable())));
                    scatterSeries.Type = ScatterSeriesType.Scatter;
                    hashtable          = scatterSeries.ToHashtable();
                }
                if (series is BubbleSeries)
                {
                    BubbleSeries bubbleSeries = series as BubbleSeries;
                    bubbleSeries.Data.ForEach((Action <BubbleSeriesData>)(data =>
                                                                          dataList.Add((object)data.ToHashtable())));
                    bubbleSeries.Type = BubbleSeriesType.Bubble;
                    hashtable         = bubbleSeries.ToHashtable();
                }
                if (series is GaugeSeries)
                {
                    GaugeSeries gaugeSeries = series as GaugeSeries;
                    gaugeSeries.Data.ForEach((Action <GaugeSeriesData>)(data =>
                                                                        dataList.Add((object)data.ToHashtable())));
                    gaugeSeries.Type = GaugeSeriesType.Gauge;
                    hashtable        = gaugeSeries.ToHashtable();
                }
                if (series is SolidgaugeSeries)
                {
                    SolidgaugeSeries solidgaugeSeries = series as SolidgaugeSeries;
                    solidgaugeSeries.Data.ForEach(
                        (Action <SolidgaugeSeriesData>)(data => dataList.Add((object)data.ToHashtable())));
                    solidgaugeSeries.Type = SolidgaugeSeriesType.Solidgauge;
                    hashtable             = solidgaugeSeries.ToHashtable();
                }
                if (series is HeatmapSeries)
                {
                    HeatmapSeries heatmapSeries = series as HeatmapSeries;
                    heatmapSeries.Data.ForEach(
                        (Action <HeatmapSeriesData>)(data => dataList.Add((object)data.ToHashtable())));
                    heatmapSeries.Type = HeatmapSeriesType.Heatmap;
                    hashtable          = heatmapSeries.ToHashtable();
                }
                if (series is BoxplotSeries)
                {
                    BoxplotSeries boxplotSeries = series as BoxplotSeries;
                    boxplotSeries.Data.ForEach(
                        (Action <BoxplotSeriesData>)(data => dataList.Add((object)data.ToHashtable())));
                    boxplotSeries.Type = BoxplotSeriesType.Boxplot;
                    hashtable          = boxplotSeries.ToHashtable();
                }
                if (series is ErrorbarSeries)
                {
                    ErrorbarSeries errorbarSeries = series as ErrorbarSeries;
                    errorbarSeries.Data.ForEach(
                        (Action <ErrorbarSeriesData>)(data => dataList.Add((object)data.ToHashtable())));
                    errorbarSeries.Type = ErrorbarSeriesType.Errorbar;
                    hashtable           = errorbarSeries.ToHashtable();
                }
                if (series is FunnelSeries)
                {
                    FunnelSeries funnelSeries = series as FunnelSeries;
                    funnelSeries.Data.ForEach((Action <FunnelSeriesData>)(data =>
                                                                          dataList.Add((object)data.ToHashtable())));
                    funnelSeries.Type = FunnelSeriesType.Funnel;
                    hashtable         = funnelSeries.ToHashtable();
                }
                if (series is PyramidSeries)
                {
                    PyramidSeries pyramidSeries = series as PyramidSeries;
                    pyramidSeries.Data.ForEach(
                        (Action <PyramidSeriesData>)(data => dataList.Add((object)data.ToHashtable())));
                    pyramidSeries.Type = PyramidSeriesType.Pyramid;
                    hashtable          = pyramidSeries.ToHashtable();
                }
                if (series is WaterfallSeries)
                {
                    WaterfallSeries waterfallSeries = series as WaterfallSeries;
                    waterfallSeries.Data.ForEach(
                        (Action <WaterfallSeriesData>)(data => dataList.Add((object)data.ToHashtable())));
                    waterfallSeries.Type = WaterfallSeriesType.Waterfall;
                    hashtable            = waterfallSeries.ToHashtable();
                }
                if (series is PolygonSeries)
                {
                    PolygonSeries polygonSeries = series as PolygonSeries;
                    polygonSeries.Data.ForEach(
                        (Action <PolygonSeriesData>)(data => dataList.Add((object)data.ToHashtable())));
                    polygonSeries.Type = PolygonSeriesType.Polygon;
                    hashtable          = polygonSeries.ToHashtable();
                }
                if (series is TreemapSeries)
                {
                    TreemapSeries treemapSeries = series as TreemapSeries;
                    treemapSeries.Data.ForEach(
                        (Action <TreemapSeriesData>)(data => dataList.Add((object)data.ToHashtable())));
                    treemapSeries.Type = TreemapSeriesType.Treemap;
                    hashtable          = treemapSeries.ToHashtable();
                }
                hashtableList.Add(hashtable);
            }
            return(hashtableList);
        }
コード例 #13
0
        private List <Hashtable> SeriesToHashtables(List <Series> listOfSeries)
        {
            List <Hashtable> hashtableList = new List <Hashtable>();

            foreach (Series series in listOfSeries)
            {
                List <object> dataList   = new List <object>();
                Hashtable     hashtable1 = new Hashtable();
                if (series is LineSeries)
                {
                    if (series.ToHashtable().ContainsKey((object)"data"))
                    {
                        Hashtable hashtable2 = series.ToHashtable();
                        hashtableList.Add(hashtable2);
                        continue;
                    }
                    LineSeries lineSeries = series as LineSeries;
                    lineSeries.Data.ForEach(
                        (Action <LineSeriesData>)(data => dataList.Add((object)data.ToHashtable())));
                    lineSeries.Type = LineSeriesType.Line;
                    hashtable1      = lineSeries.ToHashtable();
                }
                if (series is SplineSeries)
                {
                    SplineSeries splineSeries = series as SplineSeries;
                    splineSeries.Data.ForEach((Action <SplineSeriesData>)(data =>
                                                                          dataList.Add((object)data.ToHashtable())));
                    splineSeries.Type = SplineSeriesType.Spline;
                    hashtable1        = splineSeries.ToHashtable();
                }
                if (series is AreaSeries)
                {
                    AreaSeries areaSeries = series as AreaSeries;
                    areaSeries.Data.ForEach(
                        (Action <AreaSeriesData>)(data => dataList.Add((object)data.ToHashtable())));
                    areaSeries.Type = AreaSeriesType.Area;
                    hashtable1      = areaSeries.ToHashtable();
                }
                if (series is AreasplineSeries)
                {
                    AreasplineSeries areasplineSeries = series as AreasplineSeries;
                    areasplineSeries.Data.ForEach(
                        (Action <AreasplineSeriesData>)(data => dataList.Add((object)data.ToHashtable())));
                    areasplineSeries.Type = AreasplineSeriesType.Areaspline;
                    hashtable1            = areasplineSeries.ToHashtable();
                }
                if (series is AreasplinerangeSeries)
                {
                    AreasplinerangeSeries areasplinerangeSeries = series as AreasplinerangeSeries;
                    areasplinerangeSeries.Data.ForEach(
                        (Action <AreasplinerangeSeriesData>)(data => dataList.Add((object)data.ToHashtable())));
                    areasplinerangeSeries.Type = AreasplinerangeSeriesType.Areasplinerange;
                    hashtable1 = areasplinerangeSeries.ToHashtable();
                }
                if (series is ArearangeSeries)
                {
                    ArearangeSeries arearangeSeries = series as ArearangeSeries;
                    arearangeSeries.Data.ForEach(
                        (Action <ArearangeSeriesData>)(data => dataList.Add((object)data.ToHashtable())));
                    arearangeSeries.Type = ArearangeSeriesType.Arearange;
                    hashtable1           = arearangeSeries.ToHashtable();
                }
                if (series is ColumnrangeSeries)
                {
                    ColumnrangeSeries columnrangeSeries = series as ColumnrangeSeries;
                    columnrangeSeries.Data.ForEach(
                        (Action <ColumnrangeSeriesData>)(data => dataList.Add((object)data.ToHashtable())));
                    columnrangeSeries.Type = ColumnrangeSeriesType.Columnrange;
                    hashtable1             = columnrangeSeries.ToHashtable();
                }
                if (series is ColumnSeries)
                {
                    ColumnSeries columnSeries = series as ColumnSeries;
                    columnSeries.Data.ForEach((Action <ColumnSeriesData>)(data =>
                                                                          dataList.Add((object)data.ToHashtable())));
                    columnSeries.Type = ColumnSeriesType.Column;
                    hashtable1        = columnSeries.ToHashtable();
                }
                if (series is ScatterSeries)
                {
                    ScatterSeries scatterSeries = series as ScatterSeries;
                    scatterSeries.Data.ForEach(
                        (Action <ScatterSeriesData>)(data => dataList.Add((object)data.ToHashtable())));
                    scatterSeries.Type = ScatterSeriesType.Scatter;
                    hashtable1         = scatterSeries.ToHashtable();
                }
                if (series is PolygonSeries)
                {
                    PolygonSeries polygonSeries = series as PolygonSeries;
                    polygonSeries.Data.ForEach(
                        (Action <PolygonSeriesData>)(data => dataList.Add((object)data.ToHashtable())));
                    polygonSeries.Type = PolygonSeriesType.Polygon;
                    hashtable1         = polygonSeries.ToHashtable();
                }
                if (series is CandleStickSeries)
                {
                    CandleStickSeries candleStickSeries = series as CandleStickSeries;
                    candleStickSeries.Data.ForEach(
                        (Action <CandleStickSeriesData>)(data => dataList.Add((object)data.ToHashtable())));
                    candleStickSeries.Type = CandleStickSeriesType.Candlestick;
                    hashtable1             = candleStickSeries.ToHashtable();
                }
                if (series is FlagsSeries)
                {
                    FlagsSeries flagsSeries = series as FlagsSeries;
                    flagsSeries.Data.ForEach((Action <FlagsSeriesData>)(data =>
                                                                        dataList.Add((object)data.ToHashtable())));
                    flagsSeries.Type = FlagsSeriesType.Flags;
                    hashtable1       = flagsSeries.ToHashtable();
                }
                if (series is OhlcSeries)
                {
                    OhlcSeries ohlcSeries = series as OhlcSeries;
                    ohlcSeries.Data.ForEach(
                        (Action <OhlcSeriesData>)(data => dataList.Add((object)data.ToHashtable())));
                    ohlcSeries.Type = OhlcSeriesType.Ohlc;
                    hashtable1      = ohlcSeries.ToHashtable();
                }
                hashtableList.Add(hashtable1);
            }
            return(hashtableList);
        }