Ejemplo n.º 1
0
        //kiem tra ethernet qua cong UART
        public bool excuteUart()
        {
            bool ret = false;
            var  prop_ethernetresult = testingInfo.GetType().GetProperty("ethernetResult");

            prop_ethernetresult.SetValue(testingInfo, "Waiting...");

            //get logsytem
            var    prop_logsystem = testingInfo.GetType().GetProperty("logSystem");
            string log_value      = (string)prop_logsystem.GetValue(testingInfo);

            try {
                if (!camera.IsConnected())
                {
                    goto END;
                }
                int count = 0;
RE:
                count++;
                string data = camera.getEthernetState();
                log_value += data;
                prop_logsystem.SetValue(testingInfo, log_value);

                if (data != null)
                {
                    ret = data.ToUpper().Contains(std_value.ToUpper());
                }
                if (!ret)
                {
                    if (count < retry_time)
                    {
                        goto RE;
                    }
                }
            }
            catch (Exception ex) {
                log_value += ex.ToString();
                prop_logsystem.SetValue(testingInfo, log_value);
                goto END;
            }

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