Skip to content

Commit 26117cf

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 3690cbc commit 26117cf

File tree

149 files changed

+18265
-846
lines changed

Some content is hidden

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

149 files changed

+18265
-846
lines changed

build.gradle.kts

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

6464
doLast {
6565
exec {
66-
commandLine("bash", "create-dist.sh", project.version)
66+
commandLine("bash", "create-dist.sh", project.version, "cli")
6767
}
6868
}
6969

7070
outputs.dir("build/mmtc-dist-tmp")
7171
}
7272

73+
val createWebAppDistDir = tasks.register("createWebappDistDir") {
74+
inputs.files("mmtc-core/bin/mmtc")
75+
inputs.files("mmtc-core/build/libs/mmtc-core-" + project.version + "-app.jar")
76+
inputs.files("mmtc-plugin-ampcs/build/libs/mmtc-plugin-ampcs-" + project.version + ".jar")
77+
inputs.files("mmtc-webapp/build/libs/mmtc-webapp-" + project.version + ".jar")
78+
79+
dependsOn("mmtc-core:uberJar")
80+
dependsOn("mmtc-plugin-ampcs:jar")
81+
dependsOn(":userGuidePdf")
82+
dependsOn("mmtc-webapp:jar")
83+
84+
doLast {
85+
exec {
86+
commandLine("bash", "create-dist.sh", project.version, "webapp")
87+
}
88+
}
89+
90+
outputs.dir("build/mmtc-webapp-dist-tmp")
91+
}
92+
7393
val mmtcEl8Rpm = tasks.register<Rpm>("mmtcEl8Rpm") {
7494
dependsOn(tasks.build)
7595

@@ -135,6 +155,73 @@ tasks.getByName("mmtcEl9Rpm") {
135155
dependsOn(tasks.getByName("cleanMmtcEl9Rpm"))
136156
}
137157

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

234+
distributions {
235+
create("mmtcWebApp") {
236+
distributionBaseName.set("mmtc-webapp")
237+
contents {
238+
from("build/mmtc-webapp-dist-tmp")
239+
}
240+
}
241+
}
242+
147243
tasks.distZip {
148244
dependsOn(createDistDir)
149245
}
@@ -158,6 +254,20 @@ tasks.installDist {
158254
dependsOn(createDistDir)
159255
}
160256

257+
tasks.getByName<Zip>("mmtcWebAppDistZip") {
258+
dependsOn(createWebAppDistDir)
259+
}
260+
261+
tasks.getByName<Tar>("mmtcWebAppDistTar") {
262+
dependsOn(createWebAppDistDir)
263+
compression = Compression.GZIP
264+
archiveExtension.set("tar.gz")
265+
}
266+
267+
tasks.getByName("installMmtcWebAppDist") {
268+
dependsOn(createWebAppDistDir)
269+
}
270+
161271
val demoZip = tasks.register("demoZip") {
162272
dependsOn(tasks.build)
163273
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: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,21 @@ val precompiledJniSpiceClasses by configurations.creating {
1111
isCanBeResolved = true
1212
}
1313

14+
java {
15+
sourceCompatibility = JavaVersion.VERSION_1_8
16+
targetCompatibility = JavaVersion.VERSION_1_8
17+
}
18+
1419
dependencies {
1520
precompiledJniSpiceClasses(project(mapOf(
1621
"path" to ":jnispice",
1722
"configuration" to "precompiledClasses"
1823
)))
1924

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+
2029
implementation("commons-beanutils:commons-beanutils:1.11.0")
2130
implementation("org.apache.commons:commons-configuration2:2.12.0")
2231
implementation("com.google.guava:guava:33.4.8-jre")
@@ -82,7 +91,8 @@ val uberJar = tasks.register<Jar>("uberJar") {
8291
"Main-Class" to "edu.jhuapl.sd.sig.mmtc.app.MmtcCli",
8392
"Build-Date" to Instant.now().toString(),
8493
"Implementation-Version" to project.version,
85-
"Implementation-Title" to project.name
94+
"Implementation-Title" to project.name,
95+
"Multi-Release" to "true"
8696
)
8797
}
8898
}

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)