/// <summary> /// 初始化ATU /// </summary> private void init_atu() { atu.Clear(); int i = 0; foreach(var item in m_cellInfo.cellInfo) { // 按主小区 逐批取 double r = ++i / (double)m_cellInfo.cellInfo.Count; LogHelper.instance().write("# init atu process:" + r.ToString()); string sql = @"SELECT [PROJECT_ID] ,[SECTOR_ID] ,[S_RSRP] ,[RS_SINR] ,[NCELL_ID] ,[N_PCI] ,[N_RSRP] FROM [tbATUData2] WHERE SECTOR_ID = '193544-2'"; sql = sql.Replace("193544-2", item.Key); DataTable dt = new DataTable(); DBHelper.instatnce().get_dataTable(ref dt, sql); foreach(DataRow dr in dt.Rows){ string PROJECT_ID = dr["PROJECT_ID"].ToString(); string SECTOR_ID = dr["SECTOR_ID"].ToString(); string S_RSRP = dr["S_RSRP"].ToString(); string RS_SINR = dr["RS_SINR"].ToString(); string NCELL_ID = dr["NCELL_ID"].ToString(); string N_PCI = dr["N_PCI"].ToString(); string N_RSRP = dr["N_RSRP"].ToString(); if(!atu.ContainsKey(SECTOR_ID)) { atu[SECTOR_ID] = new ATU(); } if(!atu[SECTOR_ID].nInfo.ContainsKey(NCELL_ID)) { atu[SECTOR_ID].nInfo[NCELL_ID] = new ATUMatrix(); } atu[SECTOR_ID].PROJECT_ID = int.Parse(PROJECT_ID); atu[SECTOR_ID].S_Sample_CT++; atu[SECTOR_ID].nInfo[NCELL_ID].N_Sample_CT++; double deltRSRP = double.Parse(S_RSRP) - double.Parse(N_RSRP); if(deltRSRP <= 0) { // <= 0 atu[SECTOR_ID].nInfo[NCELL_ID].DB_LE_0_CT++; } if(0 < deltRSRP && deltRSRP <= 6) { // <= 0 atu[SECTOR_ID].nInfo[NCELL_ID].DB_LE_6_CT++; } if(6 < deltRSRP && deltRSRP <= 10) { // <= 0 atu[SECTOR_ID].nInfo[NCELL_ID].DB_LE_10_CT++; } } } }
/// <summary> /// 读取ATU统计信息 /// </summary> private void readATUStatistic() { atu.Clear(); int i = 0; foreach(var item in m_cellInfo.cellInfo) { // 按主小区 逐批取 double r = ++i / (double)m_cellInfo.cellInfo.Count; LogHelper.instance().write("# read atu process:" + r.ToString()); string sql = @"SELECT [seq],[PROJECT_ID] ,[SECTOR_ID],[S_EARFCN],[PCI] ,[NCELL_ID],[N_EARFCN],[N_PCI] ,[S_SampleCount],[N_SampleCount] ,[SampleCountBelowZero],[SampleRatioBelowZero] ,[SampleCountZeroAndSix],[SampleRatioZeroAndSix] ,[SampleCountSixAndTen],[SampleRatioSixAndTen] FROM [tbATUStatistics] WHERE SECTOR_ID = '193544-2'"; sql = sql.Replace("193544-2", item.Key); DataTable dt = new DataTable(); DBHelper.instatnce().get_dataTable(ref dt, sql); foreach(DataRow dr in dt.Rows){ string seq = dr["seq"].ToString(); string PROJECT_ID = dr["PROJECT_ID"].ToString(); string SECTOR_ID = dr["SECTOR_ID"].ToString(); string NCELL_ID = dr["NCELL_ID"].ToString(); string S_SampleCount = dr["S_SampleCount"].ToString(); string N_SampleCount = dr["N_SampleCount"].ToString(); string SampleCountBelowZero = dr["SampleCountBelowZero"].ToString(); string SampleRatioBelowZero = dr["SampleRatioBelowZero"].ToString(); string SampleCountZeroAndSix = dr["SampleCountZeroAndSix"].ToString(); string SampleRatioZeroAndSix = dr["SampleRatioZeroAndSix"].ToString(); string SampleCountSixAndTen = dr["SampleCountSixAndTen"].ToString(); string SampleRatioSixAndTen = dr["SampleRatioSixAndTen"].ToString(); if(!atu.ContainsKey(SECTOR_ID)) { atu[SECTOR_ID] = new ATU(); } if(!atu[SECTOR_ID].nInfo.ContainsKey(NCELL_ID)) { atu[SECTOR_ID].nInfo[NCELL_ID] = new ATUMatrix(); } atu[SECTOR_ID].PROJECT_ID = int.Parse(PROJECT_ID); atu[SECTOR_ID].S_Sample_CT = int.Parse(S_SampleCount); atu[SECTOR_ID].nInfo[NCELL_ID].N_Sample_CT = int.Parse(N_SampleCount); atu[SECTOR_ID].nInfo[NCELL_ID].DB_LE_0_CT = int.Parse(SampleCountBelowZero); atu[SECTOR_ID].nInfo[NCELL_ID].DB_LE_6_CT = int.Parse(SampleCountZeroAndSix); atu[SECTOR_ID].nInfo[NCELL_ID].DB_LE_10_CT = int.Parse(SampleCountSixAndTen); } } }