Ejemplo n.º 1
0
        /// <summary>
        /// 初始化控制卡
        /// </summary>
        /// <returns></returns>
        public s_Result InitIoCard()
        {
            s_Result result;

            try
            {
                int nCard = 0;
                nCard = IOC0640.ioc_board_init();
                if (nCard <= 0)//控制卡初始化
                {
                    result.iResultCode   = 1;
                    result.strResultInfo = "未找到IOC0640控制卡!";
                }
                else
                {
                    result.iResultCode   = 0;
                    result.strResultInfo = "控制卡初始化正常";
                }
            }
            catch (Exception ex)
            {
                result.iResultCode   = -1;
                result.strResultInfo = "控制卡初始化过程异常";
                log.LogErr(ex);
            }


            return(result);
        }
Ejemplo n.º 2
0
        public override bool Init()
        {
            IOC0640.ioc_board_close();
            m_bOpen = false;
            int nCard = 0;

            nCard = IOC0640.ioc_board_init();
            if (nCard <= 0)//控制卡初始化
            {
                logger.Warn(string.Format("{0} 号卡{1} 打开失败 请检查配置", m_nCardNo, m_strCardName));
                MessageBox.Show(string.Format("{0} 号卡{1} 打开失败 请检查配置", m_nCardNo, m_strCardName), "Err", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }
            m_bOpen = true;
            return(true);
        }
Ejemplo n.º 3
0
        private void FormMain_Load(object sender, EventArgs e)
        {
            // Enable console
//            AllocConsole();
            // this.EnableControls(false);
            UVGlue.applicationIsRunning = true;
            UVGlue.resultsThatImagesSholdBeSaved = new List<string>
                {UVGlue.resultNG, UVGlue.resultNoProduct, UVGlue.resultImageAcqFailed};

            var a = IOC0640.ioc_board_init();
            if (a > 0)
                ShowAndSaveMsg_Invoke("IO卡打开成功");
            else
                ShowAndSaveMsg_Invoke("IO卡打开失败");

            UVGlue.threadListen = new Thread(UVGlue.Listen);
            UVGlue.threadListen.Start();
            UVGlue.threadExecute = new Thread(UVGlue.ListenPos1);
            UVGlue.threadExecute.Start();
        }
Ejemplo n.º 4
0
 public static void ini()
 {
     f1.模板设置.Enabled = false;
     f1.图片.Enabled   = false;
     f1.数据日志.Enabled = false;
     f1.手动运行.Enabled = false;
     f1.登出.Enabled   = false;
     try
     {
         var a = IOC0640.ioc_board_init();
         if (a > 0)
         {
             f1.textBox2.AppendText("IO卡打开成功\r\n");
         }
     }
     catch
     {
         f1.textBox2.AppendText("IO卡打开失败\r\n");
     }
 }
Ejemplo n.º 5
0
        private void FormMain_Load(object sender, EventArgs e)
        {
            // Enable console
//            AllocConsole();
           // this.EnableControls(false);
            UVGlue.applicationIsRunning = true;
            UVGlue.resultsThatImagesSholdBeSaved = new List<string>(){UVGlue.resultNG, UVGlue.resultNoProduct};
   
            int a = IOC0640.ioc_board_init();
            if (a > 0)
            {
                ShowAndSaveMsg_Invoke("IO卡打开成功");
            }
            else
            {
                ShowAndSaveMsg_Invoke("IO卡打开失败");
            }
           
            UVGlue.threadListen = new Thread(UVGlue.Listen);
            UVGlue.threadListen.Start();
            UVGlue.threadExecute = new Thread(UVGlue.ListenPos1);
            UVGlue.threadExecute.Start();


            // store summery buttons to a list
            _chartFormButtons = new List<Button>
            {
                btnX1,
                btnX2,
                btnY1,
                btnY2,
                btnAngle
            };
            _chartFormMarshaller = new ChartFormMarshaller(this, _legends, _sigmas, _numSamples, _chartFormButtons, btnReset, _reversed);

        }
Ejemplo n.º 6
0
 public int Connect()
 {
     return(IOC0640.ioc_board_init());
 }