Esempio n. 1
0
        /// <summary>
        /// Dwell for a number of milliseconds (1000ms=1s). Optionally, retract/unretract.
        /// </summary>
        public virtual void AppendDwell(int ms, bool bRetract)
        {
            AssemblerCommandsToolpath dwell_path = new AssemblerCommandsToolpath()
            {
                AssemblerF = (iassembler, icomplier) => {
                    BaseDepositionAssembler asm = iassembler as BaseDepositionAssembler;
                    if (asm == null)
                    {
                        throw new Exception("ToolpathSetBuilder.AppendDwell: unsupported assembler");
                    }
                    asm.FlushQueues();
                    if (bRetract)
                    {
                        asm.BeginRetractRelativeDist(asm.NozzlePosition, 9999, -1.0f);
                    }
                    asm.AppendDwell(ms);
                    if (bRetract)
                    {
                        asm.EndRetract(asm.NozzlePosition, 9999);
                    }
                }
            };

            AppendPath(dwell_path);
        }
 /// <summary>
 /// Called on toolpath if IsCommandToolpath() returns true
 /// </summary>
 protected virtual void ProcessCommandToolpath(IToolpath toolpath)
 {
     if (toolpath.Type == ToolpathTypes.CustomAssemblerCommands)
     {
         AssemblerCommandsToolpath assembler_path = toolpath as AssemblerCommandsToolpath;
         if (assembler_path != null && assembler_path.AssemblerF != null)
         {
             assembler_path.AssemblerF(Assembler, this);
         }
         else
         {
             emit_message("ProcessCommandToolpath: invalid " + toolpath.Type.ToString());
         }
     }
     else
     {
         emit_message("ProcessCommandToolpath: unhandled type " + toolpath.Type.ToString());
     }
 }