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