public override void line() { if (drawhandle != null) { Axis6.removeLine(drawhandle); } drawhandle = Axis6.DrawLine(sour, dest); }
public G1(Axis6.AxisStruct stop) { message = "直线插补到点"; sour = LastStruct; dest = stop; drawhandle = Axis6.DrawLine(sour, dest); LastStruct = dest; count = docount = 0; bcount = -1; redraw = true; this.r = rg; }
public override void run() { int f, s, d; if (rg != r) { r = rg; bcount = 0; } f = Motor.Frequency; s = Motor.StartSpeed; d = Motor.SpeedTime; Motor.Frequency = (Motor.Frequency > 5000) ? 5000 : Motor.Frequency; Motor.SetInfo(Motor.Frequency, Motor.Frequency, 1); sumdata(false); if (sumlot) { if (First) { linehandl = Axis6.DrawLine(sour, dest, 'b', 2); } } LastStruct = dest; if (bcount < count) { while (isRun) { if (Motor.IsReady || !Motor.Enable) { if (docount < count) { if (AngleList[docount] == null) { continue; } if (AngleList[docount] == LastStruct.angle) { docount++; if (docount >= count) { if (inoutcount != 0) { StartInOut(); } } continue; } Axis6.MoveToAngle(AngleList[docount]); //Motor.MotorRun(AngleList[docount]); docount++; if (docount >= count) { if (inoutcount != 0) { StartInOut(); } } } else { break; } } Thread.Sleep(1); } } else { Axis6.PointToPointMove(AngleList); } if (!isRun) { return; } Motor.MotorRunList(AngleList); while (isRun && !Motor.IsReady) { Thread.Sleep(1); } if (!isRun) { return; } Motor.SetInfo(s, f, d); while (isRun && !Motor.IsReady) { Thread.Sleep(1); } //Axis6.AxisStruct last = new Axis6.AxisStruct(); //if(AngleList==null) //{ // AngleList = Axis6.PointToPointLineAngle(sour, dest, rg); // lineObj = Axis6.AngleListToObject(AngleList); //} //Motor.MotorRunList(AngleList); //Thread.Sleep(DefDelay); }