HamBook – Blame information for rev 44
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
44 | office | 1 | using HamBook.Radios.Generic; |
2 | using System; |
||
3 | using System.Collections.Generic; |
||
4 | using System.Linq; |
||
5 | using System.Text; |
||
6 | using System.Threading.Tasks; |
||
7 | |||
8 | namespace HamBook.Radios.Yaesu.FT_891 |
||
9 | { |
||
10 | public class MemoryRadioMode : Generic.MemoryRadioMode |
||
11 | { |
||
12 | public override char Code { get; } |
||
13 | |||
14 | public override string Name { get; } |
||
15 | |||
16 | public MemoryRadioMode(string name) |
||
17 | { |
||
18 | Name = name; |
||
19 | Code = NameToCode(name); |
||
20 | } |
||
21 | |||
22 | public MemoryRadioMode(char code) |
||
23 | { |
||
24 | Code = code; |
||
25 | Name = CodeToName(code); |
||
26 | } |
||
27 | |||
28 | public override char NameToCode(string name) |
||
29 | { |
||
30 | switch (name) |
||
31 | { |
||
32 | case "LSB": |
||
33 | return '1'; |
||
34 | case "USB": |
||
35 | return '2'; |
||
36 | case "CW": |
||
37 | return '3'; |
||
38 | case "FM": |
||
39 | return '4'; |
||
40 | case "AM": |
||
41 | return '5'; |
||
42 | case "RTTY-LSB": |
||
43 | return '6'; |
||
44 | case "CW-R": |
||
45 | return '7'; |
||
46 | case "DATA-LSB": |
||
47 | return '8'; |
||
48 | case "RTTY-USB": |
||
49 | return '9'; |
||
50 | case "FM-N": |
||
51 | return 'B'; |
||
52 | case "DATA-USB": |
||
53 | return 'C'; |
||
54 | case "AM-N": |
||
55 | return 'D'; |
||
56 | default: |
||
57 | throw new ArgumentException(); |
||
58 | } |
||
59 | } |
||
60 | |||
61 | public override string CodeToName(char code) |
||
62 | { |
||
63 | switch (code) |
||
64 | { |
||
65 | case '1': |
||
66 | return "LSB"; |
||
67 | case '2': |
||
68 | return "USB"; |
||
69 | case '3': |
||
70 | return "CW"; |
||
71 | case '4': |
||
72 | return "FM"; |
||
73 | case '5': |
||
74 | return "AM"; |
||
75 | case '6': |
||
76 | return "RTTY-USB"; |
||
77 | case '7': |
||
78 | return "CW-R"; |
||
79 | case '8': |
||
80 | return "DATA-LSB"; |
||
81 | case '9': |
||
82 | return "RTTY-USB"; |
||
83 | case 'B': |
||
84 | return "FM-N"; |
||
85 | case 'C': |
||
86 | return "DATA-USB"; |
||
87 | case 'D': |
||
88 | return "AM-N"; |
||
89 | default: |
||
90 | throw new ArgumentException(); |
||
91 | } |
||
92 | } |
||
93 | } |
||
94 | } |