Пример #1
0
        private bool GetData()
        {
            try
            {
                if (cmbMachineType.SelectedIndex != -1)
                {
                    m_config.m_machinetype = (MachineConfig.eMachineType)Enum.Parse(typeof(MachineConfig.eMachineType), cmbMachineType.SelectedItem.ToString());
                }

                /*
                 * if (lstDrivers.SelectedIndex != -1)
                 * {
                 *  m_config.m_driverconfig.m_drivertype = (eDriverType)Enum.Parse(typeof(eDriverType), lstDrivers.SelectedItem.ToString());
                 * }
                 */
                if (m_saved != m_config.m_driverconfig.m_drivertype)
                {
                    UVDLPApp.Instance().SetupDriver();
                }

                m_config.m_PlatXSize = double.Parse(txtPlatWidth.Text);
                m_config.m_PlatYSize = double.Parse(txtPlatHeight.Text);
                m_config.m_PlatZSize = double.Parse(txtPlatTall.Text);
                m_config.m_monitorconfig.m_XDLPRes = double.Parse(projwidth.Text);
                m_config.m_monitorconfig.m_YDLPRes = double.Parse(projheight.Text);
                //m_config.XMaxFeedrate = double.Parse(txtXFeed.Text);
                //m_config.YMaxFeedrate = double.Parse(txtYFeed.Text);
                //m_config.ZMaxFeedrate = double.Parse(txtZFeed.Text);
                m_config.CalcPixPerMM();
                if (lstMonitors.SelectedIndex != -1)
                {
                    // need to clean device name as it holds some bad characters -SHS
                    m_config.m_monitorconfig.Monitorid = CleanScreenName((Screen.AllScreens[lstMonitors.SelectedIndex].DeviceName));// lstMonitors.Items[lstMonitors.SelectedIndex].ToString();
                }
                return(true);
            }
            catch (Exception ex)
            {
                DebugLogger.Instance().LogRecord(ex.Message);
                MessageBox.Show("Please check input parameters\r\n" + ex.Message, "Input Error");
                return(false);
            }
        }
Пример #2
0
        private bool GetData()
        {
            try
            {
                // m_config.m_machinetype = MachineConfig.eMachineType.UV_DLP;

                /*
                 * if (cmbMachineType.SelectedIndex != -1)
                 * {
                 *  m_config.m_machinetype = (MachineConfig.eMachineType)Enum.Parse(typeof(MachineConfig.eMachineType), cmbMachineType.SelectedItem.ToString());
                 * }
                 * */
                if (cmbMultiSel.SelectedIndex != -1)
                {
                    m_config.m_multimontype = (MachineConfig.eMultiMonType)Enum.Parse(typeof(MachineConfig.eMultiMonType), cmbMultiSel.SelectedItem.ToString());
                }
                if (m_saved != m_config.m_driverconfig.m_drivertype)
                {
                    UVDLPApp.Instance().SetupDriver();
                }

                m_config.m_PlatXSize = double.Parse(txtPlatWidth.Text);
                m_config.m_PlatYSize = double.Parse(txtPlatHeight.Text);
                m_config.m_PlatZSize = double.Parse(txtPlatTall.Text);
                //m_config.m_monitorconfig.m_XDLPRes = double.Parse(projwidth.Text);
                //m_config.m_monitorconfig.m_YDLPRes = double.Parse(projheight.Text);
                //m_config.
                m_config.XRenderSize = int.Parse(txtXRes.Text);
                m_config.YRenderSize = int.Parse(txtYRes.Text);
                m_config.CalcPixPerMM();
                m_config.MachineControls = GetMachineControls();
                labelPressApply.Visible  = false;
                return(true);
            }
            catch (Exception ex)
            {
                DebugLogger.Instance().LogRecord(ex.Message);
                MessageBox.Show("Please check input parameters\r\n" + ex.Message, "Input Error");
                return(false);
            }
        }
Пример #3
0
        private bool GetData(bool suppresspopup = false)
        {
            try
            {
                if (cmbMultiSel.SelectedIndex != -1)
                {
                    m_config.m_multimontype = (MachineConfig.eMultiMonType)Enum.Parse(typeof(MachineConfig.eMultiMonType), cmbMultiSel.SelectedItem.ToString());
                }
                if (m_saved != m_config.m_driverconfig.m_drivertype)
                {
                    UVDLPApp.Instance().SetupDriver();
                }
                m_config.m_OverrideRenderSize = chkOverride.Checked;
                m_config.m_PlatXSize          = double.Parse(txtPlatWidth.Text);
                m_config.m_PlatYSize          = double.Parse(txtPlatHeight.Text);
                m_config.m_PlatZSize          = double.Parse(txtPlatTall.Text);
                m_config.XRenderSize          = int.Parse(txtXRes.Text);
                m_config.YRenderSize          = int.Parse(txtYRes.Text);
                m_config.m_ip = txtIp.Text;
                m_config.CalcPixPerMM();
                m_config.MachineControls = GetMachineControls();
                labelPressApply.Visible  = false;

                if (lbConfigured.SelectedIndex != -1 && curmc != null)
                {
                    //Configs.MonitorConfig mc = m_config.m_lstMonitorconfigs[lbConfigured.SelectedIndex];
                    //curmc.m_usemask = chkEnableMask.Checked;
                }
                return(true);
            }
            catch (Exception ex)
            {
                if (!suppresspopup)
                {
                    DebugLogger.Instance().LogRecord(ex.Message);
                    MessageBox.Show(((DesignMode) ? "PleaseCheckInputParameters" :UVDLPApp.Instance().resman.GetString("PleaseCheckInputParameters", UVDLPApp.Instance().cul)) + ex.Message, ((DesignMode) ? "InputError" :UVDLPApp.Instance().resman.GetString("InputError", UVDLPApp.Instance().cul)));
                }
                return(false);
            }
        }