private List<LegendUtility> GetStyleStructLegend(string title, StyleStruct ss) { List<LegendUtility> list = new List<LegendUtility>(); List<LegendUtility.LegendUtil> cutline = new List<LegendUtility.LegendUtil>(); foreach (GeoPointStyle style in ss.Styles) { LegendUtility.LegendUtil item = new LegendUtility.LegendUtil(style.SymbolValue, style.SymbolFont.FontFamily, style.SymbolFont.Style, (float)style.IconSize.Width, style.Color, style.Name); cutline.Add(item); } LegendUtility utility = new LegendUtility(title, cutline); list.Add(utility); return list; }
public void MyInit() { m_cell1 = CreatTDCell(3); m_PreCells = new List<TDSimCell>(); m_PreCells.Add(m_cell1); m_user1 = MockTDSimUser.CreatTDSimUser_CSDL(); m_user2 = MockTDSimUser.CreatTDSimUser_PSUL(); m_user2.ServiceCell = null; m_PreUsers = new List<TDSimUser>(); m_PreUsers.Add(m_user1); m_PreUsers.Add(m_user2); m_ss = new StyleStruct(); m_VecData = new R4SimulationVectorData(m_PreCells, m_PreUsers, m_ss); }
public void GetPointStyleDictTest_1() { List<UserResult> userList = new List<UserResult>(); UserResult ur = new UserResult(); ur.BcchCir = 12f; ur.BcchRxPower = 33f; ur.BestServerName = "Trx1"; ur.DlGeometry = -15f; ur.DlTchRxPower = 33f; ur.UserX = 115f; ur.UserY = 120f; ur.UserState = UserStateType.DLSatisfied; userList.Add(ur); StyleStruct ss = new StyleStruct(); GeoPointStyle style1 = new GeoPointStyle(); style1.Name = "DLSatisfied"; ss.Styles.Add(style1); GSMSimulationVectorData gvd = new GSMSimulationVectorData(ss); gvd.UserResult = userList; List<GeoXYPoint> pointList = new List<GeoXYPoint>(); List<GeoPointStyle> styleList = new List<GeoPointStyle>(); gvd.UpadateStyles(ss); gvd.GetPointStyleDict(pointList, styleList); string output; Assert.IsTrue(gvd.TryGetPointInfo(pointList[0], out output)); Assert.AreEqual(115, pointList[0].X); Assert.AreEqual(style1.Name, styleList[0].Name); Assert.IsFalse(gvd.TryGetPointInfo(new GeoXYPoint(112, 115), out output)); //Assert.IsNull(gvd.GetAllStyles()); Assert.AreEqual(style1.Name, gvd.GetAllStyles()[0].Name); }
public ISimulationVectorData GetSnapshotDisplayData(StyleStruct ss) { throw new NotImplementedException(); }
public void CellStatisticsTest_1() { //1个trx List<GSMSimTRX> trxList = new List<GSMSimTRX>(); trxList.Add(GSMMock.MockGsmSimTrx()); //3个用户 List<GSMSimUser> m_User = new List<GSMSimUser>(); m_User.AddRange(GSMMock.MockGsmSimUserList()); List<GSMSimUser> serverUsers = new List<GSMSimUser>(); serverUsers.Add(m_User[0]); List<GSMSimUser> accessFail = new List<GSMSimUser>(); accessFail.Add(m_User[2]); List<GSMSimUser> forAccessAgain = new List<GSMSimUser>(); forAccessAgain.Add(m_User[1]); //trxList[0].TSs[1].CurULThroughput.Add(m_User[0], 25f); m_User[0].UlTs.Add(trxList[0].TSs[1]); trxList[0].CellUsers.Add(m_User[0]); trxList[0].LastKick.Add(m_User[2]); m_User[0].TrafficUser.LinkType = LinkType.Uplink; m_User[2].TrafficUser.LinkType = LinkType.Downlink; trxList[0].AccessCsUlUsers.Add(m_User[0]); trxList[0].AccessCsDlUsers.Add(m_User[2]); m_User[0].ULInterf.Add(trxList[0].TSs[1], -110f); m_User[0].UlCirs.Add(trxList[0].TSs[1], 15f); m_User[0].CurULTxPower.Add(trxList[0].TSs[1], 33f); //add by 6.10 m_User[0].ResultStatistic.UlThorughput.Add(12000); m_User[0].ResultStatistic.ULTDInterf.Add(-150); m_User[0].ResultStatistic.ULUMTSInterf.Add(-150); trxList[0].IterULThrghtpt.Add(25f); trxList[0].IterDLThrghtpt.Add(0f); ConvergenceResult convergenceResult = new ConvergenceResult(); //将相应参数加入到context中 SnapshotContext context = GSMMock.CreateContext(); context.AddKey(GsmContextkey.GSMSimTRXs, trxList); context.AddKey(GsmContextkey.GSMGetLinkloss, m_IGetLinkloss); context.AddKey(GsmContextkey.AllUsers, m_User); context.AddKey(GsmContextkey.GSMServedUsers, serverUsers); context.AddKey(GsmContextkey.GSMAccessFails, accessFail); context.AddKey(GsmContextkey.GSMForAccessAgain, forAccessAgain); context.AddKey(GsmContextkey.GSMConvergenceResult, convergenceResult); SnapShotStatistics statistics = new SnapShotStatistics(); statistics.Init(context); statistics.CellStatistics(); /*小区统计参数*/ //上下行负载 Assert.IsTrue(trxList[0].UlLoad - 0.125 < 0.01); Assert.IsTrue(trxList[0].DlLoad - 0 < 0.01); //被服务的用户数 Assert.AreEqual(1, trxList[0].SerUserNum); //掉话数 //Assert.AreEqual(1, trxList[0].DropUserNum); //语音及数据阻塞数 //Assert.IsTrue(trxList[0].VoiceBlock - 0.5 < 0.01); //Assert.IsTrue(trxList[0].PacketBlock - 0 < 0.01); //接入失败用户数 Assert.AreEqual(0, trxList[0].FailAccessUserNum); statistics.PdfCdfStatistics(); /*用户统计参数*/ Assert.IsTrue(m_User[0].ResultStatistic.UserULInterf - (-110) < 0.01); Assert.AreEqual(float.NegativeInfinity, m_User[0].ResultStatistic.UserDLInterf); Assert.IsTrue(m_User[0].ResultStatistic.ULCir - 15 < 0.01); Assert.AreEqual(float.NegativeInfinity, m_User[0].ResultStatistic.DLCir); Assert.AreEqual(float.NegativeInfinity, m_User[0].ResultStatistic.DLTCHRxPower); Assert.IsTrue(m_User[0].ResultStatistic.TxPower - 33 < 0.01); GSMSnapshotResult result = statistics.GetResult(); result.GetExcelResult(); result.GetSnapshotDisplayData(new StyleStruct()); GSMGetSimulationVectorData ggsvd = new GSMGetSimulationVectorData(); List<IResult> resultList = new List<IResult>(); resultList.Add(result); StyleStruct ss = new StyleStruct(); GeoPointStyle style1 = new GeoPointStyle(); style1.Name = "DLSatisfied"; ss.Styles.Add(style1); Assert.AreEqual(6, ((GSMSimulationVectorData)ggsvd.GetSimulationVectorData(resultList, ss)).UserResult.Count); }
public void UpadateStyles(StyleStruct ss) { throw new NotImplementedException(); }
private List<TreeNode> GenerateStyleNodes(StyleStruct ss) { List<TreeNode> list = new List<TreeNode>(); foreach (GeoPointStyle style in ss.Styles) { TreeNode item = new TreeNode(); item.Text = style.Name; item.Name = style.Name; item.ImageKey = "SimulationStyle"; item.SelectedImageKey = "SimulationStyle"; item.StateImageIndex = 1; list.Add(item); } return list; }
private List<TreeNode> GenerateNetworkSnapshotNodes(INetworkResult networkResult, StyleStruct ss) { List<TreeNode> list = new List<TreeNode>(); List<string> snapshots = networkResult.GetSnapshots(); foreach (string text in snapshots) { TreeNode parentNode = new TreeNode(); parentNode.Text = text; parentNode.Name = text; parentNode.ContextMenuStrip = this.m_ContextMenuView.SnapShotContextMenuStrip; parentNode.ImageKey = "SimulationSnapshot"; parentNode.SelectedImageKey = "SimulationSnapshot"; parentNode.StateImageIndex = 1; List<TreeNode> childNodes = this.GenerateStyleNodes(ss); this.AddMulitNodes(parentNode, childNodes); list.Add(parentNode); } return list; }
public void GetPointStyleDict_Test() { TDSimUser user1; user1 = MockDPAUser.CreatTDSimUser_CS(); TDSimUser user2; user2 = MockDPAUser.CreatTDSimUser_CS(); TDSimUser user3; user3 = MockDPAUser.CreatTDSimUser_CS(); List<TDSimUser> tdPreUser = new List<TDSimUser>(); tdPreUser.Add(user1); tdPreUser.Add(user2); StyleStruct ss = new StyleStruct(); GeoPointStyle gps1 = new GeoPointStyle(); gps1.Name = "gps1"; GeoPointStyle gps2 = new GeoPointStyle(); gps2.Name = "gps2"; ss.Styles.Add(gps1); ss.Styles.Add(gps2); SimulationVectorData simuVectorData = new SimulationVectorData(tdPreUser, ss); GeoXYPoint geoXYPoint = new GeoXYPoint(); GeoPointStyle geoPointStyle = new GeoPointStyle(); List<GeoXYPoint> geoXYPointList = new List<GeoXYPoint>(); List<GeoPointStyle> geoPointStyleList = new List<GeoPointStyle>(); geoXYPointList.Add(geoXYPoint); geoPointStyleList.Add(geoPointStyle); simuVectorData.GetPointStyleDict(geoXYPointList, geoPointStyleList); simuVectorData.UpadateStyles(ss); string info = "GIS"; bool result = false; result = simuVectorData.TryGetPointInfo(geoXYPoint,out info); Assert.IsTrue(result); GeoPointStyle gpStytle1 = new GeoPointStyle(); gpStytle1 = simuVectorData.FindLinkSituByUser(user2); GeoPointStyle gpStytle2 = new GeoPointStyle(); gpStytle2 = simuVectorData.FindLinkSituByUser(user3); Assert.AreEqual(gpStytle1.Name, "gps2"); }
public void GetAllStyles_Test() { TDSimUser user1; user1 = MockDPAUser.CreatTDSimUser_CS(); TDSimUser user2; user2 = MockDPAUser.CreatTDSimUser_CS(); List<TDSimUser> tdPreUser = new List<TDSimUser>(); tdPreUser.Add(user1); tdPreUser.Add(user2); StyleStruct ss = new StyleStruct(); SimulationVectorData simuVectorData = new SimulationVectorData(tdPreUser, ss); List<GeoPointStyle> geoPointStyleList = new List<GeoPointStyle>(); geoPointStyleList = simuVectorData.GetAllStyles(); Assert.AreEqual(geoPointStyleList.Count, 0); }
/// <summary> /// /// </summary> /// <param name="tdPreUsers">所有DPA预接入用户</param> /// <param name="ss">样式</param> public SimulationVectorData(List<TDSimUser> tdPreUsers, StyleStruct ss) { //m_SheduleCells = sheduleCells; m_TDPreUsers = tdPreUsers; m_SS = ss; }
/// <summary> /// 更新样式 /// </summary> /// <param name="ss"></param> public void UpadateStyles(StyleStruct ss) { m_SS = ss; }
/// <summary> /// 构造函数 /// </summary> /// <param name="tdCells">仿真小区集合</param> /// <param name="simUsers">仿真预接入用户集合</param> /// <param name="ss">选用的用户显示类型</param> public TDSimulationVectorData(List<TDSimUser> simUsers, StyleStruct ss) { m_PreSimUsers = simUsers; m_StyStruct = ss; }
public ISimulationVectorData GetSimulationVectorData(List<IResult> datas, StyleStruct ss) { return datas[0].GetSnapshotDisplayData(ss); }
/// <summary> /// 获取指定快照名称的仿真数据 /// </summary> /// <param name="snapshotName">快照名称</param> /// <param name="ss">显示样式</param> /// <returns></returns> public ISimulationVectorData GetSnapshotDisplayData(string snapshotName, StyleStruct ss) { object target = null; m_SnapshotDic.TryGetValue(snapshotName, out target); ISimulationVectorData res = null; if (target != null) { //res = m_GetVectorData.GetSimulationVectorData(GetVectorDatas(target, ss)); res = GetOneDisplayData(ss, target); } return res; }
private ISimulationVectorData GetOneDisplayData(StyleStruct ss, object target) { List<object> temp = (List<object>)target; List<IResult> resultList = new List<IResult>(); foreach (var item in temp) { resultList.Add((IResult)item); } return m_GetVectorData.GetSimulationVectorData(resultList, ss); }