Add project files.

This commit is contained in:
Erick Kinnee 2019-03-06 08:41:51 -06:00
parent 6d39f28159
commit 27a7ac4739
8 changed files with 325 additions and 0 deletions

57
.vscode/launch.json vendored Normal file
View file

@ -0,0 +1,57 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/bin/Debug/<insert-target-framework-here>/<insert-project-name-here>.dll",
"args": [],
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/bin/Debug/<insert-target-framework-here>/<insert-project-name-here>.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart",
"launchBrowser": {
"enabled": true,
"args": "${auto-detect-url}",
"windows": {
"command": "cmd.exe",
"args": "/C start ${auto-detect-url}"
},
"osx": {
"command": "open"
},
"linux": {
"command": "xdg-open"
}
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}

17
.vscode/tasks.json vendored Normal file
View file

@ -0,0 +1,17 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet build",
"type": "shell",
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
}
]
}

90
Serial.cs Normal file
View file

@ -0,0 +1,90 @@
using System;
using System.IO.Ports;
using System.Threading;
namespace SharpCAT
{
public class Serial
{
private SerialPort _serialPort;
public string[] PortNames { get => SerialPort.GetPortNames(); }
public static int[] BaudRates { get; } = new int[] { 1200, 4800, 9600, 19200, 38400 };
public static int[] DataBits { get; } = new int[] { 7, 8 };
public enum Parity
{
Even = System.IO.Ports.Parity.Even,
Mark = System.IO.Ports.Parity.Mark,
None = System.IO.Ports.Parity.None,
Odd = System.IO.Ports.Parity.Odd,
Space = System.IO.Ports.Parity.Space
}
public enum StopBits
{
None = System.IO.Ports.StopBits.None,
One = System.IO.Ports.StopBits.One,
OnePointFive = System.IO.Ports.StopBits.OnePointFive,
Two = System.IO.Ports.StopBits.Two
}
public enum Handshake
{
None = System.IO.Ports.Handshake.None,
RequestToSend = System.IO.Ports.Handshake.RequestToSend,
RequestToSendXOnXOff = System.IO.Ports.Handshake.RequestToSendXOnXOff,
XOnXOff = System.IO.Ports.Handshake.XOnXOff
}
public Serial(string portname, int baudrate, Parity parity, StopBits bits, Handshake handshake)
{
_serialPort = new SerialPort
{
ReadTimeout = 500,
WriteTimeout = 500,
PortName = portname,
BaudRate = baudrate,
Parity = (System.IO.Ports.Parity)parity,
StopBits = (System.IO.Ports.StopBits)bits,
Handshake = (System.IO.Ports.Handshake)handshake
};
_serialPort.DataReceived += new SerialDataReceivedEventHandler(SerialDataReceived);
_serialPort.ErrorReceived += new SerialErrorReceivedEventHandler(SerialErrorReceived);
}
private void SerialErrorReceived(object sender, SerialErrorReceivedEventArgs e)
{
}
private void SerialDataReceived(object sender, SerialDataReceivedEventArgs e)
{
}
public void Read()
{
try
{
string message = _serialPort.ReadLine();
//Console.WriteLine(message);
}
catch (TimeoutException) { }
}
public void GetRXStatus()
{
}
public void GetFreqAndMode()
{
}
}
}

15
SharpCAT.cs Normal file
View file

@ -0,0 +1,15 @@
namespace SharpCAT
{
public class SharpCAT
{
private string CatCmdStr { get; set; }
private Serial _serial;
public SharpCAT()
{
//_serial = new Serial();
}
}
}

20
SharpCAT.csproj Normal file
View file

@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.IO.Ports" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
<None Update="SharpCAT WPF\App.xaml">
<Generator>MSBuild:Compile</Generator>
</None>
<None Update="SharpCAT WPF\MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
</None>
</ItemGroup>
</Project>

47
SharpCAT.sln Normal file
View file

@ -0,0 +1,47 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.421
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpCAT", "SharpCAT.csproj", "{C3A9288A-CE33-46F7-83EA-9534B8DC4A31}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{3C050B74-ACBA-427C-B3F4-069D6E23BD67}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Radios", "Radios", "{7D1D7F1D-8AC1-4309-BBFB-D8B12363A347}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Yaesu", "Yaesu", "{4B0F6F9A-A9EB-45D9-B70F-AD49D0C6AD5F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FT818", "FT818", "{9657A3C4-B6F9-4E2D-A65E-DAE55A6DBEF2}"
ProjectSection(SolutionItems) = preProject
Docs\Radios\Yaesu\FT818\Yaesu-FT-818nd-manual-FT818.pdf = Docs\Radios\Yaesu\FT818\Yaesu-FT-818nd-manual-FT818.pdf
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpCATForms", "..\SharpCATForms\SharpCATForms.csproj", "{3483B368-338A-4BE3-AEB9-460E374B2C99}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C3A9288A-CE33-46F7-83EA-9534B8DC4A31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C3A9288A-CE33-46F7-83EA-9534B8DC4A31}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C3A9288A-CE33-46F7-83EA-9534B8DC4A31}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C3A9288A-CE33-46F7-83EA-9534B8DC4A31}.Release|Any CPU.Build.0 = Release|Any CPU
{3483B368-338A-4BE3-AEB9-460E374B2C99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3483B368-338A-4BE3-AEB9-460E374B2C99}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3483B368-338A-4BE3-AEB9-460E374B2C99}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3483B368-338A-4BE3-AEB9-460E374B2C99}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{7D1D7F1D-8AC1-4309-BBFB-D8B12363A347} = {3C050B74-ACBA-427C-B3F4-069D6E23BD67}
{4B0F6F9A-A9EB-45D9-B70F-AD49D0C6AD5F} = {7D1D7F1D-8AC1-4309-BBFB-D8B12363A347}
{9657A3C4-B6F9-4E2D-A65E-DAE55A6DBEF2} = {4B0F6F9A-A9EB-45D9-B70F-AD49D0C6AD5F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4BF99AE0-6109-48CE-955C-F4F31BA0D9BA}
EndGlobalSection
EndGlobal

79
Yaesu FT818.cs Normal file
View file

@ -0,0 +1,79 @@
namespace SharpCAT.Yaesu
{
internal class FT818
{
public struct LOCK
{
private static readonly string ON = "00";
private static readonly string OFF = "80";
}
public struct PTT
{
private static readonly string ON = "08";
private static readonly string OFF = "88";
}
public struct CLAR
{
private static readonly string ON = "05";
private static readonly string OFF = "85";
}
public struct SPLIT
{
private static readonly string ON = "02";
private static readonly string OFF = "82";
}
public struct POWER
{
private static readonly string ON = "0F";
private static readonly string OFF = "8F";
}
public struct OpModes
{
private static readonly string LSB = "00";
private static readonly string USB = "01";
private static readonly string CW = "02";
private static readonly string CWR = "03";
private static readonly string AM = "04";
private static readonly string FM = "08";
private static readonly string DIG = "0A";
private static readonly string PKT = "0C";
}
public void SetLock()
{
}
public void SetPTT()
{
}
public void SetCLAR()
{
}
public void SetSPLIT()
{
}
public void SetPOWER()
{
}
public void SetFreq(double freq)
{
}
public void SetOpMode(string opmode)
{
}
public void SetVFO()
{
}
}
}