Exemplo n.º 1
0
 private void drawPoints()
 {
     for (int pairedPointsIterator = 0; pairedPointsIterator < area.pointsForDraw.Count; pairedPointsIterator++)
     {
         PairedPointsForDraw currentPairedPointsForDraw = area.pointsForDraw[pairedPointsIterator];
         if (currentPairedPointsForDraw.measuresOfCommonPoints[selectedMeasure].Count > 0)
         {
             for (int pointsIterator = 0; pointsIterator < currentPairedPointsForDraw.measuresOfCommonPoints[selectedMeasure].Count; pointsIterator++)
             {
                 DrawGraph(pane,
                           currentPairedPointsForDraw.pointOnePosX,
                           currentPairedPointsForDraw.pointOnePosY,
                           currentPairedPointsForDraw.measuresOfCommonPoints[selectedMeasure][pointsIterator].metersToPointOne, pairedPointsIterator);
                 DrawGraph(pane,
                           currentPairedPointsForDraw.pointTwoPosX,
                           currentPairedPointsForDraw.pointTwoPosY,
                           currentPairedPointsForDraw.measuresOfCommonPoints[selectedMeasure][pointsIterator].metersToPointTwo, pairedPointsIterator);
             }
         }
         else
         {
             DrawGraph(pane,
                       currentPairedPointsForDraw.pointOnePosX,
                       currentPairedPointsForDraw.pointOnePosY,
                       1, pairedPointsIterator);
             DrawGraph(pane,
                       currentPairedPointsForDraw.pointTwoPosX,
                       currentPairedPointsForDraw.pointTwoPosY,
                       1, pairedPointsIterator);
         }
     }
     Console.WriteLine("Points draw");
     bindDataGridView();
 }
Exemplo n.º 2
0
 private void preparePointsForDraw()
 {
     if (area.observerPoints.Count > 1)
     {
         area.pointsForDraw.Clear();
         for (int i = 1; i < area.observerPoints.Count; i++)
         {
             ObserverPoint       observerPointOne     = area.observerPoints[i - 1];
             ObserverPoint       observerPointTwo     = area.observerPoints[i];
             PairedPointsForDraw currentPointsForDraw = new PairedPointsForDraw();
             currentPointsForDraw.measuresOfCommonPoints = new List <List <CommonPoint> >();
             currentPointsForDraw.pointOnePosX           = observerPointOne.posx;
             currentPointsForDraw.pointOnePosY           = observerPointOne.posy;
             currentPointsForDraw.pointTwoPosX           = observerPointTwo.posx;
             currentPointsForDraw.pointTwoPosY           = observerPointTwo.posy;
             for (int measure = 0; measure < area.minMeasures; measure++)
             {
                 List <WiFiPoint>   pointOnePoints = observerPointOne.measures[measure].points;
                 List <WiFiPoint>   pointTwoPoints = observerPointTwo.measures[measure].points;
                 List <CommonPoint> commonPointsForCurrentMeasure = new List <CommonPoint>();
                 for (int pointOneIterator = 0; pointOneIterator < pointOnePoints.Count; pointOneIterator++)
                 {
                     for (int pointTwoIterator = 0; pointTwoIterator < pointTwoPoints.Count; pointTwoIterator++)
                     {
                         if (!pointOnePoints[pointOneIterator].SSId.Equals("", StringComparison.InvariantCultureIgnoreCase))
                         {
                             if (pointOnePoints[pointOneIterator].SSId.Equals(pointTwoPoints[pointTwoIterator].SSId, StringComparison.InvariantCultureIgnoreCase))
                             {
                                 CommonPoint commonPoint = new CommonPoint();
                                 commonPoint.ssid             = pointOnePoints[pointOneIterator].SSId;
                                 commonPoint.metersToPointOne = Int32.Parse(pointOnePoints[pointOneIterator].Distance.Replace("~", "").Split('.')[0]);
                                 commonPoint.metersToPointTwo = Int32.Parse(pointTwoPoints[pointTwoIterator].Distance.Replace("~", "").Split('.')[0]);
                                 commonPointsForCurrentMeasure.Add(commonPoint);
                             }
                         }
                     }
                 }
                 currentPointsForDraw.measuresOfCommonPoints.Add(commonPointsForCurrentMeasure);
             }
             area.pointsForDraw.Add(currentPointsForDraw);
         }
         Console.WriteLine("Points Prepared for draw");
         Console.WriteLine("Points Sorted");
         List <int> cbSelectedMeasureDataSource = new List <int>();
         for (int cbSelectedMeasureDataSourceIndex = 0; cbSelectedMeasureDataSourceIndex < area.minMeasures; cbSelectedMeasureDataSourceIndex++)
         {
             cbSelectedMeasureDataSource.Add(cbSelectedMeasureDataSourceIndex);
         }
         cbSelectedMeasure.DataSource = cbSelectedMeasureDataSource;
     }
 }