Skip to content

Commit

Permalink
Revert "Merge branch 'develop' into release/6.6"
Browse files Browse the repository at this point in the history
This reverts commit 1b23439, reversing
changes made to c2aa9d7.
  • Loading branch information
farmerbriantee committed Jan 7, 2025
1 parent 1b23439 commit 68339b5
Show file tree
Hide file tree
Showing 90 changed files with 1,186 additions and 596 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AgOpenGPS - Guidance software

[![GitHub Release](https://img.shields.io/github/v/release/agopengps-official/AgOpenGPS)](https://github.com/agopengps-official/AgOpenGPS/releases/latest)
[![GitHub Release](https://img.shields.io/github/v/release/farmerbriantee/AgOpenGPS)](https://github.com/farmerbriantee/AgOpenGPS/releases/latest)

Ag Precision Mapping and Section Control Software

Expand All @@ -24,7 +24,7 @@ See the PCB repo for PCB layouts, firmware for steering and rate control, machin

## Installation

1. Download the [Most Stable AgOpenGPS Release](https://github.com/agopengps-official/AgOpenGPS/releases)
1. Download the [Most Stable AgOpenGPS Release](https://github.com/farmerbriantee/AgOpenGPS/releases)
2. Unzip or extract the contents to a folder (folder accessible by user not the root of C:\\)
Even on your desktop
3. Run AgOpenGPS.exe
Expand All @@ -43,11 +43,11 @@ In order to contribute to AgOpenGPS, follow these steps:

## Links

- [AgOpenGPS Wiki](https://github.com/agopengps-official/AgOpenGPS/wiki)
- [AgOpenGPS Wiki](https://github.com/farmerbriantee/AgOpenGPS/wiki)
- [AgOpenGPS Forum](https://discourse.agopengps.com/)
- [PCB and Firmware Repository](https://github.com/agopengps-official/Boards)
- [SK21 Rate Control Repository](https://github.com/agopengps-official/Rate_Control)
- [Hardware Wiki](https://github.com/agopengps-official/Boards/wiki)
- [PCB and Firmware Repository](https://github.com/AgHardware/Boards)
- [SK21 Rate Control Repository](https://github.com/AgHardware/Rate_Control)
- [AgHardware Wiki](https://github.com/AgHardware/Boards/wiki)

## License

Expand Down
30 changes: 16 additions & 14 deletions SourceCode/AgIO/Source/AgIO.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<!-- Only write to build log in one project (AgOpenGPS), otherwise GitVersion will fail -->
<WriteVersionInfoToBuildLog>false</WriteVersionInfoToBuildLog>
<!-- Only write to build log in one project (AgOpenGPS), otherwise GitVersion will fail -->
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -53,6 +53,10 @@
<ApplicationIcon>AgIO_ico.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Keypad, Version=5.2.3.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\References\Keypad.dll</HintPath>
</Reference>
<Reference Include="RepeatButtonControl, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\References\RepeatButtonControl.dll</HintPath>
Expand All @@ -67,6 +71,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Classes\CGLM.cs" />
<Compile Include="Classes\CLog.cs" />
<Compile Include="Classes\ListViewColumnSorterExt.cs" />
<Compile Include="Classes\CRadioChannel.cs" />
<Compile Include="Classes\CSettings.cs" />
Expand Down Expand Up @@ -266,6 +271,7 @@
<SubType>Designer</SubType>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand Down Expand Up @@ -397,18 +403,14 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\AgLibrary\AgLibrary.csproj">
<Project>{692b4970-37f1-4f02-8f7f-a514283fc399}</Project>
<Name>AgLibrary</Name>
</ProjectReference>
<ProjectReference Include="..\..\Keypad\Keypad.csproj">
<Project>{f1053bac-22c7-4e6f-a3ea-cc1e1fba9cb0}</Project>
<Name>Keypad</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="GitVersion.MsBuild" Version="5.12.0" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\packages\GitVersion.MsBuild.5.12.0\build\GitVersion.MsBuild.props" Condition="Exists('..\..\packages\GitVersion.MsBuild.5.12.0\build\GitVersion.MsBuild.props')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\GitVersion.MsBuild.5.12.0\build\GitVersion.MsBuild.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\GitVersion.MsBuild.5.12.0\build\GitVersion.MsBuild.props'))" />
<Error Condition="!Exists('..\..\packages\GitVersion.MsBuild.5.12.0\build\GitVersion.MsBuild.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\GitVersion.MsBuild.5.12.0\build\GitVersion.MsBuild.targets'))" />
</Target>
<Import Project="..\..\packages\GitVersion.MsBuild.5.12.0\build\GitVersion.MsBuild.targets" Condition="Exists('..\..\packages\GitVersion.MsBuild.5.12.0\build\GitVersion.MsBuild.targets')" />
</Project>
85 changes: 85 additions & 0 deletions SourceCode/AgIO/Source/Classes/CGLM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ public static bool CheckValueCm(this NumericUpDown numericUpDown, ref double val

public static class glm
{
public static byte[] Combine(byte[] first, byte[] second)
{
byte[] ret = new byte[first.Length + second.Length];
Buffer.BlockCopy(first, 0, ret, 0, first.Length);
Buffer.BlockCopy(second, 0, ret, first.Length, second.Length);
return ret;
}

//Regex file expression
public const string fileRegex = "(^(PRN|AUX|NUL|CON|COM[1-9]|LPT[1-9]|(\\.+)$)(\\..*)?$)|(([\\x00-\\x1f\\\\?*:\";‌​|/<>])+)|([\\.]+)";

Expand Down Expand Up @@ -141,5 +149,82 @@ public static double DistanceLonLat(double lon1, double lat1, double lon2, doubl
return angle * EarthMeanRadius;
}

//float functions
public static float acos(float x)
{
return (float)Math.Acos(x);
}

public static float acosh(float x)
{
if (x < 1f) return 0f;
return (float)Math.Log(x + Math.Sqrt((x * x) - 1f));
}

public static float asin(float x)
{
return (float)Math.Asin(x);
}

public static float asinh(float x)
{
return (x < 0f ? -1f : (x > 0f ? 1f : 0f)) * (float)Math.Log(Math.Abs(x) + Math.Sqrt(1f + (x * x)));
}

public static float atan(float y, float x)
{
return (float)Math.Atan2(y, x);
}

public static float atan(float y_over_x)
{
return (float)Math.Atan(y_over_x);
}

public static float atanh(float x)
{
if (Math.Abs(x) >= 1f) return 0;
return 0.5f * (float)Math.Log((1f + x) / (1f - x));
}

public static float cos(float angle)
{
return (float)Math.Cos(angle);
}

public static float cosh(float angle)
{
return (float)Math.Cosh(angle);
}

public static float toDegrees(float radians)
{
return radians * 57.295779513082325225835265587528f;
}

public static float toRadians(float degrees)
{
return degrees * 0.01745329251994329576923690766743f;
}

public static float sin(float angle)
{
return (float)Math.Sin(angle);
}

public static float sinh(float angle)
{
return (float)Math.Sinh(angle);
}

public static float tan(float angle)
{
return (float)Math.Tan(angle);
}

public static float tanh(float angle)
{
return (float)Math.Tanh(angle);
}
}
}
67 changes: 67 additions & 0 deletions SourceCode/AgIO/Source/Classes/CLog.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AgIO
{
public static class Log
{
public static StringBuilder sbEvent = new StringBuilder();

public static void EventWriter(string message)
{
sbEvent.Append(DateTime.Now.ToString("T"));
sbEvent.Append("-> ");
sbEvent.Append(message);
sbEvent.Append("\r");
}

public static void CheckLogSize(string logFile, int sizeLimit)
{
//system event log file
FileInfo txtfile = new FileInfo(logFile);
if (txtfile.Exists)
{
if (txtfile.Length > (sizeLimit)) // ## NOTE: 0.5MB max file size
{
StringBuilder sbF = new StringBuilder();
long bytes = txtfile.Length - sizeLimit;
bytes = (sizeLimit * 2) / 10 + bytes;
Log.EventWriter("Log File Reduced by: " + bytes.ToString());

//create some extra space
int bytesSoFar = 0;

using (StreamReader reader = new StreamReader(logFile))
{
try
{
//Date time line
while (!reader.EndOfStream)
{
bytesSoFar += reader.ReadLine().Length;
if (bytesSoFar > bytes)
break;
}

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

using (StreamWriter writer = new StreamWriter(logFile))
{
writer.WriteLine(sbF);
}
}
}
}

}
}
3 changes: 1 addition & 2 deletions SourceCode/AgIO/Source/Classes/CSettings.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using AgIO.Properties;
using AgLibrary.Logging;
using Microsoft.Win32;
using System;
using System.Configuration;
Expand Down Expand Up @@ -98,7 +97,7 @@ public static void Load()
if (!string.IsNullOrEmpty(profileDirectory) && !Directory.Exists(profileDirectory))
{
Directory.CreateDirectory(profileDirectory);
Log.EventWriter("Profile Dir Created\r");
Log.EventWriter("PRofile Dir Created\r");
}
}
catch (Exception ex)
Expand Down
1 change: 0 additions & 1 deletion SourceCode/AgIO/Source/Forms/Controls.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/AgIO/Source/Forms/FormEthernet.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.IO;
using System.Windows.Forms;
using AgLibrary.Logging;

namespace AgIO
{
Expand Down
5 changes: 2 additions & 3 deletions SourceCode/AgIO/Source/Forms/FormEventViewer.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.IO;
using System.Windows.Forms;
using AgLibrary.Logging;

namespace AgIO
{
Expand Down Expand Up @@ -37,7 +36,7 @@ private void FormEventViewer_Load(object sender, EventArgs e)

rtbLogViewer.AppendText(" **** Current Session Below ***** \r\n\r\n");

rtbLogViewer.AppendText(Log.sbEvents.ToString());
rtbLogViewer.AppendText(Log.sbEvent.ToString());
}

private void btnExit_Click(object sender, EventArgs e)
Expand Down Expand Up @@ -68,7 +67,7 @@ private void btnRefresh_Click(object sender, EventArgs e)

rtbLogViewer.AppendText(" **** Current Session Below ***** \r\n\r\n");

rtbLogViewer.AppendText(Log.sbEvents.ToString());
rtbLogViewer.AppendText(Log.sbEvent.ToString());
}
}
}
5 changes: 2 additions & 3 deletions SourceCode/AgIO/Source/Forms/FormLoop.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using AgIO.Properties;
using AgLibrary.Logging;
using Microsoft.Win32;
using System;
using System.Diagnostics;
Expand Down Expand Up @@ -343,8 +342,8 @@ public void FileSaveSystemEvents()
{
using (StreamWriter writer = new StreamWriter(Path.Combine(RegistrySettings.logsDirectory, "AgIO_Events_Log.txt"), true))
{
writer.Write(Log.sbEvents);
Log.sbEvents.Clear();
writer.Write(Log.sbEvent);
Log.sbEvent.Clear();
}
}

Expand Down
2 changes: 1 addition & 1 deletion SourceCode/AgIO/Source/Forms/FormNtrip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.Text;
using System.Threading;
using System.Windows.Forms;
using AgLibrary.Logging;

namespace AgIO
{
Expand Down Expand Up @@ -167,6 +166,7 @@ private void btnGetIP_Click(object sender, EventArgs e)
{
mf.YesMessageBox("Can't Find: " + actualIP);
Log.EventWriter("Catch -> Can't Find Caster IP" + ex.ToString());

}
}

Expand Down
2 changes: 1 addition & 1 deletion SourceCode/AgIO/Source/Forms/FormRadio.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.IO.Ports;
using System.Linq;
using System.Windows.Forms;
using AgLibrary.Logging;

namespace AgIO
{
Expand Down Expand Up @@ -156,6 +155,7 @@ private void btnOpenSerial_Click(object sender, EventArgs e)
{
mf.TimedMessageBox(3000, "Error opening port", ex.Message);
Log.EventWriter("Catch - > Error opening Radio port" + ex.ToString());

}

SetButtonState();
Expand Down
1 change: 0 additions & 1 deletion SourceCode/AgIO/Source/Forms/FormSerialMonitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.IO;
using System.IO.Ports;
using System.Windows.Forms;
using AgLibrary.Logging;

namespace AgIO
{
Expand Down
1 change: 0 additions & 1 deletion SourceCode/AgIO/Source/Forms/FormSerialPass.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.IO.Ports;
using System.Windows.Forms;
using AgLibrary.Logging;

namespace AgIO
{
Expand Down
Loading

0 comments on commit 68339b5

Please sign in to comment.