Share My Creation Antenna Bearing Tool with source code

NOTE: You will need to provide your own mapkey in the manifest to run the code.

This is a fairly specialized tool so will have limited appeal however it does provide a googlemap example.

Antenna Bearing Tool is an alternative to a magnetic compass for installers of telecommunications antennas. A known landmark is used as a reference. The land mark must be visible and identifiable from the BTS.

There are a many reasons for using this method in preference to using a compass:
1. Antenna bearings are usually referenced to True North and it is a common mistake to apply the correction for a magnetic bearing in the wrong direction, therefore doubling the offset.
2. In many cases steel work or electric power sources affect the compass.

There are 2 modes of operation, Cellular and Point to Point [Microwave links.]

Cellular mode: NOTE: [BTS = Cell Phone Tower]
The principle of use is simple:
1. The Icon for the BTS is located on the map at the transmitting site.
2. The Icon for the Land Mark is located on the map at the land mark.
3. The desired antenna bearing [degrees true] is entered via the pop-up keyboard. [Tap the white text to activate the keyboard entry]
4. The two lines on the map show the line to the land mark [RED] and the desired antenna bearing.
You can then point the Red line towards the land mark and aim the antenna along the Green line. Alternatively the Offset can be read from the screen and a protractor/theodolite used in place of the phone.

Point to Point mode:
Operation is similar to Cellular mode except that co-ordinates for Aend, Bend and landmark are entered and the bearing, path distance and the offset are calculated.

Many thanks to Erel, Klaus, eurojam, thedesolatesoul, NJDude, DonManfred, rasswisak and warwound for all the help.

Regards Roger


Edit 22 Dec 2019
Issue 14
Code update: Added a panel with Transmitter power stuff such as Return Loss, ERP, Power Density Etc. Also a converter from Return Loss to VSWR.
Nothing of much interest as far as programming goes but bits and pieces that RF techs may wish to know.
NOTE: You will need to provide your own mapkey in the manifest to run the code.


Edit 5 Nov 2019
Issue 13
Code update: ABT has a database for keeping a list of sites as of earlier this year. This update allows the Site List to be exported and imported as CSV files, to and from the ABT folder.
NOTE: You will need to provide your own mapkey in the manifest to run the code.


Edit 27 Sept 2019
Issue 12
Just an update to the attached code. There are a number of changes over time, the latest is an update to permissions.

Edit 08 Dec 2016
Added Sun Dial function. This uses the sun as a Land Mark [Sky Mark].
Many thanks to Derez for posting the code used to find Azimuth and Elevation of the sun.

Regards Roger

Edit 17 May 2020
Zip for Release 16 added
You will need your own Google Map key inserted in the Manifest.
Release 16+ checks for available updates. [Means nothing until I release version 17]

Edit 02 Sep 2016
Added second mode for Point to Point systems [Microwave links]
Looks a bit different.


Edit 11 Nov 2015
Upated Zip uploaded.
Added Save, View and Delete functions to App. [50% more buttons at no extra charge.]
Cleaned up some of my really bad coding.

Regards Roger


Play Store
 

Attachments

  • AntennaBearingTool2.zip
    204 KB · Views: 329
  • ABT.jpg
    ABT.jpg
    189.8 KB · Views: 2,713
Last edited:

Beja

Expert
Licensed User
Longtime User
Hi Roger,
Thanks for sharing this and I find it useful.
I see both lines are originated from the same point.. but how about A to B to C to D? I tried to modify your code without success.
 

Roger Daley

Well-Known Member
Licensed User
Longtime User
Hi Beja,

Point to point to point should not be a problem but I have only used it in this App. As I understand it, you only need to keep adding points as in the code below. I am on the run this morning and haven't had time to check.


B4X:
    LandMarkpoints.Initialize
    If LandMarkline.IsInitialized = True Then LandMarkline.Remove
    LandMarkline = gmap.AddPolyline    '  Is the line you will draw

        'Defines the line, colour, width, Etc.
    LandMarkline.color=Colors.Red                 'Array As Int(255,255,255)
    LandMarkline.Geodesic=False
    LandMarkline.Visible =True
    LandMarkline.Width=3dip

        'Define points of the line to be drawn
    LandMarkPoint.Initialize(BTSLat, BTSLng)
    LandMarkpoints.Add(LandMarkPoint)
    LandMarkPoint.Initialize(LANDLat, LANDLng)
    LandMarkpoints.Add(LandMarkPoint)

        ' Add additional points A, B, C, ....
    LandMarkPoint.Initialize(ALat, ALng)
    LandMarkpoints.Add(LandMarkPoint)
    LandMarkPoint.Initialize(BLat, BLng)
    LandMarkpoints.Add(LandMarkPoint)
    LandMarkPoint.Initialize(CLat, CLng)
    LandMarkpoints.Add(LandMarkPoint)

          'Draw the line
    LandMarkline.points = LandMarkpoints


Give this a try and if it doen't work please post the code.


Regards Roger

PS I don't think this will work on an emulator, make sure you run it on a real device
 

Roger Daley

Well-Known Member
Licensed User
Longtime User
Hi Roger,
Thanks for sharing this and I find it useful.
I see both lines are originated from the same point.. but how about A to B to C to D? I tried to modify your code without success.

Beja,
Finally added A to B. You've probably long solved your query. I may be slow but I finally get there.

Regards Roger
 

Roger Daley

Well-Known Member
Licensed User
Longtime User
Yet another update. This time I have added Import and Export of Site Lists as CSV files.
Updated Zip attached to the original post.
NOTE: You will need to provide your own mapkey in the manifest to run the code.
Many thanks to Erel, Klaus, eurojam, thedesolatesoul, NJDude, DonManfred, rasswisak and warwound for all the help.

Regards Roger
 

Roger Daley

Well-Known Member
Licensed User
Longtime User
Just a further update to the code in the original post.

Issue 14
Code update: Added a panel with Transmitter power stuff such as Return Loss, ERP, Power Density Etc. Also a converter from Return Loss to VSWR.
Nothing of much interest as far as programming goes but bits and pieces that RF techs may wish to know.
NOTE: You will need to provide your own mapkey in the manifest to run the code.

Regards Roger
 

Roger Daley

Well-Known Member
Licensed User
Longtime User
Just a further update to the code in the original post.

Issue 16
Change from Release 14 is Relaese16 checks for available updates.
NOTE: You will need to provide your own mapkey in the manifest to run the code.

Regards Roger
 
Top