Rename SharpCAT directory to Library and update all references

Co-authored-by: ekinnee <1707617+ekinnee@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-08-07 00:09:27 +00:00
parent ff341a3fed
commit 950d840238
26 changed files with 9 additions and 9 deletions

Binary file not shown.

10
Library/FlrigProtocol.cs Normal file
View file

@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SharpCAT
{
class FlrigProtocol
{
}
}

37
Library/Library.csproj Normal file
View file

@ -0,0 +1,37 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<LangVersion>default</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<LangVersion>default</LangVersion>
</PropertyGroup>
<ItemGroup>
<None Update="Radios\Icom\ID4100a.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Radios\Icom\ID880H.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Radios\Kenwood\THD74A.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Radios\Yaesu\FT818.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="SharpCAT WPF\App.xaml">
<Generator>MSBuild:Compile</Generator>
</None>
<None Update="SharpCAT WPF\MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.IO.Ports" Version="5.0.1" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,11 @@
namespace SharpCAT.Models
{
internal class CATCommand
{
public string P1 { get; set; }
public string P2 { get; set; }
public string P3 { get; set; }
public string P4 { get; set; }
public string OpCode { get; set; }
}
}

104
Library/Models/CATRadio.cs Normal file
View file

@ -0,0 +1,104 @@
namespace SharpCAT.Models
{
//Base Radio Model
public partial class CATRadio : IRadio
{
private string RadioMfg { get; }
private string RadioModel { get; }
private string CmdPad { get; } = "00000000";
private string VFOToggle { get; }
private Lock Lock { get; }
private Ptt Ptt { get; }
private Clar Clar { get; }
private Split Split { get; }
private Power Power { get; }
private ToneMode ToneMode { get; }
private OpModes OpModes { get; }
partial void LockOn();
partial void LockOff();
partial void PttOn();
partial void PttOff();
partial void ClarOn();
partial void ClarOff();
partial void SplitOn();
partial void SplitOff();
partial void PowerOn();
partial void PowerOff();
partial void SetFreq(double freq);
partial void SetOpMode(OpModes opmode);
partial void SwitchVFO();
partial void SetToneMode(ToneMode mode);
partial void GetRXStatus();
partial void GetTXStatus();
partial void GetFreqAndModeStatus();
}
public partial class Lock
{
public static readonly string ON;
public static readonly string OFF;
}
public class Ptt
{
public static readonly string ON;
public static readonly string OFF;
}
public class Clar
{
public static readonly string ON;
public static readonly string OFF;
}
public class Split
{
public static readonly string ON;
public static readonly string OFF;
}
public class Power
{
public static readonly string ON;
public static readonly string OFF;
}
public class ToneMode
{
public static readonly string DCS;
public static readonly string CTCSS;
public static readonly string ENCODER;
public static readonly string OFF;
}
public class OpModes
{
public static readonly string LSB;
public static readonly string USB;
public static readonly string CW;
public static readonly string CWR;
public static readonly string AM;
public static readonly string FM;
public static readonly string DIG;
public static readonly string PKT;
}
}

View file

@ -0,0 +1,10 @@
namespace SharpCAT.Models
{
internal class CIVCommand
{
private string CmdToRadio = "FE FE 9A E0 Cn Sc Data area FD";
private string DataFromRadio = "FE FE E0 9A Cn Sc Data area FD";
private string OKFromRadio { get; set; }
private string NGFromRadio { get; set; }
}
}

View file

@ -0,0 +1,6 @@
namespace SharpCAT.Models
{
internal class CIVRadio : IRadio
{
}
}

8
Library/Models/IRadio.cs Normal file
View file

@ -0,0 +1,8 @@
using System;
namespace SharpCAT.Models
{
partial interface IRadio
{
}
}

View file

@ -0,0 +1,10 @@
using SharpCAT.Models;
namespace SharpCAT.Radios.Icom
{
internal class ID4100a : CIVRadio
{
private string OKFromRadio = "FEFEE09AFBFD";
private string NGFromRadio = "FEFEE09AFAFD";
}
}

View file

@ -0,0 +1,2 @@
{
}

View file

@ -0,0 +1,6 @@
namespace SharpCAT.Radios.Icom
{
internal class ID880H
{
}
}

View file

@ -0,0 +1,2 @@
{
}

View file

@ -0,0 +1,6 @@
namespace SharpCAT.Radios.Kenwood
{
internal class THD74A
{
}
}

View file

@ -0,0 +1,2 @@
{
}

View file

@ -0,0 +1,149 @@
using SharpCAT.Models;
namespace SharpCAT.Radios.Yaesu
{
public class FT818 : CATRadio
{
public string RadioMfg => "Yaesu";
public string RadioModel => "FT-818";
public string CmdPad => "00000000";
public class Lock
{
public static readonly string ON = "00";
public static readonly string OFF = "80";
}
public class Ptt
{
public static readonly string ON = "08";
public static readonly string OFF = "88";
}
public class Clar
{
public static readonly string ON = "05";
public static readonly string OFF = "85";
}
public class Split
{
public static readonly string ON = "02";
public static readonly string OFF = "82";
}
public class Power
{
public static readonly string ON = "0F";
public static readonly string OFF = "8F";
}
public string VFOToggle => "81";
public class ToneMode
{
public static readonly string DCS = "0A";
public static readonly string CTCSS = "2A";
public static readonly string ENCODER = "4A";
public static readonly string OFF = "8A";
}
public class OpModes
{
public static readonly string LSB = "00";
public static readonly string USB = "01";
public static readonly string CW = "02";
public static readonly string CWR = "03";
public static readonly string AM = "04";
public static readonly string FM = "08";
public static readonly string DIG = "0A";
public static readonly string PKT = "0C";
}
private string LockOn()
{
return "";
}
private string LockOff()
{
return "";
}
private string PttOn()
{
return "";
}
private string PttOff()
{
return "";
}
private string ClarOn()
{
return "";
}
private string ClarOff()
{
return "";
}
private string SplitOn()
{
return "";
}
private string SplitOff()
{
return "";
}
private string PowerOn()
{
return "";
}
private string PowerOff()
{
return "";
}
private string SetFreq(double freq)
{
return "";
}
private string SetOpMode(OpModes opmode)
{
return "";
}
private string SwitchVFO()
{
return "";
}
private string SetToneMode(ToneMode mode)
{
return "";
}
private string GetRXStatus()
{
return "";
}
private string GetTXStatus()
{
return "";
}
private string GetFreqAndModeStatus()
{
return "";
}
}
}

View file

@ -0,0 +1,2 @@
{
}

50
Library/Serial.cs Normal file
View file

@ -0,0 +1,50 @@
using System;
using System.IO.Ports;
namespace SharpCAT
{
public class Serial
{
private SerialPort _serialPort;
//Init
public Serial(string portname, SharpCAT.BaudRates baudrate, Parity parity, StopBits bits, Handshake handshake)
{
_serialPort = new SerialPort
{
ReadTimeout = 500,
WriteTimeout = 500,
PortName = portname,
BaudRate = (int)baudrate,
Parity = parity,
StopBits = bits,
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 ProbeSerialPort(SerialPort port)
{
}
public void Read()
{
try
{
string message = _serialPort.ReadLine();
//Console.WriteLine(message);
}
catch (TimeoutException) { }
}
}
}

6
Library/SerialClient.cs Normal file
View file

@ -0,0 +1,6 @@
namespace SharpCAT
{
internal class SerialClient
{
}
}

6
Library/SerialServer.cs Normal file
View file

@ -0,0 +1,6 @@
namespace SharpCAT
{
internal class SerialServer
{
}
}

49
Library/SharpCAT.cs Normal file
View file

@ -0,0 +1,49 @@
using System.Collections.Generic;
using System.IO.Ports;
namespace SharpCAT
{
public class SharpCAT
{
private delegate string OnPortsSelected(string[] portnames);
private static event OnPortsSelected PortsSelected;
public SharpCAT() => SharpCAT.PortsSelected += new OnPortsSelected(ConnectPorts);
public string[] PortsToUse { get; set; }
public double[] CTCSSTones = { 67.0, 69.3, 71.9, 74.4, 77.0, 79.7, 82.5, 85.4, 88.5,
91.5, 94.8, 97.4, 100.0, 103.5, 107.2, 110.9, 114.8, 118.8, 123, 127.3, 131.8,
136.5, 141.3, 146.2, 151.4, 156.7, 162.2, 167.9, 173.8, 179.9, 186.2, 192.8,
203.5, 210.7, 218.1, 225.7, 233.6, 241.8, 250.3 };
public int[] DCSCodes = { 023, 025, 026, 031, 032, 036, 043, 047, 051, 053, 054, 065,
071, 072, 073, 074, 114, 115, 116, 122, 125, 131, 132, 134, 143, 145, 152, 155,
156, 162, 165, 172, 174, 205, 212, 223, 225, 226, 243, 244, 245, 246, 251, 252, 255,
261, 263, 265, 266, 271, 274, 306, 311, 315, 325, 331, 332, 343, 346, 351, 356, 364,
365, 371, 411, 412, 413, 423, 431, 432, 445, 446, 452, 454, 455, 462, 464, 465, 466,
503, 506, 516, 523, 526, 532, 546, 565, 606, 612, 624, 627, 631, 632, 654, 662, 664,
703, 712, 723, 731, 732, 734, 743, 754 };
public string[] PortNames { get => SerialPort.GetPortNames(); }
public enum BaudRates : int { Twelve = 1200, TwentyFour = 2400, FourtyEight = 4800, NinteySix = 9600, NineteenTwo = 19200, ThirtyEightFour = 38400 };
public static int[] DataBits { get; } = new int[] { 7, 8 };
public static string[] RadioTypes { get; } = new string[] { "CAT", "CIV" };
private string ConnectPorts(string[] portnames)
{
List<SerialPort> ports = new List<SerialPort>();
foreach (string port in portnames)
{
//Testing
ports.Add(new SerialPort(port, (int)BaudRates.ThirtyEightFour, Parity.None, (int)StopBits.Two, (int)Handshake.None));
}
return "";
}
}
}

6
Library/Socket.cs Normal file
View file

@ -0,0 +1,6 @@
namespace SharpCAT
{
internal class Socket
{
}
}