From fad66d2f512db218cf2d0ad2bbf9130f7f935c77 Mon Sep 17 00:00:00 2001 From: Guylaine Prat <guylaine.prat@c-s.fr> Date: Fri, 8 Dec 2017 16:54:16 +0100 Subject: [PATCH] Update pom.xml to compile from sources zip (no git directory) and to be similar to Orekit. --- pom.xml | 70 +++++++++++-------- ...nterSensorsOptimizationProblemBuilder.java | 34 ++++----- .../adjustment/measurements/Observables.java | 3 - 3 files changed, 57 insertions(+), 50 deletions(-) diff --git a/pom.xml b/pom.xml index 1ac04bc9..8726fcb5 100644 --- a/pom.xml +++ b/pom.xml @@ -216,21 +216,6 @@ <compilerArgument>-Xlint:deprecation</compilerArgument> </configuration> </plugin> - <plugin> - <groupId>ru.concerteza.buildnumber</groupId> - <artifactId>maven-jgit-buildnumber-plugin</artifactId> - <version>${rugged.jgit.buildnumber.version}</version> - <executions> - <execution> - <phase>prepare-package</phase> - <goals> - <goal>extract-buildnumber</goal> - </goals> - </execution> - </executions> - <configuration> - </configuration> - </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> @@ -239,7 +224,6 @@ <archive> <manifestFile>${project.build.directory}/osgi/MANIFEST.MF</manifestFile> <manifestEntries> - <Implementation-Build>${rugged.implementation.build}</Implementation-Build> <X-Compile-Source-JDK>${rugged.compiler.source}</X-Compile-Source-JDK> <X-Compile-Target-JDK>${rugged.compiler.target}</X-Compile-Target-JDK> </manifestEntries> @@ -256,15 +240,6 @@ <descriptor>src/main/assembly/source-jar-assembly.xml</descriptor> </descriptors> </configuration> - <executions> - <execution> - <id>make-assembly</id> - <phase>package</phase> - <goals> - <goal>single</goal> - </goals> - </execution> - </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -414,9 +389,6 @@ </execution> </executions> </plugin> - - - <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> @@ -565,6 +537,48 @@ </reporting> <profiles> + <profile> + <id>git</id> + <activation> + <file> + <exists>.git</exists> + </file> + </activation> + <build> + <plugins> + <plugin> + <groupId>ru.concerteza.buildnumber</groupId> + <artifactId>maven-jgit-buildnumber-plugin</artifactId> + <version>${rugged.jgit.buildnumber.version}</version> + <executions> + <execution> + <phase>prepare-package</phase> + <goals> + <goal>extract-buildnumber</goal> + </goals> + </execution> + </executions> + <configuration> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>${rugged.maven-jar-plugin.version}</version> + <configuration> + <archive> + <manifestFile>${project.build.directory}/osgi/MANIFEST.MF</manifestFile> + <manifestEntries> + <Implementation-Build>${rugged.implementation.build}</Implementation-Build> + <X-Compile-Source-JDK>${rugged.compiler.source}</X-Compile-Source-JDK> + <X-Compile-Target-JDK>${rugged.compiler.target}</X-Compile-Target-JDK> + </manifestEntries> + </archive> + </configuration> + </plugin> + </plugins> + </build> + </profile> <profile> <id>release</id> <build> diff --git a/src/main/java/org/orekit/rugged/adjustment/InterSensorsOptimizationProblemBuilder.java b/src/main/java/org/orekit/rugged/adjustment/InterSensorsOptimizationProblemBuilder.java index 580b2fd0..41dd778e 100644 --- a/src/main/java/org/orekit/rugged/adjustment/InterSensorsOptimizationProblemBuilder.java +++ b/src/main/java/org/orekit/rugged/adjustment/InterSensorsOptimizationProblemBuilder.java @@ -228,25 +228,21 @@ public class InterSensorsOptimizationProblemBuilder extends OptimizationProblemB ruggedB.distanceBetweenLOSderivatives(lineSensorA, dateA, pixelA, scToBodyA, lineSensorB, dateB, pixelB, this.getGenerator()); - if (ilResult == null) { - // TODO GP manque code - } else { - // extract the value - value.setEntry(l, ilResult[0].getValue()); - value.setEntry(l + 1, ilResult[1].getValue()); - - // extract the Jacobian - final int[] orders = new int[this.getNbParams()]; - int m = 0; - - for (final ParameterDriver driver : this.getDrivers()) { - final double scale = driver.getScale(); - orders[m] = 1; - jacobian.setEntry(l, m, ilResult[0].getPartialDerivative(orders) * scale); - jacobian.setEntry(l + 1, m, ilResult[1].getPartialDerivative(orders) * scale); - orders[m] = 0; - m++; - } + // extract the value + value.setEntry(l, ilResult[0].getValue()); + value.setEntry(l + 1, ilResult[1].getValue()); + + // extract the Jacobian + final int[] orders = new int[this.getNbParams()]; + int m = 0; + + for (final ParameterDriver driver : this.getDrivers()) { + final double scale = driver.getScale(); + orders[m] = 1; + jacobian.setEntry(l, m, ilResult[0].getPartialDerivative(orders) * scale); + jacobian.setEntry(l + 1, m, ilResult[1].getPartialDerivative(orders) * scale); + orders[m] = 0; + m++; } l += 2; // pass to the next evaluation diff --git a/src/main/java/org/orekit/rugged/adjustment/measurements/Observables.java b/src/main/java/org/orekit/rugged/adjustment/measurements/Observables.java index ee039013..845a1c2d 100644 --- a/src/main/java/org/orekit/rugged/adjustment/measurements/Observables.java +++ b/src/main/java/org/orekit/rugged/adjustment/measurements/Observables.java @@ -121,7 +121,6 @@ public class Observables { public SensorToSensorMapping getInterMapping(final String ruggedNameA, final String sensorNameA, final String ruggedNameB, final String sensorNameB) { - //TODO GP revoir la creation de string par "+" final String keyA = ruggedNameA + RUGGED_SENSOR_SEPARATOR + sensorNameA; final String keyB = ruggedNameB + RUGGED_SENSOR_SEPARATOR + sensorNameB; final SensorToSensorMapping mapping = interMappings.get(keyA + SENSORS_SEPARATOR + keyB); @@ -134,7 +133,6 @@ public class Observables { */ private String createKey(final SensorToGroundMapping groundMapping) { - //TODO GP revoir la creation de string par "+" final String key = groundMapping.getRuggedName() + RUGGED_SENSOR_SEPARATOR + groundMapping.getSensorName(); return key; } @@ -145,7 +143,6 @@ public class Observables { */ private String createKey(final SensorToSensorMapping sensorMapping) { - //TODO GP revoir la creation de string par "+" final String keyA = sensorMapping.getRuggedNameA() + RUGGED_SENSOR_SEPARATOR + sensorMapping.getSensorNameA(); final String keyB = sensorMapping.getRuggedNameB() + RUGGED_SENSOR_SEPARATOR + sensorMapping.getSensorNameB(); return keyA + SENSORS_SEPARATOR + keyB; -- GitLab