Exemplo n.º 1
0
        public void moveTo(string gcodeLine)
        {
            VelocityV3f next = cursor;

            foreach (GMoveComponent gmove in GCodeToVec3.FromLine(gcodeLine))
            {
                next.apply(gmove);
            }

            if (!next.validPosition)
            {
                Debug.LogWarning("Invalid gcode line: " + gcodeLine);
                return;
            }

            var update = new CursorUpdate {
                from = cursor, to = next
            };

            foreach (var sub in subscribers)
            {
                sub(update);
            }

            cursor = next;
        }
Exemplo n.º 2
0
 public void DrawCursorUpdate(CursorUpdate cu)
 {
     //DEBUG
     if (cu.to.z > 0f)
     {
         Debug.Log("z height of to: " + cu.to.z);
     }
     if (machineConfig.isAtTravelHeight(cu.to))
     {
         if (dbugSettings.drawTravelMoves)
         {
             DrawTravelMove(cu.from.xy, cu.to.xy);
         }
     }
     else
     {
         DrawLine(cu.from.xy, cu.to.xy);
     }
 }