1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Some very simple ham radio software for OS X - Can anyone help?

Discussion in 'HTML, Graphics & Programming' started by Feek, Apr 7, 2010.

  1. Feek

    Commissario

    Joined: Oct 17, 2002

    Posts: 24,413

    Location: In the radio shack

    Well, when I say 'help', it's more a request to see if someone can code this for me!

    I'm a radio amateur and the radio software that's about for the Mac is quite limited but my request is [hopefully] very simple.

    The planet is split into a grid of squares called the Maidenhead Locator System. Radio hams exchange these locators to work out distances between them.

    I'm after a piece of software which simply calculates the distance and heading between two locators (down to the third pair, ie JO01DO). You can get an idea of how these squares look here.

    It can either ask for both locators each time or preferably store a 'home' location and then just have a single box for locator entry which one types a locator into, hits 'enter' or clicks a button to have the result displayed.

    Nothing fancy, nothing complicated.

    But it's beyond me! I did some BASIC programming on the Commodore PET, Acorn Atom and BBC Micro many years ago but that's my limit.

    Is anyone willing and able to have a pop at this for me? I wouldn't think it'd be difficult, with nothing more needing to be displayed than the distance and direction.

    All I can offer for this is brownie points and the knowledge of a job well done :)
     
  2. Spuds

    Hitman

    Joined: Jan 7, 2007

    Posts: 636

    Location: Cambridge

    If I can figure out how the system works I could probably knock something up in Java with little difficulty. Will take a look at it when I'm slightly more awake, but it looks like it's just a matter of converting the square to a latitude and longitude and then working out the distance between them.
     
  3. Feek

    Commissario

    Joined: Oct 17, 2002

    Posts: 24,413

    Location: In the radio shack

    That's pretty much it, convert square to lat/long and calculate distance and direction between them.

    I've found a Windows program here which does that but even that displays far too much info, this is the absolute maximum which is needed:

    [​IMG]

    All I need is a box to enter the distant locator (home location set via preferences) and then below that the distance/direction. If it could calculate as the details are typed in without having to hit enter then that would be a bonus so for example if I set my home location to JO01DO then it already knows the lat/long of that location. I hear someone giving out a location which starts with IN89, as soon as I've typed the first pair, ie IN the distance/direction to the centre of that square appears, I follow with 89 and the distance/direction changes to the centre of that square and then finally it narrows it right down when I get the last two characters RK which gives me his actual square.

    The idea being that it helps to get the aerial pointing in the right direction without having to receive the entire locator.

    That may be getting too difficult but it'd be great if it could be done.



     
  4. NickK

    Capodecina

    Joined: Jan 13, 2003

    Posts: 17,245

    I have an app, I've just been battling the UI to get your progressive targeting. The good news is that I have progressive input working, so as you type it will zero in. It also means you don't have to have a "Go" button too. I've not used the way I'm doing it before but it's far more simple than I would have expected!

    Additionally I've made a very pretty, small main window as per your specs and you will set your home location using a preference window.

    Then I got slightly distracted by other things.. but it's coming along :)

    Tomorrow I'll get the meat working behind it. Annoyingly the MKMapView is iPhone only.. but there is NSWebView which can be made to point to google maps.. after it's working :D

    Lastly - I've named it "iHam" and I think if we can get a nice image of a ham and an ariel knocked up by some artistic forum member I can add this - would prefer a non-lossy format such as png - I can then add it as an application icon.
     
    Last edited: Apr 9, 2010
  5. Feek

    Commissario

    Joined: Oct 17, 2002

    Posts: 24,413

    Location: In the radio shack

    Nick, that's fantastic, thank you :) Feel free to email me either via Trust or via the link in the GD sticky with anything you'd like me to try.
     
  6. RobH

    Mobster

    Joined: May 9, 2005

    Posts: 4,524

    Location: Nottingham

    I have had a go at this using Java, I've got it up and running under Windows 7 but I'm not sure about any other operating systems so I'll need you to test it out. This is only the initial version, the code needs cleaning up and I need to fix some issues with the interface but it's a start. I can add (and remove) any features you want (such as saving the 'Home' position across app launches).

    [​IMG]

    Instructions

    The 'Home' and 'Target' should be self explanatory, they will accept up to 6 characters and update the information when 2, 4 or 6 characters are entered.

    The label at the bottom is a status message, it tells you the Latitude and Longitude of the location you have entered whenever you start entering information into the 'Home' or 'Target' boxes (I'm not sure if it is formatted in the correct way?). This label also shows a message if the QTH code is in an invalid format.

    The checkbox toggles 'Always on Top' mode on and off which allows it to stay above other windows (again, untested on anything other than Windows 7, not sure if it works on OS X).

    Exit button and various other labels should be self explanatory.

    You can download the JAR from http://www.rbrt.co.uk/QTH Calc.jar

    Please let me know if it works and any feedback you have.

    -Rob
     
  7. Feek

    Commissario

    Joined: Oct 17, 2002

    Posts: 24,413

    Location: In the radio shack

    Thanks Rob, looking good and working well :)

    [​IMG]

    That certainly seems to work - The always on top coding is a bit violent though. When I open the file (I just double click on it in OS X and it opens) it always sits on top unless I toggle it on and back off again and the position of the checkbox and the exit button move as the box is ticked and unticked:

    [​IMG]

    [​IMG]

    [​IMG]

    The figures could all be rounded because the fractions really aren't needed and neither is the display of the lat/long of the destination as this is just for distance/heading.

    Is it possible to have an option somehow to store a 'home' location? That would reduce the size of the window even further although if it's a single standalone program then that might not be so straightforward.



    Nick - You were after a suitable icon for yours and suggest a person and an aerial, would not a map be better as that's purely what it's for? The name iHam has been used for a Mac application already and I'm not sure that works for a distance/direction app anyway. Not sure what else to suggest though *hangs head* but I'm really looking forward to what you've done.



     
  8. RobH

    Mobster

    Joined: May 9, 2005

    Posts: 4,524

    Location: Nottingham

    Great to know it works on OS X, I should be able to get the features you wanted working.

    Easily fixed, turns out that I had enabled it by default on the window (before you even have a chance to check the box). The issue with the movement of components is to do with the labels and layout, also easily fixed.

    Easy to do, just need to alter the rounding format. The lat/long and the status message can be removed to save space, I only put it in as the QTH code is converted to lat/long to perform the calculation and the data was available. I can get rid of the status message altogether and just turn the input box red if the QTH code is invalid.

    Should be possible, I'll come up with something.
     
  9. Feek

    Commissario

    Joined: Oct 17, 2002

    Posts: 24,413

    Location: In the radio shack

    Incidentally I tried running it on XP but the OS didn't know how to handle the .jar file!
     
  10. RobH

    Mobster

    Joined: May 9, 2005

    Posts: 4,524

    Location: Nottingham

    Yeah, it happens if you don't have the JRE installed or it is not setup correctly. It's not installed as part of Windows so you have to install it yourself. Most of the time it gets installed by something else such as a Java applet or some program that requires it.
     
  11. Feek

    Commissario

    Joined: Oct 17, 2002

    Posts: 24,413

    Location: In the radio shack

    It was installed but I guess just not set up correctly. It's not a problem for me as I'll always be using it on a Mac, I just thought I'd try it on our club laptop and see how it worked :)
     
  12. RobH

    Mobster

    Joined: May 9, 2005

    Posts: 4,524

    Location: Nottingham

    You can give version 2 a try now if you want, I've made a few changes which you mentioned and it is quite a bit smaller.

    [​IMG][​IMG][​IMG]

    The 'Home' field and 'Always on top' setting both save whenever you make a change to them and will persist across application launches. The information is stored per user profile on the computer.

    Both the 'Home' and 'Target' fields change colour depending on the input. They go green when a valid code has been typed, red when an invalid code is typed and white when it is waiting for more information to be input. The 'Target' field will only be editable when a valid home location has been entered.

    Give it a try and let me know if you come across any bugs or problems with the interface.

    http://www.rbrt.co.uk/QTH Calc2.jar
     
  13. Feek

    Commissario

    Joined: Oct 17, 2002

    Posts: 24,413

    Location: In the radio shack

    It's getting there but that one needs to be resized a bit, it's cropping itself down and there's no way for me to resize.
    [​IMG]
     
  14. RobH

    Mobster

    Joined: May 9, 2005

    Posts: 4,524

    Location: Nottingham

    Try this one: http://www.rbrt.co.uk/QTH Calc_Debug.jar

    It has resizing enabled. Let me know if it is still squashed when you launch it, if it is then resize it until it looks normal and tell me the values from the debug label on the settings page.

    The issue is related to the different windowing systems used across the platforms, it tries to use the native components.
     
  15. Feek

    Commissario

    Joined: Oct 17, 2002

    Posts: 24,413

    Location: In the radio shack

    W: 205 H:176, although the box needs drawing slightly lower as it's cutting off the text:

    [​IMG]

    I should add that I'm still very keen to see what Nick is working on as well :)
     
  16. RobH

    Mobster

    Joined: May 9, 2005

    Posts: 4,524

    Location: Nottingham

    This version is stretched out on purpose, could you post a screenshot from the settings tab. There is something up with the layout manager on the interface and I want to see if it's something to do with the font that is being used.

    http://www.rbrt.co.uk/QTH Calc_Debug2.jar
     
  17. Feek

    Commissario

    Joined: Oct 17, 2002

    Posts: 24,413

    Location: In the radio shack

    Sure can:
    [​IMG]

    The box on the Locator tab is in the right place now, the full Azimuth heading can be seen.
     
  18. RobH

    Mobster

    Joined: May 9, 2005

    Posts: 4,524

    Location: Nottingham

    I'll have a play around with the interface and see what I can do. Apart from the obvious issues with the interface does the functionality seem to be working correctly, does it give you the correct information?
     
  19. Feek

    Commissario

    Joined: Oct 17, 2002

    Posts: 24,413

    Location: In the radio shack

    Yup, sure does - I've done a comparison check with the Windows software we use for creating our contest entries and it all ties up.
     
  20. NickK

    Capodecina

    Joined: Jan 13, 2003

    Posts: 17,245

    I finally have some time to devote to it today!

    Oh the possibilities... spotlight plugin, dashboard widget, desktop application, iPhone application..
     
    Last edited: Apr 10, 2010