Share My Creation Antenna Bearing Tool with source code

Discussion in 'Share Your Creations' started by Roger Daley, May 25, 2015.

  1. Roger Daley

    Roger Daley Well-Known Member Licensed User

    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 and warwound for all the help.

    Regards Roger


    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 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

    View attachment 50781
     

    Attached Files:

    Last edited: Dec 8, 2016
  2. Roger Daley

    Roger Daley Well-Known Member Licensed User

    Updated code uploaded as zip.
    Improvements to the UI operation
    Fixed bug in OffSet. OffSet now correctly shows as an absolute.


    Regards Roger
     
  3. Beja

    Beja Expert Licensed 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.
     
  4. Roger Daley

    Roger Daley Well-Known Member Licensed 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.


    Code:
    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
     
    Beja likes this.
  5. Roger Daley

    Roger Daley Well-Known Member Licensed User

    Updated Zip uploaded to match the new version on Google Play Shop.

    Regards
    Roger
     
  6. Roger Daley

    Roger Daley Well-Known Member Licensed User

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

    Regards Roger
     
    spairo and Beja like this.
  7. Roger Daley

    Roger Daley Well-Known Member Licensed User

    Updated Zip uploaded to match the new version on Google Play Shop.

    Regards
    Roger
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice