Merge with V1.4.x (2)V1.3.3.6

pull/2/head
dl2alf 2022-01-02 09:22:23 +01:00
rodzic 36b8938a32
commit 5d83dce0a8
6 zmienionych plików z 2881 dodań i 2787 usunięć

Wyświetl plik

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.3.1")]
[assembly: AssemblyFileVersion("1.3.3.1")]
[assembly: AssemblyVersion("1.3.3.4")]
[assembly: AssemblyFileVersion("1.3.3.4")]

Wyświetl plik

@ -74,7 +74,7 @@ namespace System.Net
throw new TimeoutException("Connection timed out.");
}
while (!trailer.Contains("\r\n"));
Console.WriteLine("Reading content [" + contentlength.ToString() + " bytes]: " + resp);
// Console.WriteLine("Reading content [" + contentlength.ToString() + " bytes]: " + resp);
response += resp;
return true;
}
@ -91,6 +91,8 @@ namespace System.Net
int contentlength = 0;
// chunked transfer, first line should contain content length
// read stream bytewise until CRLF is detected
try
{
do
{
count = stream.Read(buff, 0, buff.Length);
@ -129,7 +131,12 @@ namespace System.Net
throw new TimeoutException("Connection timed out.");
}
while (!trailer.Contains("\r\n"));
Console.WriteLine("Reading chunked content [" + contentlength.ToString() + " bytes]: " + resp);
}
catch (Exception ex)
{
Console.WriteLine("Error while reading chunked content: " + ex.Message);
}
// Console.WriteLine("Reading chunked content [" + contentlength.ToString() + " bytes]: " + resp);
response += resp;
return false;
}

Wyświetl plik

@ -377,7 +377,6 @@ namespace AirScout.PlaneFeeds.Plugin.VirtualRadarServer
{
// deserialize JSON
dynamic root = JsonConvert.DeserializeObject(json);
// get local time of request in milliseconds
DateTime lt = DateTime.UtcNow;
long ltime = (long)(lt - new DateTime(1970, 1, 1)).TotalMilliseconds;

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.6")]
[assembly: AssemblyFileVersion("1.3.3.6")]
[assembly: AssemblyVersion("1.3.3.7")]
[assembly: AssemblyFileVersion("1.3.3.7")]

Wyświetl plik

@ -493,6 +493,23 @@ namespace GMap.NET.WindowsForms
}
#endif
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();
@ -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,6 +631,48 @@ namespace GMap.NET.WindowsForms
}
}
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>
@ -656,8 +716,6 @@ namespace GMap.NET.WindowsForms
// render tile
{
foreach (WindowsFormsImage img in t.Overlays)
{
try
{
if (img != null && img.Img != null)
{
@ -667,7 +725,16 @@ namespace GMap.NET.WindowsForms
if (!img.IsParent)
{
#if !PocketPC
// 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
@ -678,17 +745,20 @@ 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);
// 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
}
}
catch (Exception ex)
{
Console.WriteLine("GMapControl: Error while drwing Image: " + ex.Message);
}
}
}
}
#if !PocketPC

Wyświetl plik

@ -460,6 +460,9 @@ namespace ScoutBase.Propagation
// return null if elevation path is null for whatever reason
if (ep == null)
return null;
// using (StreamWriter sw = new StreamWriter(File.OpenWrite("propagation.csv")))
{
// sw.WriteLine("i;dist1;dist2;f1c1;f1c2;elv;eps1;eps1_min;eps2;eps2_min");
for (int i = 0; i < ep.Count; i++)
{
double dist1 = i * stepwidth / 1000.0;
@ -470,23 +473,38 @@ namespace ScoutBase.Propagation
double eps1;
double eps2;
if (dist1 > nf)
{
eps1 = ScoutBase.Core.Propagation.EpsilonFromHeights(h1, dist1, ep.Path[i] + f1c1, radius);
else
eps1 = ScoutBase.Core.Propagation.EpsilonFromHeights(h1, nf, ep.Path[i] + f1c1, radius);
if (eps1 > eps1_min)
eps1_min = eps1;
}
if (dist2 > nf)
{
eps2 = ScoutBase.Core.Propagation.EpsilonFromHeights(h2, dist2, ep.Path[i] + f1c2, radius);
else
eps2 = ScoutBase.Core.Propagation.EpsilonFromHeights(h2, nf, ep.Path[i] + f1c2, radius);
if (eps2 > eps2_min)
eps2_min = eps2;
}
if (caller != null)
{
// abort calculation if cancellation pending
if (caller.WorkerSupportsCancellation && caller.CancellationPending)
return null;
}
/*
sw.WriteLine(
i.ToString() + ";" +
dist1.ToString("F8") + ";" +
dist2.ToString("F8") + ";" +
f1c1.ToString("F8") + ";" +
f1c2.ToString("F8") + ";" +
ep.Path[i].ToString() + ";" +
eps1.ToString("F8") + ";" +
eps1_min.ToString("F8") + ";" +
eps2.ToString("F8") + ";" +
eps2_min.ToString("F8")
);
*/
}
}
PropagationPathDesignator pp = new PropagationPathDesignator(lat1, lon1, h1, lat2, lon2, h2, qrg, radius, f1_clearance, stepwidth, eps1_min, eps2_min, localobstruction);
// take status from elevation path