Skip to content

Commit

Permalink
Merge pull request #502 from farmerbriantee/nmeaLogGone
Browse files Browse the repository at this point in the history
Remove NMEA Log from AOG
  • Loading branch information
farmerbriantee authored Dec 30, 2024
2 parents f5b1a67 + 6beb346 commit ac8bbd3
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 242 deletions.
51 changes: 2 additions & 49 deletions SourceCode/GPS/Forms/FormGPS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public partial class FormGPS : Form
public bool isJobStarted = false, isBtnAutoSteerOn, isLidarBtnOn = true;

//if we are saving a file
public bool isSavingFile = false, isLogNMEA = false;
public bool isSavingFile = false;

//texture holders
public uint[] texture;
Expand Down Expand Up @@ -446,7 +446,7 @@ private void FormGPS_Load(object sender, EventArgs e)
{
if (txtfile.Length > (100000)) // ## NOTE: 0.1MB max file size
{
Log.System.WriteRaw("Missed Log File Reduced to 50Kb\r");
Log.System.WriteRaw("Missed NMEA Log File Reduced to 50Kb\r");
StringBuilder sbF = new StringBuilder();
long lines = txtfile.Length - 50000;

Expand Down Expand Up @@ -477,53 +477,6 @@ private void FormGPS_Load(object sender, EventArgs e)
}
}
}
else
{
Log.System.WriteRaw("NMEA Missed Log File Created\r");
}


//system event log file
txtfile = new FileInfo(Path.Combine(logsDirectory, "NMEA_Log.txt"));
if (txtfile.Exists)
{
if (txtfile.Length > (200000)) // ## NOTE: 0.2MB max file size
{
Log.System.WriteRaw("NMEA Log File Reduced to 50Kb\r");
StringBuilder sbF = new StringBuilder();
long lines = txtfile.Length - 100000;

//create some extra space
lines /= 22;

using (StreamReader reader = new StreamReader(Path.Combine(logsDirectory, "NMEA_Log.txt")))
{
try
{
//Date time line
for (long i = 0; i < lines; i++)
{
reader.ReadLine();
}

while (!reader.EndOfStream)
{
sbF.AppendLine(reader.ReadLine());
}
}
catch { }
}

using (StreamWriter writer = new StreamWriter(Path.Combine(logsDirectory, "NMEA_Log.txt")))
{
writer.WriteLine(sbF);
}
}
}
else
{
Log.System.WriteRaw("NMEA Log File Created\r");
}

//make sure current field directory exists, null if not
currentFieldDirectory = Settings.Default.setF_CurrentDir;
Expand Down
5 changes: 1 addition & 4 deletions SourceCode/GPS/Forms/GUI.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

97 changes: 1 addition & 96 deletions SourceCode/GPS/Forms/SaveOpen.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion SourceCode/GPS/Forms/Settings/ConfigVehicle.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ac8bbd3

Please sign in to comment.