コード例 #1
0
 private UVDLPApp()
 {
     m_supportmode          = eSupportEditMode.eNone;
     SceneFileName          = "";
     m_callbackhandler      = new CallbackHandler();
     m_appconfig            = new AppConfig();
     m_printerinfo          = new MachineConfig();
     m_buildparms           = new SliceBuildConfig();
     m_deviceinterface      = new DeviceInterface();
     m_buildmgr             = new BuildManager();
     m_slicer               = new Slicer();
     m_slicer.m_slicemethod = Slicer.eSliceMethod.eNormalCount;// configure the slicer to user the new normal count - Thanks Shai!!!
     m_slicer.Slice_Event  += new Slicer.SliceEvent(SliceEv);
     //m_dispmgr = DisplayManager.Instance(); // initialize the singleton for early event app binding
     //m_flexslice = new FlexSlice();
     m_gcode            = new GCodeFile(""); // create a blank gcode to start with
     m_supportconfig    = new SupportConfig();
     m_supportgenerator = new SupportGenerator();
     m_supportgenerator.SupportEvent += new SupportGeneratorEvent(SupEvent);
     CSG.Instance().CSGEvent += new CSG.CSGEventDel(CSGEvent);
     m_proj_cmd_lst    = new prjcmdlst();
     m_plugins         = new List <PluginEntry>(); // list of user plug-ins
     m_pluginstates    = PluginStates.Instance();  // initialize the plugin state singleton
     m_undoer          = new Undoer();
     m_2d_graphics     = new C2DGraphics();
     m_gui_config      = new GuiConfigManager();
     m_AuxBuildCmds    = AuxBuildCmds.Instance(); // make sure the singleton doesn't go away...
     m_sequencemanager = SequenceManager.Instance();
 }
コード例 #2
0
        protected override void OnClick(EventArgs e)
        {
            base.OnClick(e);
            if (mOnClickCallback == null)
            {
                return;
            }
            Object retobj = UVDLPApp.Instance().m_callbackhandler.Activate(mOnClickCallback, this);

            if (retobj != null)
            {
                //if the return object is null, then this was probably a successful call
                //if the return object type is boolean, and the value is false,
                //then this could be a sequence to execute
                // I'm debating whether this code should get put into the CallbackHandler code
                // as-is, only buttons can trigger sequences, this may change in the future.
                try
                {
                    Boolean val = (System.Boolean)retobj;
                    if (val == false)
                    {
                        // try to execute it as a sequence
                        SequenceManager.Instance().ExecuteSequence(mOnClickCallback);
                    }
                }
                catch (Exception) { }
            }
        }
コード例 #3
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);
         }
     }
 }
コード例 #4
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);
         }
         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
         }
     }
 }
コード例 #5
0
        // 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");
            }
        }