Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes back to Develop from Release/6.7 #696

Merged
merged 13 commits into from
Mar 10, 2025
3 changes: 1 addition & 2 deletions SourceCode/AgIO/Source/Forms/Controls.Designer.cs

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

3 changes: 1 addition & 2 deletions SourceCode/AgIO/Source/Forms/FormEthernet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ private void btnSerialCancel_Click(object sender, EventArgs e)
mf.YesMessageBox("AgIO will Restart to Enable UDP Networking Features");
Log.EventWriter("Program Reset: Start Ethernet Selected");

Application.Restart();
Environment.Exit(0);
Program.Restart();
Close();
}

Expand Down
3 changes: 1 addition & 2 deletions SourceCode/AgIO/Source/Forms/FormLoop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,7 @@ private void FormLoop_Load(object sender, EventArgs e)
{
Log.EventWriter("Program Reset: Saving or Selecting Profile");

Application.Restart();
Environment.Exit(0);
Program.Restart();
}
}
this.Text = "AgIO v" + Program.Version + " Profile: "
Expand Down
6 changes: 2 additions & 4 deletions SourceCode/AgIO/Source/Forms/FormNtrip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ private void cboxIsNTRIPOn_Click(object sender, EventArgs e)
mf.YesMessageBox("Restart of AgIO is Required - Restarting");
Log.EventWriter("Program Reset: Selecting NTRIP Feature");

Application.Restart();
Environment.Exit(0);
Program.Restart();
}

//get the ipv4 address only
Expand Down Expand Up @@ -265,8 +264,7 @@ private void btnSerialOK_Click(object sender, EventArgs e)
{
Log.EventWriter("Program Reset: Button Ok on Ntrip Form");

Application.Restart();
Environment.Exit(0);
Program.Restart();
}
}

Expand Down
3 changes: 1 addition & 2 deletions SourceCode/AgIO/Source/Forms/FormSerialPass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ private void btnSerialOK_Click(object sender, EventArgs e)

Log.EventWriter("Program Reset: Button OK on Serial Pass Form");

Application.Restart();
Environment.Exit(0);
Program.Restart();
Close();
}

Expand Down
3 changes: 1 addition & 2 deletions SourceCode/AgIO/Source/Forms/FormUDP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,7 @@ private void btnUDPOff_Click(object sender, EventArgs e)
mf.YesMessageBox("AgIO will Restart to Disable UDP Networking Features");
Log.EventWriter("Program Reset: Turning UDP OFF");

Application.Restart();
Environment.Exit(0);
Program.Restart();

Close();
}
Expand Down
58 changes: 31 additions & 27 deletions SourceCode/AgIO/Source/Program.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using AgIO.Properties;
using AgLibrary.Logging;
using Microsoft.Win32;
using AgLibrary.Logging;
using System;
using System.Configuration;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Threading;
using System.Windows.Forms;
Expand All @@ -13,7 +9,7 @@ namespace AgIO
{
internal static class Program
{
private static readonly Mutex Mutex = new Mutex(true, "{8F6F0AC4-B9A1-55fd-A8CF-72F04E6BDE8F}");
private static Mutex _mutex;

public static readonly string Version = Assembly.GetEntryAssembly().GetName().Version.ToString(3); // Major.Minor.Patch

Expand All @@ -23,31 +19,39 @@ internal static class Program
[STAThread]
private static void Main()
{
if (Mutex.WaitOne(TimeSpan.Zero, true))
using (_mutex = new Mutex(true, "{8F6F0AC4-B9A1-55fd-A8CF-72F04E6BDE8F}", out bool mutexCreated))
{
//load the profile name and set profile directory
RegistrySettings.Load();
if (mutexCreated)
{
//load the profile name and set profile directory
RegistrySettings.Load();

Log.EventWriter("Program Started: " + DateTime.Now.ToString("f", CultureInfo.InvariantCulture));
Log.EventWriter("AgIO Version: " + Application.ProductVersion.ToString(CultureInfo.InvariantCulture));
Log.EventWriter("Program Started: " + DateTime.Now.ToString("f", CultureInfo.InvariantCulture));
Log.EventWriter("AgIO Version: " + Application.ProductVersion.ToString(CultureInfo.InvariantCulture));

Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(RegistrySettings.culture);
Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(RegistrySettings.culture);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FormLoop());
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(RegistrySettings.culture);
Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(RegistrySettings.culture);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FormLoop());
}
}
}

// If the application needs to be restarted, it should be done via this method.
// Manually disposing the Mutex before calling Application.Restart() ensures
// that the Mutex is not still owned by the current application instance while
// the new application instance is being started.
// See: https://stackoverflow.com/a/9456822
public static void Restart()
{
if (_mutex != null)
{
_mutex.ReleaseMutex();
_mutex.Dispose();
_mutex = null;
Application.Restart();
}
}
}
}

//catch (System.Configuration.ConfigurationErrorsException ex)
//{
// // Corrupted XML! Delete the file, the user can just reload when this fails to appear. No need to worry them
// MessageBoxButtons btns = MessageBoxButtons.OK;
// System.Windows.Forms.MessageBox.Show("Error detected in config file - fixing it now, please close this and restart app", "Problem!", btns);
// string filename = ((ex.InnerException as System.Configuration.ConfigurationErrorsException)?.Filename) as string;
// System.IO.File.Delete(filename);
// Settings.Default.Reload();
// Application.Exit();
//}
9 changes: 9 additions & 0 deletions SourceCode/GPS/Culture/gStr.Designer.cs

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

2 changes: 1 addition & 1 deletion SourceCode/GPS/Culture/gStr.fr.resx
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ L'ordre dans lequel vous cliquez, sera l'ordre dans lequel ils apparaîtrons dan
<value>Afficher</value>
</data>
<data name="gsDistance" xml:space="preserve">
<value>Distance:</value>
<value>Distance</value>
</data>
<data name="gsDistanceToFlag" xml:space="preserve">
<value>Distance drapeau</value>
Expand Down
32 changes: 16 additions & 16 deletions SourceCode/GPS/Culture/gStr.hu.resx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
<value>A programról...</value>
</data>
<data name="gsAckermann" xml:space="preserve">
<value>Akermann</value>
<value>Ackermann</value>
</data>
<data name="gsActionHasBeenCancelled" xml:space="preserve">
<value>Művelet megszakítva</value>
Expand Down Expand Up @@ -169,7 +169,7 @@
<value>Antenna eltolás</value>
</data>
<data name="gsApplied" xml:space="preserve">
<value>Alkalmaz</value>
<value>Megművelt</value>
</data>
<data name="gsAquire" xml:space="preserve">
<value>Rátalálás</value>
Expand Down Expand Up @@ -234,7 +234,7 @@ A választott sorrend alapján fognak megjelenni alulról felfelé.</value>
<value>Fényerő</value>
</data>
<data name="gsBuild" xml:space="preserve">
<value>Épít</value>
<value>Létrehoz</value>
</data>
<data name="gsBuildAround" xml:space="preserve">
<value>Körbe épít</value>
Expand Down Expand Up @@ -312,10 +312,10 @@ A választott sorrend alapján fognak megjelenni alulról felfelé.</value>
<value>Nem sikerült az útvonalkészítés</value>
</data>
<data name="gsCountsPerDegree" xml:space="preserve">
<value>CPD osztószáma</value>
<value>CPD osztószám</value>
</data>
<data name="gsCoverage" xml:space="preserve">
<value>% művelve</value>
<value>lefedési cél %</value>
</data>
<data name="gsCreate" xml:space="preserve">
<value>Készít</value>
Expand All @@ -333,7 +333,7 @@ A választott sorrend alapján fognak megjelenni alulról felfelé.</value>
<value>Jelenlegi profil</value>
</data>
<data name="gsCurrentTurnSensor" xml:space="preserve">
<value>Impulzus szenzor</value>
<value>Ampermérő</value>
</data>
<data name="gsCurve" xml:space="preserve">
<value>Görbe</value>
Expand Down Expand Up @@ -396,7 +396,7 @@ A választott sorrend alapján fognak megjelenni alulról felfelé.</value>
<value>Fórum:</value>
</data>
<data name="gsDisplay" xml:space="preserve">
<value>Kijelző</value>
<value>Megjelenít</value>
</data>
<data name="gsDistance" xml:space="preserve">
<value>Távolság</value>
Expand Down Expand Up @@ -445,7 +445,7 @@ A választott sorrend alapján fognak megjelenni alulról felfelé.</value>
<comment>-4000 és 4000 közötti szám az A/D-tól</comment>
</data>
<data name="gsEnterCoordinatesForSimulator" xml:space="preserve">
<value>Szimulátor koordináták megadása (Bp 47.5 19)</value>
<value>Szimulátor koordináták megadása</value>
</data>
<data name="gsEnterFieldName" xml:space="preserve">
<value>Területnév megadása</value>
Expand Down Expand Up @@ -811,7 +811,7 @@ A választott sorrend alapján fognak megjelenni alulról felfelé.</value>
<value>Külső</value>
</data>
<data name="gsOverlap" xml:space="preserve">
<value>Átfedés:</value>
<value>Átfedés</value>
</data>
<data name="gsOverlapGap" xml:space="preserve">
<value>Átfedés / Kihagyás</value>
Expand Down Expand Up @@ -913,7 +913,7 @@ A választott sorrend alapján fognak megjelenni alulról felfelé.</value>
<value>Kevesebb pont</value>
</data>
<data name="gsRemain" xml:space="preserve">
<value>Megtart</value>
<value>Hátralévő</value>
</data>
<data name="gsRemoveOffset" xml:space="preserve">
<value>Eltolás törlése</value>
Expand Down Expand Up @@ -967,7 +967,7 @@ A választott sorrend alapján fognak megjelenni alulról felfelé.</value>
<value>Szakasz határvonalak</value>
</data>
<data name="gsSections" xml:space="preserve">
<value>Szakaszok:</value>
<value>Szakaszok</value>
</data>
<data name="gsSelectButtons" xml:space="preserve">
<value>Gombok választása</value>
Expand Down Expand Up @@ -1064,7 +1064,7 @@ A választott sorrend alapján fognak megjelenni alulról felfelé.</value>
Kapcsoló - Benyom be, Elenged ki</value>
</data>
<data name="gsSteerEnable" xml:space="preserve">
<value>Kényelmi kapcoló</value>
<value>Kényelmi kapcsoló</value>
</data>
<data name="gsSteerInReverse" xml:space="preserve">
<value>Kormányzás hátramenetben</value>
Expand Down Expand Up @@ -1118,7 +1118,7 @@ HASZNÁLAT SAJÁT FELELŐSSÉGRE.</value>
<value>Munkaeszköz jobbra</value>
</data>
<data name="gsToolsMenu" xml:space="preserve">
<value>Eszkö menü</value>
<value>Eszköz menü</value>
</data>
<data name="gsTopFieldView" xml:space="preserve">
<value>Terület felülnézete</value>
Expand Down Expand Up @@ -1181,10 +1181,10 @@ HASZNÁLAT SAJÁT FELELŐSSÉGRE.</value>
<value>Automata forduló kompenzálása</value>
</data>
<data name="gsUturnExtension" xml:space="preserve">
<value>Állítsd a hosszabbítás távolságát a rádius dupla tripla értékére</value>
<value>vonalhosszabbítás rádius 2x+</value>
</data>
<data name="gsUturnSmooth" xml:space="preserve">
<value>Állítsd a simítást a rádius három-négyszeres értékére</value>
<value>Omega forma simítása rádiusz 3x+</value>
</data>
<data name="gsVehiclegroupbox" xml:space="preserve">
<value>Jármű típus:</value>
Expand All @@ -1199,7 +1199,7 @@ HASZNÁLAT SAJÁT FELELŐSSÉGRE.</value>
<value>Nyugat</value>
</data>
<data name="gsWheelbase" xml:space="preserve">
<value>Tengelytáv:</value>
<value>Tengelytáv</value>
</data>
<data name="gsWidth" xml:space="preserve">
<value>Szélesség</value>
Expand Down
2 changes: 1 addition & 1 deletion SourceCode/GPS/Culture/gStr.it.resx
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@
<value>Schermo</value>
</data>
<data name="gsDistance" xml:space="preserve">
<value>Distanza:</value>
<value>Distanza</value>
</data>
<data name="gsDistanceToFlag" xml:space="preserve">
<value>Distanza da Punto Interesse</value>
Expand Down
2 changes: 1 addition & 1 deletion SourceCode/GPS/Culture/gStr.lt.resx
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@
<value>Ekranas</value>
</data>
<data name="gsDistance" xml:space="preserve">
<value>Atstumas:</value>
<value>Atstumas</value>
</data>
<data name="gsDistanceToFlag" xml:space="preserve">
<value>Atstumas iki žymeklio</value>
Expand Down
2 changes: 1 addition & 1 deletion SourceCode/GPS/Culture/gStr.lv.resx
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@
<value>Parādīt</value>
</data>
<data name="gsDistance" xml:space="preserve">
<value>Attālums:</value>
<value>Attālums</value>
</data>
<data name="gsDistanceToFlag" xml:space="preserve">
<value>Attālums līdz karogam</value>
Expand Down
7 changes: 5 additions & 2 deletions SourceCode/GPS/Culture/gStr.nl.resx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@
<data name="gsAgressiveness" xml:space="preserve">
<value>Agressiviteit</value>
</data>
<data name="gsAllSettings" xml:space="preserve">
<value>Open alle instellingen</value>
</data>
<data name="gsAntennaHeight" xml:space="preserve">
<value>Antenne Hoogte</value>
</data>
Expand All @@ -169,7 +172,7 @@
<value>Weet u het zeker?</value>
</data>
<data name="gsArea" xml:space="preserve">
<value>Oppervlakte</value>
<value>Areaal</value>
</data>
<data name="gsArrangeText" xml:space="preserve">
<value>Gebruik de knoppen aan de linkerkant die u in het menu wilt laten verschijnen (de rechterkant).
Expand Down Expand Up @@ -369,7 +372,7 @@ De volgorde waarin u ze indrukt, is de volgorde waarin ze van onder naar boven i
<value>Activeer Knoppen</value>
</data>
<data name="gsDistance" xml:space="preserve">
<value>Afstand:</value>
<value>Afstand</value>
</data>
<data name="gsDistanceToFlag" xml:space="preserve">
<value>Afstand tot Vlag</value>
Expand Down
Loading
Loading