Exemplo n.º 1
0
        public TestSetMessage BuildJson(Jumper jumper, MAP200 testSet)
        {
            var postMessage = new TestSetMessage();

            postMessage.Header.TestSetModel               = testSet.Model;
            postMessage.Header.TestSetName                = testSet.SerialNumber;
            postMessage.Header.Location                   = testSet.Location;
            postMessage.Header.OperId                     = testSet.OperId;
            postMessage.Body["serialNumber"]              = jumper.SerialNumber;
            postMessage.Body["InsertionLoss1550SCA"]      = jumper.Results.InsertionLoss1550SCA.ToString();
            postMessage.Body["InsertionLossLimit1550SCA"] = jumper.Limits.InsertionLossLimit1550SCA.ToString();
            postMessage.Body["ReturnLoss1550SCA"]         = jumper.Results.ReturnLoss1550SCA.ToString();
            postMessage.Body["ReturnLossLimit1550SCA"]    = jumper.Limits.ReturnLossLimit1550SCA.ToString();
            postMessage.Body["InsertionLoss1550UNC"]      = jumper.Results.InsertionLoss1550UNC.ToString();
            postMessage.Body["InsertionLossLimit1550UNC"] = jumper.Limits.InsertionLossLimit1550UNC.ToString();
            postMessage.Body["ReturnLoss1550UNC"]         = jumper.Results.ReturnLoss1550UNC.ToString();
            postMessage.Body["ReturnLossLimit1550UNC"]    = jumper.Limits.ReturnLossLimit1550UNC.ToString();
            postMessage.Body["LengthInMeters"]            = jumper.Results.LengthInMeters.ToString();
            postMessage.Body["LengthUpperLimit"]          = jumper.Limits.LengthUpperLimitInMeters.ToString();
            postMessage.Body["LengthLowerLimit"]          = jumper.Limits.LengthLowerLimitInMeters.ToString();

            return(postMessage);
        }
Exemplo n.º 2
0
 public PCT(Jumper Jumper)
 {
     this.Jumper = Jumper;
 }
Exemplo n.º 3
0
        public OperationResult RunTest(Jumper Jumper)
        {
            var testOp = new OperationResult();

            ///For testing
            //Jumper.results.InsertionLoss1550SCA = 0.15;
            //Jumper.results.ReturnLoss1550SCA = 70;
            //Jumper.results.LengthInMeters = 9;
            //return true;
            ///----------------------

            this.Jumper = this.Jumper ?? Jumper;

            if (pctConnection.Initialized)
            {
            }
            else
            {
                Initialize();
            }

            AssignInterfaces();

            if (isReadyToTest)
            {
                try
                {
                    ISetup.Type = MAP200_PCTMeasurementTypeEnum.MAP200_PCTMeasurementTypeDUT;
                    IMeas.Initiate();

                    do
                    {
                        Thread.Sleep(100);
                    } while (IMeas.State == MAP200_PCTMeasurementStateEnum.MAP200_PCTMeasurementState_Busy);

                    string msg = ISystem.GetWarning();
                    if (!msg.Equals("No Warning"))
                    {
                        logger.Debug(msg);
                    }

                    Jumper.Results.InsertionLoss1550SCA = IMeas.GetIL();
                    Jumper.Results.ReturnLoss1550SCA    = IMeas.GetORL(Method: ReturnLossMethod, Origin: ReturnLossOrigin, Aoffset: Aoffset, Boffset: Boffset);
                    Jumper.Results.LengthInMeters       = IMeas.GetLength();
                    testOp.Success = true;
                }
                catch (Exception ex)
                {
                    //jumper.postMessage.Response.Message = ex.Message;
                    testOp.Success = false;
                    testOp.ErrorMessages.Add(ex.Message);
                }
                finally
                {
                    closeConnection();
                }
            }
            else
            {
                //Jumper.postMessage.Response.Message = "PCT not ready to test";
                testOp.ErrorMessages.Add("PCT not ready to test");
                testOp.Success = false;
            }

            return(testOp);
        }