示例#1
0
        public override Task <RFmxNRAcpResults> NRFetchAcpResults(RFmxResultQuery request, ServerCallContext context)
        {
            var instr      = sessionMap[(IntPtr)request.Session.Handle];
            var nr         = GetNRSignalConfiguration(instr, request.SignalName);
            var acpResults = RFmxNR.FetchAcp(nr, request.SelectorString);
            var response   = new RFmxNRAcpResults();

            foreach (var componentCarrierResult in acpResults.ComponentCarrierResults)
            {
                response.ComponentCarrierResults.Add(new RFmxNRAcpComponentCarrierResults()
                {
                    AbsolutePowerDBm = componentCarrierResult.AbsolutePower_dBm,
                    RelativePowerDB  = componentCarrierResult.RelativePower_dB
                });
            }
            foreach (var offsetResult in acpResults.OffsetResults)
            {
                response.OffsetResults.Add(new RFmxNRAcpOffsetResults()
                {
                    FrequencyHz            = offsetResult.Frequency_Hz,
                    IntegrationBandwidthHz = offsetResult.IntegrationBandwidth_Hz,
                    LowerAbsolutePowerDBm  = offsetResult.LowerAbsolutePower_dBm,
                    LowerRelativePowerDB   = offsetResult.LowerRelativePower_dB,
                    UpperAbsolutePowerDBm  = offsetResult.UpperAbsolutePower_dBm,
                    UpperRelativePowerDB   = offsetResult.UpperRelativePower_dB
                });
            }
            return(Task.FromResult(response));
        }