예제 #1
0
        public frmMain2()
        {
            SceneFileExt = "cws";// default to creation workshop CWS files
            m_lsttabs    = new List <tabview>();
            m_logSB      = new StringBuilder();
            InitializeComponent();

            UVDLPApp.Instance().m_mainform = this;
            m_manctl = ManualControl.Instance(); // late intialization happens here after the UVDLP app Singleton is initiated.

            RegisterCallbacks();
            RegisterGUI();
            SetButtonStatuses();
            UVDLPApp.Instance().AppEvent += new AppEventDelegate(AppEventDel);
            DebugLogger.Instance().LoggerStatusEvent += new LoggerStatusHandler(LoggerStatusEvent);
            UVDLPApp.Instance().m_slicer.Slice_Event += new Slicer.SliceEvent(SliceEv);
            UVDLPApp.Instance().m_buildmgr.BuildStatus += new delBuildStatus(BuildStatus);
            UVDLPApp.Instance().m_deviceinterface.StatusEvent += new DeviceInterface.DeviceInterfaceStatus(DeviceStatusEvent);
            UVDLPApp.Instance().m_buildmgr.PrintLayer += new delPrinterLayer(PrintLayer);
            UVDLPApp.Instance().Engine3D.UpdateGrid();
            ctl3DView1.UpdateView(); // initial update
            // set up initial log data in form
            foreach (string lg in DebugLogger.Instance().GetLog())
            {
                //txtLog.Text = lg + "\r\n" + txtLog.Text;
                AddtoLog(lg);
            }
            //RearrangeGui
            AddButtons();
            AddControls();
            SetupTabs();
            //set the default tab
            m_viewtype = -1; // start with the first tab added
            ShowView(0);     // 3d tab


            ctl3DView1.RearrangeGui();
            ctl3DView1.Enable3dView(true);
            // test new gui config system
            GuiConfigDB gconfdb = new GuiConfigDB();

            gconfdb.LoadConfiguration(global::UV_DLP_3D_Printer.Properties.Resources.GuiConfig);
            UVDLPApp.Instance().m_gui_config.ApplyConfiguration(gconfdb);
            gconfdb.SaveConfiguration("GuiConfigTest");

            //ctlSliceGCodePanel1.ctlSliceViewctl.DlpForm = m_frmdlp; // set the dlp form for direct control
            SetMainMessage("");
            SetTimeMessage("");
            #if (DEBUG)
            ShowLogPanel(true);
            #else
            ShowLogPanel(false);
            pluginTesterToolStripMenuItem.Visible       = false;
            testToolStripMenuItem.Visible               = false;
            testMachineControlToolStripMenuItem.Visible = false;
            loadGUIConfigToolStripMenuItem.Visible      = false;
            #endif
            SetTitle();
            UVDLPApp.Instance().PerformPluginCommand("MainFormLoadedCommand", true);
        }
예제 #2
0
        public frmMain2()
        {
            m_logSB = new StringBuilder();
            InitializeComponent();
            m_viewtype = eViewTypes.eNone;
            UVDLPApp.Instance().m_mainform = this;
            m_manctl = ManualControl.Instance(); // late intialization happens here after the UVDLP app Singleton is initiated.

            ctlTitle3dView.Checked = true; // set it as checked
            ctlTitle3dView_Click(null, null); // and click the button

            RegisterCallbacks();
            RegisterGUI();
            SetButtonStatuses();
            UVDLPApp.Instance().AppEvent += new AppEventDelegate(AppEventDel);
            DebugLogger.Instance().LoggerStatusEvent += new LoggerStatusHandler(LoggerStatusEvent);
            UVDLPApp.Instance().m_slicer.Slice_Event += new Slicer.SliceEvent(SliceEv);
            UVDLPApp.Instance().m_buildmgr.BuildStatus += new delBuildStatus(BuildStatus);
            UVDLPApp.Instance().m_deviceinterface.StatusEvent += new DeviceInterface.DeviceInterfaceStatus(DeviceStatusEvent);
            UVDLPApp.Instance().m_buildmgr.PrintLayer += new delPrinterLayer(PrintLayer);
            UVDLPApp.Instance().Engine3D.UpdateGrid();
            ctl3DView1.UpdateView(); // initial update
            // set up initial log data in form
            foreach (string lg in DebugLogger.Instance().GetLog())
            {
                //txtLog.Text = lg + "\r\n" + txtLog.Text;
                AddtoLog(lg);
            }
            //RearrangeGui
            AddButtons();
            AddControls();
            ctl3DView1.RearrangeGui();
            ctl3DView1.Enable3dView(true);
            #if (DEBUG) // DBG_GUICONF
            // test new gui config system
            GuiConfigDB gconfdb = new GuiConfigDB();
            gconfdb.LoadConfiguration(global::UV_DLP_3D_Printer.Properties.Resources.GuiConfig);
            UVDLPApp.Instance().m_gui_config.ApplyConfiguration(gconfdb);
            gconfdb.SaveConfiguration("GuiConfigTest");
            #else
            UVDLPApp.Instance().m_gui_config.LoadConfiguration(global::UV_DLP_3D_Printer.Properties.Resources.GuiConfig);
            #endif

            //ctlSliceGCodePanel1.ctlSliceViewctl.DlpForm = m_frmdlp; // set the dlp form for direct control
            SetMainMessage("");
            SetTimeMessage("");
            #if (DEBUG)
                ShowLogPanel(true);
            #else
                ShowLogPanel(false);
                pluginTesterToolStripMenuItem.Visible = false;
                testToolStripMenuItem.Visible = false;
                testMachineControlToolStripMenuItem.Visible = false;
                loadGUIConfigToolStripMenuItem.Visible = false;
            #endif
                SetTitle();
            UVDLPApp.Instance().PerformPluginCommand("MainFormLoadedCommand", true);
        }
예제 #3
0
 private void loadGUIConfigToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         // load a new GUIConfig file from disk
         // this is a debug only function for now.
         if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             StreamReader streamReader = new StreamReader(openFileDialog1.FileName);
             string text = streamReader.ReadToEnd();
             streamReader.Close();
     #if (DEBUG) // DBG_GUICONF
                 // test new gui config system
             GuiConfigDB gconfdb = new GuiConfigDB();
             gconfdb.LoadConfiguration(text);
             UVDLPApp.Instance().m_gui_config.ApplyConfiguration(gconfdb);
             gconfdb.SaveConfiguration("GuiConfigMenuTest");
     #else
             UVDLPApp.Instance().m_gui_config.LoadConfiguration(text);
     #endif
             //UVDLPApp.Instance().m_gui_config.LayoutGui(
         }
     }catch(Exception ex)
     {
         DebugLogger.Instance().LogError(ex);
     }
 }
예제 #4
0
        /// <summary>
        /// This function iterates through all the plugins
        /// and loads the configuration GUIConfig from each
        /// there is no reason why this needs to be in the ctl3DView
        /// this should go in the main UVDLPApp class
        /// </summary>
        public void LoadPluginGui()
        {
            IPlugin plugin = null;

            foreach (PluginEntry ip in UVDLPApp.Instance().m_plugins)
            {
                try
                {
                    if (ip.m_licensed != true || ip.m_enabled == false)
                    {
                        continue;
                    }

                    plugin = ip.m_plugin;
                    if (plugin == null)
                    {
                        continue;
                    }

                    if (!plugin.SupportFunctionality(PluginFuctionality.CustomGUI))
                    {
                        continue;
                    }

                    string guiconfname = null;
                    foreach (PluginItem pi in plugin.GetPluginItems)
                    {
                        try
                        {
                            switch (pi.m_type)
                            {
                            case ePlItemType.eTexture:
                                gr2d.LoadTexture(plugin.GetString(pi.m_name + "_index"), plugin);
                                break;

                            case ePlItemType.eGuiConfig:
                                guiconfname = plugin.GetString(pi.m_name);
                                break;

                            case ePlItemType.eControl:
                                UserControl ctl = plugin.GetControl(pi.m_name);
                                if ((ctl.GetType() == typeof(ctlImageButton)) || ctl.GetType().IsSubclassOf(typeof(ctlImageButton)))
                                {
                                    guiconf.AddButton(pi.m_name, (ctlImageButton)ctl);
                                }
                                else      //(ctl.GetType().IsSubclassOf(typeof(ctlUserPanel)))
                                {
                                    guiconf.AddControl(pi.m_name, ctl);
                                }
                                break;
                            }
                        }
                        catch (Exception ex)
                        {
                            DebugLogger.Instance().LogError(ex);
                        }
                    }
                    //after all the resource have been loaded from the GUI
                    // the 'script' xml layout portion of the GUI is loaded to do something with those resources
                    if ((guiconf != null) && (guiconfname != null))
                    {
                        //gc.ClearLayout();
                        // test new gui config system
                        GuiConfigDB gconfdb = new GuiConfigDB();
                        gconfdb.LoadConfiguration(guiconfname, plugin);
                        guiconf.ApplyConfiguration(gconfdb);
                        gconfdb.SaveConfiguration("GuiConfigPlugin");
                        RearrangeGui();
                    }
                }
                catch (Exception ex)
                {
                    DebugLogger.Instance().LogError(ex);
                }
            }
        }
예제 #5
0
        /// <summary>
        /// This function iterates through all the plugins
        /// and loads the configuration GUIConfig from each
        /// there is no reason why this needs to be in the ctl3DView
        /// this should go in the main UVDLPApp class
        /// </summary>
        public void LoadPluginGui()
        {
            IPlugin plugin = null;
            foreach (PluginEntry ip in UVDLPApp.Instance().m_plugins)
            {
                try
                {
                    if (ip.m_licensed != true || ip.m_enabled == false)
                        continue;

                    plugin = ip.m_plugin;
                    if (plugin == null)
                        continue;

                    if (!plugin.SupportFunctionality(PluginFuctionality.CustomGUI))
                        continue;

                    string guiconfname = null;
                    foreach (PluginItem pi in plugin.GetPluginItems)
                    {
                        try
                        {
                            switch (pi.m_type)
                            {
                                case ePlItemType.eTexture:
                                    gr2d.LoadTexture(plugin.GetString(pi.m_name + "_index"), plugin);
                                    break;

                                case ePlItemType.eGuiConfig:
                                    guiconfname = plugin.GetString(pi.m_name);
                                    break;

                                case ePlItemType.eControl:
                                    UserControl ctl = plugin.GetControl(pi.m_name);
                                    if ((ctl.GetType() == typeof(ctlImageButton)) || ctl.GetType().IsSubclassOf(typeof(ctlImageButton)))
                                    {
                                        guiconf.AddButton(pi.m_name, (ctlImageButton)ctl);
                                    }
                                    else  //(ctl.GetType().IsSubclassOf(typeof(ctlUserPanel)))
                                    {
                                        guiconf.AddControl(pi.m_name, ctl);
                                    }
                                    break;

                            }
                        }
                        catch (Exception ex)
                        {
                            DebugLogger.Instance().LogError(ex);
                        }
                    }
                    //after all the resource have been loaded from the GUI
                    // the 'script' xml layout portion of the GUI is loaded to do something with those resources
                    if ((guiconf != null) && (guiconfname != null))
                    {
                        //gc.ClearLayout();
                        // test new gui config system
                        GuiConfigDB gconfdb = new GuiConfigDB();
                        gconfdb.LoadConfiguration(guiconfname, plugin);
                        guiconf.ApplyConfiguration(gconfdb);
                        gconfdb.SaveConfiguration("GuiConfigPlugin");
                        RearrangeGui();
                    }
                }
                catch (Exception ex)
                {
                    DebugLogger.Instance().LogError(ex);
                }
            }
        }
예제 #6
0
        public frmMain2()
        {
            SceneFileExt = "cws";// default to creation workshop CWS files
            m_lsttabs = new List<tabview>();
            m_logSB = new StringBuilder();
            InitializeComponent();

            UVDLPApp.Instance().m_mainform = this;
            m_manctl = ManualControl.Instance(); // late intialization happens here after the UVDLP app Singleton is initiated.

            RegisterCallbacks();
            RegisterGUI();
            SetButtonStatuses();
            UVDLPApp.Instance().AppEvent += new AppEventDelegate(AppEventDel);
            DebugLogger.Instance().LoggerStatusEvent += new LoggerStatusHandler(LoggerStatusEvent);
            UVDLPApp.Instance().m_slicer.Slice_Event += new Slicer.SliceEvent(SliceEv);
            UVDLPApp.Instance().m_buildmgr.BuildStatus += new delBuildStatus(BuildStatus);
            UVDLPApp.Instance().m_deviceinterface.StatusEvent += new DeviceInterface.DeviceInterfaceStatus(DeviceStatusEvent);
            UVDLPApp.Instance().m_buildmgr.PrintLayer += new delPrinterLayer(PrintLayer);
            UVDLPApp.Instance().Engine3D.UpdateGrid();
            ctl3DView1.UpdateView(); // initial update
            // set up initial log data in form
            foreach (string lg in DebugLogger.Instance().GetLog())
            {
                //txtLog.Text = lg + "\r\n" + txtLog.Text;
                AddtoLog(lg);
            }
            //RearrangeGui
            AddButtons();
            AddControls();
            SetupTabs();
            //set the default tab
            m_viewtype = -1;// start with the first tab added
            ShowView(0);// 3d tab

            ctl3DView1.RearrangeGui();
            ctl3DView1.Enable3dView(true);
            // test new gui config system
            GuiConfigDB gconfdb = new GuiConfigDB();
            //try to load the GUI
            gconfdb.LoadConfiguration(global::UV_DLP_3D_Printer.Properties.Resources.GuiConfig);
            UVDLPApp.Instance().m_gui_config.ApplyConfiguration(gconfdb);

            //ctlSliceGCodePanel1.ctlSliceViewctl.DlpForm = m_frmdlp; // set the dlp form for direct control
            SetMainMessage("");
            SetTimeMessage("");
            #if (DEBUG)
                ShowLogPanel(true);
            #else
                ShowLogPanel(false);
                pluginTesterToolStripMenuItem.Visible = false;
                testToolStripMenuItem.Visible = false;
                testMachineControlToolStripMenuItem.Visible = false;
                loadGUIConfigToolStripMenuItem.Visible = false;
                checkForUpdatesToolStripMenuItem.Visible = false;
                //miiManualControlToolStripMenuItem.Visible = false;
                //miiManualControlToolStripMenuItem.Visible = false;
            #endif
                SetTitle();
            UVDLPApp.Instance().PerformPluginCommand("MainFormLoadedCommand", true);
            AddGlobalMouseHandler();
        }