1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.orekit.files.sinex;
18
19 import org.orekit.time.AbsoluteDate;
20 import org.orekit.utils.Constants;
21
22 import java.util.function.Predicate;
23
24
25
26
27
28 enum StationPredicate implements Predicate<SinexParseInfo> {
29
30
31 STAX {
32
33 @Override
34 protected void store(final SinexParseInfo parseInfo, final double coordinate, final Station station,
35 final AbsoluteDate epoch) {
36 parseInfo.setPx(coordinate, station, epoch);
37 }
38 },
39
40
41 STAY {
42
43 @Override
44 protected void store(final SinexParseInfo parseInfo, final double coordinate, final Station station,
45 final AbsoluteDate epoch) {
46 parseInfo.setPy(coordinate, station, epoch);
47 }
48 },
49
50
51 STAZ {
52
53 @Override
54 protected void store(final SinexParseInfo parseInfo, final double coordinate, final Station station,
55 final AbsoluteDate epoch) {
56 parseInfo.setPz(coordinate, station, epoch);
57 }
58 },
59
60
61 VELX {
62
63 @Override
64 protected void store(final SinexParseInfo parseInfo, final double coordinate, final Station station,
65 final AbsoluteDate epoch) {
66 parseInfo.setVx(coordinate / Constants.JULIAN_YEAR, station);
67 }
68 },
69
70
71 VELY {
72
73 @Override
74 protected void store(final SinexParseInfo parseInfo, final double coordinate, final Station station,
75 final AbsoluteDate epoch) {
76 parseInfo.setVy(coordinate / Constants.JULIAN_YEAR, station);
77 }
78 },
79
80
81 VELZ {
82
83 @Override
84 protected void store(final SinexParseInfo parseInfo, final double coordinate, final Station station,
85 final AbsoluteDate epoch) {
86 parseInfo.setVz(coordinate / Constants.JULIAN_YEAR, station);
87 }
88 };
89
90
91 @Override
92 public boolean test(final SinexParseInfo parseInfo) {
93 if (name().equals(parseInfo.parseString(7, 6))) {
94
95 store(parseInfo, parseInfo.parseDouble(47, 22),
96 parseInfo.getCurrentLineStation(14),
97 parseInfo.stringEpochToAbsoluteDate(parseInfo.parseString(27, 12), false));
98 return true;
99 } else {
100
101 return false;
102 }
103 }
104
105
106
107
108
109
110
111 protected abstract void store(SinexParseInfo parseInfo, double coordinate, Station station, AbsoluteDate epoch);
112
113 }