Esempio n. 1
0
            public override void Define()
            {
                Calc1 calc1 = null;
                Calc2 calc2 = null;

                When()
                .Match(() => calc1)
                .Match(() => calc2, c => c.Key.Equals(calc1.Key));

                Then()
                .Yield(_ => new Calc3());
            }
Esempio n. 2
0
            public override void Define()
            {
                Calc1 calc = null;

                When()
                .Match(() => calc);

                Filter()
                .OnChange(() => calc);

                Then()
                .Yield(_ => new Calc2 {
                    Key = calc.Key
                });
            }
 public void Setup()
 {
     uut = new Calc1();
 }
Esempio n. 4
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);
            }
        }