diff --git a/AeroWizard/AeroWizard/AeroWizard.csproj b/AeroWizard/AeroWizard/AeroWizard.csproj index 19ad036..8052163 100644 --- a/AeroWizard/AeroWizard/AeroWizard.csproj +++ b/AeroWizard/AeroWizard/AeroWizard.csproj @@ -93,8 +93,7 @@ - ..\..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/AeroWizard/AeroWizard/Native/DesktopWindowManager.cs b/AeroWizard/AeroWizard/Native/DesktopWindowManager.cs index 360dca5..00e026d 100644 --- a/AeroWizard/AeroWizard/Native/DesktopWindowManager.cs +++ b/AeroWizard/AeroWizard/Native/DesktopWindowManager.cs @@ -399,7 +399,13 @@ namespace Vanara.Interop.DesktopWindowManager { lock (_lock) { - try { ((EventHandler)eventHandlerList[keys[idx]]).Invoke(null, EventArgs.Empty); } + try + { + if (((EventHandler)eventHandlerList[keys[idx]]) != null) + { + ((EventHandler)eventHandlerList[keys[idx]]).Invoke(null, EventArgs.Empty); + } + } catch { }; } } diff --git a/AeroWizard/AeroWizard/packages.config b/AeroWizard/AeroWizard/packages.config index 0bbf652..2bc3b5b 100644 --- a/AeroWizard/AeroWizard/packages.config +++ b/AeroWizard/AeroWizard/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/AirScout.AircraftPositions/AirScout.AircraftPositions.csproj b/AirScout.AircraftPositions/AirScout.AircraftPositions.csproj index 10aade2..2769597 100644 --- a/AirScout.AircraftPositions/AirScout.AircraftPositions.csproj +++ b/AirScout.AircraftPositions/AirScout.AircraftPositions.csproj @@ -33,8 +33,7 @@ - ..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/AirScout.AircraftPositions/AircraftPositionDatabaseMaintainer.cs b/AirScout.AircraftPositions/AircraftPositionDatabaseMaintainer.cs index 618e671..b1e75bc 100644 --- a/AirScout.AircraftPositions/AircraftPositionDatabaseMaintainer.cs +++ b/AirScout.AircraftPositions/AircraftPositionDatabaseMaintainer.cs @@ -132,9 +132,9 @@ namespace AirScout.AircraftPositions } while (!this.CancellationPending); if (this.CancellationPending) - this.ReportProgress(0, "Cancelled."); + this.ReportProgress(0, StartOptions.Name + "cancelled."); else - this.ReportProgress(0, "Finished."); + this.ReportProgress(0, StartOptions.Name + " finished."); } #endregion diff --git a/AirScout.AircraftPositions/packages.config b/AirScout.AircraftPositions/packages.config index 0bbf652..2bc3b5b 100644 --- a/AirScout.AircraftPositions/packages.config +++ b/AirScout.AircraftPositions/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/AirScout.Aircrafts/AirScout.Aircrafts.csproj b/AirScout.Aircrafts/AirScout.Aircrafts.csproj index 5518fef..b8ce939 100644 --- a/AirScout.Aircrafts/AirScout.Aircrafts.csproj +++ b/AirScout.Aircrafts/AirScout.Aircrafts.csproj @@ -33,8 +33,7 @@ - ..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/AirScout.Aircrafts/AircraftDatabaseUpdater.cs b/AirScout.Aircrafts/AircraftDatabaseUpdater.cs index 03bf150..e9fa3fb 100644 --- a/AirScout.Aircrafts/AircraftDatabaseUpdater.cs +++ b/AirScout.Aircrafts/AircraftDatabaseUpdater.cs @@ -359,9 +359,9 @@ namespace AirScout.Aircrafts } while (!this.CancellationPending && (StartOptions.Options == BACKGROUNDUPDATERSTARTOPTIONS.RUNPERIODICALLY)); if (this.CancellationPending) - this.ReportProgress(0, "Cancelled."); + this.ReportProgress(0, StartOptions.Name + " cancelled."); else - this.ReportProgress(0, "Finished."); + this.ReportProgress(0, StartOptions.Name + " finished."); } #endregion diff --git a/AirScout.Aircrafts/packages.config b/AirScout.Aircrafts/packages.config index 0bbf652..2bc3b5b 100644 --- a/AirScout.Aircrafts/packages.config +++ b/AirScout.Aircrafts/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/AirScout.Core/AirScout.Core.csproj b/AirScout.Core/AirScout.Core.csproj index 491cc2e..92d4100 100644 --- a/AirScout.Core/AirScout.Core.csproj +++ b/AirScout.Core/AirScout.Core.csproj @@ -32,6 +32,9 @@ 4 + + ..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll + diff --git a/AirScout.Core/packages.config b/AirScout.Core/packages.config index 4b05315..2bc3b5b 100644 --- a/AirScout.Core/packages.config +++ b/AirScout.Core/packages.config @@ -1,4 +1,5 @@  + \ No newline at end of file diff --git a/AirScout.PlaneFeeds.Plugin.FlexJSON/AirScout.PlaneFeeds.Plugin.FlexJSON.csproj b/AirScout.PlaneFeeds.Plugin.FlexJSON/AirScout.PlaneFeeds.Plugin.FlexJSON.csproj index c518440..821cdf1 100644 --- a/AirScout.PlaneFeeds.Plugin.FlexJSON/AirScout.PlaneFeeds.Plugin.FlexJSON.csproj +++ b/AirScout.PlaneFeeds.Plugin.FlexJSON/AirScout.PlaneFeeds.Plugin.FlexJSON.csproj @@ -34,6 +34,9 @@ 4 + + ..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll + diff --git a/AirScout.PlaneFeeds.Plugin.FlexJSON/packages.config b/AirScout.PlaneFeeds.Plugin.FlexJSON/packages.config index 7809c60..caa3fff 100644 --- a/AirScout.PlaneFeeds.Plugin.FlexJSON/packages.config +++ b/AirScout.PlaneFeeds.Plugin.FlexJSON/packages.config @@ -2,4 +2,5 @@ + \ No newline at end of file diff --git a/AirScout.PlaneFeeds.Plugin.OpenSky/AirScout.PlaneFeeds.Plugin.OpenSky.csproj b/AirScout.PlaneFeeds.Plugin.OpenSky/AirScout.PlaneFeeds.Plugin.OpenSky.csproj index c4e2b48..678b5fa 100644 --- a/AirScout.PlaneFeeds.Plugin.OpenSky/AirScout.PlaneFeeds.Plugin.OpenSky.csproj +++ b/AirScout.PlaneFeeds.Plugin.OpenSky/AirScout.PlaneFeeds.Plugin.OpenSky.csproj @@ -34,6 +34,12 @@ 4 + + ..\packages\BouncyCastle.1.8.5\lib\BouncyCastle.Crypto.dll + + + ..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll + @@ -52,6 +58,7 @@ True Settings.settings + diff --git a/AirScout.PlaneFeeds.Plugin.OpenSky/OpenSky.cs b/AirScout.PlaneFeeds.Plugin.OpenSky/OpenSky.cs index a9b123d..b3f0efa 100644 --- a/AirScout.PlaneFeeds.Plugin.OpenSky/OpenSky.cs +++ b/AirScout.PlaneFeeds.Plugin.OpenSky/OpenSky.cs @@ -14,6 +14,7 @@ using System.Web.Script.Serialization; using System.Xml.Linq; using System.Xml.Serialization; using System.Collections; +using Newtonsoft.Json; //TODO: Rename namespace to a name of your choice namespace AirScout.PlaneFeeds.Plugin.OpenSky @@ -54,7 +55,7 @@ namespace AirScout.PlaneFeeds.Plugin.OpenSky [Browsable(true)] [CategoryAttribute("Web Feed")] [DescriptionAttribute("Base URL for website.")] - [DefaultValue("http://opensky-network.org/api/states/all?lamin=%MINLAT%&lomin=%MINLON%&lamax=%MAXLAT%&lomax=%MAXLON%")] + [DefaultValue("https://opensky-network.org/api/states/all?lamin=%MINLAT%&lomin=%MINLON%&lamax=%MAXLAT%&lomax=%MAXLON%")] public string URL { get; set; } [Browsable(true)] @@ -236,7 +237,7 @@ namespace AirScout.PlaneFeeds.Plugin.OpenSky "For details see https://opensky-network.org.\n\n" + "As this is a community network, please consider to run a personal ADSB-receiver and to contribute your data to this network.\n\n" + "This webfeed forces TLS1.2 transport layer security. Though this plugin is compiled for .NET4.0 it needs .NET4.5 or higher installed on this machine to work.\n\n" + - "This webfeed will probably not work on early Windows XP and Linux/Mono systems"; + "This webfeed will probably not work on Windows XP and Linux/Mono systems"; } } public bool HasSettings @@ -341,18 +342,19 @@ namespace AirScout.PlaneFeeds.Plugin.OpenSky String url = VC.ReplaceAllVars(Settings.URL); Console.WriteLine("[" + this.GetType().Name + "]: Creating web request: " + url); // this will only run on .NET 4.0 if you have installed .NET 4.5 or later frameworks on your machine! - ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072; - HttpWebRequest webrequest = (HttpWebRequest)HttpWebRequest.Create(url); - webrequest.Timeout = Settings.Timeout * 1000; - webrequest.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0"; - webrequest.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"; - Console.WriteLine("[" + this.GetType().Name + "]: Getting web response"); - HttpWebResponse webresponse = (HttpWebResponse)webrequest.GetResponse(); - Console.WriteLine("[" + this.GetType().Name + "]: Reading stream"); - using (StreamReader sr = new StreamReader(webresponse.GetResponseStream())) - { - json = sr.ReadToEnd(); - } + // ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072; + // HttpWebRequest webrequest = (HttpWebRequest)HttpWebRequest.Create(url); + // webrequest.Timeout = Settings.Timeout * 1000; + // webrequest.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0"; + // webrequest.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"; + // Console.WriteLine("[" + this.GetType().Name + "]: Getting web response"); + // HttpWebResponse webresponse = (HttpWebResponse)webrequest.GetResponse(); + // Console.WriteLine("[" + this.GetType().Name + "]: Reading stream"); + // using (StreamReader sr = new StreamReader(webresponse.GetResponseStream())) + // { + // json = sr.ReadToEnd(); + // } + json = OSNTlsClient.DownloadFile(url, Settings.Timeout * 1000); // save raw data to file if enabled if (Settings.SaveToFile) { @@ -362,8 +364,9 @@ namespace AirScout.PlaneFeeds.Plugin.OpenSky } } Console.WriteLine("[" + this.GetType().Name + "]: Analyzing data"); - JavaScriptSerializer js = new JavaScriptSerializer(); - dynamic root = js.Deserialize(json); + // JavaScriptSerializer js = new JavaScriptSerializer(); + // dynamic root = js.Deserialize(json); + dynamic root = JsonConvert.DeserializeObject(json); try { // analyze json string for planes data @@ -376,14 +379,7 @@ namespace AirScout.PlaneFeeds.Plugin.OpenSky // different handling of reading JSON between Windows (Array) & Linux (ArrayList) // access to data values itself is the same int len = 0; - if (ac.GetType() == typeof(ArrayList)) - { - len = ac.Count; - } - else if (ac.GetType() == typeof(Object[])) - { - len = ac.Length; - } + len = ac.Count; // skip if too few fields in record if (len < 17) continue; @@ -428,7 +424,7 @@ namespace AirScout.PlaneFeeds.Plugin.OpenSky } catch (Exception ex) { - // do nothing if property is not found + Console.WriteLine("[" + System.Reflection.MethodBase.GetCurrentMethod().Name + "]" + ex.Message); } Console.WriteLine("[" + this.GetType().Name + "]: Returning " + planes.Count + " planes"); return planes; diff --git a/AirScout.PlaneFeeds.Plugin.OpenSky/Properties/AssemblyInfo.cs b/AirScout.PlaneFeeds.Plugin.OpenSky/Properties/AssemblyInfo.cs index 5084c27..b85de67 100644 --- a/AirScout.PlaneFeeds.Plugin.OpenSky/Properties/AssemblyInfo.cs +++ b/AirScout.PlaneFeeds.Plugin.OpenSky/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // indem Sie "*" wie unten gezeigt eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.3.0.0")] -[assembly: AssemblyFileVersion("1.3.0.0")] +[assembly: AssemblyVersion("1.3.3.0")] +[assembly: AssemblyFileVersion("1.3.3.0")] diff --git a/AirScout.PlaneFeeds.Plugin.OpenSky/TLS.cs b/AirScout.PlaneFeeds.Plugin.OpenSky/TLS.cs new file mode 100644 index 0000000..240b510 --- /dev/null +++ b/AirScout.PlaneFeeds.Plugin.OpenSky/TLS.cs @@ -0,0 +1,155 @@ +using Org.BouncyCastle.Crypto.Tls; +using Org.BouncyCastle.Security; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Net.Sockets; +using System.Text; +using System.Text.RegularExpressions; + +namespace System.Net +{ + class OSNTlsClient : DefaultTlsClient + { + string HostName; + + public OSNTlsClient(string hostname) + { + HostName = hostname; + } + + public override TlsAuthentication GetAuthentication() + { + TlsAuthentication auth = new MyTlsAuthentication(); + return auth; + } + + public override void NotifyNewSessionTicket(NewSessionTicket newSessionTicket) + { + base.NotifyNewSessionTicket(newSessionTicket); + } + + public override IDictionary GetClientExtensions() + { + var clientExtensions = base.GetClientExtensions(); + /* + List servers = new List(); + servers.Add(new ServerName(NameType.host_name, HostName)); + TlsExtensionsUtilities.AddServerNameExtension(clientExtensions, new ServerNameList(servers)); + */ + return clientExtensions; + } + + public static string DownloadFile (string url, int timeout) + { + string response = ""; + Uri uri = null; + // try to pasre url + try + { + uri = new Uri(url); + } + catch (Exception ex) + { + return ex.Message; + } + // create new TCP-Client + using (var client = new TcpClient(uri.Host, uri.Port)) + { + var sr = new SecureRandom(); + var cl = new OSNTlsClient(uri.Host); + var protocol = new TlsClientProtocol(client.GetStream(), sr); + protocol.Connect(cl); + + using (var stream = protocol.Stream) + { + var hdr = new StringBuilder(); + hdr.AppendLine("GET " + uri.PathAndQuery + " HTTP/1.1"); + hdr.AppendLine("Host: " + uri.Host); + hdr.AppendLine("Content-Type: text/json; charset=utf-8"); + hdr.AppendLine("Connection: close"); + hdr.AppendLine(); + + var dataToSend = Encoding.ASCII.GetBytes(hdr.ToString()); + + stream.Write(dataToSend, 0, dataToSend.Length); + // set stop watch as timout + Stopwatch st = new Stopwatch(); + st.Start(); + //read header bytewise + string header = ""; + int totalRead = 0; + byte[] buff = new byte[1]; + do + { + totalRead = stream.Read(buff, 0, buff.Length); + header += Encoding.ASCII.GetString(buff); + if (st.ElapsedMilliseconds > timeout) + throw new TimeoutException("Connection to " + url + " timed out."); + } + while (!header.Contains("\r\n\r\n")); + int contentlength = 0; + if (header.Contains("Transfer-Encoding: chunked")) + { + // chunked transfer, first line should contain content length + string strcontentlength = ""; + do + { + totalRead = stream.Read(buff, 0, buff.Length); + strcontentlength += Encoding.ASCII.GetString(buff, 0, buff.Length); + if (st.ElapsedMilliseconds > timeout) + throw new TimeoutException("Connection to " + url + " timed out."); + } + while (!strcontentlength.Contains("\r\n")); + strcontentlength = strcontentlength.Replace("\r\n", ""); + contentlength = int.Parse(strcontentlength, System.Globalization.NumberStyles.HexNumber); + } + else + { + // get content length from header + Regex strcontentlength = new Regex("(?<=Content-Length:\\s)\\d+", RegexOptions.IgnoreCase); + contentlength = int.Parse(strcontentlength.Match(header).Value); + } + // re-assign buffer + // read response + buff = new byte[1000]; + totalRead = 0; + do + { + int bytesRead = stream.Read(buff, 0, buff.Length); + string part = Encoding.UTF8.GetString(buff, 0, bytesRead); + Console.WriteLine(part); + response += part; + totalRead += bytesRead; + if (st.ElapsedMilliseconds > timeout) + throw new TimeoutException("Connection to " + url + " timed out."); + } + while (totalRead < contentlength); + // cut response at the end + if (response.Contains("\r\n")) + { + response = response.Substring(0, response.IndexOf("\r\n")); + } + st.Stop(); + } + } + return response; + } + } + + class MyTlsAuthentication : TlsAuthentication + { + public TlsCredentials GetClientCredentials(CertificateRequest certificateRequest) + { + return null; + } + + public void NotifyServerCertificate(Certificate serverCertificate) + { + } + } + +} diff --git a/AirScout.PlaneFeeds.Plugin.OpenSky/packages.config b/AirScout.PlaneFeeds.Plugin.OpenSky/packages.config index 7809c60..03bdb1c 100644 --- a/AirScout.PlaneFeeds.Plugin.OpenSky/packages.config +++ b/AirScout.PlaneFeeds.Plugin.OpenSky/packages.config @@ -1,5 +1,7 @@  + + \ No newline at end of file diff --git a/AirScout.PlaneFeeds.Plugin.PlaneFinder/AirScout.PlaneFeeds.Plugin.PlaneFinder.csproj b/AirScout.PlaneFeeds.Plugin.PlaneFinder/AirScout.PlaneFeeds.Plugin.PlaneFinder.csproj index fb1901c..d04d395 100644 --- a/AirScout.PlaneFeeds.Plugin.PlaneFinder/AirScout.PlaneFeeds.Plugin.PlaneFinder.csproj +++ b/AirScout.PlaneFeeds.Plugin.PlaneFinder/AirScout.PlaneFeeds.Plugin.PlaneFinder.csproj @@ -34,6 +34,9 @@ 4 + + ..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll + diff --git a/AirScout.PlaneFeeds.Plugin.PlaneFinder/PlaneFinder.cs b/AirScout.PlaneFeeds.Plugin.PlaneFinder/PlaneFinder.cs index 8e6e9b9..e4baa6c 100644 --- a/AirScout.PlaneFeeds.Plugin.PlaneFinder/PlaneFinder.cs +++ b/AirScout.PlaneFeeds.Plugin.PlaneFinder/PlaneFinder.cs @@ -14,6 +14,7 @@ using System.Web.Script.Serialization; using System.Collections; using System.Xml.Serialization; using System.Xml.Linq; +using Newtonsoft.Json; namespace AirScout.PlaneFeeds.Plugin.PlaneFinder { @@ -329,13 +330,19 @@ namespace AirScout.PlaneFeeds.Plugin.PlaneFinder } } Console.WriteLine("[" + this.GetType().Name + "]: Analyzing data"); - JavaScriptSerializer js = new JavaScriptSerializer(); - dynamic root = js.Deserialize(json); try { + Console.WriteLine("[" + this.GetType().Name + "]: Deserializing data from JSON"); + + // JavaScriptSerializer js = new JavaScriptSerializer(); + // dynamic root = js.Deserialize(json); + dynamic root = JsonConvert.DeserializeObject(json); + Console.WriteLine("[" + this.GetType().Name + "]: Created object from JSON is " + root.GetType().ToString()); // analyze json string for planes data // get the planes position list + Console.WriteLine("[" + this.GetType().Name + "]: Getting root of planes list"); var aclist = root["planes"]; + Console.WriteLine("[" + this.GetType().Name + "]: Created root object is " + aclist.GetType().ToString()); foreach (var ac in aclist) { try @@ -343,20 +350,13 @@ namespace AirScout.PlaneFeeds.Plugin.PlaneFinder // different handling of reading JSON between Windows (Array) & Linux (ArrayList) // access to data values itself is the same int len = 0; - if ( ac.Value.GetType() == typeof(ArrayList)) - { - len = ac.Value.Count; - } - else if (ac.Value.GetType() == typeof(Object[])) - { - len = ac.Value.Length; - } + len = ac.Value.Count; // skip if too few fields in record if (len < 13) continue; PlaneFeedPluginPlaneInfo plane = new PlaneFeedPluginPlaneInfo(); // get hex first - plane.Hex = ac.Key.ToString().Trim().Replace("\"",""); + plane.Hex = ac.Name.Trim().Replace("\"",""); // get position plane.Lat = ReadPropertyDouble(ac, 4); plane.Lon = ReadPropertyDouble(ac, 5); @@ -389,13 +389,28 @@ namespace AirScout.PlaneFeeds.Plugin.PlaneFinder } catch (Exception ex) { - Console.WriteLine("[" + System.Reflection.MethodBase.GetCurrentMethod().Name + "]" + ex.Message); + Console.WriteLine("[" + this.GetType().Name + "]: " + ex.Message); } } } catch (Exception ex) { - // do nothing if property is not found + string filename = args.TmpDirectory + Path.DirectorySeparatorChar + this.GetType().Name + "_" + DateTime.UtcNow.ToString("yyyy-MM-dd HH_mm_ss") + ".json"; + Console.WriteLine("[" + this.GetType().Name + "]: " + ex.Message + "\n\nJSON response saved as: " + filename); + // save the JSON file + try + { + using (StreamWriter sw = new StreamWriter(filename)) + { + sw.WriteLine(json); + } + } + catch + { + // do nothing if saving fails + } + // forward exception to parent thread + throw new Exception(ex.Message, ex.InnerException); } Console.WriteLine("[" + this.GetType().Name + "]: Returning " + planes.Count + " planes"); return planes; diff --git a/AirScout.PlaneFeeds.Plugin.PlaneFinder/Properties/AssemblyInfo.cs b/AirScout.PlaneFeeds.Plugin.PlaneFinder/Properties/AssemblyInfo.cs index ab9fcca..565abd7 100644 --- a/AirScout.PlaneFeeds.Plugin.PlaneFinder/Properties/AssemblyInfo.cs +++ b/AirScout.PlaneFeeds.Plugin.PlaneFinder/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // indem Sie "*" wie unten gezeigt eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.3.1.1")] -[assembly: AssemblyFileVersion("1.3.1.1")] +[assembly: AssemblyVersion("1.3.2.0")] +[assembly: AssemblyFileVersion("1.3.2.0")] diff --git a/AirScout.PlaneFeeds.Plugin.PlaneFinder/packages.config b/AirScout.PlaneFeeds.Plugin.PlaneFinder/packages.config index 7809c60..caa3fff 100644 --- a/AirScout.PlaneFeeds.Plugin.PlaneFinder/packages.config +++ b/AirScout.PlaneFeeds.Plugin.PlaneFinder/packages.config @@ -2,4 +2,5 @@ + \ No newline at end of file diff --git a/AirScout.PlaneFeeds.Plugin.RB24/AirScout.PlaneFeeds.Plugin.RB24.csproj b/AirScout.PlaneFeeds.Plugin.RB24/AirScout.PlaneFeeds.Plugin.RB24.csproj index 6e09012..11b1bd4 100644 --- a/AirScout.PlaneFeeds.Plugin.RB24/AirScout.PlaneFeeds.Plugin.RB24.csproj +++ b/AirScout.PlaneFeeds.Plugin.RB24/AirScout.PlaneFeeds.Plugin.RB24.csproj @@ -34,6 +34,9 @@ 4 + + ..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll + diff --git a/AirScout.PlaneFeeds.Plugin.RB24/packages.config b/AirScout.PlaneFeeds.Plugin.RB24/packages.config index 7809c60..caa3fff 100644 --- a/AirScout.PlaneFeeds.Plugin.RB24/packages.config +++ b/AirScout.PlaneFeeds.Plugin.RB24/packages.config @@ -2,4 +2,5 @@ + \ No newline at end of file diff --git a/AirScout.PlaneFeeds.Plugin.RTL1090/AirScout.PlaneFeeds.Plugin.RTL1090.csproj b/AirScout.PlaneFeeds.Plugin.RTL1090/AirScout.PlaneFeeds.Plugin.RTL1090.csproj index 7e62355..49fa2b8 100644 --- a/AirScout.PlaneFeeds.Plugin.RTL1090/AirScout.PlaneFeeds.Plugin.RTL1090.csproj +++ b/AirScout.PlaneFeeds.Plugin.RTL1090/AirScout.PlaneFeeds.Plugin.RTL1090.csproj @@ -34,6 +34,9 @@ 4 + + ..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll + diff --git a/AirScout.PlaneFeeds.Plugin.RTL1090/packages.config b/AirScout.PlaneFeeds.Plugin.RTL1090/packages.config index 7809c60..caa3fff 100644 --- a/AirScout.PlaneFeeds.Plugin.RTL1090/packages.config +++ b/AirScout.PlaneFeeds.Plugin.RTL1090/packages.config @@ -2,4 +2,5 @@ + \ No newline at end of file diff --git a/AirScout.PlaneFeeds.Plugin.Template/AirScout.PlaneFeeds.Plugin.Template.csproj b/AirScout.PlaneFeeds.Plugin.Template/AirScout.PlaneFeeds.Plugin.Template.csproj index a61aeb4..d76f7c4 100644 --- a/AirScout.PlaneFeeds.Plugin.Template/AirScout.PlaneFeeds.Plugin.Template.csproj +++ b/AirScout.PlaneFeeds.Plugin.Template/AirScout.PlaneFeeds.Plugin.Template.csproj @@ -34,6 +34,9 @@ 4 + + ..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll + diff --git a/AirScout.PlaneFeeds.Plugin.Template/packages.config b/AirScout.PlaneFeeds.Plugin.Template/packages.config index 7809c60..caa3fff 100644 --- a/AirScout.PlaneFeeds.Plugin.Template/packages.config +++ b/AirScout.PlaneFeeds.Plugin.Template/packages.config @@ -2,4 +2,5 @@ + \ No newline at end of file diff --git a/AirScout.PlaneFeeds.Plugin.VirtualRadarServer/AirScout.PlaneFeeds.Plugin.VirtualRadarServer.csproj b/AirScout.PlaneFeeds.Plugin.VirtualRadarServer/AirScout.PlaneFeeds.Plugin.VirtualRadarServer.csproj index f2a7108..79bb70e 100644 --- a/AirScout.PlaneFeeds.Plugin.VirtualRadarServer/AirScout.PlaneFeeds.Plugin.VirtualRadarServer.csproj +++ b/AirScout.PlaneFeeds.Plugin.VirtualRadarServer/AirScout.PlaneFeeds.Plugin.VirtualRadarServer.csproj @@ -34,6 +34,12 @@ 4 + + ..\packages\BouncyCastle.1.8.5\lib\BouncyCastle.Crypto.dll + + + ..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll + @@ -50,6 +56,7 @@ True Settings.settings + diff --git a/AirScout.PlaneFeeds.Plugin.VirtualRadarServer/Properties/AssemblyInfo.cs b/AirScout.PlaneFeeds.Plugin.VirtualRadarServer/Properties/AssemblyInfo.cs index 84bacdb..2166a63 100644 --- a/AirScout.PlaneFeeds.Plugin.VirtualRadarServer/Properties/AssemblyInfo.cs +++ b/AirScout.PlaneFeeds.Plugin.VirtualRadarServer/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // indem Sie "*" wie unten gezeigt eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.3.0.0")] -[assembly: AssemblyFileVersion("1.3.0.0")] +[assembly: AssemblyVersion("1.3.3.0")] +[assembly: AssemblyFileVersion("1.3.3.0")] diff --git a/AirScout.PlaneFeeds.Plugin.VirtualRadarServer/TLS.cs b/AirScout.PlaneFeeds.Plugin.VirtualRadarServer/TLS.cs new file mode 100644 index 0000000..3881267 --- /dev/null +++ b/AirScout.PlaneFeeds.Plugin.VirtualRadarServer/TLS.cs @@ -0,0 +1,154 @@ +using Org.BouncyCastle.Crypto.Tls; +using Org.BouncyCastle.Security; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Net.Sockets; +using System.Text; +using System.Text.RegularExpressions; + +namespace System.Net +{ + class VRSTlsClient : DefaultTlsClient + { + string HostName; + + public VRSTlsClient(string hostname) + { + HostName = hostname; + } + + public override TlsAuthentication GetAuthentication() + { + TlsAuthentication auth = new MyTlsAuthentication(); + return auth; + } + + public override void NotifyNewSessionTicket(NewSessionTicket newSessionTicket) + { + base.NotifyNewSessionTicket(newSessionTicket); + } + + public override IDictionary GetClientExtensions() + { + var clientExtensions = base.GetClientExtensions(); + List servers = new List(); + servers.Add(new ServerName(NameType.host_name, HostName)); + TlsExtensionsUtilities.AddServerNameExtension(clientExtensions, new ServerNameList(servers)); + return clientExtensions; + } + + public static string DownloadFile (string url, int timeout, string apikey) + { + string response = ""; + Uri uri = null; + // try to pasre url + try + { + uri = new Uri(url); + } + catch (Exception ex) + { + return ex.Message; + } + // create new TCP-Client + using (var client = new TcpClient(uri.Host, uri.Port)) + { + var sr = new SecureRandom(); + var cl = new VRSTlsClient(uri.Host); + var protocol = new TlsClientProtocol(client.GetStream(), sr); + protocol.Connect(cl); + + using (var stream = protocol.Stream) + { + var hdr = new StringBuilder(); + hdr.AppendLine("GET " + uri.PathAndQuery + " HTTP/1.1"); + hdr.AppendLine("Host: " + uri.Host); + hdr.AppendLine("Content-Type: text/json; charset=utf-8"); + hdr.AppendLine("api-auth:" + apikey); + hdr.AppendLine("Connection: close"); + hdr.AppendLine(); + + var dataToSend = Encoding.ASCII.GetBytes(hdr.ToString()); + + stream.Write(dataToSend, 0, dataToSend.Length); + // set stop watch as timout + Stopwatch st = new Stopwatch(); + st.Start(); + //read header bytewise + string header = ""; + int totalRead = 0; + byte[] buff = new byte[1]; + do + { + totalRead = stream.Read(buff, 0, buff.Length); + header += Encoding.ASCII.GetString(buff); + if (st.ElapsedMilliseconds > timeout) + throw new TimeoutException("Connection to " + url + " timed out."); + } + while (!header.Contains("\r\n\r\n")); + int contentlength = 0; + if (header.Contains("Transfer-Encoding: chunked")) + { + // chunked transfer, first line should contain content length + string strcontentlength = ""; + do + { + totalRead = stream.Read(buff, 0, buff.Length); + strcontentlength += Encoding.ASCII.GetString(buff, 0, buff.Length); + if (st.ElapsedMilliseconds > timeout) + throw new TimeoutException("Connection to " + url + " timed out."); + } + while (!strcontentlength.Contains("\r\n")); + strcontentlength = strcontentlength.Replace("\r\n", ""); + contentlength = int.Parse(strcontentlength, System.Globalization.NumberStyles.HexNumber); + } + else + { + // get content length from header + Regex strcontentlength = new Regex("(?<=Content-Length:\\s)\\d+", RegexOptions.IgnoreCase); + contentlength = int.Parse(strcontentlength.Match(header).Value); + } + // re-assign buffer + // read response + buff = new byte[1000]; + totalRead = 0; + do + { + int bytesRead = stream.Read(buff, 0, buff.Length); + string part = Encoding.UTF8.GetString(buff, 0, bytesRead); + Console.WriteLine(part); + response += part; + totalRead += bytesRead; + if (st.ElapsedMilliseconds > timeout) + throw new TimeoutException("Connection to " + url + " timed out."); + } + while (totalRead < contentlength); + // cut response at the end + if (response.Contains("\r\n")) + { + response = response.Substring(0, response.IndexOf("\r\n")); + } + st.Stop(); + } + } + return response; + } + } + + class MyTlsAuthentication : TlsAuthentication + { + public TlsCredentials GetClientCredentials(CertificateRequest certificateRequest) + { + return null; + } + + public void NotifyServerCertificate(Certificate serverCertificate) + { + } + } + +} diff --git a/AirScout.PlaneFeeds.Plugin.VirtualRadarServer/VirtualRadarServer.cs b/AirScout.PlaneFeeds.Plugin.VirtualRadarServer/VirtualRadarServer.cs index 88f4bf8..e2916dd 100644 --- a/AirScout.PlaneFeeds.Plugin.VirtualRadarServer/VirtualRadarServer.cs +++ b/AirScout.PlaneFeeds.Plugin.VirtualRadarServer/VirtualRadarServer.cs @@ -14,6 +14,7 @@ using System.Web.Script.Serialization; using System.Security.Cryptography; using System.Xml.Serialization; using System.Xml.Linq; +using Newtonsoft.Json; namespace AirScout.PlaneFeeds.Plugin.VirtualRadarServer { @@ -200,7 +201,9 @@ namespace AirScout.PlaneFeeds.Plugin.VirtualRadarServer return "Web feed from Virtual Radar Server\n\n" + "(c) AirScout(www.airscout.eu)\n\n" + "This feed requires an API-key, either personal or AirScout internal.\n" + - "See https://www.adsbexchange.com/ for details.\n"; + "See https://www.adsbexchange.com/ for details.\n\n" + + "This webfeed forces TLS1.2 transport layer security. Though this plugin is compiled for .NET4.0 it needs .NET4.5 or higher installed on this machine to work.\n\n" + + "This webfeed will probably not work on Windows XP and Linux/Mono systems"; } } @@ -337,20 +340,23 @@ namespace AirScout.PlaneFeeds.Plugin.VirtualRadarServer // calculate url and get json String url = VC.ReplaceAllVars(Settings.URL); Console.WriteLine("[" + this.GetType().Name + "]: Creating web request: " + url); - HttpWebRequest webrequest = (HttpWebRequest)HttpWebRequest.Create(url); - webrequest.Referer = "http://www.vrs-world.com/"; - webrequest.Timeout = Settings.Timeout * 1000; - webrequest.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0"; - webrequest.Accept = "application/json, text/javascript, */*;q=0.01"; - webrequest.AutomaticDecompression = System.Net.DecompressionMethods.Deflate | System.Net.DecompressionMethods.GZip; - webrequest.Headers.Add("api-auth:" + APIKey); - Console.WriteLine("[" + this.GetType().Name + "]: Getting web response"); - HttpWebResponse webresponse = (HttpWebResponse)webrequest.GetResponse(); - Console.WriteLine("[" + this.GetType().Name + "]: Reading stream"); - using (StreamReader sr = new StreamReader(webresponse.GetResponseStream())) - { - json = sr.ReadToEnd(); - } + // HttpWebRequest webrequest = (HttpWebRequest)HttpWebRequest.Create(url); + // webrequest.Referer = "http://www.vrs-world.com/"; + // webrequest.Timeout = Settings.Timeout * 1000; + // webrequest.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0"; + // webrequest.Accept = "application/json, text/javascript, */*;q=0.01"; + // webrequest.AutomaticDecompression = System.Net.DecompressionMethods.Deflate | System.Net.DecompressionMethods.GZip; + // webrequest.Headers.Add("api-auth:" + APIKey); + // Console.WriteLine("[" + this.GetType().Name + "]: Getting web response"); + // HttpWebResponse webresponse = (HttpWebResponse)webrequest.GetResponse(); + // Console.WriteLine("[" + this.GetType().Name + "]: Reading stream"); + // + // using (StreamReader sr = new StreamReader(webresponse.GetResponseStream())) + // { + // json = sr.ReadToEnd(); + // } + // */ + json = VRSTlsClient.DownloadFile(url, Settings.Timeout * 1000, APIKey); // save raw data to file if enabled if (Settings.SaveToFile) { @@ -360,8 +366,9 @@ namespace AirScout.PlaneFeeds.Plugin.VirtualRadarServer } } Console.WriteLine("[" + this.GetType().Name + "]: Analyzing data"); - JavaScriptSerializer js = new JavaScriptSerializer(); - dynamic root = js.Deserialize(json); + // JavaScriptSerializer js = new JavaScriptSerializer(); + // dynamic root = js.Deserialize(json); + dynamic root = JsonConvert.DeserializeObject(json); // 2017-07-23: workaround for "jumping planes" due to incorrect time stamps // try to get the server time to adjust the time stamps in plane positions // --> compare server time with local time and calculate offset diff --git a/AirScout.PlaneFeeds.Plugin.VirtualRadarServer/packages.config b/AirScout.PlaneFeeds.Plugin.VirtualRadarServer/packages.config index 7809c60..03bdb1c 100644 --- a/AirScout.PlaneFeeds.Plugin.VirtualRadarServer/packages.config +++ b/AirScout.PlaneFeeds.Plugin.VirtualRadarServer/packages.config @@ -1,5 +1,7 @@  + + \ No newline at end of file diff --git a/AirScout.PlaneFeeds.Plugin/AirScout.PlaneFeeds.Plugin.csproj b/AirScout.PlaneFeeds.Plugin/AirScout.PlaneFeeds.Plugin.csproj index 15625db..dc0acbd 100644 --- a/AirScout.PlaneFeeds.Plugin/AirScout.PlaneFeeds.Plugin.csproj +++ b/AirScout.PlaneFeeds.Plugin/AirScout.PlaneFeeds.Plugin.csproj @@ -31,6 +31,9 @@ 4 + + ..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll + @@ -47,6 +50,9 @@ + + + diff --git a/AirScout.PlaneFeeds.Plugin/packages.config b/AirScout.PlaneFeeds.Plugin/packages.config new file mode 100644 index 0000000..0fa4e01 --- /dev/null +++ b/AirScout.PlaneFeeds.Plugin/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/AirScout.PlaneFeeds/AirScout.PlaneFeeds.csproj b/AirScout.PlaneFeeds/AirScout.PlaneFeeds.csproj index b5f59f3..a9f67a6 100644 --- a/AirScout.PlaneFeeds/AirScout.PlaneFeeds.csproj +++ b/AirScout.PlaneFeeds/AirScout.PlaneFeeds.csproj @@ -54,8 +54,7 @@ - ..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll @@ -72,9 +71,7 @@ - - Component - + diff --git a/AirScout.PlaneFeeds/PlaneFeed.cs b/AirScout.PlaneFeeds/PlaneFeed.cs index 5aec048..ddb8e93 100644 --- a/AirScout.PlaneFeeds/PlaneFeed.cs +++ b/AirScout.PlaneFeeds/PlaneFeed.cs @@ -38,6 +38,7 @@ namespace AirScout.PlaneFeeds OK = 0 } + [System.ComponentModel.DesignerCategory("")] [DefaultPropertyAttribute("Name")] public class PlaneFeed : BackgroundWorker { @@ -416,6 +417,7 @@ namespace AirScout.PlaneFeeds Status = STATUS.ERROR; this.ReportProgress((int)PROGRESS.ERROR, "Plane Feed Execption: " + ex.Message); Log.WriteMessage(ex.ToString(), LogLevel.Error); + Console.WriteLine("Plane Feed Execption: " + ex.ToString(), LogLevel.Error); } } while (!this.CancellationPending); diff --git a/AirScout.PlaneFeeds/packages.config b/AirScout.PlaneFeeds/packages.config index 0bbf652..2bc3b5b 100644 --- a/AirScout.PlaneFeeds/packages.config +++ b/AirScout.PlaneFeeds/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/AirScout.Signals/AirScout.Signals.csproj b/AirScout.Signals/AirScout.Signals.csproj index 52a01cf..fe06329 100644 --- a/AirScout.Signals/AirScout.Signals.csproj +++ b/AirScout.Signals/AirScout.Signals.csproj @@ -33,8 +33,7 @@ - ..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/AirScout.Signals/packages.config b/AirScout.Signals/packages.config index 0bbf652..2bc3b5b 100644 --- a/AirScout.Signals/packages.config +++ b/AirScout.Signals/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/AirScout.sln b/AirScout.sln index fef359f..984aec5 100644 --- a/AirScout.sln +++ b/AirScout.sln @@ -85,6 +85,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AirScout.PlaneFeeds.Plugin. EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AirScout.PlaneFeeds.Plugin.PlaneFinder", "AirScout.PlaneFeeds.Plugin.PlaneFinder\AirScout.PlaneFeeds.Plugin.PlaneFinder.csproj", "{DB85E98A-E209-49D0-B6CF-6CDD5B8E20E3}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ScoutBase.Maps", "ScoutBase\ScoutBase.Maps\ScoutBase.Maps.csproj", "{B3B005A5-CC05-430B-B966-20BE5E5985BF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MapTileGenerator", "MapTileGenerator\MapTileGenerator.csproj", "{3D5AADC3-E4CA-4C12-8939-8DC778F6018E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -559,6 +563,30 @@ Global {DB85E98A-E209-49D0-B6CF-6CDD5B8E20E3}.Release|Mixed Platforms.Build.0 = Release|Any CPU {DB85E98A-E209-49D0-B6CF-6CDD5B8E20E3}.Release|x86.ActiveCfg = Release|Any CPU {DB85E98A-E209-49D0-B6CF-6CDD5B8E20E3}.Release|x86.Build.0 = Release|Any CPU + {B3B005A5-CC05-430B-B966-20BE5E5985BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B3B005A5-CC05-430B-B966-20BE5E5985BF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B3B005A5-CC05-430B-B966-20BE5E5985BF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {B3B005A5-CC05-430B-B966-20BE5E5985BF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {B3B005A5-CC05-430B-B966-20BE5E5985BF}.Debug|x86.ActiveCfg = Debug|Any CPU + {B3B005A5-CC05-430B-B966-20BE5E5985BF}.Debug|x86.Build.0 = Debug|Any CPU + {B3B005A5-CC05-430B-B966-20BE5E5985BF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B3B005A5-CC05-430B-B966-20BE5E5985BF}.Release|Any CPU.Build.0 = Release|Any CPU + {B3B005A5-CC05-430B-B966-20BE5E5985BF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {B3B005A5-CC05-430B-B966-20BE5E5985BF}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {B3B005A5-CC05-430B-B966-20BE5E5985BF}.Release|x86.ActiveCfg = Release|Any CPU + {B3B005A5-CC05-430B-B966-20BE5E5985BF}.Release|x86.Build.0 = Release|Any CPU + {3D5AADC3-E4CA-4C12-8939-8DC778F6018E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3D5AADC3-E4CA-4C12-8939-8DC778F6018E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3D5AADC3-E4CA-4C12-8939-8DC778F6018E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {3D5AADC3-E4CA-4C12-8939-8DC778F6018E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {3D5AADC3-E4CA-4C12-8939-8DC778F6018E}.Debug|x86.ActiveCfg = Debug|Any CPU + {3D5AADC3-E4CA-4C12-8939-8DC778F6018E}.Debug|x86.Build.0 = Debug|Any CPU + {3D5AADC3-E4CA-4C12-8939-8DC778F6018E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3D5AADC3-E4CA-4C12-8939-8DC778F6018E}.Release|Any CPU.Build.0 = Release|Any CPU + {3D5AADC3-E4CA-4C12-8939-8DC778F6018E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {3D5AADC3-E4CA-4C12-8939-8DC778F6018E}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {3D5AADC3-E4CA-4C12-8939-8DC778F6018E}.Release|x86.ActiveCfg = Release|Any CPU + {3D5AADC3-E4CA-4C12-8939-8DC778F6018E}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/AirScout/AirScout.csproj b/AirScout/AirScout.csproj index d3512f8..931e65c 100644 --- a/AirScout/AirScout.csproj +++ b/AirScout/AirScout.csproj @@ -110,8 +110,7 @@ ..\packages\DeviceId.4.5.0\lib\net40\DeviceId.dll - ..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll @@ -137,6 +136,9 @@ + + Form + Form @@ -230,7 +232,6 @@ PlaneFeedSettingsDlg.cs - Form @@ -309,6 +310,10 @@ Always + + + + Always @@ -484,6 +489,10 @@ {009cabfd-726d-481f-972d-0a218e0ad9b9} ScoutBase.Elevation + + {b3b005a5-cc05-430b-b966-20be5e5985bf} + ScoutBase.Maps + {610db007-5f74-4b5d-8b71-5e2c163a99b3} ScoutBase.Propagation diff --git a/AirScout/CrossingHistoryDlg.Designer.cs b/AirScout/CrossingHistoryDlg.Designer.cs index eec794f..e85bdd9 100644 --- a/AirScout/CrossingHistoryDlg.Designer.cs +++ b/AirScout/CrossingHistoryDlg.Designer.cs @@ -170,7 +170,7 @@ this.ud_Analysis_AmbiguousGap.Name = "ud_Analysis_AmbiguousGap"; this.ud_Analysis_AmbiguousGap.Size = new System.Drawing.Size(60, 20); this.ud_Analysis_AmbiguousGap.TabIndex = 4; - this.ud_Analysis_AmbiguousGap.Value = global::AirScout.Properties.Settings.Default.Analysis_CrossingHistory_AmbiguousGap; + this.ud_Analysis_AmbiguousGap.Value = global::AirScout.Properties.Settings.Default.Analysis_CrossingHistory_AmbigousGap; // // label1 // diff --git a/AirScout/CrossingHistoryDlg.cs b/AirScout/CrossingHistoryDlg.cs index bc24f14..2346f08 100644 --- a/AirScout/CrossingHistoryDlg.cs +++ b/AirScout/CrossingHistoryDlg.cs @@ -287,7 +287,7 @@ namespace AirScout PlaneInfo pl = null; if (!p.TryGetValue(Crossings[i].Hex, out pl)) p.Add(Crossings[i].Hex, Crossings[i]); - if (((Crossings[i].Time - Crossings[i - 1].Time).TotalSeconds > (double)Properties.Settings.Default.Analysis_CrossingHistory_AmbiguousGap) || (i >= Crossings.Count - 1)) + if (((Crossings[i].Time - Crossings[i - 1].Time).TotalSeconds > (double)Properties.Settings.Default.Analysis_CrossingHistory_AmbigousGap) || (i >= Crossings.Count - 1)) { // gap detected if (p.Count > 1) diff --git a/AirScout/LICENSE b/AirScout/LICENSE index e66c6c4..40b7864 100644 --- a/AirScout/LICENSE +++ b/AirScout/LICENSE @@ -2733,9 +2733,34 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +******************************************************************************** +Licence Information for BouncyCastle +(included in several planefeed plugins) +******************************************************************************** + +Copyright (c) 2000 - 2020 The Legion of the Bouncy Castle Inc. +(https://www.bouncycastle.org) + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. * * * - 2020-01-20 + 2020-04-06 diff --git a/AirScout/MapDlg.Designer.cs b/AirScout/MapDlg.Designer.cs index 649d5c6..ee42203 100644 --- a/AirScout/MapDlg.Designer.cs +++ b/AirScout/MapDlg.Designer.cs @@ -174,6 +174,7 @@ this.bw_Analysis_FileSaver = new System.ComponentModel.BackgroundWorker(); this.bw_Analysis_FileLoader = new System.ComponentModel.BackgroundWorker(); this.bw_AirportMapper = new System.ComponentModel.BackgroundWorker(); + this.gm_Cache = new GMap.NET.WindowsForms.GMapControl(); ((System.ComponentModel.ISupportInitialize)(this.sc_Map)).BeginInit(); this.sc_Map.Panel1.SuspendLayout(); this.sc_Map.Panel2.SuspendLayout(); @@ -267,6 +268,7 @@ this.tp_Map.Controls.Add(this.ag_Azimuth); this.tp_Map.Controls.Add(this.ag_Elevation); this.tp_Map.Controls.Add(this.gm_Main); + this.tp_Map.Controls.Add(this.gm_Cache); this.tp_Map.Location = new System.Drawing.Point(4, 22); this.tp_Map.Name = "tp_Map"; this.tp_Map.Padding = new System.Windows.Forms.Padding(3); @@ -324,7 +326,7 @@ this.gm_Main.EmptyTileColor = System.Drawing.Color.Navy; this.gm_Main.GrayScaleMode = false; this.gm_Main.HelperLineOption = GMap.NET.WindowsForms.HelperLineOptions.DontShow; - this.gm_Main.LevelsKeepInMemmory = 5; + this.gm_Main.LevelsKeepInMemmory = 10; this.gm_Main.Location = new System.Drawing.Point(3, 3); this.gm_Main.MarkersEnabled = true; this.gm_Main.MaxZoom = 2; @@ -1707,7 +1709,7 @@ this.tp_Control_Multi.Location = new System.Drawing.Point(4, 22); this.tp_Control_Multi.Name = "tp_Control_Multi"; this.tp_Control_Multi.Padding = new System.Windows.Forms.Padding(3); - this.tp_Control_Multi.Size = new System.Drawing.Size(144, 378); + this.tp_Control_Multi.Size = new System.Drawing.Size(143, 378); this.tp_Control_Multi.TabIndex = 1; this.tp_Control_Multi.Text = "Multi"; this.tp_Control_Multi.Enter += new System.EventHandler(this.tp_Control_Multi_Enter); @@ -1726,7 +1728,7 @@ this.lv_Control_Watchlist.Location = new System.Drawing.Point(3, 3); this.lv_Control_Watchlist.Name = "lv_Control_Watchlist"; this.lv_Control_Watchlist.OwnerDraw = true; - this.lv_Control_Watchlist.Size = new System.Drawing.Size(138, 349); + this.lv_Control_Watchlist.Size = new System.Drawing.Size(137, 349); this.lv_Control_Watchlist.TabIndex = 1; this.tt_Control_Watchlist.SetToolTip(this.lv_Control_Watchlist, "Watchlist"); this.lv_Control_Watchlist.UseCompatibleStateImageBehavior = false; @@ -1758,7 +1760,7 @@ this.btn_Control_Manage_Watchlist.Dock = System.Windows.Forms.DockStyle.Bottom; this.btn_Control_Manage_Watchlist.Location = new System.Drawing.Point(3, 352); this.btn_Control_Manage_Watchlist.Name = "btn_Control_Manage_Watchlist"; - this.btn_Control_Manage_Watchlist.Size = new System.Drawing.Size(138, 23); + this.btn_Control_Manage_Watchlist.Size = new System.Drawing.Size(137, 23); this.btn_Control_Manage_Watchlist.TabIndex = 0; this.btn_Control_Manage_Watchlist.Text = "Manage Watchlist"; this.btn_Control_Manage_Watchlist.UseVisualStyleBackColor = true; @@ -1937,6 +1939,31 @@ this.bw_AirportMapper.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.bw_AirportMapper_ProgressChanged); this.bw_AirportMapper.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.bw_AirportMapper_RunWorkerCompleted); // + // gm_Cache + // + this.gm_Cache.Bearing = 0F; + this.gm_Cache.CanDragMap = true; + this.gm_Cache.Dock = System.Windows.Forms.DockStyle.Fill; + this.gm_Cache.EmptyTileColor = System.Drawing.Color.Navy; + this.gm_Cache.GrayScaleMode = false; + this.gm_Cache.HelperLineOption = GMap.NET.WindowsForms.HelperLineOptions.DontShow; + this.gm_Cache.LevelsKeepInMemmory = 5; + this.gm_Cache.Location = new System.Drawing.Point(3, 3); + this.gm_Cache.MarkersEnabled = true; + this.gm_Cache.MaxZoom = 2; + this.gm_Cache.MinZoom = 2; + this.gm_Cache.MouseWheelZoomType = GMap.NET.MouseWheelZoomType.MousePositionAndCenter; + this.gm_Cache.Name = "gm_Cache"; + this.gm_Cache.NegativeMode = false; + this.gm_Cache.PolygonsEnabled = true; + this.gm_Cache.RetryLoadTile = 0; + this.gm_Cache.RoutesEnabled = true; + this.gm_Cache.SelectedAreaFillColor = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(65)))), ((int)(((byte)(105)))), ((int)(((byte)(225))))); + this.gm_Cache.ShowTileGridLines = false; + this.gm_Cache.Size = new System.Drawing.Size(838, 309); + this.gm_Cache.TabIndex = 29; + this.gm_Cache.Zoom = 0D; + // // MapDlg // this.AcceptButton = this.btn_Map_PlayPause; @@ -2150,6 +2177,7 @@ private AquaControls.AquaGauge ag_Elevation; private GMap.NET.WindowsForms.GMapControl gm_Main; private System.Windows.Forms.TabPage tp_News; + private GMap.NET.WindowsForms.GMapControl gm_Cache; } } diff --git a/AirScout/MapDlg.cs b/AirScout/MapDlg.cs index 86a5695..ebcea81 100644 --- a/AirScout/MapDlg.cs +++ b/AirScout/MapDlg.cs @@ -55,6 +55,7 @@ using ScoutBase.Database; using ScoutBase.Elevation; using ScoutBase.Stations; using ScoutBase.Propagation; +using ScoutBase.Maps; using SerializableGenerics; using Ionic.Zip; using Newtonsoft.Json; @@ -381,7 +382,7 @@ namespace AirScout private bool FirstRun = true; private bool CleanRun = false; - private Splash SplashDlg = new Splash(); + private Splash SplashDlg; // Background workers public ElevationDatabaseUpdater bw_GLOBEUpdater = new ElevationDatabaseUpdater(); @@ -397,6 +398,8 @@ namespace AirScout public PathCalculator bw_SRTM3PathCalculator = new PathCalculator(ELEVATIONMODEL.SRTM3); public PathCalculator bw_SRTM1PathCalculator = new PathCalculator(ELEVATIONMODEL.SRTM1); + public MapPreloader bw_MapPreloader = new MapPreloader(); + // Operating modes AIRSCOUTPATHMODE PathMode = AIRSCOUTPATHMODE.NONE; AIRSCOUTLIFEMODE LifeMode = AIRSCOUTLIFEMODE.NONE; @@ -502,7 +505,12 @@ namespace AirScout if (result == DialogResult.Abort) System.Environment.Exit(-1); if (result == DialogResult.OK) + { + // re-initialize settings as they can be lost during clean-up + InitializeSettings(); + // set a clean run flag CleanRun = true; + } } } // set elevation database update event handler @@ -527,6 +535,9 @@ namespace AirScout bw_SRTM3PathCalculator.ProgressChanged += new ProgressChangedEventHandler(bw_ElevationPathCalculator_ProgressChanged); bw_SRTM1PathCalculator.ProgressChanged += new ProgressChangedEventHandler(bw_ElevationPathCalculator_ProgressChanged); + // set map preloader event handler + bw_MapPreloader.ProgressChanged += new ProgressChangedEventHandler(bw_MapPreloader_ProgressChanged); + // save FirstRun property before trying to upgrade user settings FirstRun = Properties.Settings.Default.FirstRun; } @@ -900,6 +911,20 @@ namespace AirScout } if (Properties.Settings.Default.MyCalls.Count == 0) Properties.Settings.Default.MyCalls.Add("DL2ALF"); + // checking window size & location + Rectangle bounds = Screen.FromControl(this).Bounds; + if ((Properties.Settings.Default.General_WindowLocation.X < bounds.Left) || + (Properties.Settings.Default.General_WindowLocation.Y < bounds.Top) || + (Properties.Settings.Default.General_WindowLocation.X > bounds.Right) || + (Properties.Settings.Default.General_WindowLocation.Y > bounds.Bottom)) + { + Properties.Settings.Default.General_WindowLocation = new System.Drawing.Point(bounds.Left, bounds.Top); + } + if ((Properties.Settings.Default.General_WindowSize.Width > bounds.Width) || + (Properties.Settings.Default.General_WindowSize.Height > bounds.Height)) + { + Properties.Settings.Default.General_WindowSize = new System.Drawing.Size(bounds.Width, bounds.Height); + } // list all properties in log foreach (SettingsPropertyValue p in Properties.Settings.Default.PropertyValues) { @@ -920,6 +945,40 @@ namespace AirScout if (!Properties.Settings.Default.StationDatabase_Update_URL.EndsWith("/")) Properties.Settings.Default.StationDatabase_Update_URL = Properties.Settings.Default.StationDatabase_Update_URL + "/"; */ + // check for last saved stations not in database and revert to at least DL2ALF and GB3MHZ if necessary + // first check for saved stations + string mycall = GetPropertyDefaultValue(nameof(Properties.Settings.Default.MyCall)); + double mylat = GetPropertyDefaultValue(nameof(Properties.Settings.Default.MyLat)); + double mylon = GetPropertyDefaultValue(nameof(Properties.Settings.Default.MyLon)); + string myloc = MaidenheadLocator.LocFromLatLon(mylat, mylon, Properties.Settings.Default.Locator_SmallLettersForSubsquares, 3); + LocationDesignator ld = StationData.Database.LocationFind(mycall, myloc); + if (ld == null) + { + mycall = GetPropertyDefaultValue(nameof(Properties.Settings.Default.MyCall)); + mylat = GetPropertyDefaultValue(nameof(Properties.Settings.Default.MyLat)); + mylon = GetPropertyDefaultValue(nameof(Properties.Settings.Default.MyLon)); + myloc = MaidenheadLocator.LocFromLatLon(mylat, mylon, Properties.Settings.Default.Locator_SmallLettersForSubsquares, 3); + UpdateLocation(mycall, mylat, mylon, GEOSOURCE.FROMUSER); + Properties.Settings.Default.MyCall = mycall; + Properties.Settings.Default.MyLat = mylat; + Properties.Settings.Default.MyLon = mylon; + } + string dxcall = GetPropertyDefaultValue(nameof(Properties.Settings.Default.DXCall)); + double dxlat = GetPropertyDefaultValue(nameof(Properties.Settings.Default.DXLat)); + double dxlon = GetPropertyDefaultValue(nameof(Properties.Settings.Default.DXLon)); + string dxloc = MaidenheadLocator.LocFromLatLon(dxlat, dxlon, Properties.Settings.Default.Locator_SmallLettersForSubsquares, 3); + ld = StationData.Database.LocationFind(dxcall, dxloc); + if (ld == null) + { + dxcall = GetPropertyDefaultValue(nameof(Properties.Settings.Default.DXCall)); + dxlat = GetPropertyDefaultValue(nameof(Properties.Settings.Default.DXLat)); + dxlon = GetPropertyDefaultValue(nameof(Properties.Settings.Default.DXLon)); + dxloc = MaidenheadLocator.LocFromLatLon(dxlat, dxlon, Properties.Settings.Default.Locator_SmallLettersForSubsquares, 3); + UpdateLocation(dxcall, dxlat, dxlon, GEOSOURCE.FROMUSER); + Properties.Settings.Default.DXCall = dxcall; + Properties.Settings.Default.DXLat = dxlat; + Properties.Settings.Default.DXLon = dxlon; + } Log.WriteMessage("Checking properties finished..."); } @@ -955,6 +1014,8 @@ namespace AirScout Log.WriteMessage(Application.ProductName + " is starting up.", 0, false); Log.WriteMessage("-------------------------------------------------------------------------------------"); Log.WriteMessage("Operating system : " + Environment.OSVersion.Platform); + Log.WriteMessage("OS Major version : " + Environment.OSVersion.Version.Major); + Log.WriteMessage("OS Minor version : " + Environment.OSVersion.Version.Minor); Log.WriteMessage("Application directory : " + AppDirectory); Log.WriteMessage("Application data directory: " + AppDataDirectory); Log.WriteMessage("Log directory : " + LogDirectory); @@ -982,14 +1043,30 @@ namespace AirScout Properties.Settings.Default.StationsDatabase_Directory = StationData.Database.DefaultDatabaseDirectory(); Properties.Settings.Default.ElevationDatabase_Directory = ElevationData.Database.DefaultDatabaseDirectory(); Properties.Settings.Default.PropagationDatabase_Directory = PropagationData.Database.DefaultDatabaseDirectory(); + MapData.Database.DefaultDatabaseDirectory(); Log.WriteMessage("Finished."); } + private void Splash(string text) + { + Splash(text, Color.White); + } + + private void Splash(string text, Color color) + { + // show message in splash window + if (SplashDlg != null) + { + SplashDlg.Status(text, color); + } + } + private void MapDlg_Load(object sender, EventArgs e) { try { // Show splash screen + SplashDlg = new Splash(); SplashDlg.Show(); // bring window to front SplashDlg.BringToFront(); @@ -1001,25 +1078,25 @@ namespace AirScout // show AirScout main window this.BringToFront(); // Check directories, complete it and create, if not exist - SplashDlg.Status("Checking directories..."); + Splash("Checking directories..."); CheckDirectories(); // start a log, specify format of logfile and entries - SplashDlg.Status("Initializing logfile..."); + Splash("Initializing logfile..."); InitializeLogfile(); // Check properties - SplashDlg.Status("Checking settings..."); + Splash("Checking settings..."); CheckSettings(); // check, copy and load plugins - SplashDlg.Status("Loading plugins..."); + Splash("Loading plugins..."); LoadPlugins(); // Initialize database - SplashDlg.Status("Initializing database..."); + Splash("Initializing database..."); InitializeDatabase(); // initialize icons - SplashDlg.Status("Creating icons..."); + Splash("Creating icons..."); InitializeIcons(); ToolTipFont = CreateFontFromString(Properties.Settings.Default.Map_ToolTipFont); - SplashDlg.Status("Loading Map..."); + Splash("Loading Map..."); // initialize map // setting User Agent to fix Open Street Map issue 2016-09-20 @@ -1046,7 +1123,7 @@ namespace AirScout // setting User Agent to fix Open Street Map issue 2016-09-20 GMap.NET.MapProviders.GMapProvider.UserAgent = "AirScout"; // clearing referrer URL issue 2019-12-14 - gm_Main.MapProvider.RefererUrl = ""; + gm_Nearest.MapProvider.RefererUrl = ""; // set initial settings for main map gm_Nearest.MapProvider = GMapProviders.Find(Properties.Settings.Default.Map_Provider); gm_Main.MapProvider.RefererUrl = ""; @@ -1062,6 +1139,13 @@ namespace AirScout gm_Nearest.Overlays.Add(gmo_NearestPlanes); gm_Nearest.Position = new PointLatLng(Properties.Settings.Default.MyLat, Properties.Settings.Default.MyLon); + // setting User Agent to fix Open Street Map issue 2016-09-20 + GMap.NET.MapProviders.GMapProvider.UserAgent = "AirScout"; + // clearing referrer URL issue 2019-12-14 + gm_Cache.MapProvider.RefererUrl = ""; + // set initial settings for main map + gm_Cache.MapProvider = GMapProviders.Find(Properties.Settings.Default.Map_Provider); + cntdn = Properties.Settings.Default.Planes_Update; btn_Map_PlayPause.Select(); @@ -1157,7 +1241,8 @@ namespace AirScout CheckDirectories(); CheckSettings(); // reset topmost state - SplashDlg.TopMost = false; + if (SplashDlg != null) + SplashDlg.TopMost = false; /* // run database updater once for basic information bw_DatabaseUpdater.RunWorkerAsync(UPDATERSTARTOPTIONS.FIRSTRUN); @@ -1165,7 +1250,8 @@ namespace AirScout while (bw_DatabaseUpdater.IsBusy) Application.DoEvents(); */ - SplashDlg.Close(); + if (SplashDlg != null) + SplashDlg.Close(); // must have internet connection on FirstRun CheckInternet(); // show FirstRunWizard @@ -1299,6 +1385,10 @@ namespace AirScout cb_DXLoc.AutoLength = Properties.Settings.Default.Locator_AutoLength; // populate watchlist RefreshWatchlistView(); + // Linux/Mon Hack: cycle control tab view to ensure that all elements are drawn + tc_Control.SelectedTab = tp_Control_Options; + tc_Control.SelectedTab = tp_Control_Multi; + tc_Control.SelectedTab = tp_Control_Single; // set players bounds sb_Analysis_Play.Minimum = 0; sb_Analysis_Play.Maximum = int.MaxValue; @@ -1454,6 +1544,11 @@ namespace AirScout { StationDatabaseUpdaterStartOptions startoptions = new StationDatabaseUpdaterStartOptions(); startoptions.Name = "Stations"; + startoptions.RestrictToAreaOfInterest = Properties.Settings.Default.Location_RestrictToAreaOfInterest; + startoptions.MinLat = Properties.Settings.Default.MinLat; + startoptions.MinLon = Properties.Settings.Default.MinLon; + startoptions.MaxLat = Properties.Settings.Default.MaxLat; + startoptions.MaxLon = Properties.Settings.Default.MaxLon; startoptions.InstanceID = Properties.Settings.Default.AirScout_Instance_ID; startoptions.SessionKey = SessionKey; startoptions.GetKeyURL = Properties.Settings.Default.AirScout_GetKey_URL; @@ -1515,6 +1610,8 @@ namespace AirScout bw_SRTM3PathCalculator.RunWorkerAsync(BACKGROUNDUPDATERSTARTOPTIONS.RUNONCE); if (Properties.Settings.Default.Elevation_SRTM1_Enabled && (bw_SRTM1PathCalculator != null) && !bw_SRTM1PathCalculator.IsBusy) bw_SRTM1PathCalculator.RunWorkerAsync(BACKGROUNDUPDATERSTARTOPTIONS.RUNONCE); + if (Properties.Settings.Default.Map_Preloader_Enabled && (bw_MapPreloader != null) && !bw_MapPreloader.IsBusy) + bw_MapPreloader.RunWorkerAsync(BACKGROUNDUPDATERSTARTOPTIONS.RUNONCE); } else if (Properties.Settings.Default.Background_Update_Periodically) { @@ -1522,6 +1619,11 @@ namespace AirScout { StationDatabaseUpdaterStartOptions startoptions = new StationDatabaseUpdaterStartOptions(); startoptions.Name = "Stations"; + startoptions.MinLat = Properties.Settings.Default.MinLat; + startoptions.MinLon = Properties.Settings.Default.MinLon; + startoptions.MaxLat = Properties.Settings.Default.MaxLat; + startoptions.MaxLon = Properties.Settings.Default.MaxLon; + startoptions.RestrictToAreaOfInterest = Properties.Settings.Default.Location_RestrictToAreaOfInterest; startoptions.InstanceID = Properties.Settings.Default.AirScout_Instance_ID; startoptions.SessionKey = SessionKey; startoptions.GetKeyURL = Properties.Settings.Default.AirScout_GetKey_URL; @@ -1583,6 +1685,8 @@ namespace AirScout bw_SRTM3PathCalculator.RunWorkerAsync(BACKGROUNDUPDATERSTARTOPTIONS.RUNPERIODICALLY); if (Properties.Settings.Default.Elevation_SRTM1_Enabled && (bw_SRTM1PathCalculator != null) && !bw_SRTM1PathCalculator.IsBusy) bw_SRTM1PathCalculator.RunWorkerAsync(BACKGROUNDUPDATERSTARTOPTIONS.RUNPERIODICALLY); + if (Properties.Settings.Default.Map_Preloader_Enabled && (bw_MapPreloader != null) && !bw_MapPreloader.IsBusy) + bw_MapPreloader.RunWorkerAsync(BACKGROUNDUPDATERSTARTOPTIONS.RUNPERIODICALLY); } if ((bw_PlaneFeed1 != null) && (!bw_PlaneFeed1.IsBusy)) bw_PlaneFeed1.RunWorkerAsync(CreatePlaneFeedWorkEventArgs(Properties.Settings.Default.Planes_PlaneFeed1)); @@ -1631,7 +1735,7 @@ namespace AirScout { Say("Stopping background threads..."); // cancel permanent background workers, wait for finish - int bcount = 13; + int bcount = 14; int i = 1; // cancel all threads StopBackgroundworker(bw_WinTestReceive, nameof(bw_WinTestReceive), i, bcount); i++; @@ -1647,6 +1751,7 @@ namespace AirScout StopBackgroundworker(bw_SRTM1PathCalculator, nameof(bw_SRTM1PathCalculator), i, bcount); i++; StopBackgroundworker(bw_AircraftDatabaseUpdater, nameof(bw_AircraftDatabaseUpdater), i, bcount); i++; StopBackgroundworker(bw_StationDatabaseUpdater, nameof(bw_StationDatabaseUpdater), i, bcount); i++; + StopBackgroundworker(bw_MapPreloader, nameof(bw_MapPreloader), i, bcount); i++; Say("Background threads stopped."); } @@ -1996,6 +2101,8 @@ namespace AirScout private void UpdateAirports() { + // clear airports first + gmo_Airports.Clear(); if (!Properties.Settings.Default.Airports_Activate) return; if ((Airports == null) || (Airports.Count == 0)) @@ -2061,14 +2168,87 @@ namespace AirScout return usersettingspath; } + private XmlElement CreateUserSection(XmlDocument doc, SettingsBase settings) + { + XmlElement usersection = doc.CreateElement(string.Empty, "section", string.Empty); + XmlAttribute sectionname = doc.CreateAttribute(string.Empty, "name", string.Empty); + sectionname.Value = settings.GetType().FullName; + usersection.Attributes.Append(sectionname); + XmlAttribute sectiontype = doc.CreateAttribute(string.Empty, "type", string.Empty); + Assembly assembly = Assembly.GetAssembly(typeof(System.Configuration.ClientSettingsSection)); + // sectiontype.Value = "System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"; + sectiontype.Value = typeof(System.Configuration.ClientSettingsSection).FullName + ", " + assembly.FullName; + usersection.Attributes.Append(sectiontype); + XmlAttribute sectionallowexedefinition = doc.CreateAttribute(string.Empty, "allowExeDefinition", string.Empty); + sectionallowexedefinition.Value = "MachineToLocalUser"; + usersection.Attributes.Append(sectionallowexedefinition); + XmlAttribute sectionrequirepermission = doc.CreateAttribute(string.Empty, "requirePermission", string.Empty); + sectionrequirepermission.Value = "false"; + usersection.Attributes.Append(sectionrequirepermission); + return usersection; + } + + private XmlElement SerializeSettings(XmlDocument doc, SettingsBase settings) + { + XmlElement properties = doc.CreateElement(string.Empty, settings.ToString(), string.Empty); + foreach (SettingsPropertyValue p in settings.PropertyValues) + { + if ((p != null) && (p.Name != null) && (p.PropertyValue != null) && !p.UsingDefaultValue) + { + // Console.WriteLine("Appending " + p.Name + " = " + p.PropertyValue.ToString()); + XmlElement setting = doc.CreateElement(string.Empty, "setting", string.Empty); + XmlAttribute name = doc.CreateAttribute(string.Empty, "name", string.Empty); + name.Value = p.Name.ToString(); + setting.Attributes.Append(name); + XmlAttribute serializeas = doc.CreateAttribute(string.Empty, "serializeAs", string.Empty); + serializeas.Value = p.Property.SerializeAs.ToString(); + setting.Attributes.Append(serializeas); + XmlElement value = doc.CreateElement(string.Empty, "value", string.Empty); + if (p.PropertyValue != null && p.Property.SerializeAs == SettingsSerializeAs.String) + { + XmlText text = doc.CreateTextNode(p.SerializedValue.ToString()); + value.AppendChild(text); + } + else + { + if (p.PropertyValue != null && p.Property.SerializeAs == SettingsSerializeAs.Xml) + { + MemoryStream ms = new MemoryStream(); + XmlWriter writer = XmlWriter.Create(ms, new XmlWriterSettings + { + NewLineOnAttributes = true, + OmitXmlDeclaration = true + }); + XmlSerializer serializer = new XmlSerializer(p.PropertyValue.GetType()); + serializer.Serialize(writer, p.PropertyValue); + byte[] text2 = new byte[ms.ToArray().Length - 3]; + Array.Copy(ms.ToArray(), 3, text2, 0, text2.Length); + XmlText xml = doc.CreateTextNode(Encoding.UTF8.GetString(text2.ToArray())); + value.AppendChild(xml); + value.InnerXml = WebUtility.HtmlDecode(value.InnerXml); + } + } + setting.AppendChild(value); + properties.AppendChild(setting); + } + } + return properties; + } + private void SaveUserSettings() { try { Log.WriteMessage("Saving configuration..."); + // save all settings + ScoutBase.Elevation.Properties.Settings.Default.Save(); + ScoutBase.Stations.Properties.Settings.Default.Save(); + ScoutBase.Propagation.Properties.Settings.Default.Save(); + AirScout.Aircrafts.Properties.Settings.Default.Save(); Properties.Settings.Default.Save(); if (!SupportFunctions.IsMono) return; + // Linux/Mono hack to save all properties in a correct manner Console.WriteLine("Creating XML document..."); XmlDocument doc = new XmlDocument(); XmlDeclaration xmlDeclaration = doc.CreateXmlDeclaration("1.0", "UTF-8", null); @@ -2082,114 +2262,31 @@ namespace AirScout XmlAttribute usersettingsname = doc.CreateAttribute(string.Empty, "name", string.Empty); usersettingsname.Value = "userSettings"; usersettingsgroup.Attributes.Append(usersettingsname); - XmlElement usersection = doc.CreateElement(string.Empty, "section", string.Empty); - XmlAttribute sectionname = doc.CreateAttribute(string.Empty, "name", string.Empty); - sectionname.Value = "AirScout.PlaneFeeds.Properties.Settings"; - usersection.Attributes.Append(sectionname); - XmlAttribute sectiontype = doc.CreateAttribute(string.Empty, "type", string.Empty); - sectiontype.Value = "System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"; - usersection.Attributes.Append(sectiontype); - XmlAttribute sectionallowexedefinition = doc.CreateAttribute(string.Empty, "allowExeDefinition", string.Empty); - sectionallowexedefinition.Value = "MachineToLocalUser"; - usersection.Attributes.Append(sectionallowexedefinition); - XmlAttribute sectionrequirepermission = doc.CreateAttribute(string.Empty, "requirePermission", string.Empty); - sectionrequirepermission.Value = "false"; - usersection.Attributes.Append(sectionrequirepermission); - usersettingsgroup.AppendChild(usersection); + usersettingsgroup.AppendChild(CreateUserSection(doc, AirScout.PlaneFeeds.Properties.Settings.Default)); + usersettingsgroup.AppendChild(CreateUserSection(doc, ScoutBase.Elevation.Properties.Settings.Default)); + usersettingsgroup.AppendChild(CreateUserSection(doc, ScoutBase.Stations.Properties.Settings.Default)); + usersettingsgroup.AppendChild(CreateUserSection(doc, ScoutBase.Propagation.Properties.Settings.Default)); + usersettingsgroup.AppendChild(CreateUserSection(doc, AirScout.Aircrafts.Properties.Settings.Default)); configsections.AppendChild(usersettingsgroup); XmlElement usersettings = doc.CreateElement(string.Empty, "userSettings", string.Empty); configuration.AppendChild(usersettings); Console.WriteLine("Writing user settings..."); // append AirScout.PlaneFeeds properties Console.WriteLine("Appending AirScout.PlaneFeeds.Properties.Settings.Default node..."); - XmlElement planefeedproperties = doc.CreateElement(string.Empty, AirScout.PlaneFeeds.Properties.Settings.Default.ToString(), string.Empty); - usersettings.AppendChild(planefeedproperties); - foreach (SettingsPropertyValue p in AirScout.PlaneFeeds.Properties.Settings.Default.PropertyValues) - { - if ((p != null) && (p.Name != null) && (p.PropertyValue != null) && !p.UsingDefaultValue) - { - // Console.WriteLine("Appending " + p.Name + " = " + p.PropertyValue.ToString()); - XmlElement setting = doc.CreateElement(string.Empty, "setting", string.Empty); - XmlAttribute name = doc.CreateAttribute(string.Empty, "name", string.Empty); - name.Value = p.Name.ToString(); - setting.Attributes.Append(name); - XmlAttribute serializeas = doc.CreateAttribute(string.Empty, "serializeAs", string.Empty); - serializeas.Value = p.Property.SerializeAs.ToString(); - setting.Attributes.Append(serializeas); - XmlElement value = doc.CreateElement(string.Empty, "value", string.Empty); - if (p.PropertyValue != null && p.Property.SerializeAs == SettingsSerializeAs.String) - { - XmlText text = doc.CreateTextNode(p.SerializedValue.ToString()); - value.AppendChild(text); - } - else - { - if (p.PropertyValue != null && p.Property.SerializeAs == SettingsSerializeAs.Xml) - { - MemoryStream ms = new MemoryStream(); - XmlWriter writer = XmlWriter.Create(ms, new XmlWriterSettings - { - NewLineOnAttributes = true, - OmitXmlDeclaration = true - }); - XmlSerializer serializer = new XmlSerializer(p.PropertyValue.GetType()); - serializer.Serialize(writer, p.PropertyValue); - byte[] text2 = new byte[ms.ToArray().Length - 3]; - Array.Copy(ms.ToArray(), 3, text2, 0, text2.Length); - XmlText xml = doc.CreateTextNode(Encoding.UTF8.GetString(text2.ToArray())); - value.AppendChild(xml); - value.InnerXml = WebUtility.HtmlDecode(value.InnerXml); - } - } - setting.AppendChild(value); - planefeedproperties.AppendChild(setting); - } - } + usersettings.AppendChild(SerializeSettings(doc, AirScout.PlaneFeeds.Properties.Settings.Default)); + // append ScoutBase properties + Console.WriteLine("Appending ScoutBase.Elevation.Properties.Settings.Default node..."); + usersettings.AppendChild(SerializeSettings(doc, ScoutBase.Elevation.Properties.Settings.Default)); + Console.WriteLine("Appending ScoutBase.Stations.Properties.Settings.Default node..."); + usersettings.AppendChild(SerializeSettings(doc, ScoutBase.Stations.Properties.Settings.Default)); + Console.WriteLine("Appending ScoutBase.Propagation.Properties.Settings.Default node..."); + // append AirScout.Aircrafts properties + usersettings.AppendChild(SerializeSettings(doc, ScoutBase.Propagation.Properties.Settings.Default)); + Console.WriteLine("Appending AirScout.Aircrafts.Settings.Default node..."); + usersettings.AppendChild(SerializeSettings(doc, AirScout.Aircrafts.Properties.Settings.Default)); // append AirScout properties Console.WriteLine("Appending AirScout.Properties.Settings.Default node..."); - XmlElement properties = doc.CreateElement(string.Empty, Properties.Settings.Default.ToString(), string.Empty); - usersettings.AppendChild(properties); - foreach (SettingsPropertyValue p in Properties.Settings.Default.PropertyValues) - { - if ((p != null) && (p.Name != null) && (p.PropertyValue != null) && !p.UsingDefaultValue) - { - // Console.WriteLine("Appending " + p.Name + " = " + p.PropertyValue.ToString(); - XmlElement setting = doc.CreateElement(string.Empty, "setting", string.Empty); - XmlAttribute name = doc.CreateAttribute(string.Empty, "name", string.Empty); - name.Value = p.Name.ToString(); - setting.Attributes.Append(name); - XmlAttribute serializeas = doc.CreateAttribute(string.Empty, "serializeAs", string.Empty); - serializeas.Value = p.Property.SerializeAs.ToString(); - setting.Attributes.Append(serializeas); - XmlElement value = doc.CreateElement(string.Empty, "value", string.Empty); - if (p.PropertyValue != null && p.Property.SerializeAs == SettingsSerializeAs.String) - { - XmlText text = doc.CreateTextNode(p.SerializedValue.ToString()); - value.AppendChild(text); - } - else - { - if (p.PropertyValue != null && p.Property.SerializeAs == SettingsSerializeAs.Xml) - { - MemoryStream ms = new MemoryStream(); - XmlWriter writer = XmlWriter.Create(ms, new XmlWriterSettings - { - NewLineOnAttributes = true, - OmitXmlDeclaration = true - }); - XmlSerializer serializer = new XmlSerializer(p.PropertyValue.GetType()); - serializer.Serialize(writer, p.PropertyValue); - byte[] text2 = new byte[ms.ToArray().Length - 3]; - Array.Copy(ms.ToArray(), 3, text2, 0, text2.Length); - XmlText xml = doc.CreateTextNode(Encoding.UTF8.GetString(text2.ToArray())); - value.AppendChild(xml); - value.InnerXml = WebUtility.HtmlDecode(value.InnerXml); - } - } - setting.AppendChild(value); - properties.AppendChild(setting); - } - } + usersettings.AppendChild(SerializeSettings(doc, Properties.Settings.Default)); doc.Save(GetUserSettingsPath()); } catch (Exception ex) @@ -2219,11 +2316,16 @@ namespace AirScout Log.FlushLog(); } //save window size, state and location - Properties.Settings.Default.General_WindowLocation = this.Location; if (this.WindowState == FormWindowState.Normal) + { Properties.Settings.Default.General_WindowSize = this.Size; + Properties.Settings.Default.General_WindowLocation = this.Location; + } else + { Properties.Settings.Default.General_WindowSize = this.RestoreBounds.Size; + Properties.Settings.Default.General_WindowLocation = this.RestoreBounds.Location; + } Properties.Settings.Default.General_WindowState = this.WindowState; Say("Waiting for background threads to close..."); // close background threads, save database and settings @@ -2824,16 +2926,23 @@ namespace AirScout // clear paths cache assuming that new options were set ElevationPaths.Clear(); PropagationPaths.Clear(); - // update station infos - UpdateLocation(Properties.Settings.Default.MyCall, - Properties.Settings.Default.MyLat, - Properties.Settings.Default.MyLon, - MaidenheadLocator.IsPrecise(Properties.Settings.Default.MyLat, Properties.Settings.Default.MyLon, 3) ? GEOSOURCE.FROMUSER : GEOSOURCE.FROMLOC); - UpdateLocation(Properties.Settings.Default.DXCall, - Properties.Settings.Default.DXLat, - Properties.Settings.Default.DXLon, - MaidenheadLocator.IsPrecise(Properties.Settings.Default.DXLat, Properties.Settings.Default.DXLon, 3) ? GEOSOURCE.FROMUSER : GEOSOURCE.FROMLOC); - + // check and update station infos + LocationDesignator ld = StationData.Database.LocationFind(Properties.Settings.Default.MyCall, MaidenheadLocator.LocFromLatLon(Properties.Settings.Default.MyLat, Properties.Settings.Default.MyLon, false,3)); + if ((ld == null) || (ld.Lat != Properties.Settings.Default.MyLat) || (ld.Lon != Properties.Settings.Default.MyLon)) + { + UpdateLocation(Properties.Settings.Default.MyCall, + Properties.Settings.Default.MyLat, + Properties.Settings.Default.MyLon, + MaidenheadLocator.IsPrecise(Properties.Settings.Default.MyLat, Properties.Settings.Default.MyLon, 3) ? GEOSOURCE.FROMUSER : GEOSOURCE.FROMLOC); + } + ld = StationData.Database.LocationFind(Properties.Settings.Default.DXCall, MaidenheadLocator.LocFromLatLon(Properties.Settings.Default.DXLat, Properties.Settings.Default.DXLon, false, 3)); + if ((ld == null) || (ld.Lat != Properties.Settings.Default.DXLat) || (ld.Lon != Properties.Settings.Default.DXLon)) + { + UpdateLocation(Properties.Settings.Default.DXCall, + Properties.Settings.Default.DXLat, + Properties.Settings.Default.DXLon, + MaidenheadLocator.IsPrecise(Properties.Settings.Default.DXLat, Properties.Settings.Default.DXLon, 3) ? GEOSOURCE.FROMUSER : GEOSOURCE.FROMLOC); + } // update map provider gm_Main.MapProvider = GMapProviders.Find(Properties.Settings.Default.Map_Provider); @@ -4014,7 +4123,7 @@ namespace AirScout int topItemIndex = 0; try { - if (PlayMode != AIRSCOUTPLAYMODE.FORWARD) + if ((PlayMode != AIRSCOUTPLAYMODE.FORWARD) && (lv_Control_Watchlist.TopItem != null)) { topItemIndex = lv_Control_Watchlist.TopItem.Index; } @@ -4783,6 +4892,8 @@ namespace AirScout try { double potential = double.Parse(e.Item.ToolTipText); + // set default color + bkcolor = Color.White; if (potential > 0) bkcolor = Color.Orange; if (potential > 50) @@ -6999,7 +7110,7 @@ namespace AirScout string msg = (string)e.UserState; // redirect output to splash screen on first run if (FirstRun && SplashDlg != null) - SplashDlg.Status("Preparing database for first run: " + msg + " (please wait)", Color.Yellow); + Splash("Preparing database for first run: " + msg + " (please wait)", Color.Yellow); else { SayDatabase(msg); @@ -7082,7 +7193,7 @@ namespace AirScout Log.WriteMessage(msg); // redirect output to splash screen on first run if (FirstRun && SplashDlg != null) - SplashDlg.Status("Preparing database for first run: " + msg + " (please wait)", Color.Yellow); + Splash("Preparing database for first run: " + msg + " (please wait)", Color.Yellow); else { SayDatabase(msg); @@ -7113,7 +7224,6 @@ namespace AirScout if (!this.IsDisposed) { UpdateAirports(); -// gm_Main.Refresh(); } } @@ -7138,7 +7248,7 @@ namespace AirScout Log.WriteMessage(msg); // redirect output to splash screen on first run if (FirstRun && SplashDlg != null) - SplashDlg.Status("Preparing database for first run: " + msg + " (please wait)", Color.Yellow); + Splash("Preparing database for first run: " + msg + " (please wait)", Color.Yellow); else { SayDatabase(msg); @@ -7198,7 +7308,7 @@ namespace AirScout Log.WriteMessage(msg); // redirect output to splash screen on first run if (FirstRun && SplashDlg != null) - SplashDlg.Status("Preparing database for first run: " + msg + " (please wait)", Color.Yellow); + Splash("Preparing database for first run: " + msg + " (please wait)", Color.Yellow); else { SayDatabase(msg); @@ -7217,6 +7327,25 @@ namespace AirScout { } + #endregion + + #region MapPreloader + + private void bw_MapPreloader_ProgressChanged(object sender, ProgressChangedEventArgs e) + { + if (e.ProgressPercentage == 0) + SayCalculations((string)e.UserState); + else + { + PointLatLng p = (PointLatLng)e.UserState; + SayCalculations("Preloading map tile: " + MaidenheadLocator.LocFromLatLon(p.Lat, p.Lng, false, 2) + ", level " + e.ProgressPercentage); + gm_Cache.Zoom = e.ProgressPercentage; + gm_Cache.Position = p; + gm_Cache.ReloadMap(); + } + } + + #endregion #endregion @@ -7596,8 +7725,6 @@ namespace AirScout bw_AirportMapper.ReportProgress(0, "Getting airports from database..."); Stopwatch st = new Stopwatch(); st.Start(); - // clear aiports overlay - bw_AirportMapper.ReportProgress(0, null); // fill the airports layer of maps // return if switched off if (!Properties.Settings.Default.Airports_Activate) @@ -7612,18 +7739,13 @@ namespace AirScout private void bw_AirportMapper_ProgressChanged(object sender, ProgressChangedEventArgs e) { - if (e.ProgressPercentage < 0) + if (e.ProgressPercentage == 0) { // log error message string msg = (string)e.UserState; Say(msg); Log.WriteMessage(msg, LogLevel.Error); } - else if (e.ProgressPercentage == 0) - { - // clear airports overlay - gmo_Airports.Clear(); - } else if (e.ProgressPercentage == 100) { // add aiports to overlay diff --git a/AirScout/MapDlg.resx b/AirScout/MapDlg.resx index e4da65a..a29f15c 100644 --- a/AirScout/MapDlg.resx +++ b/AirScout/MapDlg.resx @@ -125,7 +125,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACc - DQAAAk1TRnQBSQFMAgEBAwEAAXABCwFwAQsBIAEAASABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + DQAAAk1TRnQBSQFMAgEBAwEAAYgBCwGIAQsBIAEAASABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABgAMAASADAAEBAQABCAYAARAYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA @@ -340,7 +340,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACM - DAAAAk1TRnQBSQFMAwEBAAHYAQkB2AEJASABAAEgAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA + DAAAAk1TRnQBSQFMAwEBAAHwAQkB8AEJASABAAEgAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA AYADAAEgAwABAQEAAQgGAAEQGAABgAIAAYADAAKAAQABgAMAAYABAAGAAQACgAIAA8ABAAHAAdwBwAEA AfABygGmAQABMwUAATMBAAEzAQABMwEAAjMCAAMWAQADHAEAAyIBAAMpAQADVQEAA00BAANCAQADOQEA AYABfAH/AQACUAH/AQABkwEAAdYBAAH/AewBzAEAAcYB1gHvAQAB1gLnAQABkAGpAa0CAAH/ATMDAAFm diff --git a/AirScout/MapPreloader.cs b/AirScout/MapPreloader.cs new file mode 100644 index 0000000..ecfc05f --- /dev/null +++ b/AirScout/MapPreloader.cs @@ -0,0 +1,270 @@ +using ScoutBase.Core; +using ScoutBase.Elevation; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading; +using System.Windows.Forms; +using GMap.NET; +using GMap.NET.WindowsForms; +using GMap.NET.MapProviders; +using System.Data.SQLite; +using System.IO; +using System.Data; +using ScoutBase.Maps; +using System.Net; + +namespace AirScout +{ + public partial class MapDlg : Form + { + + #region MapPreloader + + class MapPreloaderTile + { + public int X; + public int Y; + public int Z; + public int Type; + + public MapPreloaderTile(int x, int y, int z, int type) + { + X = x; + Y = y; + Z = z; + Type = type; + } + } + + // Background worker for preloading of map tiles + [DefaultPropertyAttribute("Name")] + public class MapPreloader : BackgroundWorker + { + string Name = "MapPreloader"; + ELEVATIONMODEL Model = ELEVATIONMODEL.NONE; + GMapControl gm_Map = new GMapControl(); + System.Data.SQLite.SQLiteDatabase db; + + public MapPreloader() + { + this.WorkerReportsProgress = true; + this.WorkerSupportsCancellation = true; + } + + int long2tilex(double lon, int z) + { + return (int)(Math.Floor((lon + 180.0) / 360.0 * (1 << z))); + } + + int lat2tiley(double lat, int z) + { + return (int)Math.Floor((1 - Math.Log(Math.Tan((lat / 180.0 * Math.PI)) + 1 / Math.Cos((lat / 180.0 * Math.PI))) / Math.PI) / 2 * (1 << z)); + } + + double tilex2long(int x, int z) + { + return x / (double)(1 << z) * 360.0 - 180; + } + + double tiley2lat(int y, int z) + { + double n = Math.PI - 2.0 * Math.PI * y / (double)(1 << z); + return 180.0 / Math.PI * Math.Atan(0.5 * (Math.Exp(n) - Math.Exp(-n))); + } + + private bool LoadOSM (int x, int y , int zoom) + { + bool b = false; + string url = ScoutBase.Maps.Properties.Settings.Default.Database_UpdateURL + zoom.ToString() + "/" + x.ToString() + "/" + y.ToString() + ".png"; + string filename = Path.Combine(Path.GetTempPath(), y.ToString() + ".png"); + try + { + WebClient cl = new WebClient(); + cl.DownloadFile(url, filename); + using (BinaryReader br = new BinaryReader(File.OpenRead(filename))) + { + byte[] buf = br.ReadBytes((int)br.BaseStream.Length); + // int id = MapData.Database.TileInsert(x, y, zoom, gm_Map.MapProvider.DbId, File.GetLastWriteTime(filename), buf); + int dbid = GMapProviders.OpenStreetMap.DbId; + GMaps.Instance.EnqueueCacheTask(new GMap.NET.Internals.CacheQueueItem(new GMap.NET.Internals.RawTile(dbid, new GPoint(x, y), zoom), buf,GMap.NET.Internals.CacheUsage.First)); + } + File.Delete(filename); + return true; + } + catch (Exception ex) + { + Console.WriteLine(this.Name + ": " + ex.ToString()); + } + return b; + } + + protected override void OnDoWork(DoWorkEventArgs e) + { + BACKGROUNDUPDATERSTARTOPTIONS Options = (BACKGROUNDUPDATERSTARTOPTIONS)e.Argument; + // name the thread for debugging + if (String.IsNullOrEmpty(Thread.CurrentThread.Name)) + Thread.CurrentThread.Name = this.Name + "_" + this.GetType().Name; + this.ReportProgress(0, this.Name + " started."); + Log.WriteMessage(this.Name + " started."); + // get update interval + int interval = (int)Properties.Settings.Default.Background_Update_Period * 60; + // get mpst simple elevation model + if (Properties.Settings.Default.Elevation_GLOBE_Enabled) + Model = ELEVATIONMODEL.GLOBE; + else if (Properties.Settings.Default.Elevation_SRTM3_Enabled) + Model = ELEVATIONMODEL.SRTM3; + else if (Properties.Settings.Default.Elevation_SRTM1_Enabled) + Model = ELEVATIONMODEL.SRTM1; + // return if no elevation model selected + if (Model == ELEVATIONMODEL.NONE) + return; + // setting User Agent to fix Open Street Map issue 2016-09-20 + GMap.NET.MapProviders.GMapProvider.UserAgent = "AirScout"; + // clearing referrer URL issue 2019-12-14 + gm_Map.MapProvider.RefererUrl = ""; + // set initial settings for main map + gm_Map.MapProvider = GMapProviders.Find(Properties.Settings.Default.Map_Provider); + gm_Map.MinZoom = 0; + gm_Map.MaxZoom = 20; + // get database filename + int i = 0; + int count = 0; + int total = 0; + do + { + i = 0; + count = 0; + total = 0; + // checks if elevation database is complete + try + { + this.ReportProgress(0, this.Name + " getting tiles from database."); + int zmin = 5; + int zmax = 11; + List l = new List(); + for (int z = zmin; z <= zmax; z++) + { + int xmin = long2tilex(Properties.Settings.Default.MinLon, z); + int xmax = long2tilex(Properties.Settings.Default.MaxLon, z); + int ymin = lat2tiley(Properties.Settings.Default.MaxLat, z); + int ymax = lat2tiley(Properties.Settings.Default.MinLat, z); + for (int x = xmin; x <= xmax; x++) + { + for (int y = ymin; y <= ymax; y++) + { + // check if tile already in database --> add it to list to get it from the web + if (!MapData.Database.TileExists(x, y, z, gm_Map.MapProvider.DbId)) + { + MapPreloaderTile t = new MapPreloaderTile(x, y, z, gm_Map.MapProvider.DbId); + l.Add(t); + } + total++; + if (this.CancellationPending) + break; + } + if (this.CancellationPending) + break; + } + if (this.CancellationPending) + break; + } + if (this.CancellationPending) + break; + count = l.Count(); + Random rng = new Random(); + // shuffle the list + int n = l.Count; + while (n > 1) + { + n--; + int k = rng.Next(n + 1); + MapPreloaderTile value = l[k]; + l[k] = l[n]; + l[n] = value; + } + n = 0; + foreach (MapPreloaderTile t in l) + { + Exception ex = null; + this.ReportProgress(0, "Preloading " + "/" + t.Z.ToString() + "/" + t.X.ToString() + "/" + t.Y.ToString() + ".png"); + try + { + // try to donwload from www.airscout.eu first + if (gm_Map.MapProvider.GetType() == typeof(OpenStreetMapProvider)) + { + LoadOSM(t.X, t.Y, t.Z); + } + else + { + PureImage img = gm_Map.Manager.GetImageFrom(gm_Map.MapProvider, new GPoint(t.X, t.Y), t.Z, out ex); + // wait until cache is written to database + } + if (ex == null) + Console.WriteLine("Preload tile [" + i.ToString() + " of " + count.ToString() + "] x=" + t.X + ", y=" + t.Y + ", z=" + t.Z + ": OK"); + else + Console.WriteLine("Preload tile [" + i.ToString() + " of " + count.ToString() + "] x=" + t.X + ", y=" + t.Y + ", z=" + t.Z + ": " + ex.ToString()); + } + catch (Exception e1) + { + Console.WriteLine(this.Name + ": " + e1.ToString()); + } + Thread.Sleep(100); + i++; + n++; + if (n > 100) + { + while (GMaps.Instance.tileCacheQueue.Count > 0) + { + Application.DoEvents(); + if (this.CancellationPending) + break; + } + n = 0; + } + if (this.CancellationPending) + break; + } + if (this.CancellationPending) + break; + } + catch (Exception ex) + { + this.ReportProgress(-1, ex.ToString()); + } + + // sleep when running periodically + if (Options == BACKGROUNDUPDATERSTARTOPTIONS.RUNPERIODICALLY) + { + int l = 0; + while (!this.CancellationPending && (l < interval)) + { + Thread.Sleep(1000); + l++; + } + } + if (this.CancellationPending) + break; + } + while (Options == BACKGROUNDUPDATERSTARTOPTIONS.RUNPERIODICALLY); + if (this.CancellationPending) + { + this.ReportProgress(0, Name + " cancelled."); + Log.WriteMessage(Name + " cancelled."); + } + else + { + this.ReportProgress(0, Name + " finished, total " + total.ToString() + " tile(s), " + (count-i).ToString() + " left."); + Log.WriteMessage(Name + " finished, total " + total.ToString() + " tile(s), " + (count - i).ToString() + " left."); + } + } + + } + + + #endregion + + } +} diff --git a/AirScout/OptionsDlg.Designer.cs b/AirScout/OptionsDlg.Designer.cs index 0d269d1..c13c38d 100644 --- a/AirScout/OptionsDlg.Designer.cs +++ b/AirScout/OptionsDlg.Designer.cs @@ -32,17 +32,20 @@ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OptionsDlg)); this.btn_Options_OK = new System.Windows.Forms.Button(); this.btn_Options_Cancel = new System.Windows.Forms.Button(); - this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); - this.btn_Open_LogDirectory = new System.Windows.Forms.Button(); - this.btn_Open_TmpDirectory = new System.Windows.Forms.Button(); + this.tt_Options = new System.Windows.Forms.ToolTip(this.components); this.btn_Options_Import_Callsigns = new System.Windows.Forms.Button(); this.btn_Options_MyUpdate = new System.Windows.Forms.Button(); this.btn_Options_DXUpdate = new System.Windows.Forms.Button(); - this.pb_Donate = new System.Windows.Forms.PictureBox(); this.btn_Options_DeleteAllElevationPaths = new System.Windows.Forms.Button(); this.btn_Options_DeleteAllPropagationPaths = new System.Windows.Forms.Button(); + this.cb_Options_Locations_RestrictToAreaOfInterest = new System.Windows.Forms.CheckBox(); this.cb_Options_Path_BestCaseElevation = new System.Windows.Forms.CheckBox(); this.cb_Options_Planes_KeepHistory = new System.Windows.Forms.CheckBox(); + this.btn_Options_Open_TmpDirectory = new System.Windows.Forms.Button(); + this.btn_Options_Open_LogDirectory = new System.Windows.Forms.Button(); + this.btn_DeleteAllMapTiles = new System.Windows.Forms.Button(); + this.btn_Options_Open_PluginDirectory = new System.Windows.Forms.Button(); + this.btn_Options_Open_AirScoutDirectory = new System.Windows.Forms.Button(); this.tab_Options_Planes = new System.Windows.Forms.TabPage(); this.groupBox48 = new System.Windows.Forms.GroupBox(); this.int32TextBox1 = new ScoutBase.Core.Int32TextBox(); @@ -135,13 +138,20 @@ this.cb_Options_Elevation_GLOBE_EnableCache = new System.Windows.Forms.CheckBox(); this.cb_Options_Elevation_GLOBE = new System.Windows.Forms.CheckBox(); this.tab_Options_Map = new System.Windows.Forms.TabPage(); + this.groupBox49 = new System.Windows.Forms.GroupBox(); + this.cb_Options_Map_SmallMarkers = new System.Windows.Forms.CheckBox(); + this.cb_Options_Map_LabelCalls = new System.Windows.Forms.CheckBox(); + this.groupBox37 = new System.Windows.Forms.GroupBox(); + this.label34 = new System.Windows.Forms.Label(); + this.ud_Options_Charts_FontSize = new System.Windows.Forms.NumericUpDown(); this.groupBox39 = new System.Windows.Forms.GroupBox(); this.tb_Options_Map_Update_Interval = new ScoutBase.Core.Int32TextBox(); this.label97 = new System.Windows.Forms.Label(); this.label29 = new System.Windows.Forms.Label(); this.groupBox23 = new System.Windows.Forms.GroupBox(); - this.cb_Options_Map_LabelCalls = new System.Windows.Forms.CheckBox(); - this.cb_Options_Map_SmallMarkers = new System.Windows.Forms.CheckBox(); + this.ud_Options_Map_Preloader_MaxZoom = new System.Windows.Forms.NumericUpDown(); + this.label144 = new System.Windows.Forms.Label(); + this.cb_Options_Map_Preloader_Enabled = new System.Windows.Forms.CheckBox(); this.cb_Options_Watchlist_Activate = new System.Windows.Forms.CheckBox(); this.cb_Options_Airports_Activate = new System.Windows.Forms.CheckBox(); this.groupBox30 = new System.Windows.Forms.GroupBox(); @@ -259,18 +269,11 @@ this.label54 = new System.Windows.Forms.Label(); this.label59 = new System.Windows.Forms.Label(); this.label60 = new System.Windows.Forms.Label(); - this.groupBox17 = new System.Windows.Forms.GroupBox(); - this.cb_Options_Watchlist_SyncWithKST = new System.Windows.Forms.CheckBox(); - this.tb_Options_Watchlist_MaxCount = new ScoutBase.Core.Int32TextBox(); - this.btn_Options_Watchlist_Manage = new System.Windows.Forms.Button(); - this.label31 = new System.Windows.Forms.Label(); this.tc_Options = new System.Windows.Forms.TabControl(); this.tab_Options_Database = new System.Windows.Forms.TabPage(); this.groupBox47 = new System.Windows.Forms.GroupBox(); this.groupBox27 = new System.Windows.Forms.GroupBox(); this.label108 = new System.Windows.Forms.Label(); - this.groupBox15 = new System.Windows.Forms.GroupBox(); - this.label105 = new System.Windows.Forms.Label(); this.gb_Options_Database_Settings = new System.Windows.Forms.GroupBox(); this.cb_Options_Background_Calculations_Enable = new System.Windows.Forms.CheckBox(); this.label47 = new System.Windows.Forms.Label(); @@ -279,6 +282,20 @@ this.rb_Options_Database_Update_OnStartup = new System.Windows.Forms.RadioButton(); this.rb_Options_Database_Update_Never = new System.Windows.Forms.RadioButton(); this.gb_Options_Database_Info = new System.Windows.Forms.GroupBox(); + this.lbl_Options_ScoutBase_Database_FileName = new System.Windows.Forms.Label(); + this.lbl_Options_AirScout_Database_FileName = new System.Windows.Forms.Label(); + this.lbl_Options_Propagation_GLOBE_Database_FileName = new System.Windows.Forms.Label(); + this.lbl_Options_Propagation_SRTM3_Database_FileName = new System.Windows.Forms.Label(); + this.lbl_Options_Propagation_SRTM1_Database_FileName = new System.Windows.Forms.Label(); + this.lbl_Options_Elevation_GLOBE_Database_FileName = new System.Windows.Forms.Label(); + this.lbl_Options_Elevation_SRTM3_Database_FileName = new System.Windows.Forms.Label(); + this.lbl_Options_Elevation_SRTM1_Database_FileName = new System.Windows.Forms.Label(); + this.lbl_Options_Map_Database_FileName = new System.Windows.Forms.Label(); + this.btn_Options_Map_Database_Maintenance = new System.Windows.Forms.Button(); + this.label38 = new System.Windows.Forms.Label(); + this.tb_Options_Map_Database_FileSize = new System.Windows.Forms.TextBox(); + this.label140 = new System.Windows.Forms.Label(); + this.label142 = new System.Windows.Forms.Label(); this.btn_Options_Elevation_SRTM1_Database_Maintenance = new System.Windows.Forms.Button(); this.btn_Options_Elevation_SRTM3_Database_Maintenance = new System.Windows.Forms.Button(); this.btn_Options_Elevation_GLOBE_Database_Maintenance = new System.Windows.Forms.Button(); @@ -293,43 +310,35 @@ this.label136 = new System.Windows.Forms.Label(); this.tb_Options_Propagation_SRTM1_Database_FileSize = new System.Windows.Forms.TextBox(); this.label137 = new System.Windows.Forms.Label(); - this.tb_Options_Propagation_SRTM1_Database_FileName = new System.Windows.Forms.TextBox(); this.label138 = new System.Windows.Forms.Label(); this.label46 = new System.Windows.Forms.Label(); this.tb_Options_Propagation_SRTM3_Database_FileSize = new System.Windows.Forms.TextBox(); this.label134 = new System.Windows.Forms.Label(); - this.tb_Options_Propagation_SRTM3_Database_FileName = new System.Windows.Forms.TextBox(); this.label135 = new System.Windows.Forms.Label(); this.label132 = new System.Windows.Forms.Label(); this.tb_Options_Propagation_GLOBE_Database_FileSize = new System.Windows.Forms.TextBox(); this.label133 = new System.Windows.Forms.Label(); - this.tb_Options_Propagation_GLOBE_Database_FileName = new System.Windows.Forms.TextBox(); this.label109 = new System.Windows.Forms.Label(); this.label118 = new System.Windows.Forms.Label(); this.tb_Options_Elevation_SRTM1_Database_FileSize = new System.Windows.Forms.TextBox(); this.label119 = new System.Windows.Forms.Label(); - this.tb_Options_Elevation_SRTM1_Database_FileName = new System.Windows.Forms.TextBox(); this.label120 = new System.Windows.Forms.Label(); this.label115 = new System.Windows.Forms.Label(); this.tb_Options_Elevation_SRTM3_Database_FileSize = new System.Windows.Forms.TextBox(); this.label116 = new System.Windows.Forms.Label(); - this.tb_Options_Elevation_SRTM3_Database_FileName = new System.Windows.Forms.TextBox(); this.label117 = new System.Windows.Forms.Label(); this.label16 = new System.Windows.Forms.Label(); this.tb_Options_Elevation_GLOBE_Database_FileSize = new System.Windows.Forms.TextBox(); this.label113 = new System.Windows.Forms.Label(); - this.tb_Options_Elevation_GLOBE_Database_FileName = new System.Windows.Forms.TextBox(); this.label114 = new System.Windows.Forms.Label(); this.label104 = new System.Windows.Forms.Label(); this.label101 = new System.Windows.Forms.Label(); this.tb_Options_AirScout_Database_FileSize = new System.Windows.Forms.TextBox(); this.label102 = new System.Windows.Forms.Label(); - this.tb_Options_AirScout_Database_FileName = new System.Windows.Forms.TextBox(); this.label103 = new System.Windows.Forms.Label(); this.label73 = new System.Windows.Forms.Label(); this.tb_Options_ScoutBase_Database_FileSize = new System.Windows.Forms.TextBox(); this.label50 = new System.Windows.Forms.Label(); - this.tb_Options_ScoutBase_Database_FileName = new System.Windows.Forms.TextBox(); this.label49 = new System.Windows.Forms.Label(); this.tab_Options_Alarm = new System.Windows.Forms.TabPage(); this.groupBox21 = new System.Windows.Forms.GroupBox(); @@ -371,7 +380,7 @@ this.label65 = new System.Windows.Forms.Label(); this.tb_SpecLab_URL = new System.Windows.Forms.TextBox(); this.cb_SpecLab_Enabled = new System.Windows.Forms.CheckBox(); - this.tc_Track = new System.Windows.Forms.TabPage(); + this.tab_Options_Track = new System.Windows.Forms.TabPage(); this.groupBox36 = new System.Windows.Forms.GroupBox(); this.rb_Options_Track_File_None = new System.Windows.Forms.RadioButton(); this.rb_Options_Track_File_WSJT = new System.Windows.Forms.RadioButton(); @@ -397,6 +406,22 @@ this.rb_Options_Track_Serial_GS232_AZ = new System.Windows.Forms.RadioButton(); this.groupBox28 = new System.Windows.Forms.GroupBox(); this.cb_Options_Track_Activate = new System.Windows.Forms.CheckBox(); + this.tab_Options_Watchlist = new System.Windows.Forms.TabPage(); + this.groupBox50 = new System.Windows.Forms.GroupBox(); + this.pictureBox3 = new System.Windows.Forms.PictureBox(); + this.pictureBox2 = new System.Windows.Forms.PictureBox(); + this.label37 = new System.Windows.Forms.Label(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.btn_Options_Watchlist_Clear = new System.Windows.Forms.Button(); + this.groupBox17 = new System.Windows.Forms.GroupBox(); + this.cb_Options_Watchlist_SyncWithKST = new System.Windows.Forms.CheckBox(); + this.tb_Options_Watchlist_MaxCount = new ScoutBase.Core.Int32TextBox(); + this.label31 = new System.Windows.Forms.Label(); + this.btn_Options_Watchlist_Manage = new System.Windows.Forms.Button(); + this.tab_Options_Misc = new System.Windows.Forms.TabPage(); + this.pictureBox4 = new System.Windows.Forms.PictureBox(); + this.label143 = new System.Windows.Forms.Label(); + this.groupBox15 = new System.Windows.Forms.GroupBox(); this.tab_Options_Info = new System.Windows.Forms.TabPage(); this.label30 = new System.Windows.Forms.Label(); this.label45 = new System.Windows.Forms.Label(); @@ -422,10 +447,8 @@ this.bw_SRTM1_MapUpdater = new System.ComponentModel.BackgroundWorker(); this.bw_GLOBE_MapUpdater = new System.ComponentModel.BackgroundWorker(); this.bw_StationDataUpdater = new System.ComponentModel.BackgroundWorker(); - this.groupBox37 = new System.Windows.Forms.GroupBox(); - this.ud_Options_Charts_FontSize = new System.Windows.Forms.NumericUpDown(); - this.label34 = new System.Windows.Forms.Label(); - ((System.ComponentModel.ISupportInitialize)(this.pb_Donate)).BeginInit(); + this.pb_Donate = new System.Windows.Forms.PictureBox(); + this.label105 = new System.Windows.Forms.Label(); this.tab_Options_Planes.SuspendLayout(); this.groupBox48.SuspendLayout(); this.groupBox40.SuspendLayout(); @@ -449,8 +472,12 @@ this.groupBox11.SuspendLayout(); this.groupBox10.SuspendLayout(); this.tab_Options_Map.SuspendLayout(); + this.groupBox49.SuspendLayout(); + this.groupBox37.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.ud_Options_Charts_FontSize)).BeginInit(); this.groupBox39.SuspendLayout(); this.groupBox23.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.ud_Options_Map_Preloader_MaxZoom)).BeginInit(); this.groupBox30.SuspendLayout(); this.groupBox7.SuspendLayout(); this.groupBox29.SuspendLayout(); @@ -468,12 +495,10 @@ this.groupBox4.SuspendLayout(); this.tab_Options_General.SuspendLayout(); this.groupBox25.SuspendLayout(); - this.groupBox17.SuspendLayout(); this.tc_Options.SuspendLayout(); this.tab_Options_Database.SuspendLayout(); this.groupBox47.SuspendLayout(); this.groupBox27.SuspendLayout(); - this.groupBox15.SuspendLayout(); this.gb_Options_Database_Settings.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.ud_Options_Database_Update_Period)).BeginInit(); this.gb_Options_Database_Info.SuspendLayout(); @@ -487,22 +512,30 @@ this.groupBox24.SuspendLayout(); this.tab_Options_SpecLab.SuspendLayout(); this.groupBox3.SuspendLayout(); - this.tc_Track.SuspendLayout(); + this.tab_Options_Track.SuspendLayout(); this.groupBox36.SuspendLayout(); this.groupBox35.SuspendLayout(); this.groupBox34.SuspendLayout(); this.groupBox33.SuspendLayout(); this.groupBox28.SuspendLayout(); + this.tab_Options_Watchlist.SuspendLayout(); + this.groupBox50.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.groupBox17.SuspendLayout(); + this.tab_Options_Misc.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit(); + this.groupBox15.SuspendLayout(); this.tab_Options_Info.SuspendLayout(); this.ss_Options.SuspendLayout(); - this.groupBox37.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.ud_Options_Charts_FontSize)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pb_Donate)).BeginInit(); this.SuspendLayout(); // // btn_Options_OK // this.btn_Options_OK.DialogResult = System.Windows.Forms.DialogResult.OK; - this.btn_Options_OK.Location = new System.Drawing.Point(697, 443); + this.btn_Options_OK.Location = new System.Drawing.Point(697, 471); this.btn_Options_OK.Name = "btn_Options_OK"; this.btn_Options_OK.Size = new System.Drawing.Size(75, 23); this.btn_Options_OK.TabIndex = 26; @@ -513,46 +546,22 @@ // this.btn_Options_Cancel.CausesValidation = false; this.btn_Options_Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btn_Options_Cancel.Location = new System.Drawing.Point(697, 472); + this.btn_Options_Cancel.Location = new System.Drawing.Point(697, 501); this.btn_Options_Cancel.Name = "btn_Options_Cancel"; this.btn_Options_Cancel.Size = new System.Drawing.Size(75, 23); this.btn_Options_Cancel.TabIndex = 25; this.btn_Options_Cancel.Text = "&Cancel"; this.btn_Options_Cancel.UseVisualStyleBackColor = true; // - // btn_Open_LogDirectory - // - this.btn_Open_LogDirectory.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btn_Open_LogDirectory.Location = new System.Drawing.Point(13, 50); - this.btn_Open_LogDirectory.Name = "btn_Open_LogDirectory"; - this.btn_Open_LogDirectory.Size = new System.Drawing.Size(119, 27); - this.btn_Open_LogDirectory.TabIndex = 1; - this.btn_Open_LogDirectory.Text = "Log Directory"; - this.toolTip1.SetToolTip(this.btn_Open_LogDirectory, "Click to see your logfiles in Explorer window."); - this.btn_Open_LogDirectory.UseVisualStyleBackColor = true; - this.btn_Open_LogDirectory.Click += new System.EventHandler(this.btn_Open_LogDirectory_Click); - // - // btn_Open_TmpDirectory - // - this.btn_Open_TmpDirectory.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btn_Open_TmpDirectory.Location = new System.Drawing.Point(138, 50); - this.btn_Open_TmpDirectory.Name = "btn_Open_TmpDirectory"; - this.btn_Open_TmpDirectory.Size = new System.Drawing.Size(119, 27); - this.btn_Open_TmpDirectory.TabIndex = 2; - this.btn_Open_TmpDirectory.Text = "Tmp Directory"; - this.toolTip1.SetToolTip(this.btn_Open_TmpDirectory, "Click to see your temp files in Explorer window. "); - this.btn_Open_TmpDirectory.UseVisualStyleBackColor = true; - this.btn_Open_TmpDirectory.Click += new System.EventHandler(this.btn_Open_TmpDirectory_Click); - // // btn_Options_Import_Callsigns // this.btn_Options_Import_Callsigns.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btn_Options_Import_Callsigns.Location = new System.Drawing.Point(244, 19); + this.btn_Options_Import_Callsigns.Location = new System.Drawing.Point(100, 36); this.btn_Options_Import_Callsigns.Name = "btn_Options_Import_Callsigns"; this.btn_Options_Import_Callsigns.Size = new System.Drawing.Size(85, 27); this.btn_Options_Import_Callsigns.TabIndex = 1; this.btn_Options_Import_Callsigns.Text = "Select File"; - this.toolTip1.SetToolTip(this.btn_Options_Import_Callsigns, "Click to see your ScoutBase database files in Explorer window."); + this.tt_Options.SetToolTip(this.btn_Options_Import_Callsigns, "Click to see your ScoutBase database files in Explorer window."); this.btn_Options_Import_Callsigns.UseVisualStyleBackColor = true; this.btn_Options_Import_Callsigns.Click += new System.EventHandler(this.btn_Options_Import_Callsigns_Click); // @@ -565,7 +574,7 @@ this.btn_Options_MyUpdate.Size = new System.Drawing.Size(100, 33); this.btn_Options_MyUpdate.TabIndex = 23; this.btn_Options_MyUpdate.Text = "Send Update!"; - this.toolTip1.SetToolTip(this.btn_Options_MyUpdate, "Send Update to AirScout web database"); + this.tt_Options.SetToolTip(this.btn_Options_MyUpdate, "Send Update to AirScout web database"); this.btn_Options_MyUpdate.UseVisualStyleBackColor = false; this.btn_Options_MyUpdate.Click += new System.EventHandler(this.btn_Options_MyUpdate_Click); // @@ -578,46 +587,50 @@ this.btn_Options_DXUpdate.Size = new System.Drawing.Size(100, 33); this.btn_Options_DXUpdate.TabIndex = 28; this.btn_Options_DXUpdate.Text = "Send Update!"; - this.toolTip1.SetToolTip(this.btn_Options_DXUpdate, "Send Update to AirScout web database"); + this.tt_Options.SetToolTip(this.btn_Options_DXUpdate, "Send Update to AirScout web database"); this.btn_Options_DXUpdate.UseVisualStyleBackColor = false; this.btn_Options_DXUpdate.Click += new System.EventHandler(this.btn_Options_DXUpdate_Click); // - // pb_Donate - // - this.pb_Donate.Image = ((System.Drawing.Image)(resources.GetObject("pb_Donate.Image"))); - this.pb_Donate.InitialImage = ((System.Drawing.Image)(resources.GetObject("pb_Donate.InitialImage"))); - this.pb_Donate.Location = new System.Drawing.Point(227, 368); - this.pb_Donate.Name = "pb_Donate"; - this.pb_Donate.Size = new System.Drawing.Size(180, 80); - this.pb_Donate.TabIndex = 37; - this.pb_Donate.TabStop = false; - this.toolTip1.SetToolTip(this.pb_Donate, "Click here to open a browser window with link."); - this.pb_Donate.Click += new System.EventHandler(this.pb_Donate_Click); - // // btn_Options_DeleteAllElevationPaths // this.btn_Options_DeleteAllElevationPaths.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btn_Options_DeleteAllElevationPaths.Location = new System.Drawing.Point(15, 19); + this.btn_Options_DeleteAllElevationPaths.Location = new System.Drawing.Point(6, 19); this.btn_Options_DeleteAllElevationPaths.Name = "btn_Options_DeleteAllElevationPaths"; - this.btn_Options_DeleteAllElevationPaths.Size = new System.Drawing.Size(266, 23); + this.btn_Options_DeleteAllElevationPaths.Size = new System.Drawing.Size(153, 23); this.btn_Options_DeleteAllElevationPaths.TabIndex = 0; this.btn_Options_DeleteAllElevationPaths.Text = "Delete All Elevation Paths"; - this.toolTip1.SetToolTip(this.btn_Options_DeleteAllElevationPaths, "Deletes all precalculated elevation paths from database"); + this.tt_Options.SetToolTip(this.btn_Options_DeleteAllElevationPaths, "Deletes all precalculated elevation paths from database"); this.btn_Options_DeleteAllElevationPaths.UseVisualStyleBackColor = true; this.btn_Options_DeleteAllElevationPaths.Click += new System.EventHandler(this.btn_Options_DeleteAllElevationPaths_Click); // // btn_Options_DeleteAllPropagationPaths // this.btn_Options_DeleteAllPropagationPaths.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btn_Options_DeleteAllPropagationPaths.Location = new System.Drawing.Point(15, 48); + this.btn_Options_DeleteAllPropagationPaths.Location = new System.Drawing.Point(6, 48); this.btn_Options_DeleteAllPropagationPaths.Name = "btn_Options_DeleteAllPropagationPaths"; - this.btn_Options_DeleteAllPropagationPaths.Size = new System.Drawing.Size(266, 23); + this.btn_Options_DeleteAllPropagationPaths.Size = new System.Drawing.Size(153, 23); this.btn_Options_DeleteAllPropagationPaths.TabIndex = 1; this.btn_Options_DeleteAllPropagationPaths.Text = "Delete All Propagation Paths"; - this.toolTip1.SetToolTip(this.btn_Options_DeleteAllPropagationPaths, "Deletes all precalculated propagation paths from database"); + this.tt_Options.SetToolTip(this.btn_Options_DeleteAllPropagationPaths, "Deletes all precalculated propagation paths from database"); this.btn_Options_DeleteAllPropagationPaths.UseVisualStyleBackColor = true; this.btn_Options_DeleteAllPropagationPaths.Click += new System.EventHandler(this.btn_Options_DeleteAllPropagationPaths_Click); // + // cb_Options_Locations_RestrictToAreaOfInterest + // + this.cb_Options_Locations_RestrictToAreaOfInterest.AutoSize = true; + this.cb_Options_Locations_RestrictToAreaOfInterest.Checked = global::AirScout.Properties.Settings.Default.Location_RestrictToAreaOfInterest; + this.cb_Options_Locations_RestrictToAreaOfInterest.CheckState = System.Windows.Forms.CheckState.Checked; + this.cb_Options_Locations_RestrictToAreaOfInterest.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::AirScout.Properties.Settings.Default, "Location_RestrictToAreaOfInterest", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.cb_Options_Locations_RestrictToAreaOfInterest.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.cb_Options_Locations_RestrictToAreaOfInterest.Location = new System.Drawing.Point(12, 58); + this.cb_Options_Locations_RestrictToAreaOfInterest.Name = "cb_Options_Locations_RestrictToAreaOfInterest"; + this.cb_Options_Locations_RestrictToAreaOfInterest.Size = new System.Drawing.Size(230, 17); + this.cb_Options_Locations_RestrictToAreaOfInterest.TabIndex = 12; + this.cb_Options_Locations_RestrictToAreaOfInterest.Text = "Restrict locations to current Area of Interest"; + this.tt_Options.SetToolTip(this.cb_Options_Locations_RestrictToAreaOfInterest, "Restrict stations kept in the database to Area of Interest \r\n(all other stations" + + " will be removed during the update process)"); + this.cb_Options_Locations_RestrictToAreaOfInterest.UseVisualStyleBackColor = true; + // // cb_Options_Path_BestCaseElevation // this.cb_Options_Path_BestCaseElevation.AutoSize = true; @@ -632,7 +645,7 @@ this.cb_Options_Path_BestCaseElevation.Tag = ""; this.cb_Options_Path_BestCaseElevation.Text = "Use best case elevation from grid square for both stations if precise location is" + " unknown"; - this.toolTip1.SetToolTip(this.cb_Options_Path_BestCaseElevation, "If an exact position of a station is not available, use highest available elevati" + + this.tt_Options.SetToolTip(this.cb_Options_Path_BestCaseElevation, "If an exact position of a station is not available, use highest available elevati" + "on within the given grid square. \r\nThis position is ONLY used for path calculati" + "on and is not kept in database."); this.cb_Options_Path_BestCaseElevation.UseVisualStyleBackColor = true; @@ -648,10 +661,70 @@ this.cb_Options_Planes_KeepHistory.Size = new System.Drawing.Size(156, 17); this.cb_Options_Planes_KeepHistory.TabIndex = 4; this.cb_Options_Planes_KeepHistory.Text = "Keep Plane Position History"; - this.toolTip1.SetToolTip(this.cb_Options_Planes_KeepHistory, "Check this option to keep plane positions in database for history analysis.\r\nCAUT" + + this.tt_Options.SetToolTip(this.cb_Options_Planes_KeepHistory, "Check this option to keep plane positions in database for history analysis.\r\nCAUT" + "ION! This will need lot of CPU performance and space on disk!"); this.cb_Options_Planes_KeepHistory.UseVisualStyleBackColor = true; // + // btn_Options_Open_TmpDirectory + // + this.btn_Options_Open_TmpDirectory.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btn_Options_Open_TmpDirectory.Location = new System.Drawing.Point(18, 86); + this.btn_Options_Open_TmpDirectory.Name = "btn_Options_Open_TmpDirectory"; + this.btn_Options_Open_TmpDirectory.Size = new System.Drawing.Size(265, 27); + this.btn_Options_Open_TmpDirectory.TabIndex = 2; + this.btn_Options_Open_TmpDirectory.Text = "Open AirScout Tmp Directory in Explorer Window"; + this.tt_Options.SetToolTip(this.btn_Options_Open_TmpDirectory, "Click to see your temp files in Explorer window. "); + this.btn_Options_Open_TmpDirectory.UseVisualStyleBackColor = true; + this.btn_Options_Open_TmpDirectory.Click += new System.EventHandler(this.btn_Options_Open_TmpDirectory_Click); + // + // btn_Options_Open_LogDirectory + // + this.btn_Options_Open_LogDirectory.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btn_Options_Open_LogDirectory.Location = new System.Drawing.Point(18, 53); + this.btn_Options_Open_LogDirectory.Name = "btn_Options_Open_LogDirectory"; + this.btn_Options_Open_LogDirectory.Size = new System.Drawing.Size(265, 27); + this.btn_Options_Open_LogDirectory.TabIndex = 1; + this.btn_Options_Open_LogDirectory.Text = "Open AirScout Log Directory in Explorer Window"; + this.tt_Options.SetToolTip(this.btn_Options_Open_LogDirectory, "Click to see your logfiles in Explorer window."); + this.btn_Options_Open_LogDirectory.UseVisualStyleBackColor = true; + this.btn_Options_Open_LogDirectory.Click += new System.EventHandler(this.btn_Options_Open_LogDirectory_Click); + // + // btn_DeleteAllMapTiles + // + this.btn_DeleteAllMapTiles.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btn_DeleteAllMapTiles.Location = new System.Drawing.Point(165, 19); + this.btn_DeleteAllMapTiles.Name = "btn_DeleteAllMapTiles"; + this.btn_DeleteAllMapTiles.Size = new System.Drawing.Size(122, 23); + this.btn_DeleteAllMapTiles.TabIndex = 2; + this.btn_DeleteAllMapTiles.Text = "Delete All Map Tiles"; + this.tt_Options.SetToolTip(this.btn_DeleteAllMapTiles, "Deletes all cached map tiles from database"); + this.btn_DeleteAllMapTiles.UseVisualStyleBackColor = true; + this.btn_DeleteAllMapTiles.Click += new System.EventHandler(this.btn_DeleteAllMapTiles_Click); + // + // btn_Options_Open_PluginDirectory + // + this.btn_Options_Open_PluginDirectory.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btn_Options_Open_PluginDirectory.Location = new System.Drawing.Point(18, 119); + this.btn_Options_Open_PluginDirectory.Name = "btn_Options_Open_PluginDirectory"; + this.btn_Options_Open_PluginDirectory.Size = new System.Drawing.Size(265, 27); + this.btn_Options_Open_PluginDirectory.TabIndex = 6; + this.btn_Options_Open_PluginDirectory.Text = "Open AirScout Plugin Directory in Explorer Window"; + this.tt_Options.SetToolTip(this.btn_Options_Open_PluginDirectory, "Click to see your plugin files and settings in Explorer window. "); + this.btn_Options_Open_PluginDirectory.UseVisualStyleBackColor = true; + this.btn_Options_Open_PluginDirectory.Click += new System.EventHandler(this.btn_Options_Open_PluginDirectory_Click); + // + // btn_Options_Open_AirScoutDirectory + // + this.btn_Options_Open_AirScoutDirectory.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btn_Options_Open_AirScoutDirectory.Location = new System.Drawing.Point(18, 20); + this.btn_Options_Open_AirScoutDirectory.Name = "btn_Options_Open_AirScoutDirectory"; + this.btn_Options_Open_AirScoutDirectory.Size = new System.Drawing.Size(265, 27); + this.btn_Options_Open_AirScoutDirectory.TabIndex = 7; + this.btn_Options_Open_AirScoutDirectory.Text = "Open AirScout Program Directory in Explorer Window"; + this.tt_Options.SetToolTip(this.btn_Options_Open_AirScoutDirectory, "Click to open AirScout\'s program directory in Explorer window."); + this.btn_Options_Open_AirScoutDirectory.UseVisualStyleBackColor = true; + this.btn_Options_Open_AirScoutDirectory.Click += new System.EventHandler(this.btn_Options_Open_AirScoutDirectory_Click); + // // tab_Options_Planes // this.tab_Options_Planes.BackColor = System.Drawing.SystemColors.Control; @@ -660,9 +733,9 @@ this.tab_Options_Planes.Controls.Add(this.groupBox38); this.tab_Options_Planes.Controls.Add(this.groupBox26); this.tab_Options_Planes.Controls.Add(this.groupBox6); - this.tab_Options_Planes.Location = new System.Drawing.Point(4, 22); + this.tab_Options_Planes.Location = new System.Drawing.Point(4, 40); this.tab_Options_Planes.Name = "tab_Options_Planes"; - this.tab_Options_Planes.Size = new System.Drawing.Size(671, 460); + this.tab_Options_Planes.Size = new System.Drawing.Size(671, 480); this.tab_Options_Planes.TabIndex = 4; this.tab_Options_Planes.Text = "Planes"; this.tab_Options_Planes.Enter += new System.EventHandler(this.tab_Options_Planes_Enter); @@ -1293,9 +1366,9 @@ // this.tab_Options_Path.BackColor = System.Drawing.SystemColors.Control; this.tab_Options_Path.Controls.Add(this.groupBox1); - this.tab_Options_Path.Location = new System.Drawing.Point(4, 22); + this.tab_Options_Path.Location = new System.Drawing.Point(4, 40); this.tab_Options_Path.Name = "tab_Options_Path"; - this.tab_Options_Path.Size = new System.Drawing.Size(671, 460); + this.tab_Options_Path.Size = new System.Drawing.Size(671, 480); this.tab_Options_Path.TabIndex = 3; this.tab_Options_Path.Text = "Path"; this.tab_Options_Path.Enter += new System.EventHandler(this.tab_Options_Path_Enter); @@ -1404,9 +1477,9 @@ this.tab_Options_SRTM1.Controls.Add(this.btn_Options_SRTM1_Copyright); this.tab_Options_SRTM1.Controls.Add(this.groupBox13); this.tab_Options_SRTM1.Controls.Add(this.groupBox12); - this.tab_Options_SRTM1.Location = new System.Drawing.Point(4, 22); + this.tab_Options_SRTM1.Location = new System.Drawing.Point(4, 40); this.tab_Options_SRTM1.Name = "tab_Options_SRTM1"; - this.tab_Options_SRTM1.Size = new System.Drawing.Size(671, 460); + this.tab_Options_SRTM1.Size = new System.Drawing.Size(671, 480); this.tab_Options_SRTM1.TabIndex = 9; this.tab_Options_SRTM1.Text = "SRTM1"; this.tab_Options_SRTM1.Enter += new System.EventHandler(this.tab_Options_SRTM1_Enter); @@ -1539,9 +1612,9 @@ this.tab_Options_SRTM3.Controls.Add(this.btn_Options_SRTM3_Copyright); this.tab_Options_SRTM3.Controls.Add(this.groupBox9); this.tab_Options_SRTM3.Controls.Add(this.groupBox8); - this.tab_Options_SRTM3.Location = new System.Drawing.Point(4, 22); + this.tab_Options_SRTM3.Location = new System.Drawing.Point(4, 40); this.tab_Options_SRTM3.Name = "tab_Options_SRTM3"; - this.tab_Options_SRTM3.Size = new System.Drawing.Size(671, 460); + this.tab_Options_SRTM3.Size = new System.Drawing.Size(671, 480); this.tab_Options_SRTM3.TabIndex = 8; this.tab_Options_SRTM3.Text = "SRTM3"; this.tab_Options_SRTM3.Enter += new System.EventHandler(this.tab_Options_SRTM3_Enter); @@ -1674,9 +1747,9 @@ this.tab_Options_GLOBE.Controls.Add(this.btn_Options_GLOBE_Copyright); this.tab_Options_GLOBE.Controls.Add(this.groupBox11); this.tab_Options_GLOBE.Controls.Add(this.groupBox10); - this.tab_Options_GLOBE.Location = new System.Drawing.Point(4, 22); + this.tab_Options_GLOBE.Location = new System.Drawing.Point(4, 40); this.tab_Options_GLOBE.Name = "tab_Options_GLOBE"; - this.tab_Options_GLOBE.Size = new System.Drawing.Size(671, 460); + this.tab_Options_GLOBE.Size = new System.Drawing.Size(671, 480); this.tab_Options_GLOBE.TabIndex = 6; this.tab_Options_GLOBE.Text = "GLOBE"; this.tab_Options_GLOBE.Enter += new System.EventHandler(this.tab_Options_GLOBE_Enter); @@ -1807,6 +1880,7 @@ // tab_Options_Map // this.tab_Options_Map.BackColor = System.Drawing.SystemColors.Control; + this.tab_Options_Map.Controls.Add(this.groupBox49); this.tab_Options_Map.Controls.Add(this.groupBox37); this.tab_Options_Map.Controls.Add(this.groupBox39); this.tab_Options_Map.Controls.Add(this.groupBox23); @@ -1814,23 +1888,105 @@ this.tab_Options_Map.Controls.Add(this.groupBox7); this.tab_Options_Map.Controls.Add(this.groupBox22); this.tab_Options_Map.Controls.Add(this.groupBox2); - this.tab_Options_Map.Location = new System.Drawing.Point(4, 22); + this.tab_Options_Map.Location = new System.Drawing.Point(4, 40); this.tab_Options_Map.Name = "tab_Options_Map"; - this.tab_Options_Map.Size = new System.Drawing.Size(671, 460); + this.tab_Options_Map.Size = new System.Drawing.Size(671, 480); this.tab_Options_Map.TabIndex = 2; this.tab_Options_Map.Text = "Map"; this.tab_Options_Map.Enter += new System.EventHandler(this.tab_Options_Map_Enter); this.tab_Options_Map.Validating += new System.ComponentModel.CancelEventHandler(this.tab_Options_Map_Validating); // + // groupBox49 + // + this.groupBox49.Controls.Add(this.cb_Options_Map_SmallMarkers); + this.groupBox49.Controls.Add(this.cb_Options_Map_LabelCalls); + this.groupBox49.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.groupBox49.Location = new System.Drawing.Point(415, 140); + this.groupBox49.Name = "groupBox49"; + this.groupBox49.Size = new System.Drawing.Size(242, 80); + this.groupBox49.TabIndex = 10; + this.groupBox49.TabStop = false; + this.groupBox49.Text = "Multi-Path"; + // + // cb_Options_Map_SmallMarkers + // + this.cb_Options_Map_SmallMarkers.AutoSize = true; + this.cb_Options_Map_SmallMarkers.Checked = global::AirScout.Properties.Settings.Default.Map_SmallMarkers; + this.cb_Options_Map_SmallMarkers.CheckState = System.Windows.Forms.CheckState.Checked; + this.cb_Options_Map_SmallMarkers.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::AirScout.Properties.Settings.Default, "Map_SmallMarkers", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.cb_Options_Map_SmallMarkers.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.cb_Options_Map_SmallMarkers.Location = new System.Drawing.Point(18, 22); + this.cb_Options_Map_SmallMarkers.Name = "cb_Options_Map_SmallMarkers"; + this.cb_Options_Map_SmallMarkers.Size = new System.Drawing.Size(199, 17); + this.cb_Options_Map_SmallMarkers.TabIndex = 2; + this.cb_Options_Map_SmallMarkers.Text = "Use Small Markers for all Path Marks"; + this.cb_Options_Map_SmallMarkers.UseVisualStyleBackColor = true; + // + // cb_Options_Map_LabelCalls + // + this.cb_Options_Map_LabelCalls.AutoSize = true; + this.cb_Options_Map_LabelCalls.Checked = global::AirScout.Properties.Settings.Default.Map_LabelCalls; + this.cb_Options_Map_LabelCalls.CheckState = System.Windows.Forms.CheckState.Checked; + this.cb_Options_Map_LabelCalls.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::AirScout.Properties.Settings.Default, "Map_LabelCalls", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.cb_Options_Map_LabelCalls.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.cb_Options_Map_LabelCalls.Location = new System.Drawing.Point(18, 45); + this.cb_Options_Map_LabelCalls.Name = "cb_Options_Map_LabelCalls"; + this.cb_Options_Map_LabelCalls.Size = new System.Drawing.Size(209, 17); + this.cb_Options_Map_LabelCalls.TabIndex = 3; + this.cb_Options_Map_LabelCalls.Text = "Show Labels with Callsign at Locations"; + this.cb_Options_Map_LabelCalls.UseVisualStyleBackColor = true; + // + // groupBox37 + // + this.groupBox37.Controls.Add(this.label34); + this.groupBox37.Controls.Add(this.ud_Options_Charts_FontSize); + this.groupBox37.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.groupBox37.Location = new System.Drawing.Point(415, 301); + this.groupBox37.Name = "groupBox37"; + this.groupBox37.Size = new System.Drawing.Size(242, 51); + this.groupBox37.TabIndex = 9; + this.groupBox37.TabStop = false; + this.groupBox37.Text = "Chart Window Options"; + // + // label34 + // + this.label34.AutoSize = true; + this.label34.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label34.Location = new System.Drawing.Point(15, 17); + this.label34.Name = "label34"; + this.label34.Size = new System.Drawing.Size(174, 13); + this.label34.TabIndex = 2; + this.label34.Text = "Font Size for Axes in Diagrams etc.:"; + // + // ud_Options_Charts_FontSize + // + this.ud_Options_Charts_FontSize.DataBindings.Add(new System.Windows.Forms.Binding("Value", global::AirScout.Properties.Settings.Default, "Charts_FontSize", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.ud_Options_Charts_FontSize.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.ud_Options_Charts_FontSize.Location = new System.Drawing.Point(192, 15); + this.ud_Options_Charts_FontSize.Maximum = new decimal(new int[] { + 16, + 0, + 0, + 0}); + this.ud_Options_Charts_FontSize.Minimum = new decimal(new int[] { + 6, + 0, + 0, + 0}); + this.ud_Options_Charts_FontSize.Name = "ud_Options_Charts_FontSize"; + this.ud_Options_Charts_FontSize.Size = new System.Drawing.Size(45, 22); + this.ud_Options_Charts_FontSize.TabIndex = 0; + this.ud_Options_Charts_FontSize.Value = global::AirScout.Properties.Settings.Default.Charts_FontSize; + // // groupBox39 // this.groupBox39.Controls.Add(this.tb_Options_Map_Update_Interval); this.groupBox39.Controls.Add(this.label97); this.groupBox39.Controls.Add(this.label29); this.groupBox39.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.groupBox39.Location = new System.Drawing.Point(415, 156); + this.groupBox39.Location = new System.Drawing.Point(415, 226); this.groupBox39.Name = "groupBox39"; - this.groupBox39.Size = new System.Drawing.Size(242, 64); + this.groupBox39.Size = new System.Drawing.Size(242, 69); this.groupBox39.TabIndex = 8; this.groupBox39.TabStop = false; this.groupBox39.Text = "Screen Updates"; @@ -1840,7 +1996,7 @@ this.tb_Options_Map_Update_Interval.DataBindings.Add(new System.Windows.Forms.Binding("Value", global::AirScout.Properties.Settings.Default, "Map_Update", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.tb_Options_Map_Update_Interval.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.tb_Options_Map_Update_Interval.FormatSpecifier = "F0"; - this.tb_Options_Map_Update_Interval.Location = new System.Drawing.Point(121, 18); + this.tb_Options_Map_Update_Interval.Location = new System.Drawing.Point(119, 33); this.tb_Options_Map_Update_Interval.MaxValue = 3600; this.tb_Options_Map_Update_Interval.MinValue = 0; this.tb_Options_Map_Update_Interval.Name = "tb_Options_Map_Update_Interval"; @@ -1853,7 +2009,7 @@ // this.label97.AutoSize = true; this.label97.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label97.Location = new System.Drawing.Point(173, 21); + this.label97.Location = new System.Drawing.Point(171, 36); this.label97.Name = "label97"; this.label97.Size = new System.Drawing.Size(56, 13); this.label97.TabIndex = 22; @@ -1863,7 +2019,7 @@ // this.label29.AutoSize = true; this.label29.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label29.Location = new System.Drawing.Point(6, 21); + this.label29.Location = new System.Drawing.Point(4, 36); this.label29.Name = "label29"; this.label29.Size = new System.Drawing.Size(109, 13); this.label29.TabIndex = 20; @@ -1871,45 +2027,57 @@ // // groupBox23 // - this.groupBox23.Controls.Add(this.cb_Options_Map_LabelCalls); - this.groupBox23.Controls.Add(this.cb_Options_Map_SmallMarkers); + this.groupBox23.Controls.Add(this.ud_Options_Map_Preloader_MaxZoom); + this.groupBox23.Controls.Add(this.label144); + this.groupBox23.Controls.Add(this.cb_Options_Map_Preloader_Enabled); this.groupBox23.Controls.Add(this.cb_Options_Watchlist_Activate); this.groupBox23.Controls.Add(this.cb_Options_Airports_Activate); this.groupBox23.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.groupBox23.Location = new System.Drawing.Point(14, 156); + this.groupBox23.Location = new System.Drawing.Point(14, 139); this.groupBox23.Name = "groupBox23"; - this.groupBox23.Size = new System.Drawing.Size(394, 64); + this.groupBox23.Size = new System.Drawing.Size(394, 81); this.groupBox23.TabIndex = 7; this.groupBox23.TabStop = false; this.groupBox23.Text = "General "; // - // cb_Options_Map_LabelCalls + // ud_Options_Map_Preloader_MaxZoom // - this.cb_Options_Map_LabelCalls.AutoSize = true; - this.cb_Options_Map_LabelCalls.Checked = global::AirScout.Properties.Settings.Default.Map_LabelCalls; - this.cb_Options_Map_LabelCalls.CheckState = System.Windows.Forms.CheckState.Checked; - this.cb_Options_Map_LabelCalls.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::AirScout.Properties.Settings.Default, "Map_LabelCalls", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.cb_Options_Map_LabelCalls.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cb_Options_Map_LabelCalls.Location = new System.Drawing.Point(202, 39); - this.cb_Options_Map_LabelCalls.Name = "cb_Options_Map_LabelCalls"; - this.cb_Options_Map_LabelCalls.Size = new System.Drawing.Size(167, 17); - this.cb_Options_Map_LabelCalls.TabIndex = 3; - this.cb_Options_Map_LabelCalls.Text = "Label calls in Multi-Path Mode"; - this.cb_Options_Map_LabelCalls.UseVisualStyleBackColor = true; + this.ud_Options_Map_Preloader_MaxZoom.DataBindings.Add(new System.Windows.Forms.Binding("Value", global::AirScout.Properties.Settings.Default, "Map_Preloader_MaxZoom", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.ud_Options_Map_Preloader_MaxZoom.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.ud_Options_Map_Preloader_MaxZoom.Location = new System.Drawing.Point(319, 44); + this.ud_Options_Map_Preloader_MaxZoom.Maximum = new decimal(new int[] { + 11, + 0, + 0, + 0}); + this.ud_Options_Map_Preloader_MaxZoom.Name = "ud_Options_Map_Preloader_MaxZoom"; + this.ud_Options_Map_Preloader_MaxZoom.Size = new System.Drawing.Size(54, 22); + this.ud_Options_Map_Preloader_MaxZoom.TabIndex = 6; + this.ud_Options_Map_Preloader_MaxZoom.Value = global::AirScout.Properties.Settings.Default.Map_Preloader_MaxZoom; // - // cb_Options_Map_SmallMarkers + // label144 // - this.cb_Options_Map_SmallMarkers.AutoSize = true; - this.cb_Options_Map_SmallMarkers.Checked = global::AirScout.Properties.Settings.Default.Map_SmallMarkers; - this.cb_Options_Map_SmallMarkers.CheckState = System.Windows.Forms.CheckState.Checked; - this.cb_Options_Map_SmallMarkers.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::AirScout.Properties.Settings.Default, "Map_SmallMarkers", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.cb_Options_Map_SmallMarkers.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cb_Options_Map_SmallMarkers.Location = new System.Drawing.Point(15, 41); - this.cb_Options_Map_SmallMarkers.Name = "cb_Options_Map_SmallMarkers"; - this.cb_Options_Map_SmallMarkers.Size = new System.Drawing.Size(183, 17); - this.cb_Options_Map_SmallMarkers.TabIndex = 2; - this.cb_Options_Map_SmallMarkers.Text = "Small Markers in Multi-Path Mode"; - this.cb_Options_Map_SmallMarkers.UseVisualStyleBackColor = true; + this.label144.AutoSize = true; + this.label144.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label144.Location = new System.Drawing.Point(226, 42); + this.label144.Name = "label144"; + this.label144.Size = new System.Drawing.Size(87, 26); + this.label144.TabIndex = 5; + this.label144.Text = "Preload down to \r\nZoom Level:"; + // + // cb_Options_Map_Preloader_Enabled + // + this.cb_Options_Map_Preloader_Enabled.AutoSize = true; + this.cb_Options_Map_Preloader_Enabled.Checked = global::AirScout.Properties.Settings.Default.Map_Preloader_Enabled; + this.cb_Options_Map_Preloader_Enabled.CheckState = System.Windows.Forms.CheckState.Checked; + this.cb_Options_Map_Preloader_Enabled.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::AirScout.Properties.Settings.Default, "Map_Preloader_Enabled", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.cb_Options_Map_Preloader_Enabled.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.cb_Options_Map_Preloader_Enabled.Location = new System.Drawing.Point(15, 41); + this.cb_Options_Map_Preloader_Enabled.Name = "cb_Options_Map_Preloader_Enabled"; + this.cb_Options_Map_Preloader_Enabled.Size = new System.Drawing.Size(205, 30); + this.cb_Options_Map_Preloader_Enabled.TabIndex = 4; + this.cb_Options_Map_Preloader_Enabled.Text = "Enable Map Preloading from AirScout \r\nWeb Server or Selected Provider"; + this.cb_Options_Map_Preloader_Enabled.UseVisualStyleBackColor = true; // // cb_Options_Watchlist_Activate // @@ -1918,11 +2086,11 @@ this.cb_Options_Watchlist_Activate.CheckState = System.Windows.Forms.CheckState.Checked; this.cb_Options_Watchlist_Activate.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::AirScout.Properties.Settings.Default, "Watchlist_Activated", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.cb_Options_Watchlist_Activate.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cb_Options_Watchlist_Activate.Location = new System.Drawing.Point(202, 17); + this.cb_Options_Watchlist_Activate.Location = new System.Drawing.Point(229, 19); this.cb_Options_Watchlist_Activate.Name = "cb_Options_Watchlist_Activate"; - this.cb_Options_Watchlist_Activate.Size = new System.Drawing.Size(183, 17); + this.cb_Options_Watchlist_Activate.Size = new System.Drawing.Size(144, 17); this.cb_Options_Watchlist_Activate.TabIndex = 1; - this.cb_Options_Watchlist_Activate.Text = "Show Calls from Watchlist in Map"; + this.cb_Options_Watchlist_Activate.Text = "Show Watchlist Callsigns"; this.cb_Options_Watchlist_Activate.UseVisualStyleBackColor = true; // // cb_Options_Airports_Activate @@ -1951,9 +2119,9 @@ this.groupBox30.Controls.Add(this.label81); this.groupBox30.Controls.Add(this.label80); this.groupBox30.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.groupBox30.Location = new System.Drawing.Point(424, 301); + this.groupBox30.Location = new System.Drawing.Point(415, 358); this.groupBox30.Name = "groupBox30"; - this.groupBox30.Size = new System.Drawing.Size(233, 154); + this.groupBox30.Size = new System.Drawing.Size(242, 97); this.groupBox30.TabIndex = 6; this.groupBox30.TabStop = false; this.groupBox30.Text = "Plane Icon Sizes per Category"; @@ -1963,7 +2131,7 @@ this.tb_Options_Planes_IconSize_S.DataBindings.Add(new System.Windows.Forms.Binding("Value", global::AirScout.Properties.Settings.Default, "Planes_IconSize_S", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.tb_Options_Planes_IconSize_S.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.tb_Options_Planes_IconSize_S.FormatSpecifier = "F0"; - this.tb_Options_Planes_IconSize_S.Location = new System.Drawing.Point(81, 103); + this.tb_Options_Planes_IconSize_S.Location = new System.Drawing.Point(183, 47); this.tb_Options_Planes_IconSize_S.MaxValue = 128; this.tb_Options_Planes_IconSize_S.MinValue = 0; this.tb_Options_Planes_IconSize_S.Name = "tb_Options_Planes_IconSize_S"; @@ -1977,7 +2145,7 @@ this.tb_Options_Planes_IconSize_H.DataBindings.Add(new System.Windows.Forms.Binding("Value", global::AirScout.Properties.Settings.Default, "Planes_IconSize_H", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.tb_Options_Planes_IconSize_H.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.tb_Options_Planes_IconSize_H.FormatSpecifier = "F0"; - this.tb_Options_Planes_IconSize_H.Location = new System.Drawing.Point(81, 78); + this.tb_Options_Planes_IconSize_H.Location = new System.Drawing.Point(183, 19); this.tb_Options_Planes_IconSize_H.MaxValue = 128; this.tb_Options_Planes_IconSize_H.MinValue = 0; this.tb_Options_Planes_IconSize_H.Name = "tb_Options_Planes_IconSize_H"; @@ -1991,7 +2159,7 @@ this.tb_Options_Planes_IconSize_M.DataBindings.Add(new System.Windows.Forms.Binding("Value", global::AirScout.Properties.Settings.Default, "Planes_IconSize_M", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.tb_Options_Planes_IconSize_M.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.tb_Options_Planes_IconSize_M.FormatSpecifier = "F0"; - this.tb_Options_Planes_IconSize_M.Location = new System.Drawing.Point(81, 53); + this.tb_Options_Planes_IconSize_M.Location = new System.Drawing.Point(63, 47); this.tb_Options_Planes_IconSize_M.MaxValue = 128; this.tb_Options_Planes_IconSize_M.MinValue = 0; this.tb_Options_Planes_IconSize_M.Name = "tb_Options_Planes_IconSize_M"; @@ -2005,7 +2173,7 @@ this.tb_Options_Planes_IconSize_L.DataBindings.Add(new System.Windows.Forms.Binding("Value", global::AirScout.Properties.Settings.Default, "Planes_IconSize_L", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.tb_Options_Planes_IconSize_L.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.tb_Options_Planes_IconSize_L.FormatSpecifier = "F0"; - this.tb_Options_Planes_IconSize_L.Location = new System.Drawing.Point(81, 28); + this.tb_Options_Planes_IconSize_L.Location = new System.Drawing.Point(63, 21); this.tb_Options_Planes_IconSize_L.MaxValue = 128; this.tb_Options_Planes_IconSize_L.MinValue = 0; this.tb_Options_Planes_IconSize_L.Name = "tb_Options_Planes_IconSize_L"; @@ -2018,7 +2186,7 @@ // this.label84.AutoSize = true; this.label84.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label84.Location = new System.Drawing.Point(37, 128); + this.label84.Location = new System.Drawing.Point(44, 77); this.label84.Name = "label84"; this.label84.Size = new System.Drawing.Size(137, 13); this.label84.TabIndex = 12; @@ -2028,7 +2196,7 @@ // this.label83.AutoSize = true; this.label83.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label83.Location = new System.Drawing.Point(23, 59); + this.label83.Location = new System.Drawing.Point(15, 51); this.label83.Name = "label83"; this.label83.Size = new System.Drawing.Size(47, 13); this.label83.TabIndex = 7; @@ -2038,7 +2206,7 @@ // this.label82.AutoSize = true; this.label82.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label82.Location = new System.Drawing.Point(24, 83); + this.label82.Location = new System.Drawing.Point(131, 25); this.label82.Name = "label82"; this.label82.Size = new System.Drawing.Size(41, 13); this.label82.TabIndex = 6; @@ -2048,7 +2216,7 @@ // this.label81.AutoSize = true; this.label81.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label81.Location = new System.Drawing.Point(24, 108); + this.label81.Location = new System.Drawing.Point(131, 51); this.label81.Name = "label81"; this.label81.Size = new System.Drawing.Size(38, 13); this.label81.TabIndex = 5; @@ -2058,7 +2226,7 @@ // this.label80.AutoSize = true; this.label80.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label80.Location = new System.Drawing.Point(23, 32); + this.label80.Location = new System.Drawing.Point(15, 25); this.label80.Name = "label80"; this.label80.Size = new System.Drawing.Size(33, 13); this.label80.TabIndex = 4; @@ -2366,7 +2534,7 @@ this.groupBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.groupBox2.Location = new System.Drawing.Point(13, 10); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(644, 141); + this.groupBox2.Size = new System.Drawing.Size(644, 123); this.groupBox2.TabIndex = 3; this.groupBox2.TabStop = false; this.groupBox2.Text = "Map Source"; @@ -2376,7 +2544,7 @@ this.label61.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label61.Location = new System.Drawing.Point(26, 17); this.label61.Name = "label61"; - this.label61.Size = new System.Drawing.Size(612, 87); + this.label61.Size = new System.Drawing.Size(612, 69); this.label61.TabIndex = 1; this.label61.Text = resources.GetString("label61.Text"); this.label61.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -2386,7 +2554,7 @@ this.cb_Options_Map_Provider.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cb_Options_Map_Provider.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.cb_Options_Map_Provider.FormattingEnabled = true; - this.cb_Options_Map_Provider.Location = new System.Drawing.Point(218, 107); + this.cb_Options_Map_Provider.Location = new System.Drawing.Point(215, 89); this.cb_Options_Map_Provider.Name = "cb_Options_Map_Provider"; this.cb_Options_Map_Provider.Size = new System.Drawing.Size(210, 21); this.cb_Options_Map_Provider.TabIndex = 0; @@ -2403,10 +2571,10 @@ this.tab_Options_Stations.Controls.Add(this.groupBox16); this.tab_Options_Stations.Controls.Add(this.groupBox5); this.tab_Options_Stations.Controls.Add(this.groupBox4); - this.tab_Options_Stations.Location = new System.Drawing.Point(4, 22); + this.tab_Options_Stations.Location = new System.Drawing.Point(4, 40); this.tab_Options_Stations.Name = "tab_Options_Stations"; this.tab_Options_Stations.Padding = new System.Windows.Forms.Padding(3); - this.tab_Options_Stations.Size = new System.Drawing.Size(671, 460); + this.tab_Options_Stations.Size = new System.Drawing.Size(671, 480); this.tab_Options_Stations.TabIndex = 1; this.tab_Options_Stations.Text = "Stations"; this.tab_Options_Stations.Enter += new System.EventHandler(this.tab_Options_Stations_Enter); @@ -2767,6 +2935,7 @@ // // groupBox14 // + this.groupBox14.Controls.Add(this.cb_Options_Locations_RestrictToAreaOfInterest); this.groupBox14.Controls.Add(this.cb_Options_SmallLettersForSubSquares); this.groupBox14.Controls.Add(this.cb_Options_Locator_AutoLength); this.groupBox14.Controls.Add(this.label48); @@ -2777,7 +2946,7 @@ this.groupBox14.Size = new System.Drawing.Size(418, 78); this.groupBox14.TabIndex = 25; this.groupBox14.TabStop = false; - this.groupBox14.Text = "Locator Settings"; + this.groupBox14.Text = "Location Settings"; // // cb_Options_SmallLettersForSubSquares // @@ -2785,11 +2954,11 @@ this.cb_Options_SmallLettersForSubSquares.Checked = global::AirScout.Properties.Settings.Default.Locator_SmallLettersForSubsquares; this.cb_Options_SmallLettersForSubSquares.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::AirScout.Properties.Settings.Default, "Locator_SmallLettersForSubsquares", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.cb_Options_SmallLettersForSubSquares.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cb_Options_SmallLettersForSubSquares.Location = new System.Drawing.Point(12, 58); + this.cb_Options_SmallLettersForSubSquares.Location = new System.Drawing.Point(239, 16); this.cb_Options_SmallLettersForSubSquares.Name = "cb_Options_SmallLettersForSubSquares"; - this.cb_Options_SmallLettersForSubSquares.Size = new System.Drawing.Size(177, 17); + this.cb_Options_SmallLettersForSubSquares.Size = new System.Drawing.Size(157, 17); this.cb_Options_SmallLettersForSubSquares.TabIndex = 11; - this.cb_Options_SmallLettersForSubSquares.Text = "Use small letters for subsquares:"; + this.cb_Options_SmallLettersForSubSquares.Text = "Small letters for subsquares:"; this.cb_Options_SmallLettersForSubSquares.UseVisualStyleBackColor = true; this.cb_Options_SmallLettersForSubSquares.CheckedChanged += new System.EventHandler(this.cb_Options_SmallLettersForSubSquares_CheckedChanged); // @@ -2813,9 +2982,9 @@ this.label48.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label48.Location = new System.Drawing.Point(14, 17); this.label48.Name = "label48"; - this.label48.Size = new System.Drawing.Size(261, 13); + this.label48.Size = new System.Drawing.Size(161, 13); this.label48.TabIndex = 1; - this.label48.Text = "Number of digits on maps and in all text boxes (6 ..14):"; + this.label48.Text = "Number of Locator digits (6 ..14):"; // // ud_Options_Locator_MaxLength // @@ -2826,7 +2995,7 @@ 0, 0, 0}); - this.ud_Options_Locator_MaxLength.Location = new System.Drawing.Point(281, 15); + this.ud_Options_Locator_MaxLength.Location = new System.Drawing.Point(180, 15); this.ud_Options_Locator_MaxLength.Maximum = new decimal(new int[] { 14, 0, @@ -3239,12 +3408,11 @@ // this.tab_Options_General.BackColor = System.Drawing.SystemColors.Control; this.tab_Options_General.Controls.Add(this.groupBox25); - this.tab_Options_General.Controls.Add(this.groupBox17); this.tab_Options_General.ForeColor = System.Drawing.SystemColors.ControlText; - this.tab_Options_General.Location = new System.Drawing.Point(4, 22); + this.tab_Options_General.Location = new System.Drawing.Point(4, 40); this.tab_Options_General.Name = "tab_Options_General"; this.tab_Options_General.Padding = new System.Windows.Forms.Padding(3); - this.tab_Options_General.Size = new System.Drawing.Size(671, 460); + this.tab_Options_General.Size = new System.Drawing.Size(671, 480); this.tab_Options_General.TabIndex = 0; this.tab_Options_General.Text = "General"; this.tab_Options_General.Enter += new System.EventHandler(this.tab_Options_General_Enter); @@ -3264,7 +3432,7 @@ this.groupBox25.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.groupBox25.Location = new System.Drawing.Point(6, 6); this.groupBox25.Name = "groupBox25"; - this.groupBox25.Size = new System.Drawing.Size(599, 378); + this.groupBox25.Size = new System.Drawing.Size(659, 466); this.groupBox25.TabIndex = 1; this.groupBox25.TabStop = false; this.groupBox25.Text = "Covered Area"; @@ -3274,7 +3442,7 @@ this.tb_Coverage_MaxLat.DataBindings.Add(new System.Windows.Forms.Binding("Value", global::AirScout.Properties.Settings.Default, "MaxLat", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.tb_Coverage_MaxLat.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.tb_Coverage_MaxLat.FormatSpecifier = "F0"; - this.tb_Coverage_MaxLat.Location = new System.Drawing.Point(535, 351); + this.tb_Coverage_MaxLat.Location = new System.Drawing.Point(589, 416); this.tb_Coverage_MaxLat.MaxValue = 90D; this.tb_Coverage_MaxLat.MinValue = -90D; this.tb_Coverage_MaxLat.Name = "tb_Coverage_MaxLat"; @@ -3289,7 +3457,7 @@ this.tb_Coverage_MinLat.DataBindings.Add(new System.Windows.Forms.Binding("Value", global::AirScout.Properties.Settings.Default, "MinLat", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.tb_Coverage_MinLat.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.tb_Coverage_MinLat.FormatSpecifier = "F0"; - this.tb_Coverage_MinLat.Location = new System.Drawing.Point(535, 326); + this.tb_Coverage_MinLat.Location = new System.Drawing.Point(589, 391); this.tb_Coverage_MinLat.MaxValue = 90D; this.tb_Coverage_MinLat.MinValue = -90D; this.tb_Coverage_MinLat.Name = "tb_Coverage_MinLat"; @@ -3304,7 +3472,7 @@ this.tb_Coverage_MaxLon.DataBindings.Add(new System.Windows.Forms.Binding("Value", global::AirScout.Properties.Settings.Default, "MaxLon", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.tb_Coverage_MaxLon.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.tb_Coverage_MaxLon.FormatSpecifier = "F0"; - this.tb_Coverage_MaxLon.Location = new System.Drawing.Point(535, 299); + this.tb_Coverage_MaxLon.Location = new System.Drawing.Point(589, 364); this.tb_Coverage_MaxLon.MaxValue = 180D; this.tb_Coverage_MaxLon.MinValue = -180D; this.tb_Coverage_MaxLon.Name = "tb_Coverage_MaxLon"; @@ -3319,7 +3487,7 @@ this.tb_Coverage_MinLon.DataBindings.Add(new System.Windows.Forms.Binding("Value", global::AirScout.Properties.Settings.Default, "MinLon", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.tb_Coverage_MinLon.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.tb_Coverage_MinLon.FormatSpecifier = "F0"; - this.tb_Coverage_MinLon.Location = new System.Drawing.Point(535, 272); + this.tb_Coverage_MinLon.Location = new System.Drawing.Point(589, 337); this.tb_Coverage_MinLon.MaxValue = 180D; this.tb_Coverage_MinLon.MinValue = -180D; this.tb_Coverage_MinLon.Name = "tb_Coverage_MinLon"; @@ -3349,7 +3517,7 @@ this.gm_Options_Coverage.RoutesEnabled = true; this.gm_Options_Coverage.SelectedAreaFillColor = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(65)))), ((int)(((byte)(105)))), ((int)(((byte)(225))))); this.gm_Options_Coverage.ShowTileGridLines = false; - this.gm_Options_Coverage.Size = new System.Drawing.Size(418, 341); + this.gm_Options_Coverage.Size = new System.Drawing.Size(476, 420); this.gm_Options_Coverage.TabIndex = 26; this.gm_Options_Coverage.Zoom = 0D; // @@ -3357,7 +3525,7 @@ // this.label35.AutoSize = true; this.label35.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label35.Location = new System.Drawing.Point(449, 356); + this.label35.Location = new System.Drawing.Point(503, 421); this.label35.Name = "label35"; this.label35.Size = new System.Drawing.Size(74, 13); this.label35.TabIndex = 24; @@ -3367,7 +3535,7 @@ // this.label54.AutoSize = true; this.label54.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label54.Location = new System.Drawing.Point(449, 330); + this.label54.Location = new System.Drawing.Point(503, 395); this.label54.Name = "label54"; this.label54.Size = new System.Drawing.Size(71, 13); this.label54.TabIndex = 22; @@ -3377,7 +3545,7 @@ // this.label59.AutoSize = true; this.label59.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label59.Location = new System.Drawing.Point(449, 303); + this.label59.Location = new System.Drawing.Point(503, 368); this.label59.Name = "label59"; this.label59.Size = new System.Drawing.Size(83, 13); this.label59.TabIndex = 20; @@ -3387,81 +3555,12 @@ // this.label60.AutoSize = true; this.label60.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label60.Location = new System.Drawing.Point(449, 277); + this.label60.Location = new System.Drawing.Point(503, 342); this.label60.Name = "label60"; this.label60.Size = new System.Drawing.Size(80, 13); this.label60.TabIndex = 18; this.label60.Text = "Min. Longitude:"; // - // groupBox17 - // - this.groupBox17.Controls.Add(this.cb_Options_Watchlist_SyncWithKST); - this.groupBox17.Controls.Add(this.tb_Options_Watchlist_MaxCount); - this.groupBox17.Controls.Add(this.btn_Options_Watchlist_Manage); - this.groupBox17.Controls.Add(this.label31); - this.groupBox17.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.groupBox17.Location = new System.Drawing.Point(6, 390); - this.groupBox17.Name = "groupBox17"; - this.groupBox17.Size = new System.Drawing.Size(599, 58); - this.groupBox17.TabIndex = 0; - this.groupBox17.TabStop = false; - this.groupBox17.Text = "Watchlist"; - // - // cb_Options_Watchlist_SyncWithKST - // - this.cb_Options_Watchlist_SyncWithKST.AutoSize = true; - this.cb_Options_Watchlist_SyncWithKST.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; - this.cb_Options_Watchlist_SyncWithKST.Checked = global::AirScout.Properties.Settings.Default.Watchlist_SyncWithKST; - this.cb_Options_Watchlist_SyncWithKST.CheckState = System.Windows.Forms.CheckState.Checked; - this.cb_Options_Watchlist_SyncWithKST.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", global::AirScout.Properties.Settings.Default, "Server_Activate", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.cb_Options_Watchlist_SyncWithKST.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::AirScout.Properties.Settings.Default, "Watchlist_SyncWithKST", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.cb_Options_Watchlist_SyncWithKST.Enabled = global::AirScout.Properties.Settings.Default.Server_Activate; - this.cb_Options_Watchlist_SyncWithKST.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cb_Options_Watchlist_SyncWithKST.Location = new System.Drawing.Point(6, 37); - this.cb_Options_Watchlist_SyncWithKST.Name = "cb_Options_Watchlist_SyncWithKST"; - this.cb_Options_Watchlist_SyncWithKST.Size = new System.Drawing.Size(436, 17); - this.cb_Options_Watchlist_SyncWithKST.TabIndex = 6; - this.cb_Options_Watchlist_SyncWithKST.Text = "Keep in sync with KST user list (needs wtKST > V3.1 and network functions activat" + - "ed):"; - this.cb_Options_Watchlist_SyncWithKST.UseVisualStyleBackColor = true; - this.cb_Options_Watchlist_SyncWithKST.CheckedChanged += new System.EventHandler(this.cb_Options_Watchlist_SyncWithKST_CheckedChanged); - // - // tb_Options_Watchlist_MaxCount - // - this.tb_Options_Watchlist_MaxCount.DataBindings.Add(new System.Windows.Forms.Binding("Value", global::AirScout.Properties.Settings.Default, "Watchlist_MaxCount", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.tb_Options_Watchlist_MaxCount.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tb_Options_Watchlist_MaxCount.FormatSpecifier = "F0"; - this.tb_Options_Watchlist_MaxCount.Location = new System.Drawing.Point(395, 13); - this.tb_Options_Watchlist_MaxCount.MaxValue = 1000; - this.tb_Options_Watchlist_MaxCount.MinValue = 1; - this.tb_Options_Watchlist_MaxCount.Name = "tb_Options_Watchlist_MaxCount"; - this.tb_Options_Watchlist_MaxCount.Size = new System.Drawing.Size(47, 22); - this.tb_Options_Watchlist_MaxCount.TabIndex = 5; - this.tb_Options_Watchlist_MaxCount.Text = "1000"; - this.tb_Options_Watchlist_MaxCount.Value = global::AirScout.Properties.Settings.Default.Watchlist_MaxCount; - // - // btn_Options_Watchlist_Manage - // - this.btn_Options_Watchlist_Manage.Enabled = false; - this.btn_Options_Watchlist_Manage.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btn_Options_Watchlist_Manage.Location = new System.Drawing.Point(472, 21); - this.btn_Options_Watchlist_Manage.Name = "btn_Options_Watchlist_Manage"; - this.btn_Options_Watchlist_Manage.Size = new System.Drawing.Size(113, 23); - this.btn_Options_Watchlist_Manage.TabIndex = 7; - this.btn_Options_Watchlist_Manage.Text = "Manage Watchlist"; - this.btn_Options_Watchlist_Manage.UseVisualStyleBackColor = true; - this.btn_Options_Watchlist_Manage.Click += new System.EventHandler(this.btn_Options_Watchlist_Manage_Click); - // - // label31 - // - this.label31.AutoSize = true; - this.label31.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label31.Location = new System.Drawing.Point(6, 17); - this.label31.Name = "label31"; - this.label31.Size = new System.Drawing.Size(155, 13); - this.label31.TabIndex = 0; - this.label31.Text = "Number of entrys to keep in list:"; - // // tc_Options // this.tc_Options.Controls.Add(this.tab_Options_General); @@ -3476,13 +3575,16 @@ this.tc_Options.Controls.Add(this.tab_Options_Alarm); this.tc_Options.Controls.Add(this.tab_Options_Network); this.tc_Options.Controls.Add(this.tab_Options_SpecLab); - this.tc_Options.Controls.Add(this.tc_Track); + this.tc_Options.Controls.Add(this.tab_Options_Track); + this.tc_Options.Controls.Add(this.tab_Options_Watchlist); + this.tc_Options.Controls.Add(this.tab_Options_Misc); this.tc_Options.Controls.Add(this.tab_Options_Info); this.tc_Options.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.tc_Options.Location = new System.Drawing.Point(12, 12); + this.tc_Options.Multiline = true; this.tc_Options.Name = "tc_Options"; this.tc_Options.SelectedIndex = 0; - this.tc_Options.Size = new System.Drawing.Size(679, 486); + this.tc_Options.Size = new System.Drawing.Size(679, 524); this.tc_Options.TabIndex = 5; // // tab_Options_Database @@ -3490,13 +3592,12 @@ this.tab_Options_Database.BackColor = System.Drawing.SystemColors.Control; this.tab_Options_Database.Controls.Add(this.groupBox47); this.tab_Options_Database.Controls.Add(this.groupBox27); - this.tab_Options_Database.Controls.Add(this.groupBox15); this.tab_Options_Database.Controls.Add(this.gb_Options_Database_Settings); this.tab_Options_Database.Controls.Add(this.gb_Options_Database_Info); - this.tab_Options_Database.Location = new System.Drawing.Point(4, 22); + this.tab_Options_Database.Location = new System.Drawing.Point(4, 40); this.tab_Options_Database.Name = "tab_Options_Database"; this.tab_Options_Database.Padding = new System.Windows.Forms.Padding(3); - this.tab_Options_Database.Size = new System.Drawing.Size(671, 460); + this.tab_Options_Database.Size = new System.Drawing.Size(671, 480); this.tab_Options_Database.TabIndex = 15; this.tab_Options_Database.Text = "Database"; this.tab_Options_Database.Enter += new System.EventHandler(this.tab_Options_Database_Enter); @@ -3504,24 +3605,25 @@ // // groupBox47 // + this.groupBox47.Controls.Add(this.btn_DeleteAllMapTiles); this.groupBox47.Controls.Add(this.btn_Options_DeleteAllPropagationPaths); this.groupBox47.Controls.Add(this.btn_Options_DeleteAllElevationPaths); this.groupBox47.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.groupBox47.Location = new System.Drawing.Point(359, 370); + this.groupBox47.Location = new System.Drawing.Point(372, 393); this.groupBox47.Name = "groupBox47"; - this.groupBox47.Size = new System.Drawing.Size(306, 79); + this.groupBox47.Size = new System.Drawing.Size(293, 79); this.groupBox47.TabIndex = 4; this.groupBox47.TabStop = false; - this.groupBox47.Text = "Maintenance"; + this.groupBox47.Text = "Quick Maintenance Commands"; // // groupBox27 // this.groupBox27.Controls.Add(this.label108); this.groupBox27.Controls.Add(this.btn_Options_Import_Callsigns); this.groupBox27.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.groupBox27.Location = new System.Drawing.Point(15, 392); + this.groupBox27.Location = new System.Drawing.Point(375, 315); this.groupBox27.Name = "groupBox27"; - this.groupBox27.Size = new System.Drawing.Size(338, 57); + this.groupBox27.Size = new System.Drawing.Size(290, 72); this.groupBox27.TabIndex = 3; this.groupBox27.TabStop = false; this.groupBox27.Text = "Import"; @@ -3530,34 +3632,11 @@ // this.label108.AutoSize = true; this.label108.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label108.Location = new System.Drawing.Point(6, 26); + this.label108.Location = new System.Drawing.Point(27, 17); this.label108.Name = "label108"; this.label108.Size = new System.Drawing.Size(235, 13); this.label108.TabIndex = 6; this.label108.Text = "Import Callsign Database from previous versions:"; - // - // groupBox15 - // - this.groupBox15.Controls.Add(this.label105); - this.groupBox15.Controls.Add(this.btn_Open_TmpDirectory); - this.groupBox15.Controls.Add(this.btn_Open_LogDirectory); - this.groupBox15.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.groupBox15.Location = new System.Drawing.Point(362, 276); - this.groupBox15.Name = "groupBox15"; - this.groupBox15.Size = new System.Drawing.Size(306, 88); - this.groupBox15.TabIndex = 2; - this.groupBox15.TabStop = false; - this.groupBox15.Text = "OpenDirectories"; - // - // label105 - // - this.label105.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label105.Location = new System.Drawing.Point(12, 16); - this.label105.Name = "label105"; - this.label105.Size = new System.Drawing.Size(219, 31); - this.label105.TabIndex = 5; - this.label105.Text = "Open directories to see database files, logs, hardcopies, path calculations and m" + - "ore:"; // // gb_Options_Database_Settings // @@ -3568,9 +3647,9 @@ this.gb_Options_Database_Settings.Controls.Add(this.rb_Options_Database_Update_OnStartup); this.gb_Options_Database_Settings.Controls.Add(this.rb_Options_Database_Update_Never); this.gb_Options_Database_Settings.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.gb_Options_Database_Settings.Location = new System.Drawing.Point(15, 276); + this.gb_Options_Database_Settings.Location = new System.Drawing.Point(15, 315); this.gb_Options_Database_Settings.Name = "gb_Options_Database_Settings"; - this.gb_Options_Database_Settings.Size = new System.Drawing.Size(338, 110); + this.gb_Options_Database_Settings.Size = new System.Drawing.Size(348, 157); this.gb_Options_Database_Settings.TabIndex = 1; this.gb_Options_Database_Settings.TabStop = false; this.gb_Options_Database_Settings.Text = "Background Update and Pre-Calculation Settings"; @@ -3582,7 +3661,7 @@ this.cb_Options_Background_Calculations_Enable.CheckState = System.Windows.Forms.CheckState.Checked; this.cb_Options_Background_Calculations_Enable.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::AirScout.Properties.Settings.Default, "Background_Calculations_Enable", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.cb_Options_Background_Calculations_Enable.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cb_Options_Background_Calculations_Enable.Location = new System.Drawing.Point(5, 90); + this.cb_Options_Background_Calculations_Enable.Location = new System.Drawing.Point(22, 126); this.cb_Options_Background_Calculations_Enable.Name = "cb_Options_Background_Calculations_Enable"; this.cb_Options_Background_Calculations_Enable.Size = new System.Drawing.Size(308, 17); this.cb_Options_Background_Calculations_Enable.TabIndex = 6; @@ -3593,7 +3672,7 @@ // this.label47.AutoSize = true; this.label47.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label47.Location = new System.Drawing.Point(150, 66); + this.label47.Location = new System.Drawing.Point(165, 86); this.label47.Name = "label47"; this.label47.Size = new System.Drawing.Size(107, 13); this.label47.TabIndex = 5; @@ -3603,7 +3682,7 @@ // this.ud_Options_Database_Update_Period.DataBindings.Add(new System.Windows.Forms.Binding("Value", global::AirScout.Properties.Settings.Default, "Background_Update_Period", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.ud_Options_Database_Update_Period.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.ud_Options_Database_Update_Period.Location = new System.Drawing.Point(263, 68); + this.ud_Options_Database_Update_Period.Location = new System.Drawing.Point(278, 84); this.ud_Options_Database_Update_Period.Maximum = new decimal(new int[] { 6000, 0, @@ -3623,7 +3702,7 @@ // this.rb_Options_Database_Update_Periodically.AutoSize = true; this.rb_Options_Database_Update_Periodically.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.rb_Options_Database_Update_Periodically.Location = new System.Drawing.Point(7, 64); + this.rb_Options_Database_Update_Periodically.Location = new System.Drawing.Point(22, 84); this.rb_Options_Database_Update_Periodically.Name = "rb_Options_Database_Update_Periodically"; this.rb_Options_Database_Update_Periodically.Size = new System.Drawing.Size(78, 17); this.rb_Options_Database_Update_Periodically.TabIndex = 2; @@ -3636,7 +3715,7 @@ this.rb_Options_Database_Update_OnStartup.AutoSize = true; this.rb_Options_Database_Update_OnStartup.Checked = true; this.rb_Options_Database_Update_OnStartup.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.rb_Options_Database_Update_OnStartup.Location = new System.Drawing.Point(7, 41); + this.rb_Options_Database_Update_OnStartup.Location = new System.Drawing.Point(22, 61); this.rb_Options_Database_Update_OnStartup.Name = "rb_Options_Database_Update_OnStartup"; this.rb_Options_Database_Update_OnStartup.Size = new System.Drawing.Size(118, 17); this.rb_Options_Database_Update_OnStartup.TabIndex = 1; @@ -3649,7 +3728,7 @@ // this.rb_Options_Database_Update_Never.AutoSize = true; this.rb_Options_Database_Update_Never.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.rb_Options_Database_Update_Never.Location = new System.Drawing.Point(7, 18); + this.rb_Options_Database_Update_Never.Location = new System.Drawing.Point(22, 38); this.rb_Options_Database_Update_Never.Name = "rb_Options_Database_Update_Never"; this.rb_Options_Database_Update_Never.Size = new System.Drawing.Size(54, 17); this.rb_Options_Database_Update_Never.TabIndex = 0; @@ -3659,6 +3738,20 @@ // // gb_Options_Database_Info // + this.gb_Options_Database_Info.Controls.Add(this.lbl_Options_ScoutBase_Database_FileName); + this.gb_Options_Database_Info.Controls.Add(this.lbl_Options_AirScout_Database_FileName); + this.gb_Options_Database_Info.Controls.Add(this.lbl_Options_Propagation_GLOBE_Database_FileName); + this.gb_Options_Database_Info.Controls.Add(this.lbl_Options_Propagation_SRTM3_Database_FileName); + this.gb_Options_Database_Info.Controls.Add(this.lbl_Options_Propagation_SRTM1_Database_FileName); + this.gb_Options_Database_Info.Controls.Add(this.lbl_Options_Elevation_GLOBE_Database_FileName); + this.gb_Options_Database_Info.Controls.Add(this.lbl_Options_Elevation_SRTM3_Database_FileName); + this.gb_Options_Database_Info.Controls.Add(this.lbl_Options_Elevation_SRTM1_Database_FileName); + this.gb_Options_Database_Info.Controls.Add(this.lbl_Options_Map_Database_FileName); + this.gb_Options_Database_Info.Controls.Add(this.btn_Options_Map_Database_Maintenance); + this.gb_Options_Database_Info.Controls.Add(this.label38); + this.gb_Options_Database_Info.Controls.Add(this.tb_Options_Map_Database_FileSize); + this.gb_Options_Database_Info.Controls.Add(this.label140); + this.gb_Options_Database_Info.Controls.Add(this.label142); this.gb_Options_Database_Info.Controls.Add(this.btn_Options_Elevation_SRTM1_Database_Maintenance); this.gb_Options_Database_Info.Controls.Add(this.btn_Options_Elevation_SRTM3_Database_Maintenance); this.gb_Options_Database_Info.Controls.Add(this.btn_Options_Elevation_GLOBE_Database_Maintenance); @@ -3673,52 +3766,194 @@ this.gb_Options_Database_Info.Controls.Add(this.label136); this.gb_Options_Database_Info.Controls.Add(this.tb_Options_Propagation_SRTM1_Database_FileSize); this.gb_Options_Database_Info.Controls.Add(this.label137); - this.gb_Options_Database_Info.Controls.Add(this.tb_Options_Propagation_SRTM1_Database_FileName); this.gb_Options_Database_Info.Controls.Add(this.label138); this.gb_Options_Database_Info.Controls.Add(this.label46); this.gb_Options_Database_Info.Controls.Add(this.tb_Options_Propagation_SRTM3_Database_FileSize); this.gb_Options_Database_Info.Controls.Add(this.label134); - this.gb_Options_Database_Info.Controls.Add(this.tb_Options_Propagation_SRTM3_Database_FileName); this.gb_Options_Database_Info.Controls.Add(this.label135); this.gb_Options_Database_Info.Controls.Add(this.label132); this.gb_Options_Database_Info.Controls.Add(this.tb_Options_Propagation_GLOBE_Database_FileSize); this.gb_Options_Database_Info.Controls.Add(this.label133); - this.gb_Options_Database_Info.Controls.Add(this.tb_Options_Propagation_GLOBE_Database_FileName); this.gb_Options_Database_Info.Controls.Add(this.label109); this.gb_Options_Database_Info.Controls.Add(this.label118); this.gb_Options_Database_Info.Controls.Add(this.tb_Options_Elevation_SRTM1_Database_FileSize); this.gb_Options_Database_Info.Controls.Add(this.label119); - this.gb_Options_Database_Info.Controls.Add(this.tb_Options_Elevation_SRTM1_Database_FileName); this.gb_Options_Database_Info.Controls.Add(this.label120); this.gb_Options_Database_Info.Controls.Add(this.label115); this.gb_Options_Database_Info.Controls.Add(this.tb_Options_Elevation_SRTM3_Database_FileSize); this.gb_Options_Database_Info.Controls.Add(this.label116); - this.gb_Options_Database_Info.Controls.Add(this.tb_Options_Elevation_SRTM3_Database_FileName); this.gb_Options_Database_Info.Controls.Add(this.label117); this.gb_Options_Database_Info.Controls.Add(this.label16); this.gb_Options_Database_Info.Controls.Add(this.tb_Options_Elevation_GLOBE_Database_FileSize); this.gb_Options_Database_Info.Controls.Add(this.label113); - this.gb_Options_Database_Info.Controls.Add(this.tb_Options_Elevation_GLOBE_Database_FileName); this.gb_Options_Database_Info.Controls.Add(this.label114); this.gb_Options_Database_Info.Controls.Add(this.label104); this.gb_Options_Database_Info.Controls.Add(this.label101); this.gb_Options_Database_Info.Controls.Add(this.tb_Options_AirScout_Database_FileSize); this.gb_Options_Database_Info.Controls.Add(this.label102); - this.gb_Options_Database_Info.Controls.Add(this.tb_Options_AirScout_Database_FileName); this.gb_Options_Database_Info.Controls.Add(this.label103); this.gb_Options_Database_Info.Controls.Add(this.label73); this.gb_Options_Database_Info.Controls.Add(this.tb_Options_ScoutBase_Database_FileSize); this.gb_Options_Database_Info.Controls.Add(this.label50); - this.gb_Options_Database_Info.Controls.Add(this.tb_Options_ScoutBase_Database_FileName); this.gb_Options_Database_Info.Controls.Add(this.label49); this.gb_Options_Database_Info.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.gb_Options_Database_Info.Location = new System.Drawing.Point(15, 6); this.gb_Options_Database_Info.Name = "gb_Options_Database_Info"; - this.gb_Options_Database_Info.Size = new System.Drawing.Size(650, 264); + this.gb_Options_Database_Info.Size = new System.Drawing.Size(650, 303); this.gb_Options_Database_Info.TabIndex = 0; this.gb_Options_Database_Info.TabStop = false; this.gb_Options_Database_Info.Text = "Info"; // + // lbl_Options_ScoutBase_Database_FileName + // + this.lbl_Options_ScoutBase_Database_FileName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.lbl_Options_ScoutBase_Database_FileName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbl_Options_ScoutBase_Database_FileName.Location = new System.Drawing.Point(167, 32); + this.lbl_Options_ScoutBase_Database_FileName.Name = "lbl_Options_ScoutBase_Database_FileName"; + this.lbl_Options_ScoutBase_Database_FileName.Size = new System.Drawing.Size(180, 21); + this.lbl_Options_ScoutBase_Database_FileName.TabIndex = 66; + this.lbl_Options_ScoutBase_Database_FileName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.lbl_Options_ScoutBase_Database_FileName.Click += new System.EventHandler(this.lbl_Options_ScoutBase_Database_FileName_Click); + // + // lbl_Options_AirScout_Database_FileName + // + this.lbl_Options_AirScout_Database_FileName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.lbl_Options_AirScout_Database_FileName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbl_Options_AirScout_Database_FileName.Location = new System.Drawing.Point(168, 58); + this.lbl_Options_AirScout_Database_FileName.Name = "lbl_Options_AirScout_Database_FileName"; + this.lbl_Options_AirScout_Database_FileName.Size = new System.Drawing.Size(180, 21); + this.lbl_Options_AirScout_Database_FileName.TabIndex = 65; + this.lbl_Options_AirScout_Database_FileName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.lbl_Options_AirScout_Database_FileName.Click += new System.EventHandler(this.lbl_Options_AirScout_Database_FileName_Click); + // + // lbl_Options_Propagation_GLOBE_Database_FileName + // + this.lbl_Options_Propagation_GLOBE_Database_FileName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.lbl_Options_Propagation_GLOBE_Database_FileName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbl_Options_Propagation_GLOBE_Database_FileName.Location = new System.Drawing.Point(167, 84); + this.lbl_Options_Propagation_GLOBE_Database_FileName.Name = "lbl_Options_Propagation_GLOBE_Database_FileName"; + this.lbl_Options_Propagation_GLOBE_Database_FileName.Size = new System.Drawing.Size(180, 21); + this.lbl_Options_Propagation_GLOBE_Database_FileName.TabIndex = 64; + this.lbl_Options_Propagation_GLOBE_Database_FileName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.lbl_Options_Propagation_GLOBE_Database_FileName.Click += new System.EventHandler(this.lbl_Options_Propagation_GLOBE_Database_FileName_Click); + // + // lbl_Options_Propagation_SRTM3_Database_FileName + // + this.lbl_Options_Propagation_SRTM3_Database_FileName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.lbl_Options_Propagation_SRTM3_Database_FileName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbl_Options_Propagation_SRTM3_Database_FileName.Location = new System.Drawing.Point(168, 110); + this.lbl_Options_Propagation_SRTM3_Database_FileName.Name = "lbl_Options_Propagation_SRTM3_Database_FileName"; + this.lbl_Options_Propagation_SRTM3_Database_FileName.Size = new System.Drawing.Size(180, 21); + this.lbl_Options_Propagation_SRTM3_Database_FileName.TabIndex = 63; + this.lbl_Options_Propagation_SRTM3_Database_FileName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.lbl_Options_Propagation_SRTM3_Database_FileName.Click += new System.EventHandler(this.lbl_Options_Propagation_SRTM3_Database_FileName_Click); + // + // lbl_Options_Propagation_SRTM1_Database_FileName + // + this.lbl_Options_Propagation_SRTM1_Database_FileName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.lbl_Options_Propagation_SRTM1_Database_FileName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbl_Options_Propagation_SRTM1_Database_FileName.Location = new System.Drawing.Point(168, 136); + this.lbl_Options_Propagation_SRTM1_Database_FileName.Name = "lbl_Options_Propagation_SRTM1_Database_FileName"; + this.lbl_Options_Propagation_SRTM1_Database_FileName.Size = new System.Drawing.Size(180, 21); + this.lbl_Options_Propagation_SRTM1_Database_FileName.TabIndex = 62; + this.lbl_Options_Propagation_SRTM1_Database_FileName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.lbl_Options_Propagation_SRTM1_Database_FileName.Click += new System.EventHandler(this.lbl_Options_Propagation_SRTM1_Database_FileName_Click); + // + // lbl_Options_Elevation_GLOBE_Database_FileName + // + this.lbl_Options_Elevation_GLOBE_Database_FileName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.lbl_Options_Elevation_GLOBE_Database_FileName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbl_Options_Elevation_GLOBE_Database_FileName.Location = new System.Drawing.Point(168, 162); + this.lbl_Options_Elevation_GLOBE_Database_FileName.Name = "lbl_Options_Elevation_GLOBE_Database_FileName"; + this.lbl_Options_Elevation_GLOBE_Database_FileName.Size = new System.Drawing.Size(180, 21); + this.lbl_Options_Elevation_GLOBE_Database_FileName.TabIndex = 61; + this.lbl_Options_Elevation_GLOBE_Database_FileName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.lbl_Options_Elevation_GLOBE_Database_FileName.Click += new System.EventHandler(this.lbl_Options_Elevation_GLOBE_Database_FileName_Click); + // + // lbl_Options_Elevation_SRTM3_Database_FileName + // + this.lbl_Options_Elevation_SRTM3_Database_FileName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.lbl_Options_Elevation_SRTM3_Database_FileName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbl_Options_Elevation_SRTM3_Database_FileName.Location = new System.Drawing.Point(168, 188); + this.lbl_Options_Elevation_SRTM3_Database_FileName.Name = "lbl_Options_Elevation_SRTM3_Database_FileName"; + this.lbl_Options_Elevation_SRTM3_Database_FileName.Size = new System.Drawing.Size(180, 21); + this.lbl_Options_Elevation_SRTM3_Database_FileName.TabIndex = 60; + this.lbl_Options_Elevation_SRTM3_Database_FileName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.lbl_Options_Elevation_SRTM3_Database_FileName.Click += new System.EventHandler(this.lbl_Options_Elevation_SRTM3_Database_FileName_Click); + // + // lbl_Options_Elevation_SRTM1_Database_FileName + // + this.lbl_Options_Elevation_SRTM1_Database_FileName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.lbl_Options_Elevation_SRTM1_Database_FileName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbl_Options_Elevation_SRTM1_Database_FileName.Location = new System.Drawing.Point(168, 215); + this.lbl_Options_Elevation_SRTM1_Database_FileName.Name = "lbl_Options_Elevation_SRTM1_Database_FileName"; + this.lbl_Options_Elevation_SRTM1_Database_FileName.Size = new System.Drawing.Size(180, 21); + this.lbl_Options_Elevation_SRTM1_Database_FileName.TabIndex = 59; + this.lbl_Options_Elevation_SRTM1_Database_FileName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.lbl_Options_Elevation_SRTM1_Database_FileName.Click += new System.EventHandler(this.lbl_Options_Elevation_SRTM1_Database_FileName_Click); + // + // lbl_Options_Map_Database_FileName + // + this.lbl_Options_Map_Database_FileName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.lbl_Options_Map_Database_FileName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbl_Options_Map_Database_FileName.Location = new System.Drawing.Point(168, 241); + this.lbl_Options_Map_Database_FileName.Name = "lbl_Options_Map_Database_FileName"; + this.lbl_Options_Map_Database_FileName.Size = new System.Drawing.Size(180, 21); + this.lbl_Options_Map_Database_FileName.TabIndex = 58; + this.lbl_Options_Map_Database_FileName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.lbl_Options_Map_Database_FileName.Click += new System.EventHandler(this.lbl_Options_Map_Database_FileName_Click); + // + // btn_Options_Map_Database_Maintenance + // + this.btn_Options_Map_Database_Maintenance.Enabled = false; + this.btn_Options_Map_Database_Maintenance.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btn_Options_Map_Database_Maintenance.Location = new System.Drawing.Point(485, 239); + this.btn_Options_Map_Database_Maintenance.Name = "btn_Options_Map_Database_Maintenance"; + this.btn_Options_Map_Database_Maintenance.Size = new System.Drawing.Size(147, 23); + this.btn_Options_Map_Database_Maintenance.TabIndex = 57; + this.btn_Options_Map_Database_Maintenance.Text = "Database Maintenance"; + this.btn_Options_Map_Database_Maintenance.UseVisualStyleBackColor = true; + // + // label38 + // + this.label38.AutoSize = true; + this.label38.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label38.Location = new System.Drawing.Point(446, 244); + this.label38.Name = "label38"; + this.label38.Size = new System.Drawing.Size(23, 13); + this.label38.TabIndex = 56; + this.label38.Text = "MB"; + // + // tb_Options_Map_Database_FileSize + // + this.tb_Options_Map_Database_FileSize.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tb_Options_Map_Database_FileSize.Location = new System.Drawing.Point(390, 241); + this.tb_Options_Map_Database_FileSize.Name = "tb_Options_Map_Database_FileSize"; + this.tb_Options_Map_Database_FileSize.ReadOnly = true; + this.tb_Options_Map_Database_FileSize.Size = new System.Drawing.Size(50, 20); + this.tb_Options_Map_Database_FileSize.TabIndex = 55; + this.tb_Options_Map_Database_FileSize.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // + // label140 + // + this.label140.AutoSize = true; + this.label140.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label140.Location = new System.Drawing.Point(354, 244); + this.label140.Name = "label140"; + this.label140.Size = new System.Drawing.Size(30, 13); + this.label140.TabIndex = 54; + this.label140.Text = "Size:"; + // + // label142 + // + this.label142.AutoSize = true; + this.label142.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label142.Location = new System.Drawing.Point(6, 244); + this.label142.Name = "label142"; + this.label142.Size = new System.Drawing.Size(66, 13); + this.label142.TabIndex = 52; + this.label142.Text = "Map Data:"; + // // btn_Options_Elevation_SRTM1_Database_Maintenance // this.btn_Options_Elevation_SRTM1_Database_Maintenance.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); @@ -3811,7 +4046,7 @@ // this.label141.AutoSize = true; this.label141.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label141.Location = new System.Drawing.Point(446, 242); + this.label141.Location = new System.Drawing.Point(444, 277); this.label141.Name = "label141"; this.label141.Size = new System.Drawing.Size(25, 13); this.label141.TabIndex = 43; @@ -3821,7 +4056,7 @@ // this.lbl_Options_Database_TotalSize.AutoSize = true; this.lbl_Options_Database_TotalSize.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lbl_Options_Database_TotalSize.Location = new System.Drawing.Point(404, 242); + this.lbl_Options_Database_TotalSize.Location = new System.Drawing.Point(401, 277); this.lbl_Options_Database_TotalSize.Name = "lbl_Options_Database_TotalSize"; this.lbl_Options_Database_TotalSize.Size = new System.Drawing.Size(25, 13); this.lbl_Options_Database_TotalSize.TabIndex = 42; @@ -3831,7 +4066,7 @@ // this.label139.AutoSize = true; this.label139.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label139.Location = new System.Drawing.Point(348, 242); + this.label139.Location = new System.Drawing.Point(345, 277); this.label139.Name = "label139"; this.label139.Size = new System.Drawing.Size(36, 13); this.label139.TabIndex = 41; @@ -3867,15 +4102,6 @@ this.label137.TabIndex = 38; this.label137.Text = "Size:"; // - // tb_Options_Propagation_SRTM1_Database_FileName - // - this.tb_Options_Propagation_SRTM1_Database_FileName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tb_Options_Propagation_SRTM1_Database_FileName.Location = new System.Drawing.Point(168, 137); - this.tb_Options_Propagation_SRTM1_Database_FileName.Name = "tb_Options_Propagation_SRTM1_Database_FileName"; - this.tb_Options_Propagation_SRTM1_Database_FileName.ReadOnly = true; - this.tb_Options_Propagation_SRTM1_Database_FileName.Size = new System.Drawing.Size(180, 20); - this.tb_Options_Propagation_SRTM1_Database_FileName.TabIndex = 37; - // // label138 // this.label138.AutoSize = true; @@ -3916,15 +4142,6 @@ this.label134.TabIndex = 33; this.label134.Text = "Size:"; // - // tb_Options_Propagation_SRTM3_Database_FileName - // - this.tb_Options_Propagation_SRTM3_Database_FileName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tb_Options_Propagation_SRTM3_Database_FileName.Location = new System.Drawing.Point(168, 111); - this.tb_Options_Propagation_SRTM3_Database_FileName.Name = "tb_Options_Propagation_SRTM3_Database_FileName"; - this.tb_Options_Propagation_SRTM3_Database_FileName.ReadOnly = true; - this.tb_Options_Propagation_SRTM3_Database_FileName.Size = new System.Drawing.Size(180, 20); - this.tb_Options_Propagation_SRTM3_Database_FileName.TabIndex = 32; - // // label135 // this.label135.AutoSize = true; @@ -3965,15 +4182,6 @@ this.label133.TabIndex = 28; this.label133.Text = "Size:"; // - // tb_Options_Propagation_GLOBE_Database_FileName - // - this.tb_Options_Propagation_GLOBE_Database_FileName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tb_Options_Propagation_GLOBE_Database_FileName.Location = new System.Drawing.Point(168, 85); - this.tb_Options_Propagation_GLOBE_Database_FileName.Name = "tb_Options_Propagation_GLOBE_Database_FileName"; - this.tb_Options_Propagation_GLOBE_Database_FileName.ReadOnly = true; - this.tb_Options_Propagation_GLOBE_Database_FileName.Size = new System.Drawing.Size(180, 20); - this.tb_Options_Propagation_GLOBE_Database_FileName.TabIndex = 27; - // // label109 // this.label109.AutoSize = true; @@ -4014,15 +4222,6 @@ this.label119.TabIndex = 23; this.label119.Text = "Size:"; // - // tb_Options_Elevation_SRTM1_Database_FileName - // - this.tb_Options_Elevation_SRTM1_Database_FileName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tb_Options_Elevation_SRTM1_Database_FileName.Location = new System.Drawing.Point(168, 215); - this.tb_Options_Elevation_SRTM1_Database_FileName.Name = "tb_Options_Elevation_SRTM1_Database_FileName"; - this.tb_Options_Elevation_SRTM1_Database_FileName.ReadOnly = true; - this.tb_Options_Elevation_SRTM1_Database_FileName.Size = new System.Drawing.Size(180, 20); - this.tb_Options_Elevation_SRTM1_Database_FileName.TabIndex = 22; - // // label120 // this.label120.AutoSize = true; @@ -4063,15 +4262,6 @@ this.label116.TabIndex = 18; this.label116.Text = "Size:"; // - // tb_Options_Elevation_SRTM3_Database_FileName - // - this.tb_Options_Elevation_SRTM3_Database_FileName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tb_Options_Elevation_SRTM3_Database_FileName.Location = new System.Drawing.Point(168, 189); - this.tb_Options_Elevation_SRTM3_Database_FileName.Name = "tb_Options_Elevation_SRTM3_Database_FileName"; - this.tb_Options_Elevation_SRTM3_Database_FileName.ReadOnly = true; - this.tb_Options_Elevation_SRTM3_Database_FileName.Size = new System.Drawing.Size(180, 20); - this.tb_Options_Elevation_SRTM3_Database_FileName.TabIndex = 17; - // // label117 // this.label117.AutoSize = true; @@ -4112,15 +4302,6 @@ this.label113.TabIndex = 13; this.label113.Text = "Size:"; // - // tb_Options_Elevation_GLOBE_Database_FileName - // - this.tb_Options_Elevation_GLOBE_Database_FileName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tb_Options_Elevation_GLOBE_Database_FileName.Location = new System.Drawing.Point(168, 163); - this.tb_Options_Elevation_GLOBE_Database_FileName.Name = "tb_Options_Elevation_GLOBE_Database_FileName"; - this.tb_Options_Elevation_GLOBE_Database_FileName.ReadOnly = true; - this.tb_Options_Elevation_GLOBE_Database_FileName.Size = new System.Drawing.Size(180, 20); - this.tb_Options_Elevation_GLOBE_Database_FileName.TabIndex = 12; - // // label114 // this.label114.AutoSize = true; @@ -4171,15 +4352,6 @@ this.label102.TabIndex = 7; this.label102.Text = "Size:"; // - // tb_Options_AirScout_Database_FileName - // - this.tb_Options_AirScout_Database_FileName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tb_Options_AirScout_Database_FileName.Location = new System.Drawing.Point(168, 59); - this.tb_Options_AirScout_Database_FileName.Name = "tb_Options_AirScout_Database_FileName"; - this.tb_Options_AirScout_Database_FileName.ReadOnly = true; - this.tb_Options_AirScout_Database_FileName.Size = new System.Drawing.Size(180, 20); - this.tb_Options_AirScout_Database_FileName.TabIndex = 6; - // // label103 // this.label103.AutoSize = true; @@ -4220,15 +4392,6 @@ this.label50.TabIndex = 2; this.label50.Text = "Size:"; // - // tb_Options_ScoutBase_Database_FileName - // - this.tb_Options_ScoutBase_Database_FileName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tb_Options_ScoutBase_Database_FileName.Location = new System.Drawing.Point(168, 33); - this.tb_Options_ScoutBase_Database_FileName.Name = "tb_Options_ScoutBase_Database_FileName"; - this.tb_Options_ScoutBase_Database_FileName.ReadOnly = true; - this.tb_Options_ScoutBase_Database_FileName.Size = new System.Drawing.Size(180, 20); - this.tb_Options_ScoutBase_Database_FileName.TabIndex = 1; - // // label49 // this.label49.AutoSize = true; @@ -4245,9 +4408,9 @@ this.tab_Options_Alarm.Controls.Add(this.groupBox21); this.tab_Options_Alarm.Controls.Add(this.groupBox19); this.tab_Options_Alarm.Controls.Add(this.groupBox20); - this.tab_Options_Alarm.Location = new System.Drawing.Point(4, 22); + this.tab_Options_Alarm.Location = new System.Drawing.Point(4, 40); this.tab_Options_Alarm.Name = "tab_Options_Alarm"; - this.tab_Options_Alarm.Size = new System.Drawing.Size(671, 460); + this.tab_Options_Alarm.Size = new System.Drawing.Size(671, 480); this.tab_Options_Alarm.TabIndex = 11; this.tab_Options_Alarm.Text = "Alarm"; this.tab_Options_Alarm.Enter += new System.EventHandler(this.tab_Options_Alarm_Enter); @@ -4373,9 +4536,9 @@ this.tab_Options_Network.Controls.Add(this.groupBox32); this.tab_Options_Network.Controls.Add(this.groupBox31); this.tab_Options_Network.Controls.Add(this.groupBox24); - this.tab_Options_Network.Location = new System.Drawing.Point(4, 22); + this.tab_Options_Network.Location = new System.Drawing.Point(4, 40); this.tab_Options_Network.Name = "tab_Options_Network"; - this.tab_Options_Network.Size = new System.Drawing.Size(671, 460); + this.tab_Options_Network.Size = new System.Drawing.Size(671, 480); this.tab_Options_Network.TabIndex = 12; this.tab_Options_Network.Text = "Network"; this.tab_Options_Network.Enter += new System.EventHandler(this.tab_Options_Network_Enter); @@ -4528,9 +4691,9 @@ // this.tab_Options_SpecLab.BackColor = System.Drawing.SystemColors.Control; this.tab_Options_SpecLab.Controls.Add(this.groupBox3); - this.tab_Options_SpecLab.Location = new System.Drawing.Point(4, 22); + this.tab_Options_SpecLab.Location = new System.Drawing.Point(4, 40); this.tab_Options_SpecLab.Name = "tab_Options_SpecLab"; - this.tab_Options_SpecLab.Size = new System.Drawing.Size(671, 460); + this.tab_Options_SpecLab.Size = new System.Drawing.Size(671, 480); this.tab_Options_SpecLab.TabIndex = 13; this.tab_Options_SpecLab.Text = "Spectrum"; this.tab_Options_SpecLab.Enter += new System.EventHandler(this.tab_Options_SpecLab_Enter); @@ -4730,20 +4893,20 @@ this.cb_SpecLab_Enabled.Text = "Activate Connection"; this.cb_SpecLab_Enabled.UseVisualStyleBackColor = true; // - // tc_Track + // tab_Options_Track // - this.tc_Track.BackColor = System.Drawing.SystemColors.Control; - this.tc_Track.Controls.Add(this.groupBox36); - this.tc_Track.Controls.Add(this.groupBox35); - this.tc_Track.Controls.Add(this.groupBox34); - this.tc_Track.Controls.Add(this.groupBox33); - this.tc_Track.Controls.Add(this.groupBox28); - this.tc_Track.Location = new System.Drawing.Point(4, 22); - this.tc_Track.Name = "tc_Track"; - this.tc_Track.Size = new System.Drawing.Size(671, 460); - this.tc_Track.TabIndex = 14; - this.tc_Track.Text = "Track"; - this.tc_Track.Validating += new System.ComponentModel.CancelEventHandler(this.tc_Track_Validating); + this.tab_Options_Track.BackColor = System.Drawing.SystemColors.Control; + this.tab_Options_Track.Controls.Add(this.groupBox36); + this.tab_Options_Track.Controls.Add(this.groupBox35); + this.tab_Options_Track.Controls.Add(this.groupBox34); + this.tab_Options_Track.Controls.Add(this.groupBox33); + this.tab_Options_Track.Controls.Add(this.groupBox28); + this.tab_Options_Track.Location = new System.Drawing.Point(4, 40); + this.tab_Options_Track.Name = "tab_Options_Track"; + this.tab_Options_Track.Size = new System.Drawing.Size(671, 480); + this.tab_Options_Track.TabIndex = 14; + this.tab_Options_Track.Text = "Track"; + this.tab_Options_Track.Validating += new System.ComponentModel.CancelEventHandler(this.tc_Track_Validating); // // groupBox36 // @@ -5083,9 +5246,210 @@ this.cb_Options_Track_Activate.Text = "Activate Antenna Tracking"; this.cb_Options_Track_Activate.UseVisualStyleBackColor = true; // + // tab_Options_Watchlist + // + this.tab_Options_Watchlist.BackColor = System.Drawing.SystemColors.Control; + this.tab_Options_Watchlist.Controls.Add(this.groupBox50); + this.tab_Options_Watchlist.Controls.Add(this.btn_Options_Watchlist_Clear); + this.tab_Options_Watchlist.Controls.Add(this.groupBox17); + this.tab_Options_Watchlist.Controls.Add(this.btn_Options_Watchlist_Manage); + this.tab_Options_Watchlist.Location = new System.Drawing.Point(4, 40); + this.tab_Options_Watchlist.Name = "tab_Options_Watchlist"; + this.tab_Options_Watchlist.Padding = new System.Windows.Forms.Padding(3); + this.tab_Options_Watchlist.Size = new System.Drawing.Size(671, 480); + this.tab_Options_Watchlist.TabIndex = 16; + this.tab_Options_Watchlist.Text = "Watchlist"; + this.tab_Options_Watchlist.Enter += new System.EventHandler(this.tab_Options_Watchlist_Enter); + // + // groupBox50 + // + this.groupBox50.Controls.Add(this.pictureBox3); + this.groupBox50.Controls.Add(this.pictureBox2); + this.groupBox50.Controls.Add(this.label37); + this.groupBox50.Controls.Add(this.pictureBox1); + this.groupBox50.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.groupBox50.Location = new System.Drawing.Point(6, 6); + this.groupBox50.Name = "groupBox50"; + this.groupBox50.Size = new System.Drawing.Size(659, 381); + this.groupBox50.TabIndex = 9; + this.groupBox50.TabStop = false; + this.groupBox50.Text = "Info"; + // + // pictureBox3 + // + this.pictureBox3.Image = global::AirScout.Properties.Resources.AirScout_Watchlist; + this.pictureBox3.Location = new System.Drawing.Point(520, 19); + this.pictureBox3.Name = "pictureBox3"; + this.pictureBox3.Size = new System.Drawing.Size(113, 344); + this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox3.TabIndex = 3; + this.pictureBox3.TabStop = false; + // + // pictureBox2 + // + this.pictureBox2.Image = global::AirScout.Properties.Resources.AirScout_Marker; + this.pictureBox2.Location = new System.Drawing.Point(281, 36); + this.pictureBox2.Name = "pictureBox2"; + this.pictureBox2.Size = new System.Drawing.Size(210, 118); + this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox2.TabIndex = 2; + this.pictureBox2.TabStop = false; + // + // label37 + // + this.label37.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label37.Location = new System.Drawing.Point(3, 171); + this.label37.Name = "label37"; + this.label37.Size = new System.Drawing.Size(488, 202); + this.label37.TabIndex = 1; + this.label37.Text = resources.GetString("label37.Text"); + this.label37.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // pictureBox1 + // + this.pictureBox1.Image = global::AirScout.Properties.Resources.AirScout_Multi; + this.pictureBox1.InitialImage = global::AirScout.Properties.Resources.AirScout_Multi; + this.pictureBox1.Location = new System.Drawing.Point(6, 15); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(283, 153); + this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox1.TabIndex = 0; + this.pictureBox1.TabStop = false; + // + // btn_Options_Watchlist_Clear + // + this.btn_Options_Watchlist_Clear.Enabled = false; + this.btn_Options_Watchlist_Clear.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btn_Options_Watchlist_Clear.Location = new System.Drawing.Point(526, 434); + this.btn_Options_Watchlist_Clear.Name = "btn_Options_Watchlist_Clear"; + this.btn_Options_Watchlist_Clear.Size = new System.Drawing.Size(113, 23); + this.btn_Options_Watchlist_Clear.TabIndex = 8; + this.btn_Options_Watchlist_Clear.Text = "Clear Watchlist"; + this.btn_Options_Watchlist_Clear.UseVisualStyleBackColor = true; + this.btn_Options_Watchlist_Clear.Click += new System.EventHandler(this.btn_Options_Watchlist_Clear_Click); + // + // groupBox17 + // + this.groupBox17.Controls.Add(this.cb_Options_Watchlist_SyncWithKST); + this.groupBox17.Controls.Add(this.tb_Options_Watchlist_MaxCount); + this.groupBox17.Controls.Add(this.label31); + this.groupBox17.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.groupBox17.Location = new System.Drawing.Point(3, 393); + this.groupBox17.Name = "groupBox17"; + this.groupBox17.Size = new System.Drawing.Size(479, 75); + this.groupBox17.TabIndex = 1; + this.groupBox17.TabStop = false; + this.groupBox17.Text = "General"; + // + // cb_Options_Watchlist_SyncWithKST + // + this.cb_Options_Watchlist_SyncWithKST.AutoSize = true; + this.cb_Options_Watchlist_SyncWithKST.CheckAlign = System.Drawing.ContentAlignment.MiddleRight; + this.cb_Options_Watchlist_SyncWithKST.Checked = global::AirScout.Properties.Settings.Default.Watchlist_SyncWithKST; + this.cb_Options_Watchlist_SyncWithKST.CheckState = System.Windows.Forms.CheckState.Checked; + this.cb_Options_Watchlist_SyncWithKST.DataBindings.Add(new System.Windows.Forms.Binding("Enabled", global::AirScout.Properties.Settings.Default, "Server_Activate", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.cb_Options_Watchlist_SyncWithKST.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::AirScout.Properties.Settings.Default, "Watchlist_SyncWithKST", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.cb_Options_Watchlist_SyncWithKST.Enabled = global::AirScout.Properties.Settings.Default.Server_Activate; + this.cb_Options_Watchlist_SyncWithKST.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.cb_Options_Watchlist_SyncWithKST.Location = new System.Drawing.Point(6, 47); + this.cb_Options_Watchlist_SyncWithKST.Name = "cb_Options_Watchlist_SyncWithKST"; + this.cb_Options_Watchlist_SyncWithKST.Size = new System.Drawing.Size(436, 17); + this.cb_Options_Watchlist_SyncWithKST.TabIndex = 6; + this.cb_Options_Watchlist_SyncWithKST.Text = "Keep in sync with KST user list (needs wtKST > V3.1 and network functions activat" + + "ed):"; + this.cb_Options_Watchlist_SyncWithKST.UseVisualStyleBackColor = true; + this.cb_Options_Watchlist_SyncWithKST.CheckedChanged += new System.EventHandler(this.cb_Options_Watchlist_SyncWithKST_CheckedChanged); + // + // tb_Options_Watchlist_MaxCount + // + this.tb_Options_Watchlist_MaxCount.DataBindings.Add(new System.Windows.Forms.Binding("Value", global::AirScout.Properties.Settings.Default, "Watchlist_MaxCount", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.tb_Options_Watchlist_MaxCount.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tb_Options_Watchlist_MaxCount.FormatSpecifier = "F0"; + this.tb_Options_Watchlist_MaxCount.Location = new System.Drawing.Point(395, 20); + this.tb_Options_Watchlist_MaxCount.MaxValue = 1000; + this.tb_Options_Watchlist_MaxCount.MinValue = 1; + this.tb_Options_Watchlist_MaxCount.Name = "tb_Options_Watchlist_MaxCount"; + this.tb_Options_Watchlist_MaxCount.Size = new System.Drawing.Size(47, 22); + this.tb_Options_Watchlist_MaxCount.TabIndex = 5; + this.tb_Options_Watchlist_MaxCount.Text = "1000"; + this.tb_Options_Watchlist_MaxCount.Value = global::AirScout.Properties.Settings.Default.Watchlist_MaxCount; + // + // label31 + // + this.label31.AutoSize = true; + this.label31.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label31.Location = new System.Drawing.Point(6, 24); + this.label31.Name = "label31"; + this.label31.Size = new System.Drawing.Size(155, 13); + this.label31.TabIndex = 0; + this.label31.Text = "Number of entrys to keep in list:"; + // + // btn_Options_Watchlist_Manage + // + this.btn_Options_Watchlist_Manage.Enabled = false; + this.btn_Options_Watchlist_Manage.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btn_Options_Watchlist_Manage.Location = new System.Drawing.Point(526, 405); + this.btn_Options_Watchlist_Manage.Name = "btn_Options_Watchlist_Manage"; + this.btn_Options_Watchlist_Manage.Size = new System.Drawing.Size(113, 23); + this.btn_Options_Watchlist_Manage.TabIndex = 7; + this.btn_Options_Watchlist_Manage.Text = "Manage Watchlist"; + this.btn_Options_Watchlist_Manage.UseVisualStyleBackColor = true; + this.btn_Options_Watchlist_Manage.Click += new System.EventHandler(this.btn_Options_Watchlist_Manage_Click); + // + // tab_Options_Misc + // + this.tab_Options_Misc.BackColor = System.Drawing.SystemColors.Control; + this.tab_Options_Misc.Controls.Add(this.pb_Donate); + this.tab_Options_Misc.Controls.Add(this.pictureBox4); + this.tab_Options_Misc.Controls.Add(this.label143); + this.tab_Options_Misc.Controls.Add(this.groupBox15); + this.tab_Options_Misc.Location = new System.Drawing.Point(4, 40); + this.tab_Options_Misc.Name = "tab_Options_Misc"; + this.tab_Options_Misc.Size = new System.Drawing.Size(671, 480); + this.tab_Options_Misc.TabIndex = 17; + this.tab_Options_Misc.Text = "Misc."; + // + // pictureBox4 + // + this.pictureBox4.BackColor = System.Drawing.Color.White; + this.pictureBox4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.pictureBox4.Image = global::AirScout.Properties.Resources.Settings; + this.pictureBox4.Location = new System.Drawing.Point(343, 108); + this.pictureBox4.Name = "pictureBox4"; + this.pictureBox4.Size = new System.Drawing.Size(306, 277); + this.pictureBox4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox4.TabIndex = 5; + this.pictureBox4.TabStop = false; + // + // label143 + // + this.label143.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label143.Location = new System.Drawing.Point(14, 14); + this.label143.Name = "label143"; + this.label143.Size = new System.Drawing.Size(635, 78); + this.label143.TabIndex = 4; + this.label143.Text = "You can change various settings here or do miscellaneous actions here.\r\nMost of t" + + "hem were not directly related to one of the Options categories."; + this.label143.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // groupBox15 + // + this.groupBox15.Controls.Add(this.btn_Options_Open_AirScoutDirectory); + this.groupBox15.Controls.Add(this.btn_Options_Open_PluginDirectory); + this.groupBox15.Controls.Add(this.btn_Options_Open_TmpDirectory); + this.groupBox15.Controls.Add(this.btn_Options_Open_LogDirectory); + this.groupBox15.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.groupBox15.Location = new System.Drawing.Point(18, 108); + this.groupBox15.Name = "groupBox15"; + this.groupBox15.Size = new System.Drawing.Size(306, 158); + this.groupBox15.TabIndex = 3; + this.groupBox15.TabStop = false; + this.groupBox15.Text = "Open Directories"; + // // tab_Options_Info // this.tab_Options_Info.BackColor = System.Drawing.SystemColors.Control; + this.tab_Options_Info.Controls.Add(this.label105); this.tab_Options_Info.Controls.Add(this.label30); this.tab_Options_Info.Controls.Add(this.label45); this.tab_Options_Info.Controls.Add(this.lbl_Options_Elevation_SRTM1); @@ -5104,10 +5468,9 @@ this.tab_Options_Info.Controls.Add(this.label20); this.tab_Options_Info.Controls.Add(this.label19); this.tab_Options_Info.Controls.Add(this.btn_Options_License); - this.tab_Options_Info.Controls.Add(this.pb_Donate); - this.tab_Options_Info.Location = new System.Drawing.Point(4, 22); + this.tab_Options_Info.Location = new System.Drawing.Point(4, 40); this.tab_Options_Info.Name = "tab_Options_Info"; - this.tab_Options_Info.Size = new System.Drawing.Size(671, 460); + this.tab_Options_Info.Size = new System.Drawing.Size(671, 480); this.tab_Options_Info.TabIndex = 5; this.tab_Options_Info.Text = "Info"; this.tab_Options_Info.Enter += new System.EventHandler(this.tab_Options_Info_Enter); @@ -5116,7 +5479,7 @@ // this.label30.AutoSize = true; this.label30.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label30.Location = new System.Drawing.Point(187, 284); + this.label30.Location = new System.Drawing.Point(181, 349); this.label30.Name = "label30"; this.label30.Size = new System.Drawing.Size(230, 13); this.label30.TabIndex = 43; @@ -5126,7 +5489,7 @@ // this.label45.AutoSize = true; this.label45.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label45.Location = new System.Drawing.Point(139, 268); + this.label45.Location = new System.Drawing.Point(133, 333); this.label45.Name = "label45"; this.label45.Size = new System.Drawing.Size(356, 13); this.label45.TabIndex = 42; @@ -5135,10 +5498,10 @@ // lbl_Options_Elevation_SRTM1 // this.lbl_Options_Elevation_SRTM1.AutoSize = true; - this.lbl_Options_Elevation_SRTM1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lbl_Options_Elevation_SRTM1.Location = new System.Drawing.Point(124, 250); + this.lbl_Options_Elevation_SRTM1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbl_Options_Elevation_SRTM1.Location = new System.Drawing.Point(89, 314); this.lbl_Options_Elevation_SRTM1.Name = "lbl_Options_Elevation_SRTM1"; - this.lbl_Options_Elevation_SRTM1.Size = new System.Drawing.Size(446, 15); + this.lbl_Options_Elevation_SRTM1.Size = new System.Drawing.Size(478, 16); this.lbl_Options_Elevation_SRTM1.TabIndex = 41; this.lbl_Options_Elevation_SRTM1.TabStop = true; this.lbl_Options_Elevation_SRTM1.Text = "1arsec (30m x 30m) Elevation Data from SRTM - Project and ASTER"; @@ -5147,7 +5510,7 @@ // this.label17.AutoSize = true; this.label17.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label17.Location = new System.Drawing.Point(155, 235); + this.label17.Location = new System.Drawing.Point(137, 269); this.label17.Name = "label17"; this.label17.Size = new System.Drawing.Size(356, 13); this.label17.TabIndex = 40; @@ -5157,18 +5520,18 @@ // this.lbl_Options_Elevation_SRTM3.AutoSize = true; this.lbl_Options_Elevation_SRTM3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lbl_Options_Elevation_SRTM3.Location = new System.Drawing.Point(140, 215); + this.lbl_Options_Elevation_SRTM3.Location = new System.Drawing.Point(89, 250); this.lbl_Options_Elevation_SRTM3.Name = "lbl_Options_Elevation_SRTM3"; - this.lbl_Options_Elevation_SRTM3.Size = new System.Drawing.Size(393, 16); + this.lbl_Options_Elevation_SRTM3.Size = new System.Drawing.Size(478, 16); this.lbl_Options_Elevation_SRTM3.TabIndex = 39; this.lbl_Options_Elevation_SRTM3.TabStop = true; - this.lbl_Options_Elevation_SRTM3.Text = "3arsec (90m x 90m) Elevation Data from SRTM - Project"; + this.lbl_Options_Elevation_SRTM3.Text = "3arsec (90m x 90m) Elevation Data from SRTM - Project and ASTER"; // // lbl_Options_Elevation_GLOBE // this.lbl_Options_Elevation_GLOBE.AutoSize = true; this.lbl_Options_Elevation_GLOBE.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lbl_Options_Elevation_GLOBE.Location = new System.Drawing.Point(165, 192); + this.lbl_Options_Elevation_GLOBE.Location = new System.Drawing.Point(164, 211); this.lbl_Options_Elevation_GLOBE.Name = "lbl_Options_Elevation_GLOBE"; this.lbl_Options_Elevation_GLOBE.Size = new System.Drawing.Size(340, 16); this.lbl_Options_Elevation_GLOBE.TabIndex = 38; @@ -5178,7 +5541,7 @@ // lbl_Options_Spherical // this.lbl_Options_Spherical.AutoSize = true; - this.lbl_Options_Spherical.Location = new System.Drawing.Point(241, 146); + this.lbl_Options_Spherical.Location = new System.Drawing.Point(241, 162); this.lbl_Options_Spherical.Name = "lbl_Options_Spherical"; this.lbl_Options_Spherical.Size = new System.Drawing.Size(251, 13); this.lbl_Options_Spherical.TabIndex = 35; @@ -5189,7 +5552,7 @@ // this.label51.AutoSize = true; this.label51.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label51.Location = new System.Drawing.Point(165, 146); + this.label51.Location = new System.Drawing.Point(165, 162); this.label51.Name = "label51"; this.label51.Size = new System.Drawing.Size(54, 13); this.label51.TabIndex = 34; @@ -5198,17 +5561,17 @@ // label25 // this.label25.AutoSize = true; - this.label25.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label25.Location = new System.Drawing.Point(121, 309); + this.label25.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label25.Location = new System.Drawing.Point(105, 391); this.label25.Name = "label25"; - this.label25.Size = new System.Drawing.Size(412, 13); + this.label25.Size = new System.Drawing.Size(495, 16); this.label25.TabIndex = 33; this.label25.Text = "special tnx to DF9IC and DL8AAU for extensive discussions and testing"; // // lbl_Options_Map // this.lbl_Options_Map.AutoSize = true; - this.lbl_Options_Map.Location = new System.Drawing.Point(238, 165); + this.lbl_Options_Map.Location = new System.Drawing.Point(238, 181); this.lbl_Options_Map.Name = "lbl_Options_Map"; this.lbl_Options_Map.Size = new System.Drawing.Size(228, 13); this.lbl_Options_Map.TabIndex = 32; @@ -5219,7 +5582,7 @@ // this.label27.AutoSize = true; this.label27.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label27.Location = new System.Drawing.Point(165, 165); + this.label27.Location = new System.Drawing.Point(165, 181); this.label27.Name = "label27"; this.label27.Size = new System.Drawing.Size(66, 13); this.label27.TabIndex = 31; @@ -5229,7 +5592,7 @@ // this.label26.AutoSize = true; this.label26.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label26.Location = new System.Drawing.Point(168, 129); + this.label26.Location = new System.Drawing.Point(168, 145); this.label26.Name = "label26"; this.label26.Size = new System.Drawing.Size(31, 13); this.label26.TabIndex = 30; @@ -5238,7 +5601,7 @@ // label24 // this.label24.AutoSize = true; - this.label24.Location = new System.Drawing.Point(243, 129); + this.label24.Location = new System.Drawing.Point(243, 145); this.label24.Name = "label24"; this.label24.Size = new System.Drawing.Size(46, 13); this.label24.TabIndex = 29; @@ -5248,7 +5611,7 @@ // this.label23.AutoSize = true; this.label23.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Italic | System.Drawing.FontStyle.Underline))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label23.Location = new System.Drawing.Point(180, 95); + this.label23.Location = new System.Drawing.Point(180, 109); this.label23.Name = "label23"; this.label23.Size = new System.Drawing.Size(291, 20); this.label23.TabIndex = 28; @@ -5258,7 +5621,7 @@ // this.lbl_Options_Version.AutoSize = true; this.lbl_Options_Version.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lbl_Options_Version.Location = new System.Drawing.Point(270, 70); + this.lbl_Options_Version.Location = new System.Drawing.Point(270, 79); this.lbl_Options_Version.Name = "lbl_Options_Version"; this.lbl_Options_Version.Size = new System.Drawing.Size(111, 20); this.lbl_Options_Version.TabIndex = 27; @@ -5268,11 +5631,11 @@ // this.label20.AutoSize = true; this.label20.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label20.Location = new System.Drawing.Point(180, 45); + this.label20.Location = new System.Drawing.Point(164, 51); this.label20.Name = "label20"; - this.label20.Size = new System.Drawing.Size(312, 20); + this.label20.Size = new System.Drawing.Size(361, 20); this.label20.TabIndex = 26; - this.label20.Text = "Aircraft scatter prediction (c) 2014 DL2ALF"; + this.label20.Text = "Aircraft scatter prediction (c) 2014 - 2020 DL2ALF"; // // label19 // @@ -5286,10 +5649,10 @@ // // btn_Options_License // - this.btn_Options_License.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btn_Options_License.Location = new System.Drawing.Point(3, 334); + this.btn_Options_License.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btn_Options_License.Location = new System.Drawing.Point(15, 419); this.btn_Options_License.Name = "btn_Options_License"; - this.btn_Options_License.Size = new System.Drawing.Size(645, 26); + this.btn_Options_License.Size = new System.Drawing.Size(640, 53); this.btn_Options_License.TabIndex = 14; this.btn_Options_License.Text = "Click here to see the complete license information."; this.btn_Options_License.UseVisualStyleBackColor = true; @@ -5308,7 +5671,7 @@ this.ss_Options.ImageScalingSize = new System.Drawing.Size(20, 20); this.ss_Options.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.tsl_Options_Status}); - this.ss_Options.Location = new System.Drawing.Point(0, 515); + this.ss_Options.Location = new System.Drawing.Point(0, 539); this.ss_Options.Name = "ss_Options"; this.ss_Options.Padding = new System.Windows.Forms.Padding(1, 0, 10, 0); this.ss_Options.Size = new System.Drawing.Size(784, 22); @@ -5345,47 +5708,28 @@ this.bw_StationDataUpdater.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.bw_StationDataUpdater_ProgressChanged); this.bw_StationDataUpdater.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.bw_StationDataUpdater_RunWorkerCompleted); // - // groupBox37 + // pb_Donate // - this.groupBox37.Controls.Add(this.label34); - this.groupBox37.Controls.Add(this.ud_Options_Charts_FontSize); - this.groupBox37.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.groupBox37.Location = new System.Drawing.Point(415, 227); - this.groupBox37.Name = "groupBox37"; - this.groupBox37.Size = new System.Drawing.Size(242, 68); - this.groupBox37.TabIndex = 9; - this.groupBox37.TabStop = false; - this.groupBox37.Text = "Chart Window Options"; + this.pb_Donate.Image = ((System.Drawing.Image)(resources.GetObject("pb_Donate.Image"))); + this.pb_Donate.InitialImage = ((System.Drawing.Image)(resources.GetObject("pb_Donate.InitialImage"))); + this.pb_Donate.Location = new System.Drawing.Point(18, 272); + this.pb_Donate.Name = "pb_Donate"; + this.pb_Donate.Size = new System.Drawing.Size(306, 113); + this.pb_Donate.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pb_Donate.TabIndex = 38; + this.pb_Donate.TabStop = false; + this.tt_Options.SetToolTip(this.pb_Donate, "Click here to open a browser window with link."); + this.pb_Donate.Click += new System.EventHandler(this.pb_Donate_Click); // - // ud_Options_Charts_FontSize + // label105 // - this.ud_Options_Charts_FontSize.DataBindings.Add(new System.Windows.Forms.Binding("Value", global::AirScout.Properties.Settings.Default, "Charts_FontSize", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); - this.ud_Options_Charts_FontSize.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.ud_Options_Charts_FontSize.Location = new System.Drawing.Point(184, 39); - this.ud_Options_Charts_FontSize.Maximum = new decimal(new int[] { - 16, - 0, - 0, - 0}); - this.ud_Options_Charts_FontSize.Minimum = new decimal(new int[] { - 6, - 0, - 0, - 0}); - this.ud_Options_Charts_FontSize.Name = "ud_Options_Charts_FontSize"; - this.ud_Options_Charts_FontSize.Size = new System.Drawing.Size(45, 22); - this.ud_Options_Charts_FontSize.TabIndex = 0; - this.ud_Options_Charts_FontSize.Value = global::AirScout.Properties.Settings.Default.Charts_FontSize; - // - // label34 - // - this.label34.AutoSize = true; - this.label34.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label34.Location = new System.Drawing.Point(7, 41); - this.label34.Name = "label34"; - this.label34.Size = new System.Drawing.Size(174, 13); - this.label34.TabIndex = 2; - this.label34.Text = "Font Size for Axes in Diagrams etc.:"; + this.label105.AutoSize = true; + this.label105.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label105.Location = new System.Drawing.Point(181, 282); + this.label105.Name = "label105"; + this.label105.Size = new System.Drawing.Size(230, 13); + this.label105.TabIndex = 44; + this.label105.Text = "ASTER GDEM is a product of METI and NASA"; // // OptionsDlg // @@ -5394,7 +5738,7 @@ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.CancelButton = this.btn_Options_Cancel; - this.ClientSize = new System.Drawing.Size(784, 537); + this.ClientSize = new System.Drawing.Size(784, 561); this.Controls.Add(this.ss_Options); this.Controls.Add(this.tc_Options); this.Controls.Add(this.btn_Options_Cancel); @@ -5404,7 +5748,6 @@ this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.OptionsDlg_FormClosing); this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.OptionsDlg_FormClosed); this.Load += new System.EventHandler(this.OptionsDlg_Load); - ((System.ComponentModel.ISupportInitialize)(this.pb_Donate)).EndInit(); this.tab_Options_Planes.ResumeLayout(false); this.groupBox48.ResumeLayout(false); this.groupBox48.PerformLayout(); @@ -5440,10 +5783,16 @@ this.groupBox10.ResumeLayout(false); this.groupBox10.PerformLayout(); this.tab_Options_Map.ResumeLayout(false); + this.groupBox49.ResumeLayout(false); + this.groupBox49.PerformLayout(); + this.groupBox37.ResumeLayout(false); + this.groupBox37.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.ud_Options_Charts_FontSize)).EndInit(); this.groupBox39.ResumeLayout(false); this.groupBox39.PerformLayout(); this.groupBox23.ResumeLayout(false); this.groupBox23.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.ud_Options_Map_Preloader_MaxZoom)).EndInit(); this.groupBox30.ResumeLayout(false); this.groupBox30.PerformLayout(); this.groupBox7.ResumeLayout(false); @@ -5473,14 +5822,11 @@ this.tab_Options_General.ResumeLayout(false); this.groupBox25.ResumeLayout(false); this.groupBox25.PerformLayout(); - this.groupBox17.ResumeLayout(false); - this.groupBox17.PerformLayout(); this.tc_Options.ResumeLayout(false); this.tab_Options_Database.ResumeLayout(false); this.groupBox47.ResumeLayout(false); this.groupBox27.ResumeLayout(false); this.groupBox27.PerformLayout(); - this.groupBox15.ResumeLayout(false); this.gb_Options_Database_Settings.ResumeLayout(false); this.gb_Options_Database_Settings.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.ud_Options_Database_Update_Period)).EndInit(); @@ -5503,7 +5849,7 @@ this.tab_Options_SpecLab.ResumeLayout(false); this.groupBox3.ResumeLayout(false); this.groupBox3.PerformLayout(); - this.tc_Track.ResumeLayout(false); + this.tab_Options_Track.ResumeLayout(false); this.groupBox36.ResumeLayout(false); this.groupBox36.PerformLayout(); this.groupBox35.ResumeLayout(false); @@ -5514,13 +5860,21 @@ this.groupBox33.PerformLayout(); this.groupBox28.ResumeLayout(false); this.groupBox28.PerformLayout(); + this.tab_Options_Watchlist.ResumeLayout(false); + this.groupBox50.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.groupBox17.ResumeLayout(false); + this.groupBox17.PerformLayout(); + this.tab_Options_Misc.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit(); + this.groupBox15.ResumeLayout(false); this.tab_Options_Info.ResumeLayout(false); this.tab_Options_Info.PerformLayout(); this.ss_Options.ResumeLayout(false); this.ss_Options.PerformLayout(); - this.groupBox37.ResumeLayout(false); - this.groupBox37.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.ud_Options_Charts_FontSize)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pb_Donate)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -5530,7 +5884,7 @@ private System.Windows.Forms.Button btn_Options_OK; private System.Windows.Forms.Button btn_Options_Cancel; - private System.Windows.Forms.ToolTip toolTip1; + private System.Windows.Forms.ToolTip tt_Options; private System.Windows.Forms.TabPage tab_Options_Planes; private System.Windows.Forms.GroupBox groupBox6; private System.Windows.Forms.TabPage tab_Options_Path; @@ -5572,9 +5926,6 @@ private System.Windows.Forms.CheckBox cb_Options_Elevation_SRTM1; private System.Windows.Forms.GroupBox groupBox16; private System.Windows.Forms.Label label52; - private System.Windows.Forms.GroupBox groupBox17; - private System.Windows.Forms.Button btn_Options_Watchlist_Manage; - private System.Windows.Forms.Label label31; private System.Windows.Forms.TabPage tab_Options_Alarm; private System.Windows.Forms.GroupBox groupBox19; private System.Windows.Forms.GroupBox groupBox20; @@ -5640,7 +5991,7 @@ private System.Windows.Forms.Label label75; private System.Windows.Forms.Label label74; private System.Windows.Forms.GroupBox groupBox29; - private System.Windows.Forms.TabPage tc_Track; + private System.Windows.Forms.TabPage tab_Options_Track; private System.Windows.Forms.GroupBox groupBox28; private System.Windows.Forms.CheckBox cb_Options_Track_Activate; private System.Windows.Forms.ComboBox cb_Options_PlaneFeed1; @@ -5695,7 +6046,6 @@ private System.Windows.Forms.Label lbl_Options_Version; private System.Windows.Forms.Label label20; private System.Windows.Forms.Label label19; - private System.Windows.Forms.PictureBox pb_Donate; private System.Windows.Forms.GroupBox groupBox38; private System.Windows.Forms.Label label9; private System.Windows.Forms.Label label8; @@ -5749,10 +6099,6 @@ private ScoutBase.Core.LocatorTextBox tb_Options_DXLoc; private ScoutBase.Core.CallsignTextBox tb_Options_DXCall; private System.Windows.Forms.CheckBox cb_Options_SmallLettersForSubSquares; - private System.Windows.Forms.GroupBox groupBox15; - private System.Windows.Forms.Button btn_Open_LogDirectory; - private System.Windows.Forms.Button btn_Open_TmpDirectory; - private ScoutBase.Core.Int32TextBox tb_Options_Watchlist_MaxCount; private ScoutBase.Core.Int32TextBox tb_Options_Planes_IconSize_S; private ScoutBase.Core.Int32TextBox tb_Options_Planes_IconSize_H; private ScoutBase.Core.Int32TextBox tb_Options_Planes_IconSize_M; @@ -5776,16 +6122,12 @@ private System.Windows.Forms.Label label73; private System.Windows.Forms.TextBox tb_Options_ScoutBase_Database_FileSize; private System.Windows.Forms.Label label50; - private System.Windows.Forms.TextBox tb_Options_ScoutBase_Database_FileName; private System.Windows.Forms.Label label49; private System.Windows.Forms.Label label101; private System.Windows.Forms.TextBox tb_Options_AirScout_Database_FileSize; private System.Windows.Forms.Label label102; - private System.Windows.Forms.TextBox tb_Options_AirScout_Database_FileName; private System.Windows.Forms.Label label103; private System.Windows.Forms.Label label104; - private System.Windows.Forms.Label label105; - private System.Windows.Forms.CheckBox cb_Options_Watchlist_SyncWithKST; private System.Windows.Forms.CheckBox cb_Options_Watchlist_Activate; private ScoutBase.Core.DoubleTextBox tb_Coverage_MaxLat; private ScoutBase.Core.DoubleTextBox tb_Coverage_MinLat; @@ -5823,17 +6165,14 @@ private System.Windows.Forms.Label label118; private System.Windows.Forms.TextBox tb_Options_Elevation_SRTM1_Database_FileSize; private System.Windows.Forms.Label label119; - private System.Windows.Forms.TextBox tb_Options_Elevation_SRTM1_Database_FileName; private System.Windows.Forms.Label label120; private System.Windows.Forms.Label label115; private System.Windows.Forms.TextBox tb_Options_Elevation_SRTM3_Database_FileSize; private System.Windows.Forms.Label label116; - private System.Windows.Forms.TextBox tb_Options_Elevation_SRTM3_Database_FileName; private System.Windows.Forms.Label label117; private System.Windows.Forms.Label label16; private System.Windows.Forms.TextBox tb_Options_Elevation_GLOBE_Database_FileSize; private System.Windows.Forms.Label label113; - private System.Windows.Forms.TextBox tb_Options_Elevation_GLOBE_Database_FileName; private System.Windows.Forms.Label label114; private System.Windows.Forms.GroupBox groupBox44; private System.Windows.Forms.GroupBox groupBox45; @@ -5885,7 +6224,6 @@ private System.Windows.Forms.Label label132; private System.Windows.Forms.TextBox tb_Options_Propagation_GLOBE_Database_FileSize; private System.Windows.Forms.Label label133; - private System.Windows.Forms.TextBox tb_Options_Propagation_GLOBE_Database_FileName; private System.Windows.Forms.Label label109; private System.Windows.Forms.Label label141; private System.Windows.Forms.Label lbl_Options_Database_TotalSize; @@ -5893,12 +6231,10 @@ private System.Windows.Forms.Label label136; private System.Windows.Forms.TextBox tb_Options_Propagation_SRTM1_Database_FileSize; private System.Windows.Forms.Label label137; - private System.Windows.Forms.TextBox tb_Options_Propagation_SRTM1_Database_FileName; private System.Windows.Forms.Label label138; private System.Windows.Forms.Label label46; private System.Windows.Forms.TextBox tb_Options_Propagation_SRTM3_Database_FileSize; private System.Windows.Forms.Label label134; - private System.Windows.Forms.TextBox tb_Options_Propagation_SRTM3_Database_FileName; private System.Windows.Forms.Label label135; private System.Windows.Forms.Button btn_Options_Elevation_SRTM1_Database_Maintenance; private System.Windows.Forms.Button btn_Options_Elevation_SRTM3_Database_Maintenance; @@ -5923,5 +6259,47 @@ private System.Windows.Forms.GroupBox groupBox37; private System.Windows.Forms.Label label34; private System.Windows.Forms.NumericUpDown ud_Options_Charts_FontSize; + private System.Windows.Forms.CheckBox cb_Options_Locations_RestrictToAreaOfInterest; + private System.Windows.Forms.CheckBox cb_Options_Map_Preloader_Enabled; + private System.Windows.Forms.TabPage tab_Options_Watchlist; + private System.Windows.Forms.TabPage tab_Options_Misc; + private System.Windows.Forms.GroupBox groupBox17; + private System.Windows.Forms.CheckBox cb_Options_Watchlist_SyncWithKST; + private ScoutBase.Core.Int32TextBox tb_Options_Watchlist_MaxCount; + private System.Windows.Forms.Button btn_Options_Watchlist_Manage; + private System.Windows.Forms.Label label31; + private System.Windows.Forms.Button btn_Options_Watchlist_Clear; + private System.Windows.Forms.GroupBox groupBox49; + private System.Windows.Forms.GroupBox groupBox50; + private System.Windows.Forms.PictureBox pictureBox1; + private System.Windows.Forms.Label label37; + private System.Windows.Forms.PictureBox pictureBox3; + private System.Windows.Forms.PictureBox pictureBox2; + private System.Windows.Forms.GroupBox groupBox15; + private System.Windows.Forms.Button btn_Options_Open_TmpDirectory; + private System.Windows.Forms.Button btn_Options_Open_LogDirectory; + private System.Windows.Forms.Button btn_Options_Map_Database_Maintenance; + private System.Windows.Forms.Label label38; + private System.Windows.Forms.TextBox tb_Options_Map_Database_FileSize; + private System.Windows.Forms.Label label140; + private System.Windows.Forms.Label label142; + private System.Windows.Forms.Button btn_DeleteAllMapTiles; + private System.Windows.Forms.Label lbl_Options_Map_Database_FileName; + private System.Windows.Forms.Label lbl_Options_Elevation_SRTM1_Database_FileName; + private System.Windows.Forms.Label lbl_Options_Elevation_SRTM3_Database_FileName; + private System.Windows.Forms.Label lbl_Options_ScoutBase_Database_FileName; + private System.Windows.Forms.Label lbl_Options_AirScout_Database_FileName; + private System.Windows.Forms.Label lbl_Options_Propagation_GLOBE_Database_FileName; + private System.Windows.Forms.Label lbl_Options_Propagation_SRTM3_Database_FileName; + private System.Windows.Forms.Label lbl_Options_Propagation_SRTM1_Database_FileName; + private System.Windows.Forms.Label lbl_Options_Elevation_GLOBE_Database_FileName; + private System.Windows.Forms.Label label143; + private System.Windows.Forms.Label label144; + private System.Windows.Forms.NumericUpDown ud_Options_Map_Preloader_MaxZoom; + private System.Windows.Forms.Button btn_Options_Open_PluginDirectory; + private System.Windows.Forms.PictureBox pictureBox4; + private System.Windows.Forms.Button btn_Options_Open_AirScoutDirectory; + private System.Windows.Forms.PictureBox pb_Donate; + private System.Windows.Forms.Label label105; } } \ No newline at end of file diff --git a/AirScout/OptionsDlg.cs b/AirScout/OptionsDlg.cs index f877a2f..0d5b8f0 100644 --- a/AirScout/OptionsDlg.cs +++ b/AirScout/OptionsDlg.cs @@ -26,6 +26,7 @@ using ScoutBase.Core; using ScoutBase.Stations; using ScoutBase.Elevation; using ScoutBase.Propagation; +using ScoutBase.Maps; using ScoutBase; using Newtonsoft.Json; using static ScoutBase.Core.ZIP; @@ -233,46 +234,6 @@ namespace AirScout gm_Options_Coverage.SetZoomToFitRect(RectLatLng.FromLTRB(tb_Coverage_MinLon.Value - 1, tb_Coverage_MaxLat.Value + 1, tb_Coverage_MaxLon.Value + 1, tb_Coverage_MinLat.Value - 1)); } - private void btn_Options_Watchlist_Manage_Click(object sender, EventArgs e) - { - // sync watchlist, try to keep previously checked calls - // you can have a call only once in the watch list - List checkedcalls = new List(); - foreach (WatchlistItem item in Properties.Settings.Default.Watchlist) - { - if (item.Checked) - checkedcalls.Add(item.Call); - } - WatchlistDlg Dlg = new WatchlistDlg(); - if (Dlg.ShowDialog() == DialogResult.OK) - { - // clear watch list - Properties.Settings.Default.Watchlist.Clear(); - foreach (DataGridViewRow row in Dlg.dgv_Watchlist_Selected.Rows) - { - string call = row.Cells[0].Value.ToString(); - string loc = row.Cells[1].Value.ToString(); - bool oor = true; - // try to get the location from database - LocationDesignator dxloc = StationData.Database.LocationFind(call, loc); - if (dxloc != null) - { - oor = LatLon.Distance(Properties.Settings.Default.MyLat, Properties.Settings.Default.MyLon, dxloc.Lat, dxloc.Lon) > Properties.Settings.Default.Path_MaxLength; - } - // add call to watch list - WatchlistItem item = new WatchlistItem(call, loc, oor); - Properties.Settings.Default.Watchlist.Add(item); - } - // reselect previously selected - foreach (string checkedcall in checkedcalls) - { - int index = Properties.Settings.Default.Watchlist.IndexOf(checkedcall); - if (index >= 0) - Properties.Settings.Default.Watchlist[index].Checked = true; - } - } - } - #endregion #region tab_Options_Database @@ -295,22 +256,33 @@ namespace AirScout private void tab_Options_Database_Enter(object sender, EventArgs e) { - tb_Options_ScoutBase_Database_FileName.Text = GetDatabaseDir(StationData.Database.GetDBLocation()); + lbl_Options_ScoutBase_Database_FileName.Text = GetDatabaseDir(StationData.Database.GetDBLocation()); tb_Options_ScoutBase_Database_FileSize.Text = StationData.Database.GetDBSize().ToString("F0"); - tb_Options_AirScout_Database_FileName.Text = GetDatabaseDir(AircraftData.Database.GetDBLocation()); + lbl_Options_AirScout_Database_FileName.Text = GetDatabaseDir(AircraftData.Database.GetDBLocation()); tb_Options_AirScout_Database_FileSize.Text = AircraftData.Database.GetDBSize().ToString("F0"); - tb_Options_Propagation_GLOBE_Database_FileName.Text = GetDatabaseDir(PropagationData.Database.GetDBLocation(ELEVATIONMODEL.GLOBE)); + lbl_Options_Propagation_GLOBE_Database_FileName.Text = GetDatabaseDir(PropagationData.Database.GetDBLocation(ELEVATIONMODEL.GLOBE)); tb_Options_Propagation_GLOBE_Database_FileSize.Text = PropagationData.Database.GetDBSize(ELEVATIONMODEL.GLOBE).ToString("F0"); - tb_Options_Propagation_SRTM3_Database_FileName.Text = GetDatabaseDir(PropagationData.Database.GetDBLocation(ELEVATIONMODEL.SRTM3)); + lbl_Options_Propagation_SRTM3_Database_FileName.Text = GetDatabaseDir(PropagationData.Database.GetDBLocation(ELEVATIONMODEL.SRTM3)); tb_Options_Propagation_SRTM3_Database_FileSize.Text = PropagationData.Database.GetDBSize(ELEVATIONMODEL.SRTM3).ToString("F0"); - tb_Options_Propagation_SRTM1_Database_FileName.Text = GetDatabaseDir(PropagationData.Database.GetDBLocation(ELEVATIONMODEL.SRTM1)); + lbl_Options_Propagation_SRTM1_Database_FileName.Text = GetDatabaseDir(PropagationData.Database.GetDBLocation(ELEVATIONMODEL.SRTM1)); tb_Options_Propagation_SRTM1_Database_FileSize.Text = PropagationData.Database.GetDBSize(ELEVATIONMODEL.SRTM1).ToString("F0"); - tb_Options_Elevation_GLOBE_Database_FileName.Text = GetDatabaseDir(ElevationData.Database.GetDBLocation(ELEVATIONMODEL.GLOBE)); + lbl_Options_Elevation_GLOBE_Database_FileName.Text = GetDatabaseDir(ElevationData.Database.GetDBLocation(ELEVATIONMODEL.GLOBE)); tb_Options_Elevation_GLOBE_Database_FileSize.Text = ElevationData.Database.GetDBSize(ELEVATIONMODEL.GLOBE).ToString("F0"); - tb_Options_Elevation_SRTM3_Database_FileName.Text = GetDatabaseDir(ElevationData.Database.GetDBLocation(ELEVATIONMODEL.SRTM3)); + lbl_Options_Elevation_SRTM3_Database_FileName.Text = GetDatabaseDir(ElevationData.Database.GetDBLocation(ELEVATIONMODEL.SRTM3)); tb_Options_Elevation_SRTM3_Database_FileSize.Text = ElevationData.Database.GetDBSize(ELEVATIONMODEL.SRTM3).ToString("F0"); - tb_Options_Elevation_SRTM1_Database_FileName.Text = GetDatabaseDir(ElevationData.Database.GetDBLocation(ELEVATIONMODEL.SRTM1)); + lbl_Options_Elevation_SRTM1_Database_FileName.Text = GetDatabaseDir(ElevationData.Database.GetDBLocation(ELEVATIONMODEL.SRTM1)); tb_Options_Elevation_SRTM1_Database_FileSize.Text = ElevationData.Database.GetDBSize(ELEVATIONMODEL.SRTM1).ToString("F0"); + lbl_Options_Map_Database_FileName.Text = GetDatabaseDir(MapData.Database.GetDBLocation()); + tb_Options_Map_Database_FileSize.Text = MapData.Database.GetDBSize().ToString("F0"); + tt_Options.SetToolTip(lbl_Options_ScoutBase_Database_FileName, StationData.Database.GetDBLocation() + "\n\n" + "Click here to open database location in Explorer window."); + tt_Options.SetToolTip(lbl_Options_AirScout_Database_FileName, AircraftData.Database.GetDBLocation() + "\n\n" + "Click here to open database location in Explorer window."); + tt_Options.SetToolTip(lbl_Options_Propagation_GLOBE_Database_FileName, PropagationData.Database.GetDBLocation(ELEVATIONMODEL.GLOBE) + "\n\n" + "Click here to open database location in Explorer window."); + tt_Options.SetToolTip(lbl_Options_Propagation_SRTM3_Database_FileName, PropagationData.Database.GetDBLocation(ELEVATIONMODEL.SRTM3) + "\n\n" + "Click here to open database location in Explorer window."); + tt_Options.SetToolTip(lbl_Options_Propagation_SRTM1_Database_FileName, PropagationData.Database.GetDBLocation(ELEVATIONMODEL.SRTM1) + "\n\n" + "Click here to open database location in Explorer window."); + tt_Options.SetToolTip(lbl_Options_Elevation_GLOBE_Database_FileName, ElevationData.Database.GetDBLocation(ELEVATIONMODEL.GLOBE) + "\n\n" + "Click here to open database location in Explorer window."); + tt_Options.SetToolTip(lbl_Options_Elevation_SRTM3_Database_FileName, ElevationData.Database.GetDBLocation(ELEVATIONMODEL.SRTM3) + "\n\n" + "Click here to open database location in Explorer window."); + tt_Options.SetToolTip(lbl_Options_Elevation_SRTM1_Database_FileName, ElevationData.Database.GetDBLocation(ELEVATIONMODEL.SRTM1) + "\n\n" + "Click here to open database location in Explorer window."); + tt_Options.SetToolTip(lbl_Options_Map_Database_FileName, MapData.Database.GetDBLocation() + "\n\n" + "Click here to open database location in Explorer window."); double total = StationData.Database.GetDBSize() + AircraftData.Database.GetDBSize() + PropagationData.Database.GetDBSize(ELEVATIONMODEL.GLOBE) + @@ -318,7 +290,8 @@ namespace AirScout PropagationData.Database.GetDBSize(ELEVATIONMODEL.SRTM1) + ElevationData.Database.GetDBSize(ELEVATIONMODEL.GLOBE) + ElevationData.Database.GetDBSize(ELEVATIONMODEL.SRTM3) + - ElevationData.Database.GetDBSize(ELEVATIONMODEL.SRTM1); + ElevationData.Database.GetDBSize(ELEVATIONMODEL.SRTM1) + + MapData.Database.GetDBSize(); lbl_Options_Database_TotalSize.Text = total.ToString("F0"); rb_Options_Database_Update_Never.Checked = !Properties.Settings.Default.Background_Update_OnStartup && !Properties.Settings.Default.Background_Update_Periodically; rb_Options_Database_Update_OnStartup.Checked = Properties.Settings.Default.Background_Update_OnStartup; @@ -361,21 +334,6 @@ namespace AirScout Properties.Settings.Default.Background_Update_Periodically = false; } - private void btn_Open_LogDirectory_Click(object sender, EventArgs e) - { - Process.Start(ParentDlg.LogDirectory); - } - - private void btn_Open_TmpDirectory_Click(object sender, EventArgs e) - { - Process.Start(ParentDlg.TmpDirectory); - } - - private void cb_Options_Watchlist_SyncWithKST_CheckedChanged(object sender, EventArgs e) - { - btn_Options_Watchlist_Manage.Enabled = !cb_Options_Watchlist_SyncWithKST.Checked; - } - private void btn_Options_DeleteAllElevationPaths_Click(object sender, EventArgs e) { if (MessageBox.Show("Are you sure to delete all precalculated elevation paths from database?", "Delete all elevation paths", MessageBoxButtons.YesNo) == DialogResult.Yes) @@ -396,6 +354,11 @@ namespace AirScout } } + private void btn_DeleteAllMapTiles_Click(object sender, EventArgs e) + { + MapData.Database.TileDeleteAll(); + } + private void btn_Options_ScoutBase_Database_Maintenance_Click(object sender, EventArgs e) { DatabaseMaintenanceDlg Dlg = new DatabaseMaintenanceDlg(StationData.Database); @@ -444,6 +407,51 @@ namespace AirScout Dlg.ShowDialog(); } + private void lbl_Options_ScoutBase_Database_FileName_Click(object sender, EventArgs e) + { + Process.Start(Path.GetDirectoryName(StationData.Database.GetDBLocation())); + } + + private void lbl_Options_AirScout_Database_FileName_Click(object sender, EventArgs e) + { + Process.Start(Path.GetDirectoryName(AircraftData.Database.GetDBLocation())); + } + + private void lbl_Options_Propagation_GLOBE_Database_FileName_Click(object sender, EventArgs e) + { + Process.Start(Path.GetDirectoryName(PropagationData.Database.GetDBLocation(ELEVATIONMODEL.GLOBE))); + } + + private void lbl_Options_Propagation_SRTM3_Database_FileName_Click(object sender, EventArgs e) + { + Process.Start(Path.GetDirectoryName(PropagationData.Database.GetDBLocation(ELEVATIONMODEL.SRTM3))); + } + + private void lbl_Options_Propagation_SRTM1_Database_FileName_Click(object sender, EventArgs e) + { + Process.Start(Path.GetDirectoryName(PropagationData.Database.GetDBLocation(ELEVATIONMODEL.SRTM1))); + } + + private void lbl_Options_Elevation_GLOBE_Database_FileName_Click(object sender, EventArgs e) + { + Process.Start(Path.GetDirectoryName(ElevationData.Database.GetDBLocation(ELEVATIONMODEL.GLOBE))); + } + + private void lbl_Options_Elevation_SRTM3_Database_FileName_Click(object sender, EventArgs e) + { + Process.Start(Path.GetDirectoryName(ElevationData.Database.GetDBLocation(ELEVATIONMODEL.SRTM3))); + } + + private void lbl_Options_Elevation_SRTM1_Database_FileName_Click(object sender, EventArgs e) + { + Process.Start(Path.GetDirectoryName(ElevationData.Database.GetDBLocation(ELEVATIONMODEL.SRTM1))); + } + + private void lbl_Options_Map_Database_FileName_Click(object sender, EventArgs e) + { + Process.Start(Path.GetDirectoryName(MapData.Database.GetDBLocation())); + } + #endregion #region tab_Options_Stations @@ -2156,6 +2164,92 @@ namespace AirScout } + #endregion + + #region tab_Options_Watchlist + + private void tab_Options_Watchlist_Enter(object sender, EventArgs e) + { + + } + + private void cb_Options_Watchlist_SyncWithKST_CheckedChanged(object sender, EventArgs e) + { + // disable manage buttons when synced with KST + btn_Options_Watchlist_Manage.Enabled = !cb_Options_Watchlist_SyncWithKST.Checked; + btn_Options_Watchlist_Clear.Enabled = !cb_Options_Watchlist_SyncWithKST.Checked; + } + + private void btn_Options_Watchlist_Manage_Click(object sender, EventArgs e) + { + // sync watchlist, try to keep previously checked calls + // you can have a call only once in the watch list + List checkedcalls = new List(); + foreach (WatchlistItem item in Properties.Settings.Default.Watchlist) + { + if (item.Checked) + checkedcalls.Add(item.Call); + } + WatchlistDlg Dlg = new WatchlistDlg(); + if (Dlg.ShowDialog() == DialogResult.OK) + { + // clear watch list + Properties.Settings.Default.Watchlist.Clear(); + foreach (DataGridViewRow row in Dlg.dgv_Watchlist_Selected.Rows) + { + string call = row.Cells[0].Value.ToString(); + string loc = row.Cells[1].Value.ToString(); + bool oor = true; + // try to get the location from database + LocationDesignator dxloc = StationData.Database.LocationFind(call, loc); + if (dxloc != null) + { + oor = LatLon.Distance(Properties.Settings.Default.MyLat, Properties.Settings.Default.MyLon, dxloc.Lat, dxloc.Lon) > Properties.Settings.Default.Path_MaxLength; + } + // add call to watch list + WatchlistItem item = new WatchlistItem(call, loc, oor); + Properties.Settings.Default.Watchlist.Add(item); + } + // reselect previously selected + foreach (string checkedcall in checkedcalls) + { + int index = Properties.Settings.Default.Watchlist.IndexOf(checkedcall); + if (index >= 0) + Properties.Settings.Default.Watchlist[index].Checked = true; + } + } + } + + private void btn_Options_Watchlist_Clear_Click(object sender, EventArgs e) + { + Properties.Settings.Default.Watchlist.Clear(); + } + + + #endregion + + #region tab_Options_Misc + + private void btn_Options_Open_AirScoutDirectory_Click(object sender, EventArgs e) + { + Process.Start(ParentDlg.AppDirectory); + } + + private void btn_Options_Open_LogDirectory_Click(object sender, EventArgs e) + { + Process.Start(ParentDlg.LogDirectory); + } + + private void btn_Options_Open_TmpDirectory_Click(object sender, EventArgs e) + { + Process.Start(ParentDlg.TmpDirectory); + } + + private void btn_Options_Open_PluginDirectory_Click(object sender, EventArgs e) + { + Process.Start(ParentDlg.PluginDirectory); + } + private void pb_Donate_Click(object sender, EventArgs e) { try @@ -2165,12 +2259,10 @@ namespace AirScout catch { } - } #endregion - private void OptionsDlg_FormClosing(object sender, FormClosingEventArgs e) { bw_GLOBE_MapUpdater.CancelAsync(); diff --git a/AirScout/OptionsDlg.resx b/AirScout/OptionsDlg.resx index 4518a40..86a2f14 100644 --- a/AirScout/OptionsDlg.resx +++ b/AirScout/OptionsDlg.resx @@ -117,9 +117,61 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + 17, 17 + + You can select different map provider from the list below. Depending on your selection some maps may not be available for your choosen area. Please note that the selection of maps is taken from Great Maps regardless of their legal status. Some of them might be copyrighted or otherwise restricted in use. You were asked to agree with the terms of use first. +Open Street Map is recommended as a default. + + + Information from callsign database and other sources are used to prefill fields. You can overwrite and complete entries here. Your local database is updated. If you want to share the information with the AirScout community please use the "Send Update!" buttons. + + + CAUTION: Running a web service is a potential security hole! You should activate this function only inside a private network. + +Depending on your user profile you will prompted several times by the Operating System on first run. Please accept all security queries with "Yes" or "Accept". +Otherwise the web service will not run properly. + + + AirScout can work as a server in a network. + +UDP Server: +You can ask for a path calculation between two stations and AirScout will return the planes near path and their portential for a reflection. + +HTTP Server: +You can ask for latest plane positions via simple http-request (e.g. from a web browser. The result is delivered as a JSON file which can used to run own services and calculations. + +See documentation for further details. + + + AirScout can get FFT data from Spectrum Lab software via Network. You must have Spectrum Lab software installed with default settings. Do not forget to activate http - server functionaltiy in Spectrum Lab. + + + Watchlist allows you to pick a number of stations out of your database. +This is very helpful especially when working in Multi-Path Mode. + +All stations on watchlist can be shown on map with small markers and callsign labels for quick showing/hiding path to them. + +If a station is selected from watchlist by checking the assigned checkbox, path is shown on map and entry is coloured according to aircraft scatter potential. + +Watchlist can be synchronized with ON4KST chat user list instead of a local managed list to show all stations currently logged in in chat (Needs wtKST software and network functions enabbled). + + + 130, 17 + + + 353, 17 + + + 483, 17 + + + 706, 17 + + + 890, 17 + @@ -239,46 +291,4 @@ bOQwu7KRw+zKRg6zKxs5zK5s5DC7spHD7MpGDrMrGznMrkwUwn8BkAmqaXV391cAAAAASUVORK5CYII= - - You can select different map provider from the list below. Depending on your selection some maps may not be available for your choosen area. Please note that the selection of maps is taken from Great Maps regardless of their legal status. Some of them might be copyrighted or otherwise restricted in use. You were asked to agree with the terms of use first. -Open Street Map is recommended as a default. - - - Information from callsign database and other sources are used to prefill fields. You can overwrite and complete entries here. Your local database is updated. If you want to share the information with the AirScout community please use the "Send Update!" buttons. - - - CAUTION: Running a web service is a potential security hole! You should activate this function only inside a private network. - -Depending on your user profile you will prompted several times by the Operating System on first run. Please accept all security queries with "Yes" or "Accept". -Otherwise the web service will not run properly. - - - AirScout can work as a server in a network. - -UDP Server: -You can ask for a path calculation between two stations and AirScout will return the planes near path and their portential for a reflection. - -HTTP Server: -You can ask for latest plane positions via simple http-request (e.g. from a web browser. The result is delivered as a JSON file which can used to run own services and calculations. - -See documentation for further details. - - - AirScout can get FFT data from Spectrum Lab software via Network. You must have Spectrum Lab software installed with default settings. Do not forget to activate http - server functionaltiy in Spectrum Lab. - - - 130, 17 - - - 353, 17 - - - 483, 17 - - - 706, 17 - - - 890, 17 - \ No newline at end of file diff --git a/AirScout/PathCalculator.cs b/AirScout/PathCalculator.cs index 8ad19e4..7f471c7 100644 --- a/AirScout/PathCalculator.cs +++ b/AirScout/PathCalculator.cs @@ -45,6 +45,44 @@ namespace AirScout this.Model = model; } + private DateTime GetDatabaseTimeStamp() + { + string filename = StationData.Database.GetDBLocation(); + DateTime dt = File.GetLastWriteTimeUtc(filename).ToUniversalTime(); + // convert to YYYY:MM:DD hh:mm:ss only as this is stored in settings + dt = new DateTime(dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, dt.Second, DateTimeKind.Utc); + return dt; + } + + private DateTime GetSavedDatabaseTimeStamp() + { + DateTime dt = DateTime.MinValue; + dt = Properties.Settings.Default.StationsDatabase_TimeStamp; + // change kind to UTC as it is not specified in settings + dt = DateTime.SpecifyKind(dt, DateTimeKind.Utc); + return dt; + } + + private void SaveDatabaseTimeStamp() + { + Properties.Settings.Default.StationsDatabase_TimeStamp = GetDatabaseTimeStamp(); + } + + private bool HasDatabaseChanged() + { + try + { + DateTime dt1 = GetSavedDatabaseTimeStamp(); + DateTime dt2 = GetDatabaseTimeStamp(); + return dt1 != dt2; + } + catch + { + // do nothing + } + return true; + } + protected override void OnDoWork(DoWorkEventArgs e) { // get all parameters @@ -75,23 +113,27 @@ namespace AirScout // name the thread for debugging if (String.IsNullOrEmpty(Thread.CurrentThread.Name)) Thread.CurrentThread.Name = Name + "_" + this.GetType().Name; + this.ReportProgress(0, Name + " started."); try { // iterate through all locations in the database and calculate the propagation path - // chek if database is ready first - while (ElevationData.Database.GetDBStatusBit(Model, DATABASESTATUS.ERROR) || (!ElevationData.Database.GetDBStatusBit(Model, DATABASESTATUS.COMPLETE) && !ElevationData.Database.GetDBStatusBit(Model, DATABASESTATUS.UPTODATE))) + // chek if databases are ready and changes reported first + while (!ElevationData.Database.GetDBStatusBit(Model, DATABASESTATUS.UPTODATE) || !StationData.Database.GetDBStatusBit(DATABASESTATUS.UPTODATE) || !HasDatabaseChanged()) { - this.ReportProgress(0, Name + " waiting for database is complete..."); // sleep 10 sec int i = 0; while (!this.CancellationPending && (i < 10)) { Thread.Sleep(1000); i++; + if (this.CancellationPending) + break; } if (this.CancellationPending) break; } + if (this.CancellationPending) + break; this.ReportProgress(0, Name + " getting locations..."); // get all locations in covered area but don't report progress this.WorkerReportsProgress = false; @@ -103,6 +145,7 @@ namespace AirScout // iterate through locations QRVDesignator myqrv = null; QRVDesignator dxqrv = null; + this.ReportProgress(0, Name + " checking locations..."); foreach (LocationDesignator ld in lds) { Stopwatch st = new Stopwatch(); @@ -212,6 +255,8 @@ namespace AirScout if (this.CancellationPending) break; } + if (this.CancellationPending) + break; } catch (Exception ex) { @@ -220,6 +265,8 @@ namespace AirScout // keep cpu load low --> TODO: find better solution here Thread.Sleep(10); } + // save station database timestamp + SaveDatabaseTimeStamp(); // wait to keep cpu load low Thread.Sleep(Properties.Settings.Default.Background_Calculations_ThreadWait); this.ReportProgress(0, Name + " finished."); @@ -248,7 +295,7 @@ namespace AirScout } else { - this.ReportProgress(0, Name + "finished."); + this.ReportProgress(0, Name + " finished."); Log.WriteMessage(Name + " finished."); } } diff --git a/AirScout/Properties/AssemblyInfo.cs b/AirScout/Properties/AssemblyInfo.cs index 0290e6f..30ea79c 100644 --- a/AirScout/Properties/AssemblyInfo.cs +++ b/AirScout/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.3.2.0")] -[assembly: AssemblyFileVersion("1.3.2.0")] +[assembly: AssemblyVersion("1.3.3.0")] +[assembly: AssemblyFileVersion("1.3.3.0")] diff --git a/AirScout/Properties/Resources.Designer.cs b/AirScout/Properties/Resources.Designer.cs index 72f5983..97fffc0 100644 --- a/AirScout/Properties/Resources.Designer.cs +++ b/AirScout/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace AirScout.Properties { // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -60,6 +60,36 @@ namespace AirScout.Properties { } } + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap AirScout_Marker { + get { + object obj = ResourceManager.GetObject("AirScout_Marker", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap AirScout_Multi { + get { + object obj = ResourceManager.GetObject("AirScout_Multi", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap AirScout_Watchlist { + get { + object obj = ResourceManager.GetObject("AirScout_Watchlist", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// @@ -99,5 +129,15 @@ namespace AirScout.Properties { return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Settings { + get { + object obj = ResourceManager.GetObject("Settings", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/AirScout/Properties/Resources.resx b/AirScout/Properties/Resources.resx index d423dd7..5bc6201 100644 --- a/AirScout/Properties/Resources.resx +++ b/AirScout/Properties/Resources.resx @@ -130,4 +130,16 @@ ..\Icons\Map2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\AirScout_Marker.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\AirScout_Multi.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\AirScout_Watchlist.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Settings.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/AirScout/Properties/Settings.Designer.cs b/AirScout/Properties/Settings.Designer.cs index 5791d8f..e273b78 100644 --- a/AirScout/Properties/Settings.Designer.cs +++ b/AirScout/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace AirScout.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.5.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); @@ -1984,12 +1984,12 @@ Digital data base on the World Wide Web (URL: http://www.ngdc.noaa.gov/mgg/topo/ [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("10")] - public decimal Analysis_CrossingHistory_AmbiguousGap { + public decimal Analysis_CrossingHistory_AmbigousGap { get { - return ((decimal)(this["Analysis_CrossingHistory_AmbiguousGap"])); + return ((decimal)(this["Analysis_CrossingHistory_AmbigousGap"])); } set { - this["Analysis_CrossingHistory_AmbiguousGap"] = value; + this["Analysis_CrossingHistory_AmbigousGap"] = value; } } @@ -2244,5 +2244,65 @@ Digital data base on the World Wide Web (URL: http://www.ngdc.noaa.gov/mgg/topo/ this["Charts_FontSize"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool Location_RestrictToAreaOfInterest { + get { + return ((bool)(this["Location_RestrictToAreaOfInterest"])); + } + set { + this["Location_RestrictToAreaOfInterest"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("1970-01-01")] + public global::System.DateTime StationsDatabase_TimeStamp { + get { + return ((global::System.DateTime)(this["StationsDatabase_TimeStamp"])); + } + set { + this["StationsDatabase_TimeStamp"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool Map_Preloader_Enabled { + get { + return ((bool)(this["Map_Preloader_Enabled"])); + } + set { + this["Map_Preloader_Enabled"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0")] + public decimal Map_Preloader_MinZoom { + get { + return ((decimal)(this["Map_Preloader_MinZoom"])); + } + set { + this["Map_Preloader_MinZoom"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("11")] + public decimal Map_Preloader_MaxZoom { + get { + return ((decimal)(this["Map_Preloader_MaxZoom"])); + } + set { + this["Map_Preloader_MaxZoom"] = value; + } + } } } diff --git a/AirScout/Properties/Settings.settings b/AirScout/Properties/Settings.settings index bb59fb3..16986bf 100644 --- a/AirScout/Properties/Settings.settings +++ b/AirScout/Properties/Settings.settings @@ -523,7 +523,7 @@ MEaSUREs data and products are available at no charge from the LP DAAC.See https False - + 10 @@ -589,5 +589,20 @@ MEaSUREs data and products are available at no charge from the LP DAAC.See https 6 + + True + + + 1970-01-01 + + + False + + + 0 + + + 11 + \ No newline at end of file diff --git a/AirScout/Resources/AirScout_Marker.png b/AirScout/Resources/AirScout_Marker.png new file mode 100644 index 0000000..ab40162 Binary files /dev/null and b/AirScout/Resources/AirScout_Marker.png differ diff --git a/AirScout/Resources/AirScout_Multi.png b/AirScout/Resources/AirScout_Multi.png new file mode 100644 index 0000000..6c1ca6e Binary files /dev/null and b/AirScout/Resources/AirScout_Multi.png differ diff --git a/AirScout/Resources/AirScout_Watchlist.png b/AirScout/Resources/AirScout_Watchlist.png new file mode 100644 index 0000000..872d721 Binary files /dev/null and b/AirScout/Resources/AirScout_Watchlist.png differ diff --git a/AirScout/Resources/Settings.png b/AirScout/Resources/Settings.png new file mode 100644 index 0000000..5c3b3a4 Binary files /dev/null and b/AirScout/Resources/Settings.png differ diff --git a/AirScout/Splash.Designer.cs b/AirScout/Splash.Designer.cs index f3ed7b0..6f2b18e 100644 --- a/AirScout/Splash.Designer.cs +++ b/AirScout/Splash.Designer.cs @@ -74,7 +74,7 @@ this.Name = "Splash"; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Splash"; + this.Text = "AirScout"; this.TopMost = true; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Splash_FormClosing); this.Load += new System.EventHandler(this.Splash_Load); diff --git a/AirScout/Splash.cs b/AirScout/Splash.cs index 7c38c3b..923c264 100644 --- a/AirScout/Splash.cs +++ b/AirScout/Splash.cs @@ -99,6 +99,11 @@ namespace AirScout this.Opacity += 0.01; ti_Animation.Start(); } + else + { + // rest topmost style + this.TopMost = false; + } } private void pb_Main_Paint(object sender, PaintEventArgs e) diff --git a/AirScout/VersionHistory.txt b/AirScout/VersionHistory.txt index 0a105fd..0d19062 100644 --- a/AirScout/VersionHistory.txt +++ b/AirScout/VersionHistory.txt @@ -1,43 +1,181 @@ -2014-01-04: V1.0.0.0 +2020-xx-xx: V1.3.3.0 ==================== -Initial Version +- Feature: Option to restrict call sign database to locations inside the area of interest (via "Option/Stations"), all others outside this area will be deleted in each update prcodedure +- Bugfix: Again fixed some issues with splash window preventing error messages being shown at startup. +- Bugifx: Some elements inside the control tab were not drawn on first enter when running under Linux/Mono --> fixed +- Feature: Optimize the database update procedures to save CPU load and bandwidth, do nothing now when neither database nor web update has changed since last update +- Bugfix: Airports are showing up on map with long delay --> fixed +- Bugfix: AirScout crashes when startup is delayed for some reason and splash window has closed meanwhile --> fixed +- Bugfix: AirScout crashes after cleaning up settings via AirScout.exe /clean and opening "Options" dialog, default path settings are lost --> fixed +- Bugfix: Critical! AirScout does not show up anymore when closed once in "Minimized" state, only way to recover is to clean up settings --> fixed (tnx SM6MUY, OZ9GE) +- Bugfix: Coloured watchlist items were not reset to default when plane passed and no potetial is left anymore --> fixed (tnx OZ9GE) +- Feature: Implementing TLS1.2 for .NET4.0 (Windows XP) for plane feeds which require a secure connection, this keeps backward compatibility for almost all streams +- Feature: Map preloader (experimental), preload missing map tiles from www.airscout.eu (only Open Street Maps, only Central Europe) or from map server and store it to database +- Feature: Rework of Options dialog, re-arranged some items to get more clearance in what they stand for -2014-01-09: V1.0.0.1 +2020-xx-xx: V1.3.2.0 (not published) ==================== -- Bugfix: Activation of AirScout server via "Activate Server" checkbox on "Options/Network" does not work. No server functions available --> fixed (tnx SM7EYW) +- Bugfix: Several limitations on Windows XP, program crashes while opening Options Dialog, users cannot save plane feed settings --> fixed (tnx OK1TEH) +- Feature: Users can click on the watchlist markers on the map to change path immediately in SINGLE mode (tnx GM4JTJ) +- Feature: Option to change font size in charts via "Options/Map" (tnx LZ2ZP) +- Bugfix: Radio Horizon shows an unwanted strike through in Cartesian diagram --> fixed (tnx LZ2ZP) +- Feature: Redirect console output, users can run AirScout from a command line and see all console output for debugging (like on Linux) +- Bugfix: Watchlist was not properly sorted when synchronized with wtKST --> fixed +- Bugfix: "Orphan paths" when watchlist is synchronized with wtKST and user leaves the chat --> fixed, call is kept on watchlist now as long as it is selected - -2015-02-08: V1.1.0.0 +2020-03-01: V1.3.1.0 ==================== -- Bugfix: Lat/Lon textboxes at "Options/Planes" do not show the current settings from "Options/General" tab. --> fixed (tnx VK6KDX) -- Bugfix: Program is crashing when pressing the "Show Traffic" button on the "Options/Planes" tab on an empty plane position database - (e.g. no plane positions were loaded neither from Internet nor from a local file) --> fixed (tnx VK6KDX) -- Bugfix: InfoWindow: Elevation is showing wrong values --> fixed -- Feature: Accessiblity enhancement, minimize Zoom, Fliter and Alarm Boxes to save screen space when using larger system fonts. - New splitters between map, info box and elevation details, positions were saved now. - Ensure that the basic window elements are always visible. (tnx IK1ZOF) -- Bugfix: several text box input in the Options window (e.g. Sepctrum Lab Server URL) is not saved correctly after pressing "Apply" or "OK" --> fixed -- Feature: new plane feeds created including random source and new web feeds, file feeds and raw data input from ADS-B receiver (DVB-T stick based with RTL1090) -- Feature: AirScout web server functionalitity -- Feature: News Feed included in separate tab -- Feature: Plane tracking by several ways included (experimental) -- Feature: Import call sign database from previous versions or other sources -- Feature: New (scalable) plane icons according to category (tnx OK1TEH) +- Bugfix: AirportMapper does not work, Airports were not shown on the map anymore --> fixed (tnx OZ9GE) +- Feature: complete rework of watchlist dialog, now changed from ListView to DataGridView (which is much faster), additionally show locator (tnx G8JVM, DH5FS, OZ9GE) +- Bugfix: Aircraft labels were not shown on the elevation tab anymore (tab was disabled while in PLAY mode) --> fixed, now showing again on Left+Click (tnx OZ9GE) +- Bugfix: ProgressTimer overflow under heavy load (especially when too many planes or paths are to display on slow systems) --> fixed (timer is stopped now and restarted not until update is performed) +- Bugfix: do not disable whole tab controls while in PLAY mode, allow some user action and display changes --> fixed (change of tabs in tab control is now blocked by other means) +- Feature: Rework of watch list in main window, showing potential now in full color, last selected call in MULTI mode is automatically transferred as selected call for SINGLE mode (tnx GM3SEK) +- Feature: rework of splash window at startup, showing software version now +- Bugfix: Planefinder web feed stopped working --> fixed (tnx F8AIH) +- Feature: New web feed from OpenSky Network implenented (a free community) +- Bugfix: AirScout crashed when the "Info" tab in the "Options" dialog box is opened twice after doing some other stuff --> fixed (tnx G0LGS) +2020-xx-xx: V1.3.0.8 (not published) +==================== -2015-xx-xx: V1.1.0.1 (not published) -==================================== +- Bugfix: The calculation of free disk space does not work on some Linux configurations, unable to load elevation tiles --> fixed with workaround (tnx G8JVM) +- Bugfix: Somtimes unable to set own callsign in First Run Wizard on Linux (when own callsign is not in database) --> fixed (tnx (G8JVM) +- Bugfix: Window splitter position not set properly when starting up after First Run Wizard or when starting on Linux +- Feature: Manage watch list dialog is slow, filling the list boxes is taking ages (especially on Linux/Mono)--> create a background worker and show progress while loading (tnx G8JVM) +- Feature: Watch list is now sorted on selected calls first when in Play mode, coloured checkboxes are showing AS potential (tnx DH5FS) +- Bugfix: Multiple dialog boxes "There are news on the website..." are showing if no user reaaction happend after some minutes --> fixed +- Bugfix: Planes Minimal Category Filter Boxes are showing all categories twice --> fixed (tnx S51ML) +- Bugfix: UDP-Server (for wtKST or similar) delivers full plane category string (e.g. "MEDIUM") in ASNEAREST message instead of one character (e.g. "M") --> fixed (tnx S51ML) -- Bugfix: Donate button issue - Program hangs or shows "Script error" while trying to load the website from the server --> fixed (tnx SM6CEN) -- Bugfix: Antenna tracking does not stop when selected AP disappeared, sending "0.0" values for Az/El instead of stop sending data--> fixed -- Bugfix: Planes with category "S" (Superheavy) were shown as "M" sized icons --> fixed -- Bugfix: GLOBE source unusable outside Europe: changed URL, tiles and data format --> fixed, complete new tile handling and download strategy is implemented (tnx VK2BJP) -- Bugfix: Corrupted lat/lon information in feed, major amount of planes is dropped --> not fixed so far(tnx W3SZ) -- Bugfix: Error in 2-line TLE handling for ISS --> fixed -- Feature: Playing of historical data (Offline mode) when double-clicking on UTC field in "Pause" mode +2020-02-12: V1.3.0.7 +==================== + +- Bugfix: The AirScout_clean.cmd does not work properly when trying to cleanup files (database files are locked) --> fixed +- Bugfix: Session key sometimes was not genrated at fresh install, resulting in limited functionality --> fixed +- Bugfix: Watchlist in multi-path mode always scrolls back to top position after watchlist is updated, watchlist is getting inoperable on large amounts of calls --> fixed +- Bugfix: Sometimes a MemoryCounter could not created by the system, Exception will occur and AirScout will not start --> fixed +- Feature: Create a progress indicator while creating elevation tile catalogue --> number of tiles processed is displayed now (tnx DL8AAU) +- Feature: colour checked items in watch list according to their AS potential (tnx DF5HS) +- Feature: Sort selected items to the top of watch list to better view all selected items at once +- Feature: label checked items from watch list in map premantently when in Multi-Path Mode (call sign only) (tnx DF5HS) +- Bugfix: several minor bugs when managing watch list (calls not sorted, multiple adding adding possible) --> fixed (tnx DL8AAU) + +2020-02-04: V1.3.0.6 +==================== + +- Bugfix: Planefeed plugins do not show up on some configurations - seems to be a problem with .NET security policies --> fixed (tnx DL8AAU) +- Bugfix: Users cannot click on a single plane to show info permanently when in PLAY mode, also no tracking of a single plane is possible --> fixed (tnx IN3UPQ) +- Bugfix: Calculation of elevation angle is wrong, always showing abt. 0°, tracking not working --> fixed (tnx IN3UPQ) + +2020-02-02: V1.3.0.5 +==================== + +- Feature: New AirScout user space on webserver, including PHP scripts for upload download information and keys +- Feature: New database on webserver containing station info, qrv info and keys +- Feature: [Security enhancement] generate a unique AirScout instance key and a temporary session key each time AirScout is starting up, all traffic is now encrypted +- Feature: [Plugin framework for plane feeds] allowing to update feeds online and to write own feeds +- Feature: New and refurbished plane feeds, according to the new plane feed framework +- Feature: News tab is moved to map tab to get more space for viewing content + +2019-xx-xx: V1.3.0.4 (not published) +==================== + +- Feature: new "Multi-Path" feature to monitor more than one path at the same time, enhanced watch list features +- Feature: new common database layout for aircraft database +- Feature: keep aircraft positions in database instead of in memory +- Feature: local obstruction is now kept in database, new dialog window in "Stations" tab to enter obstruction data +- Bugfix: Showing of airports in map could not be switched off --> fixed (tnx DL8AAU) +- Bugfix: Calculation of squint angle was intransparent and probably incorrect, its now defined as the difference between both angles theta (refer to handbook) --> fixed +- Feature: Enhanced spectrum tab with zoomed map for supervising nearest plane in real time, singal strength is kept in database for further analysis +- Feature: Enhanced webserver functionality, deliver path and nearest planes info on HTTP-request via JSON, makes it possible to run one ore more AirScout view clients +- Feature: Enhanced analysis tab with history player and import/export functions +- Feature: [Virtual Radar Server] Extended plausibility check to avoid "jumping planes" due to incorrect position messages (estimate position from older messages and check against latest message) +- Feature: [PlaneFeeds] improved recovery of missing data/empty fields in captured messages +- Bugfix: Error 403 (forbidden) when loading map tiles from OpenStreetMap --> fixed + +2018-xx-xx: V1.3.0.3 (not published) +==================== + +- Bugfix: Web downloader now allows redirection (e.g. http:// --> https://) --> fixed (tnx DL8AAU) +- Feature: new database structure (internal) +- Feature: extended database structure --> storing location per user & 6digit locator, storing QRV info per user & 6digit locator & band +- Feature: new elevation tile structure and download procedure +- Feature: latest SQLite library version and "Any CPU" feature, AirScout now running as 32bit or 64bit application on both Windows and Linux +- Feature: Linux/Mono compatibility allows running AirScout native in a Linux/Mono environment (details and limitations see readme_Linux.txt) +- Feature: New charts library for enhanced presentation and Linux/Mono compatibility +- Feature: Enhanced station details dialog with map for easier location change and QRV info per callsign, locator and band +- Feature: new background procedures for station and elevation database updates +- Feature: new background procedure for propagation path pre-calculation +- Feature: extended error logging + +2017-xx-xx: V1.2.0.7 (not published) +==================== + +- Bugfix: "Jumping planes" due to incorrect timestamps when using VirtualRadarServer --> Workaround implemented (check server time and calculate offset) +- Feature: using GAlt (corrected altitude by air pressure) when using VirtualRadarServer giving more accurate altitude asl +- Feature: History Analysis tab implemented to load an play with historical data +- Bugfix: band specific setting of maximum distance to path not working --> fixed (tnx DL8AAU) +- Feature: show Radio Horizon on map as an additional option to easy locate obstructions on topology + +2017-xx-xx: V1.2.0.6 (not published) +==================== + +- Bugfix: AirScout crashes when Options/Database/Update local database is set to "Never" --> fixed (tnx DL3IAE) +- Bugfix: AirScout does not set DXCall properly when triggered from wtKST to show path and DXLocator does not match with database --> fixed (tnx DL8AAU) +- Feature: Import old callsign database from previous versions as TXT-file (tnx F1EBK) +- Bugfix: Import of initial database files crashed +- Bugfix: misformatted tracking file in WSJT format (azel.dat) --> fixed (tnx DJ5AR) +- Bugfix: creating an empty database under unknown circumstances which causes AirScout to crash on next startup --> Workaround implemented (check for empty lookup tables before saving to database) + +2017-01-02: V1.2.0.5 +==================== + +- Bugfix: Antenna height was not set to 10m by default in the HorizonCalculationDlg --> fixed (tnx DL8AAU) +- Bugfix: Elevation data and antenna height textboxes were not set in Options/Stations --> fixed +- Bugfix: DXStation details were not filled when enetering Options/Stations --> fixed +- Bugfix: ADSBSharp and RTL1090 feeds: exeptions while receiving misformatted messages were blocking the decoder for 10sec, no position messages could be decoded --> fixed (tnx PE1ITR) +- Bugfix: ADSBSharp and RTL1090 feeds: endless loop when not receiving a start character via TCP(binary mode only) --> fixed with receiving timeout (10sec) +- Feature: Aircraft database is now updated also from received web feeds +- Bugfix: Redraw loop to maximaized window when alarms occur --> fixed (tnx DL8AAU) +- Bugfix: Frequency calcluation wrong in HorizonDlg with special CultureInfo --> fixed (tnx DL8AAU) +- Bugfix: Callsign does not update in DXCall combobox when clicking on a marker from watchlist --> fixed (tnx OZ9GE) +- Bugfix: Changes on database were discarded when done before database background update was finished --> fixed + +2016-12-24: V1.2.0.4 +==================== + +- Bugfix: several issues when entering a completly unknown callsign --> fixed (tnx SM6CEN) +- Bugfix: station detail boxes in FirtsRuznWizard and Options/Stations differ in order --> fixed +- Feature: adjust MapWindow zoom automatically in FirstRunWizard when changing locator +- Bugfix: initial DXCall was set to GB3MHL, this is outdated --> fixed, DXCall now set to GB3MHZ (tnx G3XDY) +- Bugfix: loss of callsign database if closed before DatabaseUpdater was finished > fixed +- Bugfix: LastUpdated timestamps are not handled correctly, preventing user from altering locator once set as new --> fixed + +2016-12-23: V1.2.0.3 +==================== + +- Feature: new threadsafe LogWriter object created and extensive logging implemented +- Bugfix: download of SRTM elevation tiles does not work on WinXP due to missing TLS1.2 implementation --> Workaround + +2016-12-20: V1.2.0.2 +==================== + +- Bugfix: FirstRunWizard windows remained on topmost position blocking other dialogs--> fixed (tnx G3XDY) +- Feature: downgrade FirstRunWizard to Microsoft .Net4.0 and get back Winodws XP compatibitliy (tnx OK1TEH) +- Feature: design back button as classic button in FirstRunWizard regardless of Windows Design Rules (tnx DL8AAU) +- Bugfix: Reset settings to factory default does not work properly for plane feeds --> fixed +- Bugfix: use of "Best Case Elevation" even when given location is exact --> fixed (tnx G3XDY) +- Bugfix: "Best Case Elevation" did not work properly when more than one elevation model is activated --> fixed +- Feature: added QRZ lookup for own callsign on FirstRunWizard (tnx DL8AAU) +- Bugfix: proper handling of input (callsign, lat/lon, locator textboxes) +- Bugfix: proper handling of drag marker for own locaton on map (FirstRunWizard) --> fixed +- Bugfix: aircrafts did not show up on first run --> fixed (tnx G3XDY) +- Bugfix: database updater did not load elevation tiles from web --> fixed +- Feature: buttons for default elevation path added at Options/GLOBE, SRTM3, SRTM1 2016-12-11: V1.2.0.1 ==================== @@ -57,166 +195,42 @@ Initial Version - Feature: no admin rights necessary anymore, all files are now stored in local user space - Feature: window layout, position and size is kept now -2016-12-20: V1.2.0.2 +2015-xx-xx: V1.1.0.1 (not published) +==================================== + +- Bugfix: Donate button issue - Program hangs or shows "Script error" while trying to load the website from the server --> fixed (tnx SM6CEN) +- Bugfix: Antenna tracking does not stop when selected AP disappeared, sending "0.0" values for Az/El instead of stop sending data--> fixed +- Bugfix: Planes with category "S" (Superheavy) were shown as "M" sized icons --> fixed +- Bugfix: GLOBE source unusable outside Europe: changed URL, tiles and data format --> fixed, complete new tile handling and download strategy is implemented (tnx VK2BJP) +- Bugfix: Corrupted lat/lon information in feed, major amount of planes is dropped --> not fixed so far(tnx W3SZ) +- Bugfix: Error in 2-line TLE handling for ISS --> fixed +- Feature: Playing of historical data (Offline mode) when double-clicking on UTC field in "Pause" mode + +2015-02-08: V1.1.0.0 ==================== -- Bugfix: FirstRunWizard windows remained on topmost position blocking other dialogs--> fixed (tnx G3XDY) -- Feature: downgrade FirstRunWizard to Microsoft .Net4.0 and get back Winodws XP compatibitliy (tnx OK1TEH) -- Feature: design back button as classic button in FirstRunWizard regardless of Windows Design Rules (tnx DL8AAU) -- Bugfix: Reset settings to factory default does not work properly for plane feeds --> fixed -- Bugfix: use of "Best Case Elevation" even when given location is exact --> fixed (tnx G3XDY) -- Bugfix: "Best Case Elevation" did not work properly when more than one elevation model is activated --> fixed -- Feature: added QRZ lookup for own callsign on FirstRunWizard (tnx DL8AAU) -- Bugfix: proper handling of input (callsign, lat/lon, locator textboxes) -- Bugfix: proper handling of drag marker for own locaton on map (FirstRunWizard) --> fixed -- Bugfix: aircrafts did not show up on first run --> fixed (tnx G3XDY) -- Bugfix: database updater did not load elevation tiles from web --> fixed -- Feature: buttons for default elevation path added at Options/GLOBE, SRTM3, SRTM1 +- Bugfix: Lat/Lon textboxes at "Options/Planes" do not show the current settings from "Options/General" tab. --> fixed (tnx VK6KDX) +- Bugfix: Program is crashing when pressing the "Show Traffic" button on the "Options/Planes" tab on an empty plane position database + (e.g. no plane positions were loaded neither from Internet nor from a local file) --> fixed (tnx VK6KDX) +- Bugfix: InfoWindow: Elevation is showing wrong values --> fixed +- Feature: Accessiblity enhancement, minimize Zoom, Fliter and Alarm Boxes to save screen space when using larger system fonts. + New splitters between map, info box and elevation details, positions were saved now. + Ensure that the basic window elements are always visible. (tnx IK1ZOF) +- Bugfix: several text box input in the Options window (e.g. Sepctrum Lab Server URL) is not saved correctly after pressing "Apply" or "OK" --> fixed +- Feature: new plane feeds created including random source and new web feeds, file feeds and raw data input from ADS-B receiver (DVB-T stick based with RTL1090) +- Feature: AirScout web server functionalitity +- Feature: News Feed included in separate tab +- Feature: Plane tracking by several ways included (experimental) +- Feature: Import call sign database from previous versions or other sources +- Feature: New (scalable) plane icons according to category (tnx OK1TEH) -2016-12-23: V1.2.0.3 +2014-01-09: V1.0.0.1 ==================== -- Feature: new threadsafe LogWriter object created and extensive logging implemented -- Bugfix: download of SRTM elevation tiles does not work on WinXP due to missing TLS1.2 implementation --> Workaround +- Bugfix: Activation of AirScout server via "Activate Server" checkbox on "Options/Network" does not work. No server functions available --> fixed (tnx SM7EYW) -2016-12-24: V1.2.0.4 +2014-01-04: V1.0.0.0 ==================== -- Bugfix: several issues when entering a completly unknown callsign --> fixed (tnx SM6CEN) -- Bugfix: station detail boxes in FirtsRuznWizard and Options/Stations differ in order --> fixed -- Feature: adjust MapWindow zoom automatically in FirstRunWizard when changing locator -- Bugfix: initial DXCall was set to GB3MHL, this is outdated --> fixed, DXCall now set to GB3MHZ (tnx G3XDY) -- Bugfix: loss of callsign database if closed before DatabaseUpdater was finished > fixed -- Bugfix: LastUpdated timestamps are not handled correctly, preventing user from altering locator once set as new --> fixed - -2017-01-02: V1.2.0.5 -==================== - -- Bugfix: Antenna height was not set to 10m by default in the HorizonCalculationDlg --> fixed (tnx DL8AAU) -- Bugfix: Elevation data and antenna height textboxes were not set in Options/Stations --> fixed -- Bugfix: DXStation details were not filled when enetering Options/Stations --> fixed -- Bugfix: ADSBSharp and RTL1090 feeds: exeptions while receiving misformatted messages were blocking the decoder for 10sec, no position messages could be decoded --> fixed (tnx PE1ITR) -- Bugfix: ADSBSharp and RTL1090 feeds: endless loop when not receiving a start character via TCP(binary mode only) --> fixed with receiving timeout (10sec) -- Feature: Aircraft database is now updated also from received web feeds -- Bugfix: Redraw loop to maximaized window when alarms occur --> fixed (tnx DL8AAU) -- Bugfix: Frequency calcluation wrong in HorizonDlg with special CultureInfo --> fixed (tnx DL8AAU) -- Bugfix: Callsign does not update in DXCall combobox when clicking on a marker from watchlist --> fixed (tnx OZ9GE) -- Bugfix: Changes on database were discarded when done before database background update was finished --> fixed - -2017-xx-xx: V1.2.0.6 (not published) -==================== - -- Bugfix: AirScout crashes when Options/Database/Update local database is set to "Never" --> fixed (tnx DL3IAE) -- Bugfix: AirScout does not set DXCall properly when triggered from wtKST to show path and DXLocator does not match with database --> fixed (tnx DL8AAU) -- Feature: Import old callsign database from previous versions as TXT-file (tnx F1EBK) -- Bugfix: Import of initial database files crashed -- Bugfix: misformatted tracking file in WSJT format (azel.dat) --> fixed (tnx DJ5AR) -- Bugfix: creating an empty database under unknown circumstances which causes AirScout to crash on next startup --> Workaround implemented (check for empty lookup tables before saving to database) - -2017-xx-xx: V1.2.0.7 (not published) -==================== - -- Bugfix: "Jumping planes" due to incorrect timestamps when using VirtualRadarServer --> Workaround implemented (check server time and calculate offset) -- Feature: using GAlt (corrected altitude by air pressure) when using VirtualRadarServer giving more accurate altitude asl -- Feature: History Analysis tab implemented to load an play with historical data -- Bugfix: band specific setting of maximum distance to path not working --> fixed (tnx DL8AAU) -- Feature: show Radio Horizon on map as an additional option to easy locate obstructions on topology - -2018-xx-xx: V1.3.0.3 (not published) -==================== - -- Bugfix: Web downloader now allows redirection (e.g. http:// --> https://) --> fixed (tnx DL8AAU) -- Feature: new database structure (internal) -- Feature: extended database structure --> storing location per user & 6digit locator, storing QRV info per user & 6digit locator & band -- Feature: new elevation tile structure and download procedure -- Feature: latest SQLite library version and "Any CPU" feature, AirScout now running as 32bit or 64bit application on both Windows and Linux -- Feature: Linux/Mono compatibility allows running AirScout native in a Linux/Mono environment (details and limitations see readme_Linux.txt) -- Feature: New charts library for enhanced presentation and Linux/Mono compatibility -- Feature: Enhanced station details dialog with map for easier location change and QRV info per callsign, locator and band -- Feature: new background procedures for station and elevation database updates -- Feature: new background procedure for propagation path pre-calculation -- Feature: extended error logging - -2019-xx-xx: V1.3.0.4 (not published) -==================== - -- Feature: new "Multi-Path" feature to monitor more than one path at the same time, enhanced watch list features -- Feature: new common database layout for aircraft database -- Feature: keep aircraft positions in database instead of in memory -- Feature: local obstruction is now kept in database, new dialog window in "Stations" tab to enter obstruction data -- Bugfix: Showing of airports in map could not be switched off --> fixed (tnx DL8AAU) -- Bugfix: Calculation of squint angle was intransparent and probably incorrect, its now defined as the difference between both angles theta (refer to handbook) --> fixed -- Feature: Enhanced spectrum tab with zoomed map for supervising nearest plane in real time, singal strength is kept in database for further analysis -- Feature: Enhanced webserver functionality, deliver path and nearest planes info on HTTP-request via JSON, makes it possible to run one ore more AirScout view clients -- Feature: Enhanced analysis tab with history player and import/export functions -- Feature: [Virtual Radar Server] Extended plausibility check to avoid "jumping planes" due to incorrect position messages (estimate position from older messages and check against latest message) -- Feature: [PlaneFeeds] improved recovery of missing data/empty fields in captured messages -- Bugfix: Error 403 (forbidden) when loading map tiles from OpenStreetMap --> fixed - -2020-02-02: V1.3.0.5 -==================== - -- Feature: New AirScout user space on webserver, including PHP scripts for upload download information and keys -- Feature: New database on webserver containing station info, qrv info and keys -- Feature: [Security enhancement] generate a unique AirScout instance key and a temporary session key each time AirScout is starting up, all traffic is now encrypted -- Feature: [Plugin framework for plane feeds] allowing to update feeds online and to write own feeds -- Feature: New and refurbished plane feeds, according to the new plane feed framework -- Feature: News tab is moved to map tab to get more space for viewing content - -2020-02-04: V1.3.0.6 -==================== - -- Bugfix: Planefeed plugins do not show up on some configurations - seems to be a problem with .NET security policies --> fixed (tnx DL8AAU) -- Bugfix: Users cannot click on a single plane to show info permanently when in PLAY mode, also no tracking of a single plane is possible --> fixed (tnx IN3UPQ) -- Bugfix: Calculation of elevation angle is wrong, always showing abt. 0°, tracking not working --> fixed (tnx IN3UPQ) - -2020-02-12: V1.3.0.7 -==================== - -- Bugfix: The AirScout_clean.cmd does not work properly when trying to cleanup files (database files are locked) --> fixed -- Bugfix: Session key sometimes was not genrated at fresh install, resulting in limited functionality --> fixed -- Bugfix: Watchlist in multi-path mode always scrolls back to top position after watchlist is updated, watchlist is getting inoperable on large amounts of calls --> fixed -- Bugfix: Sometimes a MemoryCounter could not created by the system, Exception will occur and AirScout will not start --> fixed -- Feature: Create a progress indicator while creating elevation tile catalogue --> number of tiles processed is displayed now (tnx DL8AAU) -- Feature: colour checked items in watch list according to their AS potential (tnx DF5HS) -- Feature: Sort selected items to the top of watch list to better view all selected items at once -- Feature: label checked items from watch list in map premantently when in Multi-Path Mode (call sign only) (tnx DF5HS) -- Bugfix: several minor bugs when managing watch list (calls not sorted, multiple adding adding possible) --> fixed (tnx DL8AAU) - -2020-xx-xx: V1.3.0.8 (not published) -==================== - -- Bugfix: The calculation of free disk space does not work on some Linux configurations, unable to load elevation tiles --> fixed with workaround (tnx G8JVM) -- Bugfix: Somtimes unable to set own callsign in First Run Wizard on Linux (when own callsign is not in database) --> fixed (tnx (G8JVM) -- Bugfix: Window splitter position not set properly when starting up after First Run Wizard or when starting on Linux -- Feature: Manage watch list dialog is slow, filling the list boxes is taking ages (especially on Linux/Mono)--> create a background worker and show progress while loading (tnx G8JVM) -- Feature: Watch list is now sorted on selected calls first when in Play mode, coloured checkboxes are showing AS potential (tnx DH5FS) -- Bugfix: Multiple dialog boxes "There are news on the website..." are showing if no user reaaction happend after some minutes --> fixed -- Bugfix: Planes Minimal Category Filter Boxes are showing all categories twice --> fixed (tnx S51ML) -- Bugfix: UDP-Server (for wtKST or similar) delivers full plane category string (e.g. "MEDIUM") in ASNEAREST message instead of one character (e.g. "M") --> fixed (tnx S51ML) - -2020-03-01: V1.3.1.0 -==================== - -- Bugfix: AirportMapper does not work, Airports were not shown on the map anymore --> fixed (tnx OZ9GE) -- Feature: complete rework of watchlist dialog, now changed from ListView to DataGridView (which is much faster), additionally show locator (tnx G8JVM, DH5FS, OZ9GE) -- Bugfix: Aircraft labels were not shown on the elevation tab anymore (tab was disabled while in PLAY mode) --> fixed, now showing again on Left+Click (tnx OZ9GE) -- Bugfix: ProgressTimer overflow under heavy load (especially when too many planes or paths are to display on slow systems) --> fixed (timer is stopped now and restarted not until update is performed) -- Bugfix: do not disable whole tab controls while in PLAY mode, allow some user action and display changes --> fixed (change of tabs in tab control is now blocked by other means) -- Feature: Rework of watch list in main window, showing potential now in full color, last selected call in MULTI mode is automatically transferred as selected call for SINGLE mode (tnx GM3SEK) -- Feature: rework of splash window at startup, showing software version now -- Bugfix: Planefinder web feed stopped working --> fixed (tnx F8AIH) -- Feature: New web feed from OpenSky Network implenented (a free community) -- Bugfix: AirScout crashed when the "Info" tab in the "Options" dialog box is opened twice after doing some other stuff --> fixed (tnx G0LGS) - -2020-xx-xx: V1.3.2.0 -==================== - -- Bugfix: Several limitations on Windows XP, program crashes while opening Options Dialog, users cannot save plane feed settings --> fixed (tnx OK1TEH) -- Feature: Users can click on the watchlist markers on the map to change path immediately in SINGLE mode (tnx GM4JTJ) -- Feature: Change font size in charts via "Options/Map" (tnx LZ2ZP) -- Bugfix: Radio Horizon shows an unwanted strike through in Cartesian diagram --> fixed (tnx LZ2ZP) -- Feature: Redirect console output, users can run AirScout from a command line and see all console output for debugging (like on Linux) -- Bugfix: Watchlist was not properly sorted when synchronized with wtKST --> fixed -- Bugfix: "Orphan paths" when watchlist synchronized with wtKST and user leaves the chat --> fixed, call is kept on watchlist now as long as it is selected +Initial Version diff --git a/AirScout/WatchlistDlg.Designer.cs b/AirScout/WatchlistDlg.Designer.cs index 18b8092..a8beef6 100644 --- a/AirScout/WatchlistDlg.Designer.cs +++ b/AirScout/WatchlistDlg.Designer.cs @@ -29,8 +29,8 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); this.ss_Watchlist_Main = new System.Windows.Forms.StatusStrip(); this.tsl_Watchlist_Main = new System.Windows.Forms.ToolStripStatusLabel(); this.btn_Watchlist_Add = new System.Windows.Forms.Button(); @@ -109,7 +109,7 @@ // btn_Watchlist_Cancel // this.btn_Watchlist_Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btn_Watchlist_Cancel.Location = new System.Drawing.Point(147, 402); + this.btn_Watchlist_Cancel.Location = new System.Drawing.Point(245, 402); this.btn_Watchlist_Cancel.Name = "btn_Watchlist_Cancel"; this.btn_Watchlist_Cancel.Size = new System.Drawing.Size(75, 23); this.btn_Watchlist_Cancel.TabIndex = 8; @@ -120,7 +120,7 @@ // this.btn_Watchlist_OK.DialogResult = System.Windows.Forms.DialogResult.OK; this.btn_Watchlist_OK.Enabled = false; - this.btn_Watchlist_OK.Location = new System.Drawing.Point(237, 402); + this.btn_Watchlist_OK.Location = new System.Drawing.Point(153, 402); this.btn_Watchlist_OK.Name = "btn_Watchlist_OK"; this.btn_Watchlist_OK.Size = new System.Drawing.Size(75, 23); this.btn_Watchlist_OK.TabIndex = 9; @@ -174,17 +174,18 @@ this.dgv_Watchlist_Callsigns.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dgv_Watchlist_Callsigns.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; this.dgv_Watchlist_Callsigns.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle3.Font = new System.Drawing.Font("Courier New", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dgv_Watchlist_Callsigns.DefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle1.Font = new System.Drawing.Font("Courier New", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgv_Watchlist_Callsigns.DefaultCellStyle = dataGridViewCellStyle1; this.dgv_Watchlist_Callsigns.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; this.dgv_Watchlist_Callsigns.Location = new System.Drawing.Point(15, 101); this.dgv_Watchlist_Callsigns.Name = "dgv_Watchlist_Callsigns"; + this.dgv_Watchlist_Callsigns.ReadOnly = true; this.dgv_Watchlist_Callsigns.RowHeadersVisible = false; this.dgv_Watchlist_Callsigns.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.dgv_Watchlist_Callsigns.Size = new System.Drawing.Size(180, 280); @@ -201,14 +202,14 @@ this.dgv_Watchlist_Selected.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dgv_Watchlist_Selected.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; this.dgv_Watchlist_Selected.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle4.Font = new System.Drawing.Font("Courier New", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dgv_Watchlist_Selected.DefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle2.Font = new System.Drawing.Font("Courier New", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgv_Watchlist_Selected.DefaultCellStyle = dataGridViewCellStyle2; this.dgv_Watchlist_Selected.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; this.dgv_Watchlist_Selected.Location = new System.Drawing.Point(288, 101); this.dgv_Watchlist_Selected.Name = "dgv_Watchlist_Selected"; @@ -261,6 +262,9 @@ this.Controls.Add(this.btn_Watchlist_Remove); this.Controls.Add(this.btn_Watchlist_Add); this.Controls.Add(this.ss_Watchlist_Main); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; this.Name = "WatchlistDlg"; this.Text = "Manage Watchlist"; this.Load += new System.EventHandler(this.WatchlistDlg_Load); diff --git a/AirScout/WatchlistDlg.resx b/AirScout/WatchlistDlg.resx index 0090a6e..2972473 100644 --- a/AirScout/WatchlistDlg.resx +++ b/AirScout/WatchlistDlg.resx @@ -123,9 +123,6 @@ 167, 17 - - 167, 17 - 315, 17 diff --git a/AirScout/app.config b/AirScout/app.config index 18903a8..59f0756 100644 --- a/AirScout/app.config +++ b/AirScout/app.config @@ -521,7 +521,7 @@ MEaSUREs data and products are available at no charge from the LP DAAC.See https False - + 10 @@ -588,6 +588,21 @@ MEaSUREs data and products are available at no charge from the LP DAAC.See https 6 + + True + + + 1970-01-01 + + + False + + + 0 + + + 11 + @@ -606,7 +621,6 @@ MEaSUREs data and products are available at no charge from the LP DAAC.See https - diff --git a/AirScout/packages.config b/AirScout/packages.config index 8d45aee..79fcfe6 100644 --- a/AirScout/packages.config +++ b/AirScout/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/AirScoutDatabaseManager/AirScoutDatabaseManager.csproj b/AirScoutDatabaseManager/AirScoutDatabaseManager.csproj index 607a4d2..13d61e8 100644 --- a/AirScoutDatabaseManager/AirScoutDatabaseManager.csproj +++ b/AirScoutDatabaseManager/AirScoutDatabaseManager.csproj @@ -74,8 +74,7 @@ True - ..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll ..\packages\SSH.NET.2016.1.0\lib\net40\Renci.SshNet.dll diff --git a/AirScoutDatabaseManager/packages.config b/AirScoutDatabaseManager/packages.config index f9a6c9b..bd583a5 100644 --- a/AirScoutDatabaseManager/packages.config +++ b/AirScoutDatabaseManager/packages.config @@ -1,7 +1,7 @@  - + \ No newline at end of file diff --git a/AirScoutPlaneServer/AirScoutPlaneServer.csproj b/AirScoutPlaneServer/AirScoutPlaneServer.csproj index 00e48c0..9344b18 100644 --- a/AirScoutPlaneServer/AirScoutPlaneServer.csproj +++ b/AirScoutPlaneServer/AirScoutPlaneServer.csproj @@ -63,8 +63,7 @@ - ..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/AirScoutPlaneServer/packages.config b/AirScoutPlaneServer/packages.config index 2f3d055..ae88648 100644 --- a/AirScoutPlaneServer/packages.config +++ b/AirScoutPlaneServer/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/AirScoutViewClient/AirScoutViewClient.csproj b/AirScoutViewClient/AirScoutViewClient.csproj index 6bdda70..77312ec 100644 --- a/AirScoutViewClient/AirScoutViewClient.csproj +++ b/AirScoutViewClient/AirScoutViewClient.csproj @@ -35,8 +35,7 @@ - ..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/AirScoutViewClient/packages.config b/AirScoutViewClient/packages.config index 0bbf652..2bc3b5b 100644 --- a/AirScoutViewClient/packages.config +++ b/AirScoutViewClient/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/AquaGauge/AquaGauge.csproj b/AquaGauge/AquaGauge.csproj index e78615e..16c1924 100644 --- a/AquaGauge/AquaGauge.csproj +++ b/AquaGauge/AquaGauge.csproj @@ -38,8 +38,7 @@ - ..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/AquaGauge/packages.config b/AquaGauge/packages.config index 0bbf652..2bc3b5b 100644 --- a/AquaGauge/packages.config +++ b/AquaGauge/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/CubicSpline/CubicSpline/CubicSpline.csproj b/CubicSpline/CubicSpline/CubicSpline.csproj index fb06dcd..631a1fa 100644 --- a/CubicSpline/CubicSpline/CubicSpline.csproj +++ b/CubicSpline/CubicSpline/CubicSpline.csproj @@ -34,8 +34,7 @@ - ..\..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/CubicSpline/CubicSpline/packages.config b/CubicSpline/CubicSpline/packages.config index 0bbf652..2bc3b5b 100644 --- a/CubicSpline/CubicSpline/packages.config +++ b/CubicSpline/CubicSpline/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/CustomScrollBar/CustomScrollBar.csproj b/CustomScrollBar/CustomScrollBar.csproj index 131b302..355aec7 100644 --- a/CustomScrollBar/CustomScrollBar.csproj +++ b/CustomScrollBar/CustomScrollBar.csproj @@ -39,8 +39,7 @@ - ..\packages\Newtonsoft.Json.12.0.1\lib\net20\Newtonsoft.Json.dll - True + ..\packages\Newtonsoft.Json.12.0.3\lib\net20\Newtonsoft.Json.dll diff --git a/CustomScrollBar/packages.config b/CustomScrollBar/packages.config index 0f8fe64..fbb9ee2 100644 --- a/CustomScrollBar/packages.config +++ b/CustomScrollBar/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/DotNetZip/Zip/Zip DLL.csproj b/DotNetZip/Zip/Zip DLL.csproj index 81376f5..a22a511 100644 --- a/DotNetZip/Zip/Zip DLL.csproj +++ b/DotNetZip/Zip/Zip DLL.csproj @@ -67,8 +67,7 @@ - ..\..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/DotNetZip/Zip/packages.config b/DotNetZip/Zip/packages.config index 0bbf652..2bc3b5b 100644 --- a/DotNetZip/Zip/packages.config +++ b/DotNetZip/Zip/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/DotNetZip/Zlib/Zlib DLL.csproj b/DotNetZip/Zlib/Zlib DLL.csproj index b9d4f61..efc01ef 100644 --- a/DotNetZip/Zlib/Zlib DLL.csproj +++ b/DotNetZip/Zlib/Zlib DLL.csproj @@ -100,6 +100,9 @@ mscorlib + + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net20\Newtonsoft.Json.dll + System @@ -147,6 +150,7 @@ Ionic.snk + diff --git a/DotNetZip/Zlib/packages.config b/DotNetZip/Zlib/packages.config new file mode 100644 index 0000000..d2c3b9c --- /dev/null +++ b/DotNetZip/Zlib/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ElevationTileGenerator/App.config b/ElevationTileGenerator/App.config index 98a0519..8e89e77 100644 --- a/ElevationTileGenerator/App.config +++ b/ElevationTileGenerator/App.config @@ -19,6 +19,12 @@ False + + + + + + diff --git a/ElevationTileGenerator/ElevationTileGenerator.csproj b/ElevationTileGenerator/ElevationTileGenerator.csproj index 3101e7a..2773430 100644 --- a/ElevationTileGenerator/ElevationTileGenerator.csproj +++ b/ElevationTileGenerator/ElevationTileGenerator.csproj @@ -74,8 +74,7 @@ ..\..\..\ScoutBase\DotNetZip\zip-v1.9\Debug\Ionic.Zip.dll - ..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/ElevationTileGenerator/MainDlg.Designer.cs b/ElevationTileGenerator/MainDlg.Designer.cs index 1a53b52..2cd69b9 100644 --- a/ElevationTileGenerator/MainDlg.Designer.cs +++ b/ElevationTileGenerator/MainDlg.Designer.cs @@ -43,11 +43,37 @@ this.btn_TestCAT = new System.Windows.Forms.Button(); this.btn_CATFromZIP = new System.Windows.Forms.Button(); this.btn_PictureFromTiles = new System.Windows.Forms.Button(); + this.btn_Delete = new System.Windows.Forms.Button(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.btn_Compare = new System.Windows.Forms.Button(); + this.btn_Compare_Tile2 = new System.Windows.Forms.Button(); + this.btn_Compare_Tile1 = new System.Windows.Forms.Button(); + this.tb_Tile2 = new System.Windows.Forms.TextBox(); + this.tb_Tile1 = new System.Windows.Forms.TextBox(); this.tb_DestDir = new System.Windows.Forms.TextBox(); this.tb_SourceDir = new System.Windows.Forms.TextBox(); - this.btn_Delete = new System.Windows.Forms.Button(); + this.tb_Diff = new System.Windows.Forms.TextBox(); + this.btn_ShowDiff = new System.Windows.Forms.Button(); + this.lbl_Diff_Dimensions = new System.Windows.Forms.Label(); + this.lbl_Diff_Min = new System.Windows.Forms.Label(); + this.lbl_Diff_Total = new System.Windows.Forms.Label(); + this.lbl_Diff_Max = new System.Windows.Forms.Label(); + this.tb_Show_Diff = new System.Windows.Forms.TextBox(); + this.lbl_Diff_Voids = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.pb_Diff = new System.Windows.Forms.PictureBox(); + this.label8 = new System.Windows.Forms.Label(); + this.lbl_Diff_Mean = new System.Windows.Forms.Label(); + this.btn_PictureFromZIP = new System.Windows.Forms.Button(); + this.btn_ConvertSRTM1ToSRTM3 = new System.Windows.Forms.Button(); this.ss_Main.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pb_Picture)).BeginInit(); + this.groupBox1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pb_Diff)).BeginInit(); this.SuspendLayout(); // // ss_Main @@ -69,7 +95,7 @@ // // btn_Start // - this.btn_Start.Location = new System.Drawing.Point(640, 478); + this.btn_Start.Location = new System.Drawing.Point(36, 478); this.btn_Start.Name = "btn_Start"; this.btn_Start.Size = new System.Drawing.Size(75, 23); this.btn_Start.TabIndex = 1; @@ -117,7 +143,7 @@ // // btn_Stop // - this.btn_Stop.Location = new System.Drawing.Point(721, 478); + this.btn_Stop.Location = new System.Drawing.Point(117, 478); this.btn_Stop.Name = "btn_Stop"; this.btn_Stop.Size = new System.Drawing.Size(75, 23); this.btn_Stop.TabIndex = 8; @@ -128,17 +154,18 @@ // pb_Picture // this.pb_Picture.BackColor = System.Drawing.SystemColors.AppWorkspace; - this.pb_Picture.Location = new System.Drawing.Point(36, 127); + this.pb_Picture.Location = new System.Drawing.Point(36, 117); this.pb_Picture.Name = "pb_Picture"; this.pb_Picture.Size = new System.Drawing.Size(586, 326); + this.pb_Picture.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pb_Picture.TabIndex = 9; this.pb_Picture.TabStop = false; // // btn_Picture // - this.btn_Picture.Location = new System.Drawing.Point(537, 478); + this.btn_Picture.Location = new System.Drawing.Point(310, 507); this.btn_Picture.Name = "btn_Picture"; - this.btn_Picture.Size = new System.Drawing.Size(75, 23); + this.btn_Picture.Size = new System.Drawing.Size(105, 23); this.btn_Picture.TabIndex = 10; this.btn_Picture.Text = "Picture"; this.btn_Picture.UseVisualStyleBackColor = true; @@ -146,7 +173,7 @@ // // btn_ZIP // - this.btn_ZIP.Location = new System.Drawing.Point(802, 478); + this.btn_ZIP.Location = new System.Drawing.Point(421, 478); this.btn_ZIP.Name = "btn_ZIP"; this.btn_ZIP.Size = new System.Drawing.Size(75, 23); this.btn_ZIP.TabIndex = 11; @@ -156,7 +183,7 @@ // // btn_CAT // - this.btn_CAT.Location = new System.Drawing.Point(883, 478); + this.btn_CAT.Location = new System.Drawing.Point(502, 478); this.btn_CAT.Name = "btn_CAT"; this.btn_CAT.Size = new System.Drawing.Size(75, 23); this.btn_CAT.TabIndex = 12; @@ -166,7 +193,7 @@ // // btn_TestCAT // - this.btn_TestCAT.Location = new System.Drawing.Point(883, 390); + this.btn_TestCAT.Location = new System.Drawing.Point(502, 507); this.btn_TestCAT.Name = "btn_TestCAT"; this.btn_TestCAT.Size = new System.Drawing.Size(75, 23); this.btn_TestCAT.TabIndex = 13; @@ -176,7 +203,7 @@ // // btn_CATFromZIP // - this.btn_CATFromZIP.Location = new System.Drawing.Point(883, 449); + this.btn_CATFromZIP.Location = new System.Drawing.Point(502, 449); this.btn_CATFromZIP.Name = "btn_CATFromZIP"; this.btn_CATFromZIP.Size = new System.Drawing.Size(75, 23); this.btn_CATFromZIP.TabIndex = 14; @@ -186,14 +213,104 @@ // // btn_PictureFromTiles // - this.btn_PictureFromTiles.Location = new System.Drawing.Point(451, 478); + this.btn_PictureFromTiles.Location = new System.Drawing.Point(310, 478); this.btn_PictureFromTiles.Name = "btn_PictureFromTiles"; - this.btn_PictureFromTiles.Size = new System.Drawing.Size(75, 23); + this.btn_PictureFromTiles.Size = new System.Drawing.Size(105, 23); this.btn_PictureFromTiles.TabIndex = 15; - this.btn_PictureFromTiles.Text = "Pic fm Tiles"; + this.btn_PictureFromTiles.Text = "Pic fm Loc-Tiles"; this.btn_PictureFromTiles.UseVisualStyleBackColor = true; this.btn_PictureFromTiles.Click += new System.EventHandler(this.btn_PictureFromTiles_Click); // + // btn_Delete + // + this.btn_Delete.Location = new System.Drawing.Point(229, 478); + this.btn_Delete.Name = "btn_Delete"; + this.btn_Delete.Size = new System.Drawing.Size(75, 23); + this.btn_Delete.TabIndex = 16; + this.btn_Delete.Text = "Delete"; + this.btn_Delete.UseVisualStyleBackColor = true; + this.btn_Delete.Click += new System.EventHandler(this.btn_Delete_Click); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.label8); + this.groupBox1.Controls.Add(this.lbl_Diff_Mean); + this.groupBox1.Controls.Add(this.pb_Diff); + this.groupBox1.Controls.Add(this.label7); + this.groupBox1.Controls.Add(this.label6); + this.groupBox1.Controls.Add(this.label5); + this.groupBox1.Controls.Add(this.label4); + this.groupBox1.Controls.Add(this.label3); + this.groupBox1.Controls.Add(this.lbl_Diff_Voids); + this.groupBox1.Controls.Add(this.tb_Show_Diff); + this.groupBox1.Controls.Add(this.lbl_Diff_Max); + this.groupBox1.Controls.Add(this.lbl_Diff_Total); + this.groupBox1.Controls.Add(this.lbl_Diff_Min); + this.groupBox1.Controls.Add(this.lbl_Diff_Dimensions); + this.groupBox1.Controls.Add(this.btn_ShowDiff); + this.groupBox1.Controls.Add(this.tb_Diff); + this.groupBox1.Controls.Add(this.btn_Compare); + this.groupBox1.Controls.Add(this.btn_Compare_Tile2); + this.groupBox1.Controls.Add(this.btn_Compare_Tile1); + this.groupBox1.Controls.Add(this.tb_Tile2); + this.groupBox1.Controls.Add(this.tb_Tile1); + this.groupBox1.Location = new System.Drawing.Point(671, 12); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(318, 431); + this.groupBox1.TabIndex = 17; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "TileCompare"; + // + // btn_Compare + // + this.btn_Compare.Location = new System.Drawing.Point(243, 76); + this.btn_Compare.Name = "btn_Compare"; + this.btn_Compare.Size = new System.Drawing.Size(69, 23); + this.btn_Compare.TabIndex = 19; + this.btn_Compare.Text = "Compare"; + this.btn_Compare.UseVisualStyleBackColor = true; + this.btn_Compare.Click += new System.EventHandler(this.btn_Compare_Click); + // + // btn_Compare_Tile2 + // + this.btn_Compare_Tile2.Location = new System.Drawing.Point(243, 47); + this.btn_Compare_Tile2.Name = "btn_Compare_Tile2"; + this.btn_Compare_Tile2.Size = new System.Drawing.Size(69, 23); + this.btn_Compare_Tile2.TabIndex = 18; + this.btn_Compare_Tile2.Text = "Select"; + this.btn_Compare_Tile2.UseVisualStyleBackColor = true; + this.btn_Compare_Tile2.Click += new System.EventHandler(this.btn_Compare_Tile2_Click); + // + // btn_Compare_Tile1 + // + this.btn_Compare_Tile1.Location = new System.Drawing.Point(243, 18); + this.btn_Compare_Tile1.Name = "btn_Compare_Tile1"; + this.btn_Compare_Tile1.Size = new System.Drawing.Size(69, 23); + this.btn_Compare_Tile1.TabIndex = 17; + this.btn_Compare_Tile1.Text = "Select"; + this.btn_Compare_Tile1.UseVisualStyleBackColor = true; + this.btn_Compare_Tile1.Click += new System.EventHandler(this.btn_Compare_Tile1_Click); + // + // tb_Tile2 + // + this.tb_Tile2.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::ElevationTileGenerator.Properties.Settings.Default, "Tile2", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.tb_Tile2.Location = new System.Drawing.Point(7, 49); + this.tb_Tile2.Name = "tb_Tile2"; + this.tb_Tile2.ReadOnly = true; + this.tb_Tile2.Size = new System.Drawing.Size(230, 20); + this.tb_Tile2.TabIndex = 1; + this.tb_Tile2.Text = global::ElevationTileGenerator.Properties.Settings.Default.Tile2; + // + // tb_Tile1 + // + this.tb_Tile1.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::ElevationTileGenerator.Properties.Settings.Default, "Tile1", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.tb_Tile1.Location = new System.Drawing.Point(7, 20); + this.tb_Tile1.Name = "tb_Tile1"; + this.tb_Tile1.ReadOnly = true; + this.tb_Tile1.Size = new System.Drawing.Size(230, 20); + this.tb_Tile1.TabIndex = 0; + this.tb_Tile1.Text = global::ElevationTileGenerator.Properties.Settings.Default.Tile1; + // // tb_DestDir // this.tb_DestDir.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::ElevationTileGenerator.Properties.Settings.Default, "DestDir", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); @@ -212,21 +329,178 @@ this.tb_SourceDir.TabIndex = 3; this.tb_SourceDir.Text = global::ElevationTileGenerator.Properties.Settings.Default.SourceDir; // - // btn_Delete + // tb_Diff // - this.btn_Delete.Location = new System.Drawing.Point(640, 449); - this.btn_Delete.Name = "btn_Delete"; - this.btn_Delete.Size = new System.Drawing.Size(75, 23); - this.btn_Delete.TabIndex = 16; - this.btn_Delete.Text = "Delete"; - this.btn_Delete.UseVisualStyleBackColor = true; - this.btn_Delete.Click += new System.EventHandler(this.btn_Delete_Click); + this.tb_Diff.Location = new System.Drawing.Point(7, 78); + this.tb_Diff.Name = "tb_Diff"; + this.tb_Diff.ReadOnly = true; + this.tb_Diff.Size = new System.Drawing.Size(230, 20); + this.tb_Diff.TabIndex = 20; + // + // btn_ShowDiff + // + this.btn_ShowDiff.Location = new System.Drawing.Point(243, 105); + this.btn_ShowDiff.Name = "btn_ShowDiff"; + this.btn_ShowDiff.Size = new System.Drawing.Size(69, 23); + this.btn_ShowDiff.TabIndex = 21; + this.btn_ShowDiff.Text = "Show Diff"; + this.btn_ShowDiff.UseVisualStyleBackColor = true; + this.btn_ShowDiff.Click += new System.EventHandler(this.btn_ShowDiff_Click); + // + // lbl_Diff_Dimensions + // + this.lbl_Diff_Dimensions.AutoSize = true; + this.lbl_Diff_Dimensions.Location = new System.Drawing.Point(176, 140); + this.lbl_Diff_Dimensions.Name = "lbl_Diff_Dimensions"; + this.lbl_Diff_Dimensions.Size = new System.Drawing.Size(22, 13); + this.lbl_Diff_Dimensions.TabIndex = 22; + this.lbl_Diff_Dimensions.Text = "xxx"; + // + // lbl_Diff_Min + // + this.lbl_Diff_Min.AutoSize = true; + this.lbl_Diff_Min.Location = new System.Drawing.Point(176, 192); + this.lbl_Diff_Min.Name = "lbl_Diff_Min"; + this.lbl_Diff_Min.Size = new System.Drawing.Size(22, 13); + this.lbl_Diff_Min.TabIndex = 23; + this.lbl_Diff_Min.Text = "xxx"; + // + // lbl_Diff_Total + // + this.lbl_Diff_Total.AutoSize = true; + this.lbl_Diff_Total.Location = new System.Drawing.Point(176, 157); + this.lbl_Diff_Total.Name = "lbl_Diff_Total"; + this.lbl_Diff_Total.Size = new System.Drawing.Size(22, 13); + this.lbl_Diff_Total.TabIndex = 24; + this.lbl_Diff_Total.Text = "xxx"; + // + // lbl_Diff_Max + // + this.lbl_Diff_Max.AutoSize = true; + this.lbl_Diff_Max.Location = new System.Drawing.Point(174, 208); + this.lbl_Diff_Max.Name = "lbl_Diff_Max"; + this.lbl_Diff_Max.Size = new System.Drawing.Size(22, 13); + this.lbl_Diff_Max.TabIndex = 25; + this.lbl_Diff_Max.Text = "xxx"; + // + // tb_Show_Diff + // + this.tb_Show_Diff.Location = new System.Drawing.Point(7, 107); + this.tb_Show_Diff.Name = "tb_Show_Diff"; + this.tb_Show_Diff.ReadOnly = true; + this.tb_Show_Diff.Size = new System.Drawing.Size(230, 20); + this.tb_Show_Diff.TabIndex = 26; + // + // lbl_Diff_Voids + // + this.lbl_Diff_Voids.AutoSize = true; + this.lbl_Diff_Voids.Location = new System.Drawing.Point(176, 175); + this.lbl_Diff_Voids.Name = "lbl_Diff_Voids"; + this.lbl_Diff_Voids.Size = new System.Drawing.Size(22, 13); + this.lbl_Diff_Voids.TabIndex = 27; + this.lbl_Diff_Voids.Text = "xxx"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(9, 140); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(64, 13); + this.label3.TabIndex = 28; + this.label3.Text = "Dimensions:"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(9, 157); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(89, 13); + this.label4.TabIndex = 29; + this.label4.Text = "Total differences:"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(9, 175); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(62, 13); + this.label5.TabIndex = 30; + this.label5.Text = "Total voids:"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(11, 192); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(101, 13); + this.label6.TabIndex = 31; + this.label6.Text = "Minimum difference:"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(11, 208); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(104, 13); + this.label7.TabIndex = 32; + this.label7.Text = "Maximum difference:"; + // + // pb_Diff + // + this.pb_Diff.BackColor = System.Drawing.SystemColors.AppWorkspace; + this.pb_Diff.Location = new System.Drawing.Point(15, 260); + this.pb_Diff.Name = "pb_Diff"; + this.pb_Diff.Size = new System.Drawing.Size(181, 163); + this.pb_Diff.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pb_Diff.TabIndex = 33; + this.pb_Diff.TabStop = false; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(12, 225); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(87, 13); + this.label8.TabIndex = 35; + this.label8.Text = "Mean difference:"; + // + // lbl_Diff_Mean + // + this.lbl_Diff_Mean.AutoSize = true; + this.lbl_Diff_Mean.Location = new System.Drawing.Point(175, 225); + this.lbl_Diff_Mean.Name = "lbl_Diff_Mean"; + this.lbl_Diff_Mean.Size = new System.Drawing.Size(22, 13); + this.lbl_Diff_Mean.TabIndex = 34; + this.lbl_Diff_Mean.Text = "xxx"; + // + // btn_PictureFromZIP + // + this.btn_PictureFromZIP.Location = new System.Drawing.Point(310, 449); + this.btn_PictureFromZIP.Name = "btn_PictureFromZIP"; + this.btn_PictureFromZIP.Size = new System.Drawing.Size(105, 23); + this.btn_PictureFromZIP.TabIndex = 18; + this.btn_PictureFromZIP.Text = "Pic fm ZIP"; + this.btn_PictureFromZIP.UseVisualStyleBackColor = true; + this.btn_PictureFromZIP.Click += new System.EventHandler(this.btn_PictureFromZIP_Click); + // + // btn_ConvertSRTM1ToSRTM3 + // + this.btn_ConvertSRTM1ToSRTM3.Location = new System.Drawing.Point(36, 508); + this.btn_ConvertSRTM1ToSRTM3.Name = "btn_ConvertSRTM1ToSRTM3"; + this.btn_ConvertSRTM1ToSRTM3.Size = new System.Drawing.Size(153, 23); + this.btn_ConvertSRTM1ToSRTM3.TabIndex = 19; + this.btn_ConvertSRTM1ToSRTM3.Text = "Convert SRTM1 to SRTM3"; + this.btn_ConvertSRTM1ToSRTM3.UseVisualStyleBackColor = true; + this.btn_ConvertSRTM1ToSRTM3.Click += new System.EventHandler(this.btn_ConvertSRTM1ToSRTM3_Click); // // MainDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1001, 556); + this.Controls.Add(this.btn_ConvertSRTM1ToSRTM3); + this.Controls.Add(this.btn_PictureFromZIP); + this.Controls.Add(this.groupBox1); this.Controls.Add(this.btn_Delete); this.Controls.Add(this.btn_PictureFromTiles); this.Controls.Add(this.btn_CATFromZIP); @@ -251,6 +525,9 @@ this.ss_Main.ResumeLayout(false); this.ss_Main.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.pb_Picture)).EndInit(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pb_Diff)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -276,6 +553,30 @@ private System.Windows.Forms.Button btn_CATFromZIP; private System.Windows.Forms.Button btn_PictureFromTiles; private System.Windows.Forms.Button btn_Delete; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Button btn_Compare_Tile2; + private System.Windows.Forms.Button btn_Compare_Tile1; + private System.Windows.Forms.TextBox tb_Tile2; + private System.Windows.Forms.TextBox tb_Tile1; + private System.Windows.Forms.Button btn_Compare; + private System.Windows.Forms.TextBox tb_Diff; + private System.Windows.Forms.Label lbl_Diff_Dimensions; + private System.Windows.Forms.Button btn_ShowDiff; + private System.Windows.Forms.Label lbl_Diff_Max; + private System.Windows.Forms.Label lbl_Diff_Total; + private System.Windows.Forms.Label lbl_Diff_Min; + private System.Windows.Forms.TextBox tb_Show_Diff; + private System.Windows.Forms.Label lbl_Diff_Voids; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.PictureBox pb_Diff; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label lbl_Diff_Mean; + private System.Windows.Forms.Button btn_PictureFromZIP; + private System.Windows.Forms.Button btn_ConvertSRTM1ToSRTM3; } } diff --git a/ElevationTileGenerator/MainDlg.cs b/ElevationTileGenerator/MainDlg.cs index b927063..423e6be 100644 --- a/ElevationTileGenerator/MainDlg.cs +++ b/ElevationTileGenerator/MainDlg.cs @@ -24,6 +24,9 @@ namespace ElevationTileGenerator { DataTableSRTM3 srtm3 = new DataTableSRTM3(); + List Files1 = new List(); + List Files2 = new List(); + ElevationCatalogue Tiles = new ElevationCatalogue(); public MainDlg() @@ -33,7 +36,32 @@ namespace ElevationTileGenerator private void MainDlg_Load(object sender, EventArgs e) { -// string[] a = ElevationModel.Database.GetLocsFromRect(50, 0, 51, 2); + // string[] a = ElevationModel.Database.GetLocsFromRect(50, 0, 51, 2); + // fill compare files catalogues + if (!String.IsNullOrEmpty(tb_Tile1.Text)) + { + // check for multiple files + if (tb_Tile1.Text.Contains(";")) + { + string[] a = tb_Tile1.Text.Split(';'); + foreach (string file in a) + Files1.Add(file); + } + else + Files1.Add(tb_Tile1.Text); + } + if (!String.IsNullOrEmpty(tb_Tile2.Text)) + { + // check for multiple files + if (tb_Tile2.Text.Contains(";")) + { + string[] a = tb_Tile2.Text.Split(';'); + foreach (string file in a) + Files2.Add(file); + } + else + Files2.Add(tb_Tile2.Text); + } } private void btn_Start_Click(object sender, EventArgs e) @@ -780,6 +808,41 @@ namespace ElevationTileGenerator CATFromZIP(); } + private void PictureFromTiles(string[] files, bool createTIFFromTiles = false) + { + Bitmap bm = null; + foreach (string file in files) + { + tsl_Status.Text = "Processing " + Path.GetFileName(file) + "..."; + Application.DoEvents(); + using (StreamReader sr = new StreamReader(File.OpenRead(file))) + { + string json = sr.ReadToEnd(); + ElevationTileDesignator tile = ElevationTileDesignator.FromJSON(json); + // create bitmap if not created + if (bm == null) + { + bm = new Bitmap(tile.Columns * 24, tile.Rows * 24); + } + Bitmap bt = tile.ToBitmap(); + if (createTIFFromTiles) + bt.Save(file.Replace(".loc",".tif"), System.Drawing.Imaging.ImageFormat.Tiff); + int col = (int)(tile.TileIndex[4] - 'A') * tile.Columns; + int row = (int)(tile.TileIndex[5] - 'A') * tile.Rows; + for (int i = 0; i < tile.Columns; i++) + { + for (int j = 0; j < tile.Rows; j++) + { + bm.SetPixel(col + i, bm.Height - row - bt.Height + j, bt.GetPixel(i, j)); + } + } + pb_Picture.Image = bm; + } + } + if (bm != null) + bm.Save("ElevationTiles.tif", System.Drawing.Imaging.ImageFormat.Tiff); + } + private void btn_PictureFromTiles_Click(object sender, EventArgs e) { FolderBrowserDialog Dlg = new FolderBrowserDialog(); @@ -787,38 +850,6 @@ namespace ElevationTileGenerator if (Dlg.ShowDialog() == DialogResult.OK) { string[] files = Directory.GetFiles(Dlg.SelectedPath, "*.loc"); - Bitmap bm = null; - double baselat, baselon; - string dir = Directory.GetParent(Dlg.SelectedPath).Name + Dlg.SelectedPath.Substring(Dlg.SelectedPath.LastIndexOf('\\')).Replace("\\", ""); - MaidenheadLocator.LatLonFromLoc(dir, PositionInRectangle.BottomLeft, out baselat, out baselon); - foreach (string file in files) - { - tsl_Status.Text = "Processing " + Path.GetFileName(file) + "..."; - Application.DoEvents(); - using (StreamReader sr = new StreamReader(File.OpenRead(file))) - { - string json = sr.ReadToEnd(); - ElevationTileDesignator tile = ElevationTileDesignator.FromJSON(json); - // create bitmap if not created - if (bm == null) - { - bm = new Bitmap(tile.Columns * 24, tile.Rows * 24); - } - Bitmap bt = tile.ToBitmap(); - // bt.Save(Path.Combine(Dlg.SelectedPath, tile.TileIndex) + ".tif", System.Drawing.Imaging.ImageFormat.Tiff); - int col = (int)(tile.TileIndex[4] - 'A') * tile.Columns; - int row = (int)(tile.TileIndex[5] - 'A') * tile.Rows; - for (int i = 0; i < tile.Columns; i++) - { - for (int j = 0; j < tile.Rows; j++) - { - bm.SetPixel(col + i, bm.Height - row - bt.Height + j, bt.GetPixel(i, j)); - } - } - } - } - if (bm != null) - bm.Save("ElevationTiles.tif", System.Drawing.Imaging.ImageFormat.Tiff); } } @@ -857,6 +888,429 @@ namespace ElevationTileGenerator { Delete(); } + + private void Say(string txt) + { + if (tsl_Status.Text != txt) + { + tsl_Status.Text = txt; + this.Refresh(); + Application.DoEvents(); + } + } + + private void btn_Compare_Tile1_Click(object sender, EventArgs e) + { + OpenFileDialog Dlg = new OpenFileDialog(); + Dlg.CheckFileExists = true; + Dlg.Multiselect = true; + Dlg.Filter = "Elevation Files (*.hgt)|*.hgt|Zipped Elevation Files (*.zip)|*.zip"; + if (Dlg.ShowDialog() == DialogResult.OK) + { + Files1.Clear(); + if (Dlg.FileNames.Length > 1) + { + // multiple files selected + tb_Tile1.Text = string.Join(";", Dlg.FileNames); + } + else + { + // unzip if zip file selected + if (Path.GetExtension(Dlg.FileName) == ".zip") + { + // create ZIP file and add all loc files + ZipFile zip = new ZipFile(Dlg.FileName); + foreach (string filename in zip.EntryFileNames) + { + Files1.Add(Path.Combine(Path.GetTempPath(), "Files1", filename)); + } + zip.ExtractAll(Path.Combine(Path.GetTempPath(), "Files1"), ExtractExistingFileAction.OverwriteSilently); + bool filemissing; + do + { + filemissing = false; + foreach (String filename in Files1) + { + if (!File.Exists(filename)) + { + Application.DoEvents(); + filemissing = true; + break; + } + } + Thread.Sleep(1000); + } + while (filemissing); + } + else + { + tb_Tile1.Text = Dlg.FileName; + Files1.Add(Dlg.FileName); + } + } + } + Properties.Settings.Default.Save(); + } + + private void btn_Compare_Tile2_Click(object sender, EventArgs e) + { + OpenFileDialog Dlg = new OpenFileDialog(); + Dlg.CheckFileExists = true; + Dlg.Multiselect = true; + Dlg.Filter = "Elevation Files (*.hgt)|*.hgt|Zipped Elevation Files (*.zip)|*.zip"; + if (Dlg.ShowDialog() == DialogResult.OK) + { + Files2.Clear(); + if (Dlg.FileNames.Length > 1) + { + // multiple files selected + tb_Tile2.Text = string.Join(";", Dlg.FileNames); + } + else + { + // unzip if zip file selected + if (Path.GetExtension(Dlg.FileName) == ".zip") + { + // create ZIP file and add all loc files + ZipFile zip = new ZipFile(Dlg.FileName); + foreach (string filename in zip.EntryFileNames) + { + Files2.Add(Path.Combine(Path.GetTempPath(), "Files2", filename)); + } + zip.ExtractAll(Path.Combine(Path.GetTempPath(), "Files2"), ExtractExistingFileAction.OverwriteSilently); + bool filemissing; + do + { + filemissing = false; + foreach (String filename in Files2) + { + if (!File.Exists(filename)) + { + Application.DoEvents(); + filemissing = true; + break; + } + } + Thread.Sleep(1000); + } + while (filemissing); + } + else + { + tb_Tile2.Text = Dlg.FileName; + Files2.Add(Dlg.FileName); + } + } + } + Properties.Settings.Default.Save(); + } + + private string FindinFiles2(string filename1) + { + foreach(string filename2 in Files2) + { + if (Path.GetFileName(filename1) == Path.GetFileName(filename2)) + return filename2; + } + return ""; + } + + public Bitmap DrawElevationBitmapHGT(string filename) + { + int minelv = 0; + int maxelv = 0; + long length = new System.IO.FileInfo(filename).Length / 2; + // calculate bitmap dimensions + // get the x/y ratio first + int width = (int)Math.Sqrt(length); + int height = width; + short[,] elv = new short[width,height]; + long diff = 0; + long voids = 0; + long count = 0; + long sum = 0; + using (var filestream = File.Open(filename, FileMode.Open)) + using (var binaryStream = new BinaryReader(filestream)) + { + for (int i = 0; i < width; i++) + { + for (int j = 0; j < height; j++) + { + elv[i, j] = binaryStream.ReadInt16(); + if (elv[i, j] != 0) + diff++; + if (elv[i, j] == -512) + voids++; + if (elv[i, j] < minelv) + minelv = elv[i, j]; + if (elv[i, j] > maxelv) + maxelv = elv[i, j]; + count++; + if (count % 100000 == 0) + Say("Processing " + count.ToString() + " of " + length.ToString() + " points"); + } + } + } + long[] d = new long[maxelv - minelv + 1]; + for (int i = 0; i < d.Length; i++) + d[i] = 0; + DEMColorPalette palette = new DEMColorPalette(); + Bitmap bm = new Bitmap(width, height); + for (int i = 0; i < width; i++) + { + // System.Console.WriteLine(i); + for (int j = 0; j < height; j++) + { + double e = (double)(elv[i,j] - minelv) / (double)(maxelv - minelv) * 100.0; + if (e < 0) + e = 0; + if (e > 100) + e = 100; + // count occurence of difference in an array + d[elv[i,j] - minelv]++; + sum += elv[i, j]; + bm.SetPixel(i, height - j - 1, palette.GetColor(e)); + } + } + using (StreamWriter sw = new StreamWriter("ElevationDifference.csv")) + { + sw.WriteLine("Difference[m];Count"); + for (int i = 0; i < d.Length; i++) + { + sw.WriteLine((i + minelv).ToString() + ";" + d[i].ToString()); + } + } + lbl_Diff_Dimensions.Text = width.ToString() + "x" + height.ToString(); + lbl_Diff_Total.Text = diff.ToString(); + lbl_Diff_Voids.Text = voids.ToString(); + lbl_Diff_Min.Text = minelv.ToString(); + lbl_Diff_Max.Text = maxelv.ToString(); + lbl_Diff_Mean.Text = (sum / length).ToString("F2"); + return bm; + } + + private string CompareFilesHGT(string filename1, string filename2) + { + string difffilename = Path.Combine(Application.StartupPath, Path.GetFileName(filename1).Replace(".hgt",".hgtdiff")); + long length1 = new System.IO.FileInfo(filename1).Length / 2; + long length2 = new System.IO.FileInfo(filename2).Length / 2; + if (length1 != length2) + { + MessageBox.Show("Cannot compare files with different length: " + filename1 + "<>" + filename2); + return ""; + } + long l = 0; + long diff = 0; + // delete diff file + try + { + File.Delete(difffilename); + FileStream fs1 = File.OpenRead(filename1); + FileStream fs2 = File.OpenRead(filename2); + using (BinaryReader br1 = new BinaryReader(fs1)) + { + using (BinaryReader br2 = new BinaryReader(fs2)) + { + using (BinaryWriter bw = new BinaryWriter(File.Create(difffilename))) + { + while (br1.BaseStream.Position < br1.BaseStream.Length) + { + byte[] b1 = br1.ReadBytes(2); + byte[] b2 = br2.ReadBytes(2); + Array.Reverse(b1); + Array.Reverse(b2); + short e1 = BitConverter.ToInt16(b1, 0); + short e2 = BitConverter.ToInt16(b2, 0); + short e = ElevationData.Database.ElvMissingFlag; + if ((e1 >= -500) && (e2 >= -500)) + { + e = (short)(e1 - e2); + if (e > 1000) + Console.WriteLine("Error at position:" + br1.BaseStream.Position.ToString("0X")); + if (e != 0) + diff++; + } + bw.Write(e); + if (l % 100000 == 0) + { + Say("Comparing point " + l.ToString() + " of " + length1.ToString() + ": " + diff.ToString() + " differences"); + } + l++; + } + } + } + } + } + catch (Exception ex) + { + MessageBox.Show(ex.ToString()); + } + + return difffilename; + } + + private void CompareFiles(string filename1, string filename2) + { + Stopwatch st = new Stopwatch(); + st.Start(); + if (Path.GetExtension(filename1) == ".hgt") + { + string difffilename = CompareFilesHGT(filename1, filename2); + tb_Diff.Text = difffilename; + Bitmap bm = DrawElevationBitmapHGT(difffilename); + pb_Picture.Image = bm; + bm.Save("ElevationDifference.tif", System.Drawing.Imaging.ImageFormat.Tiff); + pb_Picture.Image = bm; + } + st.Stop(); + tsl_Status.Text = "Compare files: " + st.ElapsedMilliseconds.ToString() + "ms."; + this.Refresh(); + } + + private void btn_Compare_Click(object sender, EventArgs e) + { + foreach (string filename1 in Files1) + { + string filename2 = FindinFiles2(filename1); + if (!String.IsNullOrEmpty(filename2)) + { + CompareFiles(filename1, filename2); + } + } + } + + private void btn_ShowDiff_Click(object sender, EventArgs e) + { + OpenFileDialog Dlg = new OpenFileDialog(); + Dlg.CheckFileExists = true; + Dlg.Multiselect = false; + Dlg.Filter = "Elevation Difference Files (*.hgtdiff)|*.hgtdiff"; + if (Dlg.ShowDialog() == DialogResult.OK) + { + tb_Show_Diff.Text = Dlg.FileName; + Bitmap bm = DrawElevationBitmapHGT(tb_Show_Diff.Text); + pb_Diff.Image = bm; + } + Properties.Settings.Default.Save(); + } + + private void btn_PictureFromZIP_Click(object sender, EventArgs e) + { + OpenFileDialog Dlg = new OpenFileDialog(); + Dlg.CheckFileExists = true; + Dlg.Multiselect = false; + Dlg.Filter = "Zipped Elevation Files (*.zip)|*.zip"; + if (Dlg.ShowDialog() == DialogResult.OK) + { + string[] delfiles = Directory.GetFiles(Path.GetTempPath(), "*.loc"); + foreach (string file in delfiles) + { + try + { + File.Delete(file); + } + catch + { + // do nothing + } + } + // unzip if zip file selected + if (Path.GetExtension(Dlg.FileName) == ".zip") + { + // create ZIP file and add all loc files + ZipFile zip = new ZipFile(Dlg.FileName); + zip.ExtractAll(Path.GetTempPath(), ExtractExistingFileAction.OverwriteSilently); + bool filemissing; + do + { + filemissing = false; + foreach (String filename in Files1) + { + if (!File.Exists(filename)) + { + Application.DoEvents(); + filemissing = true; + break; + } + } + Thread.Sleep(1000); + } + while (filemissing); + List files = new List(); + foreach (string file in zip.EntryFileNames) + files.Add(Path.Combine(Path.GetTempPath(), file)); + PictureFromTiles(files.ToArray()); + } + else + { + tb_Tile1.Text = Dlg.FileName; + Files1.Add(Dlg.FileName); + } + } + } + + private short GetSRTM1Elevation(BinaryReader br, int x, int y) + { + int rows = 3601; + int cols = 3601; + long l = (x * cols + y) * 2; + br.BaseStream.Seek(l,0); + byte[] b = br.ReadBytes(2); + Array.Reverse(b); + short e = BitConverter.ToInt16(b, 0); + return e; + } + private void ConvertSRTM1ToSRTM3File(string srtm1file, string srtm3file) + { + Say("Processing " + srtm1file); + using (BinaryReader br = new BinaryReader(File.OpenRead(srtm1file))) + { + using (BinaryWriter bw = new BinaryWriter(File.Create(srtm3file))) + { + short e = 0; + for (int i = 0; i < 1200; i++) + { + for (int j = 0; j < 1200; j++) + { + e = 0; + for (int k = 0; k < 3; k++) + { + for (int l = 0; l < 3; l++) + { + short elv = GetSRTM1Elevation(br, i * 3 + k, j * 3 + l); + e += elv; + } + } + e = (short)(e / 9); + bw.BaseStream.WriteByte((byte)((e >> 8) & 0xFF)); + bw.BaseStream.WriteByte((byte)(e & 0xFF)); + } + // write point #1201 + bw.BaseStream.WriteByte((byte)((e >> 8) & 0xFF)); + bw.BaseStream.WriteByte((byte)(e & 0xFF)); + } + for (int j = 0; j < 1201; j++) + { + e= GetSRTM1Elevation(br, 3600, j * 3); + bw.BaseStream.WriteByte((byte)((e >> 8) & 0xFF)); + bw.BaseStream.WriteByte((byte)(e & 0xFF)); + } + } + } + Say("Ready."); + } + + private void btn_ConvertSRTM1ToSRTM3_Click(object sender, EventArgs e) + { + string[] files = Directory.GetFiles(Properties.Settings.Default.SourceDir, "*.hgt"); + foreach (string srtm1file in files) + { + if (!IsSRTM1File(srtm1file)) + continue; + string srtm3file = Path.Combine(Properties.Settings.Default.DestDir, Path.GetFileName(srtm1file)); + ConvertSRTM1ToSRTM3File(srtm1file, srtm3file); + } + } } [System.ComponentModel.DesignerCategory("")] diff --git a/ElevationTileGenerator/Properties/Settings.Designer.cs b/ElevationTileGenerator/Properties/Settings.Designer.cs index 80b4a93..7e6f4f8 100644 --- a/ElevationTileGenerator/Properties/Settings.Designer.cs +++ b/ElevationTileGenerator/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace ElevationTileGenerator.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); @@ -58,5 +58,29 @@ namespace ElevationTileGenerator.Properties { this["Overwrite"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string Tile1 { + get { + return ((string)(this["Tile1"])); + } + set { + this["Tile1"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string Tile2 { + get { + return ((string)(this["Tile2"])); + } + set { + this["Tile2"] = value; + } + } } } diff --git a/ElevationTileGenerator/Properties/Settings.settings b/ElevationTileGenerator/Properties/Settings.settings index c86beba..26b60c8 100644 --- a/ElevationTileGenerator/Properties/Settings.settings +++ b/ElevationTileGenerator/Properties/Settings.settings @@ -11,5 +11,11 @@ False + + + + + + \ No newline at end of file diff --git a/ElevationTileGenerator/packages.config b/ElevationTileGenerator/packages.config index 0bbf652..2bc3b5b 100644 --- a/ElevationTileGenerator/packages.config +++ b/ElevationTileGenerator/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/GreatMaps/.hg_archival.txt b/GreatMaps/.hg_archival.txt deleted file mode 100644 index 179c922..0000000 --- a/GreatMaps/.hg_archival.txt +++ /dev/null @@ -1,5 +0,0 @@ -repo: 4535e32c8607b09918d4b3415247cd7063d4a1a1 -node: 871ebb856b1d3bc515193fc75393ad3e12b29905 -branch: default -latesttag: 1.6 -latesttagdistance: 112 diff --git a/GreatMaps/.hgtags b/GreatMaps/.hgtags deleted file mode 100644 index 623b4e1..0000000 --- a/GreatMaps/.hgtags +++ /dev/null @@ -1,24 +0,0 @@ -a41a181da72e4724a7e3442ed6260f174a47e639 1.5 beta -a41a181da72e4724a7e3442ed6260f174a47e639 1.5.0.1 -a41a181da72e4724a7e3442ed6260f174a47e639 1.5.0.1 -0000000000000000000000000000000000000000 1.5.0.1 -0000000000000000000000000000000000000000 1.5.0.1 -d7c8a823dcfa8320d90e26490ef0df894d07beec 1.5.0.1 -d7c8a823dcfa8320d90e26490ef0df894d07beec 1.5.0.1 -0000000000000000000000000000000000000000 1.5.0.1 -0000000000000000000000000000000000000000 1.5.0.1 -9283af54b20b47c60ec16730c449468047a773d0 1.5.0.1 -2b589a98ebb5da85bd4df8ea97a05dce10065376 1.5.1.1 -5aa1baf7897fbe83ffc414f83daad717eeb7073a 1.5.1.2 -2d0d554965044e588be7963c76f1ae01beaab029 1.5.1.3 -2d0d554965044e588be7963c76f1ae01beaab029 1.5.1.3 -0000000000000000000000000000000000000000 1.5.1.3 -0000000000000000000000000000000000000000 1.5.1.3 -940011f42d467102e820969c952fa78525724c45 1.5.1.3 -940011f42d467102e820969c952fa78525724c45 1.5.1.3 -0000000000000000000000000000000000000000 1.5.1.3 -258a79e50af78a6586292b98ba7925144d493d32 1.5.3.1 -3eb3a2e66d886e999ee6e39c747896df9cb47de3 1.5.3.2 -4dd6c1c7428b74731d67e713f023f9714a45a369 1.5.3.3 -32f7138ff593910cf788e8c9dd766716e8340042 1.5.5.5 -dbfffa5b4adced279df1e089a153b51dbbc34d92 1.6 diff --git a/GreatMaps/GMap.NET vs10.sln b/GreatMaps/GMap.NET vs10.sln deleted file mode 100644 index cce9f3a..0000000 --- a/GreatMaps/GMap.NET vs10.sln +++ /dev/null @@ -1,105 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GMap.NET", "GMap.NET", "{775C3C1A-44D3-41F4-9FC6-F83E39D3ABB8}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Demo", "Demo", "{4071E6E4-D401-4EF2-94B0-6F5257088116}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Testing", "Testing", "{A24009F2-84ED-4F0A-BC1C-8B05F474986A}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Info", "Info", "{9EB13FA2-ADB7-4C90-A6DA-18EDFE256273}" - ProjectSection(SolutionItems) = preProject - Info\google maps.pdf = Info\google maps.pdf - Info\License.txt = Info\License.txt - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo.WindowsForms", "Demo.WindowsForms\Demo.WindowsForms.csproj", "{A2E07A76-8B2C-41A2-B23E-EA31AE94D706}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo.WindowsPresentation", "Demo.WindowsPresentation\Demo.WindowsPresentation.csproj", "{83195AEF-0071-471C-9E8B-E67211F5D028}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GMap.NET.Core", "GMap.NET.Core\GMap.NET.Core.csproj", "{D0C39D9D-BED0-418B-9A5E-713176CAF40C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GMap.NET.WindowsForms", "GMap.NET.WindowsForms\GMap.NET.WindowsForms.csproj", "{E06DEF77-F933-42FB-AFD7-DB2D0D8D6A98}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GMap.NET.WindowsPresentation", "GMap.NET.WindowsPresentation\GMap.NET.WindowsPresentation.csproj", "{644FE7D4-0184-400F-B2D7-99CB41360658}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TemplatedBinding", "Testing\TemplatedBinding\TemplatedBinding.csproj", "{C7CD6A76-D941-493F-91F8-6222AB87BECA}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF-GMapControlNew", "Testing\WPF-GMapControlNew\WPF-GMapControlNew.csproj", "{B5A673B4-6286-4150-A536-1C16F3B8DC8B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo.StreetView", "Testing\Demo.StreetView\Demo.StreetView.csproj", "{B6E411A2-DFD8-461E-8207-BDBA405264CA}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BigMapMaker", "Testing\BigMapMaker\BigMapMaker.csproj", "{A6E9D42C-935B-44D0-9FB0-E2E0319627D1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo.Clouds", "Testing\Demo.Clouds\Demo.Clouds.csproj", "{097FA134-51A5-4801-AADD-A1914EAA32FF}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Setup", "Setup", "{BA76BAF9-B8BB-46B3-89D2-3087524D80B0}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GMap.NET - Hot Build", "Setup\GMap.NET - Hot Build\GMap.NET - Hot Build.csproj", "{C5E9D4B5-F9A8-4414-9B17-5A70DC2705C0}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo.Docking", "Testing\Demo.Docking\Demo.Docking.csproj", "{F729FF99-2991-4819-9855-7CD7A1199089}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApplication", "Testing\ConsoleApplication\ConsoleApplication.csproj", "{448B761F-C033-447D-93D5-F4380A7DB0E2}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {A2E07A76-8B2C-41A2-B23E-EA31AE94D706}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A2E07A76-8B2C-41A2-B23E-EA31AE94D706}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A2E07A76-8B2C-41A2-B23E-EA31AE94D706}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A2E07A76-8B2C-41A2-B23E-EA31AE94D706}.Release|Any CPU.Build.0 = Release|Any CPU - {83195AEF-0071-471C-9E8B-E67211F5D028}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {83195AEF-0071-471C-9E8B-E67211F5D028}.Debug|Any CPU.Build.0 = Debug|Any CPU - {83195AEF-0071-471C-9E8B-E67211F5D028}.Release|Any CPU.ActiveCfg = Release|Any CPU - {83195AEF-0071-471C-9E8B-E67211F5D028}.Release|Any CPU.Build.0 = Release|Any CPU - {D0C39D9D-BED0-418B-9A5E-713176CAF40C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D0C39D9D-BED0-418B-9A5E-713176CAF40C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D0C39D9D-BED0-418B-9A5E-713176CAF40C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D0C39D9D-BED0-418B-9A5E-713176CAF40C}.Release|Any CPU.Build.0 = Release|Any CPU - {E06DEF77-F933-42FB-AFD7-DB2D0D8D6A98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E06DEF77-F933-42FB-AFD7-DB2D0D8D6A98}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E06DEF77-F933-42FB-AFD7-DB2D0D8D6A98}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E06DEF77-F933-42FB-AFD7-DB2D0D8D6A98}.Release|Any CPU.Build.0 = Release|Any CPU - {644FE7D4-0184-400F-B2D7-99CB41360658}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {644FE7D4-0184-400F-B2D7-99CB41360658}.Debug|Any CPU.Build.0 = Debug|Any CPU - {644FE7D4-0184-400F-B2D7-99CB41360658}.Release|Any CPU.ActiveCfg = Release|Any CPU - {644FE7D4-0184-400F-B2D7-99CB41360658}.Release|Any CPU.Build.0 = Release|Any CPU - {C7CD6A76-D941-493F-91F8-6222AB87BECA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C7CD6A76-D941-493F-91F8-6222AB87BECA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B5A673B4-6286-4150-A536-1C16F3B8DC8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B5A673B4-6286-4150-A536-1C16F3B8DC8B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B6E411A2-DFD8-461E-8207-BDBA405264CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B6E411A2-DFD8-461E-8207-BDBA405264CA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A6E9D42C-935B-44D0-9FB0-E2E0319627D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A6E9D42C-935B-44D0-9FB0-E2E0319627D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {097FA134-51A5-4801-AADD-A1914EAA32FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {097FA134-51A5-4801-AADD-A1914EAA32FF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C5E9D4B5-F9A8-4414-9B17-5A70DC2705C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C5E9D4B5-F9A8-4414-9B17-5A70DC2705C0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F729FF99-2991-4819-9855-7CD7A1199089}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F729FF99-2991-4819-9855-7CD7A1199089}.Release|Any CPU.ActiveCfg = Release|Any CPU - {448B761F-C033-447D-93D5-F4380A7DB0E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {448B761F-C033-447D-93D5-F4380A7DB0E2}.Release|Any CPU.ActiveCfg = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {D0C39D9D-BED0-418B-9A5E-713176CAF40C} = {775C3C1A-44D3-41F4-9FC6-F83E39D3ABB8} - {E06DEF77-F933-42FB-AFD7-DB2D0D8D6A98} = {775C3C1A-44D3-41F4-9FC6-F83E39D3ABB8} - {644FE7D4-0184-400F-B2D7-99CB41360658} = {775C3C1A-44D3-41F4-9FC6-F83E39D3ABB8} - {A2E07A76-8B2C-41A2-B23E-EA31AE94D706} = {4071E6E4-D401-4EF2-94B0-6F5257088116} - {83195AEF-0071-471C-9E8B-E67211F5D028} = {4071E6E4-D401-4EF2-94B0-6F5257088116} - {C7CD6A76-D941-493F-91F8-6222AB87BECA} = {A24009F2-84ED-4F0A-BC1C-8B05F474986A} - {B5A673B4-6286-4150-A536-1C16F3B8DC8B} = {A24009F2-84ED-4F0A-BC1C-8B05F474986A} - {B6E411A2-DFD8-461E-8207-BDBA405264CA} = {A24009F2-84ED-4F0A-BC1C-8B05F474986A} - {A6E9D42C-935B-44D0-9FB0-E2E0319627D1} = {A24009F2-84ED-4F0A-BC1C-8B05F474986A} - {097FA134-51A5-4801-AADD-A1914EAA32FF} = {A24009F2-84ED-4F0A-BC1C-8B05F474986A} - {F729FF99-2991-4819-9855-7CD7A1199089} = {A24009F2-84ED-4F0A-BC1C-8B05F474986A} - {448B761F-C033-447D-93D5-F4380A7DB0E2} = {A24009F2-84ED-4F0A-BC1C-8B05F474986A} - {C5E9D4B5-F9A8-4414-9B17-5A70DC2705C0} = {BA76BAF9-B8BB-46B3-89D2-3087524D80B0} - EndGlobalSection -EndGlobal diff --git a/GreatMaps/GMap.NET.Core/GMap.NET.CacheProviders/MemoryCache.cs b/GreatMaps/GMap.NET.Core/GMap.NET.CacheProviders/MemoryCache.cs index 376b90a..8bac257 100644 --- a/GreatMaps/GMap.NET.Core/GMap.NET.CacheProviders/MemoryCache.cs +++ b/GreatMaps/GMap.NET.Core/GMap.NET.CacheProviders/MemoryCache.cs @@ -94,7 +94,7 @@ namespace GMap.NET.CacheProviders return null; } - internal void AddTileToMemoryCache(RawTile tile, byte[] data) + public void AddTileToMemoryCache(RawTile tile, byte[] data) { if(data != null) { diff --git a/GreatMaps/GMap.NET.Core/GMap.NET.Core.csproj b/GreatMaps/GMap.NET.Core/GMap.NET.Core.csproj index a0ff962..b16bc4e 100644 --- a/GreatMaps/GMap.NET.Core/GMap.NET.Core.csproj +++ b/GreatMaps/GMap.NET.Core/GMap.NET.Core.csproj @@ -113,8 +113,7 @@ True - ..\..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll False diff --git a/GreatMaps/GMap.NET.Core/GMap.NET.Internals/CacheQueueItem.cs b/GreatMaps/GMap.NET.Core/GMap.NET.Internals/CacheQueueItem.cs index 6a17b1b..6bb5c83 100644 --- a/GreatMaps/GMap.NET.Core/GMap.NET.Internals/CacheQueueItem.cs +++ b/GreatMaps/GMap.NET.Core/GMap.NET.Internals/CacheQueueItem.cs @@ -7,7 +7,7 @@ namespace GMap.NET.Internals /// /// cache queue item /// - internal struct CacheQueueItem + public struct CacheQueueItem { public RawTile Tile; public byte[] Img; @@ -31,7 +31,7 @@ namespace GMap.NET.Internals } } - internal enum CacheUsage + public enum CacheUsage { First = 2, Second = 4, diff --git a/GreatMaps/GMap.NET.Core/GMap.NET.Internals/RawTile.cs b/GreatMaps/GMap.NET.Core/GMap.NET.Internals/RawTile.cs index 76f832d..d516b75 100644 --- a/GreatMaps/GMap.NET.Core/GMap.NET.Internals/RawTile.cs +++ b/GreatMaps/GMap.NET.Core/GMap.NET.Internals/RawTile.cs @@ -6,7 +6,7 @@ /// /// struct for raw tile /// - internal struct RawTile + public struct RawTile { public int Type; public GPoint Pos; diff --git a/GreatMaps/GMap.NET.Core/GMap.NET.MapProviders/GMapProvider.cs b/GreatMaps/GMap.NET.Core/GMap.NET.MapProviders/GMapProvider.cs index 9a10943..6607502 100644 --- a/GreatMaps/GMap.NET.Core/GMap.NET.MapProviders/GMapProvider.cs +++ b/GreatMaps/GMap.NET.Core/GMap.NET.MapProviders/GMapProvider.cs @@ -394,7 +394,7 @@ namespace GMap.NET.MapProviders { MemoryStream responseStream = Stuff.CopyStream(response.GetResponseStream(), false); { - Debug.WriteLine("Response[" + responseStream.Length + " bytes]: " + url); + Console.WriteLine("Response[" + responseStream.Length + " bytes]: " + url); if(responseStream.Length > 0) { diff --git a/GreatMaps/GMap.NET.Core/GMap.NET.MapProviders/OpenStreetMap/OpenCycleLandscapeMapProvider.cs b/GreatMaps/GMap.NET.Core/GMap.NET.MapProviders/OpenStreetMap/OpenCycleLandscapeMapProvider.cs index 536ee6c..5145fe5 100644 --- a/GreatMaps/GMap.NET.Core/GMap.NET.MapProviders/OpenStreetMap/OpenCycleLandscapeMapProvider.cs +++ b/GreatMaps/GMap.NET.Core/GMap.NET.MapProviders/OpenStreetMap/OpenCycleLandscapeMapProvider.cs @@ -12,7 +12,7 @@ namespace GMap.NET.MapProviders OpenCycleLandscapeMapProvider() { - RefererUrl = "http://www.opencyclemap.org/"; + RefererUrl = ""; } static OpenCycleLandscapeMapProvider() @@ -70,5 +70,5 @@ namespace GMap.NET.MapProviders static readonly string UrlFormat = "http://{0}.tile3.opencyclemap.org/landscape/{1}/{2}/{3}.png"; - } + } } diff --git a/GreatMaps/GMap.NET.Core/GMap.NET.MapProviders/OpenStreetMap/OpenCycleMapProvider.cs b/GreatMaps/GMap.NET.Core/GMap.NET.MapProviders/OpenStreetMap/OpenCycleMapProvider.cs index a6726f1..7de992f 100644 --- a/GreatMaps/GMap.NET.Core/GMap.NET.MapProviders/OpenStreetMap/OpenCycleMapProvider.cs +++ b/GreatMaps/GMap.NET.Core/GMap.NET.MapProviders/OpenStreetMap/OpenCycleMapProvider.cs @@ -12,7 +12,7 @@ namespace GMap.NET.MapProviders OpenCycleMapProvider() { - RefererUrl = "http://www.opencyclemap.org/"; + RefererUrl = ""; } static OpenCycleMapProvider() @@ -69,5 +69,5 @@ namespace GMap.NET.MapProviders } static readonly string UrlFormat = "http://{0}.tile.opencyclemap.org/cycle/{1}/{2}/{3}.png"; - } + } } diff --git a/GreatMaps/GMap.NET.Core/GMap.NET.MapProviders/OpenStreetMap/OpenCycleTransportMapProvider.cs b/GreatMaps/GMap.NET.Core/GMap.NET.MapProviders/OpenStreetMap/OpenCycleTransportMapProvider.cs index be17cf7..1a4e03c 100644 --- a/GreatMaps/GMap.NET.Core/GMap.NET.MapProviders/OpenStreetMap/OpenCycleTransportMapProvider.cs +++ b/GreatMaps/GMap.NET.Core/GMap.NET.MapProviders/OpenStreetMap/OpenCycleTransportMapProvider.cs @@ -12,7 +12,7 @@ namespace GMap.NET.MapProviders OpenCycleTransportMapProvider() { - RefererUrl = "http://www.opencyclemap.org/"; + RefererUrl = ""; } static OpenCycleTransportMapProvider() @@ -69,5 +69,5 @@ namespace GMap.NET.MapProviders } static readonly string UrlFormat = "http://{0}.tile2.opencyclemap.org/transport/{1}/{2}/{3}.png"; - } + } } diff --git a/GreatMaps/GMap.NET.Core/GMap.NET.MapProviders/OpenStreetMap/OpenStreetMapProvider.cs b/GreatMaps/GMap.NET.Core/GMap.NET.MapProviders/OpenStreetMap/OpenStreetMapProvider.cs index 291374c..38d3732 100644 --- a/GreatMaps/GMap.NET.Core/GMap.NET.MapProviders/OpenStreetMap/OpenStreetMapProvider.cs +++ b/GreatMaps/GMap.NET.Core/GMap.NET.MapProviders/OpenStreetMap/OpenStreetMapProvider.cs @@ -14,8 +14,9 @@ namespace GMap.NET.MapProviders public OpenStreetMapProviderBase() { MaxZoom = null; - RefererUrl = "http://www.openstreetmap.org/"; - Copyright = string.Format("© OpenStreetMap - Map data ©{0} OpenStreetMap", DateTime.Today.Year); +// RefererUrl = "http://www.openstreetmap.org/"; + RefererUrl = ""; + Copyright = string.Format("© OpenStreetMap - Map data ©{0} OpenStreetMap", DateTime.Today.Year); } public readonly string ServerLetters = "abc"; @@ -446,7 +447,7 @@ namespace GMap.NET.MapProviders { public static readonly OpenStreetMapProvider Instance; - OpenStreetMapProvider() + public OpenStreetMapProvider() { } @@ -503,6 +504,6 @@ namespace GMap.NET.MapProviders return string.Format(UrlFormat, letter, zoom, pos.X, pos.Y); } - static readonly string UrlFormat = "http://{0}.tile.openstreetmap.org/{1}/{2}/{3}.png"; - } + static readonly string UrlFormat = "http://{0}.tile.openstreetmap.org/{1}/{2}/{3}.png"; + } } diff --git a/GreatMaps/GMap.NET.Core/GMap.NET/GMaps.cs b/GreatMaps/GMap.NET.Core/GMap.NET/GMaps.cs index 81008ee..3fc7608 100644 --- a/GreatMaps/GMap.NET.Core/GMap.NET/GMaps.cs +++ b/GreatMaps/GMap.NET.Core/GMap.NET/GMaps.cs @@ -105,7 +105,7 @@ namespace GMap.NET /// /// tile queue to cache /// - readonly Queue tileCacheQueue = new Queue(); + public readonly Queue tileCacheQueue = new Queue(); bool? isRunningOnMono; @@ -249,7 +249,7 @@ namespace GMap.NET /// enqueueens tile to cache /// /// - void EnqueueCacheTask(CacheQueueItem task) + public void EnqueueCacheTask(CacheQueueItem task) { lock(tileCacheQueue) { diff --git a/GreatMaps/GMap.NET.Core/packages.config b/GreatMaps/GMap.NET.Core/packages.config index 0bbf652..2bc3b5b 100644 --- a/GreatMaps/GMap.NET.Core/packages.config +++ b/GreatMaps/GMap.NET.Core/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/GreatMaps/GMap.NET.WindowsForms/GMap.NET.WindowsForms.csproj b/GreatMaps/GMap.NET.WindowsForms/GMap.NET.WindowsForms.csproj index 74162af..d8aa0a2 100644 --- a/GreatMaps/GMap.NET.WindowsForms/GMap.NET.WindowsForms.csproj +++ b/GreatMaps/GMap.NET.WindowsForms/GMap.NET.WindowsForms.csproj @@ -90,8 +90,7 @@ - ..\..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/GreatMaps/GMap.NET.WindowsForms/GMap.NET.WindowsForms/GMapControl.cs b/GreatMaps/GMap.NET.WindowsForms/GMap.NET.WindowsForms/GMapControl.cs index 7a1ff13..2b3e71f 100644 --- a/GreatMaps/GMap.NET.WindowsForms/GMap.NET.WindowsForms/GMapControl.cs +++ b/GreatMaps/GMap.NET.WindowsForms/GMap.NET.WindowsForms/GMapControl.cs @@ -323,7 +323,7 @@ namespace GMap.NET.WindowsForms /// /// how many levels of tiles are staying decompresed in memory /// - [Browsable(false)] + [Browsable(true)] public int LevelsKeepInMemmory { get @@ -1602,7 +1602,7 @@ namespace GMap.NET.WindowsForms #if PocketPC g.DrawString("debug build", CopyrightFont, CopyrightBrush, 2, CopyrightFont.Size); #else - g.DrawString("debug build", CopyrightFont, Brushes.Blue, 2, CopyrightFont.Height); +// g.DrawString("debug build", CopyrightFont, Brushes.Blue, 2, CopyrightFont.Height); #endif #endif diff --git a/GreatMaps/GMap.NET.WindowsForms/packages.config b/GreatMaps/GMap.NET.WindowsForms/packages.config index 0bbf652..2bc3b5b 100644 --- a/GreatMaps/GMap.NET.WindowsForms/packages.config +++ b/GreatMaps/GMap.NET.WindowsForms/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/GreatMaps/GMap.NET.sln b/GreatMaps/GMap.NET.sln deleted file mode 100644 index b9748e7..0000000 --- a/GreatMaps/GMap.NET.sln +++ /dev/null @@ -1,108 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual C# Express 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo.WindowsForms", "Demo.WindowsForms\Demo.WindowsForms.csproj", "{A2E07A76-8B2C-41A2-B23E-EA31AE94D706}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo.WindowsPresentation", "Demo.WindowsPresentation\Demo.WindowsPresentation.csproj", "{83195AEF-0071-471C-9E8B-E67211F5D028}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GMap.NET.Core", "GMap.NET.Core\GMap.NET.Core.csproj", "{D0C39D9D-BED0-418B-9A5E-713176CAF40C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GMap.NET.WindowsForms", "GMap.NET.WindowsForms\GMap.NET.WindowsForms.csproj", "{E06DEF77-F933-42FB-AFD7-DB2D0D8D6A98}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GMap.NET.WindowsPresentation", "GMap.NET.WindowsPresentation\GMap.NET.WindowsPresentation.csproj", "{644FE7D4-0184-400F-B2D7-99CB41360658}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TemplatedBinding", "Testing\TemplatedBinding\TemplatedBinding.csproj", "{C7CD6A76-D941-493F-91F8-6222AB87BECA}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF-GMapControlNew", "Testing\WPF-GMapControlNew\WPF-GMapControlNew.csproj", "{B5A673B4-6286-4150-A536-1C16F3B8DC8B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo.StreetView", "Testing\Demo.StreetView\Demo.StreetView.csproj", "{B6E411A2-DFD8-461E-8207-BDBA405264CA}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BigMapMaker", "Testing\BigMapMaker\BigMapMaker.csproj", "{A6E9D42C-935B-44D0-9FB0-E2E0319627D1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo.Clouds", "Testing\Demo.Clouds\Demo.Clouds.csproj", "{097FA134-51A5-4801-AADD-A1914EAA32FF}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo.Docking", "Testing\Demo.Docking\Demo.Docking.csproj", "{F729FF99-2991-4819-9855-7CD7A1199089}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApplication", "Testing\ConsoleApplication\ConsoleApplication.csproj", "{448B761F-C033-447D-93D5-F4380A7DB0E2}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {A2E07A76-8B2C-41A2-B23E-EA31AE94D706}.Debug|Any CPU.ActiveCfg = Debug|x86 - {A2E07A76-8B2C-41A2-B23E-EA31AE94D706}.Debug|Any CPU.Build.0 = Debug|x86 - {A2E07A76-8B2C-41A2-B23E-EA31AE94D706}.Debug|x86.ActiveCfg = Debug|x86 - {A2E07A76-8B2C-41A2-B23E-EA31AE94D706}.Debug|x86.Build.0 = Debug|x86 - {A2E07A76-8B2C-41A2-B23E-EA31AE94D706}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A2E07A76-8B2C-41A2-B23E-EA31AE94D706}.Release|Any CPU.Build.0 = Release|Any CPU - {A2E07A76-8B2C-41A2-B23E-EA31AE94D706}.Release|x86.ActiveCfg = Release|x86 - {A2E07A76-8B2C-41A2-B23E-EA31AE94D706}.Release|x86.Build.0 = Release|x86 - {83195AEF-0071-471C-9E8B-E67211F5D028}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {83195AEF-0071-471C-9E8B-E67211F5D028}.Debug|Any CPU.Build.0 = Debug|Any CPU - {83195AEF-0071-471C-9E8B-E67211F5D028}.Debug|x86.ActiveCfg = Debug|x86 - {83195AEF-0071-471C-9E8B-E67211F5D028}.Debug|x86.Build.0 = Debug|x86 - {83195AEF-0071-471C-9E8B-E67211F5D028}.Release|Any CPU.ActiveCfg = Release|Any CPU - {83195AEF-0071-471C-9E8B-E67211F5D028}.Release|Any CPU.Build.0 = Release|Any CPU - {83195AEF-0071-471C-9E8B-E67211F5D028}.Release|x86.ActiveCfg = Release|x86 - {83195AEF-0071-471C-9E8B-E67211F5D028}.Release|x86.Build.0 = Release|x86 - {D0C39D9D-BED0-418B-9A5E-713176CAF40C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D0C39D9D-BED0-418B-9A5E-713176CAF40C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D0C39D9D-BED0-418B-9A5E-713176CAF40C}.Debug|x86.ActiveCfg = Debug|x86 - {D0C39D9D-BED0-418B-9A5E-713176CAF40C}.Debug|x86.Build.0 = Debug|x86 - {D0C39D9D-BED0-418B-9A5E-713176CAF40C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D0C39D9D-BED0-418B-9A5E-713176CAF40C}.Release|Any CPU.Build.0 = Release|Any CPU - {D0C39D9D-BED0-418B-9A5E-713176CAF40C}.Release|x86.ActiveCfg = Release|x86 - {D0C39D9D-BED0-418B-9A5E-713176CAF40C}.Release|x86.Build.0 = Release|x86 - {E06DEF77-F933-42FB-AFD7-DB2D0D8D6A98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E06DEF77-F933-42FB-AFD7-DB2D0D8D6A98}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E06DEF77-F933-42FB-AFD7-DB2D0D8D6A98}.Debug|x86.ActiveCfg = Debug|x86 - {E06DEF77-F933-42FB-AFD7-DB2D0D8D6A98}.Debug|x86.Build.0 = Debug|x86 - {E06DEF77-F933-42FB-AFD7-DB2D0D8D6A98}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E06DEF77-F933-42FB-AFD7-DB2D0D8D6A98}.Release|Any CPU.Build.0 = Release|Any CPU - {E06DEF77-F933-42FB-AFD7-DB2D0D8D6A98}.Release|x86.ActiveCfg = Release|x86 - {E06DEF77-F933-42FB-AFD7-DB2D0D8D6A98}.Release|x86.Build.0 = Release|x86 - {644FE7D4-0184-400F-B2D7-99CB41360658}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {644FE7D4-0184-400F-B2D7-99CB41360658}.Debug|Any CPU.Build.0 = Debug|Any CPU - {644FE7D4-0184-400F-B2D7-99CB41360658}.Debug|x86.ActiveCfg = Debug|x86 - {644FE7D4-0184-400F-B2D7-99CB41360658}.Debug|x86.Build.0 = Debug|x86 - {644FE7D4-0184-400F-B2D7-99CB41360658}.Release|Any CPU.ActiveCfg = Release|Any CPU - {644FE7D4-0184-400F-B2D7-99CB41360658}.Release|Any CPU.Build.0 = Release|Any CPU - {644FE7D4-0184-400F-B2D7-99CB41360658}.Release|x86.ActiveCfg = Release|x86 - {644FE7D4-0184-400F-B2D7-99CB41360658}.Release|x86.Build.0 = Release|x86 - {C7CD6A76-D941-493F-91F8-6222AB87BECA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C7CD6A76-D941-493F-91F8-6222AB87BECA}.Debug|x86.ActiveCfg = Debug|x86 - {C7CD6A76-D941-493F-91F8-6222AB87BECA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C7CD6A76-D941-493F-91F8-6222AB87BECA}.Release|x86.ActiveCfg = Release|x86 - {B5A673B4-6286-4150-A536-1C16F3B8DC8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B5A673B4-6286-4150-A536-1C16F3B8DC8B}.Debug|x86.ActiveCfg = Debug|x86 - {B5A673B4-6286-4150-A536-1C16F3B8DC8B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B5A673B4-6286-4150-A536-1C16F3B8DC8B}.Release|x86.ActiveCfg = Release|x86 - {B6E411A2-DFD8-461E-8207-BDBA405264CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B6E411A2-DFD8-461E-8207-BDBA405264CA}.Debug|x86.ActiveCfg = Debug|x86 - {B6E411A2-DFD8-461E-8207-BDBA405264CA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B6E411A2-DFD8-461E-8207-BDBA405264CA}.Release|x86.ActiveCfg = Release|x86 - {A6E9D42C-935B-44D0-9FB0-E2E0319627D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A6E9D42C-935B-44D0-9FB0-E2E0319627D1}.Debug|x86.ActiveCfg = Debug|x86 - {A6E9D42C-935B-44D0-9FB0-E2E0319627D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A6E9D42C-935B-44D0-9FB0-E2E0319627D1}.Release|x86.ActiveCfg = Release|x86 - {097FA134-51A5-4801-AADD-A1914EAA32FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {097FA134-51A5-4801-AADD-A1914EAA32FF}.Debug|x86.ActiveCfg = Debug|x86 - {097FA134-51A5-4801-AADD-A1914EAA32FF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {097FA134-51A5-4801-AADD-A1914EAA32FF}.Release|x86.ActiveCfg = Release|x86 - {F729FF99-2991-4819-9855-7CD7A1199089}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F729FF99-2991-4819-9855-7CD7A1199089}.Debug|x86.ActiveCfg = Debug|x86 - {F729FF99-2991-4819-9855-7CD7A1199089}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F729FF99-2991-4819-9855-7CD7A1199089}.Release|x86.ActiveCfg = Release|x86 - {448B761F-C033-447D-93D5-F4380A7DB0E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {448B761F-C033-447D-93D5-F4380A7DB0E2}.Debug|x86.ActiveCfg = Debug|x86 - {448B761F-C033-447D-93D5-F4380A7DB0E2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {448B761F-C033-447D-93D5-F4380A7DB0E2}.Release|x86.ActiveCfg = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/HorizonGenerator/HorizonGenerator.csproj b/HorizonGenerator/HorizonGenerator.csproj index 3876f32..1133abe 100644 --- a/HorizonGenerator/HorizonGenerator.csproj +++ b/HorizonGenerator/HorizonGenerator.csproj @@ -52,8 +52,7 @@ - ..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/HorizonGenerator/packages.config b/HorizonGenerator/packages.config index 0bbf652..2bc3b5b 100644 --- a/HorizonGenerator/packages.config +++ b/HorizonGenerator/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/LibADSB/LibADSB.csproj b/LibADSB/LibADSB.csproj index d82154d..de8b04b 100644 --- a/LibADSB/LibADSB.csproj +++ b/LibADSB/LibADSB.csproj @@ -34,8 +34,7 @@ - ..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/LibADSB/packages.config b/LibADSB/packages.config index 0bbf652..2bc3b5b 100644 --- a/LibADSB/packages.config +++ b/LibADSB/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/MapTileGenerator/MainDlg.Designer.cs b/MapTileGenerator/MainDlg.Designer.cs new file mode 100644 index 0000000..c79ed3d --- /dev/null +++ b/MapTileGenerator/MainDlg.Designer.cs @@ -0,0 +1,217 @@ +namespace MapTileGenerator +{ + partial class MainDlg + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Windows Form-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.ss_Main = new System.Windows.Forms.StatusStrip(); + this.tsl_Main = new System.Windows.Forms.ToolStripStatusLabel(); + this.tb_Database = new System.Windows.Forms.TextBox(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.btn_MapTilesRootPath = new System.Windows.Forms.Button(); + this.label2 = new System.Windows.Forms.Label(); + this.tb_MapTilesRootPath = new System.Windows.Forms.TextBox(); + this.btn_Database = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.btn_Start = new System.Windows.Forms.Button(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.pb_Zoom = new System.Windows.Forms.PictureBox(); + this.btn_CreatePNG = new System.Windows.Forms.Button(); + this.ss_Main.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pb_Zoom)).BeginInit(); + this.SuspendLayout(); + // + // ss_Main + // + this.ss_Main.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.tsl_Main}); + this.ss_Main.Location = new System.Drawing.Point(0, 523); + this.ss_Main.Name = "ss_Main"; + this.ss_Main.Size = new System.Drawing.Size(666, 22); + this.ss_Main.TabIndex = 0; + this.ss_Main.Text = "statusStrip1"; + // + // tsl_Main + // + this.tsl_Main.Name = "tsl_Main"; + this.tsl_Main.Size = new System.Drawing.Size(39, 17); + this.tsl_Main.Text = "Status"; + // + // tb_Database + // + this.tb_Database.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::MapTileGenerator.Properties.Settings.Default, "Database", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.tb_Database.Location = new System.Drawing.Point(138, 32); + this.tb_Database.Name = "tb_Database"; + this.tb_Database.Size = new System.Drawing.Size(345, 20); + this.tb_Database.TabIndex = 1; + this.tb_Database.Text = global::MapTileGenerator.Properties.Settings.Default.Database; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.btn_Start); + this.groupBox1.Controls.Add(this.btn_MapTilesRootPath); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.tb_MapTilesRootPath); + this.groupBox1.Controls.Add(this.btn_Database); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Controls.Add(this.tb_Database); + this.groupBox1.Location = new System.Drawing.Point(12, 12); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(610, 156); + this.groupBox1.TabIndex = 2; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Mp Tiles from Database"; + // + // btn_MapTilesRootPath + // + this.btn_MapTilesRootPath.Location = new System.Drawing.Point(505, 56); + this.btn_MapTilesRootPath.Name = "btn_MapTilesRootPath"; + this.btn_MapTilesRootPath.Size = new System.Drawing.Size(75, 23); + this.btn_MapTilesRootPath.TabIndex = 6; + this.btn_MapTilesRootPath.Text = "Select"; + this.btn_MapTilesRootPath.UseVisualStyleBackColor = true; + this.btn_MapTilesRootPath.Click += new System.EventHandler(this.btn_MapTilesRootPath_Click); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(25, 61); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(107, 13); + this.label2.TabIndex = 5; + this.label2.Text = "Map Tiles Root Path:"; + // + // tb_MapTilesRootPath + // + this.tb_MapTilesRootPath.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::MapTileGenerator.Properties.Settings.Default, "MapTilesRootPath", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.tb_MapTilesRootPath.Location = new System.Drawing.Point(138, 58); + this.tb_MapTilesRootPath.Name = "tb_MapTilesRootPath"; + this.tb_MapTilesRootPath.Size = new System.Drawing.Size(345, 20); + this.tb_MapTilesRootPath.TabIndex = 4; + this.tb_MapTilesRootPath.Text = global::MapTileGenerator.Properties.Settings.Default.MapTilesRootPath; + // + // btn_Database + // + this.btn_Database.Location = new System.Drawing.Point(505, 30); + this.btn_Database.Name = "btn_Database"; + this.btn_Database.Size = new System.Drawing.Size(75, 23); + this.btn_Database.TabIndex = 3; + this.btn_Database.Text = "Select"; + this.btn_Database.UseVisualStyleBackColor = true; + this.btn_Database.Click += new System.EventHandler(this.btn_Database_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(25, 35); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(56, 13); + this.label1.TabIndex = 2; + this.label1.Text = "Database:"; + // + // btn_Start + // + this.btn_Start.Location = new System.Drawing.Point(505, 111); + this.btn_Start.Name = "btn_Start"; + this.btn_Start.Size = new System.Drawing.Size(75, 23); + this.btn_Start.TabIndex = 7; + this.btn_Start.Text = "Start"; + this.btn_Start.UseVisualStyleBackColor = true; + this.btn_Start.Click += new System.EventHandler(this.btn_Start_Click); + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.btn_CreatePNG); + this.groupBox2.Controls.Add(this.pb_Zoom); + this.groupBox2.Location = new System.Drawing.Point(12, 174); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(610, 330); + this.groupBox2.TabIndex = 3; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Create combined image from png"; + // + // pb_Zoom + // + this.pb_Zoom.Location = new System.Drawing.Point(6, 19); + this.pb_Zoom.Name = "pb_Zoom"; + this.pb_Zoom.Size = new System.Drawing.Size(477, 293); + this.pb_Zoom.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pb_Zoom.TabIndex = 0; + this.pb_Zoom.TabStop = false; + // + // btn_CreatePNG + // + this.btn_CreatePNG.Location = new System.Drawing.Point(505, 19); + this.btn_CreatePNG.Name = "btn_CreatePNG"; + this.btn_CreatePNG.Size = new System.Drawing.Size(75, 23); + this.btn_CreatePNG.TabIndex = 8; + this.btn_CreatePNG.Text = "Create PNG"; + this.btn_CreatePNG.UseVisualStyleBackColor = true; + this.btn_CreatePNG.Click += new System.EventHandler(this.btn_CreatePNG_Click); + // + // MainDlg + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(666, 545); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.ss_Main); + this.Name = "MainDlg"; + this.Text = "MapTileGenerator"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainDlg_FormClosing); + this.ss_Main.ResumeLayout(false); + this.ss_Main.PerformLayout(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.groupBox2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.pb_Zoom)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.StatusStrip ss_Main; + private System.Windows.Forms.ToolStripStatusLabel tsl_Main; + private System.Windows.Forms.TextBox tb_Database; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Button btn_Database; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button btn_MapTilesRootPath; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox tb_MapTilesRootPath; + private System.Windows.Forms.Button btn_Start; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.Button btn_CreatePNG; + private System.Windows.Forms.PictureBox pb_Zoom; + } +} + diff --git a/MapTileGenerator/MainDlg.cs b/MapTileGenerator/MainDlg.cs new file mode 100644 index 0000000..93180db --- /dev/null +++ b/MapTileGenerator/MainDlg.cs @@ -0,0 +1,152 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.IO; + +namespace MapTileGenerator +{ + public partial class MainDlg : Form + { + public MainDlg() + { + InitializeComponent(); + } + + private void Say(string text) + { + if (tsl_Main.Text != text) + { + tsl_Main.Text = text; + ss_Main.Refresh(); + } + } + + private void btn_Database_Click(object sender, EventArgs e) + { + OpenFileDialog Dlg = new OpenFileDialog(); + Dlg.CheckFileExists = true; + Dlg.Filter = "GMap.NET database files (*.gmdb)|*.gmdb"; + if (Dlg.ShowDialog() == DialogResult.OK) + { + tb_Database.Text = Dlg.FileName; + Properties.Settings.Default.Save(); + // change ScoutBase database location + ScoutBase.Maps.Properties.Settings.Default.Database_UpdateURL = Properties.Settings.Default.Database; + } + } + + private void btn_MapTilesRootPath_Click(object sender, EventArgs e) + { + FolderBrowserDialog Dlg = new FolderBrowserDialog(); + if (Dlg.ShowDialog() == DialogResult.OK) + { + tb_MapTilesRootPath.Text = Dlg.SelectedPath; + Properties.Settings.Default.Save(); + } + } + + private void btn_Start_Click(object sender, EventArgs e) + { + List tiles = MapData.Database.TilesGetAll(); + int count = tiles.Count(); + int i = 1; + foreach (MapTileInfo tile in tiles) + { + try + { + string dirname = Path.Combine(Properties.Settings.Default.MapTilesRootPath, tile.Zoom.ToString(), tile.X.ToString()); + if (!Directory.Exists(dirname)) + { + Directory.CreateDirectory(dirname); + } + string filename = Path.Combine(dirname, tile.Y.ToString()) + ".png"; + MapTileData d = MapData.Database.TileDataFind(tile.ID); + if (d != null && !File.Exists(filename) || (File.GetLastWriteTime(filename) != tile.CacheTime)) + { + using (BinaryWriter bw = new BinaryWriter(File.Create(filename))) + { + bw.Write(d.Tile); + } + File.SetCreationTime(filename, tile.CacheTime); + File.SetLastWriteTime(filename, tile.CacheTime); + File.SetLastAccessTime(filename, tile.CacheTime); + } + Say("Saving [" + i.ToString() + " of " + count.ToString() + "] " + filename); + } + catch (Exception ex) + { + Say(ex.Message); + } + i++; + Application.DoEvents(); + } + Say("Ready."); + } + + private void MainDlg_FormClosing(object sender, FormClosingEventArgs e) + { + Properties.Settings.Default.Save(); + } + + private void CombineImages(string[] files) + { + if (files.Count() == 0) + return; + //change the location to store the final image. + string finalImage = Path.Combine(Application.ExecutablePath, "zoom.png"); + List imageHeights = new List(); + int nIndex = 0; + int width = 0; + foreach (string file in files) + { + Image img = Image.FromFile(file); + imageHeights.Add(img.Height); + width += img.Width; + img.Dispose(); + } + imageHeights.Sort(); + int height = imageHeights[imageHeights.Count - 1]; + Bitmap img3 = new Bitmap(width, height); + Graphics g = Graphics.FromImage(img3); + g.Clear(SystemColors.AppWorkspace); + foreach (string file in files) + { + Image img = Image.FromFile(file); + if (nIndex == 0) + { + g.DrawImage(img, new Point(0, 0)); + nIndex++; + width = img.Width; + } + else + { + g.DrawImage(img, new Point(width, 0)); + width += img.Width; + } + img.Dispose(); + } + g.Dispose(); + img3.Save(finalImage, System.Drawing.Imaging.ImageFormat.Png); + img3.Dispose(); + pb_Zoom.Image = Image.FromFile(finalImage); + } + + private void btn_CreatePNG_Click(object sender, EventArgs e) + { + FolderBrowserDialog Dlg = new FolderBrowserDialog(); + { + if (Dlg.ShowDialog() == DialogResult.OK) + { + string[] files = Directory.GetFiles(Dlg.SelectedPath, "*.png"); + Array.Sort(files); + CombineImages(files); + } + } + } + } +} diff --git a/MapTileGenerator/MainDlg.resx b/MapTileGenerator/MainDlg.resx new file mode 100644 index 0000000..05efec9 --- /dev/null +++ b/MapTileGenerator/MainDlg.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/MapTileGenerator/MapTileGenerator.csproj b/MapTileGenerator/MapTileGenerator.csproj new file mode 100644 index 0000000..333a879 --- /dev/null +++ b/MapTileGenerator/MapTileGenerator.csproj @@ -0,0 +1,110 @@ + + + + + Debug + AnyCPU + {3D5AADC3-E4CA-4C12-8939-8DC778F6018E} + WinExe + MapTileGenerator + MapTileGenerator + v4.0 + 512 + true + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + ..\packages\System.Data.SQLite.Core.1.0.112.0\lib\net40\System.Data.SQLite.dll + + + + + + + + + + + + + Form + + + MainDlg.cs + + + + + MainDlg.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + {ee86e933-d883-4b18-80eb-0fba55ec67c6} + ScoutBase.Core + + + {89e6c7a3-6064-479e-a710-37c7293cf47c} + ScoutBase.Database + + + {b3b005a5-cc05-430b-b966-20be5e5985bf} + ScoutBase.Maps + + + {6056d3be-7002-4a6a-a9ea-6ff45122a3c7} + SQLiteDatabase + + + + + + + Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}". + + + + \ No newline at end of file diff --git a/MapTileGenerator/Program.cs b/MapTileGenerator/Program.cs new file mode 100644 index 0000000..32e698b --- /dev/null +++ b/MapTileGenerator/Program.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; + +namespace MapTileGenerator +{ + static class Program + { + /// + /// Der Haupteinstiegspunkt für die Anwendung. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MainDlg()); + } + } +} diff --git a/MapTileGenerator/Properties/AssemblyInfo.cs b/MapTileGenerator/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..9d6b60f --- /dev/null +++ b/MapTileGenerator/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Allgemeine Informationen über eine Assembly werden über die folgenden +// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +// die einer Assembly zugeordnet sind. +[assembly: AssemblyTitle("MapTileGenerator")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MapTileGenerator")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly +// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von +// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. +[assembly: ComVisible(false)] + +// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird +[assembly: Guid("3d5aadc3-e4ca-4c12-8939-8dc778f6018e")] + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, +// indem Sie "*" wie unten gezeigt eingeben: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/MapTileGenerator/Properties/Resources.Designer.cs b/MapTileGenerator/Properties/Resources.Designer.cs new file mode 100644 index 0000000..2c1297c --- /dev/null +++ b/MapTileGenerator/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion: 4.0.30319.42000 +// +// Änderungen an dieser Datei können fehlerhaftes Verhalten verursachen und gehen verloren, wenn +// der Code neu generiert wird. +// +//------------------------------------------------------------------------------ + +namespace MapTileGenerator.Properties +{ + + + /// + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// + // Diese Klasse wurde von der StronglyTypedResourceBuilder-Klasse + // über ein Tool wie ResGen oder Visual Studio automatisch generiert. + // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + // mit der Option /str erneut aus, oder erstellen Sie Ihr VS-Projekt neu. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MapTileGenerator.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenlookups, die diese stark typisierte Ressourcenklasse verwenden. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/MapTileGenerator/Properties/Resources.resx b/MapTileGenerator/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/MapTileGenerator/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/MapTileGenerator/Properties/Settings.Designer.cs b/MapTileGenerator/Properties/Settings.Designer.cs new file mode 100644 index 0000000..a22a505 --- /dev/null +++ b/MapTileGenerator/Properties/Settings.Designer.cs @@ -0,0 +1,50 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 +// +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. +// +//------------------------------------------------------------------------------ + +namespace MapTileGenerator.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.5.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string Database { + get { + return ((string)(this["Database"])); + } + set { + this["Database"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string MapTilesRootPath { + get { + return ((string)(this["MapTilesRootPath"])); + } + set { + this["MapTilesRootPath"] = value; + } + } + } +} diff --git a/MapTileGenerator/Properties/Settings.settings b/MapTileGenerator/Properties/Settings.settings new file mode 100644 index 0000000..5d2d851 --- /dev/null +++ b/MapTileGenerator/Properties/Settings.settings @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/MapTileGenerator/app.config b/MapTileGenerator/app.config new file mode 100644 index 0000000..a9d491c --- /dev/null +++ b/MapTileGenerator/app.config @@ -0,0 +1,18 @@ + + + + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/MapTileGenerator/packages.config b/MapTileGenerator/packages.config new file mode 100644 index 0000000..4b05315 --- /dev/null +++ b/MapTileGenerator/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/NDDE/NDde/Source/NDde/NDde.csproj b/NDDE/NDde/Source/NDde/NDde.csproj index 9bc8d88..6ab88dc 100644 --- a/NDDE/NDde/Source/NDde/NDde.csproj +++ b/NDDE/NDde/Source/NDde/NDde.csproj @@ -57,8 +57,7 @@ - ..\..\..\..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/NDDE/NDde/Source/NDde/packages.config b/NDDE/NDde/Source/NDde/packages.config index 0bbf652..2bc3b5b 100644 --- a/NDDE/NDde/Source/NDde/packages.config +++ b/NDDE/NDde/Source/NDde/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/OrbitTools/OrbitTools/Orbit.Core/Orbit.Core.csproj b/OrbitTools/OrbitTools/Orbit.Core/Orbit.Core.csproj index 704f82e..13a242a 100644 --- a/OrbitTools/OrbitTools/Orbit.Core/Orbit.Core.csproj +++ b/OrbitTools/OrbitTools/Orbit.Core/Orbit.Core.csproj @@ -74,8 +74,7 @@ - ..\..\..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/OrbitTools/OrbitTools/Orbit.Core/packages.config b/OrbitTools/OrbitTools/Orbit.Core/packages.config index 0bbf652..2bc3b5b 100644 --- a/OrbitTools/OrbitTools/Orbit.Core/packages.config +++ b/OrbitTools/OrbitTools/Orbit.Core/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/OrbitTools/OrbitTools/Orbit/Orbit.csproj b/OrbitTools/OrbitTools/Orbit/Orbit.csproj index ba92d6e..9eec3c3 100644 --- a/OrbitTools/OrbitTools/Orbit/Orbit.csproj +++ b/OrbitTools/OrbitTools/Orbit/Orbit.csproj @@ -74,8 +74,7 @@ - ..\..\..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/OrbitTools/OrbitTools/Orbit/packages.config b/OrbitTools/OrbitTools/Orbit/packages.config index 0bbf652..2bc3b5b 100644 --- a/OrbitTools/OrbitTools/Orbit/packages.config +++ b/OrbitTools/OrbitTools/Orbit/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/OxyPlot/Source/OxyPlot.WindowsForms/OxyPlot.WindowsForms.csproj b/OxyPlot/Source/OxyPlot.WindowsForms/OxyPlot.WindowsForms.csproj index 1b3f197..6d4be65 100644 --- a/OxyPlot/Source/OxyPlot.WindowsForms/OxyPlot.WindowsForms.csproj +++ b/OxyPlot/Source/OxyPlot.WindowsForms/OxyPlot.WindowsForms.csproj @@ -45,8 +45,7 @@ - ..\..\..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/OxyPlot/Source/OxyPlot.WindowsForms/packages.config b/OxyPlot/Source/OxyPlot.WindowsForms/packages.config index 0bbf652..2bc3b5b 100644 --- a/OxyPlot/Source/OxyPlot.WindowsForms/packages.config +++ b/OxyPlot/Source/OxyPlot.WindowsForms/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/OxyPlot/Source/OxyPlot/OxyPlot.csproj b/OxyPlot/Source/OxyPlot/OxyPlot.csproj index 8770450..f414e45 100644 --- a/OxyPlot/Source/OxyPlot/OxyPlot.csproj +++ b/OxyPlot/Source/OxyPlot/OxyPlot.csproj @@ -34,8 +34,7 @@ - ..\..\..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/OxyPlot/Source/OxyPlot/packages.config b/OxyPlot/Source/OxyPlot/packages.config index 0bbf652..2bc3b5b 100644 --- a/OxyPlot/Source/OxyPlot/packages.config +++ b/OxyPlot/Source/OxyPlot/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/SQLiteDatabase/SQLiteDatabase/SQLiteDatabase.csproj b/SQLiteDatabase/SQLiteDatabase/SQLiteDatabase.csproj index e50609d..d6697ac 100644 --- a/SQLiteDatabase/SQLiteDatabase/SQLiteDatabase.csproj +++ b/SQLiteDatabase/SQLiteDatabase/SQLiteDatabase.csproj @@ -72,8 +72,7 @@ - ..\..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/SQLiteDatabase/SQLiteDatabase/packages.config b/SQLiteDatabase/SQLiteDatabase/packages.config index 0bbf652..2bc3b5b 100644 --- a/SQLiteDatabase/SQLiteDatabase/packages.config +++ b/SQLiteDatabase/SQLiteDatabase/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/ScoutBase/ScoutBase.Core/ScoutBase.Core.csproj b/ScoutBase/ScoutBase.Core/ScoutBase.Core.csproj index e4b7e24..1496405 100644 --- a/ScoutBase/ScoutBase.Core/ScoutBase.Core.csproj +++ b/ScoutBase/ScoutBase.Core/ScoutBase.Core.csproj @@ -54,8 +54,7 @@ - ..\..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/ScoutBase/ScoutBase.Core/packages.config b/ScoutBase/ScoutBase.Core/packages.config index 0bbf652..2bc3b5b 100644 --- a/ScoutBase/ScoutBase.Core/packages.config +++ b/ScoutBase/ScoutBase.Core/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/ScoutBase/ScoutBase.Database/ScoutBase.Database.csproj b/ScoutBase/ScoutBase.Database/ScoutBase.Database.csproj index 09d52d1..b51ae0c 100644 --- a/ScoutBase/ScoutBase.Database/ScoutBase.Database.csproj +++ b/ScoutBase/ScoutBase.Database/ScoutBase.Database.csproj @@ -33,6 +33,9 @@ 4 + + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll + diff --git a/ScoutBase/ScoutBase.Database/packages.config b/ScoutBase/ScoutBase.Database/packages.config index 4b05315..2bc3b5b 100644 --- a/ScoutBase/ScoutBase.Database/packages.config +++ b/ScoutBase/ScoutBase.Database/packages.config @@ -1,4 +1,5 @@  + \ No newline at end of file diff --git a/ScoutBase/ScoutBase.Elevation/ElevationDatabaseUpdater.cs b/ScoutBase/ScoutBase.Elevation/ElevationDatabaseUpdater.cs index 9142901..16a77c9 100644 --- a/ScoutBase/ScoutBase.Elevation/ElevationDatabaseUpdater.cs +++ b/ScoutBase/ScoutBase.Elevation/ElevationDatabaseUpdater.cs @@ -42,10 +42,16 @@ namespace ScoutBase.Elevation { ElevationDatabaseUpdaterStartOptions StartOptions; + // Temp directory to save downloaded files + string TmpDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), Application.CompanyName, Application.ProductName, "Tmp").TrimEnd(Path.DirectorySeparatorChar); + public ElevationDatabaseUpdater() : base() { this.WorkerReportsProgress = true; this.WorkerSupportsCancellation = true; + // create temp directory if not exists + if (!Directory.Exists(TmpDirectory)) + Directory.CreateDirectory(TmpDirectory); } // TRICKY: process a single elevation tile. @@ -258,6 +264,148 @@ namespace ScoutBase.Elevation return true; } + private DateTime GetDatabaseTimeStamp() + { + string filename = ElevationData.Database.GetDBLocation(StartOptions.Model); + DateTime dt = File.GetLastWriteTimeUtc(filename).ToUniversalTime(); + // convert to YYYY:MM:DD hh:mm:ss only as this is stored in settings + dt = new DateTime(dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, dt.Second, DateTimeKind.Utc); + return dt; + } + + private DATABASESTATUS GetDatabaseStatus() + { + return ElevationData.Database.GetDBStatus(StartOptions.Model); + } + + private DateTime GetUpdateTimeStamp() + { + string filename = Path.Combine(ElevationData.Database.DefaultDatabaseDirectory(StartOptions.Model), ElevationData.Database.JSONFile(StartOptions.Model)); + DateTime dt = File.GetLastWriteTimeUtc(filename).ToUniversalTime(); + // convert to YYYY:MM:DD hh:mm:ss only as this is stored in settings + dt = new DateTime(dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, dt.Second, DateTimeKind.Utc); + return dt; + } + + private DateTime GetSavedTimeStamp() + { + DateTime dt = DateTime.MinValue; + if ((StartOptions.Model == ELEVATIONMODEL.GLOBE) && (Properties.Settings.Default.Elevation_GLOBE_TimeStamp != null)) + dt = Properties.Settings.Default.Elevation_GLOBE_TimeStamp; + else if ((StartOptions.Model == ELEVATIONMODEL.SRTM3) && (Properties.Settings.Default.Elevation_SRTM3_TimeStamp != null)) + dt = Properties.Settings.Default.Elevation_SRTM3_TimeStamp; + else if ((StartOptions.Model == ELEVATIONMODEL.SRTM1) && (Properties.Settings.Default.Elevation_SRTM1_TimeStamp != null)) + dt = Properties.Settings.Default.Elevation_SRTM1_TimeStamp; + // change kind to UTC as it is not specified in settings + dt = DateTime.SpecifyKind(dt, DateTimeKind.Utc); + return dt; + } + + private DATABASESTATUS GetSavedDatabaseStatus() + { + if (StartOptions.Model == ELEVATIONMODEL.GLOBE) + return Properties.Settings.Default.Elevation_GLOBE_Status; + else if (StartOptions.Model == ELEVATIONMODEL.SRTM3) + return Properties.Settings.Default.Elevation_SRTM3_Status; + else if (StartOptions.Model == ELEVATIONMODEL.SRTM1) + return Properties.Settings.Default.Elevation_SRTM1_Status; + return DATABASESTATUS.UNDEFINED; + } + + private DateTime GetSavedUpdateTimeStamp() + { + DateTime dt = DateTime.MinValue; + if (StartOptions.Model == ELEVATIONMODEL.GLOBE) + dt = Properties.Settings.Default.Elevation_GLOBE_Update_TimeStamp; + else if (StartOptions.Model == ELEVATIONMODEL.SRTM3) + dt = Properties.Settings.Default.Elevation_SRTM3_Update_TimeStamp; + else if (StartOptions.Model == ELEVATIONMODEL.SRTM1) + dt = Properties.Settings.Default.Elevation_SRTM1_Update_TimeStamp; + // change kind to UTC as it is not specified in settings + dt = DateTime.SpecifyKind(dt, DateTimeKind.Utc); + return dt; + } + + private void SaveDatabaseTimeStamp() + { + if (StartOptions.Model == ELEVATIONMODEL.GLOBE) + Properties.Settings.Default.Elevation_GLOBE_TimeStamp = GetDatabaseTimeStamp(); + else if (StartOptions.Model == ELEVATIONMODEL.SRTM3) + Properties.Settings.Default.Elevation_SRTM3_TimeStamp = GetDatabaseTimeStamp(); + else if (StartOptions.Model == ELEVATIONMODEL.SRTM1) + Properties.Settings.Default.Elevation_SRTM1_TimeStamp = GetDatabaseTimeStamp(); + } + + private void SaveDatabaseStatus() + { + if (StartOptions.Model == ELEVATIONMODEL.GLOBE) + Properties.Settings.Default.Elevation_GLOBE_Status = GetDatabaseStatus(); + else if (StartOptions.Model == ELEVATIONMODEL.SRTM3) + Properties.Settings.Default.Elevation_SRTM3_Status = GetDatabaseStatus(); + else if (StartOptions.Model == ELEVATIONMODEL.SRTM1) + Properties.Settings.Default.Elevation_SRTM1_Status = GetDatabaseStatus(); + } + + private void SaveUpdateTimeStamp() + { + if (StartOptions.Model == ELEVATIONMODEL.GLOBE) + Properties.Settings.Default.Elevation_GLOBE_Update_TimeStamp = GetUpdateTimeStamp(); + else if (StartOptions.Model == ELEVATIONMODEL.SRTM3) + Properties.Settings.Default.Elevation_SRTM3_Update_TimeStamp = GetUpdateTimeStamp(); + else if (StartOptions.Model == ELEVATIONMODEL.SRTM1) + Properties.Settings.Default.Elevation_SRTM1_Update_TimeStamp = GetUpdateTimeStamp(); + } + + private void SaveBounds() + { + Properties.Settings.Default.MaxLat = StartOptions.MaxLat; + Properties.Settings.Default.MinLat = StartOptions.MinLat; + Properties.Settings.Default.MaxLon = StartOptions.MaxLon; + Properties.Settings.Default.MinLon = StartOptions.MinLon; + } + + private bool HasDatabaseChanged() + { + try + { + DateTime dt1 = GetSavedTimeStamp(); + DateTime dt2 = GetDatabaseTimeStamp(); + return dt1 != dt2; + } + catch + { + // do nothing + } + return true; + } + + private bool HasUpdateChanged() + { + try + { + DateTime dt1 = GetSavedUpdateTimeStamp(); + DateTime dt2 = GetUpdateTimeStamp(); + return dt1 != dt2; + } + catch + { + // do nothing + } + return true; + } + + private bool HaveBoundsChanged() + { + if (StartOptions.MaxLat != Properties.Settings.Default.MaxLat) + return true; + if (StartOptions.MinLat != Properties.Settings.Default.MinLat) + return true; + if (StartOptions.MaxLon != Properties.Settings.Default.MaxLon) + return true; + if (StartOptions.MinLon != Properties.Settings.Default.MinLon) + return true; + return false; + } protected override void OnDoWork(DoWorkEventArgs e) { @@ -277,10 +425,6 @@ namespace ScoutBase.Elevation // check if any kind of update is enabled if ((StartOptions.Options == BACKGROUNDUPDATERSTARTOPTIONS.RUNONCE) || (StartOptions.Options == BACKGROUNDUPDATERSTARTOPTIONS.RUNPERIODICALLY)) { - // get temp directory - string TmpDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), Application.CompanyName, Application.ProductName, "Tmp").TrimEnd(Path.DirectorySeparatorChar); - if (!Directory.Exists(TmpDirectory)) - Directory.CreateDirectory(TmpDirectory); // reset status ElevationData.Database.SetDBStatus(StartOptions.Model, DATABASESTATUS.UNDEFINED); this.ReportProgress(1, ElevationData.Database.GetDBStatus(StartOptions.Model)); @@ -294,68 +438,86 @@ namespace ScoutBase.Elevation { this.ReportProgress(-1, ex.ToString()); } - // check if database is complete - this.ReportProgress(0, "Checking " + StartOptions.Name + "..."); Stopwatch st = new Stopwatch(); st.Start(); - bool b = IsDatabaseComplete(); - st.Stop(); - if (b) + // check last change of database file + if (HasDatabaseChanged() || HasUpdateChanged() || HaveBoundsChanged()) { - // set status - ElevationData.Database.SetDBStatusBit(StartOptions.Model, DATABASESTATUS.COMPLETE); - // set bounds - ElevationData.Database.MinLat = StartOptions.MinLat; - ElevationData.Database.MinLon = StartOptions.MinLon; - ElevationData.Database.MaxLat = StartOptions.MaxLat; - ElevationData.Database.MaxLon = StartOptions.MaxLon; + // database and/or update has changed --> full check necessary + // check if database is complete + this.ReportProgress(0, "Checking " + StartOptions.Name + "..."); + bool b = IsDatabaseComplete(); + st.Stop(); + if (b) + { + // set status + ElevationData.Database.SetDBStatusBit(StartOptions.Model, DATABASESTATUS.COMPLETE); + // set bounds + ElevationData.Database.MinLat = StartOptions.MinLat; + ElevationData.Database.MinLon = StartOptions.MinLon; + ElevationData.Database.MaxLat = StartOptions.MaxLat; + ElevationData.Database.MaxLon = StartOptions.MaxLon; - this.ReportProgress(0, StartOptions.Name + " complete: " + st.ElapsedMilliseconds / 1000 + "sec."); - } - else - { - ElevationData.Database.ResetDBStatusBit(StartOptions.Model, DATABASESTATUS.COMPLETE); - } - this.ReportProgress(1, ElevationData.Database.GetDBStatus(StartOptions.Model)); - if (this.CancellationPending) - break; - st.Restart(); - // update elevation database if necessary - this.ReportProgress(0, "Updating " + StartOptions.Name + "..."); - // reset database status - ElevationData.Database.ResetDBStatusBit(StartOptions.Model, DATABASESTATUS.UPTODATE); - ElevationData.Database.ResetDBStatusBit(StartOptions.Model, DATABASESTATUS.ERROR); - ElevationData.Database.SetDBStatusBit(StartOptions.Model, DATABASESTATUS.UPDATING); - this.ReportProgress(1, ElevationData.Database.GetDBStatus(StartOptions.Model)); - // start update - int er = -UpdateDatabase(); - // set database status - ElevationData.Database.ResetDBStatusBit(StartOptions.Model, DATABASESTATUS.UPDATING); - if (er > 0) - { - ElevationData.Database.SetDBStatusBit(StartOptions.Model, DATABASESTATUS.ERROR); - } - else - { + this.ReportProgress(0, StartOptions.Name + " complete: " + st.ElapsedMilliseconds / 1000 + "sec."); + } + else + { + ElevationData.Database.ResetDBStatusBit(StartOptions.Model, DATABASESTATUS.COMPLETE); + } + this.ReportProgress(1, ElevationData.Database.GetDBStatus(StartOptions.Model)); + if (this.CancellationPending) + break; + st.Restart(); + // update elevation database if necessary + this.ReportProgress(0, "Updating " + StartOptions.Name + "..."); + // reset database status + ElevationData.Database.ResetDBStatusBit(StartOptions.Model, DATABASESTATUS.UPTODATE); ElevationData.Database.ResetDBStatusBit(StartOptions.Model, DATABASESTATUS.ERROR); - ElevationData.Database.SetDBStatusBit(StartOptions.Model, DATABASESTATUS.UPTODATE); - } - this.ReportProgress(1, ElevationData.Database.GetDBStatus(StartOptions.Model)); - st.Stop(); - if (this.CancellationPending) - break; + ElevationData.Database.SetDBStatusBit(StartOptions.Model, DATABASESTATUS.UPDATING); + this.ReportProgress(1, ElevationData.Database.GetDBStatus(StartOptions.Model)); + // start update + int er = -UpdateDatabase(); + // set database status + ElevationData.Database.ResetDBStatusBit(StartOptions.Model, DATABASESTATUS.UPDATING); + if (er > 0) + { + ElevationData.Database.SetDBStatusBit(StartOptions.Model, DATABASESTATUS.ERROR); + } + else + { + ElevationData.Database.ResetDBStatusBit(StartOptions.Model, DATABASESTATUS.ERROR); + ElevationData.Database.SetDBStatusBit(StartOptions.Model, DATABASESTATUS.UPTODATE); + } + this.ReportProgress(1, ElevationData.Database.GetDBStatus(StartOptions.Model)); + st.Stop(); + if (this.CancellationPending) + break; - // display status - if (errors == 0) + // display status + if (errors == 0) + { + this.ReportProgress(0, StartOptions.Name + " update completed: " + st.Elapsed.ToString(@"hh\:mm\:ss")); + } + else + { + this.ReportProgress(0, StartOptions.Name + " update completed with errors[" + errors.ToString() + "]: " + st.Elapsed.ToString(@"hh\:mm\:ss")); + } + // store database timestamp & status in settings + SaveDatabaseTimeStamp(); + SaveDatabaseStatus(); + SaveUpdateTimeStamp(); + SaveBounds(); + // sleep once to get all messages to main thread + Thread.Sleep(1000); + } + else { + // database and update not changed -> nothing to do + // restore database status + ElevationData.Database.SetDBStatus(StartOptions.Model, GetSavedDatabaseStatus()); + this.ReportProgress(1, ElevationData.Database.GetDBStatus(StartOptions.Model)); this.ReportProgress(0, StartOptions.Name + " update completed: " + st.Elapsed.ToString(@"hh\:mm\:ss")); } - else - { - this.ReportProgress(0, StartOptions.Name + " update completed with errors[" + errors.ToString() + "]: " + st.Elapsed.ToString(@"hh\:mm\:ss")); - } - // sleep once to get all messages to main thread - Thread.Sleep(1000); // sleep when running periodically if (StartOptions.Options == BACKGROUNDUPDATERSTARTOPTIONS.RUNPERIODICALLY) diff --git a/ScoutBase/ScoutBase.Elevation/Properties/Settings.Designer.cs b/ScoutBase/ScoutBase.Elevation/Properties/Settings.Designer.cs index 0e7fb32..3293600 100644 --- a/ScoutBase/ScoutBase.Elevation/Properties/Settings.Designer.cs +++ b/ScoutBase/ScoutBase.Elevation/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace ScoutBase.Elevation.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.5.0.0")] public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); @@ -178,5 +178,161 @@ namespace ScoutBase.Elevation.Properties { this["Database_BackgroundUpdate_ThreadWait"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("1970-01-01")] + public global::System.DateTime Elevation_GLOBE_TimeStamp { + get { + return ((global::System.DateTime)(this["Elevation_GLOBE_TimeStamp"])); + } + set { + this["Elevation_GLOBE_TimeStamp"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("1970-01-01")] + public global::System.DateTime Elevation_SRTM3_TimeStamp { + get { + return ((global::System.DateTime)(this["Elevation_SRTM3_TimeStamp"])); + } + set { + this["Elevation_SRTM3_TimeStamp"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("1970-01-01")] + public global::System.DateTime Elevation_SRTM1_TimeStamp { + get { + return ((global::System.DateTime)(this["Elevation_SRTM1_TimeStamp"])); + } + set { + this["Elevation_SRTM1_TimeStamp"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("UNDEFINED")] + public global::System.Data.SQLite.DATABASESTATUS Elevation_GLOBE_Status { + get { + return ((global::System.Data.SQLite.DATABASESTATUS)(this["Elevation_GLOBE_Status"])); + } + set { + this["Elevation_GLOBE_Status"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("UNDEFINED")] + public global::System.Data.SQLite.DATABASESTATUS Elevation_SRTM3_Status { + get { + return ((global::System.Data.SQLite.DATABASESTATUS)(this["Elevation_SRTM3_Status"])); + } + set { + this["Elevation_SRTM3_Status"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("UNDEFINED")] + public global::System.Data.SQLite.DATABASESTATUS Elevation_SRTM1_Status { + get { + return ((global::System.Data.SQLite.DATABASESTATUS)(this["Elevation_SRTM1_Status"])); + } + set { + this["Elevation_SRTM1_Status"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("1970-01-01")] + public global::System.DateTime Elevation_GLOBE_Update_TimeStamp { + get { + return ((global::System.DateTime)(this["Elevation_GLOBE_Update_TimeStamp"])); + } + set { + this["Elevation_GLOBE_Update_TimeStamp"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("1970-01-01")] + public global::System.DateTime Elevation_SRTM3_Update_TimeStamp { + get { + return ((global::System.DateTime)(this["Elevation_SRTM3_Update_TimeStamp"])); + } + set { + this["Elevation_SRTM3_Update_TimeStamp"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("1970-01-01")] + public global::System.DateTime Elevation_SRTM1_Update_TimeStamp { + get { + return ((global::System.DateTime)(this["Elevation_SRTM1_Update_TimeStamp"])); + } + set { + this["Elevation_SRTM1_Update_TimeStamp"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0")] + public double MaxLat { + get { + return ((double)(this["MaxLat"])); + } + set { + this["MaxLat"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0")] + public double MinLat { + get { + return ((double)(this["MinLat"])); + } + set { + this["MinLat"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0")] + public double MaxLon { + get { + return ((double)(this["MaxLon"])); + } + set { + this["MaxLon"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0")] + public double MinLon { + get { + return ((double)(this["MinLon"])); + } + set { + this["MinLon"] = value; + } + } } } diff --git a/ScoutBase/ScoutBase.Elevation/Properties/Settings.settings b/ScoutBase/ScoutBase.Elevation/Properties/Settings.settings index 6381fb5..2c75ad6 100644 --- a/ScoutBase/ScoutBase.Elevation/Properties/Settings.settings +++ b/ScoutBase/ScoutBase.Elevation/Properties/Settings.settings @@ -41,5 +41,44 @@ 0 + + 1970-01-01 + + + 1970-01-01 + + + 1970-01-01 + + + UNDEFINED + + + UNDEFINED + + + UNDEFINED + + + 1970-01-01 + + + 1970-01-01 + + + 1970-01-01 + + + 0 + + + 0 + + + 0 + + + 0 + \ No newline at end of file diff --git a/ScoutBase/ScoutBase.Elevation/ScoutBase.Elevation.csproj b/ScoutBase/ScoutBase.Elevation/ScoutBase.Elevation.csproj index 327c4fb..fda19c8 100644 --- a/ScoutBase/ScoutBase.Elevation/ScoutBase.Elevation.csproj +++ b/ScoutBase/ScoutBase.Elevation/ScoutBase.Elevation.csproj @@ -52,8 +52,7 @@ - ..\..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/ScoutBase/ScoutBase.Elevation/app.config b/ScoutBase/ScoutBase.Elevation/app.config index 466e2eb..16bdd60 100644 --- a/ScoutBase/ScoutBase.Elevation/app.config +++ b/ScoutBase/ScoutBase.Elevation/app.config @@ -48,6 +48,45 @@ 0 + + 1970-01-01 + + + 1970-01-01 + + + 1970-01-01 + + + UNDEFINED + + + UNDEFINED + + + UNDEFINED + + + 1970-01-01 + + + 1970-01-01 + + + 1970-01-01 + + + 0 + + + 0 + + + 0 + + + 0 + diff --git a/ScoutBase/ScoutBase.Elevation/packages.config b/ScoutBase/ScoutBase.Elevation/packages.config index 0bbf652..2bc3b5b 100644 --- a/ScoutBase/ScoutBase.Elevation/packages.config +++ b/ScoutBase/ScoutBase.Elevation/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/ScoutBase/ScoutBase.Maps/MapDatabase.cs b/ScoutBase/ScoutBase.Maps/MapDatabase.cs new file mode 100644 index 0000000..5c94d19 --- /dev/null +++ b/ScoutBase/ScoutBase.Maps/MapDatabase.cs @@ -0,0 +1,313 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Data.SQLite; +using SQLiteDatabase; +using System.IO; +using ScoutBase.Core; +using ScoutBase.Database; +using System.Data; + +namespace ScoutBase.Maps +{ + public class DefaultDatabaseDirectory + { + public new string ToString() + { + // create default database directory name + string dir = Properties.Settings.Default.Database_Directory; + if (!String.IsNullOrEmpty(dir)) + { + return dir; + } + // empty settings -_> create standard path + return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "GMap.NET", "TileDBv5", "en"); + } + } + + + public class MapData + { + static MapDatabase map = new MapDatabase(); + public static MapDatabase Database + { + get + { + return map; + } + } + + } + + /// + /// Holds the Map information in a database structure. + /// + public class MapDatabase : ScoutBaseDatabase + { + + public string TilesTableName = "Tiles"; + public string TilesDataTableName = "TilesData"; + + public MapDatabase() + { + UserVersion = 5; + Name = "ScoutBase Map Database (GMaps.NET)"; + Description = "The Scoutbase Map Database is containing map tiles and is serviced mainly from GMaps.NET library.\n" + + "This object provides an interface for direct reading from / writing to database."; + // add table description manually + TableDescriptions.Add(TilesTableName, "Holds map tile inoformation."); + TableDescriptions.Add(TilesDataTableName, "Holds map tile data."); + db = OpenDatabase("Data.gmdb", DefaultDatabaseDirectory(), Properties.Settings.Default.Database_InMemory); + // create tables with schemas if not exist + if (!TilesTableExists()) + TilesCreateTable(); + if (!TilesDataTableExists()) + TilesDataCreateTable(); + } + + public string DefaultDatabaseDirectory() + { + // create default database directory name + string dir = Properties.Settings.Default.Database_Directory; + if (!String.IsNullOrEmpty(dir)) + { + return dir; + } + // empty settings -_> create standard path + return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "GMap.NET", "TileDBv5", "en"); + } + + + #region Tiles + + public bool TilesTableExists(string tablename = "") + { + // check for table name is null or empty --> use default tablename from type instead + string tn = tablename; + if (String.IsNullOrEmpty(tn)) + tn = TilesTableName; + return db.TableExists(tn); + } + + public bool TilesDataTableExists(string tablename = "") + { + // check for table name is null or empty --> use default tablename from type instead + string tn = tablename; + if (String.IsNullOrEmpty(tn)) + tn = TilesDataTableName; + return db.TableExists(tn); + } + + public void TilesCreateTable(string tablename = "") + { + lock (db.DBCommand) + { + // check for table name is null or empty --> use default tablename from type instead + string tn = tablename; + if (String.IsNullOrEmpty(tn)) + tn = TilesTableName; + db.DBCommand.CommandText = "CREATE TABLE Tiles (id INTEGER NOT NULL PRIMARY KEY, X INTEGER NOT NULL, Y INTEGER NOT NULL, Zoom INTEGER NOT NULL, Type UNSIGNED INTEGER NOT NULL, CacheTime DATETIME)"; + db.DBCommand.Parameters.Clear(); + db.Execute(db.DBCommand); + } + } + + public void TilesDataCreateTable(string tablename = "") + { + lock (db.DBCommand) + { + // check for table name is null or empty --> use default tablename from type instead + string tn = tablename; + if (String.IsNullOrEmpty(tn)) + tn = TilesDataTableName; + db.DBCommand.CommandText = "CREATE TABLE TilesData (id INTEGER NOT NULL PRIMARY KEY CONSTRAINT fk_Tiles_id REFERENCES Tiles(id) ON DELETE CASCADE, Tile BLOB NULL)"; + db.DBCommand.Parameters.Clear(); + db.Execute(db.DBCommand); + } + } + + public long TilesCount() + { + long count = (long)db.ExecuteScalar("SELECT COUNT(*) FROM " + TilesTableName); + if (count <= 0) + return 0; + return count; + } + + public long TilesDataCount() + { + long count = (long)db.ExecuteScalar("SELECT COUNT(*) FROM " + TilesDataTableName); + if (count <= 0) + return 0; + return count; + } + + public bool TileExists(int x, int y, int z, int type) + { + lock (db.DBCommand) + { + db.DBCommand.CommandText = "SELECT EXISTS (SELECT CacheTime FROM " + TilesTableName + " WHERE X = @x AND Y = @y AND Zoom = @z AND Type = @type)"; + db.DBCommand.Parameters.Clear(); + db.DBCommand.Parameters.Add(new SQLiteParameter("@x", x)); + db.DBCommand.Parameters.Add(new SQLiteParameter("@y", y)); + db.DBCommand.Parameters.Add(new SQLiteParameter("@z", z)); + db.DBCommand.Parameters.Add(new SQLiteParameter("@type", type)); + long result = (long)db.DBCommand.ExecuteScalar(); + if (result > 0) + return true; + } + return false; + } + + public MapTileInfo TileFind(int id) + { + db.DBCommand.CommandText = "SELECT * FROM " + TilesTableName + " WHERE id = @id"; + db.DBCommand.Parameters.Clear(); + db.DBCommand.Parameters.Add(new SQLiteParameter("@id", id)); + DataTable dt = db.Select(db.DBCommand); + if (dt != null) + { + DataRow row = dt.Rows[0]; + int _id = System.Convert.ToInt32(row[0]); + int _x = System.Convert.ToInt32(row[1]); + int _y = System.Convert.ToInt32(row[2]); + int _zoom = System.Convert.ToInt32(row[3]); + int _type = System.Convert.ToInt32(row[4]); + DateTime _cachetime = ((DateTime)row[5]).ToLocalTime(); + MapTileInfo m = new MapTileInfo(_id, _x, _y, _zoom, _type, _cachetime); + return m; + } + return null; + } + + public MapTileInfo TileFind(int x, int y, int z, int type) + { + db.DBCommand.CommandText = "SELECT * FROM " + TilesTableName + " WHERE X = @x AND Y = @y AND Zoom = @z AND Type = @type"; + db.DBCommand.Parameters.Clear(); + db.DBCommand.Parameters.Add(new SQLiteParameter("@x", x)); + db.DBCommand.Parameters.Add(new SQLiteParameter("@y", y)); + db.DBCommand.Parameters.Add(new SQLiteParameter("@z", z)); + db.DBCommand.Parameters.Add(new SQLiteParameter("@type", type)); + DataTable dt = db.Select(db.DBCommand); + if (dt != null) + { + DataRow row = dt.Rows[0]; + int _id = System.Convert.ToInt32(row[0]); + int _x = System.Convert.ToInt32(row[1]); + int _y = System.Convert.ToInt32(row[2]); + int _zoom = System.Convert.ToInt32(row[3]); + int _type = System.Convert.ToInt32(row[4]); + DateTime _cachetime = ((DateTime)row[5]).ToLocalTime(); + MapTileInfo m = new MapTileInfo(_id, _x, _y, _zoom, _type, _cachetime); + return m; + } + return null; + } + + public MapTileData TileDataFind(int id) + { + db.DBCommand.CommandText = "SELECT * FROM " + TilesDataTableName + " WHERE id = @id"; + db.DBCommand.Parameters.Clear(); + db.DBCommand.Parameters.Add(new SQLiteParameter("@id", id)); + DataTable dt = db.Select(db.DBCommand); + if (dt != null) + { + MapTileData m = new MapTileData(System.Convert.ToInt32(dt.Rows[0][0]), (byte[])dt.Rows[0][1]); + return m; + } + return null; + } + + public int TileInsert(int x, int y, int z, int type, DateTime cachetime, byte[] tile) + { + int id = -1; +// db.BeginTransaction(); + try + { + id = System.Convert.ToInt32(db.ExecuteScalar("SELECT MAX(id) FROM " + TilesTableName)) + 1; + lock (db.DBCommand) + { + db.DBCommand.CommandText = "INSERT INTO " + TilesTableName + " (id, X, Y, Zoom, Type, CacheTime) VALUES (@id, @x, @y, @z, @type, @cachetime)"; + db.DBCommand.Parameters.Clear(); + db.DBCommand.Parameters.Add(new SQLiteParameter("@id", id)); + db.DBCommand.Parameters.Add(new SQLiteParameter("@x", x)); + db.DBCommand.Parameters.Add(new SQLiteParameter("@y", y)); + db.DBCommand.Parameters.Add(new SQLiteParameter("@z", z)); + db.DBCommand.Parameters.Add(new SQLiteParameter("@type", type)); + db.DBCommand.Parameters.Add(new SQLiteParameter("@cachetime", cachetime)); + db.ExecuteNonQuery(db.DBCommand); + db.DBCommand.CommandText = "INSERT INTO " + TilesDataTableName + " (id, Tile) VALUES (@id, @tile)"; + db.DBCommand.Parameters.Clear(); + db.DBCommand.Parameters.Add(new SQLiteParameter("@id", id)); + db.DBCommand.Parameters.Add(new SQLiteParameter("@tile", tile)); + db.ExecuteNonQuery(db.DBCommand); + } + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + } +// db.Commit(); + return id; + } + + public int TileDeleteAll() + { + db.BeginTransaction(); + int result; + lock (db.DBCommand) + { + db.DBCommand.CommandText = "DELETE FROM " + TilesTableName; + db.DBCommand.Parameters.Clear(); + result = db.ExecuteNonQuery(db.DBCommand); + db.DBCommand.CommandText = "DELETE FROM " + TilesDataTableName; + db.DBCommand.Parameters.Clear(); + result = db.ExecuteNonQuery(db.DBCommand); + } + db.Commit(); + return result; + } + + public int TileDelete(int id) + { + db.BeginTransaction(); + int result; + lock (db.DBCommand) + { + db.DBCommand.CommandText = "DELETE FROM " + TilesTableName + " WHERE id = " + id.ToString(); + db.DBCommand.Parameters.Clear(); + result = db.ExecuteNonQuery(db.DBCommand); + db.DBCommand.CommandText = "DELETE FROM " + TilesDataTableName + " WHERE id = " + id.ToString(); + db.DBCommand.Parameters.Clear(); + result = db.ExecuteNonQuery(db.DBCommand); + } + db.Commit(); + return result; + } + + public List TilesGetAll() + { + List l = new List(); + DataTable dt = db.Select("SELECT * FROM " + TilesTableName); + if (dt != null) + { + foreach (DataRow row in dt.Rows) + { + int _id = System.Convert.ToInt32(row[0]); + int _x = System.Convert.ToInt32(row[1]); + int _y = System.Convert.ToInt32(row[2]); + int _zoom = System.Convert.ToInt32(row[3]); + int _type = System.Convert.ToInt32(row[4]); + DateTime _cachetime = ((DateTime)row[5]).ToLocalTime(); + MapTileInfo m = new MapTileInfo(_id, _x, _y, _zoom, _type, _cachetime); + l.Add(m); + } + } + return l; + } + #endregion + + } +} + diff --git a/ScoutBase/ScoutBase.Maps/MapTile.cs b/ScoutBase/ScoutBase.Maps/MapTile.cs new file mode 100644 index 0000000..d694ec2 --- /dev/null +++ b/ScoutBase/ScoutBase.Maps/MapTile.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Net; +using System.IO; +using System.Xml.Linq; +using System.Globalization; +using System.Reflection; +using System.Diagnostics; +using System.Runtime.InteropServices; +using System.ComponentModel; +using System.Configuration; +using System.Data; +using System.Data.SQLite; +using System.Xml; +using System.Xml.Serialization; +using ScoutBase.Core; +using Newtonsoft.Json; + +namespace ScoutBase.Maps +{ + + /// + /// Holds the map tile information + /// + [System.ComponentModel.DesignerCategory("")] + public class MapTileInfo + { + public int ID; + public int X; + public int Y; + public int Zoom; + public int Type; + public DateTime CacheTime; + + public MapTileInfo(int id, int x, int y, int zoom, int type, DateTime cachetime) + { + ID = id; + X = x; + Y = y; + Zoom = zoom; + Type = type; + CacheTime = cachetime; + } + } + + /// + /// Holds the map tile data + /// + [System.ComponentModel.DesignerCategory("")] + public class MapTileData + { + public int ID; + public byte[] Tile; + + public MapTileData(int id, byte[] tile) + { + ID = id; + Tile = new byte[tile.Length]; + Array.Copy(tile, Tile, tile.Length); + } + } +} diff --git a/ScoutBase/ScoutBase.Maps/Properties/AssemblyInfo.cs b/ScoutBase/ScoutBase.Maps/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..5cc4282 --- /dev/null +++ b/ScoutBase/ScoutBase.Maps/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Allgemeine Informationen über eine Assembly werden über die folgenden +// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +// die einer Assembly zugeordnet sind. +[assembly: AssemblyTitle("ScoutBase.Maps")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ScoutBase.Maps")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly +// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von +// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. +[assembly: ComVisible(false)] + +// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird +[assembly: Guid("b3b005a5-cc05-430b-b966-20be5e5985bf")] + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, +// indem Sie "*" wie unten gezeigt eingeben: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ScoutBase/ScoutBase.Maps/Properties/Settings.Designer.cs b/ScoutBase/ScoutBase.Maps/Properties/Settings.Designer.cs new file mode 100644 index 0000000..a854e39 --- /dev/null +++ b/ScoutBase/ScoutBase.Maps/Properties/Settings.Designer.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 +// +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. +// +//------------------------------------------------------------------------------ + +namespace ScoutBase.Maps.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.5.0.0")] + public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string Database_Directory { + get { + return ((string)(this["Database_Directory"])); + } + set { + this["Database_Directory"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool Database_InMemory { + get { + return ((bool)(this["Database_InMemory"])); + } + set { + this["Database_InMemory"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("http://www.airscout.eu/downloads/ScoutBase/1/MapData/OpenStreetMaps/")] + public string Database_UpdateURL { + get { + return ((string)(this["Database_UpdateURL"])); + } + set { + this["Database_UpdateURL"] = value; + } + } + } +} diff --git a/ScoutBase/ScoutBase.Maps/Properties/Settings.settings b/ScoutBase/ScoutBase.Maps/Properties/Settings.settings new file mode 100644 index 0000000..d325626 --- /dev/null +++ b/ScoutBase/ScoutBase.Maps/Properties/Settings.settings @@ -0,0 +1,15 @@ + + + + + + + + + False + + + http://www.airscout.eu/downloads/ScoutBase/1/MapData/OpenStreetMaps/ + + + \ No newline at end of file diff --git a/ScoutBase/ScoutBase.Maps/ScoutBase.Maps.csproj b/ScoutBase/ScoutBase.Maps/ScoutBase.Maps.csproj new file mode 100644 index 0000000..573ba6f --- /dev/null +++ b/ScoutBase/ScoutBase.Maps/ScoutBase.Maps.csproj @@ -0,0 +1,90 @@ + + + + + Debug + AnyCPU + {B3B005A5-CC05-430B-B966-20BE5E5985BF} + Library + Properties + ScoutBase.Maps + ScoutBase.Maps + v4.0 + 512 + true + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll + + + + + ..\..\packages\System.Data.SQLite.Core.1.0.112.0\lib\net40\System.Data.SQLite.dll + + + + + + + + + + + + + True + True + Settings.settings + + + + + {6056d3be-7002-4a6a-a9ea-6ff45122a3c7} + SQLiteDatabase + + + {ee86e933-d883-4b18-80eb-0fba55ec67c6} + ScoutBase.Core + + + {89e6c7a3-6064-479e-a710-37c7293cf47c} + ScoutBase.Database + + + + + + + PublicSettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}". + + + + \ No newline at end of file diff --git a/ScoutBase/ScoutBase.Maps/app.config b/ScoutBase/ScoutBase.Maps/app.config new file mode 100644 index 0000000..c648c82 --- /dev/null +++ b/ScoutBase/ScoutBase.Maps/app.config @@ -0,0 +1,21 @@ + + + + +
+ + + + + + + + + False + + + http://www.airscout.eu/downloads/ScoutBase/1/MapData/OpenStreetMaps/ + + + + \ No newline at end of file diff --git a/ScoutBase/ScoutBase.Maps/packages.config b/ScoutBase/ScoutBase.Maps/packages.config new file mode 100644 index 0000000..2bc3b5b --- /dev/null +++ b/ScoutBase/ScoutBase.Maps/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ScoutBase/ScoutBase.Propagation/Properties/Settings.Designer.cs b/ScoutBase/ScoutBase.Propagation/Properties/Settings.Designer.cs index cf53798..556cb0d 100644 --- a/ScoutBase/ScoutBase.Propagation/Properties/Settings.Designer.cs +++ b/ScoutBase/ScoutBase.Propagation/Properties/Settings.Designer.cs @@ -12,8 +12,8 @@ namespace ScoutBase.Propagation.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0")] + public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/ScoutBase/ScoutBase.Propagation/ScoutBase.Propagation.csproj b/ScoutBase/ScoutBase.Propagation/ScoutBase.Propagation.csproj index b8a0007..71475b4 100644 --- a/ScoutBase/ScoutBase.Propagation/ScoutBase.Propagation.csproj +++ b/ScoutBase/ScoutBase.Propagation/ScoutBase.Propagation.csproj @@ -34,8 +34,7 @@ - ..\..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll @@ -89,7 +88,7 @@ - SettingsSingleFileGenerator + PublicSettingsSingleFileGenerator Settings.Designer.cs diff --git a/ScoutBase/ScoutBase.Propagation/packages.config b/ScoutBase/ScoutBase.Propagation/packages.config index 0bbf652..2bc3b5b 100644 --- a/ScoutBase/ScoutBase.Propagation/packages.config +++ b/ScoutBase/ScoutBase.Propagation/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/ScoutBase/ScoutBase.Stations/Properties/Settings.Designer.cs b/ScoutBase/ScoutBase.Stations/Properties/Settings.Designer.cs index 156cf8e..878f534 100644 --- a/ScoutBase/ScoutBase.Stations/Properties/Settings.Designer.cs +++ b/ScoutBase/ScoutBase.Stations/Properties/Settings.Designer.cs @@ -82,5 +82,53 @@ namespace ScoutBase.Stations.Properties { this["Database_BackgroundUpdate_Period"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("1970-01-01")] + public global::System.DateTime Stations_TimeStamp { + get { + return ((global::System.DateTime)(this["Stations_TimeStamp"])); + } + set { + this["Stations_TimeStamp"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("UNDEFINED")] + public global::System.Data.SQLite.DATABASESTATUS Stations_Status { + get { + return ((global::System.Data.SQLite.DATABASESTATUS)(this["Stations_Status"])); + } + set { + this["Stations_Status"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("1970-01-01")] + public global::System.DateTime Locations_Update_TimeStamp { + get { + return ((global::System.DateTime)(this["Locations_Update_TimeStamp"])); + } + set { + this["Locations_Update_TimeStamp"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("1970-01-01")] + public global::System.DateTime QRV_Update_TimeStamp { + get { + return ((global::System.DateTime)(this["QRV_Update_TimeStamp"])); + } + set { + this["QRV_Update_TimeStamp"] = value; + } + } } } diff --git a/ScoutBase/ScoutBase.Stations/Properties/Settings.settings b/ScoutBase/ScoutBase.Stations/Properties/Settings.settings index f0564b3..224bb79 100644 --- a/ScoutBase/ScoutBase.Stations/Properties/Settings.settings +++ b/ScoutBase/ScoutBase.Stations/Properties/Settings.settings @@ -17,5 +17,17 @@ 60 + + 1970-01-01 + + + UNDEFINED + + + 1970-01-01 + + + 1970-01-01 + \ No newline at end of file diff --git a/ScoutBase/ScoutBase.Stations/ScoutBase.Stations.csproj b/ScoutBase/ScoutBase.Stations/ScoutBase.Stations.csproj index bd3218f..e48b0c1 100644 --- a/ScoutBase/ScoutBase.Stations/ScoutBase.Stations.csproj +++ b/ScoutBase/ScoutBase.Stations/ScoutBase.Stations.csproj @@ -34,8 +34,7 @@ - ..\..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/ScoutBase/ScoutBase.Stations/StationDatabase.cs b/ScoutBase/ScoutBase.Stations/StationDatabase.cs index 9dd08b9..1850bfc 100644 --- a/ScoutBase/ScoutBase.Stations/StationDatabase.cs +++ b/ScoutBase/ScoutBase.Stations/StationDatabase.cs @@ -944,7 +944,13 @@ namespace ScoutBase.Stations { lock (db.DBCommand) { - db.DBCommand.CommandText = "DELETE FROM " + QRVDesignator.TableName + " WHERE Call = @Call AND Loc = @Loc AND Band = @Band"; + // Handle delete of all bands + string bandwhere = ""; + if (qrv.Band != BAND.BALL) + bandwhere = " AND Band = @Band"; + else + bandwhere = ""; + db.DBCommand.CommandText = "DELETE FROM " + QRVDesignator.TableName + " WHERE Call = @Call AND Loc = @Loc" + bandwhere; db.DBCommand.Parameters.Clear(); db.DBCommand.Parameters.Add(qrv.AsString("Call")); db.DBCommand.Parameters.Add(qrv.AsString("Loc")); diff --git a/ScoutBase/ScoutBase.Stations/StationDatabaseUpdater.cs b/ScoutBase/ScoutBase.Stations/StationDatabaseUpdater.cs index 4ce2ec8..ffd53b2 100644 --- a/ScoutBase/ScoutBase.Stations/StationDatabaseUpdater.cs +++ b/ScoutBase/ScoutBase.Stations/StationDatabaseUpdater.cs @@ -28,6 +28,11 @@ namespace ScoutBase.Stations public class StationDatabaseUpdaterStartOptions { public string Name; + public bool RestrictToAreaOfInterest; + public double MinLat; + public double MinLon; + public double MaxLat; + public double MaxLon; public string InstanceID; public string SessionKey; public string GetKeyURL; @@ -42,18 +47,30 @@ namespace ScoutBase.Stations string Password = ""; StationDatabaseUpdaterStartOptions StartOptions; + // Temp directory to save downloaded files + string TmpDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), Application.CompanyName, Application.ProductName, "Tmp").TrimEnd(Path.DirectorySeparatorChar); + public StationDatabaseUpdater() : base() { this.WorkerReportsProgress = true; this.WorkerSupportsCancellation = true; + // create temp directory if not exists + if (!Directory.Exists(TmpDirectory)) + Directory.CreateDirectory(TmpDirectory); + } + + private DOWNLOADFILESTATUS GetUpdateFromURL(string url, string zipfilename, string filename) + { + AutoDecompressionWebClient cl = new AutoDecompressionWebClient(); + DOWNLOADFILESTATUS status = cl.DownloadFileIfNewer(url, zipfilename, true, true, Password); + return status; } private bool ReadLocationsFromURL(string url, string zipfilename, string filename) { try { - AutoDecompressionWebClient cl = new AutoDecompressionWebClient(); - DOWNLOADFILESTATUS status = cl.DownloadFileIfNewer(url, zipfilename, true, true, Password); + DOWNLOADFILESTATUS status = GetUpdateFromURL(url, zipfilename, filename); if (((status & DOWNLOADFILESTATUS.ERROR) > 0) && ((status & DOWNLOADFILESTATUS.NOTFOUND) > 0)) { this.ReportProgress(-1, "Error while downloading and extracting " + filename); @@ -64,7 +81,19 @@ namespace ScoutBase.Stations string json = ""; using (StreamReader sr = new StreamReader(filename)) json = sr.ReadToEnd(); - List lds = StationData.Database.LocationFromJSON(json); + List tmp = StationData.Database.LocationFromJSON(json); + List lds = new List(); + foreach (LocationDesignator ld in tmp) + { + // skip locations outsid area of interest if option set + if (StartOptions.RestrictToAreaOfInterest && ((ld.Lat < StartOptions.MinLat) || (ld.Lat > StartOptions.MaxLat) || (ld.Lon < StartOptions.MinLon) || (ld.Lon > StartOptions.MaxLon))) + continue; + lds.Add(ld); + if (this.CancellationPending) + return false; + // reduce CPU load + Thread.Sleep(1); + } // check for empty database if (StationData.Database.LocationCount() == 0) { @@ -91,8 +120,7 @@ namespace ScoutBase.Stations { try { - AutoDecompressionWebClient cl = new AutoDecompressionWebClient(); - DOWNLOADFILESTATUS status = cl.DownloadFileIfNewer(url, zipfilename, true, true, Password); + DOWNLOADFILESTATUS status = GetUpdateFromURL(url, zipfilename, filename); if (((status & DOWNLOADFILESTATUS.ERROR) > 0) && ((status & DOWNLOADFILESTATUS.NOTFOUND) > 0)) { this.ReportProgress(-1, "Error while downloading and extracting " + filename); @@ -103,7 +131,25 @@ namespace ScoutBase.Stations string json = ""; using (StreamReader sr = new StreamReader(filename)) json = sr.ReadToEnd(); - List qrvs = StationData.Database.QRVFromJSON(json); + List tmp = StationData.Database.QRVFromJSON(json); + List qrvs = new List(); + foreach (QRVDesignator qrv in tmp) + { + // skip locations outsid area of interest if option set + if (StartOptions.RestrictToAreaOfInterest) + { + LocationDesignator ld = StationData.Database.LocationFind(qrv.Call, qrv.Loc); + if ((ld == null) || ((ld.Lat < StartOptions.MinLat) || (ld.Lat > StartOptions.MaxLat) || (ld.Lon < StartOptions.MinLon) || (ld.Lon > StartOptions.MaxLon))) + continue; + qrvs.Add(qrv); + } + else + qrvs.Add(qrv); + if (this.CancellationPending) + return false; + // reduce CPU load + Thread.Sleep(1); + } // chek for empty database if (StationData.Database.QRVCount() == 0) { @@ -128,7 +174,15 @@ namespace ScoutBase.Stations private bool ReadLocationsFromV1_2 (string filename) { - List lds = StationData.Database.LocationFromV1_2(filename); + List tmp = StationData.Database.LocationFromV1_2(filename); + List lds = new List(); + foreach (LocationDesignator ld in tmp) + { + // skip locations outsid area of interest if option set + if (StartOptions.RestrictToAreaOfInterest && ((ld.Lat < StartOptions.MinLat) || (ld.Lat > StartOptions.MaxLat) || (ld.Lon < StartOptions.MinLon) || (ld.Lon > StartOptions.MaxLon))) + continue; + lds.Add(ld); + } try { foreach (LocationDesignator ld in lds) @@ -137,6 +191,8 @@ namespace ScoutBase.Stations this.ReportProgress(0, "Importing locations from V1.2 database: " + ld.Call + ", " + ld.Loc + ", " + ld.Source.ToString()); if (this.CancellationPending) return false; + // reduce CPU load + Thread.Sleep(1); } return true; } @@ -147,6 +203,136 @@ namespace ScoutBase.Stations return false; } + private DateTime GetDatabaseTimeStamp() + { + string filename = StationData.Database.GetDBLocation(); + DateTime dt = File.GetLastWriteTimeUtc(filename).ToUniversalTime(); + // convert to YYYY:MM:DD hh:mm:ss only as this is stored in settings + dt = new DateTime(dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, dt.Second, DateTimeKind.Utc); + return dt; + } + + private DATABASESTATUS GetDatabaseStatus() + { + return StationData.Database.GetDBStatus(); + } + + private DateTime GetLocationtUpdateTimeStamp() + { + string filename = Path.Combine(TmpDirectory, "locations.json"); + DateTime dt = File.GetLastWriteTimeUtc(filename).ToUniversalTime(); + // convert to YYYY:MM:DD hh:mm:ss only as this is stored in settings + dt = new DateTime(dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, dt.Second, DateTimeKind.Utc); + return dt; + } + + private DateTime GetQRVUpdateTimeStamp() + { + string filename = Path.Combine(TmpDirectory, "qrv.json"); + DateTime dt = File.GetLastWriteTimeUtc(filename).ToUniversalTime(); + // convert to YYYY:MM:DD hh:mm:ss only as this is stored in settings + dt = new DateTime(dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, dt.Second, DateTimeKind.Utc); + return dt; + } + + private DateTime GetSavedDatabaseTimeStamp() + { + DateTime dt = DateTime.MinValue; + dt = Properties.Settings.Default.Stations_TimeStamp; + // change kind to UTC as it is not specified in settings + dt = DateTime.SpecifyKind(dt, DateTimeKind.Utc); + return dt; + } + + private DateTime GetSavedLocationUpdateTimeStamp() + { + DateTime dt = DateTime.MinValue; + dt = Properties.Settings.Default.Locations_Update_TimeStamp; + // change kind to UTC as it is not specified in settings + dt = DateTime.SpecifyKind(dt, DateTimeKind.Utc); + return dt; + } + + private DateTime GetSavedQRVUpdateTimeStamp() + { + DateTime dt = DateTime.MinValue; + dt = Properties.Settings.Default.QRV_Update_TimeStamp; + // change kind to UTC as it is not specified in settings + dt = DateTime.SpecifyKind(dt, DateTimeKind.Utc); + return dt; + } + + private DATABASESTATUS GetSavedDatabaseStatus() + { + return Properties.Settings.Default.Stations_Status; + } + + private void SaveDatabaseTimeStamp() + { + Properties.Settings.Default.Stations_TimeStamp = GetDatabaseTimeStamp(); + } + + private void SaveDatabaseStatus() + { + Properties.Settings.Default.Stations_Status = GetDatabaseStatus(); + } + + private void SaveLocationUpdateTimeStamp() + { + Properties.Settings.Default.Locations_Update_TimeStamp = GetLocationtUpdateTimeStamp(); + } + + private void SaveQRVUpdateTimeStamp() + { + Properties.Settings.Default.QRV_Update_TimeStamp = GetQRVUpdateTimeStamp(); + } + + private bool HasDatabaseChanged() + { + try + { + DateTime dt1 = GetSavedDatabaseTimeStamp(); + DateTime dt2 = GetDatabaseTimeStamp(); + return dt1 != dt2; + } + catch + { + // do nothing + } + return true; + } + + private bool HasLocationUpdateChanged() + { + try + { + DateTime dt1 = GetSavedLocationUpdateTimeStamp(); + DateTime dt2 = GetLocationtUpdateTimeStamp(); + return dt1 != dt2; + } + catch + { + // do nothing + } + return true; + } + + private bool HasQRVUpdateChanged() + { + try + { + DateTime dt1 = GetSavedQRVUpdateTimeStamp(); + DateTime dt2 = GetQRVUpdateTimeStamp(); + return dt1 != dt2; + } + catch + { + // do nothing + } + return true; + } + + protected override void OnDoWork(DoWorkEventArgs e) { StartOptions = (StationDatabaseUpdaterStartOptions)e.Argument; @@ -183,10 +369,6 @@ namespace ScoutBase.Stations // check if any kind of update is enabled if ((StartOptions.Options == BACKGROUNDUPDATERSTARTOPTIONS.RUNONCE) || (StartOptions.Options == BACKGROUNDUPDATERSTARTOPTIONS.RUNPERIODICALLY)) { - // get temp directory - string TmpDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), Application.CompanyName, Application.ProductName, "Tmp").TrimEnd(Path.DirectorySeparatorChar); - if (!Directory.Exists(TmpDirectory)) - Directory.CreateDirectory(TmpDirectory); // reset database status StationData.Database.SetDBStatus(DATABASESTATUS.UNDEFINED); this.ReportProgress(1, StationData.Database.GetDBStatus()); @@ -204,14 +386,78 @@ namespace ScoutBase.Stations // set status to updating StationData.Database.SetDBStatus(DATABASESTATUS.UPDATING); this.ReportProgress(1, StationData.Database.GetDBStatus()); - // update callsign database - this.ReportProgress(0, "Updating callsigns from web database..."); - if (!ReadLocationsFromURL(Properties.Settings.Default.Stations_UpdateURL + "locations.zip", Path.Combine(TmpDirectory, "locations.zip"), Path.Combine(TmpDirectory, "locations.json"))) - errors++; + if (StartOptions.RestrictToAreaOfInterest) + { + this.ReportProgress(0, "Removing callsigns otside are of interest..."); + if (HasDatabaseChanged()) + { + // database changed --> do full check + List locations = StationData.Database.LocationGetAll(this); + foreach (LocationDesignator ld in locations) + { + if ((ld.Lat < StartOptions.MinLat) || (ld.Lat > StartOptions.MaxLat) || (ld.Lon < StartOptions.MinLon) || (ld.Lon > StartOptions.MaxLon)) + { + // remove from location database & QRV database + StationData.Database.LocationDelete(ld); + StationData.Database.QRVDelete(ld.Call, ld.Loc, BAND.BALL); + } + if (this.CancellationPending) + return; + // reduce CPU load + Thread.Sleep(1); + } + // save status & timestamps + SaveDatabaseTimeStamp(); + SaveDatabaseStatus(); + } + else + { + // dabase not changed --> nothing to do + // restore database status + StationData.Database.SetDBStatus(GetDatabaseStatus()); + } + } + // update location database + this.ReportProgress(0, "Updating locations from web database..."); + // get update from url + GetUpdateFromURL(Properties.Settings.Default.Stations_UpdateURL + "locations.zip", Path.Combine(TmpDirectory, "locations.zip"), Path.Combine(TmpDirectory, "locations.json")); + if (HasDatabaseChanged() || HasLocationUpdateChanged()) + { + // database and/or update changed --> do full check + if (!ReadLocationsFromURL(Properties.Settings.Default.Stations_UpdateURL + "locations.zip", Path.Combine(TmpDirectory, "locations.zip"), Path.Combine(TmpDirectory, "locations.json"))) + errors++; + // save status & timestamps + SaveDatabaseTimeStamp(); + SaveDatabaseStatus(); + SaveLocationUpdateTimeStamp(); + } + else + { + // dabase and update not changed --> nothing to do + // restore database status + StationData.Database.SetDBStatus(GetDatabaseStatus()); + } if (this.CancellationPending) break; - if (!ReadQRVFromURL(Properties.Settings.Default.Stations_UpdateURL + "qrv.zip", Path.Combine(TmpDirectory, "qrv.zip"), Path.Combine(TmpDirectory, "qrv.json"))) - errors++; + // update qrv database + this.ReportProgress(0, "Updating qrv info from web database..."); + // get update from url + GetUpdateFromURL(Properties.Settings.Default.Stations_UpdateURL + "qrv.zip", Path.Combine(TmpDirectory, "qrv.zip"), Path.Combine(TmpDirectory, "qrv.json")); + if (HasDatabaseChanged() || HasQRVUpdateChanged()) + { + if (!ReadQRVFromURL(Properties.Settings.Default.Stations_UpdateURL + "qrv.zip", Path.Combine(TmpDirectory, "qrv.zip"), Path.Combine(TmpDirectory, "qrv.json"))) + errors++; + // save status & timestamps + SaveDatabaseTimeStamp(); + SaveDatabaseStatus(); + SaveQRVUpdateTimeStamp(); + } + else + { + // dabase and update not changed --> nothing to do + // restore database status + StationData.Database.SetDBStatus(GetDatabaseStatus()); + } // silently update locations from V1.2 database if found string appdatadir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), Application.CompanyName, Application.ProductName).TrimEnd(Path.DirectorySeparatorChar); string oldfile = Path.Combine(appdatadir.Replace("AirScout", "ScoutBase"), "Database", "ScoutBase.db3"); @@ -237,7 +483,6 @@ namespace ScoutBase.Stations } // sleep once to get all messages to main thread Thread.Sleep(1000); - // sleep when running periodically if (StartOptions.Options == BACKGROUNDUPDATERSTARTOPTIONS.RUNPERIODICALLY) { diff --git a/ScoutBase/ScoutBase.Stations/app.config b/ScoutBase/ScoutBase.Stations/app.config index eea2a7e..107dec7 100644 --- a/ScoutBase/ScoutBase.Stations/app.config +++ b/ScoutBase/ScoutBase.Stations/app.config @@ -22,6 +22,18 @@ 60 + + 1970-01-01 + + + UNDEFINED + + + 1970-01-01 + + + 1970-01-01 + \ No newline at end of file diff --git a/ScoutBase/ScoutBase.Stations/packages.config b/ScoutBase/ScoutBase.Stations/packages.config index 0bbf652..2bc3b5b 100644 --- a/ScoutBase/ScoutBase.Stations/packages.config +++ b/ScoutBase/ScoutBase.Stations/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/SerializableGenerics/SerializableGenerics.csproj b/SerializableGenerics/SerializableGenerics.csproj index 9a74203..1f850b1 100644 --- a/SerializableGenerics/SerializableGenerics.csproj +++ b/SerializableGenerics/SerializableGenerics.csproj @@ -38,8 +38,7 @@ - ..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/SerializableGenerics/packages.config b/SerializableGenerics/packages.config index 0bbf652..2bc3b5b 100644 --- a/SerializableGenerics/packages.config +++ b/SerializableGenerics/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/WinTest/WinTest.csproj b/WinTest/WinTest.csproj index c7cf098..dd713c3 100644 --- a/WinTest/WinTest.csproj +++ b/WinTest/WinTest.csproj @@ -34,8 +34,7 @@ - ..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll - True + ..\packages\Newtonsoft.Json.12.0.3\lib\net40\Newtonsoft.Json.dll diff --git a/WinTest/packages.config b/WinTest/packages.config index 0bbf652..2bc3b5b 100644 --- a/WinTest/packages.config +++ b/WinTest/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file