コード例 #1
0
        private void initReceiveEnable()
        {
            int            error_code;
            ReceiverActive active = ReceiverActive.OFF;

            error_code = GetRecieverDAQ.Active(SelectAscan.sessionIndex, SelectAscan.port, ref active);
            if (error_code != 0)
            {
                return;
            }

            switch (active)
            {
            case ReceiverActive.OFF:
                rdoOFF.Checked = true;
                break;

            case ReceiverActive.ON:
                rdoON.Checked = true;
                break;

            default:
                MessageShow.show("Error:Initial receive anable failed!",
                                 "错误:初始化接收使能失败!");
                break;
            }
        }
コード例 #2
0
        private void initReceiverPath()
        {
            int          error_code;
            ReceiverPATH receiverPATH = ReceiverPATH.Normal;

            error_code = GetRecieverDAQ.ReceiverPATH(SelectAscan.sessionIndex, SelectAscan.port, ref receiverPATH);
            if (error_code != 0)
            {
                return;
            }

            switch (receiverPATH)
            {
            case ReceiverPATH.Normal:
                rdoNormal.Checked = true;
                break;

            case ReceiverPATH.Hvsense:
                rdoTransmitVoltageAcquisition.Checked = true;
                break;

            case ReceiverPATH.Testin:
                rdoTestInput.Checked = true;
                break;

            default:
                MessageShow.show("Error:Initial receiver path failed!",
                                 "错误:初始化接收路径失败!");
                break;
            }
        }
コード例 #3
0
        private void initDigitalFilter()
        {
            int error_code;
            FilterCutoffFreq digitalHPF = FilterCutoffFreq.FilterPassAway;
            FilterCutoffFreq digitalLPF = FilterCutoffFreq.FilterPassAway;

            error_code = GetRecieverDAQ.DigitalHPF(SelectAscan.sessionIndex, SelectAscan.port, ref digitalHPF);
            if (error_code != 0)
            {
                return;
            }

            error_code = GetRecieverDAQ.DigitalLPF(SelectAscan.sessionIndex, SelectAscan.port, ref digitalLPF);
            if (error_code != 0)
            {
                return;
            }

            cboDHPF.SelectedIndex = (int)digitalHPF;
            cboDLPF.SelectedIndex = (int)digitalLPF;
        }
コード例 #4
0
        private void initAnologFilter()
        {
            int error_code;
            FilterCutoffFreq analogHPF = FilterCutoffFreq.FilterPassAway;
            FilterCutoffFreq analogLPF = FilterCutoffFreq.FilterPassAway;

            error_code = GetRecieverDAQ.AnalogHPF(SelectAscan.sessionIndex, SelectAscan.port, ref analogHPF);
            if (error_code != 0)
            {
                return;
            }

            error_code = GetRecieverDAQ.AnalogLPF(SelectAscan.sessionIndex, SelectAscan.port, ref analogLPF);
            if (error_code != 0)
            {
                return;
            }

            cboAHPF.SelectedIndex = (int)analogHPF;
            cboALPF.SelectedIndex = (int)analogLPF;
        }
コード例 #5
0
        private void initImpedanceMatch()
        {
            int           error_code;
            uint          dampingValue  = 0;
            DampingActive dampingActive = DampingActive.OFF;

            error_code = GetRecieverDAQ.DampingActive(SelectAscan.sessionIndex, SelectAscan.port, ref dampingActive);
            if (error_code != 0)
            {
                return;
            }

            error_code = GetRecieverDAQ.DampingValue(SelectAscan.sessionIndex, SelectAscan.port, ref dampingValue);
            if (error_code != 0)
            {
                return;
            }

            switch (dampingActive)
            {
            case DampingActive.OFF:
                textBoxImpedance.Enabled  = false;
                chkImpedanceMatch.Checked = false;
                break;

            case DampingActive.ON:
                textBoxImpedance.Enabled  = true;
                chkImpedanceMatch.Checked = true;
                break;

            default:
                MessageShow.show("Error:Initial impedance match failed!",
                                 "错误:初始化匹配阻抗失败!");
                break;
            }

            textBoxImpedance.Text = dampingValue.ToString();
        }
コード例 #6
0
        //使得筛选的通道和当前显示通道所有参数变得一样
        public static int Param(uint sessionIndex, uint selPort)
        {
            int    error_code                  = 0;
            bool   isSetPre                    = false;
            double delay                       = 0;
            double range                       = 0;
            double gain                        = 0;
            uint   envlopDecay                 = 0;
            AscanWaveDectionMode waveMode      = AscanWaveDectionMode.SemiPositve;
            RecieverType         type          = RecieverType.Pc;
            AscanEnvelopActive   envelopActive = AscanEnvelopActive.OFF;

            int     gateTol = 4;
            TofMode tofMode = TofMode.Flank;

            TofMode[]               tofModeArr      = new TofMode[gateTol];
            GateAlarmLogic[]        gateAlarmLogic  = new GateAlarmLogic[gateTol];
            GateAlarmActive[]       gateAlarmActive = new GateAlarmActive[gateTol];
            double[]                gateDelay       = new double[gateTol];
            double[]                gateWidth       = new double[gateTol];
            double[]                threshold       = new double[gateTol];
            SuppressCounterActive[] scActive        = new SuppressCounterActive[gateTol];
            uint[] scCount = new uint[gateTol];

            IFActive      ifActive      = IFActive.OFF;
            AscanIFActive ascanIfActive = AscanIFActive.OFF;

            //取得当前通道的所有参数
            error_code  = GetAsacnVideoDAQ.Delay(sessionIndex, selPort, ref delay);
            error_code |= GetAsacnVideoDAQ.Range(sessionIndex, selPort, ref range);
            error_code |= GetAsacnVideoDAQ.Range(sessionIndex, selPort, ref range);
            error_code |= GetRecieverDAQ.AnalogGain(sessionIndex, selPort, ref gain);
            error_code |= GetAsacnVideoDAQ.EnvlopDecayFactor(sessionIndex, selPort, ref envlopDecay);
            error_code |= GetAsacnVideoDAQ.DetectionWaveMode(sessionIndex, selPort, ref waveMode);
            error_code |= GetPulserTransmitDAQ.RecieverMode(sessionIndex, selPort, ref type);
            error_code |= GetAsacnVideoDAQ.EnvlopActive(sessionIndex, selPort, ref envelopActive);
            error_code |= GetGateDAQ.IFActive(sessionIndex, selPort, GateType.I, ref ifActive);
            error_code |= GetAsacnVideoDAQ.IFActive(sessionIndex, selPort, ref ascanIfActive);

            for (int i = 0; i < gateTol; i++)
            {
                GateType gateIndex = (GateType)i;
                error_code |= GetGateDAQ.TofMode(sessionIndex, selPort, gateIndex, ref tofModeArr[i]);
                error_code |= GetGateDAQ.AlarmLogic(sessionIndex, selPort, gateIndex, ref gateAlarmLogic[i]);
                error_code |= GetGateDAQ.AlarmActive(sessionIndex, selPort, gateIndex, ref gateAlarmActive[i]);
                error_code |= GetGateDAQ.Delay(sessionIndex, selPort, gateIndex, ref gateDelay[i]);
                error_code |= GetGateDAQ.Width(sessionIndex, selPort, gateIndex, ref gateWidth[i]);
                error_code |= GetGateDAQ.Threshold(sessionIndex, selPort, gateIndex, ref threshold[i]);
                error_code |= GetGateDAQ.ScActive(sessionIndex, selPort, gateIndex, ref scActive[i]);
                error_code |= GetGateDAQ.ScCounter(sessionIndex, selPort, gateIndex, ref scCount[i]);
            }

            if (error_code != 0)
            {
                return(error_code);
            }

            //赋值
            for (int i = 0; i < batchSessionsInfo.Count; i++)
            {
                uint port    = (uint)batchSessionsInfo[i].port;
                uint seIndex = (uint)batchSessionsInfo[i].sessionIndex;
                //第二种情况||batchSessionsInfo[i].sessionIndex != sessionIndex
                //if (batchSessionsInfo[i].sessionIndex == sessionIndex && port != selPort )//以selPort号为依据配置同一块板卡的其他虚拟通道的参数
                {
                    error_code  = SetAscanVideoDAQ.Delay(seIndex, port, delay);
                    error_code |= SetAscanVideoDAQ.Range(seIndex, port, range);
                    error_code |= SetReceiverDAQ.AnalogGain(seIndex, port, gain);
                    error_code |= SetAscanVideoDAQ.EnvlopDecayFactor(seIndex, port, envlopDecay);
                    isSetPre    = SetAscanVideoDAQ.WaveMode(seIndex, port, waveMode);
                    error_code |= SetPulserTransmitDAQ.RecieverMode(seIndex, port, type);
                    error_code |= SetAscanVideoDAQ.EnvlopActive(seIndex, port, envelopActive);

                    for (int j = 0; j < gateTol; j++)
                    {
                        GateType gateIndex = (GateType)j;
                        isSetPre   |= SetGateDAQ.setTofMode(seIndex, port, gateIndex, tofModeArr[j]);
                        error_code |= SetGateDAQ.AlarmLogic(seIndex, port, gateIndex, gateAlarmLogic[j]);
                        error_code |= SetGateDAQ.AlarmActive(seIndex, port, gateIndex, gateAlarmActive[j]);
                        error_code |= SetGateDAQ.Delay(seIndex, port, gateIndex, gateDelay[j]);
                        error_code |= SetGateDAQ.Width(seIndex, port, gateIndex, gateWidth[j]);
                        error_code |= SetGateDAQ.Threshold(seIndex, port, gateIndex, threshold[j]);
                        error_code |= SetGateDAQ.ScActive(seIndex, port, gateIndex, scActive[j]);
                        error_code |= SetGateDAQ.ScCounter(seIndex, port, gateIndex, scCount[j]);

                        if (error_code != 0)
                        {
                            return(error_code);
                        }
                    }

                    error_code |= GetGateDAQ.TofMode(seIndex, port, GateType.I, ref tofMode);
                    if (ifActive == IFActive.ON && ascanIfActive == AscanIFActive.ON)
                    {
                        if (tofMode != TofMode.Flank)
                        {
                            MessageShow.show("Warning:" + seIndex + port + "The TOF Mode GateI must select Flank mode!",
                                             "警告:" + sessionIndex + port + "门模式门I未选择Flank模式!");
                            return(error_code = -1);
                        }
                        else
                        {
                            error_code |= SetGateDAQ.iFActive(seIndex, port, GateType.I, IFActive.ON);
                            error_code |= SetAscanVideoDAQ.IFActive(seIndex, port, AscanIFActive.ON);
                        }
                    }
                    else
                    {
                        error_code |= SetGateDAQ.iFActive(seIndex, port, GateType.I, IFActive.OFF);
                        error_code |= SetAscanVideoDAQ.IFActive(seIndex, port, AscanIFActive.OFF);
                    }
                    if (error_code != 0)
                    {
                        return(error_code);
                    }
                }
            }
            return(error_code);
        }