예제 #1
0
 public bool ExecuteSequence(string name)
 {
     try
     {
         CommandSequence seq = Find(name);
         if (seq == null)
         {
             return(false);
         }
         switch (seq.m_seqtype)
         {
         case CommandSequence.COMMAND_TYPE_GCODE:
             //a gcode command sequence - execute it with a pseudo-build manager/sequencer
             GCodeFile gcf = new GCodeFile(seq.m_seq);
             if (!UVDLPApp.Instance().m_buildmgr.IsPrinting)
             {
                 DebugLogger.Instance().LogInfo("Running GCode Sequence " + seq.m_name);
                 UVDLPApp.Instance().m_buildmgr.StartPrint(UVDLPApp.Instance().m_slicefile, gcf, true);
             }
             break;
         }
         return(true);
     }
     catch (Exception ex)
     {
         DebugLogger.Instance().LogError(ex);
     }
     return(false);
 }
예제 #2
0
 public void Remove(CommandSequence seq)
 {
     try
     {
         m_lstsequences.Remove(seq);
     }
     catch (Exception ex)
     {
         DebugLogger.Instance().LogError(ex);
     }
 }
예제 #3
0
        public bool ExecuteSequence(string name)
        {
            try
            {
                CommandSequence seq = Find(name);
                if (seq == null)
                {
                    return(false);
                }
                switch (seq.m_seqtype)
                {
                case CommandSequence.COMMAND_TYPE_GCODE:
                    //a gcode command sequence - execute it with a pseudo-build manager/sequencer
                    GCodeFile gcf = new GCodeFile(seq.m_seq);
                    if (!UVDLPApp.Instance().m_buildmgr.IsPrinting)
                    {
                        DebugLogger.Instance().LogInfo("Running GCode Sequence " + seq.m_name);
                        UVDLPApp.Instance().m_buildmgr.StartPrint(UVDLPApp.Instance().m_slicefile, gcf, true);
                    }
                    break;

                case CommandSequence.COMMAND_TYPE_SPAWN_PROCESS:
                    //use the parameter variables to fill in the args, then spawn the process
                    // a flag can be to wait for the process to end , or simply start it.
                    ProcessSequence psc = (ProcessSequence)seq;
                    foreach (ProcessEntry pe in psc.m_entries)
                    {
                        pe.RunProcess();
                    }
                    break;
                }
                return(true);
            }
            catch (Exception ex)
            {
                DebugLogger.Instance().LogError(ex);
            }
            return(false);
        }
예제 #4
0
 public void Add(CommandSequence seq)
 {
     m_lstsequences.Add(seq);
 }
 public void Remove(CommandSequence seq)
 {
     try
     {
         m_lstsequences.Remove(seq);
     }
     catch (Exception ex)
     {
         DebugLogger.Instance().LogError(ex);
     }
 }
 public void Add(CommandSequence seq)
 {
     m_lstsequences.Add(seq);
 }