1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.orekit.files.ccsds.ndm.adm.apm;
19
20 import java.io.IOException;
21
22 import org.orekit.files.ccsds.definitions.Units;
23 import org.orekit.files.ccsds.section.AbstractWriter;
24 import org.orekit.files.ccsds.utils.generation.Generator;
25
26
27
28
29
30 class AngularVelocityWriter extends AbstractWriter {
31
32
33 private final AngularVelocity angularVelocity;
34
35
36
37
38
39
40 AngularVelocityWriter(final String xmlTag, final String kvnTag,
41 final AngularVelocity angularVelocity) {
42 super(xmlTag, kvnTag);
43 this.angularVelocity = angularVelocity;
44 }
45
46
47 @Override
48 protected void writeContent(final Generator generator) throws IOException {
49
50 generator.writeComments(angularVelocity.getComments());
51
52
53 generator.writeEntry(AngularVelocityKey.REF_FRAME_A.name(), angularVelocity.getEndpoints().getFrameA().getName(), null, true);
54 generator.writeEntry(AngularVelocityKey.REF_FRAME_B.name(), angularVelocity.getEndpoints().getFrameB().getName(), null, true);
55
56
57 generator.writeEntry(AngularVelocityKey.ANGVEL_FRAME.name(), angularVelocity.getFrame().getName(), null, true);
58
59
60 generator.writeEntry(AngularVelocityKey.ANGVEL_X.name(), angularVelocity.getAngVelX(), Units.DEG_PER_S, true);
61 generator.writeEntry(AngularVelocityKey.ANGVEL_Y.name(), angularVelocity.getAngVelY(), Units.DEG_PER_S, true);
62 generator.writeEntry(AngularVelocityKey.ANGVEL_Z.name(), angularVelocity.getAngVelZ(), Units.DEG_PER_S, true);
63
64 }
65
66 }