mirror of
https://github.com/ekinnee/SharpCAT.git
synced 2026-01-20 15:20:15 +01:00
Start CIV (Icom) radio support. Realized I'd need to split radio types.
This commit is contained in:
parent
5257130859
commit
8a42cf0dd5
105
SharpCAT/Models/CATRadio.cs
Normal file
105
SharpCAT/Models/CATRadio.cs
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
namespace SharpCATLib.Models
|
||||
{
|
||||
//Base Radio Model
|
||||
public partial class CATRadio
|
||||
{
|
||||
string RadioMfg { get; }
|
||||
string RadioModel { get; }
|
||||
|
||||
string CmdPad { get; }
|
||||
|
||||
string VFOToggle { get; }
|
||||
Lock Lock { get; }
|
||||
Ptt Ptt { get; }
|
||||
Clar Clar { get; }
|
||||
Split Split { get; }
|
||||
Power Power { get; }
|
||||
ToneMode ToneMode { get; }
|
||||
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 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;
|
||||
}
|
||||
|
||||
}
|
||||
14
SharpCAT/Models/CIVCommand.cs
Normal file
14
SharpCAT/Models/CIVCommand.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace SharpCATLib.Models
|
||||
{
|
||||
class CIVCommand
|
||||
{
|
||||
string CmdToRadio = "FE FE 9A E0 Cn Sc Data area FD";
|
||||
string DataFromRadio = "FE FE E0 9A Cn Sc Data area FD";
|
||||
string OKFromRadio { get; set; }
|
||||
string NGFromRadio { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -2,9 +2,9 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace SharpCATLib.Models.Radios.Icom
|
||||
namespace SharpCATLib.Models
|
||||
{
|
||||
class ID4100a : Radio
|
||||
class CIVRadio
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace SharpCATLib.Models
|
||||
{
|
||||
//Base Radio Model
|
||||
class Radio
|
||||
{
|
||||
public readonly string CmdPad = "00000000";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,165 +0,0 @@
|
|||
namespace SharpCATLib.Models.Radios.Yaesu
|
||||
{
|
||||
internal class FT818 : Radio
|
||||
{
|
||||
public struct Lock
|
||||
{
|
||||
public static readonly string ON = "00";
|
||||
public static readonly string OFF = "80";
|
||||
}
|
||||
|
||||
public struct Ptt
|
||||
{
|
||||
public static readonly string ON = "08";
|
||||
public static readonly string OFF = "88";
|
||||
}
|
||||
|
||||
public struct Clar
|
||||
{
|
||||
public static readonly string ON = "05";
|
||||
public static readonly string OFF = "85";
|
||||
}
|
||||
|
||||
public struct Split
|
||||
{
|
||||
public static readonly string ON = "02";
|
||||
public static readonly string OFF = "82";
|
||||
}
|
||||
|
||||
public struct Power
|
||||
{
|
||||
public static readonly string ON = "0F";
|
||||
public static readonly string OFF = "8F";
|
||||
}
|
||||
|
||||
public string VFOToggle = "81";
|
||||
|
||||
public struct 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 struct 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";
|
||||
}
|
||||
|
||||
public string LockOn()
|
||||
{
|
||||
string _cmd = CmdPad + Lock.ON;
|
||||
return _cmd;
|
||||
}
|
||||
|
||||
public string LockOff()
|
||||
{
|
||||
string _cmd = CmdPad + Lock.OFF;
|
||||
return _cmd;
|
||||
}
|
||||
|
||||
public string PttOn()
|
||||
{
|
||||
string _cmd = CmdPad + Ptt.ON;
|
||||
return _cmd;
|
||||
}
|
||||
|
||||
public string PttOff()
|
||||
{
|
||||
string _cmd = CmdPad + Ptt.OFF;
|
||||
return _cmd;
|
||||
}
|
||||
|
||||
public string ClarOn()
|
||||
{
|
||||
string _cmd = CmdPad + Clar.ON;
|
||||
return _cmd;
|
||||
}
|
||||
|
||||
public string ClarOff()
|
||||
{
|
||||
string _cmd = CmdPad + Clar.OFF;
|
||||
return _cmd;
|
||||
}
|
||||
|
||||
public string SplitOn()
|
||||
{
|
||||
string _cmd = CmdPad + Split.ON;
|
||||
return _cmd;
|
||||
}
|
||||
|
||||
public string SplitOff()
|
||||
{
|
||||
string _cmd = CmdPad + Split.OFF;
|
||||
return _cmd;
|
||||
}
|
||||
|
||||
public string PowerOn()
|
||||
{
|
||||
string _cmd = CmdPad + Power.ON;
|
||||
return _cmd;
|
||||
}
|
||||
|
||||
public string PowerOff()
|
||||
{
|
||||
string _cmd = CmdPad + Power.OFF;
|
||||
return _cmd;
|
||||
}
|
||||
|
||||
public void SetFreq(double freq)
|
||||
{
|
||||
char[] freqChars = freq.ToString().ToCharArray();
|
||||
// 01 42 34 56 = 14.23456MHz
|
||||
switch (freqChars.Length)
|
||||
{
|
||||
case 1: break;
|
||||
case 2: break;
|
||||
case 3: break;
|
||||
case 4: break;
|
||||
case 5: break;
|
||||
case 6: break;
|
||||
case 7: break;
|
||||
case 8: break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetOpMode(OpModes opmode)
|
||||
{
|
||||
}
|
||||
|
||||
public string SwitchVFO()
|
||||
{
|
||||
string _cmd = CmdPad + VFOToggle;
|
||||
return _cmd;
|
||||
}
|
||||
|
||||
public void SetToneMode(ToneMode mode)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void GetRXStatus()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void GetTXStatus()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void GetFreqAndModeStatus()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
12
SharpCAT/Radios/Icom/ID4100a.cs
Normal file
12
SharpCAT/Radios/Icom/ID4100a.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace SharpCATLib.Models.Radios.Icom
|
||||
{
|
||||
class ID4100a : CIVRadio
|
||||
{
|
||||
string OKFromRadio = "FEFEE09AFBFD";
|
||||
string NGFromRadio = "FEFEE09AFAFD";
|
||||
}
|
||||
}
|
||||
3
SharpCAT/Radios/Icom/ID4100a.json
Normal file
3
SharpCAT/Radios/Icom/ID4100a.json
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
|
||||
}
|
||||
|
|
@ -4,7 +4,8 @@ using System.Text;
|
|||
|
||||
namespace SharpCATLib.Models.Radios.Icom
|
||||
{
|
||||
class ID880H : Radio
|
||||
class ID880H
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
3
SharpCAT/Radios/Icom/ID880H.json
Normal file
3
SharpCAT/Radios/Icom/ID880H.json
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
|
||||
}
|
||||
|
|
@ -4,7 +4,8 @@ using System.Text;
|
|||
|
||||
namespace SharpCATLib.Models.Radios.Kenwood
|
||||
{
|
||||
class THD74A : Radio
|
||||
class THD74A
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
3
SharpCAT/Radios/Kenwood/THD74A.json
Normal file
3
SharpCAT/Radios/Kenwood/THD74A.json
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
|
||||
}
|
||||
149
SharpCAT/Radios/Yaesu/FT818.cs
Normal file
149
SharpCAT/Radios/Yaesu/FT818.cs
Normal file
|
|
@ -0,0 +1,149 @@
|
|||
using SharpCATLib;
|
||||
|
||||
namespace SharpCATLib.Models.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";
|
||||
}
|
||||
|
||||
string LockOn()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
string LockOff()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
string PttOn()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
string PttOff()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
string ClarOn()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
string ClarOff()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
string SplitOn()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
string SplitOff()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
string PowerOn()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
string PowerOff()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
string SetFreq(double freq)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
string SetOpMode(OpModes opmode)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
string SwitchVFO()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
string SetToneMode(ToneMode mode)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
string GetRXStatus()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
string GetTXStatus()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
string GetFreqAndModeStatus()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
3
SharpCAT/Radios/Yaesu/FT818.json
Normal file
3
SharpCAT/Radios/Yaesu/FT818.json
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
|
||||
}
|
||||
|
|
@ -9,6 +9,18 @@
|
|||
</ItemGroup>
|
||||
|
||||
<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>
|
||||
|
|
|
|||
Loading…
Reference in a new issue