Exemple #1
0
        public bool ConnectToDevice(out string result)
        {
            result = "";

            bool qa401Ok = false, qa450Ok = false;

            if (Qa401.IsConnected() == true)
            {
                qa401Ok = true;
            }
            else
            {
                qa401Ok = Qa401.ConnectToDevice(out result);
            }

            if (qa401Ok)
            {
                if (Qa401.GetVersion() >= Constants.RequiredQa401Version)
                {
                    // Version OK
                }
                else
                {
                    qa401Ok = false;
                    result += "The QA401 application version was not current. Must be >= " + Constants.RequiredQa401Version.ToString("0.00") + ". ";
                }
            }
            else
            {
                result += "Unable to connect to the QA401. ";
            }

            qa450Ok = Qa450.IsConnected();

            if (qa450Ok)
            {
                if (Qa450.GetVersion() >= Constants.RequiredQa450Version)
                {
                    // Version OK
                }
                else
                {
                    qa450Ok = false;
                    result += "The QA450 application version was not current. Must be >= " + Constants.RequiredQa450Version.ToString("0.00") + ". ";
                }
            }
            else
            {
                qa450Ok = false;
                result += "Unable to connect to the QA450. ";
            }

            if (qa401Ok && qa450Ok)
            {
                return(true);
            }

            result += "The testing will now stop. ";
            return(false);
        }