Example #1
0
        public void Initilazie()
        {
            if (!colorimeter.Connect())
            {
                args.StatusInfo = "No Camera";
            }

            new Action(delegate() {
                while (!flagExit)
                {
                    if (dataChange != null)
                    {
                        this.args.Colorimeter = colorimeter;
                        dataChange.Invoke(this, args);
                        //dataChange(this, args);
                    }
                    System.Threading.Thread.Sleep(100);
                }
            }).BeginInvoke(null, null);
        }
Example #2
0
        // UI related
        private void Form1_Load(object sender, EventArgs e)
        {
            this.Hide();
            m_preTabPage = Tabs.TabPages[0];

            xml = new XMLManage("XMLFile1.xml");
            xml.LoadScript();
            fixture = new Fixture("COM21");

            if (!isdemomode)
            {
                m_colorimeter = new Colorimeter();

                if (!m_colorimeter.Connect())
                {
                    MessageBox.Show("No camera.");
                    Application.Exit();
                    return;
                }
                new Action(delegate() {
                    //        fixture.Reset();
                    while (true)
                    {
                        UpdateCCDTemperature();
                        UpdateUpTime();
                        UpdateStatusBar();
                        colorimeterstatus();
                        System.Threading.Thread.Sleep(100);
                    }
                }).BeginInvoke(null, null);
            }
            else
            {
                Tabs.SelectedTab = tab_Analysis;
                MessageBox.Show("Demo Mode with no Colorimeter. Only for Analysis", "Remind");
            }

            Show();
            tbox_sn.Focus();
        }