自动刮34圈代码

 //自动刮第3,4圈   for  X:=MinX to MaxX do     begin       countmaxy:=0;       countminy:=0;       yminrun:=0;       ymaxrun:=0;       tempmaxX:=MaxX;       TEMPMINX:=MinX;       TEMPMAXY:=MaxY;       TEMPMINY:=MinY;       while  TEMPMAXY-TEMPMINY>=7  do       BEGIN         if (myPD.Map[X,TEMPMINY] IS TChipData) then           begin             countminy:=countminy+1;             if ((countminY=3) OR (countminY=4)) and (mypd.Map[X,TEMPMINY].GetValueByItem('Bin')=166)  and (yminRun<2) then             BEGIN               yminRun:=yminRun+1;               RX := X - 128;               RY := (TEMPMINY - 128) * -1;               XStringList.Add(IntToStr(RX));               YStringList.Add(IntToStr(RY));               SNStringList.Add(myPD.Map[X,TEMPMINY].SNumber + '^' + myPD.Map[X,TEMPMINY].CorolBool);             END;             TEMPMINY:=TEMPMINY+1;           end         else if (yminRun<2) then           begin             TEMPMINY:=TEMPMINY+1;           end           else           begin             TEMPMINY:=TEMPMINY;           end;

          if (myPD.Map[X,TEMPMAXY] IS TChipData)  then           begin             countmaxY:=countmaxy+1;             if (countmaxY=3) and  (ymaxRun<2) and (mypd.Map[X,TEMPMAXY].GetValueByItem('Bin')=166) then               BEGIN                 ymaxRun:=ymaxRun+1;                 RX := X - 128;                 RY := (TEMPMAXY - 128) * -1;                 XStringList.Add(IntToStr(RX));                 YStringList.Add(IntToStr(RY));                 SNStringList.Add(myPD.Map[X,TEMPMAXY].SNumber + '^' + myPD.Map[X,TEMPMAXY].CorolBool);               end;               if (countmaxY=4) and  (ymaxRun<2) and (mypd.Map[X,TEMPMAXY].GetValueByItem('Bin')=166) then               BEGIN                 ymaxRun:=ymaxRun+1;                 RX := X - 128;                 RY := (TEMPMAXY - 128) * -1;                 XStringList.Add(IntToStr(RX));                 YStringList.Add(IntToStr(RY));                 SNStringList.Add(myPD.Map[X,TEMPMAXY].SNumber + '^' + myPD.Map[X,TEMPMAXY].CorolBool);               end;               TEMPMAXY:=TEMPMAXY-1;           end           else if (ymaxRun<2)  then           begin             TEMPMAXY:=TEMPMAXY-1;           end           else           begin             TEMPMAXY:=TEMPMAXY;           end;

          if (yminRun>=2) AND (ymaxRun>=2) then           begin             Break;           end;          lastX:=X;       end;     end;

  //自动刮第3,4圈   for  Y:=Miny to Maxy do     begin       countmaxx:=0;       countminx:=0;       xminrun:=0;

      xmaxrun:=0;       TEMPMAXY:=MaxY;       TEMPMINY:=MinY;       tempmaxX:=MaxX;       TEMPMINX:=MinX;

      while  TEMPMAXx-TEMPMINx>=7  do       BEGIN         if (myPD.Map[TEMPMINX,Y] IS TChipData)  then           begin             countminX:=countminX+1;             if ((countminX=3) OR (countminX=4)) and (XminRun<2)   and (mypd.Map[TEMPMINX,Y].GetValueByItem('Bin')=166) then             BEGIN               XminRun:=XminRun+1;               RX := TEMPMINX - 128;               RY := (Y - 128) * -1;               XStringList.Add(IntToStr(RX));               YStringList.Add(IntToStr(RY));               SNStringList.Add(myPD.Map[TEMPMINX,Y].SNumber + '^' + myPD.Map[TEMPMINX,Y].CorolBool);             END;             TEMPMINX:=TEMPMINX+1;           end         else if (XminRun<2) then           begin             TEMPMINX:=TEMPMINX+1;           end           else           begin             TEMPMINX:=TEMPMINX;           end;

          if (myPD.Map[tempmaxX,Y] IS TChipData)  then           begin             countmaxX:=countmaxX+1;             if (countmaxX=3) and  (XmaxRun<2) and (mypd.Map[tempmaxX,Y].GetValueByItem('Bin')=166) then               BEGIN                 XmaxRun:=XmaxRun+1;                 RX := tempmaxX - 128;                 RY := (Y - 128) * -1;                 XStringList.Add(IntToStr(RX));                 YStringList.Add(IntToStr(RY));                 SNStringList.Add(myPD.Map[tempmaxX,Y].SNumber + '^' + myPD.Map[tempmaxX,Y].CorolBool);               end;               if (countmaxX=4) and  (XmaxRun<2) and (mypd.Map[tempmaxX,Y].GetValueByItem('Bin')=166) then               BEGIN                 XmaxRun:=XmaxRun+1;                 RX := tempmaxX - 128;                 RY := (Y - 128) * -1;                 XStringList.Add(IntToStr(RX));                 YStringList.Add(IntToStr(RY));                 SNStringList.Add(myPD.Map[tempmaxX,Y].SNumber + '^' + myPD.Map[tempmaxX,Y].CorolBool);               end;               tempmaxX:=tempmaxX-1;           end           else if (XmaxRun<2)  then           begin             tempmaxX:=tempmaxX-1;           end           else           begin             tempmaxX:=tempmaxX;           end;

          if (XminRun>=2) AND (XmaxRun>=2) then           begin             Break;           end;          lastY:=Y;       end;     end;

  //end 自动刮第3,4圈

原文地址:https://www.cnblogs.com/qiu18359243869/p/10430725.html