Esempio n. 1
0
        /****************************************************************************/

        /*****************************Analysis***************************************/
        private void Set_Analysis_Xmax_Click(object sender, EventArgs e)
        {
            CurvAnalysis.CurvShow.SetCurvXtoMax();
            Text_Analysis_Xmax.Text = (Math.Round(CurvAnalysis.CurvShow.GetCurv_xMax(), 3)).ToString();
            Text_Analysis_Xmin.Text = (Math.Round(CurvAnalysis.CurvShow.GetCurv_xMin(), 3)).ToString();
            Text_Analysis_Xmax.Invalidate();
            Text_Analysis_Xmin.Invalidate();
        }
Esempio n. 2
0
        private void Increase_Analysis_X_Click(object sender, EventArgs e)
        {
            double delta = (Convert.ToDouble(Text_Analysis_Xmax.Text) - Convert.ToDouble(Text_Analysis_Xmin.Text)) * 0.1;

            CurvAnalysis.CurvShow.SetCurv_xMax(Convert.ToDouble(Text_Analysis_Xmax.Text) + delta);
            CurvAnalysis.CurvShow.SetCurv_xMin(Convert.ToDouble(Text_Analysis_Xmin.Text) - delta);
            Text_Analysis_Xmax.Text = (Math.Round(CurvAnalysis.CurvShow.GetCurv_xMax(), 3)).ToString();
            Text_Analysis_Xmin.Text = (Math.Round(CurvAnalysis.CurvShow.GetCurv_xMin(), 3)).ToString();
            Text_Analysis_Xmax.Invalidate();
            Text_Analysis_Xmin.Invalidate();
        }
Esempio n. 3
0
        private void UVInfo_Fresher_Tick(object sender, EventArgs e)
        {
            if (FrmLeft.uvInstance != null &&
                FrmLeft.uvInstance.t_SerialPortCommu.uvPort != null &&
                FrmLeft.uvInstance.t_SerialPortCommu.uvPort.IsOpen)
            {
                if (!UVSpectrum_Start.Enabled && !UVSpectrum_Pause.Enabled && !UVSpectrum_Stop.Enabled)
                {
                    if (UVSpectrum_Pause.Checked)
                    {
                        UVSpectrum_Start.Enabled = false;
                        UVSpectrum_Pause.Enabled = true;
                        UVSpectrum_Stop.Enabled  = true;
                    }
                    else
                    {
                        UVSpectrum_Start.Enabled = true;
                    }
                }
                UVProgram_Download.Enabled = true;
                OpenUVLamp.Enabled         = true;
                SetUVCurvZero.Enabled      = true;
            }
            else
            {
                if (!UVSpectrum_Start.Enabled && UVSpectrum_Pause.Enabled && UVSpectrum_Stop.Enabled && !UVSpectrum_Pause.Checked)
                {
                    Pause_UVProgram();
                }
                UVSpectrum_Start.Enabled = false;
                UVSpectrum_Pause.Enabled = false;
                UVSpectrum_Stop.Enabled  = false;

                UVProgram_Download.Enabled = false;
                OpenUVLamp.Enabled         = false;
                SetUVCurvZero.Enabled      = false;
            }
            if (!FrmMain.ISRegisted())
            {
                UVSpectrum_Start.Enabled = false;
            }


            //string log = UVDetector.CurvShow.GetLog();
            //if (log != null && log != "")
            //{
            //    //AppConfig.frmBottom.EquipmentText_LOG.Lines[AppConfig.frmBottom.LogCnt++] = UVSpectrum_Show.Log.Text;
            //    //UVSpectrum_Show.Log.Text = "";
            //    FrmBottom.LogCnt++;
            //    AppConfig.frmBottom.EquipmentLOG_Text.Text = AppConfig.frmBottom.EquipmentLOG_Text.Text.Insert(0, "Line " + FrmBottom.LogCnt + log.ToString() + Environment.NewLine);
            //    UVDetector.CurvShow.ClearLog();
            //}
            if (UVVPS_ComboBox.Text != "")
            {
                UVDetector.CurvShow.SetCurv_vps(Convert.ToDouble(UVVPS_ComboBox.Text));
            }
            try {
                if (Convert.ToDouble(Text_UVSpectrum_Xmax.Text) - Convert.ToDouble(Text_UVSpectrum_Xmin.Text) >= 0.005)
                {
                    UVDetector.CurvShow.SetCurv_xUnit(UVTimeUnit_ComboBox.Text);
                }
                if (Convert.ToDouble(Text_UVSpectrum_Ymax.Text) - Convert.ToDouble(Text_UVSpectrum_Ymin.Text) >= 0.005)
                {
                    UVDetector.CurvShow.SetCurv_yUnit(UVAUUnit_ComboBox.Text);
                }
                UVDetector.CurvShow.SetCurv_Color(UVWaveLength1Color_Set.BackColor, UVWaveLength2Color_Set.BackColor, UVWaveLength3Color_Set.BackColor);
            } catch
            {
            }
            //if (Convert.ToDouble(Text_Analysis_Xmax.Text) - Convert.ToDouble(Text_Analysis_Xmin.Text) >= 0.005)
            //    CurvAnalysis.CurvShow.SetCurv_xUnit(CurvTimeUnit_ComboBox.Text);
            //if (Convert.ToDouble(Text_Analysis_Ymax.Text) - Convert.ToDouble(Text_Analysis_Ymin.Text) >= 0.005)
            //    CurvAnalysis.CurvShow.SetCurv_yUnit(CurvAUUnit_ComboBox.Text);
            //CurvAnalysis.CurvShow.SetCurv_Color(CurvWaveLength1Color_Set.BackColor, CurvWaveLength2Color_Set.BackColor, CurvWaveLength3Color_Set.BackColor);

            CurvTimeUnit_ComboBox.Text         = CurvAnalysis.CurvShow.GetCurv_xUnit();
            CurvAUUnit_ComboBox.Text           = CurvAnalysis.CurvShow.GetCurv_yUnit();
            CurvWaveLength1_TextBox.Text       = CurvAnalysis.CurvShow.GetWaveLength1().ToString();
            CurvWaveLength2_TextBox.Text       = CurvAnalysis.CurvShow.GetWaveLength2().ToString();
            CurvWaveLength3_TextBox.Text       = CurvAnalysis.CurvShow.GetWaveLength3().ToString();
            CurvWaveLength1Color_Set.BackColor = CurvAnalysis.CurvShow.GetCurv0_Color();
            CurvWaveLength2Color_Set.BackColor = CurvAnalysis.CurvShow.GetCurv1_Color();
            CurvWaveLength3Color_Set.BackColor = CurvAnalysis.CurvShow.GetCurv2_Color();

            if (!UVSpectrum_Start.Enabled && UVSpectrum_Pause.Enabled && UVSpectrum_Stop.Enabled)
            {
                UVValue_Main.Text = "波长:" + UVDetector.CurvShow.GetWaveLength1().ToString() + " " + string.Format("{0:0.000}", UVDetector.CurvShow.GetUVValue(UVDetector.CurvShow.GetCurv_yUnit(), 0)) + UVDetector.CurvShow.GetCurv_yUnit();
                if (UVDetector.CurvShow.GetWaveLengthCnt() > 1)
                {
                    UVValue_Main.Text = UVValue_Main.Text + "    波长:" + UVDetector.CurvShow.GetWaveLength2().ToString() + " " + string.Format("{0:0.000}", UVDetector.CurvShow.GetUVValue(UVDetector.CurvShow.GetCurv_yUnit(), 1)) + UVDetector.CurvShow.GetCurv_yUnit();
                }
                if (UVDetector.CurvShow.GetWaveLengthCnt() > 2)
                {
                    UVValue_Main.Text = UVValue_Main.Text + "    波长:" + UVDetector.CurvShow.GetWaveLength3().ToString() + " " + string.Format("{0:0.000}", UVDetector.CurvShow.GetUVValue(UVDetector.CurvShow.GetCurv_yUnit(), 2)) + UVDetector.CurvShow.GetCurv_yUnit();
                }
                UVTime_Main.Text = string.Format("{0:0.00}", UVDetector.CurvShow.GetUVTime(UVDetector.CurvShow.GetCurv_xUnit())) + UVDetector.CurvShow.GetCurv_xUnit();
                if (UVDetector.CurvShow.GetUVTime(UVDetector.CurvShow.GetCurv_xUnit()) >= Convert.ToDouble(UVMaxTime_TextBox.Text))
                {
                    UVSpectrum_Stop_Click(null, null);
                }
            }
            else
            {
                UVValue_Main.Text = "";
                UVTime_Main.Text  = "";
            }

            if (!xMaxEnter_UVSpectrum)
            {
                Text_UVSpectrum_Xmax.Text = (Math.Round(UVDetector.CurvShow.GetCurv_xMax(), 3)).ToString();
                Text_UVSpectrum_Xmax.Invalidate();
            }
            if (!xMinEnter_UVSpectrum)
            {
                Text_UVSpectrum_Xmin.Text = (Math.Round(UVDetector.CurvShow.GetCurv_xMin(), 3)).ToString();
                Text_UVSpectrum_Xmin.Invalidate();
            }
            if (!yMaxEnter_UVSpectrum)
            {
                Text_UVSpectrum_Ymax.Text = (Math.Round(UVDetector.CurvShow.GetCurv_yMax(), 3)).ToString();
                Text_UVSpectrum_Ymax.Invalidate();
            }
            if (!yMinEnter_UVSpectrum)
            {
                Text_UVSpectrum_Ymin.Text = (Math.Round(UVDetector.CurvShow.GetCurv_yMin(), 3)).ToString();
                Text_UVSpectrum_Ymin.Invalidate();
            }

            if (!xMaxEnter_Analysis)
            {
                Text_Analysis_Xmax.Text = (Math.Round(CurvAnalysis.CurvShow.GetCurv_xMax(), 3)).ToString();
                Text_Analysis_Xmax.Invalidate();
            }
            if (!xMinEnter_Analysis)
            {
                Text_Analysis_Xmin.Text = (Math.Round(CurvAnalysis.CurvShow.GetCurv_xMin(), 3)).ToString();
                Text_Analysis_Xmin.Invalidate();
            }
            if (!yMaxEnter_Analysis)
            {
                Text_Analysis_Ymax.Text = (Math.Round(CurvAnalysis.CurvShow.GetCurv_yMax(), 3)).ToString();
                Text_Analysis_Ymax.Invalidate();
            }
            if (!yMinEnter_Analysis)
            {
                Text_Analysis_Ymin.Text = (Math.Round(CurvAnalysis.CurvShow.GetCurv_yMin(), 3)).ToString();
                Text_Analysis_Ymin.Invalidate();
            }
        }