Exemple #1
0
        public void AddArc(ArcInfo arcInfo, double velocity)
        {
            var target = ConvertToPulse(arcInfo);

            _mc.AddArcXYC(2, (short)_coordinateId, target.X, target.Y,
                          target.ArcCenterToXStartOffset, target.ArcCenterToYStartOffset,
                          velocity, target.Acceleration);
        }
Exemple #2
0
        public void DrawArc(ArcInfo arcInfo)
        {
            lock (_motionLocker)
            {
                ClearInterpolationBuffer();

                AddArc(arcInfo);

                CheckEnoughSpace();
                StartInterpolation();
                WaitTillInterpolationEnd();
            }
        }
Exemple #3
0
        public ArcInfoPulse ConvertToPulse(ArcInfo arcInfo)
        {
            arcInfo.CalculateCenterOffset();

            return(new ArcInfoPulse()
            {
                X = (int)(MotorX.EncoderFactor * arcInfo.XEnd * MotorX.Direction),
                Y = (int)(MotorY.EncoderFactor * arcInfo.YEnd * MotorY.Direction),
                Z = (int)(MotorZ.EncoderFactor * arcInfo.Z * MotorZ.Direction),

                ArcCenterToXStartOffset =
                    (int)(MotorX.EncoderFactor * arcInfo.CenterToStartXOffset * MotorX.Direction),
                ArcCenterToYStartOffset =
                    (int)(MotorY.EncoderFactor * arcInfo.CenterToStartYOffset * MotorY.Direction),

                Velocity = MotorX.Velocity,
                Acceleration = MotorX.Acceleration,
            });
        }
Exemple #4
0
 public async Task <WaitBlock> DrawArcAsync(ArcInfo arcInfo)
 {
     return(await Task.Run(() =>
     {
         try
         {
             DrawArc(arcInfo);
             return new WaitBlock()
             {
                 Message = "ShotGlueAsync Successful."
             };
         }
         catch (Exception ex)
         {
             return new WaitBlock()
             {
                 Code = ErrorCode.GlueLineFail, Message = "ShotGlueAsync fail: " + ex.Message
             };
         }
     }));
 }