Commit 62775ba5 authored by Luc Maisonobe's avatar Luc Maisonobe

Fixed orb/cov/man lines in OCM XML writer.

parent dfae5199
......@@ -24,6 +24,7 @@ import org.hipparchus.linear.RealMatrix;
import org.orekit.files.ccsds.definitions.TimeConverter;
import org.orekit.files.ccsds.definitions.Units;
import org.orekit.files.ccsds.section.AbstractWriter;
import org.orekit.files.ccsds.utils.FileFormat;
import org.orekit.files.ccsds.utils.generation.Generator;
import org.orekit.utils.AccurateFormatter;
import org.orekit.utils.units.Unit;
......@@ -90,8 +91,12 @@ class CovarianceHistoryWriter extends AbstractWriter {
line.append(' ');
line.append(AccurateFormatter.format(units.get(i).fromSI(units.get(j).fromSI(matrix.getEntry(i, j)))));
}
generator.writeRawData(line);
generator.newLine();
if (generator.getFormat() == FileFormat.XML) {
generator.writeEntry(OcmFile.COV_LINE, line.toString(), true);
} else {
generator.writeRawData(line);
generator.newLine();
}
}
}
......
......@@ -23,6 +23,7 @@ import java.util.List;
import org.orekit.files.ccsds.definitions.TimeConverter;
import org.orekit.files.ccsds.definitions.Units;
import org.orekit.files.ccsds.section.AbstractWriter;
import org.orekit.files.ccsds.utils.FileFormat;
import org.orekit.files.ccsds.utils.generation.Generator;
import org.orekit.utils.AccurateFormatter;
import org.orekit.utils.units.Unit;
......@@ -75,7 +76,9 @@ class ManeuverHistoryWriter extends AbstractWriter {
generator.writeEntry(ManeuverHistoryMetadataKey.MAN_PRED_SOURCE.name(), metadata.getManPredSource(), false);
generator.writeEntry(ManeuverHistoryMetadataKey.MAN_REF_FRAME.name(), metadata.getManReferenceFrame().getName(), false);
generator.writeEntry(ManeuverHistoryMetadataKey.MAN_FRAME_EPOCH.name(), timeConverter, metadata.getManFrameEpoch(), false);
generator.writeEntry(ManeuverHistoryMetadataKey.GRAV_ASSIST_NAME.name(), metadata.getGravitationalAssist().getName(), false);
if (metadata.getGravitationalAssist() != null) {
generator.writeEntry(ManeuverHistoryMetadataKey.GRAV_ASSIST_NAME.name(), metadata.getGravitationalAssist().getName(), false);
}
// duty cycle
generator.writeEntry(ManeuverHistoryMetadataKey.DC_TYPE.name(), metadata.getDcType(), false);
......@@ -126,8 +129,12 @@ class ManeuverHistoryWriter extends AbstractWriter {
}
line.append(types.get(i).outputField(timeConverter, maneuver));
}
generator.writeRawData(line);
generator.newLine();
if (generator.getFormat() == FileFormat.XML) {
generator.writeEntry(OcmFile.MAN_LINE, line.toString(), true);
} else {
generator.writeRawData(line);
generator.newLine();
}
}
}
......
......@@ -23,6 +23,7 @@ import java.util.List;
import org.orekit.files.ccsds.definitions.TimeConverter;
import org.orekit.files.ccsds.definitions.Units;
import org.orekit.files.ccsds.section.AbstractWriter;
import org.orekit.files.ccsds.utils.FileFormat;
import org.orekit.files.ccsds.utils.generation.Generator;
import org.orekit.utils.AccurateFormatter;
import org.orekit.utils.units.Unit;
......@@ -93,8 +94,12 @@ class OrbitStateHistoryWriter extends AbstractWriter {
line.append(' ');
line.append(AccurateFormatter.format(units.get(i).fromSI(elements[i])));
}
generator.writeRawData(line);
generator.newLine();
if (generator.getFormat() == FileFormat.XML) {
generator.writeEntry(OcmFile.ORB_LINE, line.toString(), true);
} else {
generator.writeRawData(line);
generator.newLine();
}
}
}
......
......@@ -881,7 +881,9 @@ public class OcmParserTest {
// TODO test perturbation data
// TODO test user data
// test user data
Assert.assertEquals(1, file.getData().getUserDefinedBlock().getParameters().size());
Assert.assertEquals("OREKIT", file.getData().getUserDefinedBlock().getParameters().get("LIBRARY"));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment