示例#1
0
        //kiem tra ethernet qua cong UART
        public bool excuteUart()
        {
            bool ret = false;
            var  prop_imagesensorresult = testingInfo.GetType().GetProperty("imageSensorResult");

            prop_imagesensorresult.SetValue(testingInfo, "Waiting...");
            try {
                if (!camera.IsConnected())
                {
                    goto END;
                }
                //get logsytem
                var    prop_logsystem = testingInfo.GetType().GetProperty("logSystem");
                string log_value      = (string)prop_logsystem.GetValue(testingInfo);

                int count = 0;
RE:
                count++;
                string data = camera.getImageSensorInterface();
                log_value += data;
                prop_logsystem.SetValue(testingInfo, log_value);

                bool r = data.ToUpper().Contains(std_value.ToUpper());
                if (!r)
                {
                    if (count < retry_time)
                    {
                        goto RE;
                    }
                }

                ret = r;
            }
            catch { goto END; }

END:
            prop_imagesensorresult.SetValue(testingInfo, ret ? "Passed" : "Failed");
            return(ret);
        }