/*
 * This program is for tracking and communicating with an AirCore in flight. It provides location input to 
 * Global Mapper and interfaces with the iMet telemetry modem, 900 Mhz trasnceiver, and the Iridium
 * backup transmitter. 
 * Written by: Jack Higgs
 * Basic program was written prior to Jan 2012.
*/

/*
 * W A R N I N G S
 * 1. Don't use the <, >, ~, ^, &, |, # for anything that is sent to the 900mhz transmitters except as commands
 *    for the payload transmitters. These characters are used for commands in the 900Mhz cutdown module on the payload 
 *    and might cause unexpected problems is sent to a 900mhz transmitter on a balloon or if they are sent out 
 *    in Broadcast mode to all receivers.
 * 2. This program is currently set up to work only in the North America region. It might not work properly
 *    south of the equator or east of 000 longitude.
*/

/*
 * Revisions:
 * 1.08 26Oct2012
 *      1. Added funtionality so that Iridium email attachments that are downloaded and saved into a specific directory
 *         can be updloaded into the program and then automatically added to the Global Mapper program and displayed
 *         as tracks. This can be useful if the iMet fails and there is no other way to track the payload.
 * 1.07 19Oct2012
 *      1. Added functionality for backup tracks from 900Mhz to go to the iMet file to be transmitted by the 
 *         automailer program.
 * 1.06 11May2012
 *      1. Added the Test Tab and functionality to input simulated moving Locations for the CV and the iMet.
 * 1.05 03May2012
 *      1. Added the Bearing to the payload in relation to both True North and relative to the heading of the chase
 *         vehicle. The relative bearing will not register if the chase vehicle is not moving therefore has no heading.
 *      2. Added the Vertical Angle for the payload. It is 0 to 90 degrees with 90 degrees being straight up. This is 
 *         the angle of the kink in your neck in relation to your spine when looking up at the payload.
 *      3. Added test mode for the chase vehicle GPS so simulated GPS data can be used.
 *      4. Added Heading to the chase vehicle info section.
 *      5. Added checkbox to set the C/V speed to 2 mph for testing. This could also be used if the vehicle is sitting 
 *         still but you want to maintain vertical angle and bearing to the payload.
 *      6. Changed log files to open at start up and to flush after writing a line.
 * 1.04 25Apr2012
 *      1. Added the Test Mode button for the 900Mhz transmitter on the payload. This will send the "{" symbol once
 *         to the payload and put it in test mode. All GPS data from the payload will be false. The power on the 
 *         payload 900Mhz package will have to be cycled to get it out of test mode. Do not use this feature except 
 *         in the lab for test.
 *      2. Added button to tell the payload 900Mhz to transmit its location every 2 minutes. This will send the "@" 
 *         symbol several times to activate this mode in the payload Arduino. This cannot be turned off once activated.
 *      3. Added check box to simulate a valid GPS output from the iMet. This is for indoor and lab use only.
 * 1.03 20Apr2012
 *      1. Reworked the 900Mhz GPS read so it will determine which Aircore is sending the GPS data and label
 *         it accordingly for Global Mapper.
 * 1.02 18Apr2012
 *      1. Added capability to communicate with more than one 900Mhz transmitter on a balloon payload at a time.
 *         Used the Digi transmitters Digimesh capability.
 *      2. Added a rough chat capability so separate chase vehicles can communicate via bouncing a signal off
 *         the inflight balloons. I don't know how well or if this will work or be useful. Could be useful if chase
 *         vehicles are out of cell phone coverage.
 *      3. Added capability to transmit second aircore location to Iridium from 900Mhz transmitter. Both Aircore 01 and 02
 *         can be polled and the GPS data separated and sent thru the ground station iridium.
*/