Exemplo n.º 1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            if (RegistSoftware.CheckRegeditInfo(1))
            {
                tsBtnInspectSetting.Enabled = false;
                tsBtnSysSetting.Enabled     = false;
                tsBtnComSetting.Enabled     = false;
                tbOkCount.Text = Convert.ToString(controler.okCount);
                tbNgCount.Text = Convert.ToString(controler.ngCount);
                if (controler.okCount + controler.ngCount == 0)
                {
                    tbOkRate.Text = "0%";
                }
                else
                {
                    tbOkRate.Text = Math.Round(controler.okCount * 100.0 / (controler.okCount + controler.ngCount), 2) + "%";
                }
                s_Result result;
                result = controler.loadConfig();
                if (result.iResultCode != 0)
                {
                    MessageBox.Show(result.strResultInfo);
                    return;
                }

                result = controler.InvLoad(Common.ivsPath);
                if (result.iResultCode != 0)
                {
                    MessageBox.Show(result.strResultInfo);
                    tsBtnLogin.Enabled    = false;
                    btnStarOrStop.Enabled = false;
                    return;
                }
                controler.ConnectEngine(WindowImage, "imgA");

                controler.visionSystem.VarSetBool("bSetShutter", true);
                //bool b;
                //controler.visionSystem.VarGetBool("bSetShutter",out b);
                //Console.WriteLine("======== b ========= " + b);
            }
            else
            {
                tableLayoutPanel1.Enabled = false;

                tsBtnInspectSetting.Enabled = false;
                tsBtnSysSetting.Enabled     = false;
                tsBtnComSetting.Enabled     = false;
                tsBtnLogin.Enabled          = false;
                tsBtnUpdatePwd.Enabled      = false;
                tsBtnExit.Enabled           = false;
                MessageBox.Show("软件未授权,请尽快联系厂商!");
            }
        }
Exemplo n.º 2
0
 private void InspectSetting_Load(object sender, EventArgs e)
 {
     controler.ConnectEngine(imageWindow, "imgA");
     btnStop.Enabled = false;
 }