1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.orekit.files.ccsds.ndm.odm.ocm;
18
19 import org.orekit.files.ccsds.definitions.DutyCycleType;
20 import org.orekit.files.ccsds.utils.ContextBinding;
21 import org.orekit.files.ccsds.utils.lexical.ParseToken;
22 import org.orekit.files.ccsds.utils.lexical.TokenType;
23 import org.orekit.utils.units.Unit;
24
25
26
27
28
29
30 public enum ManeuverHistoryMetadataKey {
31
32
33 COMMENT((token, context, container) ->
34 token.getType() == TokenType.ENTRY ? container.addComment(token.getContentAsNormalizedString()) : true),
35
36
37 MAN_ID((token, context, container) -> token.processAsNormalizedString(container::setManID)),
38
39
40 MAN_PREV_ID((token, context, container) -> token.processAsNormalizedString(container::setManPrevID)),
41
42
43 MAN_NEXT_ID((token, context, container) -> token.processAsNormalizedString(container::setManNextID)),
44
45
46 MAN_BASIS((token, context, container) -> token.processAsEnum(ManBasis.class, container::setManBasis)),
47
48
49 MAN_BASIS_ID((token, context, container) -> token.processAsNormalizedString(container::setManBasisID)),
50
51
52 MAN_DEVICE_ID((token, context, container) -> token.processAsNormalizedString(container::setManDeviceID)),
53
54
55 MAN_PREV_EPOCH((token, context, container) -> token.processAsDate(container::setManPrevEpoch, context)),
56
57
58 MAN_NEXT_EPOCH((token, context, container) -> token.processAsDate(container::setManNextEpoch, context)),
59
60
61 MAN_PURPOSE((token, context, container) -> token.processAsNormalizedList(container::setManPurpose)),
62
63
64 MAN_PRED_SOURCE((token, context, container) -> token.processAsNormalizedString(container::setManPredSource)),
65
66
67 MAN_REF_FRAME((token, context, container) -> token.processAsFrame(container::setManReferenceFrame, context, true, true, false)),
68
69
70 MAN_FRAME_EPOCH((token, context, container) -> token.processAsDate(container::setManFrameEpoch, context)),
71
72
73 GRAV_ASSIST_NAME((token, context, container) -> token.processAsCenter(container::setGravitationalAssist,
74 context.getDataContext().getCelestialBodies())),
75
76
77 DC_TYPE((token, context, container) -> token.processAsEnum(DutyCycleType.class, container::setDcType)),
78
79
80 DC_WIN_OPEN((token, context, container) -> token.processAsDate(container::setDcWindowOpen, context)),
81
82
83 DC_WIN_CLOSE((token, context, container) -> token.processAsDate(container::setDcWindowClose, context)),
84
85
86 DC_MIN_CYCLES((token, context, container) -> token.processAsInteger(container::setDcMinCycles)),
87
88
89 DC_MAX_CYCLES((token, context, container) -> token.processAsInteger(container::setDcMaxCycles)),
90
91
92 DC_EXEC_START((token, context, container) -> token.processAsDate(container::setDcExecStart, context)),
93
94
95 DC_EXEC_STOP((token, context, container) -> token.processAsDate(container::setDcExecStop, context)),
96
97
98 DC_REF_TIME((token, context, container) -> token.processAsDate(container::setDcRefTime, context)),
99
100
101 DC_TIME_PULSE_DURATION((token, context, container) -> token.processAsDouble(Unit.SECOND, context.getParsedUnitsBehavior(),
102 container::setDcTimePulseDuration)),
103
104
105 DC_TIME_PULSE_PERIOD((token, context, container) -> token.processAsDouble(Unit.SECOND, context.getParsedUnitsBehavior(),
106 container::setDcTimePulsePeriod)),
107
108
109 DC_REF_DIR((token, context, container) -> token.processAsVector(container::setDcRefDir)),
110
111
112 DC_BODY_FRAME((token, context, container) -> token.processAsFrame(f -> container.setDcBodyFrame(f.asSpacecraftBodyFrame()),
113 context, false, false, true)),
114
115
116 DC_BODY_TRIGGER((token, context, container) -> token.processAsVector(container::setDcBodyTrigger)),
117
118
119 DC_PA_START_ANGLE((token, context, container) -> token.processAsDouble(Unit.DEGREE, context.getParsedUnitsBehavior(),
120 container::setDcPhaseStartAngle)),
121
122
123 DC_PA_STOP_ANGLE((token, context, container) -> token.processAsDouble(Unit.DEGREE, context.getParsedUnitsBehavior(),
124 container::setDcPhaseStopAngle)),
125
126
127 MAN_COMPOSITION((token, context, container) -> token.processAsEnumsList(ManeuverFieldType.class, container::setManComposition)),
128
129
130 MAN_UNITS((token, context, container) -> token.processAsUnitList(container::setManUnits));
131
132
133 private final TokenProcessor processor;
134
135
136
137
138 ManeuverHistoryMetadataKey(final TokenProcessor processor) {
139 this.processor = processor;
140 }
141
142
143
144
145
146
147
148 public boolean process(final ParseToken token, final ContextBinding context, final ManeuverHistoryMetadata container) {
149 return processor.process(token, context, container);
150 }
151
152
153 interface TokenProcessor {
154
155
156
157
158
159
160 boolean process(ParseToken token, ContextBinding context, ManeuverHistoryMetadata container);
161 }
162
163 }