Exemplo n.º 1
0
        //需要确定
        //public static int AlarmMode(uint ascanNum, uint ascanPort, GateType type, GateAlarmActive active)
        //{
        //    int error_code;
        //    int gateNum = (int)type;
        //    uint attr = DaqAttrType.dGate[gateNum].AlarmActive;
        //    uint val = 0;

        //    if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
        //    {
        //        error_code = -1;
        //        return error_code;
        //    }

        //    if (type < gateTypeMin || type > gateTypeMax)
        //    {
        //        error_code = -1;
        //        return error_code;
        //    }

        //    error_code = DAQ.daqSet(ascanNum, ascanPort, attr, ref val);
        //    if (error_code != (int)PDAQ_ERR.GOOD)
        //    {
        //        MessageShow.show("Error:Get alarm active double gate failed!", "错误:获得门的报警使能失败!");
        //    }
        //    active = (GateAlarmActive)val;
        //    return error_code;
        //}

        public static int AlarmSignalLength(uint ascanNum, uint ascanPort, DGateType type, GateAlarmSignalLength length)
        {
            int  error_code;
            int  gateNum = (int)type;
            uint attr    = DaqAttrType.dGate[gateNum].AlarmSignalLength;
            uint val     = (uint)length;

            if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
            {
                error_code = -1;
                return(error_code);
            }

            if (type < gateTypeMin || type > gateTypeMax)
            {
                error_code = -1;
                return(error_code);
            }

            error_code = DAQ.daqSet(ascanNum, ascanPort, attr, val);
            if (error_code != (int)PDAQ_ERR.GOOD)
            {
                MessageShow.show("Error:Set alarm singal length of double gate failed!", "错误:设置门的报警信号长度失败!");
            }

            return(error_code);
        }
Exemplo n.º 2
0
        public static int AlarmActive(uint ascanNum, uint ascanPort, DGateType type, GateAlarmActive active)
        {
            int  error_code;
            int  gateNum = (int)type;
            uint attr    = DaqAttrType.dGate[gateNum].AlarmActive;
            uint val     = (uint)active;

            if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
            {
                error_code = -1;
                return(error_code);
            }

            if (type < gateTypeMin || type > gateTypeMax)
            {
                error_code = -1;
                return(error_code);
            }

            error_code = DAQ.daqSet(ascanNum, ascanPort, attr, val);
            if (error_code != (int)PDAQ_ERR.GOOD)
            {
                MessageShow.show("Error:Get alarm active of double gate failed!", "错误:获得门的报警使能失败!");
            }

            return(error_code);
        }
Exemplo n.º 3
0
        public static int TolMonitorActive(uint ascanNum, uint ascanPort, DGateType type, TMActive active)
        {
            int  error_code;
            int  gateNum = (int)type;
            uint attr    = DaqAttrType.dGate[gateNum].TolMonitorActive;
            uint val     = (uint)active;

            if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
            {
                error_code = -1;
                return(error_code);
            }

            if (type < gateTypeMin || type > gateTypeMax)
            {
                error_code = -1;
                return(error_code);
            }

            error_code = DAQ.daqSet(ascanNum, ascanPort, attr, val);
            if (error_code != (int)PDAQ_ERR.GOOD)
            {
                MessageShow.show("Error:Set tolerance monitor active of double gate failed!", "错误:设置门的容限误差使能失败!");
            }
            return(error_code);
        }
Exemplo n.º 4
0
        public static int TolMonitorSc(uint ascanNum, uint ascanPort, DGateType type, ref uint tolMonitorSc)
        {
            int  error_code;
            int  gateNum = (int)type;
            uint attr    = DaqAttrType.dGate[gateNum].TolMonitorSc;
            uint val     = 0;

            if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
            {
                error_code = -1;
                return(error_code);
            }

            if (type < gateTypeMin || type > gateTypeMax)
            {
                error_code = -1;
                return(error_code);
            }

            error_code = DAQ.daqGet(ascanNum, ascanPort, attr, ref val);
            if (error_code != (int)PDAQ_ERR.GOOD)
            {
                MessageShow.show("Error:Get tolerance monitor suppresser count of double gate failed!", "错误:获得门的容限误差计数失败!");
            }
            tolMonitorSc = val;
            return(error_code);
        }
Exemplo n.º 5
0
        public static int MeasActive(uint ascanNum, uint ascanPort, DGateType type, MeasActive active)
        {
            int  error_code;
            int  gateNum = (int)type;
            uint attr    = DaqAttrType.dGate[gateNum].MeasActive;
            uint val     = 0;

            if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
            {
                error_code = -1;
                return(error_code);
            }

            if (type < gateTypeMin || type > gateTypeMax)
            {
                error_code = -1;
                return(error_code);
            }

            error_code = DAQ.daqGet(ascanNum, ascanPort, attr, ref val);
            if (error_code != (int)PDAQ_ERR.GOOD)
            {
                MessageShow.show("Error:Get measurement active of double gate failed!", "错误:获得门的测量使能失败!");
            }
            active = (MeasActive)val;
            return(error_code);
        }
Exemplo n.º 6
0
        public static int MeasMode(uint ascanNum, uint ascanPort, DGateType type, MeasMode mode)
        {
            int  error_code;
            int  gateNum = (int)type;
            uint attr    = DaqAttrType.dGate[gateNum].MeasMode;
            uint val     = (uint)mode;

            if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
            {
                error_code = -1;
                return(error_code);
            }

            if (type < gateTypeMin || type > gateTypeMax)
            {
                error_code = -1;
                return(error_code);
            }

            error_code = DAQ.daqSet(ascanNum, ascanPort, attr, val);
            if (error_code != (int)PDAQ_ERR.GOOD)
            {
                MessageShow.show("Error:Set measurement mode of double gate failed!", "错误:设置门的测量模式失败!");
            }

            return(error_code);
        }
Exemplo n.º 7
0
        public static int AlarmLevel(uint ascanNum, uint ascanPort, DGateType type, GateAlarmLevel level)
        {
            int  error_code;
            int  gateNum = (int)type;
            uint attr    = DaqAttrType.dGate[gateNum].AlarmLevel;
            uint val     = 0;

            if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
            {
                error_code = -1;
                return(error_code);
            }

            if (type < gateTypeMin || type > gateTypeMax)
            {
                error_code = -1;
                return(error_code);
            }

            error_code = DAQ.daqSet(ascanNum, ascanPort, attr, val);
            if (error_code != (int)PDAQ_ERR.GOOD)
            {
                MessageShow.show("Error:Set alarm level of double gate failed!", "错误:设置门的报警等级失败!");
            }
            level = (GateAlarmLevel)val;
            return(error_code);
        }
Exemplo n.º 8
0
        public void getHardInfo()
        {
            int  error_code;
            uint cla_num = 0;
            uint slt_num = 0;

            error_code = DAQ.daqGet((uint)index, (uint)port, (uint)AttrbuteType.DAQ_ATTR_PCI_CLASSIC_NUMBER, ref cla_num);
            if (error_code == 0)
            {
                classicNum = cla_num;
            }
            else
            {
                classicNum = 0;
            }

            error_code = DAQ.daqGet((uint)index, (uint)port, (uint)AttrbuteType.DAQ_ATTR_PCI_SLOT_NUMBER, ref slt_num);
            if (error_code == 0)
            {
                slotNum = slt_num;
            }
            else
            {
                slotNum = 0;
            }

            if (assignedName == null)
            {
                assignedName = cla_num.ToString() + "-" + slotNum.ToString();
            }
        }
Exemplo n.º 9
0
        public static int daqRead(uint index, ref UniSetPacket setPacket)
        {
            int        error_code;
            const uint DOBLOCK = 1;

            error_code = DAQ.USCOMM_Read(index, ref setPacket, DOBLOCK);

            return(error_code);
        }
Exemplo n.º 10
0
        public static int BeamFile(uint ascanNum, uint chn, StructBeamFile structBeam)
        {
            int  error_code;
            uint attr = DaqAttrType.pA.BeamFormerFile;

            if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
            {
                error_code = -1;
                return(error_code);
            }

            error_code = DAQ.daqSet(ascanNum, chn, attr, structBeam);
            if (error_code != (int)PDAQ_ERR.GOOD)
            {
                MessageShow.show("Error:Set Beam File failed", "错误:设置Beam File失败");
            }
            return(error_code);
        }
Exemplo n.º 11
0
        public static int PeriodTimes(uint ascanNum, uint chn, uint num)
        {
            int  error_code;
            uint attr = DaqAttrType.pA.SeqPeriodTimes;

            if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
            {
                error_code = -1;
                return(error_code);
            }

            error_code = DAQ.daqSet(ascanNum, chn, attr, num);
            if (error_code != (int)PDAQ_ERR.GOOD)
            {
                MessageShow.show("Error:Set Seq Period Times failed", "错误:设置Seq Period Times失败");
            }
            return(error_code);
        }
Exemplo n.º 12
0
        public static int Active(uint ascanNum, uint ascanPort, ReceiverActive active)
        {
            int  error_code;
            uint attr = DaqAttrType.receiver.Active;
            uint val  = (uint)active;

            if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
            {
                error_code = -1;
                return(error_code);
            }

            error_code = DAQ.daqSet(ascanNum, ascanPort, attr, val);
            if (error_code != (int)PDAQ_ERR.GOOD)
            {
                MessageShow.show("Error:Set reciviever active failed!", "错误:设置reciviever active失败!");
            }
            return(error_code);
        }
Exemplo n.º 13
0
        public static int DampingValue(uint ascanNum, uint ascanPort, uint dampingValue)
        {
            int  error_code;
            uint attr = DaqAttrType.receiver.DampingValue;
            uint val  = (uint)dampingValue;

            if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
            {
                error_code = -1;
                return(error_code);
            }

            error_code = DAQ.daqSet(ascanNum, ascanPort, attr, val);
            if (error_code != (int)PDAQ_ERR.GOOD)
            {
                MessageShow.show("Error:Set damping value failed!", "错误:设置damping value失败!");
            }
            return(error_code);
        }
Exemplo n.º 14
0
        public static int DACFile(uint ascanNum, uint ascanPort, DACParas dacParas)
        {
            int      error_code;
            uint     attr = DaqAttrType.dac.File;
            DACParas val  = dacParas;

            if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
            {
                error_code = -1;
                return(error_code);
            }

            error_code = DAQ.daqSet(ascanNum, ascanPort, attr, val);
            if (error_code != (int)PDAQ_ERR.GOOD)
            {
                MessageShow.show("Error:Set DAC file failed", "错误:设置DAC file失败");
            }
            return(error_code);
        }
Exemplo n.º 15
0
        public static int RecieverPATH(uint ascanNum, uint ascanPort, ReceiverPATH receiverPATH)
        {
            int  error_code;
            uint attr = DaqAttrType.receiver.ReceiverPATH;
            uint val  = (uint)receiverPATH;

            if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
            {
                error_code = -1;
                return(error_code);
            }

            error_code = DAQ.daqSet(ascanNum, ascanPort, attr, val);
            if (error_code != (int)PDAQ_ERR.GOOD)
            {
                MessageShow.show("Error:Set reciever PATH failed!", "错误:设置reciever PATH失败!");
            }
            return(error_code);
        }
Exemplo n.º 16
0
        public static int Mode(uint ascanNum, uint ascanPort, DACMode mode)
        {
            int  error_code;
            uint attr = DaqAttrType.dac.Mode;
            uint val  = (uint)mode;

            if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
            {
                error_code = -1;
                return(error_code);
            }

            error_code = DAQ.daqSet(ascanNum, ascanPort, attr, val);
            if (error_code != (int)PDAQ_ERR.GOOD)
            {
                MessageShow.show("Error:Set DAC mode failed", "错误:设置DAC mode失败");
            }
            return(error_code);
        }
Exemplo n.º 17
0
        public static int Point(uint ascanNum, uint ascanPort, uint point)
        {
            int  error_code;
            uint attr = DaqAttrType.dac.Point;
            uint val  = point;

            if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
            {
                error_code = -1;
                return(error_code);
            }

            error_code = DAQ.daqSet(ascanNum, ascanPort, attr, val);
            if (error_code != (int)PDAQ_ERR.GOOD)
            {
                MessageShow.show("Error:Set DAC point failed", "错误:设置DAC point失败");
            }
            return(error_code);
        }
Exemplo n.º 18
0
        public static int DigitalLPF(uint ascanNum, uint ascanPort, FilterCutoffFreq digitalLPF)
        {
            int  error_code;
            uint attr = DaqAttrType.receiver.DigitalLPF;
            uint val  = (uint)digitalLPF;

            if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
            {
                error_code = -1;
                return(error_code);
            }

            error_code = DAQ.daqSet(ascanNum, ascanPort, attr, val);
            if (error_code != (int)PDAQ_ERR.GOOD)
            {
                MessageShow.show("Error:Set digital low pass filter failed!", "错误:设置digital low pass filter失败!");
            }
            return(error_code);
        }
Exemplo n.º 19
0
        public static int Length(uint ascanNum, uint ascanPort, AscanVideoLength length)
        {
            int  error_code;
            uint attr = DaqAttrType.ascanVideo.Length;
            uint val  = (uint)length;

            if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
            {
                error_code = -1;
                return(error_code);
            }

            error_code = DAQ.daqSet(ascanNum, ascanPort, attr, val);
            if (error_code != (int)PDAQ_ERR.GOOD)
            {
                MessageShow.show("Error:Set Ascan video length failed", "错误:设置Ascan video length失败");
            }
            return(error_code);
        }
Exemplo n.º 20
0
        public static int Transverse(uint ascanNum, uint ascanPort, double transverse)
        {
            int    error_code;
            uint   attr = DaqAttrType.matVelocity.Transverse;
            double val  = transverse;

            if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
            {
                error_code = -1;
                return(error_code);
            }

            error_code = DAQ.daqSet(ascanNum, ascanPort, attr, val);
            if (error_code != (int)PDAQ_ERR.GOOD)
            {
                MessageShow.show("Error:Set Material transverse velocity failed", "错误:设置材料横波声速失败");
            }
            return(error_code);
        }
Exemplo n.º 21
0
        public static int AnalogGain(uint ascanNum, uint ascanPort, double gain)
        {
            int    error_code;
            uint   attr = DaqAttrType.receiver.AnalogGain;
            double val  = gain;

            if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
            {
                error_code = -1;
                return(error_code);
            }

            error_code = DAQ.daqSet(ascanNum, ascanPort, attr, val);
            if (error_code != (int)PDAQ_ERR.GOOD)
            {
                MessageShow.show("Error:Set analog gain failed!", "错误:设置analog gain失败!");
            }
            return(error_code);
        }
Exemplo n.º 22
0
        public static int Intensity(uint ascanNum, uint ascanPort, double intensity)
        {
            int    error_code;
            uint   attr = DaqAttrType.pulserTranmit.Intensity;
            double val  = intensity;

            if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
            {
                error_code = -1;
                return(error_code);
            }

            error_code = DAQ.daqSet(ascanNum, ascanPort, attr, val);
            if (error_code != (int)PDAQ_ERR.GOOD)
            {
                MessageShow.show("Error:Set Pulser transmit reciviever intensity failed", "错误:设置Pulser transmit reciviever intensity失败");
            }
            return(error_code);
        }
Exemplo n.º 23
0
        private static int DetectionWaveMode(uint ascanNum, uint ascanPort, AscanWaveDectionMode mode)
        {
            int  error_code;
            uint attr = DaqAttrType.ascanVideo.DetectionWaveMode;
            uint val  = (uint)mode;

            if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
            {
                error_code = -1;
                return(error_code);
            }

            error_code = DAQ.daqSet(ascanNum, ascanPort, attr, val);
            if (error_code != (int)PDAQ_ERR.GOOD)
            {
                MessageShow.show("Error:Set the Detection wave mode of Asacn failed", "错误:设置A扫的检波失败");
            }
            return(error_code);
        }
Exemplo n.º 24
0
        public static int Range(uint ascanNum, uint ascanPort, double range)
        {
            int    error_code;
            uint   attr = DaqAttrType.ascanVideo.Range;
            double val  = range;

            if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
            {
                error_code = -1;
                return(error_code);
            }

            error_code = DAQ.daqSet(ascanNum, ascanPort, attr, val);
            if (error_code != (int)PDAQ_ERR.GOOD)
            {
                MessageShow.show("Error:Set Ascan range failed", "错误:设置Ascan range失败");
            }
            return(error_code);
        }
Exemplo n.º 25
0
        public static int IFActive(uint ascanNum, uint ascanPort, AscanIFActive active)
        {
            int  error_code;
            uint attr = DaqAttrType.ascanVideo.IFActive;
            uint val  = (uint)active;

            if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
            {
                error_code = -1;
                return(error_code);
            }

            error_code = DAQ.daqSet(ascanNum, ascanPort, attr, val);
            if (error_code != (int)PDAQ_ERR.GOOD)
            {
                MessageShow.show("Error:Set Ascan if active failed", "错误:设置Ascan if active失败");
            }
            return(error_code);
        }
Exemplo n.º 26
0
        public static int EnvlopDecayFactor(uint ascanNum, uint ascanPort, uint speed)
        {
            int  error_code;
            uint attr = DaqAttrType.ascanVideo.EnvlopDecayFactor;
            uint val  = speed;

            if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
            {
                error_code = -1;
                return(error_code);
            }

            error_code = DAQ.daqSet(ascanNum, ascanPort, attr, val);
            if (error_code != (int)PDAQ_ERR.GOOD)
            {
                MessageShow.show("Error:Set Envlop Decay Factor failed!", "错误:设置包络速度失败!");
            }
            return(error_code);
        }
Exemplo n.º 27
0
        public static int AnalogHPF(uint ascanNum, uint ascanPort, FilterCutoffFreq freq)
        {
            int  error_code;
            uint attr = DaqAttrType.receiver.AnalogHPF;
            uint val  = (uint)freq;

            if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
            {
                error_code = -1;
                return(error_code);
            }

            error_code = DAQ.daqSet(ascanNum, ascanPort, attr, val);
            if (error_code != (int)PDAQ_ERR.GOOD)
            {
                MessageShow.show("Error:Set Filter cut off frequency failed!", "错误:设置截止频率失败!");
            }
            return(error_code);
        }
Exemplo n.º 28
0
        public static int RunMode(uint ascanNum, uint ascanPort, RunMode runMode)
        {
            int  error_code;
            uint attr = DaqAttrType.globalCtrl.RunMode;
            uint val  = (uint)runMode;

            if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
            {
                error_code = -1;
                return(error_code);
            }

            error_code = DAQ.daqSet(ascanNum, ascanPort, attr, val);
            if (error_code != (int)PDAQ_ERR.GOOD)
            {
                MessageShow.show("Error:Set run mode failed", "错误:设置运行模式失败");
            }
            return(error_code);
        }
Exemplo n.º 29
0
        public static int Longitudinal(uint ascanNum, uint ascanPort, double longitudinal)
        {
            int    error_code;
            uint   attr = DaqAttrType.matVelocity.Longitudinal;
            double val  = longitudinal;

            if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
            {
                error_code = -1;
                return(error_code);
            }

            error_code = DAQ.daqSet(ascanNum, ascanPort, attr, val);
            if (error_code != (int)PDAQ_ERR.GOOD)
            {
                MessageShow.show("Error:Set Material longitudinal velocity failed", "错误:设置材料纵波声速失败");
            }
            return(error_code);
        }
Exemplo n.º 30
0
        public static int DampingActive(uint ascanNum, uint ascanPort, PulserDampingActive active)
        {
            int  error_code;
            uint attr = DaqAttrType.pulserTranmit.DampingActive;
            uint val  = (uint)active;

            if (ascanNum < ascanNumMin || ascanNum > ascanNumMax)
            {
                error_code = -1;
                return(error_code);
            }

            error_code = DAQ.daqSet(ascanNum, ascanPort, attr, val);
            if (error_code != (int)PDAQ_ERR.GOOD)
            {
                MessageShow.show("Error:Set Pulser transmit reciviever damping active failed", "错误:设置Pulser transmit reciviever damping active失败");
            }
            return(error_code);
        }