예제 #1
0
        public override bool Init(HardWareInfoBase infoHardWare)
        {
            GoogolTechExtCardInfo googoTechMCInfo = infoHardWare as GoogolTechExtCardInfo;

            //   Global.logger.InfoFormat("初始化固高拓展卡,卡名称{0}", googoTechMCInfo.hardwareName);
            usCardNo = (short)googoTechMCInfo.iCardNo;
            usExtNo  = (short)googoTechMCInfo.iExtCardNo;
            short sRtn = 0;

            sRtn = gts.mc.GT_OpenExtMdl((short)usCardNo, googoTechMCInfo.m_strExtDllName);
            if (!HandleErrorMessage(sRtn))
            {
                //    Global.logger.ErrorFormat("初始化固高拓展卡{0}失败", googoTechMCInfo.hardwareName);
                bInitOK = false;
                return(false);
            }
            //sRtn = gts.mc.GT_Stop(0xFF, 0);

            sRtn = gts.mc.GT_ResetExtMdl((short)usCardNo);
            sRtn = gts.mc.GT_LoadExtConfig((short)usCardNo, googoTechMCInfo.m_strConfigPath);
            //sRtn = gts.mc.GT_ClrSts((short)usCardNo, 1, 8);//清除轴报警和限位
            bInitOK = true;

            System.Threading.Thread threadScan = new System.Threading.Thread(ScanThreadFunction);
            threadScan.IsBackground = true;
            threadScan.Start();
            return(true);
        }
예제 #2
0
 public GoogolTechExtCardInfoForm(GoogolTechExtCardInfo Info)
 {
     InitializeComponent();
     hardInfo = Info;
 }
예제 #3
0
 static public void InitHardWare()
 {
     hardwardDictionary = new Dictionary <string, HardWareBase>();
     foreach (KeyValuePair <string, HardWareInfoBase> item in hardDoc.m_HardWareDictionary)
     {
         #region Demo
         if (item.Value.hardwareVender == HardWardVender.Demo)
         {
             if (item.Value.hardwareTpye == HardWardType.InputCard)
             {
                 DemoInputCard demoCard = new DemoInputCard();
                 demoCard.hardwareName   = item.Value.hardwareName;
                 demoCard.hardwareVender = item.Value.hardwareVender;
                 demoCard.hardwareTpye   = item.Value.hardwareTpye;
                 hardwardDictionary.Add(demoCard.hardwareName, demoCard);
             }
             if (item.Value.hardwareTpye == HardWardType.InputOutputCard)
             {
                 DemoInputOutputCard demoCard = new DemoInputOutputCard();
                 demoCard.hardwareName   = item.Value.hardwareName;
                 demoCard.hardwareVender = item.Value.hardwareVender;
                 demoCard.hardwareTpye   = item.Value.hardwareTpye;
                 hardwardDictionary.Add(demoCard.hardwareName, demoCard);
             }
             if (item.Value.hardwareTpye == HardWardType.MotionCard)
             {
                 DemoMCard demoCard = new DemoMCard();
                 demoCard.hardwareName   = item.Value.hardwareName;
                 demoCard.hardwareVender = item.Value.hardwareVender;
                 demoCard.hardwareTpye   = item.Value.hardwareTpye;
                 hardwardDictionary.Add(demoCard.hardwareName, demoCard);
             }
             if (item.Value.hardwareTpye == HardWardType.OutputCard)
             {
                 DemoOutputCard demoCard = new DemoOutputCard();
                 demoCard.hardwareName   = item.Value.hardwareName;
                 demoCard.hardwareVender = item.Value.hardwareVender;
                 demoCard.hardwareTpye   = item.Value.hardwareTpye;
                 hardwardDictionary.Add(demoCard.hardwareName, demoCard);
             }
         }
         #endregion
         #region LEISAI
         if (item.Value.hardwareVender == HardWardVender.LEADTECH)
         {
             if (item.Value.hardwareTpye == HardWardType.InputCard)
             {
                 LEISAIInputCard demoCard = new LEISAIInputCard();
                 demoCard.hardwareName   = item.Value.hardwareName;
                 demoCard.hardwareVender = item.Value.hardwareVender;
                 demoCard.hardwareTpye   = item.Value.hardwareTpye;
                 hardwardDictionary.Add(demoCard.hardwareName, demoCard);
             }
             if (item.Value.hardwareTpye == HardWardType.InputOutputCard)
             {
                 LEISAIInputOutputCard demoCard = new LEISAIInputOutputCard();
                 demoCard.hardwareName   = item.Value.hardwareName;
                 demoCard.hardwareVender = item.Value.hardwareVender;
                 demoCard.hardwareTpye   = item.Value.hardwareTpye;
                 hardwardDictionary.Add(demoCard.hardwareName, demoCard);
             }
             if (item.Value.hardwareTpye == HardWardType.MotionCard)
             {
                 LEISAIMCard demoCard = new LEISAIMCard();
                 demoCard.hardwareName   = item.Value.hardwareName;
                 demoCard.hardwareVender = item.Value.hardwareVender;
                 demoCard.hardwareTpye   = item.Value.hardwareTpye;
                 HardWareInfoBase tempInfo       = item.Value;
                 LEISAIMCInfo     tempInfoLEISAI = (LEISAIMCInfo)tempInfo;
                 demoCard.usCardNo = (ushort)tempInfoLEISAI.iCardNo;
                 hardwardDictionary.Add(demoCard.hardwareName, demoCard);
             }
             if (item.Value.hardwareTpye == HardWardType.OutputCard)
             {
                 LEISAIOutputCard demoCard = new LEISAIOutputCard();
                 demoCard.hardwareName   = item.Value.hardwareName;
                 demoCard.hardwareVender = item.Value.hardwareVender;
                 demoCard.hardwareTpye   = item.Value.hardwareTpye;
                 hardwardDictionary.Add(demoCard.hardwareName, demoCard);
             }
         }
         #endregion
         #region GOOGOL
         if (item.Value.hardwareVender == HardWardVender.GOOGOL)
         {
             if (item.Value.hardwareTpye == HardWardType.MotionCard)
             {
                 GoogoTechMCard demoCard = new GoogoTechMCard();
                 demoCard.hardwareName   = item.Value.hardwareName;
                 demoCard.hardwareVender = item.Value.hardwareVender;
                 demoCard.hardwareTpye   = item.Value.hardwareTpye;
                 HardWareInfoBase tempInfo       = item.Value;
                 GoogoTechMCInfo  tempInfoLEISAI = (GoogoTechMCInfo)tempInfo;
                 demoCard.usCardNo = (short)tempInfoLEISAI.iCardNo;
                 hardwardDictionary.Add(demoCard.hardwareName, demoCard);
             }
             if (item.Value.hardwareTpye == HardWardType.ExpansionModule)
             {
                 GoogolTechExtCard demoCard = new GoogolTechExtCard();
                 demoCard.hardwareName   = item.Value.hardwareName;
                 demoCard.hardwareVender = item.Value.hardwareVender;
                 demoCard.hardwareTpye   = item.Value.hardwareTpye;
                 HardWareInfoBase      tempInfo       = item.Value;
                 GoogolTechExtCardInfo tempInfoGoogol = (GoogolTechExtCardInfo)tempInfo;
                 demoCard.usCardNo = (short)tempInfoGoogol.iCardNo;
                 demoCard.usExtNo  = (short)tempInfoGoogol.iExtCardNo;
                 hardwardDictionary.Add(demoCard.hardwareName, demoCard);
             }
         }
         #endregion
         #region ADVANCE
         if (item.Value.hardwareVender == HardWardVender.ADVANTECH)
         {
             if (item.Value.hardwareTpye == HardWardType.InputCard)
             {
                 AdvanceInputCard demoCard = new AdvanceInputCard();
                 demoCard.hardwareName   = item.Value.hardwareName;
                 demoCard.hardwareVender = item.Value.hardwareVender;
                 demoCard.hardwareTpye   = item.Value.hardwareTpye;
                 hardwardDictionary.Add(demoCard.hardwareName, demoCard);
             }
             if (item.Value.hardwareTpye == HardWardType.OutputCard)
             {
                 AdvanceOutputCard demoCard = new AdvanceOutputCard();
                 demoCard.hardwareName   = item.Value.hardwareName;
                 demoCard.hardwareVender = item.Value.hardwareVender;
                 demoCard.hardwareTpye   = item.Value.hardwareTpye;
                 hardwardDictionary.Add(demoCard.hardwareName, demoCard);
             }
         }
         #endregion
         #region ADLINK
         if (item.Value.hardwareVender == HardWardVender.ADLINK)
         {
             if (item.Value.hardwareTpye == HardWardType.MotionCard)
             {
                 ADLINKMotionCard demoCard = new ADLINKMotionCard();
                 demoCard.hardwareName   = item.Value.hardwareName;
                 demoCard.hardwareVender = item.Value.hardwareVender;
                 demoCard.hardwareTpye   = item.Value.hardwareTpye;
                 demoCard.hardwareModel  = item.Value.hardwareModel;
                 hardwardDictionary.Add(demoCard.hardwareName, demoCard);
             }
             if (item.Value.hardwareTpye == HardWardType.InputOutputCard)
             {
                 ADLINKInputOuputCard demoCard = new ADLINKInputOuputCard();
                 demoCard.hardwareName   = item.Value.hardwareName;
                 demoCard.hardwareVender = item.Value.hardwareVender;
                 demoCard.hardwareTpye   = item.Value.hardwareTpye;
                 demoCard.hardwareModel  = item.Value.hardwareModel;
                 hardwardDictionary.Add(demoCard.hardwareName, demoCard);
             }
             if (item.Value.hardwareTpye == HardWardType.InputCard)
             {
                 ADLINKInputCard demoCard = new ADLINKInputCard();
                 demoCard.hardwareName   = item.Value.hardwareName;
                 demoCard.hardwareVender = item.Value.hardwareVender;
                 demoCard.hardwareTpye   = item.Value.hardwareTpye;
                 demoCard.hardwareModel  = item.Value.hardwareModel;
                 hardwardDictionary.Add(demoCard.hardwareName, demoCard);
             }
         }
         #endregion
         #region Softservo
         if (item.Value.hardwareVender == HardWardVender.SOFTSERVO)
         {
             if (item.Value.hardwareTpye == HardWardType.MotionCard)
             {
                 SoftservoControler demoCard = new SoftservoControler();
                 demoCard.hardwareName   = item.Value.hardwareName;
                 demoCard.hardwareVender = item.Value.hardwareVender;
                 demoCard.hardwareTpye   = item.Value.hardwareTpye;
                 hardwardDictionary.Add(demoCard.hardwareName, demoCard);
             }
         }
         #endregion
         #region Beckhoff
         if (item.Value.hardwareVender == HardWardVender.BECKHOFF)
         {
             if (item.Value.hardwareTpye == HardWardType.MotionCard)
             {
                 BeckhoffADS demoCard = new BeckhoffADS();
                 demoCard.hardwareName   = item.Value.hardwareName;
                 demoCard.hardwareVender = item.Value.hardwareVender;
                 demoCard.hardwareTpye   = item.Value.hardwareTpye;
                 hardwardDictionary.Add(demoCard.hardwareName, demoCard);
             }
         }
         #endregion
     }
     foreach (KeyValuePair <string, HardWareBase> item in hardwardDictionary)
     {
         item.Value.Init(hardDoc.m_HardWareDictionary[item.Key]);
     }
 }
예제 #4
0
 private void buttonAdd_Click(object sender, EventArgs e)
 {
     if (textBoxHardWareName.Text == "")
     {
         return;
     }
     try
     {
         #region Demo
         if ((HardWardVender)comboBoxVender.SelectedItem == HardWardVender.Demo)
         {
             if ((HardWardType)comboBoxType.SelectedItem == HardWardType.InputCard)
             {
                 DemoInputInfo demoInputInfo = new DemoInputInfo();
                 demoInputInfo.hardwareName   = textBoxHardWareName.Text;
                 demoInputInfo.hardwareVender = (HardWardVender)comboBoxVender.SelectedItem;
                 demoInputInfo.hardwareTpye   = (HardWardType)comboBoxType.SelectedItem;
                 HardwareManage.hardDoc.m_HardWareDictionary.Add(demoInputInfo.hardwareName, demoInputInfo);
                 HardwareManage.hardDoc.m_HardWareList.Add(demoInputInfo);
                 ListViewItem lvi = listViewNFHardWare.Items.Add(demoInputInfo.hardwareName);
                 lvi.SubItems.Add(demoInputInfo.hardwareVender.ToString());
                 lvi.SubItems.Add(demoInputInfo.hardwareTpye.ToString());
             }
             if ((HardWardType)comboBoxType.SelectedItem == HardWardType.InputOutputCard)
             {
                 DemoInputOutputInfo demoInfo = new DemoInputOutputInfo();
                 demoInfo.hardwareName   = textBoxHardWareName.Text;
                 demoInfo.hardwareVender = (HardWardVender)comboBoxVender.SelectedItem;
                 demoInfo.hardwareTpye   = (HardWardType)comboBoxType.SelectedItem;
                 HardwareManage.hardDoc.m_HardWareDictionary.Add(demoInfo.hardwareName, demoInfo);
                 HardwareManage.hardDoc.m_HardWareList.Add(demoInfo);
                 ListViewItem lvi = listViewNFHardWare.Items.Add(demoInfo.hardwareName);
                 lvi.SubItems.Add(demoInfo.hardwareVender.ToString());
                 lvi.SubItems.Add(demoInfo.hardwareTpye.ToString());
             }
             if ((HardWardType)comboBoxType.SelectedItem == HardWardType.MotionCard)
             {
                 DemoMCInfo demoInfo = new DemoMCInfo();
                 demoInfo.hardwareName   = textBoxHardWareName.Text;
                 demoInfo.hardwareVender = (HardWardVender)comboBoxVender.SelectedItem;
                 demoInfo.hardwareTpye   = (HardWardType)comboBoxType.SelectedItem;
                 HardwareManage.hardDoc.m_HardWareDictionary.Add(demoInfo.hardwareName, demoInfo);
                 HardwareManage.hardDoc.m_HardWareList.Add(demoInfo);
                 ListViewItem lvi = listViewNFHardWare.Items.Add(demoInfo.hardwareName);
                 lvi.SubItems.Add(demoInfo.hardwareVender.ToString());
                 lvi.SubItems.Add(demoInfo.hardwareTpye.ToString());
             }
             if ((HardWardType)comboBoxType.SelectedItem == HardWardType.OutputCard)
             {
                 DemoOutputInfo demoInfo = new DemoOutputInfo();
                 demoInfo.hardwareName   = textBoxHardWareName.Text;
                 demoInfo.hardwareVender = (HardWardVender)comboBoxVender.SelectedItem;
                 demoInfo.hardwareTpye   = (HardWardType)comboBoxType.SelectedItem;
                 HardwareManage.hardDoc.m_HardWareDictionary.Add(demoInfo.hardwareName, demoInfo);
                 HardwareManage.hardDoc.m_HardWareList.Add(demoInfo);
                 ListViewItem lvi = listViewNFHardWare.Items.Add(demoInfo.hardwareName);
                 lvi.SubItems.Add(demoInfo.hardwareVender.ToString());
                 lvi.SubItems.Add(demoInfo.hardwareTpye.ToString());
             }
         }
         #endregion
         #region LEISAI
         if ((HardWardVender)comboBoxVender.SelectedItem == HardWardVender.LEADTECH)
         {
             if ((HardWardType)comboBoxType.SelectedItem == HardWardType.InputCard)
             {
                 LEISAIInputInfo demoInputInfo = new LEISAIInputInfo();
                 demoInputInfo.hardwareName   = textBoxHardWareName.Text;
                 demoInputInfo.hardwareVender = (HardWardVender)comboBoxVender.SelectedItem;
                 demoInputInfo.hardwareTpye   = (HardWardType)comboBoxType.SelectedItem;
                 HardwareManage.hardDoc.m_HardWareDictionary.Add(demoInputInfo.hardwareName, demoInputInfo);
                 HardwareManage.hardDoc.m_HardWareList.Add(demoInputInfo);
                 ListViewItem lvi = listViewNFHardWare.Items.Add(demoInputInfo.hardwareName);
                 lvi.SubItems.Add(demoInputInfo.hardwareVender.ToString());
                 lvi.SubItems.Add(demoInputInfo.hardwareTpye.ToString());
             }
             if ((HardWardType)comboBoxType.SelectedItem == HardWardType.InputOutputCard)
             {
                 LEISAIInputOutputInfo demoInfo = new LEISAIInputOutputInfo();
                 demoInfo.hardwareName   = textBoxHardWareName.Text;
                 demoInfo.hardwareVender = (HardWardVender)comboBoxVender.SelectedItem;
                 demoInfo.hardwareTpye   = (HardWardType)comboBoxType.SelectedItem;
                 HardwareManage.hardDoc.m_HardWareDictionary.Add(demoInfo.hardwareName, demoInfo);
                 HardwareManage.hardDoc.m_HardWareList.Add(demoInfo);
                 ListViewItem lvi = listViewNFHardWare.Items.Add(demoInfo.hardwareName);
                 lvi.SubItems.Add(demoInfo.hardwareVender.ToString());
                 lvi.SubItems.Add(demoInfo.hardwareTpye.ToString());
             }
             if ((HardWardType)comboBoxType.SelectedItem == HardWardType.MotionCard)
             {
                 LEISAIMCInfo demoInfo = new LEISAIMCInfo();
                 demoInfo.hardwareName   = textBoxHardWareName.Text;
                 demoInfo.hardwareVender = (HardWardVender)comboBoxVender.SelectedItem;
                 demoInfo.hardwareTpye   = (HardWardType)comboBoxType.SelectedItem;
                 HardwareManage.hardDoc.m_HardWareDictionary.Add(demoInfo.hardwareName, demoInfo);
                 HardwareManage.hardDoc.m_HardWareList.Add(demoInfo);
                 ListViewItem lvi = listViewNFHardWare.Items.Add(demoInfo.hardwareName);
                 lvi.SubItems.Add(demoInfo.hardwareVender.ToString());
                 lvi.SubItems.Add(demoInfo.hardwareTpye.ToString());
             }
             if ((HardWardType)comboBoxType.SelectedItem == HardWardType.OutputCard)
             {
                 LEISAIOutputInfo demoInfo = new LEISAIOutputInfo();
                 demoInfo.hardwareName   = textBoxHardWareName.Text;
                 demoInfo.hardwareVender = (HardWardVender)comboBoxVender.SelectedItem;
                 demoInfo.hardwareTpye   = (HardWardType)comboBoxType.SelectedItem;
                 HardwareManage.hardDoc.m_HardWareDictionary.Add(demoInfo.hardwareName, demoInfo);
                 HardwareManage.hardDoc.m_HardWareList.Add(demoInfo);
                 ListViewItem lvi = listViewNFHardWare.Items.Add(demoInfo.hardwareName);
                 lvi.SubItems.Add(demoInfo.hardwareVender.ToString());
                 lvi.SubItems.Add(demoInfo.hardwareTpye.ToString());
             }
         }
         #endregion
         #region GOOGOL
         if ((HardWardVender)comboBoxVender.SelectedItem == HardWardVender.GOOGOL)
         {
             if ((HardWardType)comboBoxType.SelectedItem == HardWardType.MotionCard)
             {
                 GoogoTechMCInfo demoInfo = new GoogoTechMCInfo();
                 demoInfo.hardwareName   = textBoxHardWareName.Text;
                 demoInfo.hardwareVender = (HardWardVender)comboBoxVender.SelectedItem;
                 demoInfo.hardwareTpye   = (HardWardType)comboBoxType.SelectedItem;
                 HardwareManage.hardDoc.m_HardWareDictionary.Add(demoInfo.hardwareName, demoInfo);
                 HardwareManage.hardDoc.m_HardWareList.Add(demoInfo);
                 ListViewItem lvi = listViewNFHardWare.Items.Add(demoInfo.hardwareName);
                 lvi.SubItems.Add(demoInfo.hardwareVender.ToString());
                 lvi.SubItems.Add(demoInfo.hardwareTpye.ToString());
             }
             if ((HardWardType)comboBoxType.SelectedItem == HardWardType.ExpansionModule)
             {
                 GoogolTechExtCardInfo demoInfo = new GoogolTechExtCardInfo();
                 demoInfo.hardwareName   = textBoxHardWareName.Text;
                 demoInfo.hardwareVender = (HardWardVender)comboBoxVender.SelectedItem;
                 demoInfo.hardwareTpye   = (HardWardType)comboBoxType.SelectedItem;
                 HardwareManage.hardDoc.m_HardWareDictionary.Add(demoInfo.hardwareName, demoInfo);
                 HardwareManage.hardDoc.m_HardWareList.Add(demoInfo);
                 ListViewItem lvi = listViewNFHardWare.Items.Add(demoInfo.hardwareName);
                 lvi.SubItems.Add(demoInfo.hardwareVender.ToString());
                 lvi.SubItems.Add(demoInfo.hardwareTpye.ToString());
             }
         }
         #endregion
         #region ADVANCE
         if ((HardWardVender)comboBoxVender.SelectedItem == HardWardVender.ADVANTECH)
         {
             if ((HardWardType)comboBoxType.SelectedItem == HardWardType.InputCard)
             {
                 AdvanceInputInfo demoInputInfo = new AdvanceInputInfo();
                 demoInputInfo.hardwareName   = textBoxHardWareName.Text;
                 demoInputInfo.hardwareVender = (HardWardVender)comboBoxVender.SelectedItem;
                 demoInputInfo.hardwareTpye   = (HardWardType)comboBoxType.SelectedItem;
                 HardwareManage.hardDoc.m_HardWareDictionary.Add(demoInputInfo.hardwareName, demoInputInfo);
                 HardwareManage.hardDoc.m_HardWareList.Add(demoInputInfo);
                 ListViewItem lvi = listViewNFHardWare.Items.Add(demoInputInfo.hardwareName);
                 lvi.SubItems.Add(demoInputInfo.hardwareVender.ToString());
                 lvi.SubItems.Add(demoInputInfo.hardwareTpye.ToString());
             }
             if ((HardWardType)comboBoxType.SelectedItem == HardWardType.OutputCard)
             {
                 AdvanceOutputInfo demoInfo = new AdvanceOutputInfo();
                 demoInfo.hardwareName   = textBoxHardWareName.Text;
                 demoInfo.hardwareVender = (HardWardVender)comboBoxVender.SelectedItem;
                 demoInfo.hardwareTpye   = (HardWardType)comboBoxType.SelectedItem;
                 HardwareManage.hardDoc.m_HardWareDictionary.Add(demoInfo.hardwareName, demoInfo);
                 HardwareManage.hardDoc.m_HardWareList.Add(demoInfo);
                 ListViewItem lvi = listViewNFHardWare.Items.Add(demoInfo.hardwareName);
                 lvi.SubItems.Add(demoInfo.hardwareVender.ToString());
                 lvi.SubItems.Add(demoInfo.hardwareTpye.ToString());
             }
         }
         #endregion
         #region ADLINK
         if ((HardWardVender)comboBoxVender.SelectedItem == HardWardVender.ADLINK)
         {
             if ((HardWardType)comboBoxType.SelectedItem == HardWardType.MotionCard)
             {
                 ADLINKTechMCInfo demoInputInfo = new ADLINKTechMCInfo();
                 demoInputInfo.hardwareName   = textBoxHardWareName.Text;
                 demoInputInfo.hardwareVender = (HardWardVender)comboBoxVender.SelectedItem;
                 demoInputInfo.hardwareTpye   = (HardWardType)comboBoxType.SelectedItem;
                 HardwareManage.hardDoc.m_HardWareDictionary.Add(demoInputInfo.hardwareName, demoInputInfo);
                 HardwareManage.hardDoc.m_HardWareList.Add(demoInputInfo);
                 ListViewItem lvi = listViewNFHardWare.Items.Add(demoInputInfo.hardwareName);
                 lvi.SubItems.Add(demoInputInfo.hardwareVender.ToString());
                 lvi.SubItems.Add(demoInputInfo.hardwareTpye.ToString());
             }
             if ((HardWardType)comboBoxType.SelectedItem == HardWardType.InputOutputCard)
             {
                 ADLINKInputOutputInfo demoInputInfo = new ADLINKInputOutputInfo();
                 demoInputInfo.hardwareName   = textBoxHardWareName.Text;
                 demoInputInfo.hardwareVender = (HardWardVender)comboBoxVender.SelectedItem;
                 demoInputInfo.hardwareTpye   = (HardWardType)comboBoxType.SelectedItem;
                 HardwareManage.hardDoc.m_HardWareDictionary.Add(demoInputInfo.hardwareName, demoInputInfo);
                 HardwareManage.hardDoc.m_HardWareList.Add(demoInputInfo);
                 ListViewItem lvi = listViewNFHardWare.Items.Add(demoInputInfo.hardwareName);
                 lvi.SubItems.Add(demoInputInfo.hardwareVender.ToString());
                 lvi.SubItems.Add(demoInputInfo.hardwareTpye.ToString());
             }
             if ((HardWardType)comboBoxType.SelectedItem == HardWardType.InputCard)
             {
                 ADLINKInputInfo demoInputInfo = new ADLINKInputInfo();
                 demoInputInfo.hardwareName   = textBoxHardWareName.Text;
                 demoInputInfo.hardwareVender = (HardWardVender)comboBoxVender.SelectedItem;
                 demoInputInfo.hardwareTpye   = (HardWardType)comboBoxType.SelectedItem;
                 HardwareManage.hardDoc.m_HardWareDictionary.Add(demoInputInfo.hardwareName, demoInputInfo);
                 HardwareManage.hardDoc.m_HardWareList.Add(demoInputInfo);
                 ListViewItem lvi = listViewNFHardWare.Items.Add(demoInputInfo.hardwareName);
                 lvi.SubItems.Add(demoInputInfo.hardwareVender.ToString());
                 lvi.SubItems.Add(demoInputInfo.hardwareTpye.ToString());
             }
         }
         #endregion
         #region Softservo
         if ((HardWardVender)comboBoxVender.SelectedItem == HardWardVender.SOFTSERVO)
         {
             if ((HardWardType)comboBoxType.SelectedItem == HardWardType.MotionCard)
             {
                 SoftservoControlerInfo demoInputInfo = new SoftservoControlerInfo();
                 demoInputInfo.hardwareName   = textBoxHardWareName.Text;
                 demoInputInfo.hardwareVender = (HardWardVender)comboBoxVender.SelectedItem;
                 demoInputInfo.hardwareTpye   = (HardWardType)comboBoxType.SelectedItem;
                 HardwareManage.hardDoc.m_HardWareDictionary.Add(demoInputInfo.hardwareName, demoInputInfo);
                 HardwareManage.hardDoc.m_HardWareList.Add(demoInputInfo);
                 ListViewItem lvi = listViewNFHardWare.Items.Add(demoInputInfo.hardwareName);
                 lvi.SubItems.Add(demoInputInfo.hardwareVender.ToString());
                 lvi.SubItems.Add(demoInputInfo.hardwareTpye.ToString());
             }
         }
         if ((HardWardVender)comboBoxVender.SelectedItem == HardWardVender.BECKHOFF)
         {
             if ((HardWardType)comboBoxType.SelectedItem == HardWardType.MotionCard)
             {
                 BeckhoffADSInfo demoInputInfo = new BeckhoffADSInfo();
                 demoInputInfo.hardwareName   = textBoxHardWareName.Text;
                 demoInputInfo.hardwareVender = (HardWardVender)comboBoxVender.SelectedItem;
                 demoInputInfo.hardwareTpye   = (HardWardType)comboBoxType.SelectedItem;
                 HardwareManage.hardDoc.m_HardWareDictionary.Add(demoInputInfo.hardwareName, demoInputInfo);
                 HardwareManage.hardDoc.m_HardWareList.Add(demoInputInfo);
                 ListViewItem lvi = listViewNFHardWare.Items.Add(demoInputInfo.hardwareName);
                 lvi.SubItems.Add(demoInputInfo.hardwareVender.ToString());
                 lvi.SubItems.Add(demoInputInfo.hardwareTpye.ToString());
             }
         }
         #endregion
     }
     catch
     {
     }
 }