public DataTable GetAllCellsStatData(SimulationResult result) { DataTable table = new DataTable(); table.Columns.Add(SimulationResource.SIMULATION_SITE); table.Columns.Add(SimulationResource.SIMULATION_TRANSCEIVER); table.Columns.Add(SimulationResource.SIMULATION_CELL); table.Columns.Add(SimulationResource.SIMULATION_TX_POWER, typeof(float)); table.Columns.Add(SimulationResource.SIMULATION_UL_IOT_DB, typeof(float)); table.Columns.Add(SimulationResource.SIMULATION_UL_LOAD, typeof(float)); table.Columns.Add(SimulationResource.SIMULATION_UL_AVG_USERD_RB_NUM, typeof(float)); table.Columns.Add(SimulationResource.SIMULATION_DL_LOAD, typeof(float)); table.Columns.Add(SimulationResource.SIMULATION_DL_AVG_USERD_RB_NUM, typeof(float)); table.Columns.Add(SimulationResource.SIMULATION_UL_THROUGHPUT_KBPS, typeof(float)); table.Columns.Add(SimulationResource.SIMULATION_UL_APP_THROUGHPUT_KBPS, typeof(float)); table.Columns.Add(SimulationResource.SIMULATION_DL_THROUGHPUT_KBPS, typeof(float)); table.Columns.Add(SimulationResource.SIMULATION_DL_APP_THROUGHPUT_KBPS, typeof(float)); table.Columns.Add(SimulationResource.SIMULATION_SERVICE_USER, typeof(int)); table.Columns.Add(SimulationResource.SIMULATION_CALL_DROPED_USER, typeof(int)); List<int> snapshotIndexs = result.GetSnapshotIndexs(); int count = snapshotIndexs.Count; if (count > 0) { CarrierStatData data2; List<StaSimuSiteResult> statSimuSiteResultList = result.GetSnapShotStatData(snapshotIndexs[0], this.m_OtherSubSysInterface).StatSimuSiteResultList; Dictionary<string, CarrierStatData> dictionary = new Dictionary<string, CarrierStatData>(); foreach (StaSimuSiteResult result2 in statSimuSiteResultList) { foreach (StatSimuCarrierResult result3 in result2.StatSimuCarrierResultList) { data2 = new CarrierStatData(); data2.Carrier = result3.CarrierName; dictionary.Add(result3.CarrierName, data2); } } foreach (int num2 in snapshotIndexs) { SnapShotStatData snapShotStatData = result.GetSnapShotStatData(num2, this.m_OtherSubSysInterface); foreach (StaSimuSiteResult result2 in snapShotStatData.StatSimuSiteResultList) { foreach (StatSimuCarrierResult result3 in result2.StatSimuCarrierResultList) { dictionary.TryGetValue(result3.CarrierName, out data2); data2.Site = result2.SiteName; data2.Cell = result3.CellName; data2.Carrier = result3.CarrierName; data2.TXPower += result3.TxPower; data2.ULIot += result3.UlIoT; data2.UlAvgUsedRbNum += result3.UlAvgUsedRbNum; data2.DlAvgUsedRbNum += result3.DlAvgUsedRbNum; data2.ULLoad += result3.UlAvgLoad; data2.DLLoad += result3.DlAvgLoad; data2.ULThroughPut += result3.UlAvgThroughput; data2.ULAppThroughPut += result3.UlAppAvgThroughput; data2.DLThroughPut += result3.DlAvgThroughput; data2.DLAppThroughPut += result3.DlAppAvgThroughput; data2.ServiceUser += result3.SatisfiedUserNum; data2.CallDropedUser += result3.OfflineUserNum; } } } foreach (KeyValuePair<string, CarrierStatData> pair in dictionary) { List<object> list3 = new List<object>(); data2 = pair.Value; list3.Add(data2.Site); list3.Add(data2.Cell); list3.Add(data2.Carrier); list3.Add(data2.TXPower / ((float) count)); list3.Add(data2.ULIot / ((float) count)); list3.Add(data2.ULLoad / ((float) count)); list3.Add(data2.UlAvgUsedRbNum / ((float) count)); list3.Add(data2.DLLoad / ((float) count)); list3.Add(data2.DlAvgUsedRbNum / ((float) count)); list3.Add(data2.ULThroughPut / ((float) count)); list3.Add(data2.ULAppThroughPut / ((float) count)); list3.Add(data2.DLThroughPut / ((float) count)); list3.Add(data2.DLAppThroughPut / ((float) count)); list3.Add(data2.ServiceUser / count); list3.Add(data2.CallDropedUser / count); table.Rows.Add(list3.ToArray()); } dictionary.Clear(); dictionary = null; } return table; }
public DataTable GetAllSitesStatData(SimulationResult result) { List<string> serviceNameList = this.GetServiceNameList(result); DataTable dt = new DataTable(); dt.Columns.Add(SimulationResource.SIMULATION_SITE, typeof(string)); dt.Columns.Add(SimulationResource.SIMULATION_TOTAL_THROUGHPUT_UL, typeof(float)); dt.Columns.Add(SimulationResource.SIMULATION_TOTAL_APP_THROUGHPUT_UL, typeof(float)); dt.Columns.Add(SimulationResource.SIMULATION_TOTAL_THROUGHPUT_DL, typeof(float)); dt.Columns.Add(SimulationResource.SIMULATION_TOTAL_APP_THROUGHPUT_DL, typeof(float)); foreach (string str in serviceNameList) { dt.Columns.Add(str + SimulationResource.SIMULATION_UL_KBPS, typeof(float)); dt.Columns.Add(str + SimulationResource.SIMULATION_UL_APP_KBPS, typeof(float)); dt.Columns.Add(str + SimulationResource.SIMULATION_DL_KBPS, typeof(float)); dt.Columns.Add(str + SimulationResource.SIMULATION_DL_APP_KBPS, typeof(float)); } List<int> snapshotIndexs = result.GetSnapshotIndexs(); int count = snapshotIndexs.Count; if (count > 0) { int oneRowDataLength = (serviceNameList.Count * 4) + 5; Dictionary<string, float[]> statDataDic = this.GetSiteDataDic(result, snapshotIndexs, oneRowDataLength); this.CalculateTotalData(result, serviceNameList, snapshotIndexs, statDataDic); CalculateAvgData(dt, count, statDataDic); statDataDic.Clear(); statDataDic = null; } return dt; }