Пример #1
0
        /// <summary>
        /// Main Test Process, Start in a new thread.
        /// </summary>
        private void testProcess()
        {
            try
            { testFunction.BridgePowerOff(); }  //try to stop the bridge if it's in use.
            catch
            { }

            try
            {
                testFunction.idacErased    = false;
                testFunction.IDACItem      = false;
                testFunction.RawCountItem  = false;
                testFunction.FWVersionItem = false;
                //power on trackpad and enter into test mode.
                testFunction.BridgePowerOn();
                System.Threading.Thread.Sleep(500);
                testFunction.ExitBootloader();
                System.Threading.Thread.Sleep(100);
                testFunction.Enter_TestMode();
                System.Threading.Thread.Sleep(100);
                // System.Threading.Thread.Sleep(1000);
                //clear text box message, show "testing".
                //testFunction.dut.ErrorCode = ErrorCode.EEROR_SYSTEM_ERROR;
                //SetTxtBoxStatus(testFunction.dut.ErrorCode);
                // FW check
                if (tpConfigTestItems.ReadFW)
                {
                    testFunction.I2C_Read_FW_Rev_Test();
                }
                testFunction.BridgePowerOff();
                testFunction.BridgePowerOn();
                System.Threading.Thread.Sleep(500);
                testFunction.ExitBootloader();
                if (checkBoxRecal.Checked & !testFunction.I2C_Check_RawCount_Value())
                {
                    testFunction.I2C_Calibrate_IDAC();
                    testFunction.BridgePowerOff();
                    testFunction.BridgePowerOn();
                    System.Threading.Thread.Sleep(500);
                    testFunction.ExitBootloader();
                    testFunction.I2C_Check_RawCount_Value();
                }


                //Position test
                SetTabControlIndex(1);
                SetTabPassFocus();

                while (testFunction.readPositionStop)
                {
                    testFunction.ReadPosition();
                    PositionPanel.Invalidate();
                }
                testFunction.BridgePowerOff();

                SetTxtBoxStatus(testFunction.dut.ErrorCode);
                if (testFunction.dut.ErrorCode == 0)
                {
                    System.Threading.Thread.Sleep(500);
                    testFunction.BridgePowerOn();
                    System.Threading.Thread.Sleep(1000);
                    testFunction.ExitBootloader();
                    // System.Threading.Thread.Sleep(1000);
                    //clear text box message, show "testing".
                    SetTxtBoxStatus(testFunction.dut.ErrorCode);

                    if (checkBoxRecal.Checked & !testFunction.I2C_Check_RawCount_Value())
                    {
                        testFunction.I2C_Calibrate_IDAC();
                        testFunction.BridgePowerOff();
                        testFunction.BridgePowerOn();
                        System.Threading.Thread.Sleep(1000);
                        testFunction.ExitBootloader();
                        testFunction.I2C_Check_RawCount_Value();
                    }
                    testFunction.BridgePowerOff();
                }

                test_running = false;   //stop test
                SetTxtBoxStatus(testFunction.dut.ErrorCode);
            }
            catch (Exception ex)
            {
                test_running = false;
                SetTxtBoxStatus(ErrorCode.EEROR_SYSTEM_ERROR);
                MessageBox.Show(ex.Message, "Error: ", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log.error(ex.Message);
                bridge.PowerOff();
                //bridge.ClosePort();
            }

            finally
            {
            }
        }
Пример #2
0
 private void trackPad_MessageChangeEvent(object sender, MessageChangeEventArgs e)
 {
     SetListBoxStatus(e.Message);
     PositionPanel.Invalidate();
 }