Skip to content

Commit 83ac062

Browse files
committed
Adds the feature branch containing the new MMTC UI: a Javalin webapp built with Vue 3, Nuxt 3, and NuxtUI 4 components.
1 parent f0ac7bd commit 83ac062

File tree

143 files changed

+18246
-833
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+18246
-833
lines changed

build.gradle.kts

Lines changed: 111 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,33 @@ val createDistDir = tasks.register("createDistDir") {
6969

7070
doLast {
7171
exec {
72-
commandLine("bash", "create-dist.sh", project.version)
72+
commandLine("bash", "create-dist.sh", project.version, "cli")
7373
}
7474
}
7575

7676
outputs.dir("build/mmtc-dist-tmp")
7777
}
7878

79+
val createWebAppDistDir = tasks.register("createWebappDistDir") {
80+
inputs.files("mmtc-core/bin/mmtc")
81+
inputs.files("mmtc-core/build/libs/mmtc-core-" + project.version + "-app.jar")
82+
inputs.files("mmtc-plugin-ampcs/build/libs/mmtc-plugin-ampcs-" + project.version + ".jar")
83+
inputs.files("mmtc-webapp/build/libs/mmtc-webapp-" + project.version + ".jar")
84+
85+
dependsOn("mmtc-core:uberJar")
86+
dependsOn("mmtc-plugin-ampcs:jar")
87+
dependsOn(":userGuidePdf")
88+
dependsOn("mmtc-webapp:jar")
89+
90+
doLast {
91+
exec {
92+
commandLine("bash", "create-dist.sh", project.version, "webapp")
93+
}
94+
}
95+
96+
outputs.dir("build/mmtc-webapp-dist-tmp")
97+
}
98+
7999
val mmtcEl8Rpm = tasks.register<Rpm>("mmtcEl8Rpm") {
80100
dependsOn(tasks.build)
81101

@@ -141,6 +161,73 @@ tasks.getByName("mmtcEl9Rpm") {
141161
dependsOn(tasks.getByName("cleanMmtcEl9Rpm"))
142162
}
143163

164+
val mmtcWebAppEl8Rpm = tasks.register<Rpm>("mmtcWebAppEl8Rpm") {
165+
dependsOn(tasks.build)
166+
167+
packageName = "mmtc-webapp"
168+
distribution = "el8"
169+
release = "1.$distribution"
170+
archStr = "x86_64"
171+
os = org.redline_rpm.header.Os.LINUX
172+
173+
preInstall(file(projectDir.toPath().resolve("rpm-scripts/pre-install.sh")))
174+
postInstall(file(projectDir.toPath().resolve("rpm-scripts/post-install.sh")))
175+
176+
user(this, "mmtc")
177+
permissionGroup(this, "mmtc")
178+
179+
//make the RPM relocatable using prefix(). however, also set the default location using into();
180+
//otherwise, if you install without specifying a custom "--prefix", it gets installed in /usr
181+
//(at least that's what happened in my local testing).
182+
prefix("/opt/local/mmtc")
183+
into("/opt/local/mmtc")
184+
185+
//copy the distribution folder, preserving permissions since they're already correct.
186+
//NOTE: this doesn't seem to set *directory* permissions, so we use post-install.sh for that.
187+
from(projectDir.toPath().resolve("build/mmtc-webapp-dist-tmp"))
188+
189+
//NOTE: create-dist.sh updates bin/mmtc to point to the correct (newly installed) jar file,
190+
//so we no longer create a symlink at lib/mmtc.jar
191+
}
192+
193+
val mmtcWebAppEl9Rpm = tasks.register<Rpm>("mmtcWebAppEl9Rpm") {
194+
dependsOn(tasks.build)
195+
196+
packageName = "mmtc-webapp"
197+
distribution = "el9"
198+
release = "1.$distribution"
199+
archStr = "x86_64"
200+
os = org.redline_rpm.header.Os.LINUX
201+
202+
preInstall(file(projectDir.toPath().resolve("rpm-scripts/pre-install.sh")))
203+
postInstall(file(projectDir.toPath().resolve("rpm-scripts/post-install.sh")))
204+
205+
user(this, "mmtc")
206+
permissionGroup(this, "mmtc")
207+
208+
//make the RPM relocatable using prefix(). however, also set the default location using into();
209+
//otherwise, if you install without specifying a custom "--prefix", it gets installed in /usr
210+
//(at least that's what happened in my local testing).
211+
prefix("/opt/local/mmtc")
212+
into("/opt/local/mmtc")
213+
214+
//copy the distribution folder, preserving permissions since they're already correct.
215+
//NOTE: this doesn't seem to set *directory* permissions, so we use post-install.sh for that.
216+
from(projectDir.toPath().resolve("build/mmtc-webapp-dist-tmp"))
217+
218+
//NOTE: create-dist.sh updates bin/mmtc to point to the correct (newly installed) jar file,
219+
//so we no longer create a symlink at lib/mmtc.jar
220+
}
221+
222+
// fix for Rpm task setting incorrect digests in RPM metadata
223+
tasks.getByName("mmtcWebAppEl8Rpm") {
224+
dependsOn(tasks.getByName("cleanMmtcWebAppEl8Rpm"))
225+
}
226+
227+
tasks.getByName("mmtcWebAppEl9Rpm") {
228+
dependsOn(tasks.getByName("cleanMmtcWebAppEl9Rpm"))
229+
}
230+
144231
distributions {
145232
main {
146233
distributionBaseName.set(project.name)
@@ -150,6 +237,15 @@ distributions {
150237
}
151238
}
152239

240+
distributions {
241+
create("mmtcWebApp") {
242+
distributionBaseName.set("mmtc-webapp")
243+
contents {
244+
from("build/mmtc-webapp-dist-tmp")
245+
}
246+
}
247+
}
248+
153249
tasks.distZip {
154250
dependsOn(createDistDir)
155251
}
@@ -164,6 +260,20 @@ tasks.installDist {
164260
dependsOn(createDistDir)
165261
}
166262

263+
tasks.getByName<Zip>("mmtcWebAppDistZip") {
264+
dependsOn(createWebAppDistDir)
265+
}
266+
267+
tasks.getByName<Tar>("mmtcWebAppDistTar") {
268+
dependsOn(createWebAppDistDir)
269+
compression = Compression.GZIP
270+
archiveExtension.set("tar.gz")
271+
}
272+
273+
tasks.getByName("installMmtcWebAppDist") {
274+
dependsOn(createWebAppDistDir)
275+
}
276+
167277
val demoZip = tasks.register("demoZip") {
168278
dependsOn(tasks.build)
169279
dependsOn(createDistDir)

create-dist.sh

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
#!/bin/bash
22

3-
# only arg provided to this script must be project version string
3+
# two args provided to this script:
4+
# - project version string
5+
# - "cli" or "webapp"
46

57
set -e
68

7-
DIST_DIR=build/mmtc-dist-tmp
9+
if [ "${2}" = "webapp" ]; then
10+
DIST_DIR=build/mmtc-webapp-dist-tmp
11+
else
12+
DIST_DIR=build/mmtc-dist-tmp
13+
fi
814

915
if [[ -d $DIST_DIR ]]; then
1016
rm -r $DIST_DIR
@@ -53,3 +59,17 @@ touch $DIST_DIR/log/.keep
5359

5460
mkdir $DIST_DIR/output/
5561
touch $DIST_DIR/output/.keep
62+
63+
if [ "${2}" = "webapp" ]; then
64+
cp mmtc-webapp/bin/mmtc-webapp $DIST_DIR/bin
65+
66+
if [[ "$OSTYPE" == "darwin"* ]]; then
67+
# BSD sed
68+
sed -i '' "s|@VERSION@|${1}|" $DIST_DIR/bin/mmtc-webapp
69+
else
70+
# assume Linux (and GNU sed)
71+
sed -i "s/@VERSION@/${1}/" $DIST_DIR/bin/mmtc-webapp
72+
fi
73+
74+
cp mmtc-webapp/build/libs/mmtc-webapp-$1.jar $DIST_DIR/lib/
75+
fi

mmtc-core/bin/mmtc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@ fi
2929

3030
echo
3131

32+
if [[ -z "${MMTC_JAR+x}" ]]
33+
then
34+
export MMTC_JAR=mmtc-core-@[email protected]
35+
fi
36+
3237
exec ${JAVA_HOME}/bin/java \
3338
-jar \
3439
-Djava.library.path=${MMTC_HOME}/lib/naif/JNISpice/lib \
3540
-Dlog4j2.configurationFile=${MMTC_HOME}/conf/log4j2.xml \
36-
${MMTC_HOME}/lib/mmtc-core-@[email protected] "$@"
41+
${MMTC_HOME}/lib/${MMTC_JAR} "$@"

mmtc-core/build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ dependencies {
2222
"configuration" to "precompiledClasses"
2323
)))
2424

25+
// provides javax.xml.bind classes
26+
implementation("jakarta.xml.bind:jakarta.xml.bind-api:4.0.2")
27+
implementation("com.sun.xml.bind:jaxb-impl:4.0.2")
28+
2529
implementation("commons-beanutils:commons-beanutils:1.11.0")
2630
implementation("org.apache.commons:commons-configuration2:2.12.0")
2731
implementation("com.google.guava:guava:33.4.8-jre")

mmtc-core/src/main/java/edu/jhuapl/sd/sig/mmtc/app/MmtcCli.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import java.util.ArrayList;
1313
import java.util.Arrays;
1414
import java.util.List;
15+
import java.util.Optional;
1516

1617
public class MmtcCli {
1718
public static final Marker USER_NOTICE = MarkerManager.getMarker("USER_NOTICE");
@@ -115,7 +116,7 @@ public static void main(String[] args) {
115116
}
116117
case ROLLBACK: {
117118
try {
118-
new TimeCorrelationRollback(appInvoc.args).rollback();
119+
new TimeCorrelationRollback(appInvoc.args).rollback(Optional.empty());
119120
} catch (Exception e) {
120121
logger.fatal("Rollback failed.", e);
121122
System.exit(1);

mmtc-core/src/main/java/edu/jhuapl/sd/sig/mmtc/app/TimeCorrelationAncillaryOperations.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package edu.jhuapl.sd.sig.mmtc.app;
22

3-
import edu.jhuapl.sd.sig.mmtc.cfg.TimeCorrelationAppConfig;
3+
import edu.jhuapl.sd.sig.mmtc.cfg.TimeCorrelationRunConfig;
44
import edu.jhuapl.sd.sig.mmtc.correlation.TimeCorrelationContext;
55
import edu.jhuapl.sd.sig.mmtc.products.model.SclkKernel;
66
import edu.jhuapl.sd.sig.mmtc.products.model.TextProductException;
@@ -77,6 +77,7 @@ private double computeTdtPredictionErrorMs() throws MmtcException {
7777
double estimatedEtUsingPriorCorrelation = CSPICE.sct2e(ctx.config.getNaifSpacecraftId(), actualEncSclk);
7878
double estimatedTdtUsingPriorCorrelation = CSPICE.unitim(estimatedEtUsingPriorCorrelation, "ET", "TDT");
7979
return (estimatedTdtUsingPriorCorrelation - actualTdt) * TimeConvert.MSEC_PER_SECOND;
80+
// experimental == estimated - actual/accepted
8081
} catch (SpiceErrorException ex) {
8182
throw new MmtcException("Unable to compute TDT error: " + ex.getMessage(), ex);
8283
}
@@ -115,7 +116,7 @@ private void retrieveAndComputeGncParams() throws MmtcException, TimeConvertExce
115116
logger.info("Retrieving GNC parameter values and calculating related metrics");
116117

117118
// create local refs for brevity throughout the rest of this method
118-
final TimeCorrelationAppConfig config = ctx.config;
119+
final TimeCorrelationRunConfig config = ctx.config;
119120
final TelemetrySource tlmSource = ctx.telemetrySource;
120121
// final FrameSample targetSample = ctx.correlation.target.get().getTargetSample();
121122
final TimeCorrelationTarget tcTarget = ctx.correlation.target.get();
@@ -252,7 +253,7 @@ private double computeTdtSErrorMs(TelemetrySource.GncParms gncParms, Double curr
252253
* @throws MmtcException if the state vector could not be computed
253254
*/
254255
private double[] computeTargetState(String target, String observer) throws TimeConvertException, MmtcException {
255-
final TimeCorrelationAppConfig config = ctx.config;
256+
final TimeCorrelationRunConfig config = ctx.config;
256257
final FrameSample targetSample = ctx.correlation.target.get().getTargetSample();
257258

258259
final String corr = "NONE"; // Aberration correction

0 commit comments

Comments
 (0)