コード例 #1
0
ファイル: MainForm.cs プロジェクト: countrymarmot/Cypress
        //private void tabControlMain_SelectedIndexChanged(object sender, EventArgs e)
        //{
        //    if (tabControlMain.SelectedIndex != 2)
        //    {
        //        labelDeviceSettingStatus.Text = "";
        //    }
        //}
        private void textBoxSNA_TextChanged(object sender, EventArgs e)
        {
            if (textBoxSNA.Text.Length == SERIAL_NUMBER_LENGTH)
            {
                string serialNumber = textBoxSNA.Text;

                //Go to Produciton Mode First.
                if (toolStripMenuItemEMode.Checked)
                {
                    toolStripMenuItemEMode.CheckState = CheckState.Unchecked;
                    toolStripMenuItemPMode.CheckState = CheckState.Checked;
                }

                //Check test parameter setting
                DeviceConfig.partType = serialNumber.Substring(0, PARTNUMBER_LENGTH);
                //DeviceConfig.filePath = Application.StartupPath + "\\Production.ini";
                if (!DeviceConfig.Read())
                {
                    MessageBox.Show("Cannot find " + DeviceConfig.partType.ToString() + " in Production.ini", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Set_TextBox(textBoxMPNA, "");
                    Set_TextBox(textBoxSNA, "");
                    return;
                }

                //Check test hardware
                if (!testHardwareReady)
                {
                    MessageBox.Show("Hardware is not ready, check hardware config", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Set_TextBox(textBoxMPNA, "");
                    Set_TextBox(textBoxSNA, "");
                    //SettingLoad();
                    return;
                }

                if (!testWellARunning)
                {
                    testWellARunning = true;

                    Set_StatusBox(textBoxWellAStatus, "", Color.White);
                    Set_TextBox(textBoxMPNA, DeviceConfig.partType);
                    Set_TextBox(textBoxSNA, serialNumber.Substring(PARTNUMBER_LENGTH + 1, (SERIAL_NUMBER_LENGTH - PARTNUMBER_LENGTH-1)));
                    //SettingLoad();

                    testWellA = new TestWell(agilentDevice, mpqDevice, serialNumber);
                    Thread testThread1 = new Thread(testProcess);
                    testThread1.Start(testWellA);

                }

                else MessageBox.Show("Current Well is in testing...", "Error:", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: countrymarmot/Cypress
 //****************************************//
 //            User Interface              //
 //****************************************//
 private void Show_Test_Result(TestWell tW, bool testFinished)
 {
     //testWellARunning = !testFinished;
     int i = 0;
     foreach (TextBox tb in dutTextBoxWellA)
     {
         int errorCode = tW.DUTArray[i].ErrorCode;
         SetDUTTextBox(tb, errorCode, testFinished);
         i++;
     }
 }