示例#1
0
        /// <summary>
        /// This is a blocking call that doesn't finish until the requested pattern is confirmed to be displayed.
        /// </summary>
        /// <param name="p"> The pattern to be displayed and confirmed. </param>
        protected override void ShowPattern(TrueTestPattern p)
        {
            if (p == null)
            {
                return;
            }

            // Check that the pattern is the appropriate type for the DI to send.
            if (!p.Pattern.GetType().Equals(typeof(SimplePattern)))
            {
                return;
            }

            AckRecieved = false;
            SimplePattern pattern        = (SimplePattern)p.Pattern;
            string        PatternNumber  = pattern.ImageNumber.ToString();
            List <string> PacketDataList = new List <string>()
            {
                PatternNumber
            };
            PacketSerial PatternPacket = new PacketSerial(SerialCommand.ShowPattern, PacketDataList);

            PatternPacket.Send(this);

            if (!WaitForAck())
            {
                // Fixture timed out changing the pattern
                WriteToLog("Fixture did not send the Pattern Ready (PR) command after TrueTest requested pattern #" + PatternNumber + ".");
                TrueTest.SequenceStop(); // Cancel sequence
            }
        }
示例#2
0
        void TrueTest__AnalysisComplete(object sender, string e)
        {
            var mode = ObjectRepository.ReadWriteEnum.ReadOnlyNoWait;
            var ea   = ObjectRepository.GetItem(e, ref mode) as AnalysisCompleteEventArgs;

            if (ea != null)
            {
                string s = ea.Results.Count > 0 ? ea.Results[0].Name + "= " + ea.Results[0].Value.ToString() : "";
                MessageBox.Show("Analysis Complete: " + ea.AnalysisUserName + Environment.NewLine + s + Environment.NewLine + ea.PassFail.ToString());

                if (ea.PassFail == TrueTest.AnalysisResultEnum.Fail)
                {
                    // cancel the rest of the sequence
                    TrueTest.SequenceStop();
                }
            }
        }