public void Test() { ICalcGain calcGain = new MockCalcGain(); //不共站的情况,只计算水平隔离度 float linkLoss1 = m_Target.GetCellToCellLinkLoss(m_CellFrom, m_CellTo, calcGain); Assert.AreEqual(45.5, linkLoss1, 0.3); //共站址的情况,计算垂直隔离度 m_CellTo.Parent.Parent.X = 0; m_CellTo.Parent.Parent.Y = 0; float linkLoss2 = m_Target.GetCellToCellLinkLoss(m_CellFrom, m_CellTo, calcGain); Assert.AreEqual(75, linkLoss2, 0.3); //共站址的情况,且天线高度一致 AntConfig toConfig = new AntConfig(); toConfig.OutdoorAntenna = new AntennaEntity(); toConfig.AntType = 1; toConfig.Height = 30; toConfig.SectorID = 0; m_CellTo.Parent.removeSetorConfig(0); m_CellTo.Parent.addAntConfig(toConfig); float linkLoss3 = m_Target.GetCellToCellLinkLoss(m_CellFrom, m_CellTo, calcGain); Assert.AreEqual(0, linkLoss3,0.1); }
public void Init() { ProjectSingleton.CurrentProject = MockProject.Instance; ProjectSingleton.CurrentProject.AppContext.RegisterService(new MockPLCalcDataVstr()); ProjectSingleton.CurrentProject.AppContext.RegisterService(new MockGeoProvider()); List<User> m_UserList = new List<User>(); List<IACell> m_CellList = new List<IACell>(); Service Ser1 = new UnionPsService(); Terminal Ter1 = new Terminal(); User user1 = new User(); user1.Id = 1; user1.X = 100; user1.Y = 100; user1.Service = Ser1; user1.Terminal = Ter1; User user2 = new User(); user2.Id = 2; user2.X = 100; user2.Y = 100; user2.Service = Ser1; user2.Terminal = Ter1; m_UserList.Add(user1); m_UserList.Add(user2); IACell cell1; IACell cell2; InitCell(out cell1, out cell2); m_CellList.Add(cell1); m_CellList.Add(cell2); ICalcGain calcGain = new MockCalcGain(); m_LinkLossGet = new LinkLossGet(m_UserList, m_CellList, calcGain, ProjectSingleton.CurrentProject.AppContext,75); }
public void TestPolyAntenna() { ICalcGain calcGain = new MockCalcGain(); AntConfig fromConfig2 = new AntConfig(); fromConfig2.AntType = 1; fromConfig2.Height = 30; fromConfig2.SectorID = 1; m_CellFrom.Parent.addAntConfig(fromConfig2); AntConfig toConfig2 = new AntConfig(); toConfig2.AntType = 1; toConfig2.Height = 30; toConfig2.SectorID = 1; m_CellTo.Parent.addAntConfig(toConfig2); float linkLoss = m_Target.GetCellToCellLinkLoss(m_CellFrom, m_CellTo, calcGain); Assert.AreEqual(45.5, linkLoss, 0.3); }