Skip to content

Commit

Permalink
🎨 shx8800pro works (ui)
Browse files Browse the repository at this point in the history
  • Loading branch information
SydneyOwl committed Aug 11, 2024
1 parent f4fd034 commit d812ec2
Show file tree
Hide file tree
Showing 12 changed files with 800 additions and 27 deletions.
16 changes: 16 additions & 0 deletions Constants/Shx8800Pro/DTMF_CHOICE.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System.Collections.ObjectModel;

namespace SenhaixFreqWriter.Constants.Shx8800Pro;

public class DtmfChoice
{
public static ObservableCollection<string> Time = new()
{
"50 ms", "100 ms", "200 ms", "300 ms", "500 ms"
};

public static ObservableCollection<string> SendID = new()
{
"关", "按下PPT", "松开PPT", "两者"
};
}
175 changes: 175 additions & 0 deletions Constants/Shx8800Pro/FUNCTION_CHOICE.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
using System.Collections.ObjectModel;

namespace SenhaixFreqWriter.Constants.Shx8800Pro;

public class FunctionChoice
{
public static ObservableCollection<string> Sql = new()
{
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
};

public static ObservableCollection<string> TxTimeout = new()
{
"关", "30s", "60s", "90s", "120s", "150s", "180s", "210s", "240s"
};

public static ObservableCollection<string> SaveMode = new()
{
"关", "普通省电","超级省电","深度省电"
};

public static ObservableCollection<string> Vox = new()
{
"高灵敏度", "中灵敏度", "低灵敏度"
};

public static ObservableCollection<string> VoiceSW = new()
{
"关", "开"
};

public static ObservableCollection<string> VoxDelay = new()
{
"0.5s", "0.6s", "0.7s", "0.8s", "0.9s", "1.0s", "1.1s", "1.2s", "1.3s", "1.4s",
"1.5s", "1.6s", "1.7s", "1.8s", "1.9s", "2.0s"
};

public static ObservableCollection<string> DoubleWait = new()
{
"关", "开"
};

public static ObservableCollection<string> Tone = new()
{
"1000Hz", "1450Hz", "1750Hz", "2100Hz"
};

public static ObservableCollection<string> SideTone = new()
{
"关", "按键侧音","身份码侧音","两者"
};

public static ObservableCollection<string> TailClear = new()
{
"关", "开"
};

public static ObservableCollection<string> PowerOnDisplay = new()
{
"LOGO", "电池电压"
};

public static ObservableCollection<string> Beep = new()
{
"关", "开"
};

public static ObservableCollection<string> Roger = new()
{
"关", "开"
};

public static ObservableCollection<string> BtMicGain = new()
{
"1", "2", "3", "4", "5"
};

public static ObservableCollection<string> MicGain = new()
{
"低增益", "中增益", "高增益"
};

public static ObservableCollection<string> ScanMode = new()
{
"时间扫描", "载波扫描", "搜索扫描"
};

public static ObservableCollection<string> Sos = new()
{
"现场报警", "发射报警音", "发射报警码"
};

public static ObservableCollection<string> SosVoice = new()
{
"关","开"
};

public static ObservableCollection<string> KeyLock = new()
{
"关", "开"
};

public static ObservableCollection<string> Fm = new()
{
"允许", "禁止"
};

public static ObservableCollection<string> AutoLock = new()
{
"关", "5 s", "10 s", "15 s"
};

public static ObservableCollection<string> AutoQuit = new()
{
"5 s", "10 s", "15 s", "20 s", "25 s", "30 s", "35 s", "40 s", "45 s", "50 s",
"60 s"
};

public static ObservableCollection<string> BackgroundLightTime = new()
{
"常开", "5 s", "10 s", "15 s", "20 s", "30 s", "1 min", "2 min", "3 min"
};

public static ObservableCollection<string> SendCodeDelay = new()
{
"0 ms", "100 ms", "200 ms", "400 ms", "600 ms", "800 ms"
};

public static ObservableCollection<string> DisplayType = new()
{
"信道名称", "频率", "信道号"
};

public static ObservableCollection<string> WorkMode = new()
{
"频率模式", "信道模式"
};

public static ObservableCollection<string> KeyFunc = new()
{
"收音机", "监听", "扫描", "扫频", "天气预报"
};

public static ObservableCollection<string> RptTailClear = new()
{
"0", "100 ms", "200 ms", "300 ms", "400 ms", "500 ms", "600 ms", "700 ms", "800 ms", "900 ms", "1000 ms"
};

public static ObservableCollection<string> RptDetectTail = new()
{
"0", "100 ms", "200 ms", "300 ms", "400 ms", "500 ms", "600 ms", "700 ms", "800 ms", "900 ms", "1000 ms"
};

public static ObservableCollection<string> VoxSwitch = new()
{
"关", "开"
};

public static ObservableCollection<string> PowerUpDisplayTime = new()
{
"0.2 s", "0.4 s", "0.6 s", "0.8 s", "1.0 s", "1.2 s", "1.4 s", "1.6 s", "1.8 s", "2.0 s",
"2.2 s", "2.4 s", "2.6 s", "2.8 s", "3.0 s"
};

public static ObservableCollection<string> BtGain = new()
{
"1", "2", "3", "4", "5"
};

public static ObservableCollection<string> CurBank = new()
{
"1", "2", "3", "4", "5",
"6", "7", "8"
};
}
2 changes: 1 addition & 1 deletion DataModels/Gt12/FMChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace SenhaixFreqWriter.DataModels.Gt12;

public partial class FmChannel : ObservableObject
{
[ObservableProperty] private int[] _channels = new int[15];
[ObservableProperty] private int[] _channels = new int[30];
[ObservableProperty] private int _curFreq = 904;
}

Expand Down
6 changes: 2 additions & 4 deletions DataModels/Shx8800Pro/AppData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ public class AppData
{
[JsonIgnore] public static AppData Instance;

public string[] BankName = new string[30]
public string[] BankName = new string[8]
{
"区域一", "区域二", "区域三", "区域四", "区域五", "区域六", "区域七", "区域八", "区域九", "区域十",
"区域十一", "区域十二", "区域十三", "区域十四", "区域十五", "区域十六", "区域十七", "区域十八", "区域十九", "区域二十",
"区域二十一", "区域二十二", "区域二十三", "区域二十四", "区域二十五", "区域二十六", "区域二十七", "区域二十八", "区域二十九", "区域三十"
"区域一", "区域二", "区域三", "区域四", "区域五", "区域六", "区域七", "区域八",
};//

public Channel[][] ChannelList = new Channel[8][];//
Expand Down
14 changes: 2 additions & 12 deletions DataModels/Shx8800Pro/DTMF.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ namespace SenhaixFreqWriter.DataModels.Shx8800Pro;

public partial class Dtmf : ObservableObject
{
[ObservableProperty] private string[] _group = new string[20];
[ObservableProperty] private string[] _groupName = new string[20];
[ObservableProperty] private string[] _group = new string[15];
[ObservableProperty] private string[] _groupName = new string[15]; //seems useless...
[ObservableProperty] private int _idleTime = 1;
[ObservableProperty] private string _localId = "100";
[ObservableProperty] private int _wordTime = 1;
Expand Down Expand Up @@ -43,16 +43,6 @@ public Dtmf()
GroupName[13] = "成员14";
Group[14] = "115";
GroupName[14] = "成员15";
Group[15] = "116";
GroupName[15] = "成员16";
Group[16] = "117";
GroupName[16] = "成员17";
Group[17] = "118";
GroupName[17] = "成员18";
Group[18] = "119";
GroupName[18] = "成员19";
Group[19] = "120";
GroupName[19] = "成员20";
}
}

Expand Down
51 changes: 51 additions & 0 deletions Views/Shx8800Pro/DTMFWindow.axaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="400" Height="550"
WindowStartupLocation="CenterScreen"
CanResize="False"
x:Class="SenhaixFreqWriter.Views.Shx8800Pro.DtmfWindow"
xmlns:vm="using:SenhaixFreqWriter.Views.Shx8800Pro"
x:DataType="vm:DtmfWindow"
xmlns:constants="clr-namespace:SenhaixFreqWriter.Constants.Shx8800Pro"
Title="DTMF设置">
<Canvas>
<DataGrid Margin="20" Name="FMDataGrid"
GridLinesVisibility="All"
BorderThickness="1" BorderBrush="Gray"
CanUserSortColumns="False"
CanUserResizeColumns="True"
CanUserReorderColumns="True"
ItemsSource="{Binding Dtmfs}"
Height="400"
Width="350"
RowBackground="{DynamicResource dgBackgroundBrush}">
<DataGrid.Columns>
<DataGridTextColumn Header="序号" IsReadOnly="True" Width="*" Binding="{Binding Id }" />
<DataGridTemplateColumn Header="" IsReadOnly="False"
Width="*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding Group}" TextChanged="GroupCodeInputElement_OnLostFocus" />
<!-- LostFocus="rxFreq_OnLostFocus" /> -->
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
<Label Content="本机id" Canvas.Bottom="90" Canvas.Left="15" />
<TextBox Canvas.Bottom="85" Canvas.Left="90" Text="{Binding MyId}"
TextChanged="GroupCodeInputElement_OnLostFocus" />

<Label Content="发送本机id" Canvas.Bottom="50" Canvas.Left="15" />
<ComboBox Canvas.Bottom="45" Canvas.Left="90" ItemsSource="{x:Static constants:DtmfChoice.SendID}"
SelectedIndex="{Binding PttID}" />

<Label Content="DTMF码持续时间" Canvas.Bottom="90" Canvas.Left="160" />
<ComboBox Canvas.Bottom="85" Canvas.Left="290" ItemsSource="{x:Static constants:DtmfChoice.Time}"
SelectedIndex="{Binding WordTime}" />

<Label Content="DTMF码间断时间" Canvas.Bottom="50" Canvas.Left="160" />
<ComboBox Canvas.Bottom="45" Canvas.Left="290" ItemsSource="{x:Static constants:DtmfChoice.Time}"
SelectedIndex="{Binding IdleTime}" />
</Canvas>
</Window>
Loading

0 comments on commit d812ec2

Please sign in to comment.