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