예제 #1
0
        void 手动拍照(object LockWatingThread)
        {
            SerialFunc.SerialCommand3(rxNeed, ls);
            while (true)
            {
                WFNetLib.WFGlobal.WaitMS(1);
                if (waitProc.HasBeenCancelled())
                {
                    break;
                }
                else
                {
                    waitProc.SetProcessBar(rxFrame);
                }
                if (rxFrame == rxNeed)
                {
                    break;
                }
            }
            for (int i = 0; i < rxNeed; i++)
            {
                byte[] yByteArray = wfSapGUI.ReadPicDatas(m_Buffers, i);
                SystemParam.CreateBINFile(yByteArray, saveFileFolder + "//" + toolStripTextBox2.Text + "(" + (i + 1).ToString() + ")" + ".bin");
//                 SystemParam.WriteTempFile(yByteArray, i * FPN_Len + j - 1, FPNFile_Path + "TempData\\Light\\" + (k + 1).ToString() + "bin");
            }
        }
예제 #2
0
        void 暗场采集(object LockWatingThread)
        {
            double y, d;
            double t;

            Calc1.miu_y_dark   = new List <double>();
            Calc1.delta_y_dark = new List <double>();
            this.Invoke((EventHandler)(delegate
            {
                chart1.Series[0].Points.Clear();
                chart1.Series[1].Points.Clear();
                chart1.ChartAreas[0].AxisY.Title = "暗场均值";
                chart1.ChartAreas[1].AxisY.Title = "暗场方差";
            }));
            NopCam((ushort)(PicN + 1), SystemParam.eStart);
            int saveindex = 0;
            int step      = (int)(MaxTime / SystemParam.Ts / PhotoNs);

            for (uint i = 0; i < PhotoNs; i++)
            {
                uint ls = SystemParam.eStart + (uint)(i * step);
                this.Invoke((EventHandler)(delegate
                {
                    toolStripLabel3.Text = SystemParam.GetTime((int)i).ToString("F2") + " ms";
                }));
                if (waitProc.HasBeenCancelled())
                {
                    return;
                }
                SerialFunc.SerialCommand3((ushort)(PicN + 1), ls);
                if (!WaitCam((ushort)(PicN + 1)))
                {
                    i--;
                    continue;
                }
                for (int j = 1; j < PicN + 1; j++)
                {
                    saveindex++;
                    m_Buffers.Save(Calc1.TempPicPath_Dark + saveindex.ToString() + ".bmp", "-format bmp", j, 0);
                    Thread.Sleep(SystemParam.PicDelay);
                }
                byte[] yByteArray;
                t = ls * SystemParam.Ts;
                for (int j = 1; j < PicN + 1; j++)
                {
                    yByteArray = wfSapGUI.ReadPicDatas(m_Buffers, j);
                    SystemParam.CreateBINFile(yByteArray, SystemParam.TxtCustomDarkDataPath + dtStart.ToString("yyyyMMdd_HHmmss") + "\\" + t.ToString("F3") + "_" + j.ToString() + ".bin");
                }
//                 yByteArray = wfSapGUI.ReadPicDatas(m_Buffers, 1);
//                 SystemParam.CreateBINFile(yByteArray, SystemParam.TxtCustomDarkDataPath + dtStart.ToString("yyyyMMdd_HHmmss") + "\\" + t.ToString("F3") + "_1.bin");
//                 yByteArray = wfSapGUI.ReadPicDatas(m_Buffers, 2);
//                 SystemParam.CreateBINFile(yByteArray, SystemParam.TxtCustomDarkDataPath + dtStart.ToString("yyyyMMdd_HHmmss") + "\\" + t.ToString("F3") + "_2.bin");
                ya = wfSapGUI.ReadPicDatas(m_Buffers, PicN);
                //yb = wfSapGUI.ReadPicDatas(m_Buffers, 2);
                Calc1.TestExposureTime1(ya, m_Buffers.Height, m_Buffers.Width, SystemParam.cmosInfo.PixelDepth, out y, out d);
                this.Invoke((EventHandler)(delegate
                {
                    chart1.Series[0].Points.AddXY(t, y);
                    chart1.Series[1].Points.AddXY(t, d);
                    waitProc.SetProcessBar((int)(i + 1));
                }));
                TextLog.AddTextLog(String.Format(SystemParam.TxtCustomDarkDataFormat, t.ToString("F3"), y.ToString("F6"), d.ToString("F6")), fileName, false);
            }
        }