コード例 #1
0
        private int videoMode = 0;  //0 camera test //1 标定 //2 芯片检测 //3 整体联动


        public FormChipDetection(bool isResetConfiguration)
        {
            mIsResetConfiguration = isResetConfiguration;
            InitializeComponent();                                    //控件及文本

            Parameter.GetInstance().LoadOptionFile();                 //参数option.ini(改参数在这里)
            mConfiguration = new Configuration(isResetConfiguration); //配置

            if (isResetConfiguration)                                 //用户配置
            {
                UserConfiguration.GetInstance().CreateDefualtUserConfigurationFile();
            }
            else
            {
                UserConfiguration.GetInstance().LoadUserConfigurationFile();
            }
            mChipDetection = new ChipDetection();//新的ChipDetection


            lblMark.BackColor = Color.Transparent;//是那个上面的3999
            Form.CheckForIllegalCrossThreadCalls = false;

            //显示窗口刷新
            picImage.Paint += new PaintEventHandler(PicImage_Paint);//函数PicImage_Paint
            //mExcelModalFileName = MiscFunction.GetInstance().GetAssemblyPath() + Parameter.GetInstance().ExcelFileName + ".xlsx";//EXCEL名称

            InitializeTimers(); //定时器
            UserLogin(false);   //用户登录


            m_grabThreadExited = new AutoResetEvent(false);
            CAM_connect();     //相机连接

            ResetTestStatus(); //界面参数全都初始化
        }
コード例 #2
0
        public FormChipDetection(bool isResetConfiguration)
        {
            mIsResetConfiguration = isResetConfiguration;
            InitializeComponent();

            Parameter.GetInstance().LoadOptionFile();
            mConfiguration = new Configuration(isResetConfiguration);

            if (isResetConfiguration)
            {
                UserConfiguration.GetInstance().CreateDefualtUserConfigurationFile();
            }
            else
            {
                UserConfiguration.GetInstance().LoadUserConfigurationFile();
            }
            mChipDetection = new ChipDetection();

            Parameter.GetInstance().WidthRatio  = ((double)Parameter.GetInstance().WidthPixels) / picImage.Width;
            Parameter.GetInstance().HeightRatio = ((double)Parameter.GetInstance().HeightPixels) / picImage.Height;

            lblMark.BackColor = Color.Transparent;
            Form.CheckForIllegalCrossThreadCalls = false;

            picImage.Paint += new PaintEventHandler(PicImage_Paint);

            InitializeTimers();
            //UserLogin(false);

            m_grabThreadExited = new AutoResetEvent(false);
            CAM_connect();

            //mCom_ = new SerialPort();
            //mCom_Open();

            ResetTestStatus();

            lblStatusIndicator.Text = "初始化完成";
        }