diff --git a/README.md b/README.md
index a15429fb..378d96f4 100644
--- a/README.md
+++ b/README.md
@@ -51,19 +51,19 @@ mvn clean install
#### **As a single runnable JAR**
```shell
-java -jar coda-calibration/calibration-standalone/target/calibration-standalone-1.0.18-runnable.jar
+java -jar coda-calibration/calibration-standalone/target/calibration-standalone-1.0.19-runnable.jar
```
#### **GUI alone**
```shell
-java -jar coda-calibration/calibration-gui/target/calibration-gui-1.0.18-runnable.jar
+java -jar coda-calibration/calibration-gui/target/calibration-gui-1.0.19-runnable.jar
```
#### **Calibration REST service alone**
```shell
-java -jar coda-calibration/calibration-service/application/target/application-1.0.18-runnable.jar
+java -jar coda-calibration/calibration-service/application/target/application-1.0.19-runnable.jar
```
#### A note about HTTPS
@@ -188,4 +188,4 @@ The `Coda Calibration Tool` is provided under the [Apache License](LICENSE.txt).
by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344.
```
-`LLNL-CODE-743439`
+`LLNL-CODE-743439, LLNL-CODE-848318`
diff --git a/calibration-gui/pom.xml b/calibration-gui/pom.xml
index b87cb44d..4a2ac8a0 100644
--- a/calibration-gui/pom.xml
+++ b/calibration-gui/pom.xml
@@ -5,7 +5,7 @@
gov.llnl.gnem.apps.coda.calibration
coda-calibration
- 1.0.18.3
+ 1.0.19
calibration-gui
diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/AppProperties.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/AppProperties.java
index 52ceba8b..50976962 100644
--- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/AppProperties.java
+++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/AppProperties.java
@@ -2,11 +2,11 @@
* Copyright (c) 2018, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory
* CODE-743439.
* All rights reserved.
-* This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool.
-*
+* This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool.
+*
* Licensed under the Apache License, Version 2.0 (the “Licensee”); you may not use this file except in compliance with the License. You may obtain a copy of the License at:
* http://www.apache.org/licenses/LICENSE-2.0
-* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and limitations under the license.
*
* This work was performed under the auspices of the U.S. Department of Energy
@@ -25,8 +25,7 @@
@Component
@ConfigurationProperties("app")
public class AppProperties {
-
- private String baseTitle = "Coda Calibration";
+ private String baseTitle = "";
private Integer height = 800;
private Integer width = 600;
private Boolean debugEnabled = Boolean.FALSE;
diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/CodaGuiController.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/CodaGuiController.java
index 5a7e3c80..c4659406 100644
--- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/CodaGuiController.java
+++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/CodaGuiController.java
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2018, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory
+* Copyright (c) 2023, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory
* CODE-743439.
* All rights reserved.
* This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool.
@@ -25,7 +25,6 @@
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
-import java.util.function.Consumer;
import javax.annotation.PreDestroy;
import javax.net.ssl.HostnameVerifier;
@@ -40,15 +39,16 @@
import com.google.common.eventbus.EventBus;
import com.google.common.eventbus.Subscribe;
+import gov.llnl.gnem.apps.coda.calibration.gui.GuiApplication.ApplicationMode;
import gov.llnl.gnem.apps.coda.calibration.gui.controllers.CodaParamLoadingController;
import gov.llnl.gnem.apps.coda.calibration.gui.controllers.DataController;
import gov.llnl.gnem.apps.coda.calibration.gui.controllers.EnvelopeLoadingController;
+import gov.llnl.gnem.apps.coda.calibration.gui.controllers.EventTabController;
import gov.llnl.gnem.apps.coda.calibration.gui.controllers.MapListeningController;
import gov.llnl.gnem.apps.coda.calibration.gui.controllers.MeasuredMwsController;
import gov.llnl.gnem.apps.coda.calibration.gui.controllers.PathController;
import gov.llnl.gnem.apps.coda.calibration.gui.controllers.ReferenceEventLoadingController;
import gov.llnl.gnem.apps.coda.calibration.gui.controllers.RefreshableController;
-import gov.llnl.gnem.apps.coda.calibration.gui.controllers.ScreenshotEnabledController;
import gov.llnl.gnem.apps.coda.calibration.gui.controllers.ShapeController;
import gov.llnl.gnem.apps.coda.calibration.gui.controllers.SiteController;
import gov.llnl.gnem.apps.coda.calibration.gui.controllers.parameters.ParametersController;
@@ -59,19 +59,23 @@
import gov.llnl.gnem.apps.coda.calibration.gui.events.MapIconActivationCallback;
import gov.llnl.gnem.apps.coda.calibration.gui.events.MapPolygonChangeHandler;
import gov.llnl.gnem.apps.coda.calibration.gui.events.UpdateMapPolygonEvent;
+import gov.llnl.gnem.apps.coda.calibration.gui.plotting.CertLeafletMapController;
+import gov.llnl.gnem.apps.coda.calibration.gui.plotting.LeafletMapController;
import gov.llnl.gnem.apps.coda.calibration.gui.plotting.WaveformGui;
import gov.llnl.gnem.apps.coda.calibration.gui.util.CalibrationProgressListener;
import gov.llnl.gnem.apps.coda.calibration.gui.util.FileDialogs;
import gov.llnl.gnem.apps.coda.calibration.model.messaging.CalibrationStatusEvent;
import gov.llnl.gnem.apps.coda.calibration.model.messaging.CalibrationStatusEvent.Status;
+import gov.llnl.gnem.apps.coda.calibration.model.messaging.RatioStatusEvent;
import gov.llnl.gnem.apps.coda.common.gui.controllers.ProgressGui;
import gov.llnl.gnem.apps.coda.common.gui.data.client.api.WaveformClient;
import gov.llnl.gnem.apps.coda.common.gui.events.ShowFailureReportEvent;
import gov.llnl.gnem.apps.coda.common.gui.util.ProgressMonitor;
import gov.llnl.gnem.apps.coda.common.gui.util.SnapshotUtils;
-import gov.llnl.gnem.apps.coda.common.mapping.api.GeoMap;
import gov.llnl.gnem.apps.coda.common.model.domain.Pair;
import gov.llnl.gnem.apps.coda.envelope.gui.EnvelopeGuiController;
+import gov.llnl.gnem.apps.coda.spectra.gui.RatioStatusProgressListener;
+import gov.llnl.gnem.apps.coda.spectra.gui.SpectraRatioGuiController;
import javafx.application.Platform;
import javafx.concurrent.Worker;
import javafx.event.ActionEvent;
@@ -99,15 +103,21 @@ public class CodaGuiController {
private static final Logger log = LoggerFactory.getLogger(CodaGuiController.class);
+ private static final String SCREENSHOT_TITLE = "CERT_Screenshot";
+
@FXML
private Node rootElement;
+ private LeafletMapController cctMapController;
+ private CertLeafletMapController certMapController;
private WaveformGui waveformGui;
private DataController data;
private ParametersController param;
private ShapeController shape;
private PathController path;
private SiteController site;
+ private EventTabController eventTableController;
+ private SpectraRatioGuiController spectraGui;
private MeasuredMwsController measuredMws;
@FXML
@@ -131,29 +141,29 @@ public class CodaGuiController {
@FXML
private Tab measuredMwsTab;
- private Runnable activeTabRefresh;
- private Consumer activeTabScreenshot;
-
@FXML
private Button showMapButton;
@FXML
private Button refreshButton;
+ @FXML
+ private Button centerMapBtn;
+
@FXML
private Button snapshotButton;
@FXML
private CheckMenuItem waveformFocus;
+ private Runnable activeTabRefresh;
+
private EnvelopeGuiController envelopeGui;
private Label activeMapIcon;
private Label showMapIcon;
- private GeoMap mapController;
-
private WaveformClient waveformClient;
private ParameterClient configClient;
@@ -185,7 +195,8 @@ public class CodaGuiController {
private ProgressGui loadingGui;
- private Map monitors = new HashMap<>();
+ private Map calibrationMonitors = new HashMap<>();
+ private Map ratioMonitors = new HashMap<>();
private ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor(r -> {
Thread thread = new Thread(r);
@@ -205,12 +216,14 @@ public class CodaGuiController {
private SSLContext sslContext;
@Autowired
- public CodaGuiController(GeoMap mapController, WaveformClient waveformClient, EnvelopeLoadingController waveformLoadingController, CodaParamLoadingController codaParamLoadingController,
- ReferenceEventLoadingController refEventLoadingController, CalibrationClient calibrationClient, ParamExporter paramExporter, WaveformGui waveformGui, DataController data,
- ParametersController param, ShapeController shape, PathController path, SiteController site, MeasuredMwsController measuredMws, ParameterClient configClient,
- EnvelopeGuiController envelopeGui, HostnameVerifier hostnameVerifier, SSLContext sslContext, Environment env, EventBus bus) {
- this.mapController = mapController;
+ public CodaGuiController(LeafletMapController cctMapController, CertLeafletMapController certMapController, WaveformClient waveformClient, EnvelopeLoadingController waveformLoadingController,
+ CodaParamLoadingController codaParamLoadingController, ReferenceEventLoadingController refEventLoadingController, CalibrationClient calibrationClient, ParamExporter paramExporter,
+ WaveformGui waveformGui, DataController data, ParametersController param, ShapeController shape, PathController path, SiteController site, EventTabController certEventTab,
+ MeasuredMwsController measuredMws, ParameterClient configClient, EnvelopeGuiController envelopeGui, SpectraRatioGuiController spectraGui, HostnameVerifier hostnameVerifier,
+ SSLContext sslContext, Environment env, EventBus bus) {
this.waveformClient = waveformClient;
+ this.cctMapController = cctMapController;
+ this.certMapController = certMapController;
this.envelopeLoadingController = waveformLoadingController;
this.codaParamLoadingController = codaParamLoadingController;
this.refEventLoadingController = refEventLoadingController;
@@ -222,10 +235,11 @@ public CodaGuiController(GeoMap mapController, WaveformClient waveformClient, En
this.shape = shape;
this.path = path;
this.site = site;
+ this.eventTableController = certEventTab;
this.measuredMws = measuredMws;
this.configClient = configClient;
this.envelopeGui = envelopeGui;
- this.sslContext = sslContext;
+ this.spectraGui = spectraGui;
this.env = env;
this.bus = bus;
bus.register(this);
@@ -258,6 +272,36 @@ public CodaGuiController(GeoMap mapController, WaveformClient waveformClient, En
referenceEventFileChooser.getExtensionFilters().add(allFilesFilter);
}
+ @FXML
+ private void changeAppMode() {
+ GuiApplication.changeApplicationMode();
+
+ if (GuiApplication.getStartupMode() == ApplicationMode.CCT) {
+ addEnabledTabListeners(shapeTab, shape);
+ addEnabledTabListeners(pathTab, path);
+ addEnabledTabListeners(siteTab, site);
+ addEnabledTabListeners(measuredMwsTab, measuredMws);
+ Platform.runLater(() -> {
+ showMapButton.setGraphic(activeMapIcon);
+ });
+ } else {
+ spectraGui.loadEnvelopes();
+ siteTab.setOnSelectionChanged(e -> {
+ if (siteTab.isSelected()) {
+ activeTabRefresh = ((RefreshableController) eventTableController).getRefreshFunction();
+ } else {
+ siteTab.setGraphic(null);
+ }
+ });
+
+ Platform.runLater(() -> {
+ mainTabPane.getTabs().remove(shapeTab);
+ mainTabPane.getTabs().remove(pathTab);
+ mainTabPane.getTabs().remove(measuredMwsTab);
+ });
+ }
+ }
+
@FXML
private void openWaveformLoadingWindow() {
Optional.ofNullable(sacFileChooser.showOpenMultipleDialog(rootElement.getScene().getWindow())).ifPresent(envelopeLoadingController::loadFiles);
@@ -266,9 +310,24 @@ private void openWaveformLoadingWindow() {
@FXML
private void showMapWindow() {
Platform.runLater(() -> {
- if (mapController != null) {
- mapController.show();
- mapController.fitViewToActiveShapes();
+ if (GuiApplication.getStartupMode() == ApplicationMode.CCT) {
+ if (cctMapController != null) {
+ cctMapController.show();
+ cctMapController.fitViewToActiveShapes();
+ }
+ } else if (certMapController != null) {
+ certMapController.show();
+ certMapController.fitViewToActiveShapes();
+ }
+ });
+ }
+
+ @FXML
+ private void centerMap() {
+ Platform.runLater(() -> {
+ if (GuiApplication.getStartupMode() == ApplicationMode.CERT && certMapController != null) {
+ certMapController.show();
+ certMapController.fitViewToActiveShapes();
}
});
}
@@ -334,8 +393,8 @@ private void openCalibrationDataSavingWindow(ActionEvent e) {
Files.move(exportArchive.toPath(), selectedFile.toPath(), StandardCopyOption.REPLACE_EXISTING);
}
}
- } catch (IOException e1) {
- FileDialogs.fileIoErrorAlert(e1);
+ } catch (IOException ex) {
+ FileDialogs.fileIoErrorAlert(ex);
}
}
}
@@ -394,6 +453,8 @@ private void measureMws() {
private void clearData() {
calibrationClient.clearData().subscribe(val -> {
}, err -> log.trace(err.getMessage(), err), () -> data.getRefreshFunction().run());
+ spectraGui.loadEnvelopes();
+ activeTabRefresh.run();
}
@FXML
@@ -413,8 +474,11 @@ public void initialize() {
waveformFocus.selectedProperty().bindBidirectional(waveformGui.focusProperty());
- mapController.registerEventCallback(new MapIconActivationCallback(waveformClient));
- mapController.registerEventCallback(new MapPolygonChangeHandler(configClient));
+ certMapController.registerEventCallback(new MapIconActivationCallback(waveformClient));
+ certMapController.registerEventCallback(new MapPolygonChangeHandler(configClient));
+
+ cctMapController.registerEventCallback(new MapIconActivationCallback(waveformClient));
+ cctMapController.registerEventCallback(new MapPolygonChangeHandler(configClient));
activeMapIcon = makeMapLabel();
showMapIcon = makeMapLabel();
@@ -423,21 +487,36 @@ public void initialize() {
snapshotButton.setContentDisplay(ContentDisplay.CENTER);
addEnabledTabListeners(dataTab, data);
- activeTabScreenshot = folder -> SnapshotUtils.writePng(folder, new Pair<>(dataTab.getText(), dataTab.getContent()));
+
data.setVisible(true);
paramTab.setOnSelectionChanged(e -> {
if (paramTab.isSelected()) {
- mapController.clearIcons();
+ cctMapController.clearIcons();
+ certMapController.clearIcons();
activeTabRefresh = param.getRefreshFunction();
- activeTabScreenshot = folder -> SnapshotUtils.writePng(folder, new Pair<>(paramTab.getText(), paramTab.getContent()));
}
});
- addEnabledTabListeners(shapeTab, shape);
- addEnabledTabListeners(pathTab, path);
- addEnabledTabListeners(siteTab, site);
- addEnabledTabListeners(measuredMwsTab, measuredMws);
+ if (GuiApplication.getStartupMode() == ApplicationMode.CCT) {
+ addEnabledTabListeners(shapeTab, shape);
+ addEnabledTabListeners(pathTab, path);
+ addEnabledTabListeners(siteTab, site);
+ addEnabledTabListeners(measuredMwsTab, measuredMws);
+ } else {
+ siteTab.setOnSelectionChanged(e -> {
+ if (siteTab.isSelected()) {
+ activeTabRefresh = ((RefreshableController) eventTableController).getRefreshFunction();
+ } else {
+ siteTab.setGraphic(null);
+ }
+ });
+ Platform.runLater(() -> {
+ mainTabPane.getTabs().remove(shapeTab);
+ mainTabPane.getTabs().remove(pathTab);
+ mainTabPane.getTabs().remove(measuredMwsTab);
+ });
+ }
rootElement.setOnDragOver(event -> {
if (event.getGestureSource() != rootElement && event.getDragboard().hasFiles()) {
@@ -450,6 +529,17 @@ public void initialize() {
boolean success = false;
if (event.getGestureSource() != rootElement && event.getDragboard().hasFiles()) {
envelopeLoadingController.loadFiles(event.getDragboard().getFiles());
+
+ if (GuiApplication.getStartupMode() == ApplicationMode.CERT) {
+ envelopeLoadingController.setCompletionCallback(() -> {
+ spectraGui.loadEnvelopes();
+ if (certMapController != null) {
+ certMapController.show();
+ certMapController.fitViewToActiveShapes();
+ }
+ });
+ }
+
codaParamLoadingController.loadFiles(event.getDragboard().getFiles());
success = true;
}
@@ -458,7 +548,7 @@ public void initialize() {
});
try {
- loadingGui = new ProgressGui();
+ loadingGui = ProgressGui.getInstance();
} catch (IllegalStateException e) {
log.error("Unable to instantiate loading display {}", e.getMessage(), e);
}
@@ -472,15 +562,13 @@ private void addEnabledTabListeners(Tab tab, MapListeningController controller)
controller.refreshView();
tab.setGraphic(activeMapIcon);
if (controller instanceof RefreshableController) {
- activeTabRefresh = ((RefreshableController) controller).getRefreshFunction();
+ activeTabRefresh = () -> {
+ ((RefreshableController) controller).getRefreshFunction().run();
+ ((RefreshableController) eventTableController).getRefreshFunction().run();
+ };
} else {
activeTabRefresh = () -> controller.refreshView();
}
- if (controller instanceof ScreenshotEnabledController) {
- activeTabScreenshot = ((ScreenshotEnabledController) controller).getScreenshotFunction();
- } else {
- activeTabScreenshot = folder -> SnapshotUtils.writePng(folder, new Pair<>(tab.getText(), tab.getContent()));
- }
} else {
tab.setGraphic(null);
controller.setVisible(false);
@@ -504,7 +592,7 @@ private void snapshotTab(ActionEvent e) {
try {
if (folder != null && folder.exists() && folder.isDirectory() && folder.canWrite()) {
screenshotFolderChooser.setInitialDirectory(folder);
- Platform.runLater(() -> activeTabScreenshot.accept(folder));
+ SnapshotUtils.writePng(folder, new Pair<>(SCREENSHOT_TITLE + SnapshotUtils.getTimestampWithLeadingSeparator(), rootElement));
}
} catch (SecurityException ex) {
log.warn("Exception trying to write screenshots to folder {} : {}", folder, ex.getLocalizedMessage(), ex);
@@ -537,32 +625,37 @@ private Label makeSnapshotLabel() {
@Subscribe
private void listener(UpdateMapPolygonEvent event) {
- if (mapController != null && event != null && event.getGeoJSON() != null && !event.getGeoJSON().isEmpty()) {
- mapController.setPolygonGeoJSON(event.getGeoJSON());
+ if (event != null && event.getGeoJSON() != null && !event.getGeoJSON().isEmpty()) {
+ if (certMapController != null) {
+ certMapController.setPolygonGeoJSON(event.getGeoJSON());
+ }
+ if (cctMapController != null) {
+ cctMapController.setPolygonGeoJSON(event.getGeoJSON());
+ }
}
}
//TODO: Move this to a controller
@Subscribe
private void listener(CalibrationStatusEvent event) {
- if (!monitors.containsKey(event.getId()) && event.getStatus() == Status.STARTING) {
+ if (!calibrationMonitors.containsKey(event.getId()) && event.getStatus() == Status.STARTING) {
CalibrationProgressListener eventMonitor = new CalibrationProgressListener(bus, event);
ProgressMonitor monitor = new ProgressMonitor("Calibration Progress " + event.getId(), eventMonitor);
monitor.addCancelCallback(() -> calibrationClient.cancelCalibration(event.getId()).subscribe());
- monitors.put(event.getId(), monitor);
+ calibrationMonitors.put(event.getId(), monitor);
loadingGui.addProgressMonitor(monitor);
loadingGui.show();
}
if (event.getStatus() == Status.COMPLETE || event.getStatus() == Status.ERROR) {
- final ProgressMonitor monitor = monitors.remove(event.getId());
+ final ProgressMonitor monitor = calibrationMonitors.remove(event.getId());
if (monitor != null) {
monitor.setProgressStage("Finished");
monitor.clearCancelCallbacks();
service.schedule(() -> loadingGui.removeProgressMonitor(monitor), 15, TimeUnit.MINUTES);
}
} else {
- ProgressMonitor monitor = monitors.get(event.getId());
+ ProgressMonitor monitor = calibrationMonitors.get(event.getId());
if (monitor != null) {
switch (event.getStatus()) {
case PEAK_STARTING:
@@ -584,6 +677,37 @@ private void listener(CalibrationStatusEvent event) {
}
}
+ @Subscribe
+ private void listener(RatioStatusEvent event) {
+
+ ProgressMonitor monitor = ratioMonitors.get(event.getId());
+
+ if (monitor == null && event.getStatus() == RatioStatusEvent.Status.STARTING) {
+ RatioStatusProgressListener eventMonitor = new RatioStatusProgressListener(bus, event);
+ ProgressMonitor newMonitor = new ProgressMonitor("Ratio Measurement Progress " + event.getId(), eventMonitor);
+ loadingGui.addProgressMonitor(newMonitor);
+ ratioMonitors.put(event.getId(), newMonitor);
+ service.schedule(() -> loadingGui.removeProgressMonitor(monitor), 15, TimeUnit.MINUTES);
+ loadingGui.show();
+ }
+
+ if (monitor != null && (event.getStatus() == RatioStatusEvent.Status.COMPLETE || event.getStatus() == RatioStatusEvent.Status.ERROR)) {
+ monitor.setProgressStage("Finished");
+ service.schedule(() -> loadingGui.removeProgressMonitor(monitor), 15, TimeUnit.MINUTES);
+ } else if (monitor != null) {
+ switch (event.getStatus()) {
+ case STARTING:
+ monitor.setProgressStage("Starting...");
+ break;
+ case PROCESSING:
+ monitor.setProgressStage("Processing...");
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
@Subscribe
private void listener(CalibrationStageShownEvent evt) {
if (!initialized) {
diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/GuiApplication.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/GuiApplication.java
index f48f7996..66b6134a 100644
--- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/GuiApplication.java
+++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/GuiApplication.java
@@ -59,16 +59,26 @@
@ComponentScan("gov.llnl.gnem.apps.coda.envelope.model")
@ComponentScan("gov.llnl.gnem.apps.coda.envelope.gui")
@ComponentScan("gov.llnl.gnem.apps.coda.calibration.gui")
+@ComponentScan("gov.llnl.gnem.apps.coda.spectra.gui")
public class GuiApplication extends Application {
+ public enum ApplicationMode {
+ CERT, CCT
+ }
+
+ static final String CERT_TITLE = "Coda Envelope Ratio Tool";
+ static final String CCT_TITLE = "Coda Calibration Tool";
+
private static final Logger log = LoggerFactory.getLogger(GuiApplication.class);
- private ConfigurableApplicationContext springContext;
+ private static ConfigurableApplicationContext springContext;
- private Stage primaryStage;
+ private static Stage primaryStage;
private EventBus bus;
+ private static ApplicationMode startupMode;
+
@PostConstruct
void started() {
Locale.setDefault(Locale.ENGLISH);
@@ -78,9 +88,10 @@ void started() {
public GuiApplication() {
}
- public GuiApplication(ConfigurableApplicationContext springContext, EventBus bus) {
+ public GuiApplication(ConfigurableApplicationContext springContext, EventBus bus, ApplicationMode mode) {
this.springContext = springContext;
this.bus = bus;
+ GuiApplication.startupMode = mode;
}
public static void main(String[] args) {
@@ -130,13 +141,20 @@ public void start(Stage primaryStage) throws Exception {
Class clazz = GuiApplication.class;
String className = clazz.getSimpleName() + ".class";
String classPath = clazz.getResource(className).toString();
- String baseTitle = props.getBaseTitle();
+ String baseTitle = "";
+
+ if (GuiApplication.getStartupMode() == ApplicationMode.CCT) {
+ baseTitle = CCT_TITLE;
+ } else {
+ baseTitle = CERT_TITLE;
+ }
+
if (classPath.startsWith("jar")) {
String manifestPath = classPath.substring(0, classPath.indexOf('!') + 1) + "/META-INF/MANIFEST.MF";
Manifest mf = new Manifest(new URL(manifestPath).openStream());
Attributes atts = mf.getMainAttributes();
// Put this info in the log to help with analysis
- log.info(
+ log.debug(
"Version:{} Commit:{} Branch:{} By:{} at {}",
atts.getValue("Implementation-Version"),
atts.getValue("Implementation-Build"),
@@ -147,7 +165,7 @@ public void start(Stage primaryStage) throws Exception {
baseTitle += " Built at " + atts.getValue("Build-Timestamp");
} else {
// Class not from JAR
- log.info("{} not running from a jar.", baseTitle);
+ log.debug("{} not running from a jar.", baseTitle);
}
props.setBaseTitle(baseTitle);
} catch (IOException e) {
@@ -156,7 +174,13 @@ public void start(Stage primaryStage) throws Exception {
}
Platform.setImplicitExit(true);
- FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/fxml/CodaGui.fxml"));
+ FXMLLoader fxmlLoader = null;
+
+ if (startupMode == ApplicationMode.CERT) {
+ fxmlLoader = new FXMLLoader(getClass().getResource("/fxml/CertGui.fxml"));
+ } else {
+ fxmlLoader = new FXMLLoader(getClass().getResource("/fxml/CodaGui.fxml"));
+ }
fxmlLoader.setControllerFactory(springContext::getBean);
try {
@@ -174,6 +198,43 @@ public void start(Stage primaryStage) throws Exception {
}
}
+ static public void changeApplicationMode() {
+
+ if (GuiApplication.getStartupMode() == ApplicationMode.CCT) {
+ GuiApplication.startupMode = ApplicationMode.CERT;
+ } else {
+ GuiApplication.startupMode = ApplicationMode.CCT;
+ }
+
+ Platform.runLater(() -> {
+ primaryStage.close();
+ });
+
+ AppProperties props = springContext.getBean(AppProperties.class);
+ FXMLLoader fxmlLoader = null;
+ if (GuiApplication.startupMode == ApplicationMode.CERT) {
+ props.setBaseTitle(CERT_TITLE);
+ fxmlLoader = new FXMLLoader(GuiApplication.class.getResource("/fxml/CertGui.fxml"));
+ } else {
+ props.setBaseTitle(CCT_TITLE);
+ fxmlLoader = new FXMLLoader(GuiApplication.class.getResource("/fxml/CodaGui.fxml"));
+ }
+ fxmlLoader.setControllerFactory(springContext::getBean);
+
+ try {
+ Parent root = fxmlLoader.load();
+ Platform.runLater(() -> {
+ primaryStage.setTitle(props.getBaseTitle());
+ Scene scene = new Scene(root, props.getHeight(), props.getWidth());
+ primaryStage.setScene(scene);
+ primaryStage.show();
+ });
+ } catch (IllegalStateException | IOException e) {
+ log.error("Unable to load main panel FXML file, terminating. {}", e.getMessage(), e);
+ Platform.exit();
+ }
+ }
+
@Override
public void stop() throws Exception {
try {
@@ -187,6 +248,14 @@ public void stop() throws Exception {
System.exit(0);
}
+ public static ApplicationMode getStartupMode() {
+ return startupMode;
+ }
+
+ public static void setStartupMode(ApplicationMode startupMode) {
+ GuiApplication.startupMode = startupMode;
+ }
+
public Stage getPrimaryStage() {
return primaryStage;
}
diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/WebfluxConfig.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/WebfluxConfig.java
index e72b7aef..0bd55b36 100644
--- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/WebfluxConfig.java
+++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/WebfluxConfig.java
@@ -1,68 +1,68 @@
-/*
-* Copyright (c) 2019, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory
-* CODE-743439.
-* All rights reserved.
-* This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool.
-*
-* Licensed under the Apache License, Version 2.0 (the “Licensee”); you may not use this file except in compliance with the License. You may obtain a copy of the License at:
-* http://www.apache.org/licenses/LICENSE-2.0
-* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and limitations under the license.
-*
-* This work was performed under the auspices of the U.S. Department of Energy
-* by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344.
-*/
-package gov.llnl.gnem.apps.coda.calibration.gui;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.http.codec.json.Jackson2JsonDecoder;
-import org.springframework.http.codec.json.Jackson2JsonEncoder;
-import org.springframework.web.reactive.function.client.ExchangeStrategies;
-
-import com.fasterxml.jackson.core.Version;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver;
-import com.fasterxml.jackson.databind.module.SimpleModule;
-
-import gov.llnl.gnem.apps.coda.calibration.model.domain.SiteFrequencyBandParameters;
-import gov.llnl.gnem.apps.coda.calibration.model.domain.SpectraMeasurementMetadata;
-import gov.llnl.gnem.apps.coda.calibration.model.domain.SpectraMeasurementMetadataImpl;
-import gov.llnl.gnem.apps.coda.calibration.model.domain.WaveformMetadataImpl;
-import gov.llnl.gnem.apps.coda.calibration.model.domain.mixins.SharedFrequencyBandParametersJsonMixin;
-import gov.llnl.gnem.apps.coda.calibration.model.domain.mixins.SiteFrequencyBandParametersJsonMixin;
-import gov.llnl.gnem.apps.coda.common.model.domain.SharedFrequencyBandParameters;
-import gov.llnl.gnem.apps.coda.common.model.domain.WaveformMetadata;
-
-@Configuration
-public class WebfluxConfig {
-
- private final ObjectMapper objectMapper;
-
- @Autowired
- public WebfluxConfig(ObjectMapper objectMapper) {
- this.objectMapper = objectMapper;
- this.objectMapper.addMixIn(SharedFrequencyBandParameters.class, SharedFrequencyBandParametersJsonMixin.class);
- this.objectMapper.addMixIn(SiteFrequencyBandParameters.class, SiteFrequencyBandParametersJsonMixin.class);
-
- SimpleModule module = new SimpleModule("SpectraMeasurementMapper", Version.unknownVersion());
- SimpleAbstractTypeResolver resolver = new SimpleAbstractTypeResolver();
- resolver.addMapping(SpectraMeasurementMetadata.class, SpectraMeasurementMetadataImpl.class);
- resolver.addMapping(WaveformMetadata.class, WaveformMetadataImpl.class);
- module.setAbstractTypes(resolver);
- this.objectMapper.registerModule(module);
- }
-
- @Bean
- public ExchangeStrategies configureJacksonExchangeStrategies() {
- return ExchangeStrategies.builder().codecs(clientCodecConfigurer -> {
- Jackson2JsonDecoder decoder = new Jackson2JsonDecoder(objectMapper);
- decoder.setMaxInMemorySize(-1);
- clientCodecConfigurer.customCodecs().registerWithDefaultConfig(decoder);
- clientCodecConfigurer.customCodecs().registerWithDefaultConfig(new Jackson2JsonEncoder(objectMapper));
- //Unlimited
- clientCodecConfigurer.defaultCodecs().maxInMemorySize(-1);
- }).build();
- }
-}
+/*
+* Copyright (c) 2019, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory
+* CODE-743439.
+* All rights reserved.
+* This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool.
+*
+* Licensed under the Apache License, Version 2.0 (the “Licensee”); you may not use this file except in compliance with the License. You may obtain a copy of the License at:
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and limitations under the license.
+*
+* This work was performed under the auspices of the U.S. Department of Energy
+* by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344.
+*/
+package gov.llnl.gnem.apps.coda.calibration.gui;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.codec.json.Jackson2JsonDecoder;
+import org.springframework.http.codec.json.Jackson2JsonEncoder;
+import org.springframework.web.reactive.function.client.ExchangeStrategies;
+
+import com.fasterxml.jackson.core.Version;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver;
+import com.fasterxml.jackson.databind.module.SimpleModule;
+
+import gov.llnl.gnem.apps.coda.calibration.model.domain.SiteFrequencyBandParameters;
+import gov.llnl.gnem.apps.coda.calibration.model.domain.SpectraMeasurementMetadata;
+import gov.llnl.gnem.apps.coda.calibration.model.domain.SpectraMeasurementMetadataImpl;
+import gov.llnl.gnem.apps.coda.calibration.model.domain.WaveformMetadataImpl;
+import gov.llnl.gnem.apps.coda.calibration.model.domain.mixins.SharedFrequencyBandParametersJsonMixin;
+import gov.llnl.gnem.apps.coda.calibration.model.domain.mixins.SiteFrequencyBandParametersJsonMixin;
+import gov.llnl.gnem.apps.coda.common.model.domain.SharedFrequencyBandParameters;
+import gov.llnl.gnem.apps.coda.common.model.domain.WaveformMetadata;
+
+@Configuration
+public class WebfluxConfig {
+
+ private final ObjectMapper objectMapper;
+
+ @Autowired
+ public WebfluxConfig(ObjectMapper objectMapper) {
+ this.objectMapper = objectMapper;
+ this.objectMapper.addMixIn(SharedFrequencyBandParameters.class, SharedFrequencyBandParametersJsonMixin.class);
+ this.objectMapper.addMixIn(SiteFrequencyBandParameters.class, SiteFrequencyBandParametersJsonMixin.class);
+
+ SimpleModule module = new SimpleModule("SpectraMeasurementMapper", Version.unknownVersion());
+ SimpleAbstractTypeResolver resolver = new SimpleAbstractTypeResolver();
+ resolver.addMapping(SpectraMeasurementMetadata.class, SpectraMeasurementMetadataImpl.class);
+ resolver.addMapping(WaveformMetadata.class, WaveformMetadataImpl.class);
+ module.setAbstractTypes(resolver);
+ this.objectMapper.registerModule(module);
+ }
+
+ @Bean
+ public ExchangeStrategies configureJacksonExchangeStrategies() {
+ return ExchangeStrategies.builder().codecs(clientCodecConfigurer -> {
+ Jackson2JsonDecoder decoder = new Jackson2JsonDecoder(objectMapper);
+ decoder.setMaxInMemorySize(-1);
+ clientCodecConfigurer.customCodecs().registerWithDefaultConfig(decoder);
+ clientCodecConfigurer.customCodecs().registerWithDefaultConfig(new Jackson2JsonEncoder(objectMapper));
+ //Unlimited
+ clientCodecConfigurer.defaultCodecs().maxInMemorySize(-1);
+ }).build();
+ }
+}
diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/AbstractMeasurementController.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/AbstractMeasurementController.java
index 3de8aeb6..c0d500b0 100644
--- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/AbstractMeasurementController.java
+++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/AbstractMeasurementController.java
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory
+* Copyright (c) 2023, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory
* CODE-743439.
* All rights reserved.
*
@@ -33,7 +33,6 @@
import java.util.Map;
import java.util.Map.Entry;
import java.util.Objects;
-import java.util.Optional;
import java.util.Set;
import java.util.TreeMap;
import java.util.concurrent.atomic.AtomicReference;
@@ -84,7 +83,6 @@
import gov.llnl.gnem.apps.coda.common.model.messaging.WaveformChangeEvent;
import gov.llnl.gnem.apps.coda.common.model.util.SPECTRA_TYPES;
import javafx.application.Platform;
-import javafx.beans.binding.Bindings;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
@@ -98,9 +96,7 @@
import javafx.scene.control.MenuItem;
import javafx.scene.control.Tab;
import javafx.scene.control.TableColumn;
-import javafx.scene.control.TableColumn.CellDataFeatures;
import javafx.scene.control.TableRow;
-import javafx.scene.control.TableView;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
@@ -165,159 +161,6 @@ public abstract class AbstractMeasurementController implements MapListeningContr
@FXML
protected ComboBox evidCombo;
- @FXML
- protected TableView eventTable;
-
- @FXML
- protected TableColumn evidCol;
-
- @FXML
- protected TableColumn dateCol;
-
- @FXML
- protected TableColumn mwCol;
-
- @FXML
- protected TableColumn obsEnergyCol;
-
- @FXML
- protected TableColumn totalEnergyCol;
-
- @FXML
- protected TableColumn totalEnergyUq1LowCol;
-
- @FXML
- protected TableColumn totalEnergyUq1HighCol;
-
- @FXML
- protected TableColumn totalEnergyUq2LowCol;
-
- @FXML
- protected TableColumn totalEnergyUq2HighCol;
-
- @FXML
- protected TableColumn totalEnergyMDACCol;
-
- @FXML
- protected TableColumn totalEnergyMDACUq1LowCol;
-
- @FXML
- protected TableColumn totalEnergyMDACUq1HighCol;
-
- @FXML
- protected TableColumn totalEnergyMDACUq2LowCol;
-
- @FXML
- protected TableColumn totalEnergyMDACUq2HighCol;
-
- @FXML
- protected TableColumn energyRatioCol;
-
- @FXML
- protected TableColumn energyStressCol;
-
- @FXML
- protected TableColumn energyStressUq1LowCol;
-
- @FXML
- protected TableColumn energyStressUq1HighCol;
-
- @FXML
- protected TableColumn energyStressUq2LowCol;
-
- @FXML
- protected TableColumn energyStressUq2HighCol;
-
- @FXML
- protected TableColumn stressCol;
-
- @FXML
- protected TableColumn measuredMwCol;
-
- @FXML
- protected TableColumn measuredMeCol;
-
- @FXML
- protected TableColumn measuredStressCol;
-
- @FXML
- protected TableColumn valMwCol;
-
- @FXML
- protected TableColumn valStressCol;
-
- @FXML
- protected TableColumn mistfitCol;
-
- @FXML
- protected TableColumn measuredCornerFreqCol;
-
- @FXML
- protected TableColumn measuredMwUq1LowCol;
-
- @FXML
- protected TableColumn measuredMwUq1HighCol;
-
- @FXML
- protected TableColumn measuredMwUq2LowCol;
-
- @FXML
- protected TableColumn measuredMwUq2HighCol;
-
- @FXML
- protected TableColumn measuredMeUq1LowCol;
-
- @FXML
- protected TableColumn measuredMeUq1HighCol;
-
- @FXML
- protected TableColumn measuredMeUq2LowCol;
-
- @FXML
- protected TableColumn measuredMeUq2HighCol;
-
- @FXML
- protected TableColumn measuredStressUq1LowCol;
-
- @FXML
- protected TableColumn measuredStressUq1HighCol;
-
- @FXML
- protected TableColumn measuredStressUq2LowCol;
-
- @FXML
- protected TableColumn measuredStressUq2HighCol;
-
- @FXML
- protected TableColumn measuredCornerFreqUq1LowCol;
-
- @FXML
- protected TableColumn measuredCornerFreqUq1HighCol;
-
- @FXML
- protected TableColumn measuredCornerFreqUq2LowCol;
-
- @FXML
- protected TableColumn measuredCornerFreqUq2HighCol;
-
- @FXML
- protected TableColumn iterationsCol;
-
- @FXML
- protected TableColumn dataCountCol;
-
- @FXML
- protected TableColumn stationCountCol;
-
- @FXML
- protected TableColumn bandCoverageCol;
-
- @FXML
- protected TableColumn likelyPoorlyConstrainedCol;
-
- @FXML
- protected TableColumn stationCol;
-
@FXML
protected HiddenHeaderTableView> summaryTable;
@@ -514,74 +357,6 @@ public void initialize() {
}
});
- CellBindingUtils.attachTextCellFactoriesString(evidCol, MeasuredMwDetails::getEventId);
- evidCol.comparatorProperty().set(new MaybeNumericStringComparator());
-
- CellBindingUtils.attachTextCellFactoriesString(dateCol, MeasuredMwDetails::getDatetime);
-
- CellBindingUtils.attachTextCellFactories(mwCol, MeasuredMwDetails::getRefMw, dfmt4);
- CellBindingUtils.attachTextCellFactories(stressCol, MeasuredMwDetails::getRefApparentStressInMpa, dfmt4);
- CellBindingUtils.attachTextCellFactories(valMwCol, MeasuredMwDetails::getValMw, dfmt4);
- CellBindingUtils.attachTextCellFactories(valStressCol, MeasuredMwDetails::getValApparentStressInMpa, dfmt4);
-
- CellBindingUtils.attachTextCellFactories(measuredMwCol, MeasuredMwDetails::getMw, dfmt4);
- CellBindingUtils.attachTextCellFactories(measuredMwUq1LowCol, MeasuredMwDetails::getMw1Min, dfmt4);
- CellBindingUtils.attachTextCellFactories(measuredMwUq1HighCol, MeasuredMwDetails::getMw1Max, dfmt4);
- CellBindingUtils.attachTextCellFactories(measuredMwUq2LowCol, MeasuredMwDetails::getMw2Min, dfmt4);
- CellBindingUtils.attachTextCellFactories(measuredMwUq2HighCol, MeasuredMwDetails::getMw2Max, dfmt4);
- CellBindingUtils.attachTextCellFactories(measuredMeCol, MeasuredMwDetails::getMe, dfmt4);
- CellBindingUtils.attachTextCellFactories(measuredMeUq1LowCol, MeasuredMwDetails::getMw1Min, dfmt4);
- CellBindingUtils.attachTextCellFactories(measuredMeUq1HighCol, MeasuredMwDetails::getMw1Max, dfmt4);
- CellBindingUtils.attachTextCellFactories(measuredMeUq2LowCol, MeasuredMwDetails::getMw2Min, dfmt4);
- CellBindingUtils.attachTextCellFactories(measuredMeUq2HighCol, MeasuredMwDetails::getMw2Max, dfmt4);
-
- CellBindingUtils.attachTextCellFactories(obsEnergyCol, MeasuredMwDetails::getObsEnergy, dfmt4);
- CellBindingUtils.attachTextCellFactories(totalEnergyCol, MeasuredMwDetails::getTotalEnergy, dfmt4);
- CellBindingUtils.attachTextCellFactories(totalEnergyUq1LowCol, MeasuredMwDetails::getLogTotalEnergy1Min, dfmt4);
- CellBindingUtils.attachTextCellFactories(totalEnergyUq1HighCol, MeasuredMwDetails::getLogTotalEnergy1Max, dfmt4);
- CellBindingUtils.attachTextCellFactories(totalEnergyUq2LowCol, MeasuredMwDetails::getLogTotalEnergy2Min, dfmt4);
- CellBindingUtils.attachTextCellFactories(totalEnergyUq2HighCol, MeasuredMwDetails::getLogTotalEnergy2Max, dfmt4);
-
- CellBindingUtils.attachTextCellFactories(totalEnergyMDACCol, MeasuredMwDetails::getTotalEnergyMDAC, dfmt4);
- CellBindingUtils.attachTextCellFactories(totalEnergyMDACUq1LowCol, MeasuredMwDetails::getLogTotalEnergyMDAC1Min, dfmt4);
- CellBindingUtils.attachTextCellFactories(totalEnergyMDACUq1HighCol, MeasuredMwDetails::getLogTotalEnergyMDAC1Max, dfmt4);
- CellBindingUtils.attachTextCellFactories(totalEnergyMDACUq2LowCol, MeasuredMwDetails::getLogTotalEnergyMDAC2Min, dfmt4);
- CellBindingUtils.attachTextCellFactories(totalEnergyMDACUq2HighCol, MeasuredMwDetails::getLogTotalEnergyMDAC2Max, dfmt4);
-
- CellBindingUtils.attachTextCellFactories(energyRatioCol, MeasuredMwDetails::getEnergyRatio, dfmt4);
- CellBindingUtils.attachTextCellFactories(energyStressCol, MeasuredMwDetails::getEnergyStress, dfmt4);
- CellBindingUtils.attachTextCellFactories(energyStressUq1LowCol, MeasuredMwDetails::getObsAppStress1Min, dfmt4);
- CellBindingUtils.attachTextCellFactories(energyStressUq1HighCol, MeasuredMwDetails::getObsAppStress1Max, dfmt4);
- CellBindingUtils.attachTextCellFactories(energyStressUq2LowCol, MeasuredMwDetails::getObsAppStress2Min, dfmt4);
- CellBindingUtils.attachTextCellFactories(energyStressUq2HighCol, MeasuredMwDetails::getObsAppStress2Max, dfmt4);
-
- CellBindingUtils.attachTextCellFactories(measuredStressCol, MeasuredMwDetails::getApparentStressInMpa, dfmt4);
- CellBindingUtils.attachTextCellFactories(measuredStressUq1LowCol, MeasuredMwDetails::getApparentStress1Min, dfmt4);
- CellBindingUtils.attachTextCellFactories(measuredStressUq1HighCol, MeasuredMwDetails::getApparentStress1Max, dfmt4);
- CellBindingUtils.attachTextCellFactories(measuredStressUq2LowCol, MeasuredMwDetails::getApparentStress2Min, dfmt4);
- CellBindingUtils.attachTextCellFactories(measuredStressUq2HighCol, MeasuredMwDetails::getApparentStress2Max, dfmt4);
-
- CellBindingUtils.attachTextCellFactories(measuredCornerFreqCol, MeasuredMwDetails::getCornerFreq, dfmt4);
- CellBindingUtils.attachTextCellFactories(measuredCornerFreqUq1LowCol, MeasuredMwDetails::getCornerFreq1Min, dfmt4);
- CellBindingUtils.attachTextCellFactories(measuredCornerFreqUq1HighCol, MeasuredMwDetails::getCornerFreq1Max, dfmt4);
- CellBindingUtils.attachTextCellFactories(measuredCornerFreqUq2LowCol, MeasuredMwDetails::getCornerFreq2Min, dfmt4);
- CellBindingUtils.attachTextCellFactories(measuredCornerFreqUq2HighCol, MeasuredMwDetails::getCornerFreq2Max, dfmt4);
-
- CellBindingUtils.attachTextCellFactories(mistfitCol, MeasuredMwDetails::getMisfit, dfmt4);
- CellBindingUtils.attachTextCellFactories(bandCoverageCol, MeasuredMwDetails::getBandCoverage, dfmt4);
- CellBindingUtils.attachTextCellFactoriesString(likelyPoorlyConstrainedCol, mw -> mw.isLikelyPoorlyConstrained().toString());
-
- stationCountCol.setCellValueFactory(
- x -> Bindings.createIntegerBinding(() -> Optional.ofNullable(x).map(CellDataFeatures::getValue).map(MeasuredMwDetails::getStationCount).orElseGet(() -> 0)).asObject());
-
- iterationsCol.setCellValueFactory(
- x -> Bindings.createIntegerBinding(() -> Optional.ofNullable(x).map(CellDataFeatures::getValue).map(MeasuredMwDetails::getIterations).orElseGet(() -> 0)).asObject());
-
- dataCountCol.setCellValueFactory(
- x -> Bindings.createIntegerBinding(() -> Optional.ofNullable(x).map(CellDataFeatures::getValue).map(MeasuredMwDetails::getDataCount).orElseGet(() -> 0)).asObject());
-
- eventTable.setItems(mwParameters);
-
menu = new ContextMenu();
include = new MenuItem("Include Selected");
menu.getItems().add(include);
@@ -615,7 +390,7 @@ private void showWaveformPopup(final Long... ids) {
private void plotSpectra() {
clearSpectraPlots();
spectraControllers.forEach(spc -> {
- spc.getSpectraMeasurementMap().clear();
+ spc.getSpectraDataMap().clear();
spc.getSymbolMap().clear();
});
plotPointMap.clear();
@@ -663,7 +438,7 @@ private void plotSpectra() {
filteredMeasurements = Collections.emptyList();
}
- if (mwDetails.getEventId() != null) {
+ if (mwDetails != null && mwDetails.getEventId() != null) {
final Spectra fitSpectra = fittingSpectra.get(0);
summaryValues.add(
new Pair<>("Mw (Model Fit)",
@@ -765,11 +540,11 @@ private void plotSpectra() {
spectraControllers.forEach(spc -> {
if (fittingSpectra != null && spc.shouldShowFits()) {
- spc.getSpectralPlot().plotXYdata(toPlotPoints(selectedEventMeasurements, spc.getDataFunc()), fittingSpectra);
+ spc.getSpectralPlot().plotXYdata(toPlotPoints(selectedEventMeasurements, spc.getDataFunc()), fittingSpectra, null);
} else {
- spc.getSpectralPlot().plotXYdata(toPlotPoints(selectedEventMeasurements, spc.getDataFunc()), null);
+ spc.getSpectralPlot().plotXYdata(toPlotPoints(selectedEventMeasurements, spc.getDataFunc()), null, null);
}
- spc.getSpectraMeasurementMap().putAll(mapSpectraToPoint(selectedEventMeasurements, spc.getDataFunc()));
+ spc.getSpectraDataMap().putAll(mapSpectraToPoint(selectedEventMeasurements, spc.getDataFunc()));
spc.showConstraintWarningBanner(showPoorlyConstrainedBanner);
});
@@ -1131,7 +906,6 @@ protected void reloadData() {
.distinct()
.sorted(new MaybeNumericStringComparator())
.collect(Collectors.toList()));
- eventTable.sort();
});
final Map> evidStats = new HashMap<>();
@@ -1534,35 +1308,4 @@ protected PropertyChangeListener getPlotpointObserver(final Supplier