public ProcessSequence Clone()
        {
            ProcessSequence newseq = new ProcessSequence();

            newseq.m_name    = m_name;
            newseq.m_seqtype = m_seqtype;
            foreach (ProcessEntry pe in m_entries)
            {
                ProcessEntry pec = pe.Clone();
                newseq.m_entries.Add(pec);
            }
            return(newseq);
        }
Beispiel #2
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);
        }
 public ProcessSequence Clone()
 {
     ProcessSequence newseq = new ProcessSequence();
     newseq.m_name = m_name;
     newseq.m_seqtype = m_seqtype;
     foreach (ProcessEntry pe in m_entries)
     {
         ProcessEntry pec = pe.Clone();
         newseq.m_entries.Add(pec);
     }
     return newseq;
 }