示例#1
0
        private TestSetMessage SendResultsToPTS(Jumper jumper, MAP200 testSet)
        {
            MAP200_PTStransaction pts = new MAP200_PTStransaction();
            var json = pts.BuildJson(jumper, testSet);

            return(pts.SendUPFI(json));
        }
示例#2
0
        public OperationResult GetTestingRequired(Jumper jumper, MAP200 testSet)
        {
            var json            = BuildJson(jumper, testSet);
            var responseMessage = SendREFI(json);
            var op = new OperationResult();

            if (responseMessage.Success)
            {
                bool testingRequired = responseMessage.Body["required"].Equals("yes");

                if (testingRequired)
                {
                    jumper.AssignLimits(responseMessage);
                }
                op.Success = true;
                op.Messages.Add(testingRequired.ToString());
            }
            else
            {
                logger.Debug("---ERROR--- UP: {0} RESPONSE: {1}", json, responseMessage);
                op.Success = false;
                op.ErrorMessages.Add(responseMessage.Response.Message);
            }
            return(op);
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Map200 = new MAP200();
            Jumper = new Jumper();

            //Event fired if the connection to the MAP200 fails
            Map200.conman.MAP200ConnectionFailed += OnMAP200ConnectionFailed;
        }
示例#4
0
        public OperationResult GetTestingRequired(MAP200 testSet)
        {
            var op = new OperationResult();

            if (LossTestRequired)
            {
                op.Success = true;
            }
            else
            {
                MAP200_PTStransaction pts = new MAP200_PTStransaction();
                op = pts.GetTestingRequired(this, testSet);
                LossTestRequired = op.Messages.Any();
            }
            return(op);
        }
示例#5
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);
        }