예제 #1
0
 void HandleSequences(GuiConfigDB conf)
 {
     foreach (CommandSequence cmdseq in conf.CmdSequenceList)
     {
         if (cmdseq.m_seqtype == CommandSequence.COMMAND_TYPE_GCODE)
         {
             GCodeSequence gcseq = new GCodeSequence(cmdseq.m_name, cmdseq.m_seq);
             SequenceManager.Instance().Add(gcseq);
         }
     }
 }
 void HandleSequences(GuiConfigDB conf)
 {
     foreach (CommandSequence cmdseq in conf.CmdSequenceList)
     {
         if (cmdseq.m_seqtype == CommandSequence.COMMAND_TYPE_GCODE)
         {
             GCodeSequence gcseq = new GCodeSequence(cmdseq.m_name, cmdseq.m_seq);
             SequenceManager.Instance().Add(gcseq);
         }
         if (cmdseq.m_seqtype == CommandSequence.COMMAND_TYPE_SPAWN_PROCESS)
         {
             ProcessSequence cast = (ProcessSequence)cmdseq;
             SequenceManager.Instance().Add(cast.Clone()); // insert a cloned copy into the sequencemanager
         }
     }
 }
        // sequences should be named with the prefix of where they came from, such as a namespace
        // for example, if a sequence is loaded from the guiconfig of
        // the plugin named plugPro, and the sequence name is goHome,
        // then the name should be: plugPro.goHome
        void LoadSequence(XmlNode seqnode)
        {
            //get name
            string name = GetStrParam(seqnode, "name", "");
            //get sequence
            string seq = GetStrParam(seqnode, "seqdata", "");
            //get type
            string seqtype = GetStrParam(seqnode, "seqtype", "");

            if (seqtype.ToLower().Equals("gcode"))
            {
                GCodeSequence gcseq = new GCodeSequence(name, seq);
                SequenceManager.Instance().Add(gcseq);
            }
            else
            {
                DebugLogger.Instance().LogWarning("Unknown sequence type " + seqtype + " in GUIConfig");
            }
        }