public LinkBudget(IBroadcastModel model, double power = 15.2, double gain = 18) { model = model ?? BroadcastModel.DefaultModel; Model = model; TransmitPower = power; AntennaGain = gain; }
protected void Initialize() { budgetList = new List <ILinkBudget <double> >(); model = new BroadcastModel(); outdoorCellList = new List <IOutdoorCell>(); measurablePoint = new MeasurePoint(); }
public static double CalculatePathLoss(this IBroadcastModel model, double distanceInKilometer, double baseHeight, double mobileHeight = 1.5) { Validate(distanceInKilometer, baseHeight, mobileHeight); return(model.K1 + K2 * Math.Log10(model.Frequency) + K3 * Math.Log10(baseHeight) + Math.Log10(model.CalculateModifiedFactor(mobileHeight, model.UrbanType)) + (model.K4 + K5 * Math.Log10(baseHeight)) * Math.Log10(distanceInKilometer) + DiffractionLoss + ClutterLoss); }
public void Test_Construct_Earfcn() { model = new BroadcastModel(100); Assert.AreEqual(model.Frequency, 2120); model = new BroadcastModel(1825); Assert.AreEqual(model.Frequency, 1867.5); model = new BroadcastModel(1750); Assert.AreEqual(model.Frequency, 1860); }
public void Test_Contruct_Frequency() { Assert.AreEqual(model.Frequency, 2120); model = new BroadcastModel(FrequencyBandType.Downlink1800); Assert.AreEqual(model.Frequency, 1860); model = new BroadcastModel(FrequencyBandType.Uplink2100); Assert.AreEqual(model.Frequency, 1930); model = new BroadcastModel(FrequencyBandType.Uplink1800); Assert.AreEqual(model.Frequency, 1765); model = new BroadcastModel(FrequencyBandType.Tdd2600); Assert.AreEqual(model.Frequency, 2645); }
public void Test_Contruct_Kvalue() { Assert.AreEqual(model.K1, 69.55); Assert.AreEqual(model.K4, 44.9); model = new BroadcastModel(utype: UrbanType.Middle); Assert.AreNotEqual(model.K1, 85.83); Assert.AreNotEqual(model.K4, 60); Assert.AreEqual(model.K1, 69.55); Assert.AreEqual(model.K4, 44.9); model = new BroadcastModel(utype: UrbanType.Dense); Assert.AreEqual(model.K1, 85.83); Assert.AreEqual(model.K4, 60); }
private static void TestModelValidation(IBroadcastModel model, double p1 = 1, double p2 = 1, double p3 = 1) { try { double x = CalculatePathLoss(model, p1, p2, p3); } catch (Exception e) { if (e is ArgumentOutOfRangeException) { Assert.AreEqual(1, 1, "exception!"); } return; } Assert.AreEqual(0, 1, "The validation is invalid!"); }
private static double CalculateModifiedFactor(this IBroadcastModel model, double mobileHeight, UrbanType urbanType) { switch (urbanType) { case UrbanType.Middle: return((1.1 * Math.Log10(model.Frequency) - 0.7) * mobileHeight - 1.56 * Math.Log10(model.Frequency) + 0.8); case UrbanType.Large: return(8.29 * Math.Log10(1.54 * model.Frequency) * Math.Log10(1.54 * model.Frequency) - 1.1); default: return(3.2 * Math.Log10(11.75 * model.Frequency) * Math.Log10(11.75 * model.Frequency) - 4.97); } }
private void TestDifferentUrbanTypesWithFrequency(FrequencyBandType ftype, double distance, bool farEnough) { model = new BroadcastModel(ftype, UrbanType.Dense); double d1 = model.CalculatePathLoss(distance, 40); model = new BroadcastModel(ftype); double d2 = model.CalculatePathLoss(distance, 40); model = new BroadcastModel(ftype, UrbanType.Middle); double d3 = model.CalculatePathLoss(distance, 40); if (farEnough) { Assert.IsTrue(d1 > d2, "d1 = {0}, d2 = {1}", d1, d2); } else { Assert.IsTrue(d1 < d2, "d1 = {0}, d2 = {1}", d1, d2); } Assert.IsTrue(d2 > d3, "d2 = {0}, d3 = {1}", d2, d3); }
public ComparableCell(IGeoPoint<double> point, IOutdoorCell cell, IList<ILinkBudget<double>> budgetList, IBroadcastModel model, byte pciModx = 0) { SetupComparableCell(point, cell); ILinkBudget<double> budget = budgetList.FirstOrDefault( x => Math.Abs(x.TransmitPower - cell.RsPower) < Eps && Math.Abs(x.AntennaGain - cell.AntennaGain) < Eps); if (budget == null) { budget = new LinkBudget(model, cell.RsPower, cell.AntennaGain); budgetList.Add(budget); } Budget = budget; PciModx = pciModx; }
private void TestDifferentFrequenciesWithUrbanType(UrbanType utype, double distance) { model = new BroadcastModel(utype: utype); double d1 = model.CalculatePathLoss(distance, 40); model = new BroadcastModel(FrequencyBandType.Uplink2100, utype); double d2 = model.CalculatePathLoss(distance, 40); model = new BroadcastModel(FrequencyBandType.Downlink1800, utype); double d3 = model.CalculatePathLoss(distance, 40); model = new BroadcastModel(FrequencyBandType.Uplink1800, utype); double d4 = model.CalculatePathLoss(distance, 40); model = new BroadcastModel(FrequencyBandType.Tdd2600, utype); double d5 = model.CalculatePathLoss(distance, 40); Assert.IsTrue(d5 > d1); Assert.IsTrue(d1 > d2); Assert.IsTrue(d2 > d3); Assert.IsTrue(d3 > d4); }
public ComparableCell(IGeoPoint <double> point, IOutdoorCell cell, IList <ILinkBudget <double> > budgetList, IBroadcastModel model, byte pciModx = 0) { SetupComparableCell(point, cell); ILinkBudget <double> budget = budgetList.FirstOrDefault( x => Math.Abs(x.TransmitPower - cell.RsPower) < Eps && Math.Abs(x.AntennaGain - cell.AntennaGain) < Eps); if (budget == null) { budget = new LinkBudget(model, cell.RsPower, cell.AntennaGain); budgetList.Add(budget); } Budget = budget; PciModx = pciModx; }
private async void OnItemSelected(object sender, SelectedItemChangedEventArgs e) { Debug.WriteLine("### selected ###" + e.SelectedItem == null); if (e.SelectedItem == null) { return; //ItemSelected is called on deselection, which results in SelectedItem being set to null } //DependencyService.Get<ITextToSpeech>().Speak("Hello from Xamarin Forms"); //Debug.WriteLine( "%%%ORIEND" + DependencyService.Get<IDeviceOrientation>().GetOrientation()); //DependencyService.Get<IDeviceOrientation>().SetOrientation( false ); IBroadcastModel model = listViewBroadcastGame.SelectedItem as IBroadcastModel; listViewBroadcastGame.SelectedItem = null; if (model.Kind != BroadcastStruct.LIVE) { return; } string goNaverUrl = await vm.GetLink(model, broadcastHeader.ViewModel.DateTimeCurrent); Debug.WriteLine(goNaverUrl); PopupWebviewPage webViewPage = new PopupWebviewPage(); webViewPage.OpenURL(goNaverUrl); webViewPage.Closed -= OnClosed; webViewPage.Closed += OnClosed; await Navigation.PushModalAsync(webViewPage); //await DependencyService.Get<IAppHandler>().LaunchApp("naverplayer://" ); //Device.OpenUri(new Uri("naverplayer://nlc_play?minAppVersion=1210&is_addr=is1.ncast.naver.com&is_port=11310&serviceID=12002&liveId=S2017041909ch5&qualityId=2000&title=+&video1=selected%3Dtrue%26%26title%3DHD%ED%99%94%EC%A7%88%26%26type%3Dnlivecast%26%26url%3Dhighch5%26%26id%3D2000&video2=selected%3Dfalse%26%26title%3D%EA%B3%A0%ED%99%94%EC%A7%88%26%26type%3Dnlivecast%26%26url%3Dlowch5%26%26id%3D800&video3=selected%3Dfalse%26%26title%3D%EC%A0%80%ED%99%94%EC%A7%88%26%26type%3Dcdn%26%26url%3Dhttp%3A%2F%2Fhls.live.m.nhn.gscdn.com%2Fch5%2F_definst_%2Fch5_300.stream%2Fplaylist.m3u8%26%26id%3D300&advertiseUrl=http%3A%2F%2Fams.rmcnmv.naver.com%2Fitem%2Fcreate%2F2002%2FNAVER%3Fams_ctgr%3DNSPORTS%26ams_cp%3DNHN%26svc%3Dsportslive%26st%3DLIVE%26ams_vodType%3DLIVE%26ams_chnl%3DLIVE_nba%26cl%3D%26ams_videoId%3D2017041909%26unit%3D1104B#Intent;scheme=naverplayer;action=android.intent.action.VIEW;category=android.intent.category.BROWSABLE;package=com.nhn.android.naverplayer;end")); //Device.OpenUri(new Uri( "daummaps://" )); //Device.OpenUri(new Uri( "naverplayer://" )); //Device.OpenUri(new Uri( "https://appsto.re/kr/rryj3.i" )); }
protected void Initialize() { budgetList = new List<ILinkBudget<double>>(); model = new BroadcastModel(); outdoorCellList = new List<IOutdoorCell>(); measurablePoint = new MeasurePoint(); }
public void Test_ModelIsNotNull() { Assert.IsNotNull(model); model = new BroadcastModel(FrequencyBandType.Downlink1800, UrbanType.Middle); Assert.IsNotNull(model); }
private static double CalculatePathLoss(IBroadcastModel model, double distanceInKilometer, double baseHeight, double mobileHeight = 1.5) { return model.CalculatePathLoss(distanceInKilometer, baseHeight, mobileHeight); }
public void TestLargeModel_Downlink1800(double height) { model = new BroadcastModel(FrequencyBandType.Downlink1800); TestDifferentDistancesWithBsHeight(height); }
public void ImportCells(IEnumerable <IOutdoorCell> cells, IList <ILinkBudget <double> > budgetList, IBroadcastModel model, byte modBase = 3) { ComparableCell[] compCells = GenerateComaparbleCellList(cells, budgetList, model, modBase); CellRepository.GenerateMeasurableCellList(compCells, this); }
public void TestDenseModel(double height) { model = new BroadcastModel(utype: UrbanType.Dense); TestDifferentDistancesWithBsHeight(height); }
public void TestInitialize() { model = new BroadcastModel(); budget = new LinkBudget(model); }
public void TestInitialize() { model = new BroadcastModel(); }
public void SetUp() { budgetList = new List<ILinkBudget<double>>(); model = new BroadcastModel(); }
public async Task <string> GetLink(IBroadcastModel model, DateTime dateTimeCurrent) { NaverService naverService = new NaverService(); return(await naverService.GetGameURL(dateTimeCurrent, model.Title)); }
public void SetUp() { budgetList = new List <ILinkBudget <double> >(); model = new BroadcastModel(); }
public ComparableCell[] GenerateComaparbleCellList(IEnumerable <IOutdoorCell> cells, IList <ILinkBudget <double> > budgetList, IBroadcastModel model, byte modBase = 3) { ComparableCell[] compCells = cells.Select(x => new ComparableCell(this, x, budgetList, model, (byte)(x.Pci % modBase))).ToArray(); Array.Sort(compCells); return(compCells); }
private static double CalculatePathLoss(IBroadcastModel model, double distanceInKilometer, double baseHeight, double mobileHeight = 1.5) { return(model.CalculatePathLoss(distanceInKilometer, baseHeight, mobileHeight)); }