Changeset - 636f2836d35c
[Not reviewed]
default
0 2 0
mkanning@CL-ENS241-10.cedarville.edu - 13 years ago 2013-04-04 20:38:29
mkanning@CL-ENS241-10.cedarville.edu
small changes
2 files changed with 6 insertions and 12 deletions:
0 comments (0 inline, 0 general)
Demo.WindowsForms/Forms/MainForm.cs
Show inline comments
 
@@ -1144,28 +1144,28 @@ namespace Demo.WindowsForms
 
            //find and store longitude string
 
            indexStart = rawDataReceived.IndexOf("N/");
 
            indexEnd = rawDataReceived.IndexOf("WO");
 
            longitude = rawDataReceived.Substring(indexStart + 2, indexEnd - indexStart - 2);
 
            
 
            //remove APRS overhead from string
 
            string transmissionCommentField= rawDataReceived.Substring(rawDataReceived.IndexOf(" ")); 
 
            string transmissionCommentField = rawDataReceived.Substring(rawDataReceived.IndexOf(" ") + 1); 
 
 
            //place each datum in its own variable
 
            string[] dataTransmission;
 
            dataTransmission = transmissionCommentField.Split('~');
 
 
            //variables for processing datums
 
            string typeCode;
 
            string data;
 
            string csvData = "";
 
            string testString = "";
 
 
            //loop through all datums in the transmission and send them to the chart builder
 
            for (int i = 0; i < dataTransmission.Length; i++)
 
            for (int i = 1; i < dataTransmission.Length; i++)
 
            {
 
                if (i == 0)
 
                if (i == 1)
 
                {
 
                    firstTransmissionDatum = true;
 
                }
 
                else
 
                {
 
                    firstTransmissionDatum = false;
 
@@ -1246,18 +1246,12 @@ namespace Demo.WindowsForms
 
            int firsttwodigits = ((int)f) / 100;                               //This assumes that f < 10000.
 
            float nexttwodigits = f - (float)(firsttwodigits * 100);
 
            float theFinalAnswer = (float)(firsttwodigits + nexttwodigits / 60.0);
 
            return theFinalAnswer;
 
        }
 
 
        //must change lat/long coords to properly place map marker
 
        public decimal DmsToDD(double d, double m = 0, double s = 0)
 
        {
 
            return Convert.ToDecimal((d + (m / 60) + (s / 3600)) * (d < 0 ? -1 : 1));
 
        }
 
 
        // add marker from an APRS transmission - MDKEdit
 
        private void addTrackerMarker(string lat, string lng)
 
        {
 
 
            double latitude = double.Parse(lat), longitude = double.Parse(lng);
 
            PointLatLng APRSloc = new PointLatLng();
 
@@ -1352,20 +1346,20 @@ namespace Demo.WindowsForms
 
                else if (dataType.Equals("i")) //Info Message
 
                {
 
                    AddTextDelegate("Info: " + data + "\r\n");
 
                }
 
                
 
                ///MASTER MODULE DATA TYPES
 
                else if (dataType.Equals("_"))  //latitude
 
                else if (dataType.Equals("_"))  //latitude extra accuracy
 
                {
 
                    //TODO: check math and decimal placement
 
                    latitude += data.ToString();
 
                    tboxMasterLatitude.Text = latitude;
 
                    tboxMasterLatitude.BackColor = Color.Chartreuse;
 
                }
 
                else if (dataType.Equals("|"))  //longitude
 
                else if (dataType.Equals("|"))  //longitude extra accuracy
 
                {
 
                    //TODO: check math and decimal placement
 
                    longitude += data.ToString();
 
                    tboxMasterLongitude.Text = longitude;
 
                    tboxMasterLongitude.BackColor = Color.Chartreuse;
 
                }
Demo.WindowsForms/Source/Program.cs
Show inline comments
 
@@ -17,13 +17,13 @@ namespace Demo.WindowsForms
 
   {
 
      /// <summary>
 
      /// The main entry point for the application.
 
      /// </summary>
 
      /// 
 
       // Instantiate the communications port 
 
       private SerialPort port = new SerialPort("COM1", 9600, Parity.None, 8, StopBits.One);
 
       private SerialPort port = new SerialPort("COM5", 9600, Parity.None, 8, StopBits.One);
 
       static MainForm windowGUI;
 
 
      [STAThread]
 
      static void Main()
 
      {
 
          Application.SetCompatibleTextRenderingDefault(false);
0 comments (0 inline, 0 general)