private void setScan1(int X, int Y)
 {
     if (positionCounter == 0)
     {
         Bitmap   preciseMapBmp = mainForm.environment.preciseMap.GetBitmap();
         Graphics graphics      = Graphics.FromImage(preciseMapBmp);
         if (mainForm.environment.canRobotStayOnThisPoint(X, Y))
         {
             double l_rl2 = Parameters.getSquaredDistance(currentRobotPosX, currentRobotPosY, X, Y);
             if (l_rl2 <= Parameters.getL_max2())
             {
                 Console.WriteLine("First scan on " + X + "," + Y);
                 crosslinker.setCenter1(X - currentErrorX, Y - currentErrorY);
                 crosslinker.scan1 = mainForm.environment.getScan(X, Y, Parameters.finishColor);
                 positionCounter++;
                 drawPieSupposedZone(preciseMapBmp);
                 interfaceDrawing(preciseMapBmp, graphics);
             }
         }
     }
 }
Exemplo n.º 2
0
 private void setScan1(int X, int Y)
 {
     if (positionCounter == 1)
     {
         Bitmap   preciseMapBmp = mainForm.environment.preciseMap.GetBitmap();
         Graphics graphics      = Graphics.FromImage(preciseMapBmp);
         if (mainForm.environment.canRobotStayOnThisPoint(X, Y))
         {
             double l_rl2 = Parameters.getSquaredDistance(crosslinker.getXY0(), X, Y);
             if (l_rl2 <= Parameters.getL_max2())
             {
                 crosslinker.setCenter1(X, Y);
                 crosslinker.scan1 = mainForm.environment.getScan(X, Y, Parameters.finishColor);
                 MainForm.drawBitmapOnPictureBox(pictureBox3, crosslinker.scan1.getBitmap());
                 positionCounter++;
                 drawPieSupposedZone(preciseMapBmp);
                 textBox2Scan1Center.Text = X + "," + Y;
                 interfaceDrawing(preciseMapBmp, graphics);
             }
         }
     }
 }