Exemple #1
0
        public override void addPoints(MeasureQueueElement measureQueueElement)
        {
            int bin = (int)measureQueueElement.gatePacket.head.bin;
            int id  = (int)measureQueueElement.gatePacket.head.id;

            if (id == (int)PacketId.eventId && bin == (int)DAQ_EVENT.STOP_EVENT)
            {
                if (scanModeIndex == (int)ScanMode.Bscan)
                {
                    bscanSeries.clear();
                    //if (bscanCofig.IsSave)
                    //binarySerialize.SetializeClose();
                }
                else
                {
                    cscanSeries.clear();
                    //if (cscanCofig.IsSave)
                    //binarySerialize.SetializeClose();
                }
                return;
            }
            if (id == (int)PacketId.eventId && bin == (int)DAQ_EVENT.START_EVENT)
            {
                ;
            }



            updateCscan(measureQueueElement);
            updateBscan(measureQueueElement);
        }
Exemple #2
0
        private void updateCscan(MeasureQueueElement measureQueueElement)
        {
            int boardIndex = measureQueueElement.boardIndex;
            int id         = (int)measureQueueElement.gatePacket.head.id;
            int bin        = (int)measureQueueElement.gatePacket.head.bin;

            if (boardIndex == cscanCofig.AscanIndex && id == cscanCofig.SelectGate && bin == (int)DAQ_MEAS_MODE.AMP_PERCENT)
            {
                GatePacket gatePacket = measureQueueElement.gatePacket;
                cscanSeries.add(gatePacket);
                cscanSeries.updatePicture();
                showAscan(measureQueueElement);
                if (cscanCofig.IsSave)
                {
                    binarySerialize.SerializeWrite(gatePacket);
                }
            }
        }
Exemple #3
0
        private void updateBscan(MeasureQueueElement measureQueueElement)
        {
            int boardIndex = measureQueueElement.boardIndex;
            int id         = (int)measureQueueElement.gatePacket.head.id;
            int bin        = (int)measureQueueElement.gatePacket.head.bin;

            if (boardIndex == bscanCofig.AscanIndex && id == (int)PacketId.BGate && bin == (int)DAQ_MEAS_MODE.GATEIN_DATA)
            {
                GatePacket gatePacket = measureQueueElement.gatePacket;
                bscanSeries.add(gatePacket, bscanCofig.Range);
                bscanSeries.updatePicture();
                //showAscan(measureQueueElement);
                if (bscanCofig.IsSave)
                {
                    binarySerialize.SerializeWrite(gatePacket);
                }
            }
        }
Exemple #4
0
        private void showAscan(MeasureQueueElement measureQueueElement)
        {
            int num = ConstParameter.BscanPointNumPrePacket;//256点

            float[] measureDate         = measureQueueElement.gatePacket.measureDate;
            float   measureDateMax      = measureDate.Max();
            int     measureDateMaxIndex = Array.IndexOf(measureDate, measureDateMax);

            int k = measureDateMaxIndex / num; //第k条Bscan数据的

            k = k * num;
            double delay = gateDelay;
            double width = gateRange;
            double yStep = width / (num - 1);//Divide width into (ConstParameter.BscanPointNumPrePacket - 1) part.

            for (int i = 0; i < num; i++)
            {
                ascanDataX[i] = measureDate[k + i];
                ascanDataY[i] = delay + yStep * i;
            }

            AscanLine.Add(ascanDataX, ascanDataY);
        }
Exemple #5
0
        public override void addPoints(MeasureQueueElement measureQueueElement)
        {
            if (measureQueueElement == null)
            {
                return;
            }

            int    boardIndex = measureQueueElement.boardIndex;
            int    id         = (int)measureQueueElement.gatePacket.head.id;
            int    bin        = (int)measureQueueElement.gatePacket.head.bin;
            int    port       = (int)measureQueueElement.gatePacket.head.port;
            Source source;
            double tmpMaxValue;

            switch (id)
            {
            case (int)PacketId.none:
                source = Source.Error;
                break;

            case (int)PacketId.IGate:
                source = Source.GateI;
                break;

            case (int)PacketId.AGate:
                source = Source.GateA;
                break;

            case (int)PacketId.BGate:
                source = Source.GateB;
                break;

            case (int)PacketId.CGate:
                source = Source.GateC;
                break;

            default:
                source = Source.Error;
                break;
            }

            if (id == (int)PacketId.eventId)
            {
                if (bin == (int)DAQ_EVENT.START_EVENT)
                {
                    timer.Enabled = true;
                    timer.Start();
                    motiontimer.Enabled = true;
                    motiontimer.Start();
                    maxPosValue = 0;
                    this.clearViews();
                    this.Invoke(new Action(() =>
                    {      //在主线程上执行委托,目的函数为updateScroll()
                        initScroll();
                    }));
                    Thread.Sleep(10);
                }
                else if (bin == (int)DAQ_EVENT.STOP_EVENT)
                {
                    timer.Enabled = false;
                    timer.Stop();
                    motiontimer.Enabled = false;
                    motiontimer.Stop();
                    //startCalibrateButton.Enabled = true;
                }
                else
                {
                    //doing nothing
                }
            }

            if (source == Source.Error)
            {
                return;
            }

            foreach (calibStripColumn stripColumn in stripColumnList)
            {
                if ((bin == (int)DAQ_MEAS_MODE.TOF_PEAK || bin == (int)DAQ_MEAS_MODE.AMP_PERCENT) && stripColumn.isMatched(port))
                {
                    tmpMaxValue = stripColumn.add(measureQueueElement.gatePacket, boardIndex);
                    if (tmpMaxValue > maxPosValue)
                    {
                        maxPosValue = tmpMaxValue;
                        //updateAxes(maxPosValue);
                    }
                }
            }

            foreach (calibTofdColumn tofdColumn in tofdColumnList)  //tofdColumn is nearly the same as stripColumn, use TOF_PEAK and AMP_PERCENT
            {
                if ((bin == (int)DAQ_MEAS_MODE.TOF_PEAK || bin == (int)DAQ_MEAS_MODE.AMP_PERCENT) && tofdColumn.isMatched(port))
                {
                    tmpMaxValue = tofdColumn.add(measureQueueElement.gatePacket, boardIndex);
                    if (tmpMaxValue > maxPosValue)
                    {
                        maxPosValue = tmpMaxValue;
                        //updateAxes(maxPosValue);
                    }
                }
            }
        }