Hi!
I’ve been editing AOG code using VS22 in order to add some things that are useful to me and maybe useful to someone else.
1. Add a timestamp to the Elevation.txt file
2. Add elevation data to the Flags.txt file and KML file
3. Show elevation in the Flag window
In a future I think elevation data can be corrected to consider roll and pitch.
I don’t know Git and don’t know how to properly use VS to make pull requests from there.
I know this is not the proper way, and I am learning how to use github.
But this are the changes I’ve done and maybe someone can tell me if they are ok and useful:
Changes for adding timestamp to Elevation.txt
In SaveOpen.Designer.cs
line 2039 changed: writer.WriteLine(“Latitude,Longitude,Elevation,Quality,Easting,Northing,Heading,Roll,TimeStamp”);
In Position.Designer.cs
line 1102 added: + DateTime.Now.ToString(CultureInfo.InvariantCulture)+
Changes to add elevation to Flags
In FormFlags.cs [Design]
Added 2 labels: "Elev: " lablElevStart
Located below Lat and Long
In CShapeFile.cs
line 365 changed: mf.flagPts.Add(new CFlag(tt.Lat, tt.Lon,Math.Round((mf.pn.altitude-mf.vehicle.antennaHeight),4), Easting, Northing, 0, 0, mf.flagPts.Count+1, (mf.flagPts.Count + 1).ToString()));
In SaveOpen.Designer.cs
line 1460 changed: CFlag flagPt = new CFlag(lat, longi, elev, east, nort, head, color, ID, notes);
line 2136 added: writer.WriteLine(“Latitude,Longitude,Elevation,Easting,Northing,Heading,Color, ID,Notes”);
line 2523 added: flagPts[i].elevation.ToString(CultureInfo.InvariantCulture) + “,” +
line 2652 added: double elev = Math.Round((pn.altitude - vehicle.antennaHeight), 4);
line 2688 changed: writer.WriteLine(@“ " + lon.ToString(CultureInfo.InvariantCulture) + “,” + lat.ToString(CultureInfo.InvariantCulture) + “,” + elev.ToString(CultureInfo.InvariantCulture) +
@” “);
line 2701 added: double elev = Math.Round((pn.altitude - vehicle.antennaHeight), 4);
line 2734 changed: writer.WriteLine(@” " +
flagPts[flagNumber-1].longitude.ToString(CultureInfo.InvariantCulture) + “,” + flagPts[flagNumber-1].latitude.ToString(CultureInfo.InvariantCulture) + “,” + elev.ToString(CultureInfo.InvariantCulture) +
@“ “);
line 2747 added: double elev = Math.Round((pn.altitude - vehicle.antennaHeight), 4);
line 2772 changed: writer.WriteLine(@” " +
lon.ToString(CultureInfo.InvariantCulture) + “,” + lat.ToString(CultureInfo.InvariantCulture) + “,” + elev.ToString(CultureInfo.InvariantCulture) +
@” ");
line 2989 changed: kml.WriteElementString(“coordinates”, flagPts[i].longitude.ToString(CultureInfo.InvariantCulture) +
“,” + flagPts[i].latitude.ToString(CultureInfo.InvariantCulture) + “,” + flagPts[i].elevation.ToString(CultureInfo.InvariantCulture);
In Controls.Designer.cs
line 995 changed: CFlag flagPt = new CFlag(pn.latitude, pn.longitude, Math.Round((mf.pn.altitude-mf.vehicle.antennaHeight),4), pn.fix.easting, pn.fix.northing,
fixHeading, flagColor, nextflag, nextflag.ToString()); //added pn.altitude
line 2522 added: flagPts[i].elevation.ToString(CultureInfo.InvariantCulture) + “,” +
In CFlag.cs
line 12 added: public double elevation = 0;
line 27 changed: public CFlag(double _lati, double _longi, double _elev, double _easting, double _northing, double _heading, int _color, int _ID, string _notes = “Notes”)
line 31 added: elevation = Math.Round(_elev, 7);
in FormEnterFlag.cs
line 70 changed: CFlag flagPt = new CFlag((double)nudLatitude.Value, (double)nudLongitude.Value, Math.Round((mf.pn.altitude - mf.vehicle.antennaHeight), east, nort, 0, flagColor, nextflag, (nextflag).ToString());