private void Process(ConvertJob convertJob, QualityConverter qualityConverter) { if (convertJob.MergeScenarios) { var listConnectionDatas = convertJob.Files.Select(file => OpenLogFile(file.Path).ConnectionDatas).ToList(); var firstConnectionData = listConnectionDatas[0]; var links = firstConnectionData.Length; var linkData = new List <double> [links]; for (int i = 0; i < links; i++) { linkData[i] = new List <double>(); } foreach (var connectionData in listConnectionDatas) { for (int i = 0; i < links; i++) { var data = connectionData[i]; linkData[i].AddRange(qualityConverter(data.Quality)); } } for (int i = 0; i < linkData.Length; i++) { var data = linkData[i]; var tuple = CreateCleanCumulativeDistribution(data.ToArray()); var graphFactory = CreateGraphFactory(tuple, firstConnectionData[i].EndPointA, firstConnectionData[i].EndPointB); _graphQueue.Add(new GraphJob(convertJob.GetNewFullPathWithoutExtension(string.Format("{0:00}-{1:00}", firstConnectionData[i].EndPointA, firstConnectionData[i].EndPointB)) + ".png", graphFactory)); } } else { foreach (var file in convertJob.Files) { var connectionDatas = OpenLogFile(file.Path).ConnectionDatas; foreach (var connectionData in connectionDatas) { var tuple = CreateCleanCumulativeDistribution(qualityConverter(connectionData.Quality)); var graphFactory = CreateGraphFactory(tuple, connectionData.EndPointA, connectionData.EndPointB); _graphQueue.Add(new GraphJob(convertJob.GetNewFullPathWithoutExtension(string.Format("{0:00}-{1:00}", connectionData.EndPointA, connectionData.EndPointB)) + ".png", graphFactory)); } } } }
private void AbsoluteRSSI(ConvertJob convertJob) { Process(convertJob, _absoluteQualityConverter); }
private void LossRSSI(ConvertJob convertJob) { var txPower = convertJob.Files[0].dBm; Process(convertJob, array => Array.ConvertAll(array, rxPower => txPower - rxPower)); }