mirror of
https://github.com/SDRSharpR/SDRSharp.git
synced 2026-04-07 07:14:07 +00:00
SDRSharp Build 1632 Full Source (VS2017)
This commit is contained in:
parent
c0fc5d4af0
commit
bce56796eb
246 changed files with 31983 additions and 0 deletions
15
SDRSharp.PanView/Properties/AssemblyInfo.cs
Normal file
15
SDRSharp.PanView/Properties/AssemblyInfo.cs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.Versioning;
|
||||
using System.Security.Permissions;
|
||||
|
||||
[assembly: CompilationRelaxations(8)]
|
||||
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
|
||||
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
|
||||
[assembly: AssemblyTitle("Panoramic Spectrum Viewer")]
|
||||
[assembly: AssemblyDescription("Panoramic Spectrum Viewer")]
|
||||
[assembly: AssemblyProduct("SDR#")]
|
||||
[assembly: AssemblyCopyright("Copyright © Youssef TOUIL 2012")]
|
||||
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
|
||||
[assembly: AssemblyVersion("0.0.0.0")]
|
||||
73
SDRSharp.PanView/SDRSharp.PanView.csproj
Normal file
73
SDRSharp.PanView/SDRSharp.PanView.csproj
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{040E3622-194B-4FA6-9CBB-1A22BD52A13D}</ProjectGuid>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<OutputType>Library</OutputType>
|
||||
<AssemblyName>SDRSharp.PanView</AssemblyName>
|
||||
<TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
|
||||
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="SDRSharp.Radio">
|
||||
<HintPath>..\SDRSharp.Radio\bin\Debug\SDRSharp.Radio.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows.Forms">
|
||||
<HintPath>C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System">
|
||||
<HintPath>C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing">
|
||||
<HintPath>C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SDRSharp.PanView\BandType.cs" />
|
||||
<Compile Include="SDRSharp.PanView\BandwidthEventArgs.cs" />
|
||||
<Compile Include="SDRSharp.PanView\CustomPaintEventArgs.cs" />
|
||||
<Compile Include="SDRSharp.PanView\CustomPaintEventHandler.cs" />
|
||||
<Compile Include="SDRSharp.PanView\FrequencyChangeSource.cs" />
|
||||
<Compile Include="SDRSharp.PanView\FrequencyEventArgs.cs" />
|
||||
<Compile Include="SDRSharp.PanView\GradientDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="SDRSharp.PanView\LineInsertEventArgs.cs" />
|
||||
<Compile Include="SDRSharp.PanView\LineInsertEventHandler.cs" />
|
||||
<Compile Include="SDRSharp.PanView\ManualBandwidthChangeEventHandler.cs" />
|
||||
<Compile Include="SDRSharp.PanView\ManualFrequencyChangeEventHandler.cs" />
|
||||
<Compile Include="SDRSharp.PanView\PeakDetector.cs" />
|
||||
<Compile Include="SDRSharp.PanView\SpectrumAnalyzer.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="SDRSharp.PanView\SpectrumStyle.cs" />
|
||||
<Compile Include="SDRSharp.PanView\Waterfall.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="SDRSharp.PanView\GradientDialog.resx">
|
||||
<DependentUpon>GradientDialog.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
25
SDRSharp.PanView/SDRSharp.PanView.sln
Normal file
25
SDRSharp.PanView/SDRSharp.PanView.sln
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.27428.2015
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SDRSharp.PanView", "SDRSharp.PanView.csproj", "{040E3622-194B-4FA6-9CBB-1A22BD52A13D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{040E3622-194B-4FA6-9CBB-1A22BD52A13D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{040E3622-194B-4FA6-9CBB-1A22BD52A13D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{040E3622-194B-4FA6-9CBB-1A22BD52A13D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{040E3622-194B-4FA6-9CBB-1A22BD52A13D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {A133AD22-210D-4E51-898D-75EF97AE9732}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
9
SDRSharp.PanView/SDRSharp.PanView/BandType.cs
Normal file
9
SDRSharp.PanView/SDRSharp.PanView/BandType.cs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
namespace SDRSharp.PanView
|
||||
{
|
||||
public enum BandType
|
||||
{
|
||||
Lower,
|
||||
Upper,
|
||||
Center
|
||||
}
|
||||
}
|
||||
38
SDRSharp.PanView/SDRSharp.PanView/BandwidthEventArgs.cs
Normal file
38
SDRSharp.PanView/SDRSharp.PanView/BandwidthEventArgs.cs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
using System;
|
||||
|
||||
namespace SDRSharp.PanView
|
||||
{
|
||||
public class BandwidthEventArgs : EventArgs
|
||||
{
|
||||
public int Bandwidth
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public int Offset
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public bool Cancel
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public BandType Side
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public BandwidthEventArgs(int bandwidth, int offset, BandType side)
|
||||
{
|
||||
this.Bandwidth = bandwidth;
|
||||
this.Offset = offset;
|
||||
this.Side = side;
|
||||
}
|
||||
}
|
||||
}
|
||||
38
SDRSharp.PanView/SDRSharp.PanView/CustomPaintEventArgs.cs
Normal file
38
SDRSharp.PanView/SDRSharp.PanView/CustomPaintEventArgs.cs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace SDRSharp.PanView
|
||||
{
|
||||
public class CustomPaintEventArgs : EventArgs
|
||||
{
|
||||
public Graphics Graphics
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public Point CursorPosition
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public string CustomTitle
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public bool Cancel
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public CustomPaintEventArgs(Graphics graphics, Point cursorPosition)
|
||||
{
|
||||
this.Graphics = graphics;
|
||||
this.CursorPosition = cursorPosition;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
namespace SDRSharp.PanView
|
||||
{
|
||||
public delegate void CustomPaintEventHandler(object sender, CustomPaintEventArgs e);
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
namespace SDRSharp.PanView
|
||||
{
|
||||
public enum FrequencyChangeSource
|
||||
{
|
||||
Scroll,
|
||||
Drag,
|
||||
Click
|
||||
}
|
||||
}
|
||||
31
SDRSharp.PanView/SDRSharp.PanView/FrequencyEventArgs.cs
Normal file
31
SDRSharp.PanView/SDRSharp.PanView/FrequencyEventArgs.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
|
||||
namespace SDRSharp.PanView
|
||||
{
|
||||
public class FrequencyEventArgs : EventArgs
|
||||
{
|
||||
public long Frequency
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public FrequencyChangeSource Source
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public bool Cancel
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public FrequencyEventArgs(long frequency, FrequencyChangeSource source)
|
||||
{
|
||||
this.Frequency = frequency;
|
||||
this.Source = source;
|
||||
}
|
||||
}
|
||||
}
|
||||
269
SDRSharp.PanView/SDRSharp.PanView/GradientDialog.cs
Normal file
269
SDRSharp.PanView/SDRSharp.PanView/GradientDialog.cs
Normal file
|
|
@ -0,0 +1,269 @@
|
|||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace SDRSharp.PanView
|
||||
{
|
||||
public class GradientDialog : Form
|
||||
{
|
||||
private IContainer components;
|
||||
|
||||
private ListBox colorListBox;
|
||||
|
||||
private Button upButton;
|
||||
|
||||
private Button downButton;
|
||||
|
||||
private PictureBox gradientPictureBox;
|
||||
|
||||
private Button addButton;
|
||||
|
||||
private Button deleteButton;
|
||||
|
||||
private Button cancelButton;
|
||||
|
||||
private Button okButton;
|
||||
|
||||
private ColorDialog colorDialog;
|
||||
|
||||
private GradientDialog()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
|
||||
public static ColorBlend GetGradient(ColorBlend originalBlend)
|
||||
{
|
||||
using (GradientDialog gradientDialog = new GradientDialog())
|
||||
{
|
||||
gradientDialog.SetColorBlend(originalBlend);
|
||||
if (gradientDialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
return gradientDialog.GetColorBlend();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private ColorBlend GetColorBlend()
|
||||
{
|
||||
ColorBlend colorBlend = new ColorBlend(this.colorListBox.Items.Count);
|
||||
float num = 1f / (float)(colorBlend.Positions.Length - 1);
|
||||
for (int i = 0; i < colorBlend.Positions.Length; i++)
|
||||
{
|
||||
colorBlend.Positions[i] = (float)i * num;
|
||||
colorBlend.Colors[i] = (Color)this.colorListBox.Items[i];
|
||||
}
|
||||
return colorBlend;
|
||||
}
|
||||
|
||||
private void SetColorBlend(ColorBlend colorBlend)
|
||||
{
|
||||
for (int i = 0; i < colorBlend.Positions.Length; i++)
|
||||
{
|
||||
this.colorListBox.Items.Add(colorBlend.Colors[i]);
|
||||
}
|
||||
}
|
||||
|
||||
private void colorListBox_DrawItem(object sender, DrawItemEventArgs e)
|
||||
{
|
||||
if (e.Index >= 0)
|
||||
{
|
||||
Color color = (Color)this.colorListBox.Items[e.Index];
|
||||
Rectangle bounds;
|
||||
if ((e.State & DrawItemState.Selected) == DrawItemState.None)
|
||||
{
|
||||
using (SolidBrush solidBrush = new SolidBrush(color))
|
||||
{
|
||||
Graphics graphics = e.Graphics;
|
||||
SolidBrush brush = solidBrush;
|
||||
bounds = e.Bounds;
|
||||
int x = bounds.Left + 1;
|
||||
bounds = e.Bounds;
|
||||
int y = bounds.Top + 1;
|
||||
bounds = e.Bounds;
|
||||
int width = bounds.Width - 2;
|
||||
bounds = e.Bounds;
|
||||
graphics.FillRectangle(brush, x, y, width, bounds.Height - 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
using (HatchBrush hatchBrush = new HatchBrush(HatchStyle.Percent70, color, Color.Gray))
|
||||
{
|
||||
Graphics graphics2 = e.Graphics;
|
||||
HatchBrush brush2 = hatchBrush;
|
||||
bounds = e.Bounds;
|
||||
int x2 = bounds.Left + 1;
|
||||
bounds = e.Bounds;
|
||||
int y2 = bounds.Top + 1;
|
||||
bounds = e.Bounds;
|
||||
int width2 = bounds.Width - 2;
|
||||
bounds = e.Bounds;
|
||||
graphics2.FillRectangle(brush2, x2, y2, width2, bounds.Height - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void upButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
int selectedIndex = this.colorListBox.SelectedIndex;
|
||||
if (selectedIndex > 0)
|
||||
{
|
||||
object item = this.colorListBox.Items[selectedIndex];
|
||||
this.colorListBox.Items.RemoveAt(selectedIndex);
|
||||
this.colorListBox.Items.Insert(selectedIndex - 1, item);
|
||||
this.colorListBox.SelectedIndex = selectedIndex - 1;
|
||||
this.gradientPictureBox.Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
private void downButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
int selectedIndex = this.colorListBox.SelectedIndex;
|
||||
if (selectedIndex >= 0 && selectedIndex < this.colorListBox.Items.Count - 1)
|
||||
{
|
||||
object item = this.colorListBox.Items[selectedIndex];
|
||||
this.colorListBox.Items.RemoveAt(selectedIndex);
|
||||
this.colorListBox.Items.Insert(selectedIndex + 1, item);
|
||||
this.colorListBox.SelectedIndex = selectedIndex + 1;
|
||||
this.gradientPictureBox.Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
private void addButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.colorDialog.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
this.colorListBox.Items.Add(this.colorDialog.Color);
|
||||
this.gradientPictureBox.Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
private void deleteButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
int selectedIndex = this.colorListBox.SelectedIndex;
|
||||
if (selectedIndex >= 0 && this.colorListBox.Items.Count > 2)
|
||||
{
|
||||
this.colorListBox.Items.RemoveAt(selectedIndex);
|
||||
this.gradientPictureBox.Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
private void gradientPictureBox_Paint(object sender, PaintEventArgs e)
|
||||
{
|
||||
ColorBlend colorBlend = this.GetColorBlend();
|
||||
using (LinearGradientBrush linearGradientBrush = new LinearGradientBrush(this.gradientPictureBox.ClientRectangle, Color.White, Color.Black, LinearGradientMode.Vertical))
|
||||
{
|
||||
linearGradientBrush.InterpolationColors = colorBlend;
|
||||
e.Graphics.FillRectangle(linearGradientBrush, e.ClipRectangle);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && this.components != null)
|
||||
{
|
||||
this.components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.colorListBox = new ListBox();
|
||||
this.upButton = new Button();
|
||||
this.downButton = new Button();
|
||||
this.gradientPictureBox = new PictureBox();
|
||||
this.addButton = new Button();
|
||||
this.deleteButton = new Button();
|
||||
this.cancelButton = new Button();
|
||||
this.okButton = new Button();
|
||||
this.colorDialog = new ColorDialog();
|
||||
((ISupportInitialize)this.gradientPictureBox).BeginInit();
|
||||
base.SuspendLayout();
|
||||
this.colorListBox.DrawMode = DrawMode.OwnerDrawVariable;
|
||||
this.colorListBox.FormattingEnabled = true;
|
||||
this.colorListBox.Location = new Point(12, 12);
|
||||
this.colorListBox.Name = "colorListBox";
|
||||
this.colorListBox.Size = new Size(107, 238);
|
||||
this.colorListBox.TabIndex = 0;
|
||||
this.colorListBox.DrawItem += this.colorListBox_DrawItem;
|
||||
this.upButton.Location = new Point(164, 12);
|
||||
this.upButton.Name = "upButton";
|
||||
this.upButton.Size = new Size(75, 23);
|
||||
this.upButton.TabIndex = 1;
|
||||
this.upButton.Text = "Up";
|
||||
this.upButton.UseVisualStyleBackColor = true;
|
||||
this.upButton.Click += this.upButton_Click;
|
||||
this.downButton.Location = new Point(164, 41);
|
||||
this.downButton.Name = "downButton";
|
||||
this.downButton.Size = new Size(75, 23);
|
||||
this.downButton.TabIndex = 2;
|
||||
this.downButton.Text = "Down";
|
||||
this.downButton.UseVisualStyleBackColor = true;
|
||||
this.downButton.Click += this.downButton_Click;
|
||||
this.gradientPictureBox.BorderStyle = BorderStyle.FixedSingle;
|
||||
this.gradientPictureBox.Location = new Point(125, 12);
|
||||
this.gradientPictureBox.Name = "gradientPictureBox";
|
||||
this.gradientPictureBox.Size = new Size(33, 238);
|
||||
this.gradientPictureBox.TabIndex = 3;
|
||||
this.gradientPictureBox.TabStop = false;
|
||||
this.gradientPictureBox.Paint += this.gradientPictureBox_Paint;
|
||||
this.addButton.Location = new Point(164, 70);
|
||||
this.addButton.Name = "addButton";
|
||||
this.addButton.Size = new Size(75, 23);
|
||||
this.addButton.TabIndex = 3;
|
||||
this.addButton.Text = "Add";
|
||||
this.addButton.UseVisualStyleBackColor = true;
|
||||
this.addButton.Click += this.addButton_Click;
|
||||
this.deleteButton.Location = new Point(164, 99);
|
||||
this.deleteButton.Name = "deleteButton";
|
||||
this.deleteButton.Size = new Size(75, 23);
|
||||
this.deleteButton.TabIndex = 4;
|
||||
this.deleteButton.Text = "Delete";
|
||||
this.deleteButton.UseVisualStyleBackColor = true;
|
||||
this.deleteButton.Click += this.deleteButton_Click;
|
||||
this.cancelButton.DialogResult = DialogResult.Cancel;
|
||||
this.cancelButton.Location = new Point(164, 227);
|
||||
this.cancelButton.Name = "cancelButton";
|
||||
this.cancelButton.Size = new Size(75, 23);
|
||||
this.cancelButton.TabIndex = 6;
|
||||
this.cancelButton.Text = "Cancel";
|
||||
this.cancelButton.UseVisualStyleBackColor = true;
|
||||
this.okButton.DialogResult = DialogResult.OK;
|
||||
this.okButton.Location = new Point(164, 198);
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.Size = new Size(75, 23);
|
||||
this.okButton.TabIndex = 5;
|
||||
this.okButton.Text = "OK";
|
||||
this.okButton.UseVisualStyleBackColor = true;
|
||||
this.colorDialog.AnyColor = true;
|
||||
this.colorDialog.FullOpen = true;
|
||||
base.AcceptButton = this.okButton;
|
||||
base.AutoScaleDimensions = new SizeF(6f, 13f);
|
||||
base.AutoScaleMode = AutoScaleMode.Font;
|
||||
base.CancelButton = this.cancelButton;
|
||||
base.ClientSize = new Size(251, 262);
|
||||
base.Controls.Add(this.okButton);
|
||||
base.Controls.Add(this.cancelButton);
|
||||
base.Controls.Add(this.deleteButton);
|
||||
base.Controls.Add(this.addButton);
|
||||
base.Controls.Add(this.gradientPictureBox);
|
||||
base.Controls.Add(this.downButton);
|
||||
base.Controls.Add(this.upButton);
|
||||
base.Controls.Add(this.colorListBox);
|
||||
base.FormBorderStyle = FormBorderStyle.FixedDialog;
|
||||
base.MaximizeBox = false;
|
||||
base.MinimizeBox = false;
|
||||
base.Name = "GradientDialog";
|
||||
base.ShowInTaskbar = false;
|
||||
base.StartPosition = FormStartPosition.CenterParent;
|
||||
this.Text = "Gradient Editor";
|
||||
((ISupportInitialize)this.gradientPictureBox).EndInit();
|
||||
base.ResumeLayout(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
120
SDRSharp.PanView/SDRSharp.PanView/GradientDialog.resx
Normal file
120
SDRSharp.PanView/SDRSharp.PanView/GradientDialog.resx
Normal file
|
|
@ -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>
|
||||
25
SDRSharp.PanView/SDRSharp.PanView/LineInsertEventArgs.cs
Normal file
25
SDRSharp.PanView/SDRSharp.PanView/LineInsertEventArgs.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
using System;
|
||||
|
||||
namespace SDRSharp.PanView
|
||||
{
|
||||
public class LineInsertEventArgs : EventArgs
|
||||
{
|
||||
public unsafe int* RgbBuffer
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public int Length
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public unsafe LineInsertEventArgs(int* rgbBuffer, int length)
|
||||
{
|
||||
rgbBuffer = this.RgbBuffer;
|
||||
this.Length = length;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
namespace SDRSharp.PanView
|
||||
{
|
||||
public delegate void LineInsertEventHandler(object sender, LineInsertEventArgs e);
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
namespace SDRSharp.PanView
|
||||
{
|
||||
public delegate void ManualBandwidthChangeEventHandler(object sender, BandwidthEventArgs e);
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
namespace SDRSharp.PanView
|
||||
{
|
||||
public delegate void ManualFrequencyChangeEventHandler(object sender, FrequencyEventArgs e);
|
||||
}
|
||||
53
SDRSharp.PanView/SDRSharp.PanView/PeakDetector.cs
Normal file
53
SDRSharp.PanView/SDRSharp.PanView/PeakDetector.cs
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SDRSharp.PanView
|
||||
{
|
||||
public sealed class PeakDetector
|
||||
{
|
||||
private const byte Threshold = 20;
|
||||
|
||||
public static void GetPeaks(byte[] buffer, List<int> peaks, int windowSize)
|
||||
{
|
||||
windowSize |= 1;
|
||||
int halfSize = windowSize / 2;
|
||||
float num = 1f / (float)windowSize;
|
||||
peaks.Clear();
|
||||
for (int i = 0; i < buffer.Length; i++)
|
||||
{
|
||||
int num2 = 0;
|
||||
int max_index = i;
|
||||
for (int j = 0; j < windowSize; j++)
|
||||
{
|
||||
int num3 = i + j - halfSize;
|
||||
if (num3 < 0)
|
||||
{
|
||||
num3 = 0;
|
||||
}
|
||||
if (num3 >= buffer.Length)
|
||||
{
|
||||
num3 = buffer.Length - 1;
|
||||
}
|
||||
if (buffer[num3] >= buffer[max_index])
|
||||
{
|
||||
max_index = num3;
|
||||
}
|
||||
num2 += buffer[num3];
|
||||
}
|
||||
float num4 = (float)num2 * num;
|
||||
if ((float)(int)buffer[max_index] - num4 > 20f && !peaks.Exists(delegate(int x)
|
||||
{
|
||||
if (Math.Abs(max_index - x) <= halfSize)
|
||||
{
|
||||
return buffer[x] > buffer[max_index];
|
||||
}
|
||||
return false;
|
||||
}))
|
||||
{
|
||||
peaks.RemoveAll((int x) => Math.Abs(max_index - x) <= halfSize);
|
||||
peaks.Add(max_index);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1730
SDRSharp.PanView/SDRSharp.PanView/SpectrumAnalyzer.cs
Normal file
1730
SDRSharp.PanView/SDRSharp.PanView/SpectrumAnalyzer.cs
Normal file
File diff suppressed because it is too large
Load diff
12
SDRSharp.PanView/SDRSharp.PanView/SpectrumStyle.cs
Normal file
12
SDRSharp.PanView/SDRSharp.PanView/SpectrumStyle.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
namespace SDRSharp.PanView
|
||||
{
|
||||
public enum SpectrumStyle
|
||||
{
|
||||
Dots,
|
||||
SimpleCurve,
|
||||
SolidFill,
|
||||
StaticGradient,
|
||||
DynamicGradient,
|
||||
MinMax
|
||||
}
|
||||
}
|
||||
1280
SDRSharp.PanView/SDRSharp.PanView/Waterfall.cs
Normal file
1280
SDRSharp.PanView/SDRSharp.PanView/Waterfall.cs
Normal file
File diff suppressed because it is too large
Load diff
0
SDRSharp.PanView/refs Radio.txt
Normal file
0
SDRSharp.PanView/refs Radio.txt
Normal file
Loading…
Add table
Add a link
Reference in a new issue