void WaitingCollect_DarkI(object LockWatingThread) { double miu = 0; double miuCC; double delta; int Tex; //double E; this.Invoke((EventHandler)(delegate { WFGlobal.WaitMS(1); exposureChart.Series["miu"].Points.Clear(); exposureChart.Series["delta"].Points.Clear(); tcpCCS.LightSet(SystemParam.lambda_Oe, 0);//暗场 })); Tex = SystemParam.NTdark; //明场 for (int i = 0; i < 16; i++) { this.Invoke((EventHandler)(delegate { // exposureListView.Items[2].SubItems[1].Text = (Imin.ToString("F2") + "-" + Imax.ToString("F2")); // exposureListView.Items[3].SubItems[1].Text = oe_per.ToString("F2"); if (!UDPProc.CollectImage(this, Tex, 2)) { ParamTestWaitingProc.ExitWatting(); return; } UDPProc.ccdImageList[0].save(SystemParam.TempPicPath + "DarkI" + Tex.ToString("") + "_0.bin"); UDPProc.ccdImageList[1].save(SystemParam.TempPicPath + "DarkI" + Tex.ToString("") + "_1.bin"); ccdImage.Calc_miu_delta(UDPProc.ccdImageList[0], UDPProc.ccdImageList[1], out miu, out delta, out miuCC); exposureChart.Series["miu"].Points.AddXY(Tex, miu); exposureChart.Series["delta"].Points.AddXY(Tex, delta); Collect_DarkI_miu.Add(miu); Collect_DarkI_delta.Add(delta); })); if (exposureWaitingProc.HasBeenCancelled()) { return; } Tex += SystemParam.delta_Tdark; ParamTestWaitingProc.SetProcessBarPerformStep(); } }
private void btnSave_Click(object sender, EventArgs e) { if (NbrSpeed != 0.0) { Dt = NfrSpeed / NbrSpeed; txtDt.Text = Dt.ToString("0.00");//牵伸倍数,保留两位小数 } else { txtDt.Text = "0.00"; } //////////////////////////////////// if (txtRov.Text != "" && Dt != 0) { Tex = Double.Parse(txtRov.Text) / Dt;//细纱号数 txtTex.Text = Tex.ToString("0.00"); } else { txtTex.Text = "0.00"; } /////////////////////////////////// if (NfrSpeed != 0) { T = (1000 * SpindleSpeed) / (3.14 * Double.Parse(combDr.Text) * NfrSpeed);//捻度 txtT.Text = T.ToString("0.00"); } else { txtT.Text = "0.00"; } //////////////////////////////////// if (T != 0) { P = (SpindleSpeed * 60 * Tex * 1000) / (T * 1000 * 1000);//千锭小时产量 txtP.Text = P.ToString("0.00"); } else { txtP.Text = "0.00"; } }
void WaitingCollect_etaCurve_2(object LockWatingThread) { double miu = 0; double miuCC; double delta; int Tex; int stepCount = 0; for (double lamba = SystemParam.L_lambda; lamba < SystemParam.H_lambda; lamba += SystemParam.delta_lambda) { stepCount = 0; List <double> eta_miu = new List <double>(); Collect_etaCurve_delta = new List <double>(); this.Invoke((EventHandler)(delegate { WFGlobal.WaitMS(1); ParamTestChart2.Series["miu"].Points.Clear(); ParamTestChart2.Series["delta"].Points.Clear(); ParamTestChart2.Series["miu_dark"].Points.Clear(); ParamTestChart2.Series["delta_dark"].Points.Clear(); tcpCCS.LightSet((int)lamba, SystemParam.Oe); })); Tex = SystemParam.NTmin; //明场 while (true) { this.Invoke((EventHandler)(delegate { // exposureListView.Items[2].SubItems[1].Text = (Imin.ToString("F2") + "-" + Imax.ToString("F2")); // exposureListView.Items[3].SubItems[1].Text = oe_per.ToString("F2"); if (!UDPProc.CollectImage(this, Tex, 2)) { ParamTestWaitingProc.ExitWatting(); return; } UDPProc.ccdImageList[0].save(SystemParam.TempPicPath + "ET" + Tex.ToString("") + "_0.bin"); UDPProc.ccdImageList[1].save(SystemParam.TempPicPath + "ET" + Tex.ToString("") + "_1.bin"); ccdImage.Calc_miu_delta(UDPProc.ccdImageList[0], UDPProc.ccdImageList[1], out miu, out delta, out miuCC); ParamTestChart2.Series["miu"].Points.AddXY(Tex, miu); ParamTestChart2.Series["delta"].Points.AddXY(Tex, delta); DeviceState ds = UDPProc.UDPCommand_04(); if (ds == null) { textBox1.AppendText("照度采集失败,测试终止\r\n"); ParamTestWaitingProc.ExitWatting(); return; } eta_miu.Add(miu); Collect_etaCurve_delta.Add(delta); Collect_etaCurve_E.Add(ds.Illuminance); Tex += SystemParam.NTexp; stepCount++; ParamTestWaitingProc.SetProcessBarPerformStep(); })); if (miu >= SystemParam.miu_sat)//均值达到本文第二章(曝光步距)所确定的饱和均值 { double max = Collect_etaCurve_delta.Max(); if (Collect_etaCurve_delta.Last() < max * 0.5)//方差由最大峰值迅速下降(超过50%) { Collect_etaCurve_miu.Add(eta_miu); break; } } if (exposureWaitingProc.HasBeenCancelled()) { return; } } this.Invoke((EventHandler)(delegate { WFGlobal.WaitMS(1); tcpCCS.LightSet(SystemParam.lambda_Oe, 0); })); Tex = SystemParam.NTmin; List <double> eta_miu_dark = new List <double>(); for (int i = 0; i < stepCount; i++) { this.Invoke((EventHandler)(delegate { // exposureListView.Items[2].SubItems[1].Text = (Imin.ToString("F2") + "-" + Imax.ToString("F2")); // exposureListView.Items[3].SubItems[1].Text = oe_per.ToString("F2"); if (!UDPProc.CollectImage(this, Tex, 2)) { ParamTestWaitingProc.ExitWatting(); return; } UDPProc.ccdImageList[0].save(SystemParam.TempPicPath + "EDT" + Tex.ToString("") + "_0.bin"); UDPProc.ccdImageList[1].save(SystemParam.TempPicPath + "EDT" + Tex.ToString("") + "_1.bin"); ccdImage.Calc_miu_delta(UDPProc.ccdImageList[0], UDPProc.ccdImageList[1], out miu, out delta, out miuCC); ParamTestChart2.Series["miu_dark"].Points.AddXY(Tex, miu); ParamTestChart2.Series["delta_dark"].Points.AddXY(Tex, delta); eta_miu_dark.Add(miu); Collect_etaCurve_delta_dark.Add(delta); })); if (exposureWaitingProc.HasBeenCancelled()) { return; } Tex += SystemParam.NTexp; ParamTestWaitingProc.SetProcessBarPerformStep(); } Collect_etaCurve_miu_dark.Add(eta_miu_dark); } }