pull/3/head
dl2alf 2020-04-25 08:00:15 +02:00
rodzic 6b962d23eb
commit 8f3f6132d8
27 zmienionych plików z 3603 dodań i 1676 usunięć

Wyświetl plik

@ -196,6 +196,12 @@
<Compile Include="LicenseDlg.Designer.cs">
<DependentUpon>LicenseDlg.cs</DependentUpon>
</Compile>
<Compile Include="PercentageControl.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="PercentageControl.Designer.cs">
<DependentUpon>PercentageControl.cs</DependentUpon>
</Compile>
<Compile Include="PlaneFeedDisclaimerDlg.cs">
<SubType>Form</SubType>
</Compile>
@ -344,6 +350,9 @@
<EmbeddedResource Include="MapStationDlg.resx">
<DependentUpon>MapStationDlg.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PercentageControl.resx">
<DependentUpon>PercentageControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PlaneFeedDisclaimerDlg.resx">
<DependentUpon>PlaneFeedDisclaimerDlg.cs</DependentUpon>
</EmbeddedResource>

91
AirScout/MapDlg.Designer.cs wygenerowano
Wyświetl plik

@ -40,6 +40,7 @@
this.ag_Azimuth = new AquaControls.AquaGauge();
this.ag_Elevation = new AquaControls.AquaGauge();
this.gm_Main = new GMap.NET.WindowsForms.GMapControl();
this.gm_Cache = new GMap.NET.WindowsForms.GMapControl();
this.tp_News = new System.Windows.Forms.TabPage();
this.tc_Main = new System.Windows.Forms.TabControl();
this.tp_Elevation = new System.Windows.Forms.TabPage();
@ -104,6 +105,8 @@
this.tsl_Database_LED_GLOBE = new System.Windows.Forms.ToolStripStatusLabel();
this.tsl_Database_LED_SRTM3 = new System.Windows.Forms.ToolStripStatusLabel();
this.tsl_Database_LED_SRTM1 = new System.Windows.Forms.ToolStripStatusLabel();
this.tsl_Database_LED_ASTER3 = new System.Windows.Forms.ToolStripStatusLabel();
this.tsl_Database_LED_ASTER1 = new System.Windows.Forms.ToolStripStatusLabel();
this.tt_Main = new System.Windows.Forms.ToolTip(this.components);
this.btn_Map_PlayPause = new System.Windows.Forms.Button();
this.btn_Map_Save = new System.Windows.Forms.Button();
@ -174,7 +177,6 @@
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();
@ -334,6 +336,7 @@
this.gm_Main.MouseWheelZoomType = GMap.NET.MouseWheelZoomType.MousePositionAndCenter;
this.gm_Main.Name = "gm_Main";
this.gm_Main.NegativeMode = false;
this.gm_Main.Opacity = 1D;
this.gm_Main.PolygonsEnabled = true;
this.gm_Main.RetryLoadTile = 0;
this.gm_Main.RoutesEnabled = true;
@ -352,6 +355,32 @@
this.gm_Main.MouseMove += new System.Windows.Forms.MouseEventHandler(this.gm_Main_MouseMove);
this.gm_Main.MouseUp += new System.Windows.Forms.MouseEventHandler(this.gm_Main_MouseUp);
//
// 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.Opacity = 1D;
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;
//
// tp_News
//
this.tp_News.Location = new System.Drawing.Point(4, 22);
@ -599,6 +628,7 @@
this.gm_Nearest.MouseWheelZoomType = GMap.NET.MouseWheelZoomType.MousePositionAndCenter;
this.gm_Nearest.Name = "gm_Nearest";
this.gm_Nearest.NegativeMode = false;
this.gm_Nearest.Opacity = 1D;
this.gm_Nearest.PolygonsEnabled = true;
this.gm_Nearest.RetryLoadTile = 0;
this.gm_Nearest.RoutesEnabled = true;
@ -1042,7 +1072,9 @@
this.tsl_Database_LED_Stations,
this.tsl_Database_LED_GLOBE,
this.tsl_Database_LED_SRTM3,
this.tsl_Database_LED_SRTM1});
this.tsl_Database_LED_SRTM1,
this.tsl_Database_LED_ASTER3,
this.tsl_Database_LED_ASTER1});
this.ss_Main.Location = new System.Drawing.Point(0, 706);
this.ss_Main.Name = "ss_Main";
this.ss_Main.ShowItemToolTips = true;
@ -1057,7 +1089,7 @@
| System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom)));
this.tsl_Status.BorderStyle = System.Windows.Forms.Border3DStyle.SunkenInner;
this.tsl_Status.Name = "tsl_Status";
this.tsl_Status.Size = new System.Drawing.Size(742, 19);
this.tsl_Status.Size = new System.Drawing.Size(714, 19);
this.tsl_Status.Spring = true;
this.tsl_Status.Text = "No Messages.";
this.tsl_Status.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@ -1154,6 +1186,32 @@
this.tsl_Database_LED_SRTM1.Text = " SRTM3 database status LED";
this.tsl_Database_LED_SRTM1.ToolTipText = "SRTM1 database status LED";
//
// tsl_Database_LED_ASTER3
//
this.tsl_Database_LED_ASTER3.AutoSize = false;
this.tsl_Database_LED_ASTER3.BackColor = System.Drawing.Color.Plum;
this.tsl_Database_LED_ASTER3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.None;
this.tsl_Database_LED_ASTER3.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tsl_Database_LED_ASTER3.Image = ((System.Drawing.Image)(resources.GetObject("tsl_Database_LED_ASTER3.Image")));
this.tsl_Database_LED_ASTER3.Margin = new System.Windows.Forms.Padding(1, 5, 1, 5);
this.tsl_Database_LED_ASTER3.Name = "tsl_Database_LED_ASTER3";
this.tsl_Database_LED_ASTER3.Size = new System.Drawing.Size(12, 14);
this.tsl_Database_LED_ASTER3.Text = " SRTM3 database status LED";
this.tsl_Database_LED_ASTER3.ToolTipText = "SRTM3 database status LED";
//
// tsl_Database_LED_ASTER1
//
this.tsl_Database_LED_ASTER1.AutoSize = false;
this.tsl_Database_LED_ASTER1.BackColor = System.Drawing.Color.Plum;
this.tsl_Database_LED_ASTER1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.None;
this.tsl_Database_LED_ASTER1.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tsl_Database_LED_ASTER1.Image = ((System.Drawing.Image)(resources.GetObject("tsl_Database_LED_ASTER1.Image")));
this.tsl_Database_LED_ASTER1.Margin = new System.Windows.Forms.Padding(1, 5, 1, 5);
this.tsl_Database_LED_ASTER1.Name = "tsl_Database_LED_ASTER1";
this.tsl_Database_LED_ASTER1.Size = new System.Drawing.Size(12, 14);
this.tsl_Database_LED_ASTER1.Text = " SRTM3 database status LED";
this.tsl_Database_LED_ASTER1.ToolTipText = "SRTM3 database status LED";
//
// btn_Map_PlayPause
//
this.btn_Map_PlayPause.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
@ -1939,31 +1997,6 @@
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;
@ -2178,6 +2211,8 @@
private GMap.NET.WindowsForms.GMapControl gm_Main;
private System.Windows.Forms.TabPage tp_News;
private GMap.NET.WindowsForms.GMapControl gm_Cache;
private System.Windows.Forms.ToolStripStatusLabel tsl_Database_LED_ASTER3;
private System.Windows.Forms.ToolStripStatusLabel tsl_Database_LED_ASTER1;
}
}

Wyświetl plik

@ -388,6 +388,8 @@ namespace AirScout
public ElevationDatabaseUpdater bw_GLOBEUpdater = new ElevationDatabaseUpdater();
public ElevationDatabaseUpdater bw_SRTM3Updater = new ElevationDatabaseUpdater();
public ElevationDatabaseUpdater bw_SRTM1Updater = new ElevationDatabaseUpdater();
public ElevationDatabaseUpdater bw_ASTER3Updater = new ElevationDatabaseUpdater();
public ElevationDatabaseUpdater bw_ASTER1Updater = new ElevationDatabaseUpdater();
public StationDatabaseUpdater bw_StationDatabaseUpdater = new StationDatabaseUpdater();
public AircraftDatabaseUpdater bw_AircraftDatabaseUpdater = new AircraftDatabaseUpdater();
@ -397,6 +399,8 @@ namespace AirScout
public PathCalculator bw_GLOBEPathCalculator = new PathCalculator(ELEVATIONMODEL.GLOBE);
public PathCalculator bw_SRTM3PathCalculator = new PathCalculator(ELEVATIONMODEL.SRTM3);
public PathCalculator bw_SRTM1PathCalculator = new PathCalculator(ELEVATIONMODEL.SRTM1);
public PathCalculator bw_ASTER3PathCalculator = new PathCalculator(ELEVATIONMODEL.ASTER3);
public PathCalculator bw_ASTER1PathCalculator = new PathCalculator(ELEVATIONMODEL.ASTER1);
public MapPreloader bw_MapPreloader = new MapPreloader();
@ -476,6 +480,10 @@ namespace AirScout
// force culture invariant language for GUI
Application.CurrentCulture = CultureInfo.InvariantCulture;
// set security protocol to TLS1.2 globally
// this will work even on .NET 4.0 for most operating systems > Windows XP
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072; //TLS 1.2
InitializeComponent();
// do basic initialization
@ -517,6 +525,8 @@ namespace AirScout
bw_GLOBEUpdater.ProgressChanged += new ProgressChangedEventHandler(bw_ElevationDatabaseUpdater_ProgressChanged);
bw_SRTM3Updater.ProgressChanged += new ProgressChangedEventHandler(bw_ElevationDatabaseUpdater_ProgressChanged);
bw_SRTM1Updater.ProgressChanged += new ProgressChangedEventHandler(bw_ElevationDatabaseUpdater_ProgressChanged);
bw_ASTER3Updater.ProgressChanged += new ProgressChangedEventHandler(bw_ElevationDatabaseUpdater_ProgressChanged);
bw_ASTER1Updater.ProgressChanged += new ProgressChangedEventHandler(bw_ElevationDatabaseUpdater_ProgressChanged);
// set station database updater event handler
bw_StationDatabaseUpdater.ProgressChanged += new ProgressChangedEventHandler(bw_StationDatabaseUpdater_ProgressChanged);
@ -534,6 +544,8 @@ namespace AirScout
bw_GLOBEPathCalculator.ProgressChanged += new ProgressChangedEventHandler(bw_ElevationPathCalculator_ProgressChanged);
bw_SRTM3PathCalculator.ProgressChanged += new ProgressChangedEventHandler(bw_ElevationPathCalculator_ProgressChanged);
bw_SRTM1PathCalculator.ProgressChanged += new ProgressChangedEventHandler(bw_ElevationPathCalculator_ProgressChanged);
bw_ASTER3PathCalculator.ProgressChanged += new ProgressChangedEventHandler(bw_ElevationPathCalculator_ProgressChanged);
bw_ASTER1PathCalculator.ProgressChanged += new ProgressChangedEventHandler(bw_ElevationPathCalculator_ProgressChanged);
// set map preloader event handler
bw_MapPreloader.ProgressChanged += new ProgressChangedEventHandler(bw_MapPreloader_ProgressChanged);
@ -1036,6 +1048,8 @@ namespace AirScout
Properties.Settings.Default.Elevation_GLOBE_DatabaseStatus = DATABASESTATUS.UNDEFINED;
Properties.Settings.Default.Elevation_SRTM3_DatabaseStatus = DATABASESTATUS.UNDEFINED;
Properties.Settings.Default.Elevation_SRTM1_DatabaseStatus = DATABASESTATUS.UNDEFINED;
Properties.Settings.Default.Elevation_ASTER3_DatabaseStatus = DATABASESTATUS.UNDEFINED;
Properties.Settings.Default.Elevation_ASTER1_DatabaseStatus = DATABASESTATUS.UNDEFINED;
// set nearfield suppression
PropagationData.Database.NearFieldSuppression = Properties.Settings.Default.Path_NearFieldSuppression;
// get all database directories and store it in settings
@ -1119,6 +1133,7 @@ namespace AirScout
gm_Main.Overlays.Add(gmo_Objects);
gm_Main.Overlays.Add(gmo_Planes);
gm_Main.Overlays.Add(gmo_Callsigns);
gm_Main.Opacity = (double)Properties.Settings.Default.Map_Opacity;
// setting User Agent to fix Open Street Map issue 2016-09-20
GMap.NET.MapProviders.GMapProvider.UserAgent = "AirScout";
@ -1608,12 +1623,42 @@ namespace AirScout
startoptions.FileCacheEnabled = Properties.Settings.Default.Elevation_SRTM1_EnableCache;
bw_SRTM1Updater.RunWorkerAsync(startoptions);
}
if (Properties.Settings.Default.Elevation_ASTER3_Enabled && (bw_ASTER3Updater != null) && !bw_ASTER3Updater.IsBusy)
{
ElevationDatabaseUpdaterStartOptions startoptions = new ElevationDatabaseUpdaterStartOptions();
startoptions.Name = "ASTER3";
startoptions.Options = BACKGROUNDUPDATERSTARTOPTIONS.RUNONCE;
startoptions.Model = ELEVATIONMODEL.ASTER3;
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.FileCacheEnabled = Properties.Settings.Default.Elevation_ASTER3_EnableCache;
bw_ASTER3Updater.RunWorkerAsync(startoptions);
}
if (Properties.Settings.Default.Elevation_ASTER1_Enabled && (bw_ASTER1Updater != null) && !bw_ASTER1Updater.IsBusy)
{
ElevationDatabaseUpdaterStartOptions startoptions = new ElevationDatabaseUpdaterStartOptions();
startoptions.Name = "ASTER1";
startoptions.Options = BACKGROUNDUPDATERSTARTOPTIONS.RUNONCE;
startoptions.Model = ELEVATIONMODEL.ASTER1;
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.FileCacheEnabled = Properties.Settings.Default.Elevation_ASTER1_EnableCache;
bw_ASTER1Updater.RunWorkerAsync(startoptions);
}
if (Properties.Settings.Default.Elevation_GLOBE_Enabled && (bw_GLOBEPathCalculator != null) && !bw_GLOBEPathCalculator.IsBusy)
bw_GLOBEPathCalculator.RunWorkerAsync(BACKGROUNDUPDATERSTARTOPTIONS.RUNONCE);
if (Properties.Settings.Default.Elevation_SRTM3_Enabled && (bw_SRTM3PathCalculator != null) && !bw_SRTM3PathCalculator.IsBusy)
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.Elevation_ASTER3_Enabled && (bw_ASTER3PathCalculator != null) && !bw_ASTER3PathCalculator.IsBusy)
bw_ASTER3PathCalculator.RunWorkerAsync(BACKGROUNDUPDATERSTARTOPTIONS.RUNONCE);
if (Properties.Settings.Default.Elevation_ASTER1_Enabled && (bw_ASTER1PathCalculator != null) && !bw_ASTER1PathCalculator.IsBusy)
bw_ASTER1PathCalculator.RunWorkerAsync(BACKGROUNDUPDATERSTARTOPTIONS.RUNONCE);
if (Properties.Settings.Default.Map_Preloader_Enabled && (bw_MapPreloader != null) && !bw_MapPreloader.IsBusy)
bw_MapPreloader.RunWorkerAsync(BACKGROUNDUPDATERSTARTOPTIONS.RUNONCE);
}
@ -1683,12 +1728,42 @@ namespace AirScout
startoptions.FileCacheEnabled = Properties.Settings.Default.Elevation_SRTM1_EnableCache;
bw_SRTM1Updater.RunWorkerAsync(startoptions);
}
if (Properties.Settings.Default.Elevation_ASTER3_Enabled && (bw_ASTER3Updater != null) && !bw_ASTER3Updater.IsBusy)
{
ElevationDatabaseUpdaterStartOptions startoptions = new ElevationDatabaseUpdaterStartOptions();
startoptions.Name = "ASTER3";
startoptions.Options = BACKGROUNDUPDATERSTARTOPTIONS.RUNPERIODICALLY;
startoptions.Model = ELEVATIONMODEL.ASTER3;
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.FileCacheEnabled = Properties.Settings.Default.Elevation_ASTER3_EnableCache;
bw_ASTER3Updater.RunWorkerAsync(startoptions);
}
if (Properties.Settings.Default.Elevation_ASTER1_Enabled && (bw_ASTER1Updater != null) && !bw_ASTER1Updater.IsBusy)
{
ElevationDatabaseUpdaterStartOptions startoptions = new ElevationDatabaseUpdaterStartOptions();
startoptions.Name = "ASTER1";
startoptions.Options = BACKGROUNDUPDATERSTARTOPTIONS.RUNPERIODICALLY;
startoptions.Model = ELEVATIONMODEL.ASTER1;
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.FileCacheEnabled = Properties.Settings.Default.Elevation_ASTER1_EnableCache;
bw_ASTER1Updater.RunWorkerAsync(startoptions);
}
if (Properties.Settings.Default.Elevation_GLOBE_Enabled && (bw_GLOBEPathCalculator != null) && !bw_GLOBEPathCalculator.IsBusy)
bw_GLOBEPathCalculator.RunWorkerAsync(BACKGROUNDUPDATERSTARTOPTIONS.RUNPERIODICALLY);
if (Properties.Settings.Default.Elevation_SRTM3_Enabled && (bw_SRTM3PathCalculator != null) && !bw_SRTM3PathCalculator.IsBusy)
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.Elevation_ASTER3_Enabled && (bw_ASTER3PathCalculator != null) && !bw_ASTER3PathCalculator.IsBusy)
bw_ASTER3PathCalculator.RunWorkerAsync(BACKGROUNDUPDATERSTARTOPTIONS.RUNPERIODICALLY);
if (Properties.Settings.Default.Elevation_ASTER1_Enabled && (bw_ASTER1PathCalculator != null) && !bw_ASTER1PathCalculator.IsBusy)
bw_ASTER1PathCalculator.RunWorkerAsync(BACKGROUNDUPDATERSTARTOPTIONS.RUNPERIODICALLY);
if (Properties.Settings.Default.Map_Preloader_Enabled && (bw_MapPreloader != null) && !bw_MapPreloader.IsBusy)
bw_MapPreloader.RunWorkerAsync(BACKGROUNDUPDATERSTARTOPTIONS.RUNPERIODICALLY);
}
@ -1739,7 +1814,7 @@ namespace AirScout
{
Say("Stopping background threads...");
// cancel permanent background workers, wait for finish
int bcount = 14;
int bcount = 16;
int i = 1;
// cancel all threads
StopBackgroundworker(bw_WinTestReceive, nameof(bw_WinTestReceive), i, bcount); i++;
@ -1753,6 +1828,8 @@ namespace AirScout
StopBackgroundworker(bw_GLOBEPathCalculator, nameof(bw_GLOBEPathCalculator), i, bcount); i++;
StopBackgroundworker(bw_SRTM3PathCalculator, nameof(bw_SRTM3PathCalculator), i, bcount); i++;
StopBackgroundworker(bw_SRTM1PathCalculator, nameof(bw_SRTM1PathCalculator), i, bcount); i++;
StopBackgroundworker(bw_ASTER3PathCalculator, nameof(bw_ASTER3PathCalculator), i, bcount); i++;
StopBackgroundworker(bw_ASTER1PathCalculator, nameof(bw_ASTER1PathCalculator), 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++;
@ -1796,12 +1873,20 @@ namespace AirScout
bw_SRTM3Updater.CancelAsync();
if (bw_SRTM1Updater != null)
bw_SRTM1Updater.CancelAsync();
if (bw_ASTER3Updater != null)
bw_ASTER3Updater.CancelAsync();
if (bw_ASTER1Updater != null)
bw_ASTER1Updater.CancelAsync();
if (bw_GLOBEPathCalculator != null)
bw_GLOBEPathCalculator.CancelAsync();
if (bw_SRTM3PathCalculator != null)
bw_SRTM3PathCalculator.CancelAsync();
if (bw_SRTM1PathCalculator != null)
bw_SRTM1PathCalculator.CancelAsync();
if (bw_ASTER3PathCalculator != null)
bw_ASTER3PathCalculator.CancelAsync();
if (bw_ASTER1PathCalculator != null)
bw_ASTER1PathCalculator.CancelAsync();
}
private Bitmap CreatePlaneIcon(Color color)
@ -2387,6 +2472,24 @@ namespace AirScout
st.Stop();
Log.WriteMessage("Propagation database SRTM1 saved, " + st.ElapsedMilliseconds.ToString() + " ms.");
}
if (PropagationData.Database.IsInMemory(ELEVATIONMODEL.ASTER3))
{
Stopwatch st = new Stopwatch();
st.Start();
SayDatabase("Saving ASTER3 database...");
PropagationData.Database.BackupDatabase(ELEVATIONMODEL.ASTER3);
st.Stop();
Log.WriteMessage("Propagation database ASTER3 saved, " + st.ElapsedMilliseconds.ToString() + " ms.");
}
if (PropagationData.Database.IsInMemory(ELEVATIONMODEL.ASTER1))
{
Stopwatch st = new Stopwatch();
st.Start();
SayDatabase("Saving ASTER1 database...");
PropagationData.Database.BackupDatabase(ELEVATIONMODEL.ASTER1);
st.Stop();
Log.WriteMessage("Propagation database ASTER1 saved, " + st.ElapsedMilliseconds.ToString() + " ms.");
}
if (AircraftData.Database.IsInMemory())
{
Stopwatch st = new Stopwatch();
@ -2719,6 +2822,10 @@ namespace AirScout
short elv = ElevationData.Database.ElvMissingFlag;
// try to get elevation data from distinct elevation model
// start with detailed one
if (Properties.Settings.Default.Elevation_ASTER1_Enabled && (elv == ElevationData.Database.ElvMissingFlag))
elv = ElevationData.Database[lat, lon, ELEVATIONMODEL.ASTER1, false];
if (Properties.Settings.Default.Elevation_ASTER3_Enabled && (elv == ElevationData.Database.ElvMissingFlag))
elv = ElevationData.Database[lat, lon, ELEVATIONMODEL.ASTER3, false];
if (Properties.Settings.Default.Elevation_SRTM1_Enabled && (elv == ElevationData.Database.ElvMissingFlag))
elv = ElevationData.Database[lat, lon, ELEVATIONMODEL.SRTM1, false];
if (Properties.Settings.Default.Elevation_SRTM3_Enabled && (elv == ElevationData.Database.ElvMissingFlag))
@ -2736,6 +2843,32 @@ namespace AirScout
ElvMinMaxInfo elv = new ElvMinMaxInfo();
// try to get elevation data from distinct elevation model
// start with detailed one
if (Properties.Settings.Default.Elevation_ASTER1_Enabled && (elv.MaxElv == ElevationData.Database.ElvMissingFlag))
{
ElvMinMaxInfo info = ElevationData.Database.GetMaxElvLoc(loc, ELEVATIONMODEL.ASTER1, false);
if (info != null)
{
elv.MaxLat = info.MaxLat;
elv.MaxLon = info.MaxLon;
elv.MaxElv = info.MaxElv;
elv.MinLat = info.MinLat;
elv.MinLon = info.MinLon;
elv.MinElv = info.MinElv;
}
}
if (Properties.Settings.Default.Elevation_ASTER3_Enabled && (elv.MaxElv == ElevationData.Database.ElvMissingFlag))
{
ElvMinMaxInfo info = ElevationData.Database.GetMaxElvLoc(loc, ELEVATIONMODEL.ASTER3, false);
if (info != null)
{
elv.MaxLat = info.MaxLat;
elv.MaxLon = info.MaxLon;
elv.MaxElv = info.MaxElv;
elv.MinLat = info.MinLat;
elv.MinLon = info.MinLon;
elv.MinElv = info.MinElv;
}
}
if (Properties.Settings.Default.Elevation_SRTM1_Enabled && (elv.MaxElv == ElevationData.Database.ElvMissingFlag))
{
ElvMinMaxInfo info = ElevationData.Database.GetMaxElvLoc(loc, ELEVATIONMODEL.SRTM1, false);
@ -2787,7 +2920,11 @@ namespace AirScout
public void SetElevationModel()
{
if (Properties.Settings.Default.Elevation_SRTM1_Enabled)
if (Properties.Settings.Default.Elevation_ASTER1_Enabled)
Properties.Settings.Default.ElevationModel = ELEVATIONMODEL.ASTER1;
else if (Properties.Settings.Default.Elevation_ASTER3_Enabled)
Properties.Settings.Default.ElevationModel = ELEVATIONMODEL.ASTER3;
else if (Properties.Settings.Default.Elevation_SRTM1_Enabled)
Properties.Settings.Default.ElevationModel = ELEVATIONMODEL.SRTM1;
else if (Properties.Settings.Default.Elevation_SRTM3_Enabled)
Properties.Settings.Default.ElevationModel = ELEVATIONMODEL.SRTM3;
@ -2950,6 +3087,9 @@ namespace AirScout
// update map provider
gm_Main.MapProvider = GMapProviders.Find(Properties.Settings.Default.Map_Provider);
// update map opacity
gm_Main.Opacity = (double)Properties.Settings.Default.Map_Opacity;
// update ToolTipFont
ToolTipFont = CreateFontFromString(Properties.Settings.Default.Map_ToolTipFont);
@ -3508,7 +3648,11 @@ namespace AirScout
Charts_ShowLegends(5000);
// refresh path info
tp_Elevation.Text = "Pathinfo ";
if (Properties.Settings.Default.ElevationModel == ELEVATIONMODEL.SRTM1)
if (Properties.Settings.Default.ElevationModel == ELEVATIONMODEL.ASTER1)
tp_Elevation.Text = tp_Elevation.Text + "[ASTER1]";
else if (Properties.Settings.Default.ElevationModel == ELEVATIONMODEL.ASTER3)
tp_Elevation.Text = tp_Elevation.Text + "[ASTER3]";
else if (Properties.Settings.Default.ElevationModel == ELEVATIONMODEL.SRTM1)
tp_Elevation.Text = tp_Elevation.Text + "[SRTM1]";
else if (Properties.Settings.Default.ElevationModel == ELEVATIONMODEL.SRTM3)
tp_Elevation.Text = tp_Elevation.Text + "[SRTM3]";
@ -7154,6 +7298,26 @@ namespace AirScout
if (tsl_Database_LED_SRTM1.ToolTipText != text)
tsl_Database_LED_SRTM1.ToolTipText = text;
}
else if (sender == this.bw_ASTER3Updater)
{
Properties.Settings.Default.Elevation_ASTER3_DatabaseStatus = (DATABASESTATUS)e.UserState;
Color color = DatabaseStatus.GetDatabaseStatusColor(Properties.Settings.Default.Elevation_ASTER3_DatabaseStatus);
if (tsl_Database_LED_ASTER3.BackColor != color)
tsl_Database_LED_ASTER3.BackColor = color;
string text = "ASTER3 Database Status\n\n" + DatabaseStatus.GetDatabaseStatusText(Properties.Settings.Default.Elevation_ASTER3_DatabaseStatus);
if (tsl_Database_LED_ASTER3.ToolTipText != text)
tsl_Database_LED_ASTER3.ToolTipText = text;
}
else if (sender == this.bw_ASTER1Updater)
{
Properties.Settings.Default.Elevation_ASTER1_DatabaseStatus = (DATABASESTATUS)e.UserState;
Color color = DatabaseStatus.GetDatabaseStatusColor(Properties.Settings.Default.Elevation_ASTER1_DatabaseStatus);
if (tsl_Database_LED_ASTER1.BackColor != color)
tsl_Database_LED_ASTER1.BackColor = color;
string text = "ASTER1 Database Status\n\n" + DatabaseStatus.GetDatabaseStatusText(Properties.Settings.Default.Elevation_ASTER1_DatabaseStatus);
if (tsl_Database_LED_ASTER1.ToolTipText != text)
tsl_Database_LED_ASTER1.ToolTipText = text;
}
}
if (!this.Disposing && (ss_Main != null))
ss_Main.Update();

Wyświetl plik

@ -125,7 +125,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACc
DQAAAk1TRnQBSQFMAgEBAwEAAYgBCwGIAQsBIAEAASABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
DQAAAk1TRnQBSQFMAgEBAwEAAagBCwGoAQsBIAEAASABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABgAMAASADAAEBAQABCAYAARAYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
@ -330,6 +330,18 @@
<value>
iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wwAADsMBx2+oZAAAABBJREFUGFdjqMcBhpREfT0AN/NfQdTsp04AAAAASUVORK5CYII=
</value>
</data>
<data name="tsl_Database_LED_ASTER3.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wwAADsMBx2+oZAAAABBJREFUGFdjqMcBhpREfT0AN/NfQdTsp04AAAAASUVORK5CYII=
</value>
</data>
<data name="tsl_Database_LED_ASTER1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wwAADsMBx2+oZAAAABBJREFUGFdjqMcBhpREfT0AN/NfQdTsp04AAAAASUVORK5CYII=
</value>
</data>
<metadata name="il_Sat.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
@ -340,7 +352,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACM
DAAAAk1TRnQBSQFMAwEBAAHwAQkB8AEJASABAAEgAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA
DAAAAk1TRnQBSQFMAwEBAAEQAQoBEAEKASABAAEgAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA
AYADAAEgAwABAQEAAQgGAAEQGAABgAIAAYADAAKAAQABgAMAAYABAAGAAQACgAIAA8ABAAHAAdwBwAEA
AfABygGmAQABMwUAATMBAAEzAQABMwEAAjMCAAMWAQADHAEAAyIBAAMpAQADVQEAA00BAANCAQADOQEA
AYABfAH/AQACUAH/AQABkwEAAdYBAAH/AewBzAEAAcYB1gHvAQAB1gLnAQABkAGpAa0CAAH/ATMDAAFm

Plik diff jest za duży Load Diff

Wyświetl plik

@ -41,6 +41,8 @@ namespace AirScout
GMapOverlay GLOBEpolygons = new GMapOverlay("GLOBEpolygons");
GMapOverlay SRTM3polygons = new GMapOverlay("SRTM3polygons");
GMapOverlay SRTM1polygons = new GMapOverlay("SRTM1polygons");
GMapOverlay ASTER3polygons = new GMapOverlay("ASTER3polygons");
GMapOverlay ASTER1polygons = new GMapOverlay("ASTER1polygons");
MapDlg ParentDlg;
@ -145,6 +147,35 @@ namespace AirScout
gm_Options_SRTM1.SelectionPen = null;
gm_Options_SRTM1.MapScaleInfoEnabled = true;
gm_Options_SRTM1.Overlays.Add(SRTM1polygons);
// set initial settings for ASTER3Map
gm_Options_ASTER3.MapProvider = GMapProviders.Find(Properties.Settings.Default.Map_Provider);
gm_Options_ASTER3.IgnoreMarkerOnMouseWheel = true;
gm_Options_ASTER3.MinZoom = 0;
gm_Options_ASTER3.MaxZoom = 20;
gm_Options_ASTER3.Zoom = 6;
gm_Options_ASTER3.DragButton = System.Windows.Forms.MouseButtons.Left;
gm_Options_ASTER3.CanDragMap = true;
gm_Options_ASTER3.ScalePen = new Pen(Color.Black, 3);
gm_Options_ASTER3.HelperLinePen = null;
gm_Options_ASTER3.SelectionPen = null;
gm_Options_ASTER3.MapScaleInfoEnabled = true;
gm_Options_ASTER3.Overlays.Add(ASTER3polygons);
// set initial settings for ASTER1Map
gm_Options_ASTER1.MapProvider = GMapProviders.Find(Properties.Settings.Default.Map_Provider);
gm_Options_ASTER1.IgnoreMarkerOnMouseWheel = true;
gm_Options_ASTER1.MinZoom = 0;
gm_Options_ASTER1.MaxZoom = 20;
gm_Options_ASTER1.Zoom = 6;
gm_Options_ASTER1.DragButton = System.Windows.Forms.MouseButtons.Left;
gm_Options_ASTER1.CanDragMap = true;
gm_Options_ASTER1.ScalePen = new Pen(Color.Black, 3);
gm_Options_ASTER1.HelperLinePen = null;
gm_Options_ASTER1.SelectionPen = null;
gm_Options_ASTER1.MapScaleInfoEnabled = true;
gm_Options_ASTER1.Overlays.Add(ASTER1polygons);
Log.WriteMessage("Finished.");
}
@ -180,6 +211,10 @@ namespace AirScout
private ELEVATIONMODEL GetElevationModel()
{
if (Properties.Settings.Default.Elevation_ASTER1_Enabled)
return ELEVATIONMODEL.ASTER1;
if (Properties.Settings.Default.Elevation_ASTER3_Enabled)
return ELEVATIONMODEL.ASTER3;
if (Properties.Settings.Default.Elevation_SRTM1_Enabled)
return ELEVATIONMODEL.SRTM1;
if (Properties.Settings.Default.Elevation_SRTM3_Enabled)
@ -195,7 +230,7 @@ namespace AirScout
private void tab_Options_General_Enter(object sender, EventArgs e)
{
tab_Options_General_Update(this,null);
tab_Options_General_Update(this, null);
}
private void tab_Options_General_Validating(object sender, CancelEventArgs e)
@ -290,7 +325,7 @@ 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;
@ -1418,7 +1453,7 @@ namespace AirScout
p.Fill = new SolidBrush(Color.FromArgb(50, Color.Red));
SRTM3polygons.Polygons.Add(p);
}
else
else
{
Say((string)e.UserState);
}
@ -1588,6 +1623,246 @@ namespace AirScout
Dlg.ShowDialog();
}
#endregion
#region tab_Options_ASTER3
private void bw_ASTER3_MapUpdater_DoWork(object sender, DoWorkEventArgs e)
{
bw_ASTER3_MapUpdater.ReportProgress(0, "ASTER3: Creating elevation tile catalogue...");
ElevationCatalogue availabletiles = ElevationData.Database.ElevationCatalogueCreateCheckBoundsAndLastModified(bw_ASTER3_MapUpdater, ELEVATIONMODEL.ASTER3, Properties.Settings.Default.MinLat, Properties.Settings.Default.MinLon, Properties.Settings.Default.MaxLat, Properties.Settings.Default.MaxLon);
bw_ASTER3_MapUpdater.ReportProgress(0, "ASTER3: Processing tiles...");
int missing = 0;
int found = 0;
foreach (string tilename in availabletiles.Files.Keys)
{
if (ElevationData.Database.ElevationTileExists(tilename.Substring(0, 6), ELEVATIONMODEL.ASTER3))
{
bw_ASTER3_MapUpdater.ReportProgress(1, tilename);
found++;
}
else
{
bw_ASTER3_MapUpdater.ReportProgress(-1, tilename);
missing++;
}
if (bw_ASTER3_MapUpdater.CancellationPending)
{
bw_ASTER3_MapUpdater.ReportProgress(0, "ASTER3: Processing cancelled...");
return;
}
}
bw_ASTER3_MapUpdater.ReportProgress(0, "ASTER3: " + found.ToString() + " tile(s) found, " + missing.ToString() + " more tile(s) available and missing.");
}
private void bw_ASTER3_MapUpdater_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
if (e.ProgressPercentage == 1)
{
// add a tile found in database to map polygons
double baselat;
double baselon;
MaidenheadLocator.LatLonFromLoc(((string)e.UserState).Substring(0, 6), PositionInRectangle.BottomLeft, out baselat, out baselon);
List<PointLatLng> l = new List<PointLatLng>();
l.Add(new PointLatLng((decimal)baselat, (decimal)baselon));
l.Add(new PointLatLng((decimal)(baselat + 1 / 24.0), (decimal)baselon));
l.Add(new PointLatLng((decimal)(baselat + 1 / 24.0), (decimal)(baselon + 2 / 24.0)));
l.Add(new PointLatLng((decimal)baselat, (decimal)(baselon + 2 / 24.0)));
GMapPolygon p = new GMapPolygon(l, (string)e.UserState);
p.Stroke = new Pen(Color.FromArgb(50, Color.Green));
p.Fill = new SolidBrush(Color.FromArgb(50, Color.Green));
ASTER3polygons.Polygons.Add(p);
}
else if (e.ProgressPercentage == -1)
{
// add missing tile to map polygons
double baselat;
double baselon;
MaidenheadLocator.LatLonFromLoc(((string)e.UserState).Substring(0, 6), PositionInRectangle.BottomLeft, out baselat, out baselon);
List<PointLatLng> l = new List<PointLatLng>();
l.Add(new PointLatLng((decimal)baselat, (decimal)baselon));
l.Add(new PointLatLng((decimal)(baselat + 1 / 24.0), (decimal)baselon));
l.Add(new PointLatLng((decimal)(baselat + 1 / 24.0), (decimal)(baselon + 2 / 24.0)));
l.Add(new PointLatLng((decimal)baselat, (decimal)(baselon + 2 / 24.0)));
GMapPolygon p = new GMapPolygon(l, (string)e.UserState);
p.Stroke = new Pen(Color.FromArgb(50, Color.Red));
p.Fill = new SolidBrush(Color.FromArgb(50, Color.Red));
ASTER3polygons.Polygons.Add(p);
}
else
{
Say((string)e.UserState);
}
}
private void bw_ASTER3_MapUpdater_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
}
private void tab_Options_ASTER3_Enter(object sender, EventArgs e)
{
// clear map polygons
ASTER3polygons.Clear();
// add coverage to map polygons
List<PointLatLng> cl = new List<PointLatLng>();
cl.Add(new PointLatLng(Properties.Settings.Default.MinLat, Properties.Settings.Default.MinLon));
cl.Add(new PointLatLng(Properties.Settings.Default.MinLat, Properties.Settings.Default.MaxLon));
cl.Add(new PointLatLng(Properties.Settings.Default.MaxLat, Properties.Settings.Default.MaxLon));
cl.Add(new PointLatLng(Properties.Settings.Default.MaxLat, Properties.Settings.Default.MinLon));
GMapPolygon c = new GMapPolygon(cl, "Coverage");
c.Stroke = new Pen(Color.FromArgb(255, Color.Magenta), 3);
c.Fill = new SolidBrush(Color.FromArgb(0, Color.Magenta));
ASTER3polygons.Polygons.Add(c);
// zoom the map initally
gm_Options_ASTER3.SetZoomToFitRect(RectLatLng.FromLTRB(Properties.Settings.Default.MinLon, Properties.Settings.Default.MaxLat, Properties.Settings.Default.MaxLon, Properties.Settings.Default.MinLat));
// start map updater
if (!bw_ASTER3_MapUpdater.IsBusy)
bw_ASTER3_MapUpdater.RunWorkerAsync();
// zoom the map
gm_Options_Coverage.SetZoomToFitRect(RectLatLng.FromLTRB(Properties.Settings.Default.MinLon - 1, Properties.Settings.Default.MaxLat + 1, Properties.Settings.Default.MaxLon + 1, Properties.Settings.Default.MinLat - 1));
}
private void tab_Options_ASTER3_Leave(object sender, EventArgs e)
{
// stop map updater
bw_ASTER3_MapUpdater.CancelAsync();
// clear map polygons
ASTER3polygons.Clear();
// do garbage collection
GC.Collect();
Say("");
}
private void btn_Options_ASTER3_Copyright_Click(object sender, EventArgs e)
{
ElevationCopyrightDlg Dlg = new ElevationCopyrightDlg();
Dlg.Text = "ASTER3 Copyright Information";
Dlg.rtb_Copyright.Text = Properties.Settings.Default.Elevation_ASTER3_Copyright;
Dlg.ShowDialog();
}
#endregion
#region tab_Options_ASTER1
private void bw_ASTER1_MapUpdater_DoWork(object sender, DoWorkEventArgs e)
{
bw_ASTER1_MapUpdater.ReportProgress(0, "ASTER1: Creating elevation tile catalogue...");
ElevationCatalogue availabletiles = ElevationData.Database.ElevationCatalogueCreateCheckBoundsAndLastModified(bw_ASTER1_MapUpdater, ELEVATIONMODEL.ASTER1, Properties.Settings.Default.MinLat, Properties.Settings.Default.MinLon, Properties.Settings.Default.MaxLat, Properties.Settings.Default.MaxLon);
bw_ASTER1_MapUpdater.ReportProgress(0, "ASTER1: Processing tiles...");
int missing = 0;
int found = 0;
foreach (string tilename in availabletiles.Files.Keys)
{
if (ElevationData.Database.ElevationTileExists(tilename.Substring(0, 6), ELEVATIONMODEL.ASTER1))
{
bw_ASTER1_MapUpdater.ReportProgress(1, tilename);
found++;
}
else
{
bw_ASTER1_MapUpdater.ReportProgress(-1, tilename);
missing++;
}
if (bw_ASTER1_MapUpdater.CancellationPending)
{
bw_ASTER1_MapUpdater.ReportProgress(0, "ASTER1: Processing cancelled...");
return;
}
}
bw_ASTER1_MapUpdater.ReportProgress(0, "ASTER1: " + found.ToString() + " tile(s) found, " + missing.ToString() + " more tile(s) available and missing.");
}
private void bw_ASTER1_MapUpdater_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
if (e.ProgressPercentage == 1)
{
// add a tile found in database to map polygons
double baselat;
double baselon;
MaidenheadLocator.LatLonFromLoc(((string)e.UserState).Substring(0, 6), PositionInRectangle.BottomLeft, out baselat, out baselon);
List<PointLatLng> l = new List<PointLatLng>();
l.Add(new PointLatLng((decimal)baselat, (decimal)baselon));
l.Add(new PointLatLng((decimal)(baselat + 1 / 24.0), (decimal)baselon));
l.Add(new PointLatLng((decimal)(baselat + 1 / 24.0), (decimal)(baselon + 2 / 24.0)));
l.Add(new PointLatLng((decimal)baselat, (decimal)(baselon + 2 / 24.0)));
GMapPolygon p = new GMapPolygon(l, (string)e.UserState);
p.Stroke = new Pen(Color.FromArgb(50, Color.Green));
p.Fill = new SolidBrush(Color.FromArgb(50, Color.Green));
ASTER1polygons.Polygons.Add(p);
}
else if (e.ProgressPercentage == -1)
{
// add missing tile to map polygons
double baselat;
double baselon;
MaidenheadLocator.LatLonFromLoc(((string)e.UserState).Substring(0, 6), PositionInRectangle.BottomLeft, out baselat, out baselon);
List<PointLatLng> l = new List<PointLatLng>();
l.Add(new PointLatLng((decimal)baselat, (decimal)baselon));
l.Add(new PointLatLng((decimal)(baselat + 1 / 24.0), (decimal)baselon));
l.Add(new PointLatLng((decimal)(baselat + 1 / 24.0), (decimal)(baselon + 2 / 24.0)));
l.Add(new PointLatLng((decimal)baselat, (decimal)(baselon + 2 / 24.0)));
GMapPolygon p = new GMapPolygon(l, (string)e.UserState);
p.Stroke = new Pen(Color.FromArgb(50, Color.Red));
p.Fill = new SolidBrush(Color.FromArgb(50, Color.Red));
ASTER1polygons.Polygons.Add(p);
}
else
{
Say((string)e.UserState);
}
}
private void bw_ASTER1_MapUpdater_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
}
private void tba_Option_ASTER1_Enter(object sender, EventArgs e)
{
// clear map polygons
ASTER1polygons.Clear();
// add coverage to map polygons
List<PointLatLng> cl = new List<PointLatLng>();
cl.Add(new PointLatLng(Properties.Settings.Default.MinLat, Properties.Settings.Default.MinLon));
cl.Add(new PointLatLng(Properties.Settings.Default.MinLat, Properties.Settings.Default.MaxLon));
cl.Add(new PointLatLng(Properties.Settings.Default.MaxLat, Properties.Settings.Default.MaxLon));
cl.Add(new PointLatLng(Properties.Settings.Default.MaxLat, Properties.Settings.Default.MinLon));
GMapPolygon c = new GMapPolygon(cl, "Coverage");
c.Stroke = new Pen(Color.FromArgb(255, Color.Magenta), 3);
c.Fill = new SolidBrush(Color.FromArgb(0, Color.Magenta));
ASTER1polygons.Polygons.Add(c);
// zoom the map initally
gm_Options_ASTER1.SetZoomToFitRect(RectLatLng.FromLTRB(Properties.Settings.Default.MinLon, Properties.Settings.Default.MaxLat, Properties.Settings.Default.MaxLon, Properties.Settings.Default.MinLat));
// start map updater
if (!bw_ASTER1_MapUpdater.IsBusy)
bw_ASTER1_MapUpdater.RunWorkerAsync();
// zoom the map
gm_Options_Coverage.SetZoomToFitRect(RectLatLng.FromLTRB(Properties.Settings.Default.MinLon - 1, Properties.Settings.Default.MaxLat + 1, Properties.Settings.Default.MaxLon + 1, Properties.Settings.Default.MinLat - 1));
}
private void tba_Option_ASTER1_Leave(object sender, EventArgs e)
{
// stop map updater
bw_ASTER1_MapUpdater.CancelAsync();
// clear map polygons
ASTER1polygons.Clear();
// do garbage collection
GC.Collect();
Say("");
}
private void btn_Options_ASTER1_Copyright_Click(object sender, EventArgs e)
{
ElevationCopyrightDlg Dlg = new ElevationCopyrightDlg();
Dlg.Text = "ASTER1 Copyright Information";
Dlg.rtb_Copyright.Text = Properties.Settings.Default.Elevation_ASTER1_Copyright;
Dlg.ShowDialog();
}
#endregion
#region tab_Options_Path
@ -1712,7 +1987,6 @@ namespace AirScout
}
return ld;
}
private void btn_Options_Path_Export_Click(object sender, EventArgs e)
{
// check and update station database
@ -1727,7 +2001,7 @@ namespace AirScout
if (myqrv.AntennaGain == 0)
myqrv.AntennaGain = StationData.Database.QRVGetDefaultAntennaGain(Properties.Settings.Default.Band);
if (myqrv.Power == 0)
myqrv.Power = StationData.Database.QRVGetDefaultPower(Properties.Settings.Default.Band);
myqrv.Power = StationData.Database.QRVGetDefaultPower(Properties.Settings.Default.Band);
// check if there are a valid DX settings
if (!Callsign.Check(Properties.Settings.Default.DXCall) ||
!GeographicalPoint.Check(Properties.Settings.Default.DXLat, Properties.Settings.Default.DXLon))
@ -1772,7 +2046,7 @@ namespace AirScout
SaveFileDialog Dlg = new SaveFileDialog();
Dlg.AddExtension = true;
Dlg.DefaultExt = "csv";
Dlg.Filter = "Comma Separated Values *.csv |csv";
Dlg.Filter = "Comma Separated Values *.csv |*.csv";
Dlg.FileName = "Path Information " + Properties.Settings.Default.MyCall.Replace("/", "_") + " to " + Properties.Settings.Default.DXCall.Replace("/", "_");
Dlg.InitialDirectory = Application.StartupPath;
Dlg.OverwritePrompt = true;
@ -1782,21 +2056,26 @@ namespace AirScout
{
using (StreamWriter sw = new StreamWriter(Dlg.FileName))
{
int est = 10;
sw.WriteLine("Distance[km];Lat[deg];Lon[deg];Elevation[m]");
for (int i = 0; i < epath.Path.Length; i++)
{
double distance = (double)i * epath.StepWidth / 1000.0;
LatLon.GPoint p = LatLon.DestinationPoint(myloc.Lat, myloc.Lon, epath.Bearing12, distance);
sw.WriteLine(distance.ToString("F8") + ";" +
p.Lat.ToString("F8") + ";" +
p.Lon.ToString("F8") + ";" +
epath.Path[i].ToString());
for (int j = 0; j < epath.StepWidth / est; j++)
{
double distance = (double)(i + j * est / epath.StepWidth) * epath.StepWidth / 1000.0;
LatLon.GPoint p = LatLon.DestinationPoint(myloc.Lat, myloc.Lon, epath.Bearing12, distance);
sw.WriteLine(distance.ToString("F8") + ";" +
p.Lat.ToString("F8") + ";" +
p.Lon.ToString("F8") + ";" +
epath.Path[i].ToString());
}
}
}
}
catch
catch (Exception ex)
{
// do nothing, if export is going wrong
MessageBox.Show("Error while exporting path: " + ex.Message, "Export Path to CSV");
Log.WriteMessage(ex.ToString());
}
}
}
@ -2203,7 +2482,7 @@ namespace AirScout
{
try
{
Properties.Settings.Default.Planes_Filter_Min_Category = PlaneCategories.ParseStringValue((string) cb_Options_Planes_Filter_Min_Cat.SelectedItem);
Properties.Settings.Default.Planes_Filter_Min_Category = PlaneCategories.ParseStringValue((string)cb_Options_Planes_Filter_Min_Cat.SelectedItem);
}
catch (Exception ex)
{
@ -2548,14 +2827,13 @@ namespace AirScout
#endregion
public class StationDataUpdaterDoWorkEventArgs
{
public LocationDesignator ld;
public List<QRVDesignator> qrvs;
}
}
public class StationDataUpdaterDoWorkEventArgs
{
public LocationDesignator ld;
public List<QRVDesignator> qrvs;
}
}

Wyświetl plik

@ -120,6 +120,65 @@
<metadata name="tt_Options.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="label61.Text" xml:space="preserve">
<value>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.</value>
</data>
<data name="label52.Text" xml:space="preserve">
<value>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.</value>
</data>
<data name="label86.Text" xml:space="preserve">
<value>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.</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>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.</value>
</data>
<data name="label65.Text" xml:space="preserve">
<value>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.</value>
</data>
<data name="label37.Text" xml:space="preserve">
<value>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).</value>
</data>
<metadata name="bw_SRTM3_MapUpdater.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>130, 17</value>
</metadata>
<metadata name="ss_Options.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>353, 17</value>
</metadata>
<metadata name="bw_SRTM1_MapUpdater.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>483, 17</value>
</metadata>
<metadata name="bw_GLOBE_MapUpdater.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>706, 17</value>
</metadata>
<metadata name="bw_StationDataUpdater.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>890, 17</value>
</metadata>
<metadata name="bw_ASTER3_MapUpdater.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1071, 17</value>
</metadata>
<metadata name="bw_ASTER1_MapUpdater.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1259, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="pb_Donate.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
@ -239,56 +298,4 @@
bOQwu7KRw+zKRg6zKxs5zK5s5DC7spHD7MpGDrMrGznMrkwUwn8BkAmqaXV391cAAAAASUVORK5CYII=
</value>
</data>
<data name="label61.Text" xml:space="preserve">
<value>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.</value>
</data>
<data name="label52.Text" xml:space="preserve">
<value>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.</value>
</data>
<data name="label86.Text" xml:space="preserve">
<value>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.</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>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.</value>
</data>
<data name="label65.Text" xml:space="preserve">
<value>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.</value>
</data>
<data name="label37.Text" xml:space="preserve">
<value>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).</value>
</data>
<metadata name="bw_SRTM3_MapUpdater.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>130, 17</value>
</metadata>
<metadata name="ss_Options.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>353, 17</value>
</metadata>
<metadata name="bw_SRTM1_MapUpdater.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>483, 17</value>
</metadata>
<metadata name="bw_GLOBE_MapUpdater.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>706, 17</value>
</metadata>
<metadata name="bw_StationDataUpdater.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>890, 17</value>
</metadata>
</root>

Wyświetl plik

@ -0,0 +1,44 @@
namespace AirScout
{
partial class PercentageControl
{
/// <summary>
/// Erforderliche Designervariable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Verwendete Ressourcen bereinigen.
/// </summary>
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Vom Komponenten-Designer generierter Code
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
//
// PercentageControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Name = "PercentageControl";
this.ResumeLayout(false);
}
#endregion
}
}

Wyświetl plik

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace AirScout
{
public partial class PercentageControl : NumericUpDown
{
public PercentageControl()
{
InitializeComponent();
}
protected override void UpdateEditText()
{
this.Text = Value.ToString("0%");
// base.UpdateEditText();
}
}
}

Wyświetl plik

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

Wyświetl plik

@ -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.3.3")]
[assembly: AssemblyFileVersion("1.3.3.3")]
[assembly: AssemblyVersion("1.4.0.0")]
[assembly: AssemblyFileVersion("1.4.0.0")]

Wyświetl plik

@ -2304,5 +2304,156 @@ Digital data base on the World Wide Web (URL: http://www.ngdc.noaa.gov/mgg/topo/
this["Map_Preloader_MaxZoom"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Maidenhead locator system elvation tiles calculated by DL2ALF based on elevation " +
"data of the ASTER project:\r\n\r\nThe ASTER Global Digital Elevation Model (GDEM) V" +
"ersion 3 (ASTGTM) provides a global digital elevation model (DEM) of land areas " +
"on Earth at a spatial resolution of 1 arc second (approximately 30 meter horizon" +
"tal posting at the equator).\r\n\r\nThe development of the ASTER GDEM data products " +
"is a collaborative effort between National Aeronautics and Space Administration " +
"(NASA) and Japans Ministry of Economy, Trade, and Industry (METI).\r\nThe ASTER G" +
"DEM data products are created by the Sensor Information Laboratory Corporation (" +
"SILC) in Tokyo.\r\n\r\nThe ASTER GDEM Version 3 data product was created from the au" +
"tomated processing of the entire ASTER Level 1A archive of scenes acquired betwe" +
"en March 1, 2000, and November 30, 2013\r\nStereo correlation was used to produce " +
"over one million individual scene based ASTER DEMs, to which cloud masking was a" +
"pplied. All cloud screened DEMs and non-cloud screened DEMs were stacked.\r\nResid" +
"ual bad values and outliers were removed. In areas with limited data stacking, s" +
"everal existing reference DEMs were used to supplement ASTER data to correct for" +
" residual anomalies.\r\nSelected data were averaged to create final pixel values b" +
"efore partitioning the data into 1° by 1° tiles with a one pixel overlap.\r\nTo co" +
"rrect elevation values of water body surfaces, the ASTER Global Water Bodies Dat" +
"abase (ASTWBD) Version 1 data product was also generated.\r\n\r\nASTER GDEM is a pro" +
"duct of NASA and MET See Ihttps://lpdaac.usgs.gov/products/astgtmv003/\r\n\r\nNASA/M" +
"ETI/AIST/Japan Spacesystems, and U.S./Japan ASTER Science Team (2019). ASTER Glo" +
"bal Digital Elevation Model V003 [Data set]. NASA EOSDIS Land Processes DAAC\r\n")]
public string Elevation_ASTER3_Copyright {
get {
return ((string)(this["Elevation_ASTER3_Copyright"]));
}
set {
this["Elevation_ASTER3_Copyright"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool Elevation_ASTER3_Enabled {
get {
return ((bool)(this["Elevation_ASTER3_Enabled"]));
}
set {
this["Elevation_ASTER3_Enabled"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool Elevation_ASTER3_EnableCache {
get {
return ((bool)(this["Elevation_ASTER3_EnableCache"]));
}
set {
this["Elevation_ASTER3_EnableCache"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Maidenhead locator system elvation tiles calculated by DL2ALF based on elevation " +
"data of the ASTER project:\r\n\r\nThe ASTER Global Digital Elevation Model (GDEM) V" +
"ersion 3 (ASTGTM) provides a global digital elevation model (DEM) of land areas " +
"on Earth at a spatial resolution of 1 arc second (approximately 30 meter horizon" +
"tal posting at the equator).\r\n\r\nThe development of the ASTER GDEM data products " +
"is a collaborative effort between National Aeronautics and Space Administration " +
"(NASA) and Japans Ministry of Economy, Trade, and Industry (METI).\r\nThe ASTER G" +
"DEM data products are created by the Sensor Information Laboratory Corporation (" +
"SILC) in Tokyo.\r\n\r\nThe ASTER GDEM Version 3 data product was created from the au" +
"tomated processing of the entire ASTER Level 1A archive of scenes acquired betwe" +
"en March 1, 2000, and November 30, 2013\r\nStereo correlation was used to produce " +
"over one million individual scene based ASTER DEMs, to which cloud masking was a" +
"pplied. All cloud screened DEMs and non-cloud screened DEMs were stacked.\r\nResid" +
"ual bad values and outliers were removed. In areas with limited data stacking, s" +
"everal existing reference DEMs were used to supplement ASTER data to correct for" +
" residual anomalies.\r\nSelected data were averaged to create final pixel values b" +
"efore partitioning the data into 1° by 1° tiles with a one pixel overlap.\r\nTo co" +
"rrect elevation values of water body surfaces, the ASTER Global Water Bodies Dat" +
"abase (ASTWBD) Version 1 data product was also generated.\r\n\r\nASTER GDEM is a pro" +
"duct of NASA and MET See Ihttps://lpdaac.usgs.gov/products/astgtmv003/\r\n\r\nNASA/M" +
"ETI/AIST/Japan Spacesystems, and U.S./Japan ASTER Science Team (2019). ASTER Glo" +
"bal Digital Elevation Model V003 [Data set]. NASA EOSDIS Land Processes DAAC\r\n\r\n" +
"")]
public string Elevation_ASTER1_Copyright {
get {
return ((string)(this["Elevation_ASTER1_Copyright"]));
}
set {
this["Elevation_ASTER1_Copyright"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool Elevation_ASTER1_Enabled {
get {
return ((bool)(this["Elevation_ASTER1_Enabled"]));
}
set {
this["Elevation_ASTER1_Enabled"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool Elevation_ASTER1_EnableCache {
get {
return ((bool)(this["Elevation_ASTER1_EnableCache"]));
}
set {
this["Elevation_ASTER1_EnableCache"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("UNDEFINED")]
public global::System.Data.SQLite.DATABASESTATUS Elevation_ASTER3_DatabaseStatus {
get {
return ((global::System.Data.SQLite.DATABASESTATUS)(this["Elevation_ASTER3_DatabaseStatus"]));
}
set {
this["Elevation_ASTER3_DatabaseStatus"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("UNDEFINED")]
public global::System.Data.SQLite.DATABASESTATUS Elevation_ASTER1_DatabaseStatus {
get {
return ((global::System.Data.SQLite.DATABASESTATUS)(this["Elevation_ASTER1_DatabaseStatus"]));
}
set {
this["Elevation_ASTER1_DatabaseStatus"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("1")]
public decimal Map_Opacity {
get {
return ((decimal)(this["Map_Opacity"]));
}
set {
this["Map_Opacity"] = value;
}
}
}
}

Wyświetl plik

@ -604,5 +604,65 @@ MEaSUREs data and products are available at no charge from the LP DAAC.See https
<Setting Name="Map_Preloader_MaxZoom" Type="System.Decimal" Scope="User">
<Value Profile="(Default)">11</Value>
</Setting>
<Setting Name="Elevation_ASTER3_Copyright" Type="System.String" Scope="User">
<Value Profile="(Default)">Maidenhead locator system elvation tiles calculated by DL2ALF based on elevation data of the ASTER project:
The ASTER Global Digital Elevation Model (GDEM) Version 3 (ASTGTM) provides a global digital elevation model (DEM) of land areas on Earth at a spatial resolution of 1 arc second (approximately 30 meter horizontal posting at the equator).
The development of the ASTER GDEM data products is a collaborative effort between National Aeronautics and Space Administration (NASA) and Japans Ministry of Economy, Trade, and Industry (METI).
The ASTER GDEM data products are created by the Sensor Information Laboratory Corporation (SILC) in Tokyo.
The ASTER GDEM Version 3 data product was created from the automated processing of the entire ASTER Level 1A archive of scenes acquired between March 1, 2000, and November 30, 2013
Stereo correlation was used to produce over one million individual scene based ASTER DEMs, to which cloud masking was applied. All cloud screened DEMs and non-cloud screened DEMs were stacked.
Residual bad values and outliers were removed. In areas with limited data stacking, several existing reference DEMs were used to supplement ASTER data to correct for residual anomalies.
Selected data were averaged to create final pixel values before partitioning the data into 1° by 1° tiles with a one pixel overlap.
To correct elevation values of water body surfaces, the ASTER Global Water Bodies Database (ASTWBD) Version 1 data product was also generated.
ASTER GDEM is a product of NASA and MET See Ihttps://lpdaac.usgs.gov/products/astgtmv003/
NASA/METI/AIST/Japan Spacesystems, and U.S./Japan ASTER Science Team (2019). ASTER Global Digital Elevation Model V003 [Data set]. NASA EOSDIS Land Processes DAAC
</Value>
</Setting>
<Setting Name="Elevation_ASTER3_Enabled" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="Elevation_ASTER3_EnableCache" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="Elevation_ASTER1_Copyright" Type="System.String" Scope="User">
<Value Profile="(Default)">Maidenhead locator system elvation tiles calculated by DL2ALF based on elevation data of the ASTER project:
The ASTER Global Digital Elevation Model (GDEM) Version 3 (ASTGTM) provides a global digital elevation model (DEM) of land areas on Earth at a spatial resolution of 1 arc second (approximately 30 meter horizontal posting at the equator).
The development of the ASTER GDEM data products is a collaborative effort between National Aeronautics and Space Administration (NASA) and Japans Ministry of Economy, Trade, and Industry (METI).
The ASTER GDEM data products are created by the Sensor Information Laboratory Corporation (SILC) in Tokyo.
The ASTER GDEM Version 3 data product was created from the automated processing of the entire ASTER Level 1A archive of scenes acquired between March 1, 2000, and November 30, 2013
Stereo correlation was used to produce over one million individual scene based ASTER DEMs, to which cloud masking was applied. All cloud screened DEMs and non-cloud screened DEMs were stacked.
Residual bad values and outliers were removed. In areas with limited data stacking, several existing reference DEMs were used to supplement ASTER data to correct for residual anomalies.
Selected data were averaged to create final pixel values before partitioning the data into 1° by 1° tiles with a one pixel overlap.
To correct elevation values of water body surfaces, the ASTER Global Water Bodies Database (ASTWBD) Version 1 data product was also generated.
ASTER GDEM is a product of NASA and MET See Ihttps://lpdaac.usgs.gov/products/astgtmv003/
NASA/METI/AIST/Japan Spacesystems, and U.S./Japan ASTER Science Team (2019). ASTER Global Digital Elevation Model V003 [Data set]. NASA EOSDIS Land Processes DAAC
</Value>
</Setting>
<Setting Name="Elevation_ASTER1_Enabled" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="Elevation_ASTER1_EnableCache" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="Elevation_ASTER3_DatabaseStatus" Type="System.Data.SQLite.DATABASESTATUS" Scope="User">
<Value Profile="(Default)">UNDEFINED</Value>
</Setting>
<Setting Name="Elevation_ASTER1_DatabaseStatus" Type="System.Data.SQLite.DATABASESTATUS" Scope="User">
<Value Profile="(Default)">UNDEFINED</Value>
</Setting>
<Setting Name="Map_Opacity" Type="System.Decimal" Scope="User">
<Value Profile="(Default)">1</Value>
</Setting>
</Settings>
</SettingsFile>

Wyświetl plik

@ -1,4 +1,11 @@
2020-xx-xx: V1.3.3.3
2020-xx-xx: V1.4.0.0
====================
- Feature: introducing ASTER Digital Elevation Model covering earth surface almost complete, but data are very raw and have to filtered, only useful when coverage > 60° needed
- Feature: new OpenTopoMap provider, not really suitable for surpervising aircraft travel but has very nice contour levels (based on SRTM)
- Feature: adjust main map opacity via "Options/Map" which is helpful in case map colors are very prominent
2020-xx-xx: V1.3.3.3
====================
- Feature: export current path to CSV, feature was removed during change to V1.3.x

Wyświetl plik

@ -603,6 +603,66 @@ MEaSUREs data and products are available at no charge from the LP DAAC.See https
<setting name="Map_Preloader_MaxZoom" serializeAs="String">
<value>11</value>
</setting>
<setting name="Elevation_ASTER3_Copyright" serializeAs="String">
<value>Maidenhead locator system elvation tiles calculated by DL2ALF based on elevation data of the ASTER project:
The ASTER Global Digital Elevation Model (GDEM) Version 3 (ASTGTM) provides a global digital elevation model (DEM) of land areas on Earth at a spatial resolution of 1 arc second (approximately 30 meter horizontal posting at the equator).
The development of the ASTER GDEM data products is a collaborative effort between National Aeronautics and Space Administration (NASA) and Japans Ministry of Economy, Trade, and Industry (METI).
The ASTER GDEM data products are created by the Sensor Information Laboratory Corporation (SILC) in Tokyo.
The ASTER GDEM Version 3 data product was created from the automated processing of the entire ASTER Level 1A archive of scenes acquired between March 1, 2000, and November 30, 2013
Stereo correlation was used to produce over one million individual scene based ASTER DEMs, to which cloud masking was applied. All cloud screened DEMs and non-cloud screened DEMs were stacked.
Residual bad values and outliers were removed. In areas with limited data stacking, several existing reference DEMs were used to supplement ASTER data to correct for residual anomalies.
Selected data were averaged to create final pixel values before partitioning the data into 1° by 1° tiles with a one pixel overlap.
To correct elevation values of water body surfaces, the ASTER Global Water Bodies Database (ASTWBD) Version 1 data product was also generated.
ASTER GDEM is a product of NASA and MET See Ihttps://lpdaac.usgs.gov/products/astgtmv003/
NASA/METI/AIST/Japan Spacesystems, and U.S./Japan ASTER Science Team (2019). ASTER Global Digital Elevation Model V003 [Data set]. NASA EOSDIS Land Processes DAAC
</value>
</setting>
<setting name="Elevation_ASTER3_Enabled" serializeAs="String">
<value>False</value>
</setting>
<setting name="Elevation_ASTER3_EnableCache" serializeAs="String">
<value>False</value>
</setting>
<setting name="Elevation_ASTER1_Copyright" serializeAs="String">
<value>Maidenhead locator system elvation tiles calculated by DL2ALF based on elevation data of the ASTER project:
The ASTER Global Digital Elevation Model (GDEM) Version 3 (ASTGTM) provides a global digital elevation model (DEM) of land areas on Earth at a spatial resolution of 1 arc second (approximately 30 meter horizontal posting at the equator).
The development of the ASTER GDEM data products is a collaborative effort between National Aeronautics and Space Administration (NASA) and Japans Ministry of Economy, Trade, and Industry (METI).
The ASTER GDEM data products are created by the Sensor Information Laboratory Corporation (SILC) in Tokyo.
The ASTER GDEM Version 3 data product was created from the automated processing of the entire ASTER Level 1A archive of scenes acquired between March 1, 2000, and November 30, 2013
Stereo correlation was used to produce over one million individual scene based ASTER DEMs, to which cloud masking was applied. All cloud screened DEMs and non-cloud screened DEMs were stacked.
Residual bad values and outliers were removed. In areas with limited data stacking, several existing reference DEMs were used to supplement ASTER data to correct for residual anomalies.
Selected data were averaged to create final pixel values before partitioning the data into 1° by 1° tiles with a one pixel overlap.
To correct elevation values of water body surfaces, the ASTER Global Water Bodies Database (ASTWBD) Version 1 data product was also generated.
ASTER GDEM is a product of NASA and MET See Ihttps://lpdaac.usgs.gov/products/astgtmv003/
NASA/METI/AIST/Japan Spacesystems, and U.S./Japan ASTER Science Team (2019). ASTER Global Digital Elevation Model V003 [Data set]. NASA EOSDIS Land Processes DAAC
</value>
</setting>
<setting name="Elevation_ASTER1_Enabled" serializeAs="String">
<value>False</value>
</setting>
<setting name="Elevation_ASTER1_EnableCache" serializeAs="String">
<value>False</value>
</setting>
<setting name="Elevation_ASTER3_DatabaseStatus" serializeAs="String">
<value>UNDEFINED</value>
</setting>
<setting name="Elevation_ASTER1_DatabaseStatus" serializeAs="String">
<value>UNDEFINED</value>
</setting>
<setting name="Map_Opacity" serializeAs="String">
<value>1</value>
</setting>
</AirScout.Properties.Settings>
</userSettings>
<startup>

Wyświetl plik

@ -167,6 +167,7 @@
<Compile Include="GMap.NET.MapProviders\Lithuania\LithuaniaOrtoFotoMapProvider.cs" />
<Compile Include="GMap.NET.MapProviders\Lithuania\Lithuania3dMapProvider.cs" />
<Compile Include="GMap.NET.MapProviders\Lithuania\LithuaniaMapProvider.cs" />
<Compile Include="GMap.NET.MapProviders\OpenStreetMap\OpenTopoMapProvider.cs" />
<Compile Include="GMap.NET.MapProviders\OpenStreetMap\OpenStreetMapQuestSatteliteProvider.cs" />
<Compile Include="GMap.NET.MapProviders\OpenStreetMap\OpenStreetMapQuestHybridProvider.cs" />
<Compile Include="GMap.NET.MapProviders\OpenStreetMap\OpenStreetMapQuestProvider.cs" />

Wyświetl plik

@ -38,6 +38,8 @@ namespace GMap.NET.MapProviders
public static readonly OpenSeaMapHybridProvider OpenSeaMapHybrid = OpenSeaMapHybridProvider.Instance;
public static readonly OpenTopoMapProvider OpenTopoMap = OpenTopoMapProvider.Instance;
#if OpenStreetOsm
public static readonly OpenStreetOsmProvider OpenStreetOsm = OpenStreetOsmProvider.Instance;
#endif
@ -46,7 +48,7 @@ namespace GMap.NET.MapProviders
public static readonly OpenStreetMapSurferProvider OpenStreetMapSurfer = OpenStreetMapSurferProvider.Instance;
public static readonly OpenStreetMapSurferTerrainProvider OpenStreetMapSurferTerrain = OpenStreetMapSurferTerrainProvider.Instance;
#endif
public static readonly WikiMapiaMapProvider WikiMapiaMap = WikiMapiaMapProvider.Instance;
public static readonly WikiMapiaMapProvider WikiMapiaMap = WikiMapiaMapProvider.Instance;
public static readonly BingMapProvider BingMap = BingMapProvider.Instance;
public static readonly BingSatelliteMapProvider BingSatelliteMap = BingSatelliteMapProvider.Instance;

Wyświetl plik

@ -0,0 +1,75 @@

namespace GMap.NET.MapProviders
{
using System;
/// <summary>
/// OpenTopoMap provider - http://www.opentopomap.org
/// </summary>
public class OpenTopoMapProvider : OpenStreetMapProviderBase
{
public static readonly OpenTopoMapProvider Instance;
OpenTopoMapProvider()
{
RefererUrl = "";
Copyright = string.Format("© OpenTopoMap - Map data ©{0} OpenTopoMap. Licence CC-BY-SA. See www.opentopomap.org", DateTime.Today.Year);
}
static OpenTopoMapProvider()
{
Instance = new OpenTopoMapProvider();
}
#region GMapProvider Members
readonly Guid id = new Guid("B8A6A7B4-3034-495D-BC83-96F6034748B1");
public override Guid Id
{
get
{
return id;
}
}
readonly string name = "OpenTopoMap";
public override string Name
{
get
{
return name;
}
}
GMapProvider[] overlays;
public override GMapProvider[] Overlays
{
get
{
if(overlays == null)
{
overlays = new GMapProvider[] { this };
}
return overlays;
}
}
public override PureImage GetTileImage(GPoint pos, int zoom)
{
string url = MakeTileImageUrl(pos, zoom, string.Empty);
return GetTileImageUsingHttp(url);
}
#endregion
string MakeTileImageUrl(GPoint pos, int zoom, string language)
{
char letter = ServerLetters[GMapProvider.GetServerNum(pos, 3)];
return string.Format(UrlFormat, letter, zoom, pos.X, pos.Y);
}
static readonly string UrlFormat = "https://{0}.tile.opentopomap.org/{1}/{2}/{3}.png";
}
}

Wyświetl plik

@ -493,8 +493,25 @@ namespace GMap.NET.WindowsForms
}
#endif
// internal stuff
internal readonly Core Core = new Core();
private double _Opacity = 1.0;
public double Opacity
{
get
{
return _Opacity;
}
set
{
_Opacity = value;
if (Core.IsStarted)
{
ReloadMap();
}
}
}
// internal stuff
internal readonly Core Core = new Core();
internal readonly Font CopyrightFont = new Font(FontFamily.GenericSansSerif, 7, FontStyle.Regular);
#if !PocketPC
@ -530,7 +547,8 @@ namespace GMap.NET.WindowsForms
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.Opaque, true);
// this.SetStyle(ControlStyles.Opaque, true);
this.SetStyle(ControlStyles.Opaque, false);
ResizeRedraw = true;
TileFlipXYAttributes.SetWrapMode(WrapMode.TileFlipXY);
@ -613,11 +631,53 @@ namespace GMap.NET.WindowsForms
}
}
/// <summary>
/// render map in GDI+
/// </summary>
/// <param name="g"></param>
void DrawMap(Graphics g)
private const int bytesPerPixel = 4;
/// <summary>
/// method for changing the opacity of an image
/// </summary>
/// <param name="image">image to set opacity on</param>
/// <param name="opacity">percentage of opacity</param>
/// <returns></returns>
public Image SetImageOpacity(Image image, double opacity)
{
try
{
//create a Bitmap the size of the image provided
Bitmap bmp = new Bitmap(image.Width, image.Height);
//create a graphics object from the image
using (Graphics gfx = Graphics.FromImage(bmp))
{
//create a color matrix object
ColorMatrix matrix = new ColorMatrix();
//set the opacity
matrix.Matrix33 = (float)opacity;
//create image attributes
ImageAttributes attributes = new ImageAttributes();
//set the color(opacity) of the image
attributes.SetColorMatrix(matrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
//now draw the image
gfx.DrawImage(image, new Rectangle(0, 0, bmp.Width, bmp.Height), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, attributes);
}
return bmp;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
return null;
}
}
/// <summary>
/// render map in GDI+
/// </summary>
/// <param name="g"></param>
void DrawMap(Graphics g)
{
if(Core.updatingBounds || MapProvider == EmptyProvider.Instance || MapProvider == null)
{
@ -665,7 +725,16 @@ namespace GMap.NET.WindowsForms
if(!img.IsParent)
{
#if !PocketPC
g.DrawImage(img.Img, Core.tileRect.X, Core.tileRect.Y, Core.tileRectBearing.Width, Core.tileRectBearing.Height);
// change opacity if < 1.0
if (Opacity < 1)
{
Image im = SetImageOpacity(img.Img, Opacity);
g.DrawImage(im, Core.tileRect.X, Core.tileRect.Y, Core.tileRectBearing.Width, Core.tileRectBearing.Height);
}
else
{
g.DrawImage(img.Img, Core.tileRect.X, Core.tileRect.Y, Core.tileRectBearing.Width, Core.tileRectBearing.Height);
}
#else
g.DrawImage(img.Img, (int) Core.tileRect.X, (int) Core.tileRect.Y);
#endif
@ -676,8 +745,16 @@ namespace GMap.NET.WindowsForms
// TODO: move calculations to loader thread
System.Drawing.RectangleF srcRect = new System.Drawing.RectangleF((float)(img.Xoff * (img.Img.Width / img.Ix)), (float)(img.Yoff * (img.Img.Height / img.Ix)), (img.Img.Width / img.Ix), (img.Img.Height / img.Ix));
System.Drawing.Rectangle dst = new System.Drawing.Rectangle((int)Core.tileRect.X, (int)Core.tileRect.Y, (int)Core.tileRect.Width, (int)Core.tileRect.Height);
g.DrawImage(img.Img, dst, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, GraphicsUnit.Pixel, TileFlipXYAttributes);
// change opacity if < 1.0
if (Opacity < 1)
{
Image im = SetImageOpacity(img.Img, Opacity);
g.DrawImage(im, dst, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, GraphicsUnit.Pixel, TileFlipXYAttributes);
}
else
{
g.DrawImage(img.Img, dst, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, GraphicsUnit.Pixel, TileFlipXYAttributes);
}
}
#endif
}

Wyświetl plik

@ -697,25 +697,36 @@ namespace ScoutBase.Core
/// <summary>
/// Gets the creation time of a web resource.
/// </summary>
/// <param name="address">The address URI of web resource.</param>
/// <param name="address">The address URI of web/file resource.</param>
/// <param name="allowredirect">Allows redirection of requested source.</param>
/// <returns>The creation time in UTC if successful. DateTime.MinValue if not.</returns>
public DateTime GetWebCreationTimeUtc(Uri address, bool allowredirect = true)
{
// get the last modified time of the website
// get the last modified time of the website/file
// returns DateTime.MinValue if address not found
try
{
DateTime webcreationtime = DateTime.MinValue;
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(address);
// allow redirect 2017/12/06 DL2ALF
req.AllowAutoRedirect = allowredirect;
using (HttpWebResponse res = (HttpWebResponse)req.GetResponse())
if (address.IsFile)
{
webcreationtime = res.LastModified.ToUniversalTime();
if (File.Exists(address.LocalPath))
{
webcreationtime = File.GetLastWriteTimeUtc(address.LocalPath);
}
}
Console.WriteLine("[GetWebCreationTime] Getting web creation time from address: " + address + " = " + webcreationtime.ToString("yyyy-MM-dd HH:mm:ss"));
return webcreationtime;
else
{
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(address);
// allow redirect 2017/12/06 DL2ALF
req.AllowAutoRedirect = allowredirect;
using (HttpWebResponse res = (HttpWebResponse)req.GetResponse())
{
webcreationtime = res.LastModified.ToUniversalTime();
}
Console.WriteLine("[GetWebCreationTime] Getting web creation time from address: " + address + " = " + webcreationtime.ToString("yyyy-MM-dd HH:mm:ss"));
}
return webcreationtime;
}
catch (Exception ex)
{
@ -726,44 +737,62 @@ namespace ScoutBase.Core
private bool DownloadFileFromWeb(string address, string filename, bool allowredirect, bool autounzip, string password = "")
{
// donwloads file from a web resource
// donwloads file from a web/file resource
try
{
// get web cration time
DateTime webcreationtime = GetWebCreationTimeUtc(address, allowredirect);
// download file and check for errors and uri identical to request
// do not use WebClient.Download for this!
var request = (HttpWebRequest)WebRequest.Create(address);
// allow redirect 2017/12/06 DL2ALF
request.AllowAutoRedirect = allowredirect;
request.Method = "GET";
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
Uri uri = new Uri(address);
if (uri.IsFile)
{
HttpStatusCode status = response.StatusCode;
if ((status == HttpStatusCode.OK) && (response.ResponseUri == new Uri(address)))
if (File.Exists(uri.LocalPath))
{
using (var responseStream = response.GetResponseStream())
File.Copy(uri.LocalPath, filename, true);
if (autounzip && Path.GetExtension(filename).ToLower() == ".zip")
{
using (var fileToDownload = new System.IO.FileStream(filename, System.IO.FileMode.Create, System.IO.FileAccess.ReadWrite))
Console.WriteLine("[DownloadFileFromWeb] Trying to unzip downloaded file: " + filename);
return ZIP.UncompressFile(filename, 60, password);
}
Console.WriteLine("[DownloadFileFromWeb] Downloading file from address finished: " + address);
return true;
}
}
else
{
// get web cration time
DateTime webcreationtime = GetWebCreationTimeUtc(address, allowredirect);
// download file and check for errors and uri identical to request
// do not use WebClient.Download for this!
var request = (HttpWebRequest)WebRequest.Create(address);
// allow redirect 2017/12/06 DL2ALF
request.AllowAutoRedirect = allowredirect;
request.Method = "GET";
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
{
HttpStatusCode status = response.StatusCode;
if ((status == HttpStatusCode.OK) && (response.ResponseUri == new Uri(address)))
{
using (var responseStream = response.GetResponseStream())
{
responseStream.CopyTo(fileToDownload);
using (var fileToDownload = new System.IO.FileStream(filename, System.IO.FileMode.Create, System.IO.FileAccess.ReadWrite))
{
responseStream.CopyTo(fileToDownload);
}
}
}
}
}
// set creation time
if (File.Exists(filename))
{
File.SetCreationTime(filename, webcreationtime);
File.SetLastWriteTime(filename, webcreationtime);
// unzip the file content if enabled
if (autounzip && (Path.GetExtension(filename).ToLower() == ".zip"))
// set creation time
if (File.Exists(filename))
{
Console.WriteLine("[DownloadFileFromWeb] Trying to unzip downloaded file: " + filename);
return ZIP.UncompressFile(filename, 60, password);
File.SetCreationTime(filename, webcreationtime);
File.SetLastWriteTime(filename, webcreationtime);
// unzip the file content if enabled
if (autounzip && (Path.GetExtension(filename).ToLower() == ".zip"))
{
Console.WriteLine("[DownloadFileFromWeb] Trying to unzip downloaded file: " + filename);
return ZIP.UncompressFile(filename, 60, password);
}
Console.WriteLine("[DownloadFileFromWeb] Downloading file from address finished: " + address);
return true;
}
Console.WriteLine("[DownloadFileFromWeb] Downloading file from address finished: " + address);
return true;
}
}
catch (Exception ex)

Wyświetl plik

@ -95,20 +95,30 @@ namespace ScoutBase.Elevation
System.Data.SQLite.SQLiteDatabase globe;
System.Data.SQLite.SQLiteDatabase srtm3;
System.Data.SQLite.SQLiteDatabase srtm1;
System.Data.SQLite.SQLiteDatabase aster3;
System.Data.SQLite.SQLiteDatabase aster1;
// tile cache
private ElevationTileDesignator globe_tile = null;
private ElevationTileDesignator srtm3_tile = null;
private ElevationTileDesignator srtm1_tile = null;
private ElevationTileDesignator aster3_tile = null;
private ElevationTileDesignator aster1_tile = null;
private OrderedDictionary globe_cache = new OrderedDictionary();
private OrderedDictionary srtm3_cache = new OrderedDictionary();
private OrderedDictionary srtm1_cache = new OrderedDictionary();
private OrderedDictionary aster3_cache = new OrderedDictionary();
private OrderedDictionary aster1_cache = new OrderedDictionary();
private int globe_tile_size = 138;
private int srtm3_tile_size = 10038;
private int srtm1_tile_size = 90038;
private int aster3_tile_size = 10038;
private int aster1_tile_size = 90038;
private int globe_cache_count = 0;
private int srtm3_cache_count = 0;
private int srtm1_cache_count = 0;
private int aster3_cache_count = 0;
private int aster1_cache_count = 0;
public ElevationDatabase()
{
@ -118,7 +128,7 @@ namespace ScoutBase.Elevation
"The basic elevation information is kept unique per 6digit-Maidenhead Locator and is updated periodically from a global web resource.\n" +
"The path and horizon information are unique per one oder between two geographical locations.\n" +
"These values are (pre-)calculated and stored at runtime.\n" +
"All values are based on a distinct elevation model either GLOBE, SRTM3 or SRTM1.";
"All values are based on a distinct elevation model either GLOBE, SRTM3, SRTM1 or ASTER.";
// add table description manually
TableDescriptions.Add(ElevationTileDesignator.TableName, "Holds elevation information per 6digit Maidenhead Locator.");
TableDescriptions.Add(ElevationPathDesignator.TableName, "Holds elevation path information between two locations.");
@ -130,6 +140,8 @@ namespace ScoutBase.Elevation
globe = OpenDatabase("globe.db3", DefaultDatabaseDirectory(), false);
srtm3 = OpenDatabase("srtm3.db3", DefaultDatabaseDirectory(), false);
srtm1 = OpenDatabase("srtm1.db3", DefaultDatabaseDirectory(), false);
aster3 = OpenDatabase("aster3.db3", DefaultDatabaseDirectory(), false);
aster1 = OpenDatabase("aster1.db3", DefaultDatabaseDirectory(), false);
// create tables with schemas if not exist
if (!ElevationTileTableExists(ELEVATIONMODEL.GLOBE))
ElevationTileCreateTable(ELEVATIONMODEL.GLOBE);
@ -137,24 +149,40 @@ namespace ScoutBase.Elevation
ElevationTileCreateTable(ELEVATIONMODEL.SRTM3);
if (!ElevationTileTableExists(ELEVATIONMODEL.SRTM1))
ElevationTileCreateTable(ELEVATIONMODEL.SRTM1);
if (!ElevationTileTableExists(ELEVATIONMODEL.ASTER3))
ElevationTileCreateTable(ELEVATIONMODEL.ASTER3);
if (!ElevationTileTableExists(ELEVATIONMODEL.ASTER1))
ElevationTileCreateTable(ELEVATIONMODEL.ASTER1);
if (!ElevationPathTableExists(ELEVATIONMODEL.GLOBE))
ElevationPathCreateTable(ELEVATIONMODEL.GLOBE);
if (!ElevationPathTableExists(ELEVATIONMODEL.SRTM3))
ElevationPathCreateTable(ELEVATIONMODEL.SRTM3);
if (!ElevationPathTableExists(ELEVATIONMODEL.SRTM1))
ElevationPathCreateTable(ELEVATIONMODEL.SRTM1);
if (!ElevationPathTableExists(ELEVATIONMODEL.ASTER3))
ElevationPathCreateTable(ELEVATIONMODEL.ASTER3);
if (!ElevationPathTableExists(ELEVATIONMODEL.ASTER1))
ElevationPathCreateTable(ELEVATIONMODEL.ASTER1);
if (!ElevationHorizonTableExists(ELEVATIONMODEL.GLOBE))
ElevationHorizonCreateTable(ELEVATIONMODEL.GLOBE);
if (!ElevationHorizonTableExists(ELEVATIONMODEL.SRTM3))
ElevationHorizonCreateTable(ELEVATIONMODEL.SRTM3);
if (!ElevationHorizonTableExists(ELEVATIONMODEL.SRTM1))
ElevationHorizonCreateTable(ELEVATIONMODEL.SRTM1);
if (!ElevationHorizonTableExists(ELEVATIONMODEL.ASTER3))
ElevationHorizonCreateTable(ELEVATIONMODEL.ASTER3);
if (!ElevationHorizonTableExists(ELEVATIONMODEL.ASTER1))
ElevationHorizonCreateTable(ELEVATIONMODEL.ASTER1);
if (!LocalObstructionTableExists(ELEVATIONMODEL.GLOBE))
LocalObstructionCreateTable(ELEVATIONMODEL.GLOBE);
if (!LocalObstructionTableExists(ELEVATIONMODEL.SRTM3))
LocalObstructionCreateTable(ELEVATIONMODEL.SRTM3);
if (!LocalObstructionTableExists(ELEVATIONMODEL.SRTM1))
LocalObstructionCreateTable(ELEVATIONMODEL.SRTM1);
if (!LocalObstructionTableExists(ELEVATIONMODEL.ASTER3))
LocalObstructionCreateTable(ELEVATIONMODEL.ASTER3);
if (!LocalObstructionTableExists(ELEVATIONMODEL.ASTER1))
LocalObstructionCreateTable(ELEVATIONMODEL.ASTER1);
// set default bounds
MinLat = double.MinValue;
MinLon = double.MinValue;
@ -167,6 +195,8 @@ namespace ScoutBase.Elevation
CloseDatabase(globe);
CloseDatabase(srtm3);
CloseDatabase(srtm1);
CloseDatabase(aster3);
CloseDatabase(aster1);
}
private void UpgradeToV1(System.Data.SQLite.SQLiteDatabase db)
@ -216,6 +246,8 @@ namespace ScoutBase.Elevation
case ELEVATIONMODEL.GLOBE: return globe;
case ELEVATIONMODEL.SRTM3: return srtm3;
case ELEVATIONMODEL.SRTM1: return srtm1;
case ELEVATIONMODEL.ASTER3: return aster3;
case ELEVATIONMODEL.ASTER1: return aster1;
default: return null;
}
}
@ -282,6 +314,12 @@ namespace ScoutBase.Elevation
case ELEVATIONMODEL.SRTM1:
dir = Path.Combine(dir, Properties.Settings.Default.Elevation_SRTM1_DataPath);
break;
case ELEVATIONMODEL.ASTER3:
dir = Path.Combine(dir, Properties.Settings.Default.Elevation_ASTER3_DataPath);
break;
case ELEVATIONMODEL.ASTER1:
dir = Path.Combine(dir, Properties.Settings.Default.Elevation_ASTER1_DataPath);
break;
}
// replace Windows/Linux directory spearator chars
dir = dir.Replace('\\', Path.DirectorySeparatorChar);
@ -303,6 +341,10 @@ namespace ScoutBase.Elevation
return Properties.Settings.Default.Elevation_SRTM3_UpdateURL;
case ELEVATIONMODEL.SRTM1:
return Properties.Settings.Default.Elevation_SRTM1_UpdateURL;
case ELEVATIONMODEL.ASTER3:
return Properties.Settings.Default.Elevation_ASTER3_UpdateURL;
case ELEVATIONMODEL.ASTER1:
return Properties.Settings.Default.Elevation_ASTER1_UpdateURL;
}
return "";
}
@ -318,6 +360,10 @@ namespace ScoutBase.Elevation
return Properties.Settings.Default.Elevation_SRTM3_JSONFile;
case ELEVATIONMODEL.SRTM1:
return Properties.Settings.Default.Elevation_SRTM1_JSONFile;
case ELEVATIONMODEL.ASTER3:
return Properties.Settings.Default.Elevation_ASTER3_JSONFile;
case ELEVATIONMODEL.ASTER1:
return Properties.Settings.Default.Elevation_ASTER1_JSONFile;
}
return "";
@ -402,6 +448,8 @@ namespace ScoutBase.Elevation
globe_cache_count = (int)((avmem / globe_tile_size < int.MaxValue) ? avmem / globe_tile_size : int.MaxValue);
srtm3_cache_count = (int)((avmem / srtm3_tile_size < int.MaxValue) ? avmem / srtm3_tile_size : int.MaxValue);
srtm1_cache_count = (int)((avmem / srtm1_tile_size < int.MaxValue) ? avmem / srtm1_tile_size : int.MaxValue);
aster3_cache_count = (int)((avmem / aster3_tile_size < int.MaxValue) ? avmem / aster3_tile_size : int.MaxValue);
aster1_cache_count = (int)((avmem / aster1_tile_size < int.MaxValue) ? avmem / aster1_tile_size : int.MaxValue);
}
/// <summary>
@ -412,6 +460,8 @@ namespace ScoutBase.Elevation
globe_cache.Clear();
srtm3_cache.Clear();
srtm1_cache.Clear();
aster3_cache.Clear();
aster1_cache.Clear();
}
private int GetCacheSize(ELEVATIONMODEL model)
@ -425,6 +475,10 @@ namespace ScoutBase.Elevation
return srtm3_cache_count;
case ELEVATIONMODEL.SRTM1:
return srtm1_cache_count;
case ELEVATIONMODEL.ASTER3:
return aster3_cache_count;
case ELEVATIONMODEL.ASTER1:
return aster1_cache_count;
}
return 0;
}
@ -530,6 +584,10 @@ namespace ScoutBase.Elevation
return srtm3_cache;
if (model == ELEVATIONMODEL.SRTM1)
return srtm1_cache;
if (model == ELEVATIONMODEL.ASTER3)
return aster3_cache;
if (model == ELEVATIONMODEL.ASTER1)
return aster1_cache;
return null;
}
@ -540,7 +598,11 @@ namespace ScoutBase.Elevation
if (model == ELEVATIONMODEL.SRTM3)
return srtm3_tile;
if (model == ELEVATIONMODEL.SRTM1)
return srtm1_tile;
return aster1_tile;
if (model == ELEVATIONMODEL.ASTER3)
return aster3_tile;
if (model == ELEVATIONMODEL.ASTER1)
return aster1_tile;
return null;
}
@ -552,6 +614,10 @@ namespace ScoutBase.Elevation
srtm3_tile = tile;
if (model == ELEVATIONMODEL.SRTM1)
srtm1_tile = tile;
if (model == ELEVATIONMODEL.ASTER3)
aster3_tile = tile;
if (model == ELEVATIONMODEL.ASTER1)
aster1_tile = tile;
}
private ElevationTileDesignator GetElevationTile(ELEVATIONMODEL model, double lat, double lon)
@ -653,6 +719,10 @@ namespace ScoutBase.Elevation
return 30;
if (model == ELEVATIONMODEL.SRTM3)
return 90;
if (model == ELEVATIONMODEL.ASTER1)
return 30;
if (model == ELEVATIONMODEL.ASTER3)
return 90;
return 1000;
}
@ -980,6 +1050,16 @@ namespace ScoutBase.Elevation
#region ElevationPath
public int GetElevationPathAveragePeriod(ELEVATIONMODEL model)
{
if (model == ELEVATIONMODEL.ASTER1)
return 5;
if (model == ELEVATIONMODEL.ASTER3)
return 5;
return 0;
}
public bool ElevationPathTableExists(ELEVATIONMODEL model, string tablename = "")
{
// check for table name is null or empty --> use default tablename from type instead
@ -1159,44 +1239,113 @@ namespace ScoutBase.Elevation
return ElevationPathCreateFromLatLon(caller, lat1, lon1, gp.Lat, gp.Lon, stepwidth, model);
}
// simple moving average for elevation path
// the resulting average array is (periods - 1) shorter than the source array
private short[] MovingAverage(short[] values, int periods)
{
// check for sufficient count of values
if (values.Length < periods)
return null;
short[] averages = new short[values.Length - periods + 1];
double sum = 0;
for (int i = 0; i < values.Length; i++)
if (i < periods)
{
sum += values[i];
// averages[i] = (short)((i == periods - 1) ? sum / (double)periods : 0);
averages[0] = (short)((i == periods - 1) ? sum / (double)periods : 0);
}
else
{
sum = sum - values[i - periods] + values[i];
averages[i - periods + 1] = (short)(sum / (double)periods);
}
return averages;
}
public ElevationPathDesignator ElevationPathCreateFromLatLon(BackgroundWorker caller, double lat1, double lon1, double lat2, double lon2, double stepwidth, ELEVATIONMODEL model, bool savetodatabase = true)
{
// calculate new elevation path
// supports abort calculation if called from background worker and cancellation requested
// report of status messages and single data points not needed so far
ElevationPathDesignator ep = new ElevationPathDesignator(lat1, lon1, lat2, lon2, stepwidth);
double d = 0;
bool tilemissing = false;
// convert stepwidth to [km]
stepwidth = stepwidth / 1000.0;
// check if elevation database is complete before trying to retrieve elevation path
bool complete = this.GetDBStatusBit(model, DATABASESTATUS.COMPLETE) & !this.GetDBStatusBit(model, DATABASESTATUS.ERROR);
bool tilemissing = false;
// create tile for cache
ElevationTileDesignator tile = new ElevationTileDesignator();
for (int i = 0; i < ep.Count; i++)
int avperiod = GetElevationPathAveragePeriod(model);
// check for any averaging
if (avperiod == 0)
{
LatLon.GPoint gp = LatLon.DestinationPoint(lat1, lon1, ep.Bearing12, d);
// get elevation point with status
// tile will be cached locally for subsequent use
short e = GetElevation(model, gp.Lat, gp.Lon, false);
// set elevation point if valid, else set it to 0
if (e > TileMissingFlag)
ep.Path[i] = e;
else
// no averaging --> create path direct into ep
double d = 0;
// check if elevation database is complete before trying to retrieve elevation path
for (int i = 0; i < ep.Count; i++)
{
ep.Path[i] = 0;
// set the tilemissing flag
if (e == TileMissingFlag)
tilemissing = true;
}
d += stepwidth;
// abort calculation if called from background worker and cancellation pending
if (caller != null)
{
if (caller.CancellationPending)
return null;
LatLon.GPoint gp = LatLon.DestinationPoint(lat1, lon1, ep.Bearing12, d);
// get elevation point with status
// tile will be cached locally for subsequent use
short e = GetElevation(model, gp.Lat, gp.Lon, false);
// set elevation point if valid, else set it to 0
if (e > TileMissingFlag)
{
ep.Path[i] = e;
}
else
{
ep.Path[i] = 0;
// set the tilemissing flag
if (e == TileMissingFlag)
tilemissing = true;
}
d += stepwidth;
// abort calculation if called from background worker and cancellation pending
if (caller != null)
{
if (caller.CancellationPending)
return null;
}
}
}
else
{
// create raw elevation buffer first and copy the average to ep
short[] raw = new short[ep.Path.Length + avperiod - 1];
// put the start value at the half of avperiod back in opposite direction
double d = -(avperiod / 2) * stepwidth;
// check if elevation database is complete before trying to retrieve elevation path
for (int i = 0; i < raw.Length; i++)
{
LatLon.GPoint gp = LatLon.DestinationPoint(lat1, lon1, ep.Bearing12, d);
// get elevation point with status
// tile will be cached locally for subsequent use
short e = GetElevation(model, gp.Lat, gp.Lon, false);
// set elevation point if valid, else set it to 0
if (e > TileMissingFlag)
{
raw[i] = e;
}
else
{
raw[i] = 0;
// set the tilemissing flag
if (e == TileMissingFlag)
tilemissing = true;
}
d += stepwidth;
// abort calculation if called from background worker and cancellation pending
if (caller != null)
{
if (caller.CancellationPending)
return null;
}
}
// calculate average and assign it to ep.Path
ep.Path = MovingAverage(raw, avperiod);
}
// check if database is still complete, could have benn changed during background calculation
if (complete)
complete = GetDBStatusBit(model, DATABASESTATUS.COMPLETE) & !GetDBStatusBit(model, DATABASESTATUS.ERROR);

Wyświetl plik

@ -296,6 +296,10 @@ namespace ScoutBase.Elevation
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;
else if ((StartOptions.Model == ELEVATIONMODEL.ASTER3) && (Properties.Settings.Default.Elevation_ASTER3_TimeStamp != null))
dt = Properties.Settings.Default.Elevation_ASTER3_TimeStamp;
else if ((StartOptions.Model == ELEVATIONMODEL.ASTER1) && (Properties.Settings.Default.Elevation_ASTER1_TimeStamp != null))
dt = Properties.Settings.Default.Elevation_ASTER1_TimeStamp;
// change kind to UTC as it is not specified in settings
dt = DateTime.SpecifyKind(dt, DateTimeKind.Utc);
return dt;
@ -309,6 +313,10 @@ namespace ScoutBase.Elevation
return Properties.Settings.Default.Elevation_SRTM3_Status;
else if (StartOptions.Model == ELEVATIONMODEL.SRTM1)
return Properties.Settings.Default.Elevation_SRTM1_Status;
else if (StartOptions.Model == ELEVATIONMODEL.ASTER3)
return Properties.Settings.Default.Elevation_ASTER3_Status;
else if (StartOptions.Model == ELEVATIONMODEL.ASTER1)
return Properties.Settings.Default.Elevation_ASTER1_Status;
return DATABASESTATUS.UNDEFINED;
}
@ -321,6 +329,10 @@ namespace ScoutBase.Elevation
dt = Properties.Settings.Default.Elevation_SRTM3_Update_TimeStamp;
else if (StartOptions.Model == ELEVATIONMODEL.SRTM1)
dt = Properties.Settings.Default.Elevation_SRTM1_Update_TimeStamp;
else if (StartOptions.Model == ELEVATIONMODEL.ASTER3)
dt = Properties.Settings.Default.Elevation_ASTER3_Update_TimeStamp;
else if (StartOptions.Model == ELEVATIONMODEL.ASTER1)
dt = Properties.Settings.Default.Elevation_ASTER1_Update_TimeStamp;
// change kind to UTC as it is not specified in settings
dt = DateTime.SpecifyKind(dt, DateTimeKind.Utc);
return dt;
@ -334,6 +346,10 @@ namespace ScoutBase.Elevation
Properties.Settings.Default.Elevation_SRTM3_TimeStamp = GetDatabaseTimeStamp();
else if (StartOptions.Model == ELEVATIONMODEL.SRTM1)
Properties.Settings.Default.Elevation_SRTM1_TimeStamp = GetDatabaseTimeStamp();
else if (StartOptions.Model == ELEVATIONMODEL.ASTER3)
Properties.Settings.Default.Elevation_ASTER3_TimeStamp = GetDatabaseTimeStamp();
else if (StartOptions.Model == ELEVATIONMODEL.ASTER1)
Properties.Settings.Default.Elevation_ASTER1_TimeStamp = GetDatabaseTimeStamp();
}
private void SaveDatabaseStatus()
@ -344,6 +360,10 @@ namespace ScoutBase.Elevation
Properties.Settings.Default.Elevation_SRTM3_Status = GetDatabaseStatus();
else if (StartOptions.Model == ELEVATIONMODEL.SRTM1)
Properties.Settings.Default.Elevation_SRTM1_Status = GetDatabaseStatus();
else if (StartOptions.Model == ELEVATIONMODEL.ASTER3)
Properties.Settings.Default.Elevation_ASTER3_Status = GetDatabaseStatus();
else if (StartOptions.Model == ELEVATIONMODEL.ASTER1)
Properties.Settings.Default.Elevation_ASTER1_Status = GetDatabaseStatus();
}
private void SaveUpdateTimeStamp()
@ -354,6 +374,10 @@ namespace ScoutBase.Elevation
Properties.Settings.Default.Elevation_SRTM3_Update_TimeStamp = GetUpdateTimeStamp();
else if (StartOptions.Model == ELEVATIONMODEL.SRTM1)
Properties.Settings.Default.Elevation_SRTM1_Update_TimeStamp = GetUpdateTimeStamp();
else if (StartOptions.Model == ELEVATIONMODEL.ASTER3)
Properties.Settings.Default.Elevation_ASTER3_Update_TimeStamp = GetUpdateTimeStamp();
else if (StartOptions.Model == ELEVATIONMODEL.ASTER1)
Properties.Settings.Default.Elevation_ASTER1_Update_TimeStamp = GetUpdateTimeStamp();
}
private void SaveBounds()

Wyświetl plik

@ -10,6 +10,8 @@ namespace ScoutBase.Elevation
NONE = 0,
GLOBE = 1,
SRTM3 = 2,
SRTM1 = 3
SRTM1 = 3,
ASTER3 = 4,
ASTER1 = 5
}
}

Wyświetl plik

@ -334,5 +334,149 @@ namespace ScoutBase.Elevation.Properties {
this["MinLon"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("ASTER3")]
public string Elevation_ASTER3_DataPath {
get {
return ((string)(this["Elevation_ASTER3_DataPath"]));
}
set {
this["Elevation_ASTER3_DataPath"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("file://E:\\\\ElevationData\\\\ASTER\\\\V3\\\\ASTER3\\\\Locs")]
public string Elevation_ASTER3_UpdateURL {
get {
return ((string)(this["Elevation_ASTER3_UpdateURL"]));
}
set {
this["Elevation_ASTER3_UpdateURL"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("aster3.json")]
public string Elevation_ASTER3_JSONFile {
get {
return ((string)(this["Elevation_ASTER3_JSONFile"]));
}
set {
this["Elevation_ASTER3_JSONFile"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("1970-01-01")]
public global::System.DateTime Elevation_ASTER3_TimeStamp {
get {
return ((global::System.DateTime)(this["Elevation_ASTER3_TimeStamp"]));
}
set {
this["Elevation_ASTER3_TimeStamp"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("1970-01-01")]
public global::System.DateTime Elevation_ASTER3_Update_TimeStamp {
get {
return ((global::System.DateTime)(this["Elevation_ASTER3_Update_TimeStamp"]));
}
set {
this["Elevation_ASTER3_Update_TimeStamp"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("ASTER1")]
public string Elevation_ASTER1_DataPath {
get {
return ((string)(this["Elevation_ASTER1_DataPath"]));
}
set {
this["Elevation_ASTER1_DataPath"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("file://E:\\\\ElevationData\\\\ASTER\\\\V3\\\\ASTER1\\\\Locs")]
public string Elevation_ASTER1_UpdateURL {
get {
return ((string)(this["Elevation_ASTER1_UpdateURL"]));
}
set {
this["Elevation_ASTER1_UpdateURL"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("aster1.json")]
public string Elevation_ASTER1_JSONFile {
get {
return ((string)(this["Elevation_ASTER1_JSONFile"]));
}
set {
this["Elevation_ASTER1_JSONFile"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("1970-01-01")]
public global::System.DateTime Elevation_ASTER1_TimeStamp {
get {
return ((global::System.DateTime)(this["Elevation_ASTER1_TimeStamp"]));
}
set {
this["Elevation_ASTER1_TimeStamp"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("1970-01-01")]
public global::System.DateTime Elevation_ASTER1_Update_TimeStamp {
get {
return ((global::System.DateTime)(this["Elevation_ASTER1_Update_TimeStamp"]));
}
set {
this["Elevation_ASTER1_Update_TimeStamp"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("UNDEFINED")]
public global::System.Data.SQLite.DATABASESTATUS Elevation_ASTER3_Status {
get {
return ((global::System.Data.SQLite.DATABASESTATUS)(this["Elevation_ASTER3_Status"]));
}
set {
this["Elevation_ASTER3_Status"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("UNDEFINED")]
public global::System.Data.SQLite.DATABASESTATUS Elevation_ASTER1_Status {
get {
return ((global::System.Data.SQLite.DATABASESTATUS)(this["Elevation_ASTER1_Status"]));
}
set {
this["Elevation_ASTER1_Status"] = value;
}
}
}
}

Wyświetl plik

@ -80,5 +80,41 @@
<Setting Name="MinLon" Type="System.Double" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="Elevation_ASTER3_DataPath" Type="System.String" Scope="User">
<Value Profile="(Default)">ASTER3</Value>
</Setting>
<Setting Name="Elevation_ASTER3_UpdateURL" Type="System.String" Scope="User">
<Value Profile="(Default)">file://E:\\ElevationData\\ASTER\\V3\\ASTER3\\Locs</Value>
</Setting>
<Setting Name="Elevation_ASTER3_JSONFile" Type="System.String" Scope="User">
<Value Profile="(Default)">aster3.json</Value>
</Setting>
<Setting Name="Elevation_ASTER3_TimeStamp" Type="System.DateTime" Scope="User">
<Value Profile="(Default)">1970-01-01</Value>
</Setting>
<Setting Name="Elevation_ASTER3_Update_TimeStamp" Type="System.DateTime" Scope="User">
<Value Profile="(Default)">1970-01-01</Value>
</Setting>
<Setting Name="Elevation_ASTER1_DataPath" Type="System.String" Scope="User">
<Value Profile="(Default)">ASTER1</Value>
</Setting>
<Setting Name="Elevation_ASTER1_UpdateURL" Type="System.String" Scope="User">
<Value Profile="(Default)">file://E:\\ElevationData\\ASTER\\V3\\ASTER1\\Locs</Value>
</Setting>
<Setting Name="Elevation_ASTER1_JSONFile" Type="System.String" Scope="User">
<Value Profile="(Default)">aster1.json</Value>
</Setting>
<Setting Name="Elevation_ASTER1_TimeStamp" Type="System.DateTime" Scope="User">
<Value Profile="(Default)">1970-01-01</Value>
</Setting>
<Setting Name="Elevation_ASTER1_Update_TimeStamp" Type="System.DateTime" Scope="User">
<Value Profile="(Default)">1970-01-01</Value>
</Setting>
<Setting Name="Elevation_ASTER3_Status" Type="System.Data.SQLite.DATABASESTATUS" Scope="User">
<Value Profile="(Default)">UNDEFINED</Value>
</Setting>
<Setting Name="Elevation_ASTER1_Status" Type="System.Data.SQLite.DATABASESTATUS" Scope="User">
<Value Profile="(Default)">UNDEFINED</Value>
</Setting>
</Settings>
</SettingsFile>

Wyświetl plik

@ -87,6 +87,42 @@
<setting name="MinLon" serializeAs="String">
<value>0</value>
</setting>
<setting name="Elevation_ASTER3_DataPath" serializeAs="String">
<value>ASTER3</value>
</setting>
<setting name="Elevation_ASTER3_UpdateURL" serializeAs="String">
<value>file://E:\\ElevationData\\ASTER\\V3\\ASTER3\\Locs</value>
</setting>
<setting name="Elevation_ASTER3_JSONFile" serializeAs="String">
<value>aster3.json</value>
</setting>
<setting name="Elevation_ASTER3_TimeStamp" serializeAs="String">
<value>1970-01-01</value>
</setting>
<setting name="Elevation_ASTER3_Update_TimeStamp" serializeAs="String">
<value>1970-01-01</value>
</setting>
<setting name="Elevation_ASTER1_DataPath" serializeAs="String">
<value>ASTER1</value>
</setting>
<setting name="Elevation_ASTER1_UpdateURL" serializeAs="String">
<value>file://E:\\ElevationData\\ASTER\\V3\\ASTER1\\Locs</value>
</setting>
<setting name="Elevation_ASTER1_JSONFile" serializeAs="String">
<value>aster1.json</value>
</setting>
<setting name="Elevation_ASTER1_TimeStamp" serializeAs="String">
<value>1970-01-01</value>
</setting>
<setting name="Elevation_ASTER1_Update_TimeStamp" serializeAs="String">
<value>1970-01-01</value>
</setting>
<setting name="Elevation_ASTER3_Status" serializeAs="String">
<value>UNDEFINED</value>
</setting>
<setting name="Elevation_ASTER1_Status" serializeAs="String">
<value>UNDEFINED</value>
</setting>
</ScoutBase.Elevation.Properties.Settings>
</userSettings>
<entityFramework>

Wyświetl plik

@ -80,6 +80,8 @@ namespace ScoutBase.Propagation
System.Data.SQLite.SQLiteDatabase globe;
System.Data.SQLite.SQLiteDatabase srtm3;
System.Data.SQLite.SQLiteDatabase srtm1;
System.Data.SQLite.SQLiteDatabase aster3;
System.Data.SQLite.SQLiteDatabase aster1;
public PropagationDatabase()
{
@ -87,7 +89,7 @@ namespace ScoutBase.Propagation
Name = "ScoutBase Propagation Database";
Description = "The Scoutbase Propagation Database is containing propagation path and horizon information.\n" +
"The info is unique for one single or between two geographical locations, heights, frequency, F1-Clearance and calculation stepwidth.\n" +
"All calculations are based on a distinct elevation model GLOBE, SRTM3 or SRTM1.\n" +
"All calculations are based on a distinct elevation model GLOBE, SRTM3, SRTM1 or ASTER.\n" +
"All values are (pre-)calculated and stored at runtime.";
// add table description manually
TableDescriptions.Add(PropagationPathDesignator.TableName, "Holds propagation path information.");
@ -95,6 +97,8 @@ namespace ScoutBase.Propagation
globe = OpenDatabase("globe.db3", DefaultDatabaseDirectory(), Properties.Settings.Default.Database_InMemory);
srtm3 = OpenDatabase("srtm3.db3", DefaultDatabaseDirectory(), Properties.Settings.Default.Database_InMemory);
srtm1 = OpenDatabase("srtm1.db3", DefaultDatabaseDirectory(), Properties.Settings.Default.Database_InMemory);
aster3 = OpenDatabase("aster3.db3", DefaultDatabaseDirectory(), Properties.Settings.Default.Database_InMemory);
aster1 = OpenDatabase("aster1.db3", DefaultDatabaseDirectory(), Properties.Settings.Default.Database_InMemory);
// create tables with schemas if not exist
// create tables with schemas if not exist
if (!PropagationPathTableExists(ELEVATIONMODEL.GLOBE))
@ -103,12 +107,20 @@ namespace ScoutBase.Propagation
PropagationPathCreateTable(ELEVATIONMODEL.SRTM3);
if (!PropagationPathTableExists(ELEVATIONMODEL.SRTM1))
PropagationPathCreateTable(ELEVATIONMODEL.SRTM1);
if (!PropagationPathTableExists(ELEVATIONMODEL.ASTER3))
PropagationPathCreateTable(ELEVATIONMODEL.ASTER3);
if (!PropagationPathTableExists(ELEVATIONMODEL.ASTER1))
PropagationPathCreateTable(ELEVATIONMODEL.ASTER1);
if (!PropagationHorizonTableExists(ELEVATIONMODEL.GLOBE))
PropagationHorizonCreateTable(ELEVATIONMODEL.GLOBE);
if (!PropagationHorizonTableExists(ELEVATIONMODEL.SRTM3))
PropagationHorizonCreateTable(ELEVATIONMODEL.SRTM3);
if (!PropagationHorizonTableExists(ELEVATIONMODEL.SRTM1))
PropagationHorizonCreateTable(ELEVATIONMODEL.SRTM1);
if (!PropagationHorizonTableExists(ELEVATIONMODEL.ASTER3))
PropagationHorizonCreateTable(ELEVATIONMODEL.ASTER3);
if (!PropagationHorizonTableExists(ELEVATIONMODEL.ASTER1))
PropagationHorizonCreateTable(ELEVATIONMODEL.ASTER1);
// set nearfield suppression to 0
NearFieldSuppression = 0;
}
@ -118,6 +130,8 @@ namespace ScoutBase.Propagation
CloseDatabase(globe);
CloseDatabase(srtm3);
CloseDatabase(srtm1);
CloseDatabase(aster3);
CloseDatabase(aster1);
}
public System.Data.SQLite.SQLiteDatabase GetPropagationDatabase(ELEVATIONMODEL model)
@ -127,6 +141,8 @@ namespace ScoutBase.Propagation
case ELEVATIONMODEL.GLOBE: return globe;
case ELEVATIONMODEL.SRTM3: return srtm3;
case ELEVATIONMODEL.SRTM1: return srtm1;
case ELEVATIONMODEL.ASTER3: return aster3;
case ELEVATIONMODEL.ASTER1: return aster1;
default: return null;
}
}