Ejemplo n.º 1
0
 //【重载】创建PCI1752更新输出及输出状态回读类的实例
 /// <summary>
 /// 【重载】创建PCI1752更新输出及输出状态回读类的实例
 /// </summary>
 /// <param name="TargetCard">目标PCI1752卡【窗体控件的形式】</param>
 /// <param name="DLLPassword">使用此DLL的密码</param>
 public PCI1752(ref Automation.BDaq.InstantDoCtrl TargetCard, string DLLPassword)
 {
     SuccessBuiltNew   = false;
     PasswordIsCorrect = false;
     try
     {
         TargetPCI1752Card = TargetCard;
         if (TargetPCI1752Card.Initialized == true)
         {
             NeedFormControlFlag = true;
             ReadOnlyFlag        = false;
             SuccessBuiltNew     = true;
         }
         else
         {
             MessageBox.Show("参数'TargetCard'传递的PCI1752控件初始化失败,没有选择设备或者是设备打开失败,请检查具体原因。", "错误");
             SuccessBuiltNew = false;
             return;
         }
     }
     catch (Exception ex)
     {
         SuccessBuiltNew = false;
         MessageBox.Show("创建类的实例时出现错误!\r\n" + ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
 }
Ejemplo n.º 2
0
 public MSOutController(int deviceNumber, VM_MSConfig msConfig)
 {
     if (instantDoCtrl1 == null)
     {
         instantDoCtrl1 = new InstantDoCtrl();
     }
     instantDoCtrl1.SelectedDevice = new DeviceInformation(deviceNumber);
 }
        //【重载】创建PCI1752更新输出及输出状态回读窗体类的实例
        /// <summary>
        /// 【重载】创建PCI1752更新输出及输出状态回读窗体类的实例
        /// 【软件作者:彭东南, [email protected]】
        /// </summary>
        /// <param name="TargetCard">目标PCI1752卡【窗体控件的形式】</param>
        /// <param name="DLLPassword">使用此DLL的密码</param>
        public frmPCI1752(ref Automation.BDaq.InstantDoCtrl TargetCard, string DLLPassword)
            {
            SuccessBuiltNew = false;
            PasswordIsCorrect = false;
            try
                {
                if (DLLPassword == "ThomasPeng" || (DLLPassword == "pengdongnan")
                    || (DLLPassword == "彭东南"))
                    {
                    PasswordIsCorrect = true;

                    NewPCI1752 = new PCI1752(ref TargetCard, "彭东南");
                    if (NewPCI1752.SuccessBuilt == false)
                        {
                        SuccessBuiltNew = false;
                        throw new Exception("Error: Failed to open the PCI1752 card: " + TargetCard.SelectedDevice.DeviceNumber
                            + "\r\n错误:打开PCI1752卡【 " + TargetCard.SelectedDevice.DeviceNumber + " 】 失败,请检查卡是否存在或者已经正确安装。");
                        }
                    InitializeComponent();//*********
                    if (AddCheckBoxes() == false)
                        {
                        throw new Exception("Failed to initial the controls of form.\r\n"
                            + "初始化窗体控件失败。");
                        }
                    SuccessBuiltNew = true;
                    NeedFormControlFlag = false;
                    }
                else
                    {
                    PasswordIsCorrect = false;
                    SuccessBuiltNew = false;
                    MessageBox.Show("Right Prohibited.\return\n     You don't have the given right to use this DLL library, please contact with ThomasPeng.\r\n你未得到授权的密码,无法使用此DLL进行软件开发!请与作者彭东南联系:[email protected]\r\n                                                                版权所有: 彭东南", "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                    }
                }
            catch (Exception ex)
                {
                SuccessBuiltNew = false;
                MessageBox.Show("创建类的实例时出现错误!\r\n" + ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Dispose();
                return;
                }
            }
 //【重载】创建PCI1752更新输出及输出状态回读类的实例
 /// <summary>
 /// 【重载】创建PCI1752更新输出及输出状态回读类的实例
 /// </summary>
 /// <param name="TargetCard">目标PCI1752卡【窗体控件的形式】</param>
 /// <param name="DLLPassword">使用此DLL的密码</param>
 public PCI1752(ref Automation.BDaq.InstantDoCtrl TargetCard, string DLLPassword)
     {
     SuccessBuiltNew = false;
     PasswordIsCorrect = false;
     try
         {
         if (DLLPassword == "ThomasPeng" || (DLLPassword == "pengdongnan")
             || (DLLPassword == "彭东南"))
             {
             PasswordIsCorrect = true;
             TargetPCI1752Card = TargetCard;
             if (TargetPCI1752Card.Initialized == true)
                 {
                 NeedFormControlFlag = true;
                 ReadOnlyFlag = false;
                 SuccessBuiltNew = true;
                 }
             else
                 {
                 MessageBox.Show("参数'TargetCard'传递的PCI1752控件初始化失败,没有选择设备或者是设备打开失败,请检查具体原因。","错误");
                 SuccessBuiltNew = false;
                 return;
                 }
             }
         else
             {
             PasswordIsCorrect = false;
             SuccessBuiltNew = false;
             MessageBox.Show("Right Prohibited.\return\n     You don't have the given right to use this DLL library, please contact with ThomasPeng.\r\n你未得到授权的密码,无法使用此DLL进行软件开发!请与作者彭东南联系:[email protected]\r\n                                                                版权所有: 彭东南", "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             return;
             }
         }
     catch (Exception ex)
         {
         SuccessBuiltNew = false;
         MessageBox.Show("创建类的实例时出现错误!\r\n" + ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
         }
     }
Ejemplo n.º 5
0
 public void InstantDo()
 {
     this.instantDoCtrl1 = new Automation.BDaq.InstantDoCtrl();
     this.instantDoCtrl1.SelectedDevice = new DeviceInformation(conf.deviceDescription);
 }
Ejemplo n.º 6
0
 public void InstantDo(System.ComponentModel.IContainer components)
 {
     this.instantDoCtrl1 = new Automation.BDaq.InstantDoCtrl(components);
     this.instantDoCtrl1.SelectedDevice = new DeviceInformation(conf.deviceDescription);
 }