Skip to content

Commit d65c9c2

Browse files
committed
Fixed P25 Filtering Bug
1 parent 696d65c commit d65c9c2

File tree

7 files changed

+23
-24
lines changed

7 files changed

+23
-24
lines changed

src/CFT.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
</Compile>
106106
<Compile Include="KirisunBPEncryptionRow.cs" />
107107
<Compile Include="KirisunKeyLengthEnum.cs" />
108+
<Compile Include="P25EncryptionRow.cs" />
108109
<Compile Include="P25AESEncryptionRow.cs" />
109110
<Compile Include="P25AESEncryptionMethodForm.cs">
110111
<SubType>Form</SubType>

src/MainForm.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ private ListViewItem CreateListViewRow(ProtocolEnum filter, IEncryptionRow row)
713713
if (row.Protocol != ProtocolEnum.P25)
714714
return null;
715715

716-
var options = ((P25ADPEncryptionRow)row).ActivateOptions;
716+
var options = ((P25EncryptionRow)row).ActivateOptions;
717717

718718
var listViewSubItem0 = new ListViewItem.ListViewSubItem();
719719
listViewSubItem0.Text = options.IsActivated(P25SelectedActivateOptionsEnum.NAC) ? options.NAC.ToString() : "-";

src/P25ADPEncryptionRow.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,12 @@ namespace CFT
55
{
66
[DisplayName("P25 ADP")]
77
[Serializable]
8-
public class P25ADPEncryptionRow : BaseEncryptionRow
8+
public class P25ADPEncryptionRow : P25EncryptionRow
99
{
1010
public const int KEY_SIZE = 5;
1111

1212
public byte[] Key { get; set; }
1313

14-
public P25ActivateOptions ActivateOptions { get; set; }
15-
16-
[JsonIgnore]
17-
public override ProtocolEnum Protocol => ProtocolEnum.P25;
18-
1914
[JsonIgnore]
2015
public override string Description
2116
{
@@ -27,6 +22,5 @@ public override string Description
2722
return $"P25 ADP";
2823
}
2924
}
30-
public override bool IsFrequencyNeed => ActivateOptions == null ? true : ActivateOptions.IsActivated(P25SelectedActivateOptionsEnum.Frequency);
3125
}
3226
}

src/P25AESEncryptionRow.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,12 @@ namespace CFT
55
{
66
[DisplayName("P25 AES")]
77
[Serializable]
8-
public class P25AESEncryptionRow : BaseEncryptionRow
8+
public class P25AESEncryptionRow : P25EncryptionRow
99
{
1010
public const int KEY_SIZE = 32;
1111

1212
public byte[] Key { get; set; }
1313

14-
public P25ActivateOptions ActivateOptions { get; set; }
15-
16-
[JsonIgnore]
17-
public override ProtocolEnum Protocol => ProtocolEnum.P25;
18-
1914
[JsonIgnore]
2015
public override string Description
2116
{
@@ -27,6 +22,5 @@ public override string Description
2722
return $"P25 AES";
2823
}
2924
}
30-
public override bool IsFrequencyNeed => ActivateOptions == null ? true : ActivateOptions.IsActivated(P25SelectedActivateOptionsEnum.Frequency);
3125
}
3226
}

src/P25DESEncryptionRow.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,12 @@ namespace CFT
55
{
66
[DisplayName("P25 DES")]
77
[Serializable]
8-
public class P25DESEncryptionRow : BaseEncryptionRow
8+
public class P25DESEncryptionRow : P25EncryptionRow
99
{
1010
public const int KEY_SIZE = 8;
1111

1212
public byte[] Key { get; set; }
1313

14-
public P25ActivateOptions ActivateOptions { get; set; }
15-
16-
[JsonIgnore]
17-
public override ProtocolEnum Protocol => ProtocolEnum.P25;
18-
1914
[JsonIgnore]
2015
public override string Description
2116
{
@@ -27,6 +22,5 @@ public override string Description
2722
return $"P25 DES";
2823
}
2924
}
30-
public override bool IsFrequencyNeed => ActivateOptions == null ? true : ActivateOptions.IsActivated(P25SelectedActivateOptionsEnum.Frequency);
3125
}
3226
}

src/P25EncryptionRow.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using Newtonsoft.Json;
2+
using System;
3+
4+
namespace CFT
5+
{
6+
[Serializable]
7+
public abstract class P25EncryptionRow : BaseEncryptionRow
8+
{
9+
public P25ActivateOptions ActivateOptions { get; set; }
10+
11+
[JsonIgnore]
12+
public override ProtocolEnum Protocol => ProtocolEnum.P25;
13+
14+
public override bool IsFrequencyNeed => ActivateOptions == null ? true : ActivateOptions.IsActivated(P25SelectedActivateOptionsEnum.Frequency);
15+
}
16+
}

src/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("2.0.0.42")]
35-
[assembly: AssemblyFileVersion("2.0.0.42")]
34+
[assembly: AssemblyVersion("2.0.0.43")]
35+
[assembly: AssemblyFileVersion("2.0.0.43")]

0 commit comments

Comments
 (0)