Skip to content

Commit b45714f

Browse files
committed
initial
0 parents  commit b45714f

17 files changed

Lines changed: 811 additions & 0 deletions

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.vs
2+
bin
3+
obj

Assemblies/SDRSharp.Common.dll

14 KB
Binary file not shown.

Assemblies/SDRSharp.Radio.dll

112 KB
Binary file not shown.

Pocsag.Cli/Pocsag.Cli.csproj

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net5.0-windows</TargetFramework>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Include="NAudio" Version="2.0.0" />
10+
</ItemGroup>
11+
12+
<ItemGroup>
13+
<ProjectReference Include="..\Pocsag\Pocsag.csproj" />
14+
</ItemGroup>
15+
16+
</Project>

Pocsag.Cli/Program.cs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
namespace Pocsag.Cli
2+
{
3+
using System;
4+
using System.Collections.Generic;
5+
6+
class Program
7+
{
8+
static void Main(string[] args)
9+
{
10+
var file = new NAudio.Wave.WaveFileReader("SDRSharp_20210322_165253Z_153350000Hz_AF.wav");
11+
12+
var samples = new List<float>();
13+
14+
while (true)
15+
{
16+
var frame = file.ReadNextSampleFrame();
17+
18+
if (frame == null)
19+
{
20+
break;
21+
}
22+
23+
samples.Add(frame[0]);
24+
}
25+
26+
var pocsagManager =
27+
new Manager(
28+
file.WaveFormat.SampleRate,
29+
(Message message) =>
30+
{
31+
Console.WriteLine(message.Payload);
32+
});
33+
34+
foreach (var sample in samples)
35+
{
36+
pocsagManager.Process(sample);
37+
}
38+
39+
Console.WriteLine("Done.");
40+
Console.ReadKey(true);
41+
}
42+
}
43+
}

Pocsag.Plugin/Pocsag.Plugin.csproj

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net5.0-windows</TargetFramework>
5+
<OutputType>Library</OutputType>
6+
<UseWindowsForms>true</UseWindowsForms>
7+
</PropertyGroup>
8+
9+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
10+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
11+
</PropertyGroup>
12+
13+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
14+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
15+
</PropertyGroup>
16+
17+
<ItemGroup>
18+
<PackageReference Include="Microsoft.Windows.Compatibility" Version="5.0.2" />
19+
</ItemGroup>
20+
21+
<ItemGroup>
22+
<ProjectReference Include="..\Pocsag\Pocsag.csproj" />
23+
</ItemGroup>
24+
25+
<ItemGroup>
26+
<Reference Include="SDRSharp.Common">
27+
<HintPath>..\Assemblies\SDRSharp.Common.dll</HintPath>
28+
</Reference>
29+
<Reference Include="SDRSharp.Radio">
30+
<HintPath>..\Assemblies\SDRSharp.Radio.dll</HintPath>
31+
</Reference>
32+
</ItemGroup>
33+
34+
</Project>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup />
4+
<ItemGroup>
5+
<Compile Update="PocsagControl.cs">
6+
<SubType>UserControl</SubType>
7+
</Compile>
8+
</ItemGroup>
9+
</Project>

Pocsag.Plugin/PocsagControl.Designer.cs

Lines changed: 134 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Pocsag.Plugin/PocsagControl.cs

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
namespace Pocsag.Plugin
2+
{
3+
using SDRSharp.Common;
4+
using System.ComponentModel;
5+
using System.Windows.Forms;
6+
7+
public partial class PocsagControl : UserControl
8+
{
9+
private ISharpControl control;
10+
11+
private PocsagProcessor processor;
12+
13+
private BindingSource bindingSource;
14+
private BindingList<Pocsag.Message> bindingList;
15+
16+
public PocsagControl(ISharpControl control)
17+
{
18+
InitializeComponent();
19+
20+
this.bindingSource = new BindingSource();
21+
this.bindingList = new BindingList<Pocsag.Message>();
22+
23+
this.bindingSource.DataSource = this.bindingList;
24+
25+
this.control = control;
26+
27+
this.processor =
28+
new PocsagProcessor(
29+
this.control.AudioSampleRate,
30+
(Pocsag.Message message) =>
31+
{
32+
this.MessageReceived(message);
33+
});
34+
35+
this.control.RegisterStreamHook(
36+
this.processor,
37+
SDRSharp.Radio.ProcessorType.DemodulatorOutput);
38+
39+
this.processor.Enabled = true;
40+
41+
this.dataGridView1.AutoGenerateColumns = false;
42+
43+
this.dataGridView1.DataSource = this.bindingSource;
44+
}
45+
46+
private void MessageReceived(Pocsag.Message message)
47+
{
48+
//int firstDisplayed = this.dataGridView1.FirstDisplayedScrollingRowIndex;
49+
//int displayed = this.dataGridView1.DisplayedRowCount(true);
50+
//int lastVisible = (firstDisplayed + displayed) - 1;
51+
//int lastIndex = this.dataGridView1.RowCount - 1;
52+
53+
this.bindingList.Add(message);
54+
55+
//if (lastVisible == lastIndex)
56+
//{
57+
// this.dataGridView1.FirstDisplayedScrollingRowIndex = firstDisplayed + 1;
58+
//}
59+
60+
//this.dataGridView1.FirstDisplayedScrollingRowIndex = this.messages.Count - 1;
61+
}
62+
}
63+
}

Pocsag.Plugin/PocsagControl.resx

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<root>
2+
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
3+
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
4+
<xsd:element name="root" msdata:IsDataSet="true">
5+
<xsd:complexType>
6+
<xsd:choice maxOccurs="unbounded">
7+
<xsd:element name="metadata">
8+
<xsd:complexType>
9+
<xsd:sequence>
10+
<xsd:element name="value" type="xsd:string" minOccurs="0" />
11+
</xsd:sequence>
12+
<xsd:attribute name="name" use="required" type="xsd:string" />
13+
<xsd:attribute name="type" type="xsd:string" />
14+
<xsd:attribute name="mimetype" type="xsd:string" />
15+
<xsd:attribute ref="xml:space" />
16+
</xsd:complexType>
17+
</xsd:element>
18+
<xsd:element name="assembly">
19+
<xsd:complexType>
20+
<xsd:attribute name="alias" type="xsd:string" />
21+
<xsd:attribute name="name" type="xsd:string" />
22+
</xsd:complexType>
23+
</xsd:element>
24+
<xsd:element name="data">
25+
<xsd:complexType>
26+
<xsd:sequence>
27+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
28+
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
29+
</xsd:sequence>
30+
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
31+
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
32+
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
33+
<xsd:attribute ref="xml:space" />
34+
</xsd:complexType>
35+
</xsd:element>
36+
<xsd:element name="resheader">
37+
<xsd:complexType>
38+
<xsd:sequence>
39+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
40+
</xsd:sequence>
41+
<xsd:attribute name="name" type="xsd:string" use="required" />
42+
</xsd:complexType>
43+
</xsd:element>
44+
</xsd:choice>
45+
</xsd:complexType>
46+
</xsd:element>
47+
</xsd:schema>
48+
<resheader name="resmimetype">
49+
<value>text/microsoft-resx</value>
50+
</resheader>
51+
<resheader name="version">
52+
<value>2.0</value>
53+
</resheader>
54+
<resheader name="reader">
55+
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
56+
</resheader>
57+
<resheader name="writer">
58+
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
59+
</resheader>
60+
<metadata name="Payload.UserAddedColumn" type="System.Boolean, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e">
61+
<value>True</value>
62+
</metadata>
63+
<metadata name="Baud.UserAddedColumn" type="System.Boolean, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e">
64+
<value>True</value>
65+
</metadata>
66+
<metadata name="Function.UserAddedColumn" type="System.Boolean, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e">
67+
<value>True</value>
68+
</metadata>
69+
<metadata name="ChannelAccessProtocolCode.UserAddedColumn" type="System.Boolean, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e">
70+
<value>True</value>
71+
</metadata>
72+
<metadata name="FrameIndex.UserAddedColumn" type="System.Boolean, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e">
73+
<value>True</value>
74+
</metadata>
75+
<metadata name="Timestamp.UserAddedColumn" type="System.Boolean, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e">
76+
<value>True</value>
77+
</metadata>
78+
</root>

0 commit comments

Comments
 (0)