diff --git a/README.md b/README.md
index e8ec4ad5..f6e86d5d 100644
--- a/README.md
+++ b/README.md
@@ -42,18 +42,18 @@ We don't presently deploy versioned artifacts into a public repository like the
#### **As a single runnable JAR**
```shell
-java -jar coda-calibration/calibration-standalone/target/calibration-standalone-1.0.1-runnable.jar
+java -jar coda-calibration/calibration-standalone/target/calibration-standalone-1.0.2-runnable.jar
```
#### **GUI alone**
```shell
-java -jar coda-calibration/calibration-gui/target/calibration-gui-1.0.1-runnable.jar
+java -jar coda-calibration/calibration-gui/target/calibration-gui-1.0.2-runnable.jar
```
#### **Calibration REST service alone**
```shell
-java -jar coda-calibration/calibration-service/application/target/application-1.0.1-runnable.jar
+java -jar coda-calibration/calibration-service/application/target/application-1.0.2-runnable.jar
```
#### A note about HTTPS
@@ -89,7 +89,7 @@ As of 1.0, CCT is capable of loading four basic file types
```text
STATION_CHANNEL_EVENTID_LOWFREQ_HIGHFREQ_UNITS_.*.env
- (e.g. ANMO.STACK.999999_1.0_1.5_VEL_.env)
+ (e.g. ANMO_STACK_999999_1.0_1.5_VEL_.env)
```
2. Reference events
diff --git a/calibration-gui/pom.xml b/calibration-gui/pom.xml
index e1059df7..88d13279 100644
--- a/calibration-gui/pom.xml
+++ b/calibration-gui/pom.xml
@@ -5,7 +5,7 @@
gov.llnl.gnem.apps.coda.calibration
calibration-gui
- 1.0.1
+ 1.0.2
jar
calibration-gui
@@ -54,7 +54,7 @@
org.springframework.boot
spring-boot-starter-parent
- 2.0.0.RC2
+ 2.0.2.RELEASE
pom
import
@@ -65,12 +65,12 @@
gov.llnl.gnem.apps.coda.calibration
externals
- 1.0.1
+ 1.0.2
gov.llnl.gnem.apps.coda.calibration
model
- 1.0.1
+ 1.0.2
org.eclipse.persistence
@@ -202,7 +202,7 @@
org.springframework.boot
spring-boot-maven-plugin
- 2.0.0.RC2
+ 2.0.2.RELEASE
true
${start-class}
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 f6767fde..fcc79e30 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
@@ -38,7 +38,7 @@
import gov.llnl.gnem.apps.coda.calibration.gui.controllers.ReferenceEventLoadingController;
import gov.llnl.gnem.apps.coda.calibration.gui.controllers.WaveformLoadingController;
import gov.llnl.gnem.apps.coda.calibration.gui.data.client.api.CalibrationClient;
-import gov.llnl.gnem.apps.coda.calibration.gui.plotting.WaveformGui;
+import gov.llnl.gnem.apps.coda.calibration.gui.events.ShowFailureReportEvent;
import gov.llnl.gnem.apps.coda.calibration.gui.util.CalibrationProgressListener;
import gov.llnl.gnem.apps.coda.calibration.gui.util.ProgressMonitor;
import gov.llnl.gnem.apps.coda.calibration.model.domain.messaging.CalibrationStatusEvent;
@@ -76,7 +76,6 @@ public class CodaGuiController {
private EventBus bus;
private ProgressGui loadingGui;
- private WaveformGui waveformGui;
private Map monitors = new HashMap<>();
@@ -88,13 +87,12 @@ public class CodaGuiController {
@Autowired
public CodaGuiController(WaveformLoadingController waveformLoadingController, CodaParamLoadingController codaParamLoadingController, ReferenceEventLoadingController refEventLoadingController,
- CalibrationClient calibrationClient, WaveformGui waveformGui, EventBus bus) throws IOException {
+ CalibrationClient calibrationClient, EventBus bus) throws IOException {
super();
this.waveformLoadingController = waveformLoadingController;
this.codaParamLoadingController = codaParamLoadingController;
this.refEventLoadingController = refEventLoadingController;
this.calibrationClient = calibrationClient;
- this.waveformGui = waveformGui;
this.bus = bus;
sacDirFileChooser.setTitle("Coda STACK File Directory");
sacFileChooser.getExtensionFilters().add(new ExtensionFilter("Coda STACK Files (.sac,.env)", "*.sac", "*.env"));
@@ -118,8 +116,8 @@ private void openWaveformLoadingWindow() {
}
@FXML
- private void openWaveformDisplay() {
- waveformGui.show();
+ private void openFailureReportDisplay() {
+ bus.post(new ShowFailureReportEvent());
}
@FXML
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 d0a7f9a2..ae6ad2f6 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
@@ -18,11 +18,13 @@
import java.io.IOException;
import java.lang.reflect.Method;
import java.net.URL;
+import java.util.TimeZone;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import java.util.jar.Attributes;
import java.util.jar.Manifest;
+import javax.annotation.PostConstruct;
import javax.swing.SwingUtilities;
import org.slf4j.Logger;
@@ -52,6 +54,11 @@ public class GuiApplication extends Application {
private Stage primaryStage;
+ @PostConstruct
+ void started() {
+ TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
+ }
+
public GuiApplication() {
}
diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/FailureReportController.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/FailureReportController.java
new file mode 100644
index 00000000..f5cc0a16
--- /dev/null
+++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/FailureReportController.java
@@ -0,0 +1,109 @@
+/*
+* 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.
+*
+* 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.controllers;
+
+import java.io.IOException;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import com.google.common.eventbus.EventBus;
+import com.google.common.eventbus.Subscribe;
+
+import gov.llnl.gnem.apps.coda.calibration.gui.events.LoadStartingEvent;
+import gov.llnl.gnem.apps.coda.calibration.gui.events.ShowFailureReportEvent;
+import gov.llnl.gnem.apps.coda.calibration.gui.util.CellBindingUtils;
+import gov.llnl.gnem.apps.coda.calibration.model.domain.messaging.PassFailEvent;
+import javafx.application.Platform;
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import javafx.fxml.FXML;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.scene.control.TableColumn;
+import javafx.scene.control.TableView;
+import javafx.scene.text.Font;
+import javafx.stage.Stage;
+import javafx.stage.StageStyle;
+
+@Component
+public class FailureReportController {
+
+ private final Logger log = LoggerFactory.getLogger(this.getClass());
+
+ private Parent root;
+ private Scene scene;
+ private Stage stage;
+
+ @FXML
+ TableView tableView;
+
+ @FXML
+ TableColumn errorCol;
+
+ private ObservableList errors = FXCollections.observableArrayList();
+
+ private EventBus bus;
+
+ @Autowired
+ public FailureReportController(EventBus bus) {
+ this.bus = bus;
+ bus.register(this);
+ Platform.runLater(() -> {
+ FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/fxml/FailureReport.fxml"));
+ fxmlLoader.setController(this);
+ stage = new Stage(StageStyle.DECORATED);
+ Font.loadFont(getClass().getResource("/fxml/MaterialIcons-Regular.ttf").toExternalForm(), 18);
+ try {
+ root = fxmlLoader.load();
+ scene = new Scene(root);
+ stage.setScene(scene);
+ } catch (IOException e) {
+ throw new IllegalStateException(e);
+ }
+ });
+ }
+
+ @Subscribe
+ private void listener(LoadStartingEvent event) {
+ errors.clear();
+ }
+
+ @Subscribe
+ private void listener(ShowFailureReportEvent event) {
+ Platform.runLater(() -> {
+ stage.show();
+ stage.toFront();
+ });
+ }
+
+ @Subscribe
+ private void listener(PassFailEvent event) {
+ if (event.getResult() != null && !event.getResult().isSuccess()) {
+ errors.addAll(event.getResult().getErrors().stream().map(e -> e.getMessage()).collect(Collectors.toList()));
+ }
+ }
+
+ @FXML
+ public void initialize() {
+ CellBindingUtils.attachTextCellFactoriesString(errorCol, Function.identity());
+ tableView.setItems(errors);
+ }
+}
diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/PathController.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/PathController.java
index 2f520bed..aca45039 100644
--- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/PathController.java
+++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/PathController.java
@@ -55,14 +55,18 @@
import javafx.scene.control.Tooltip;
import javafx.scene.layout.StackPane;
import llnl.gnem.core.gui.plotting.MouseOverPlotObject;
+import llnl.gnem.core.gui.plotting.PaintMode;
+import llnl.gnem.core.gui.plotting.PenStyle;
import llnl.gnem.core.gui.plotting.jmultiaxisplot.JMultiAxisPlot;
import llnl.gnem.core.gui.plotting.jmultiaxisplot.JSubplot;
import llnl.gnem.core.gui.plotting.plotobject.Circle;
+import llnl.gnem.core.gui.plotting.plotobject.Line;
import llnl.gnem.core.gui.plotting.plotobject.PlotObject;
import llnl.gnem.core.gui.plotting.plotobject.Square;
import llnl.gnem.core.gui.plotting.plotobject.Symbol;
import llnl.gnem.core.gui.plotting.plotobject.TriangleDn;
import llnl.gnem.core.gui.plotting.plotobject.TriangleUp;
+import llnl.gnem.core.util.SeriesMath;
import llnl.gnem.core.util.Geometry.EModel;
@Component
@@ -382,7 +386,7 @@ private void plotSd() {
if (plotObj.getYcenter() < ymin) {
ymin = plotObj.getYcenter();
}
- plot.AddPlotObject(plotObj);
+ plot.AddPlotObject(plotObj, 9);
if (plotObj2.getXcenter() > xmax) {
xmax = plotObj2.getXcenter();
@@ -483,7 +487,7 @@ private void plotBeforeAfter() {
if (plotObj.getYcenter() < xmin) {
xmin = plotObj.getYcenter();
}
- plot.AddPlotObject(plotObj);
+ plot.AddPlotObject(plotObj, 9);
if (plotObj2.getXcenter() > xmax) {
xmax = plotObj2.getXcenter();
@@ -503,9 +507,22 @@ private void plotBeforeAfter() {
}
}
+
+ double paddedXmin = xmin - (xmin * .1);
+ double paddedXmax = xmax + (xmax * .1);
if (xmax != null) {
- plot.SetAxisLimits(xmin - (xmin * .1), xmax + (xmax * .1), xmin - (xmin * .1), xmax + (xmax * .1));
+ plot.SetAxisLimits(paddedXmin, paddedXmax, paddedXmin, paddedXmax);
}
+ int points = 50;
+ double dx = (plot.getXaxis().getMax()) / (points - 1);
+ float[] xy = new float[points];
+ for (int i = 0; i < points; i++) {
+ xy[i] = (float) (0 + (dx * i));
+ }
+ Line line = new Line(xy, xy, Color.black, PaintMode.COPY, PenStyle.DASH, 2);
+
+ plot.AddPlotObject(line, 1);
+
if (stationDistance == null) {
stationDistance = 0.0;
}
diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/ProgressGui.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/ProgressGui.java
index 6644ea5e..832407ec 100644
--- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/ProgressGui.java
+++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/ProgressGui.java
@@ -16,6 +16,7 @@
import java.io.IOException;
+import gov.llnl.gnem.apps.coda.calibration.gui.util.ClickUtils;
import gov.llnl.gnem.apps.coda.calibration.gui.util.ProgressMonitor;
import javafx.application.Platform;
import javafx.beans.binding.Bindings;
@@ -74,8 +75,9 @@ public TableCell call(TableColumn
return new TableCell() {
@Override
protected void updateItem(Node item, boolean empty) {
- if (item == getItem())
+ if (item == getItem()) {
return;
+ }
super.updateItem(item, empty);
if (item == null) {
@@ -90,6 +92,11 @@ protected void updateItem(Node item, boolean empty) {
}
});
progressTable.setItems(monitors);
+ progressTable.getSelectionModel().selectedItemProperty().addListener((obs, prevSelection, newSelection) -> {
+ if (newSelection != null) {
+ ClickUtils.clickNode(newSelection);
+ }
+ });
} catch (IOException e) {
throw new IllegalStateException(e);
}
diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/WaveformLoadingController.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/WaveformLoadingController.java
index 9f03981b..c83ac6b1 100644
--- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/WaveformLoadingController.java
+++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/WaveformLoadingController.java
@@ -38,19 +38,26 @@
import gov.llnl.gnem.apps.coda.calibration.gui.converters.api.FileToWaveformConverter;
import gov.llnl.gnem.apps.coda.calibration.gui.converters.sac.SacExporter;
import gov.llnl.gnem.apps.coda.calibration.gui.data.client.api.WaveformClient;
+import gov.llnl.gnem.apps.coda.calibration.gui.events.LoadStartingEvent;
+import gov.llnl.gnem.apps.coda.calibration.gui.events.ShowFailureReportEvent;
import gov.llnl.gnem.apps.coda.calibration.gui.util.PassFailEventProgressListener;
import gov.llnl.gnem.apps.coda.calibration.gui.util.ProgressEventProgressListener;
import gov.llnl.gnem.apps.coda.calibration.gui.util.ProgressMonitor;
import gov.llnl.gnem.apps.coda.calibration.model.domain.Waveform;
+import gov.llnl.gnem.apps.coda.calibration.model.domain.messaging.PassFailEvent;
import gov.llnl.gnem.apps.coda.calibration.model.domain.messaging.Progress;
import gov.llnl.gnem.apps.coda.calibration.model.domain.messaging.ProgressEvent;
import gov.llnl.gnem.apps.coda.calibration.model.domain.messaging.Result;
+import javafx.application.Platform;
+import javafx.scene.input.MouseEvent;
//TODO: This class needs a GUI to display a list of files it's attempting to load and process + pass/fail indicators
@Component
@ConfigurationProperties("waveform.client")
public class WaveformLoadingController {
+ private static final Long LOCAL_FAIL_EVENT = -1l;
+
private final Logger log = LoggerFactory.getLogger(this.getClass());
private WaveformClient client;
@@ -120,11 +127,18 @@ public void loadFiles(List inputFiles) {
});
if (!files.isEmpty()) {
- Progress fileProcessingProgress = new Progress(0l, 0l);
+ bus.post(new LoadStartingEvent());
+ // TODO: Condense these bars into a composite pass/fail progress bar
+ Progress fileProcessingProgress = new Progress(-1l, 0l);
+ Progress fileFailedProgress = new Progress(-1l, 0l);
ProgressEvent processingProgressEvent = new ProgressEvent(idCounter.getAndIncrement(), fileProcessingProgress);
+ ProgressEvent processingFailedProgressEvent = new ProgressEvent(idCounter.getAndIncrement(), fileFailedProgress);
ProgressMonitor processingMonitor = new ProgressMonitor("File Processing", new ProgressEventProgressListener(bus, processingProgressEvent));
+ ProgressMonitor processingFailedMonitor = new ProgressMonitor("Processing Failures", new ProgressEventProgressListener(bus, processingFailedProgressEvent));
+ processingFailedMonitor.addEventFilter(MouseEvent.MOUSE_CLICKED, e -> bus.post(new ShowFailureReportEvent()));
+ Platform.runLater(() -> processingFailedMonitor.getProgressBar().getStyleClass().add("red-bar"));
- Progress fileUploadProgress = new Progress(0l, 0l);
+ Progress fileUploadProgress = new Progress(-1l, 0l);
ProgressEvent fileUploadProgressEvent = new ProgressEvent(idCounter.getAndIncrement(), fileUploadProgress);
ProgressMonitor uploadMonitor = new ProgressMonitor("Saving Data", new PassFailEventProgressListener(bus, fileUploadProgressEvent));
@@ -132,6 +146,7 @@ public void loadFiles(List inputFiles) {
ProgressGui progressGui = new ProgressGui();
progressGui.show();
progressGui.addProgressMonitor(processingMonitor);
+ progressGui.addProgressMonitor(processingFailedMonitor);
progressGui.addProgressMonitor(uploadMonitor);
fileUploadProgress.setTotal((long) (files.size() / maxBatching) + 1);
@@ -140,15 +155,28 @@ public void loadFiles(List inputFiles) {
fileProcessingProgress.setTotal(Integer.toUnsignedLong(files.size()));
bus.post(processingProgressEvent);
+ fileFailedProgress.setTotal(0l);
+ bus.post(processingFailedProgressEvent);
+
fileConverters.stream().forEach(fileConverter -> fileConverter.convertFiles(files).buffer(maxBatching, ArrayList::new).subscribe(results -> {
- // TODO: Feedback to the user about failure causes!
try {
List> successfulResults = results.stream().filter(Result::isSuccess).collect(Collectors.toList());
+ List> failedResults = results.stream().filter(r -> !r.isSuccess()).collect(Collectors.toList());
client.postWaveforms(fileUploadProgressEvent.getId(), successfulResults.stream().map(result -> result.getResultPayload().get()).collect(Collectors.toList()))
.retry(3)
.subscribe();
fileProcessingProgress.setCurrent(fileProcessingProgress.getCurrent() + successfulResults.size());
+ fileUploadProgress.setTotal((long) ((files.size() - failedResults.size()) / maxBatching) + 1);
+ bus.post(fileUploadProgressEvent);
+
bus.post(processingProgressEvent);
+ if (failedResults.size() > 0) {
+ fileProcessingProgress.setTotal(fileProcessingProgress.getTotal() - failedResults.size());
+ fileFailedProgress.setTotal(fileFailedProgress.getTotal() + failedResults.size());
+ fileFailedProgress.setCurrent(fileFailedProgress.getCurrent() + failedResults.size());
+ bus.post(processingFailedProgressEvent);
+ failedResults.forEach(r -> bus.post(new PassFailEvent(LOCAL_FAIL_EVENT, "", r)));
+ }
} catch (JsonProcessingException ex) {
log.trace(ex.getMessage(), ex);
}
@@ -160,7 +188,6 @@ public void loadFiles(List inputFiles) {
} catch (IllegalStateException e) {
log.error("Unable to instantiate loading display {}", e.getMessage(), e);
}
-
});
}
diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/parameters/ModelController.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/parameters/ModelController.java
index 4cceeaf9..6ab2b001 100644
--- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/parameters/ModelController.java
+++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/parameters/ModelController.java
@@ -14,9 +14,7 @@
*/
package gov.llnl.gnem.apps.coda.calibration.gui.controllers.parameters;
-import java.text.NumberFormat;
import java.util.Objects;
-import java.util.Optional;
import javax.annotation.PostConstruct;
@@ -25,17 +23,18 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
+import com.fasterxml.jackson.core.JsonProcessingException;
+
import gov.llnl.gnem.apps.coda.calibration.gui.data.client.api.ParameterClient;
-import gov.llnl.gnem.apps.coda.calibration.gui.util.NumberFormatFactory;
+import gov.llnl.gnem.apps.coda.calibration.gui.util.CellBindingUtils;
import gov.llnl.gnem.apps.coda.calibration.model.domain.MdacParametersFI;
import gov.llnl.gnem.apps.coda.calibration.model.domain.MdacParametersPS;
-import javafx.beans.binding.Bindings;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
-import javafx.event.ActionEvent;
+import javafx.event.Event;
import javafx.fxml.FXML;
import javafx.scene.control.TableColumn;
-import javafx.scene.control.TableColumn.CellDataFeatures;
+import javafx.scene.control.TableColumn.CellEditEvent;
import javafx.scene.control.TableView;
@Component
@@ -43,8 +42,6 @@ public class ModelController {
private final Logger log = LoggerFactory.getLogger(this.getClass());
- private final NumberFormat dfmt2 = NumberFormatFactory.twoDecimalOneLeadingZero();
-
@FXML
private TableView fiTableView;
@@ -134,7 +131,7 @@ public ModelController(ParameterClient client) {
}
@FXML
- private void reloadTable(ActionEvent e) {
+ private void reloadTable(Event e) {
requestData();
}
@@ -143,6 +140,28 @@ private void onSpringStartupFinished() {
requestData();
}
+ @FXML
+ private void postUpdate(CellEditEvent, ?> e) {
+ fiData.forEach(p -> {
+ try {
+ client.postFiParameters(p);
+ } catch (JsonProcessingException e1) {
+ log.error(e1.getMessage(), e1);
+ }
+ });
+
+ psData.forEach(p -> {
+ try {
+ client.postPsParameters(p);
+ } catch (JsonProcessingException e1) {
+ log.error(e1.getMessage(), e1);
+ }
+ });
+ fiData.clear();
+ psData.clear();
+ requestData();
+ }
+
protected void requestData() {
fiData.clear();
psData.clear();
@@ -154,172 +173,30 @@ protected void requestData() {
@FXML
public void initialize() {
- phaseCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(MdacParametersPS::getPhase)
- .filter(Objects::nonNull)
- .orElseGet(String::new)));
-
- q0Col.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(MdacParametersPS::getQ0)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- delQ0Col.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(MdacParametersPS::getDelQ0)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- gammaCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(MdacParametersPS::getGamma0)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- delGammaCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(MdacParametersPS::getDelGamma0)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- u0Col.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(MdacParametersPS::getU0)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- etaCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(MdacParametersPS::getEta)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- delEtaCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(MdacParametersPS::getDelEta)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- distCritCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(MdacParametersPS::getDistCrit)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- snrCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(MdacParametersPS::getSnr)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- sigmaCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(MdacParametersFI::getSigma)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- delSigmaCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(MdacParametersFI::getDelSigma)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- psiCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(MdacParametersFI::getPsi)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- delPsiCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(MdacParametersFI::getDelPsi)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- zetaCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(MdacParametersFI::getZeta)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- m0RefCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(MdacParametersFI::getM0ref)
- .filter(Objects::nonNull)
- .map(d -> d.toString())
- .orElseGet(String::new)));
-
- alphasCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(MdacParametersFI::getAlphas)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- betasCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(MdacParametersFI::getBetas)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- rhosCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(MdacParametersFI::getRhos)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- radpatPCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(MdacParametersFI::getRadPatP)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- radpatSCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(MdacParametersFI::getRadPatS)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- alpharCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(MdacParametersFI::getAlphaR)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- betarCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(MdacParametersFI::getBetaR)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- rhorCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(MdacParametersFI::getRhor)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
+ CellBindingUtils.attachTextCellFactoriesString(phaseCol, MdacParametersPS::getPhase);
+ CellBindingUtils.attachEditableTextCellFactories(q0Col, MdacParametersPS::getQ0, MdacParametersPS::setQ0);
+ CellBindingUtils.attachEditableTextCellFactories(delQ0Col, MdacParametersPS::getDelQ0, MdacParametersPS::setDelQ0);
+ CellBindingUtils.attachEditableTextCellFactories(gammaCol, MdacParametersPS::getGamma0, MdacParametersPS::setGamma0);
+ CellBindingUtils.attachEditableTextCellFactories(delGammaCol, MdacParametersPS::getDelGamma0, MdacParametersPS::setDelGamma0);
+ CellBindingUtils.attachEditableTextCellFactories(u0Col, MdacParametersPS::getU0, MdacParametersPS::setU0);
+ CellBindingUtils.attachEditableTextCellFactories(etaCol, MdacParametersPS::getEta, MdacParametersPS::setEta);
+ CellBindingUtils.attachEditableTextCellFactories(delEtaCol, MdacParametersPS::getDelEta, MdacParametersPS::setDelEta);
+ CellBindingUtils.attachEditableTextCellFactories(distCritCol, MdacParametersPS::getDistCrit, MdacParametersPS::setDistCrit);
+ CellBindingUtils.attachEditableTextCellFactories(snrCol, MdacParametersPS::getSnr, MdacParametersPS::setSnr);
+ CellBindingUtils.attachEditableTextCellFactories(sigmaCol, MdacParametersFI::getSigma, MdacParametersFI::setSigma);
+ CellBindingUtils.attachEditableTextCellFactories(delSigmaCol, MdacParametersFI::getDelSigma, MdacParametersFI::setDelSigma);
+ CellBindingUtils.attachEditableTextCellFactories(psiCol, MdacParametersFI::getPsi, MdacParametersFI::setPsi);
+ CellBindingUtils.attachEditableTextCellFactories(delPsiCol, MdacParametersFI::getDelPsi, MdacParametersFI::setDelPsi);
+ CellBindingUtils.attachEditableTextCellFactories(zetaCol, MdacParametersFI::getZeta, MdacParametersFI::setZeta);
+ CellBindingUtils.attachEditableTextCellFactories(m0RefCol, MdacParametersFI::getM0ref, MdacParametersFI::setM0ref);
+ CellBindingUtils.attachEditableTextCellFactories(alphasCol, MdacParametersFI::getAlphas, MdacParametersFI::setAlphas);
+ CellBindingUtils.attachEditableTextCellFactories(betasCol, MdacParametersFI::getBetas, MdacParametersFI::setBetas);
+ CellBindingUtils.attachEditableTextCellFactories(rhosCol, MdacParametersFI::getRhos, MdacParametersFI::setRhos);
+ CellBindingUtils.attachEditableTextCellFactories(radpatPCol, MdacParametersFI::getRadPatP, MdacParametersFI::setRadPatP);
+ CellBindingUtils.attachEditableTextCellFactories(radpatSCol, MdacParametersFI::getRadPatS, MdacParametersFI::setRadPatS);
+ CellBindingUtils.attachEditableTextCellFactories(alpharCol, MdacParametersFI::getAlphaR, MdacParametersFI::setAlphaR);
+ CellBindingUtils.attachEditableTextCellFactories(betarCol, MdacParametersFI::getBetaR, MdacParametersFI::setBetaR);
+ CellBindingUtils.attachEditableTextCellFactories(rhorCol, MdacParametersFI::getRhor, MdacParametersFI::setRhor);
fiTableView.setItems(fiData);
psTableView.setItems(psData);
diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/parameters/SharedBandController.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/parameters/SharedBandController.java
index 2f920b5b..a0e3de2d 100644
--- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/parameters/SharedBandController.java
+++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/parameters/SharedBandController.java
@@ -16,7 +16,6 @@
import java.text.NumberFormat;
import java.util.Objects;
-import java.util.Optional;
import javax.annotation.PostConstruct;
@@ -25,17 +24,19 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
+import com.fasterxml.jackson.core.JsonProcessingException;
+
import gov.llnl.gnem.apps.coda.calibration.gui.data.client.api.ParameterClient;
+import gov.llnl.gnem.apps.coda.calibration.gui.util.CellBindingUtils;
import gov.llnl.gnem.apps.coda.calibration.gui.util.MaybeNumericStringComparator;
import gov.llnl.gnem.apps.coda.calibration.gui.util.NumberFormatFactory;
import gov.llnl.gnem.apps.coda.calibration.model.domain.SharedFrequencyBandParameters;
-import javafx.beans.binding.Bindings;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
-import javafx.event.ActionEvent;
+import javafx.event.Event;
import javafx.fxml.FXML;
import javafx.scene.control.TableColumn;
-import javafx.scene.control.TableColumn.CellDataFeatures;
+import javafx.scene.control.TableColumn.CellEditEvent;
import javafx.scene.control.TableView;
@Component
@@ -43,8 +44,6 @@ public class SharedBandController {
private final Logger log = LoggerFactory.getLogger(this.getClass());
- private final NumberFormat dfmt2 = NumberFormatFactory.twoDecimalOneLeadingZero();
-
private final NumberFormat dfmt4 = NumberFormatFactory.fourDecimalOneLeadingZero();
@FXML
@@ -114,154 +113,53 @@ public SharedBandController(ParameterClient client) {
}
@FXML
- private void reloadTable(ActionEvent e) {
+ private void reloadTable(Event e) {
+ requestData();
+ }
+
+ @FXML
+ private void postUpdate(CellEditEvent, ?> e) {
+ sharedFbData.forEach(fb -> {
+ try {
+ client.postSharedFrequencyBandParameters(fb);
+ } catch (JsonProcessingException e1) {
+ log.error(e1.getMessage(), e1);
+ }
+ });
+ sharedFbData.clear();
requestData();
}
@FXML
public void initialize() {
- lowFreqCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(SharedFrequencyBandParameters::getLowFrequency)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
+ CellBindingUtils.attachEditableTextCellFactories(lowFreqCol, SharedFrequencyBandParameters::getLowFrequency, SharedFrequencyBandParameters::setLowFrequency);
lowFreqCol.comparatorProperty().set(new MaybeNumericStringComparator());
- highFreqCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(SharedFrequencyBandParameters::getHighFrequency)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
+ CellBindingUtils.attachEditableTextCellFactories(highFreqCol, SharedFrequencyBandParameters::getHighFrequency, SharedFrequencyBandParameters::setHighFrequency);
highFreqCol.comparatorProperty().set(new MaybeNumericStringComparator());
- v0Col.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(SharedFrequencyBandParameters::getVelocity0)
- .filter(Objects::nonNull)
- .map(dfmt4::format)
- .orElseGet(String::new)));
-
- v1Col.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(SharedFrequencyBandParameters::getVelocity1)
- .filter(Objects::nonNull)
- .map(dfmt4::format)
- .orElseGet(String::new)));
-
- v2Col.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(SharedFrequencyBandParameters::getVelocity2)
- .filter(Objects::nonNull)
- .map(dfmt4::format)
- .orElseGet(String::new)));
-
- b0Col.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(SharedFrequencyBandParameters::getBeta0)
- .filter(Objects::nonNull)
- .map(dfmt4::format)
- .orElseGet(String::new)));
-
- b1Col.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(SharedFrequencyBandParameters::getBeta1)
- .filter(Objects::nonNull)
- .map(dfmt4::format)
- .orElseGet(String::new)));
-
- b2Col.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(SharedFrequencyBandParameters::getBeta2)
- .filter(Objects::nonNull)
- .map(dfmt4::format)
- .orElseGet(String::new)));
-
- g0Col.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(SharedFrequencyBandParameters::getGamma0)
- .filter(Objects::nonNull)
- .map(dfmt4::format)
- .orElseGet(String::new)));
-
- g1Col.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(SharedFrequencyBandParameters::getGamma1)
- .filter(Objects::nonNull)
- .map(dfmt4::format)
- .orElseGet(String::new)));
-
- g2Col.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(SharedFrequencyBandParameters::getGamma2)
- .filter(Objects::nonNull)
- .map(dfmt4::format)
- .orElseGet(String::new)));
-
- minSnrCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(SharedFrequencyBandParameters::getMinSnr)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- s1Col.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(SharedFrequencyBandParameters::getS1)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- s2Col.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(SharedFrequencyBandParameters::getS2)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- xcCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(SharedFrequencyBandParameters::getXc)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- xtCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(SharedFrequencyBandParameters::getXt)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- qCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(SharedFrequencyBandParameters::getQ)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- minLengthCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(SharedFrequencyBandParameters::getMinLength)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- maxLengthCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(SharedFrequencyBandParameters::getMaxLength)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
-
- measureTimeCol.setCellValueFactory(x -> Bindings.createStringBinding(() -> Optional.ofNullable(x)
- .map(CellDataFeatures::getValue)
- .map(SharedFrequencyBandParameters::getMeasurementTime)
- .filter(Objects::nonNull)
- .map(dfmt2::format)
- .orElseGet(String::new)));
+ CellBindingUtils.attachTextCellFactories(v0Col, SharedFrequencyBandParameters::getVelocity0, dfmt4);
+ CellBindingUtils.attachTextCellFactories(v1Col, SharedFrequencyBandParameters::getVelocity1, dfmt4);
+ CellBindingUtils.attachTextCellFactories(v2Col, SharedFrequencyBandParameters::getVelocity2, dfmt4);
+ CellBindingUtils.attachTextCellFactories(b0Col, SharedFrequencyBandParameters::getBeta0, dfmt4);
+ CellBindingUtils.attachTextCellFactories(b1Col, SharedFrequencyBandParameters::getBeta1, dfmt4);
+ CellBindingUtils.attachTextCellFactories(b2Col, SharedFrequencyBandParameters::getBeta2, dfmt4);
+ CellBindingUtils.attachTextCellFactories(g0Col, SharedFrequencyBandParameters::getGamma0, dfmt4);
+ CellBindingUtils.attachTextCellFactories(g1Col, SharedFrequencyBandParameters::getGamma1, dfmt4);
+ CellBindingUtils.attachTextCellFactories(g2Col, SharedFrequencyBandParameters::getGamma2, dfmt4);
+
+ CellBindingUtils.attachEditableTextCellFactories(minSnrCol, SharedFrequencyBandParameters::getMinSnr, SharedFrequencyBandParameters::setMinSnr);
+
+ CellBindingUtils.attachTextCellFactories(s1Col, SharedFrequencyBandParameters::getS1);
+ CellBindingUtils.attachTextCellFactories(s2Col, SharedFrequencyBandParameters::getS2);
+ CellBindingUtils.attachTextCellFactories(xcCol, SharedFrequencyBandParameters::getXc);
+ CellBindingUtils.attachTextCellFactories(xtCol, SharedFrequencyBandParameters::getXt);
+ CellBindingUtils.attachTextCellFactories(qCol, SharedFrequencyBandParameters::getQ);
+
+ CellBindingUtils.attachEditableTextCellFactories(minLengthCol, SharedFrequencyBandParameters::getMinLength, SharedFrequencyBandParameters::setMinLength);
+ CellBindingUtils.attachEditableTextCellFactories(maxLengthCol, SharedFrequencyBandParameters::getMaxLength, SharedFrequencyBandParameters::setMaxLength);
+ CellBindingUtils.attachEditableTextCellFactories(measureTimeCol, SharedFrequencyBandParameters::getMeasurementTime, SharedFrequencyBandParameters::setMeasurementTime);
codaSharedTableView.setItems(sharedFbData);
}
diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/converters/sac/SacLoader.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/converters/sac/SacLoader.java
index 37bf5f1f..87419f6c 100644
--- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/converters/sac/SacLoader.java
+++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/converters/sac/SacLoader.java
@@ -79,7 +79,7 @@ public Result convertSacFileToWaveform(File file) {
return exceptionalResult(new LightweightIllegalStateException(String.format("Error parsing (%s): file does not exist or is unreadable. %s", "NULL", "File reference is null")));
}
- String fileName = file.getName();
+ String fileName = file.getPath().toString();
log.trace("Reading {} ", fileName);
SACFileReader reader = null;
try {
@@ -96,16 +96,22 @@ public Result convertSacFileToWaveform(File file) {
}
String stationName = headerResult.getResultPayload().get();
+ TimeT originTime = header.getOriginTime() != null ? header.getOriginTime() : header.getReferenceTime();
+ if (originTime == null) {
+ return exceptionalResult(new LightweightIllegalStateException("Both reference time and origin time may not be null!"));
+ }
+
String evid = null;
headerResult = validateHeaderDefined(fileName, "NEVID", header.nevid);
if (headerResult.isSuccess() && !headerResult.getResultPayload().get().equals("0")) {
evid = headerResult.getResultPayload().get();
- }
- else {
+ } else {
headerResult = validateHeaderDefined(fileName, "KEVNM", header.kevnm);
if (headerResult.isSuccess() && headerResult.getResultPayload().isPresent() && !headerResult.getResultPayload().get().isEmpty()) {
evid = headerResult.getResultPayload().get();
- }
+ } else {
+ evid = getOrCreateEvid(header);
+ }
}
headerResult = validateHeaderDefined(fileName, "KCMPNM", header.kcmpnm);
@@ -184,11 +190,15 @@ public Result convertSacFileToWaveform(File file) {
double sampleRate = header.delta > 0 ? 1.0 / header.delta : 1.0;
float[] rawVals = sequence.getArray();
Double[] segment = new Double[rawVals.length];
- IntStream.range(0, rawVals.length).forEach(index -> segment[index] = Double.valueOf(rawVals[index]));
-
- TimeT originTime = header.getOriginTime() != null ? header.getOriginTime() : header.getReferenceTime();
- if (originTime == null) {
- return exceptionalResult(new IllegalArgumentException("Both reference time and origin time may not be null!"));
+ try {
+ IntStream.range(0, rawVals.length).forEach(index -> {
+ segment[index] = Double.valueOf(rawVals[index]);
+ if (!Double.isFinite(segment[index])) {
+ throw new LightweightIllegalStateException("Invalid data in segment for file: " + fileName);
+ }
+ });
+ } catch (LightweightIllegalStateException e) {
+ return exceptionalResult(e);
}
return new Result<>(true,
@@ -241,14 +251,12 @@ private List getPicksFromHeader(SACHeader header) {
private Result validateDoubleDefinedAndInRange(String fileName, String headerName, float value, double minVal, double maxVal) {
Result validation = new Result<>(false, "");
- List exceptions = new ArrayList<>();
-
if (SACHeader.isDefault(value)) {
- exceptions.add(new LightweightIllegalStateException(String.format(SAC_HEADER_NOT_SET, fileName, headerName)));
+ validation.getErrors().add(new LightweightIllegalStateException(String.format(SAC_HEADER_NOT_SET, fileName, headerName)));
}
if (value < minVal || value > maxVal) {
- exceptions.add(new LightweightIllegalStateException(String.format("Error parsing (%s): SAC header variable %s must be between %f and %f! Actual value is %f",
+ validation.getErrors().add(new LightweightIllegalStateException(String.format("Error parsing (%s): SAC header variable %s must be between %f and %f! Actual value is %f",
fileName,
headerName,
minVal,
@@ -266,10 +274,9 @@ private Result validateDoubleDefinedAndInRange(String fileName, String h
private Result validateHeaderDefined(String fileName, String headerName, int headerValue) {
String validHeader = null;
Result validation = new Result<>(false, validHeader);
- List exceptions = new ArrayList<>();
if (SACHeader.isDefault(headerValue)) {
- exceptions.add(new LightweightIllegalStateException(String.format(SAC_HEADER_NOT_SET, fileName, headerName)));
+ validation.getErrors().add(new LightweightIllegalStateException(String.format(SAC_HEADER_NOT_SET, fileName, headerName)));
} else {
validHeader = Integer.toString(headerValue);
validation.setResultPayload(Optional.of(validHeader));
@@ -286,10 +293,9 @@ private Result validateHeaderDefined(String fileName, String headerName,
String validHeader = StringUtils.trimToEmpty(headerValue);
Result validation = new Result<>(false, validHeader);
- List exceptions = new ArrayList<>();
if (SACHeader.isDefault(validHeader)) {
- exceptions.add(new LightweightIllegalStateException(String.format(SAC_HEADER_NOT_SET, fileName, headerName)));
+ validation.getErrors().add(new LightweightIllegalStateException(String.format(SAC_HEADER_NOT_SET, fileName, headerName)));
}
if (validation.getErrors().isEmpty()) {
@@ -313,4 +319,25 @@ private Result exceptionalResult(List errors) {
public PathMatcher getMatchingPattern() {
return filter;
}
+
+ private String getOrCreateEvid(SACHeader header) {
+ int evid = 0;
+ Double time = 0d;
+ if (header.getOriginTime() != null) {
+ time = header.getOriginTime().getEpochTime();
+ } else if (header.getReferenceTime() != null) {
+ time = header.getReferenceTime().getEpochTime();
+ }
+ evid = createJDateMinuteResolutionFromEpoch(time);
+ return Integer.toString(evid);
+ }
+
+ private int createJDateMinuteResolutionFromEpoch(Double instant) {
+ TimeT time = new TimeT(instant);
+ int jDate = time.getYear() % 100;
+ jDate = jDate * 1000 + time.getJDay();
+ jDate = jDate * 100 + time.getHour();
+ jDate = jDate * 100 + time.getMinute();
+ return jDate;
+ }
}
diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/events/LoadStartingEvent.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/events/LoadStartingEvent.java
new file mode 100644
index 00000000..4fa39cbf
--- /dev/null
+++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/events/LoadStartingEvent.java
@@ -0,0 +1,18 @@
+/*
+* 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.
+*
+* 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.events;
+
+public class LoadStartingEvent {
+}
diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/events/ShowFailureReportEvent.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/events/ShowFailureReportEvent.java
new file mode 100644
index 00000000..885badc8
--- /dev/null
+++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/events/ShowFailureReportEvent.java
@@ -0,0 +1,18 @@
+/*
+* 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.
+*
+* 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.events;
+
+public class ShowFailureReportEvent {
+}
diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/plotting/CodaWaveformPlot.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/plotting/CodaWaveformPlot.java
index 8eac6cff..b6ff8b23 100644
--- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/plotting/CodaWaveformPlot.java
+++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/plotting/CodaWaveformPlot.java
@@ -53,183 +53,229 @@
public class CodaWaveformPlot extends SeriesPlot {
- private final Logger log = LoggerFactory.getLogger(this.getClass());
-
- private NumberFormat dfmt4 = NumberFormatFactory.fourDecimalOneLeadingZero();
-
- private Map pickLineMap = new HashMap<>();
-
- private WaveformClient waveformClient;
-
- private ParameterClient paramClient;
-
- private ShapeMeasurementClient shapeClient;
-
- public CodaWaveformPlot(String xLabel, WaveformClient waveformClient, ShapeMeasurementClient shapeClient, ParameterClient paramClient, TimeSeries... seismograms) {
- super(xLabel, seismograms);
- this.waveformClient = waveformClient;
- this.shapeClient = shapeClient;
- this.paramClient = paramClient;
- }
-
- private static final long serialVersionUID = 1L;
-
- public void setWaveform(Waveform waveform) {
- setWaveform(waveform, null);
- }
-
- public void setWaveform(SyntheticCoda synth) {
- setWaveform(synth.getSourceWaveform(), synth);
- }
-
- public void setWaveform(Waveform waveform, SyntheticCoda synth) {
- this.clear();
- pickLineMap.clear();
-
- if (waveform.getSegment() != null) {
- getXaxis().setLabelText("");
- paramClient.getSharedFrequencyBandParametersForFrequency(new FrequencyBand(waveform.getLowFrequency(), waveform.getHighFrequency())).subscribe(params -> {
- shapeClient.getMeasuredShape(waveform.getId()).subscribe(shape -> {
- TimeT beginTime = new TimeT(waveform.getBeginTime());
- float[] waveformSegment = doublesToFloats(waveform.getSegment());
- TimeSeries series = new TimeSeries(waveformSegment, waveform.getSampleRate(), beginTime);
- this.addSeismogram(series);
- JSubplot subplot = this.getSubplot(series);
- subplot.setYlimits(subplot.getYaxis().getMin() - 1.0, subplot.getYaxis().getMax() + 1.0);
- Legend legend = new Legend(getTitle().getFontName(), getTitle().getFontSize(), HorizPinEdge.RIGHT, VertPinEdge.TOP, 5, 5);
- legend.addLabeledLine(waveform.getStream().getStation().getStationName() + "_" + waveform.getEvent().getEventId() + "_" + waveform.getLowFrequency() + "_"
- + waveform.getHighFrequency(), new Line(0, series.getDelta(), series.getData(), 1));
- subplot.AddPlotObject(legend);
-
- List picks = waveform.getAssociatedPicks();
- if (picks != null) {
- //1221: Plotting throws a runtime error if a pick is before/after the bounds of the waveform so we need to check that
- for (WaveformPick pick : picks) {
- double pickTime = new TimeT(waveform.getEvent().getOriginTime()).getEpochTime() + pick.getPickTimeSecFromOrigin();
- if (pickTime >= new TimeT(waveform.getBeginTime()).getEpochTime() && pickTime <= new TimeT(waveform.getEndTime()).getEpochTime()) {
- Collection pickLines = this.addPick(pick.getPickName(), pickTime);
- for (VPickLine pickLine : pickLines) {
- pickLine.setDraggable(true);
- pickLineMap.put(pickLine, pick);
- }
- }
- }
- }
-
- if (shape != null && shape.getId() != null) {
- try {
- series = new TimeSeries(waveformSegment, waveform.getSampleRate(), beginTime);
- series.interpolate(1.0);
- float[] fitSegment = new float[series.getData().length];
-
- double gamma = shape.getMeasuredGamma();
- double beta = shape.getMeasuredBeta();
- double intercept = shape.getMeasuredIntercept();
-
- int timeShift = (int) (new TimeT(shape.getMeasuredTime()).subtractD(beginTime) - 0.5);
- for (int i = 0; i < series.getData().length; i++) {
- fitSegment[i] = (float) (intercept - gamma * Math.log10(i + 1) + beta * (i + 1));
- }
-
- TimeSeries fitSeries = new TimeSeries(fitSegment, series.getSamprate(), series.getTime());
- subplot.AddPlotObject(createLine(timeShift, 0.0, fitSeries, Color.GRAY));
- repaint();
- } catch (IllegalArgumentException e) {
- log.warn(e.getMessage(), e);
- }
- }
-
- if (synth != null && params != null) {
- try {
- series = new TimeSeries(waveformSegment, waveform.getSampleRate(), beginTime);
- float[] synthSegment = doublesToFloats(synth.getSegment());
- TimeSeries synthSeries = new TimeSeries(synthSegment, synth.getSampleRate(), new TimeT(synth.getBeginTime()));
- WaveformPick endPick = null;
- for (WaveformPick p : waveform.getAssociatedPicks()) {
- if (PICK_TYPES.F.name().equals(p.getPickType())) {
- endPick = p;
- break;
- }
- }
- TimeT endTime;
- if (endPick != null && endPick.getPickTimeSecFromOrigin() > 0 && waveform.getEvent() != null) {
- endTime = new TimeT(waveform.getEvent().getOriginTime()).add(endPick.getPickTimeSecFromOrigin());
- } else {
- endTime = new TimeT(synth.getEndTime());
- }
-
- series.interpolate(synthSeries.getSamprate());
-
- Station station = synth.getSourceWaveform().getStream().getStation();
- Event event = synth.getSourceWaveform().getEvent();
-
- double distance = EModel.getDistanceWGS84(event.getLatitude(), event.getLongitude(), station.getLatitude(), station.getLongitude());
- double vr = params.getVelocity0() - params.getVelocity1() / (params.getVelocity2() + distance);
- if (vr == 0.0) {
- vr = 1.0;
- }
- TimeT originTime = new TimeT(event.getOriginTime());
- TimeT startTime = originTime.add(distance / vr);
-
- if (startTime.lt(endTime)) {
- series.cut(startTime, endTime);
- synthSeries.cut(startTime, endTime);
-
- TimeSeries diffSeis = series.subtract(synthSeries);
-
- int timeShift = (int) (startTime.subtractD(beginTime) - 0.5);
-
- double median = diffSeis.getMedian();
- double baz = EModel.getBAZ(station.getLatitude(), station.getLongitude(), event.getLatitude(), event.getLongitude());
-
- getXaxis().setLabelText(getXaxis().getLabelText() + "Shift: " + dfmt4.format(median) + ", Distance: " + dfmt4.format(distance) + ", BAz: " + dfmt4.format(baz));
- subplot.AddPlotObject(createLine(timeShift, median, synthSeries, Color.GREEN));
- repaint();
- }
- } catch (IllegalArgumentException e) {
- log.warn(e.getMessage(), e);
- }
- }
- });
- });
- }
- }
-
- private PlotObject createLine(int timeShift, double valueShift, TimeSeries timeSeries, Color lineColor) {
-
- Line line = new Line(timeShift, timeSeries.getDelta(), SeriesMath.Add(timeSeries.getData(), valueShift), 1);
- line.setColor(lineColor);
- line.setWidth(3);
- return line;
- }
-
- /* (non-Javadoc)
- * @see llnl.gnem.core.gui.waveform.WaveformPlot#handlePickMovedState(java.lang.Object)T
- */
- @Override
- protected void handlePickMovedState(Object obj) {
- super.handlePickMovedState(obj);
- PickMovedState pms = (PickMovedState) obj;
- VPickLine vpl = pms.getPickLine();
-
- if (vpl != null) {
- try {
- WaveformPick pick = pickLineMap.get(vpl);
- if (pick != null) {
- pick.setPickTimeSecFromOrigin((float) (vpl.getXval() - new TimeT(pick.getWaveform().getEvent().getOriginTime()).subtractD(new TimeT(pick.getWaveform().getBeginTime()))));
- waveformClient.postWaveform(pick.getWaveform()).subscribe(this::setWaveform);
- }
- } catch (ClassCastException | JsonProcessingException e) {
- log.info("Error updating Waveform, {}", e);
- }
- }
- }
-
- public static float[] doublesToFloats(Double[] x) {
- float[] xfloats = new float[x.length];
- for (int i = 0; i < x.length; i++) {
- xfloats[i] = x[i].floatValue();
- }
- return xfloats;
- }
+ private final Logger log = LoggerFactory.getLogger(this.getClass());
+
+ private NumberFormat dfmt4 = NumberFormatFactory.fourDecimalOneLeadingZero();
+
+ private Map pickLineMap = new HashMap<>();
+
+ private WaveformClient waveformClient;
+
+ private ParameterClient paramClient;
+
+ private ShapeMeasurementClient shapeClient;
+
+ public CodaWaveformPlot(String xLabel, WaveformClient waveformClient, ShapeMeasurementClient shapeClient,
+ ParameterClient paramClient, TimeSeries... seismograms) {
+ super(xLabel, seismograms);
+ this.waveformClient = waveformClient;
+ this.shapeClient = shapeClient;
+ this.paramClient = paramClient;
+ }
+
+ private static final long serialVersionUID = 1L;
+
+ public void setWaveform(Waveform waveform) {
+ setWaveform(waveform, null);
+ }
+
+ public void setWaveform(SyntheticCoda synth) {
+ setWaveform(synth.getSourceWaveform(), synth);
+ }
+
+ public void setWaveform(Waveform waveform, SyntheticCoda synth) {
+ this.clear();
+ pickLineMap.clear();
+
+ if (waveform.getSegment() != null) {
+ getXaxis().setLabelText("");
+ paramClient .getSharedFrequencyBandParametersForFrequency(new FrequencyBand(waveform.getLowFrequency(),
+ waveform.getHighFrequency()))
+ .subscribe(params -> {
+ shapeClient.getMeasuredShape(waveform.getId()).subscribe(shape -> {
+ TimeT beginTime = new TimeT(waveform.getBeginTime());
+ float[] waveformSegment = doublesToFloats(waveform.getSegment());
+
+ TimeSeries series = new TimeSeries( waveformSegment, waveform.getSampleRate(),
+ beginTime);
+
+ this.addSeismogram(series);
+ JSubplot subplot = this.getSubplot(series);
+ subplot.setYlimits( subplot.getYaxis().getMin() - 1.0,
+ subplot.getYaxis().getMax() + 1.0);
+ Legend legend = new Legend( getTitle().getFontName(), getTitle().getFontSize(),
+ HorizPinEdge.RIGHT, VertPinEdge.TOP, 5, 5);
+ legend.addLabeledLine( waveform.getStream().getStation().getStationName() + "_"
+ + waveform.getEvent().getEventId() + "_" + waveform.getLowFrequency() + "_"
+ + waveform.getHighFrequency(),
+ new Line(0, series.getDelta(), series.getData(), 1));
+ subplot.AddPlotObject(legend);
+
+ List picks = waveform.getAssociatedPicks();
+ if (picks != null) {
+ // 1221: Plotting throws a runtime error if
+ // a pick is before/after the bounds of the
+ // waveform so we need to check that
+ for (WaveformPick pick : picks) {
+ double pickTime = new TimeT(waveform.getEvent().getOriginTime()).getEpochTime()
+ + pick.getPickTimeSecFromOrigin();
+ if (pickTime >= new TimeT(waveform.getBeginTime()).getEpochTime()
+ && pickTime <= new TimeT(waveform.getEndTime()).getEpochTime()) {
+ Collection pickLines = this.addPick( pick.getPickName(),
+ pickTime);
+ for (VPickLine pickLine : pickLines) {
+ pickLine.setDraggable(true);
+ pickLineMap.put(pickLine, pick);
+ }
+ }
+ }
+ }
+
+ if (shape != null && shape.getId() != null) {
+ try {
+ series = new TimeSeries(waveformSegment, waveform.getSampleRate(), beginTime);
+ series.interpolate(1.0);
+ float[] fitSegment = new float[series.getData().length];
+
+ double gamma = shape.getMeasuredGamma();
+ double beta = shape.getMeasuredBeta();
+ double intercept = shape.getMeasuredIntercept();
+
+ int timeShift = (int) (new TimeT(shape.getMeasuredTime()).subtractD(beginTime)
+ - 0.5);
+ for (int i = 0; i < series.getData().length; i++) {
+ fitSegment[i] = (float) (intercept - gamma * Math.log10(i + 1)
+ + beta * (i + 1));
+ }
+
+ TimeSeries fitSeries = new TimeSeries( fitSegment, series.getSamprate(),
+ series.getTime());
+ subplot.AddPlotObject(createLine(timeShift, 0.0, fitSeries, Color.GRAY));
+ repaint();
+ } catch (IllegalArgumentException e) {
+ log.warn(e.getMessage(), e);
+ }
+ }
+
+ if (synth != null && params != null) {
+ try {
+ series = new TimeSeries(waveformSegment, waveform.getSampleRate(), beginTime);
+ float[] synthSegment = doublesToFloats(synth.getSegment());
+ TimeSeries synthSeries = new TimeSeries(synthSegment, synth.getSampleRate(),
+ new TimeT(synth.getBeginTime()));
+ WaveformPick endPick = null;
+ for (WaveformPick p : waveform.getAssociatedPicks()) {
+ if (PICK_TYPES.F.name().equals(p.getPickType())) {
+ endPick = p;
+ break;
+ }
+ }
+ TimeT endTime;
+ if (endPick != null && endPick.getPickTimeSecFromOrigin() > 0
+ && waveform.getEvent() != null) {
+ endTime = new TimeT(waveform.getEvent()
+ .getOriginTime()).add(endPick.getPickTimeSecFromOrigin());
+ } else {
+ endTime = new TimeT(synth.getEndTime());
+ }
+
+ series.interpolate(synthSeries.getSamprate());
+
+ Station station = synth.getSourceWaveform().getStream().getStation();
+ Event event = synth.getSourceWaveform().getEvent();
+
+ double distance = EModel.getDistanceWGS84( event.getLatitude(),
+ event.getLongitude(),
+ station.getLatitude(),
+ station.getLongitude());
+ double vr = params.getVelocity0()
+ - params.getVelocity1() / (params.getVelocity2() + distance);
+ if (vr == 0.0) {
+ vr = 1.0;
+ }
+ TimeT originTime = new TimeT(event.getOriginTime());
+ TimeT startTime;
+ TimeT trimTime = originTime.add(distance / vr);
+ TimeSeries trimmedWaveform = new TimeSeries(waveformSegment, waveform.getSampleRate(), beginTime);
+ try {
+ trimmedWaveform.cutBefore(trimTime);
+ trimmedWaveform.cutAfter(trimTime.add(30.0));
+
+ startTime = new TimeT(trimTime.getEpochTime()
+ + trimmedWaveform.getMaxTime()[0]);
+ } catch (IllegalArgumentException e) {
+ startTime = trimTime;
+ }
+
+ if (startTime.lt(endTime)) {
+ series.cut(startTime, endTime);
+ synthSeries.cut(startTime, endTime);
+
+ TimeSeries diffSeis = series.subtract(synthSeries);
+
+ int timeShift = (int) (startTime.subtractD(beginTime) - 0.5);
+
+ double median = diffSeis.getMedian();
+ double baz = EModel.getBAZ( station.getLatitude(), station.getLongitude(),
+ event.getLatitude(), event.getLongitude());
+
+ getXaxis().setLabelText(getXaxis().getLabelText() + "Shift: "
+ + dfmt4.format(median) + ", Distance: " + dfmt4.format(distance)
+ + ", BAz: " + dfmt4.format(baz));
+ subplot.AddPlotObject(createLine( timeShift, median, synthSeries,
+ Color.GREEN));
+ repaint();
+ }
+ } catch (IllegalArgumentException e) {
+ log.warn(e.getMessage(), e);
+ }
+ }
+ });
+ });
+ }
+ }
+
+ private PlotObject createLine(int timeShift, double valueShift, TimeSeries timeSeries, Color lineColor) {
+
+ Line line = new Line(timeShift, timeSeries.getDelta(), SeriesMath.Add(timeSeries.getData(), valueShift), 1);
+ line.setColor(lineColor);
+ line.setWidth(3);
+ return line;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * llnl.gnem.core.gui.waveform.WaveformPlot#handlePickMovedState(java.lang.
+ * Object)T
+ */
+ @Override
+ protected void handlePickMovedState(Object obj) {
+ super.handlePickMovedState(obj);
+ PickMovedState pms = (PickMovedState) obj;
+ VPickLine vpl = pms.getPickLine();
+
+ if (vpl != null) {
+ try {
+ WaveformPick pick = pickLineMap.get(vpl);
+ if (pick != null) {
+ pick.setPickTimeSecFromOrigin((float) (vpl.getXval()
+ - new TimeT(pick.getWaveform().getEvent()
+ .getOriginTime()).subtractD(new TimeT(pick.getWaveform().getBeginTime()))));
+ waveformClient.postWaveform(pick.getWaveform()).subscribe(this::setWaveform);
+ }
+ } catch (ClassCastException | JsonProcessingException e) {
+ log.info("Error updating Waveform, {}", e);
+ }
+ }
+ }
+
+ public static float[] doublesToFloats(Double[] x) {
+ float[] xfloats = new float[x.length];
+ for (int i = 0; i < x.length; i++) {
+ xfloats[i] = x[i].floatValue();
+ }
+ return xfloats;
+ }
}
diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/util/CalibrationProgressListener.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/util/CalibrationProgressListener.java
index ee6c4842..a7b99076 100644
--- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/util/CalibrationProgressListener.java
+++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/util/CalibrationProgressListener.java
@@ -24,7 +24,7 @@
public class CalibrationProgressListener extends ProgressListener {
private CalibrationStatusEvent cachedEvent;
- private Progress progress = new Progress(1l, 0l);
+ private Progress progress = new Progress(1l, -1l);
public CalibrationProgressListener(EventBus bus, CalibrationStatusEvent event) {
bus.register(this);
@@ -38,7 +38,7 @@ private void listener(CalibrationStatusEvent event) {
if (cachedEvent.getStatus() == Status.COMPLETE || cachedEvent.getStatus() == Status.ERROR) {
progress.setCurrent(1l);
} else {
- progress.setCurrent(0l);
+ progress.setCurrent(-1l);
}
this.setChanged();
this.notifyObservers(progress);
diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/util/CellBindingUtils.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/util/CellBindingUtils.java
new file mode 100644
index 00000000..f951a501
--- /dev/null
+++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/util/CellBindingUtils.java
@@ -0,0 +1,67 @@
+/*
+* 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.
+*
+* 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.util;
+
+import java.text.NumberFormat;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.function.BiConsumer;
+import java.util.function.Function;
+
+import javafx.beans.binding.Bindings;
+import javafx.beans.value.ObservableValue;
+import javafx.scene.control.TableColumn;
+import javafx.scene.control.TableColumn.CellDataFeatures;
+import javafx.scene.control.cell.TextFieldTableCell;
+import javafx.util.Callback;
+
+public class CellBindingUtils {
+
+ private static NumberFormat DEFAULT_NUMBER_FORMAT = NumberFormatFactory.twoDecimalOneLeadingZero();
+
+ public static void attachTextCellFactories(TableColumn col, Function getValue) {
+ attachTextCellFactories(col, getValue, DEFAULT_NUMBER_FORMAT);
+ }
+
+ public static void attachTextCellFactoriesString(TableColumn col, Function getValue) {
+ col.setCellValueFactory(stringFormatCellBinding(getValue));
+ }
+
+ public static void attachTextCellFactories(TableColumn col, Function getValue, NumberFormat format) {
+ col.setCellValueFactory(numberFormatCellBinding(getValue, format));
+ }
+
+ public static void attachEditableTextCellFactories(TableColumn col, Function getValue, BiConsumer setValue) {
+ attachEditableTextCellFactories(col, getValue, setValue, DEFAULT_NUMBER_FORMAT);
+ }
+
+ public static void attachEditableTextCellFactories(TableColumn col, Function getValue, BiConsumer setValue, NumberFormat format) {
+ attachTextCellFactories(col, getValue, format);
+ col.setCellFactory(TextFieldTableCell.forTableColumn());
+ col.setOnEditCommit(new WrappingEventHandler(col.getOnEditCommit(), setValue));
+ }
+
+ private static Callback, ObservableValue> numberFormatCellBinding(Function getValue, NumberFormat formatter) {
+ return x -> Bindings.createStringBinding(() -> getOptionalValue(x, getValue).map(formatter::format).orElseGet(String::new));
+ }
+
+ private static Callback, ObservableValue> stringFormatCellBinding(Function getValue) {
+ return x -> Bindings.createStringBinding(() -> getOptionalValue(x, getValue).orElseGet(String::new));
+ }
+
+ private static Optional getOptionalValue(CellDataFeatures x, Function getValue) {
+ return Optional.ofNullable(x).map(CellDataFeatures::getValue).map(getValue::apply).filter(Objects::nonNull);
+ }
+}
diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/util/ClickUtils.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/util/ClickUtils.java
new file mode 100644
index 00000000..50a5cbf9
--- /dev/null
+++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/util/ClickUtils.java
@@ -0,0 +1,32 @@
+/*
+* 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.
+*
+* 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.util;
+
+import javafx.event.Event;
+import javafx.scene.Node;
+import javafx.scene.input.MouseButton;
+import javafx.scene.input.MouseEvent;
+
+public class ClickUtils {
+
+ public static void clickNode(Node target) {
+ try {
+ Event.fireEvent(target, new MouseEvent(MouseEvent.MOUSE_CLICKED,
+ target.getScene().getX(), target.getScene().getY(), target.getScene().getX(), target.getScene().getY(), MouseButton.PRIMARY, 1,
+ false, false, false, false, true, false, false, false, false, true, null));
+ }
+ finally {}
+ }
+}
diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/util/ProgressMonitor.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/util/ProgressMonitor.java
index cc5035fa..7df53e31 100644
--- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/util/ProgressMonitor.java
+++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/util/ProgressMonitor.java
@@ -50,7 +50,7 @@ public ProgressMonitor(String displayableName, ProgressListener progressListener
Parent root = fxmlLoader.load();
this.getChildren().add(root);
- if (progressListener.getProgress() > 0.0) {
+ if (progressListener.getProgress() >= 0.0) {
progressBar.setProgress(progressListener.getProgress());
} else {
progressBar.setProgress(ProgressBar.INDETERMINATE_PROGRESS);
@@ -67,7 +67,7 @@ public void update(Observable o, Object event) {
if (event instanceof Progress) {
Progress progress = (Progress) event;
Platform.runLater(() -> {
- if (progress.getTotal() > 0.0) {
+ if (progress.getTotal() >= 0.0) {
label.setText(progress.getCurrent() + "/" + progress.getTotal());
progressBar.setProgress(progress.getProgress());
} else {
@@ -81,4 +81,8 @@ public void update(Observable o, Object event) {
public String getDisplayableName() {
return displayableName;
}
+
+ public ProgressBar getProgressBar() {
+ return progressBar;
+ }
}
diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/util/WrappingEventHandler.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/util/WrappingEventHandler.java
new file mode 100644
index 00000000..2a8576df
--- /dev/null
+++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/util/WrappingEventHandler.java
@@ -0,0 +1,43 @@
+/*
+* 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.
+*
+* 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.util;
+
+import java.util.function.BiConsumer;
+
+import javafx.event.EventHandler;
+import javafx.scene.control.TableColumn.CellEditEvent;
+
+public class WrappingEventHandler implements EventHandler> {
+
+ private EventHandler> existingHandler;
+ private BiConsumer setValue;
+
+ public WrappingEventHandler(EventHandler> existingHandler, BiConsumer setValue) {
+ this.existingHandler = existingHandler;
+ this.setValue = setValue;
+ }
+
+ @Override
+ public void handle(CellEditEvent e) {
+ try {
+ setValue.accept(e.getRowValue(), Double.valueOf(e.getNewValue()));
+ } catch (Exception ex) {
+ }
+ if (existingHandler != null) {
+ existingHandler.handle(e);
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/calibration-gui/src/main/resources/fxml/CodaGui.css b/calibration-gui/src/main/resources/fxml/CodaGui.css
index 8bb202a1..3fc3427d 100644
--- a/calibration-gui/src/main/resources/fxml/CodaGui.css
+++ b/calibration-gui/src/main/resources/fxml/CodaGui.css
@@ -10,4 +10,8 @@
-fx-word-wrap: normal;
-fx-white-space: nowrap;
-fx-direction: ltr;
+}
+
+.red-bar {
+ -fx-accent: red;
}
\ No newline at end of file
diff --git a/calibration-gui/src/main/resources/fxml/CodaGui.fxml b/calibration-gui/src/main/resources/fxml/CodaGui.fxml
index 8aa4eb8d..b78b28c0 100644
--- a/calibration-gui/src/main/resources/fxml/CodaGui.fxml
+++ b/calibration-gui/src/main/resources/fxml/CodaGui.fxml
@@ -32,7 +32,7 @@
diff --git a/calibration-gui/src/main/resources/fxml/FailureReport.fxml b/calibration-gui/src/main/resources/fxml/FailureReport.fxml
new file mode 100644
index 00000000..b05e5fe4
--- /dev/null
+++ b/calibration-gui/src/main/resources/fxml/FailureReport.fxml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/calibration-gui/src/main/resources/fxml/Model.fxml b/calibration-gui/src/main/resources/fxml/Model.fxml
index bbf2eeca..37c29c91 100644
--- a/calibration-gui/src/main/resources/fxml/Model.fxml
+++ b/calibration-gui/src/main/resources/fxml/Model.fxml
@@ -12,18 +12,18 @@
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -33,22 +33,22 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/calibration-gui/src/main/resources/fxml/SharedBand.fxml b/calibration-gui/src/main/resources/fxml/SharedBand.fxml
index 9d873a42..f6cdf5cb 100644
--- a/calibration-gui/src/main/resources/fxml/SharedBand.fxml
+++ b/calibration-gui/src/main/resources/fxml/SharedBand.fxml
@@ -9,12 +9,12 @@
-
+
-
+
-
-
+
+
@@ -38,19 +38,19 @@
-
+
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/calibration-gui/src/main/resources/leaflet/leaflet-debug.html b/calibration-gui/src/main/resources/leaflet/leaflet-debug.html
index 95f00c24..523ffbde 100644
--- a/calibration-gui/src/main/resources/leaflet/leaflet-debug.html
+++ b/calibration-gui/src/main/resources/leaflet/leaflet-debug.html
@@ -1,20 +1,22 @@
+
-
-
-
-
-
+
+
+
+
+
-
-
+
+
+
\ No newline at end of file
diff --git a/calibration-service/application/pom.xml b/calibration-service/application/pom.xml
index 6b196117..465e7882 100644
--- a/calibration-service/application/pom.xml
+++ b/calibration-service/application/pom.xml
@@ -4,7 +4,7 @@
gov.llnl.gnem.apps.coda.calibration
calibration-service
- 1.0.1
+ 1.0.2
4.0.0
application
diff --git a/calibration-service/application/src/main/java/gov/llnl/gnem/apps/coda/calibration/CalibrationApplication.java b/calibration-service/application/src/main/java/gov/llnl/gnem/apps/coda/calibration/CalibrationApplication.java
index 5e2a7fca..be1a7bc3 100644
--- a/calibration-service/application/src/main/java/gov/llnl/gnem/apps/coda/calibration/CalibrationApplication.java
+++ b/calibration-service/application/src/main/java/gov/llnl/gnem/apps/coda/calibration/CalibrationApplication.java
@@ -14,6 +14,10 @@
*/
package gov.llnl.gnem.apps.coda.calibration;
+import java.util.TimeZone;
+
+import javax.annotation.PostConstruct;
+
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -21,6 +25,11 @@
@SpringBootApplication
@EnableAutoConfiguration
public class CalibrationApplication {
+ @PostConstruct
+ void started() {
+ TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
+ }
+
public static void main(String[] args) {
SpringApplication.run(CalibrationApplication.class, args);
}
diff --git a/calibration-service/application/src/main/java/gov/llnl/gnem/apps/coda/calibration/application/config/WebSocketConfig.java b/calibration-service/application/src/main/java/gov/llnl/gnem/apps/coda/calibration/application/config/WebSocketConfig.java
index 0d751199..791e6b24 100644
--- a/calibration-service/application/src/main/java/gov/llnl/gnem/apps/coda/calibration/application/config/WebSocketConfig.java
+++ b/calibration-service/application/src/main/java/gov/llnl/gnem/apps/coda/calibration/application/config/WebSocketConfig.java
@@ -17,13 +17,13 @@
import org.springframework.context.annotation.Configuration;
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
import org.springframework.scheduling.concurrent.DefaultManagedTaskScheduler;
-import org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer;
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
+import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer;
@Configuration
@EnableWebSocketMessageBroker
-public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {
+public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
diff --git a/calibration-service/application/src/main/resources/application-dev.properties b/calibration-service/application/src/main/resources/application-dev.properties
index fff5dd05..b65fd4d5 100644
--- a/calibration-service/application/src/main/resources/application-dev.properties
+++ b/calibration-service/application/src/main/resources/application-dev.properties
@@ -8,7 +8,7 @@ spring.datasource.url=jdbc\:h2\:file\:./codaH2.db;DB_CLOSE_DELAY\=-1;COMPRESS=TR
#spring.jpa.properties.hibernate.format_sql=true
#spring.jpa.properties.hibernate.generate_statistics=true
#spring.jpa.show-sql=true
-spring.messages.cache-seconds=0
+spring.messages.cache-duration=0
server.port=53921
spring.jpa.hibernate.ddl-auto=update
server.ssl.key-alias=selfsigned
@@ -17,4 +17,5 @@ server.ssl.key-store=classpath:coda-keystore.jks
server.ssl.key-store-provider=SUN
server.ssl.key-store-type=JKS
spring.datasource.continueOnError=true
-spring.jdbc.template.fetch-size=1000
\ No newline at end of file
+spring.jdbc.template.fetch-size=1000
+spring.jpa.properties.hibernate.jdbc.time_zone = UTC
\ No newline at end of file
diff --git a/calibration-service/application/src/main/resources/application-file.properties b/calibration-service/application/src/main/resources/application-file.properties
index 891e7925..58776c3c 100644
--- a/calibration-service/application/src/main/resources/application-file.properties
+++ b/calibration-service/application/src/main/resources/application-file.properties
@@ -12,4 +12,5 @@ server.ssl.key-store-provider=SUN
server.ssl.key-store-type=JKS
spring.datasource.continueOnError=true
spring.datasource.hikari.connection-timeout=0
-spring.jdbc.template.fetch-size=1000
\ No newline at end of file
+spring.jdbc.template.fetch-size=1000
+spring.jpa.properties.hibernate.jdbc.time_zone = UTC
\ No newline at end of file
diff --git a/calibration-service/application/src/main/resources/application.properties b/calibration-service/application/src/main/resources/application.properties
index 80c9f22b..354402d8 100644
--- a/calibration-service/application/src/main/resources/application.properties
+++ b/calibration-service/application/src/main/resources/application.properties
@@ -10,4 +10,5 @@ server.ssl.key-store=classpath:coda-keystore.jks
server.ssl.key-store-provider=SUN
server.ssl.key-store-type=JKS
spring.datasource.continueOnError=true
-spring.jdbc.template.fetch-size=1000
\ No newline at end of file
+spring.jdbc.template.fetch-size=1000
+spring.jpa.properties.hibernate.jdbc.time_zone = UTC
\ No newline at end of file
diff --git a/calibration-service/application/src/main/resources/data.sql b/calibration-service/application/src/main/resources/data.sql
index dd230b29..dffdd6ce 100644
--- a/calibration-service/application/src/main/resources/data.sql
+++ b/calibration-service/application/src/main/resources/data.sql
@@ -5,17 +5,17 @@ INSERT INTO "MDACPS" (ID, DEL_ETA, DEL_GAMMA0, DELQ0, DIST_CRIT, ETA, GAMMA0, PH
INSERT INTO "MDACFI" (ID, ALPHAR, ALPHAS, BETAS, BETAR, DEL_PSI, DEL_SIGMA, M0REF, PSI, RAD_PATP, RAD_PATS, RHOR, RHOS, SIGMA, VERSION, ZETA) VALUES ('1', '5000', '6000', '3500', '2900', '0', '0', '10000000000000000', '0.25', '0.44', '0.6', '2500', '2700', '0.3', '0', '1')
-INSERT INTO "SHARED_FB_PARAMS" (ID, BETA0, BETA1, BETA2, GAMMA0, GAMMA1, GAMMA2, LOW_FREQUENCY, HIGH_FREQUENCY,MIN_SNR, Q, S1, S2, VELOCITY0, VELOCITY1, VELOCITY2, VERSION, XC, XT, MIN_LENGTH, MAX_LENGTH, MEASURE_TIME) VALUES ('1', '0', '0', '0', '0', '0', '0', '0.0200', '0.0300', '1.5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '300', '1000','100')
-INSERT INTO "SHARED_FB_PARAMS" (ID, BETA0, BETA1, BETA2, GAMMA0, GAMMA1, GAMMA2, LOW_FREQUENCY, HIGH_FREQUENCY,MIN_SNR, Q, S1, S2, VELOCITY0, VELOCITY1, VELOCITY2, VERSION, XC, XT, MIN_LENGTH, MAX_LENGTH, MEASURE_TIME) VALUES ('2', '0', '0', '0', '0', '0', '0', '0.0300', '0.0500', '1.5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '300', '800', '100')
-INSERT INTO "SHARED_FB_PARAMS" (ID, BETA0, BETA1, BETA2, GAMMA0, GAMMA1, GAMMA2, LOW_FREQUENCY, HIGH_FREQUENCY,MIN_SNR, Q, S1, S2, VELOCITY0, VELOCITY1, VELOCITY2, VERSION, XC, XT, MIN_LENGTH, MAX_LENGTH, MEASURE_TIME) VALUES ('3', '0', '0', '0', '0', '0', '0', '0.0500', '0.1000', '1.5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '250', '600', '100')
-INSERT INTO "SHARED_FB_PARAMS" (ID, BETA0, BETA1, BETA2, GAMMA0, GAMMA1, GAMMA2, LOW_FREQUENCY, HIGH_FREQUENCY,MIN_SNR, Q, S1, S2, VELOCITY0, VELOCITY1, VELOCITY2, VERSION, XC, XT, MIN_LENGTH, MAX_LENGTH, MEASURE_TIME) VALUES ('4', '0', '0', '0', '0', '0', '0', '0.1000', '0.2000', '1.5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '250', '550', '100')
-INSERT INTO "SHARED_FB_PARAMS" (ID, BETA0, BETA1, BETA2, GAMMA0, GAMMA1, GAMMA2, LOW_FREQUENCY, HIGH_FREQUENCY,MIN_SNR, Q, S1, S2, VELOCITY0, VELOCITY1, VELOCITY2, VERSION, XC, XT, MIN_LENGTH, MAX_LENGTH, MEASURE_TIME) VALUES ('5', '0', '0', '0', '0', '0', '0', '0.2000', '0.3000', '1.5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '150', '550', '100')
-INSERT INTO "SHARED_FB_PARAMS" (ID, BETA0, BETA1, BETA2, GAMMA0, GAMMA1, GAMMA2, LOW_FREQUENCY, HIGH_FREQUENCY,MIN_SNR, Q, S1, S2, VELOCITY0, VELOCITY1, VELOCITY2, VERSION, XC, XT, MIN_LENGTH, MAX_LENGTH, MEASURE_TIME) VALUES ('6', '0', '0', '0', '0', '0', '0', '0.3000', '0.5000', '1.5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '150', '500', '100')
-INSERT INTO "SHARED_FB_PARAMS" (ID, BETA0, BETA1, BETA2, GAMMA0, GAMMA1, GAMMA2, LOW_FREQUENCY, HIGH_FREQUENCY,MIN_SNR, Q, S1, S2, VELOCITY0, VELOCITY1, VELOCITY2, VERSION, XC, XT, MIN_LENGTH, MAX_LENGTH, MEASURE_TIME) VALUES ('7', '0', '0', '0', '0', '0', '0', '0.5000', '0.7000', '1.5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '150', '500', '100')
-INSERT INTO "SHARED_FB_PARAMS" (ID, BETA0, BETA1, BETA2, GAMMA0, GAMMA1, GAMMA2, LOW_FREQUENCY, HIGH_FREQUENCY,MIN_SNR, Q, S1, S2, VELOCITY0, VELOCITY1, VELOCITY2, VERSION, XC, XT, MIN_LENGTH, MAX_LENGTH, MEASURE_TIME) VALUES ('8', '0', '0', '0', '0', '0', '0', '0.7000', '1.0000', '1.5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '120', '450', '100')
-INSERT INTO "SHARED_FB_PARAMS" (ID, BETA0, BETA1, BETA2, GAMMA0, GAMMA1, GAMMA2, LOW_FREQUENCY, HIGH_FREQUENCY,MIN_SNR, Q, S1, S2, VELOCITY0, VELOCITY1, VELOCITY2, VERSION, XC, XT, MIN_LENGTH, MAX_LENGTH, MEASURE_TIME) VALUES ('9', '0', '0', '0', '0', '0', '0', '1.0000', '1.5000', '1.5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '90', '450', '100')
-INSERT INTO "SHARED_FB_PARAMS" (ID, BETA0, BETA1, BETA2, GAMMA0, GAMMA1, GAMMA2, LOW_FREQUENCY, HIGH_FREQUENCY,MIN_SNR, Q, S1, S2, VELOCITY0, VELOCITY1, VELOCITY2, VERSION, XC, XT, MIN_LENGTH, MAX_LENGTH, MEASURE_TIME) VALUES ('10', '0', '0', '0', '0', '0', '0', '1.5000', '2.0000', '1.5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '80', '400', '100')
-INSERT INTO "SHARED_FB_PARAMS" (ID, BETA0, BETA1, BETA2, GAMMA0, GAMMA1, GAMMA2, LOW_FREQUENCY, HIGH_FREQUENCY,MIN_SNR, Q, S1, S2, VELOCITY0, VELOCITY1, VELOCITY2, VERSION, XC, XT, MIN_LENGTH, MAX_LENGTH, MEASURE_TIME) VALUES ('11', '0', '0', '0', '0', '0', '0', '2.0000', '3.0000', '1.5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '60', '400', '100')
-INSERT INTO "SHARED_FB_PARAMS" (ID, BETA0, BETA1, BETA2, GAMMA0, GAMMA1, GAMMA2, LOW_FREQUENCY, HIGH_FREQUENCY,MIN_SNR, Q, S1, S2, VELOCITY0, VELOCITY1, VELOCITY2, VERSION, XC, XT, MIN_LENGTH, MAX_LENGTH, MEASURE_TIME) VALUES ('12', '0', '0', '0', '0', '0', '0', '3.0000', '4.0000', '1.5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '60', '400', '100')
-INSERT INTO "SHARED_FB_PARAMS" (ID, BETA0, BETA1, BETA2, GAMMA0, GAMMA1, GAMMA2, LOW_FREQUENCY, HIGH_FREQUENCY,MIN_SNR, Q, S1, S2, VELOCITY0, VELOCITY1, VELOCITY2, VERSION, XC, XT, MIN_LENGTH, MAX_LENGTH, MEASURE_TIME) VALUES ('13', '0', '0', '0', '0', '0', '0', '4.0000', '6.0000', '1.5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '60', '400', '100')
-INSERT INTO "SHARED_FB_PARAMS" (ID, BETA0, BETA1, BETA2, GAMMA0, GAMMA1, GAMMA2, LOW_FREQUENCY, HIGH_FREQUENCY,MIN_SNR, Q, S1, S2, VELOCITY0, VELOCITY1, VELOCITY2, VERSION, XC, XT, MIN_LENGTH, MAX_LENGTH, MEASURE_TIME) VALUES ('14', '0', '0', '0', '0', '0', '0', '6.0000', '8.0000', '1.5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '40', '350', '100')
\ No newline at end of file
+INSERT INTO "SHARED_FB_PARAMS" (ID, BETA0, BETA1, BETA2, GAMMA0, GAMMA1, GAMMA2, LOW_FREQUENCY, HIGH_FREQUENCY,MIN_SNR, Q, S1, S2, VELOCITY0, VELOCITY1, VELOCITY2, VERSION, XC, XT, MIN_LENGTH, MAX_LENGTH, MEASURE_TIME) VALUES ('1', '0', '0', '0', '0', '0', '0', '0.0200', '0.0300', '0.5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '300', '1000','100')
+INSERT INTO "SHARED_FB_PARAMS" (ID, BETA0, BETA1, BETA2, GAMMA0, GAMMA1, GAMMA2, LOW_FREQUENCY, HIGH_FREQUENCY,MIN_SNR, Q, S1, S2, VELOCITY0, VELOCITY1, VELOCITY2, VERSION, XC, XT, MIN_LENGTH, MAX_LENGTH, MEASURE_TIME) VALUES ('2', '0', '0', '0', '0', '0', '0', '0.0300', '0.0500', '0.5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '300', '800', '100')
+INSERT INTO "SHARED_FB_PARAMS" (ID, BETA0, BETA1, BETA2, GAMMA0, GAMMA1, GAMMA2, LOW_FREQUENCY, HIGH_FREQUENCY,MIN_SNR, Q, S1, S2, VELOCITY0, VELOCITY1, VELOCITY2, VERSION, XC, XT, MIN_LENGTH, MAX_LENGTH, MEASURE_TIME) VALUES ('3', '0', '0', '0', '0', '0', '0', '0.0500', '0.1000', '0.5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '250', '600', '100')
+INSERT INTO "SHARED_FB_PARAMS" (ID, BETA0, BETA1, BETA2, GAMMA0, GAMMA1, GAMMA2, LOW_FREQUENCY, HIGH_FREQUENCY,MIN_SNR, Q, S1, S2, VELOCITY0, VELOCITY1, VELOCITY2, VERSION, XC, XT, MIN_LENGTH, MAX_LENGTH, MEASURE_TIME) VALUES ('4', '0', '0', '0', '0', '0', '0', '0.1000', '0.2000', '0.5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '250', '550', '100')
+INSERT INTO "SHARED_FB_PARAMS" (ID, BETA0, BETA1, BETA2, GAMMA0, GAMMA1, GAMMA2, LOW_FREQUENCY, HIGH_FREQUENCY,MIN_SNR, Q, S1, S2, VELOCITY0, VELOCITY1, VELOCITY2, VERSION, XC, XT, MIN_LENGTH, MAX_LENGTH, MEASURE_TIME) VALUES ('5', '0', '0', '0', '0', '0', '0', '0.2000', '0.3000', '0.5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '150', '550', '100')
+INSERT INTO "SHARED_FB_PARAMS" (ID, BETA0, BETA1, BETA2, GAMMA0, GAMMA1, GAMMA2, LOW_FREQUENCY, HIGH_FREQUENCY,MIN_SNR, Q, S1, S2, VELOCITY0, VELOCITY1, VELOCITY2, VERSION, XC, XT, MIN_LENGTH, MAX_LENGTH, MEASURE_TIME) VALUES ('6', '0', '0', '0', '0', '0', '0', '0.3000', '0.5000', '0.5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '150', '500', '100')
+INSERT INTO "SHARED_FB_PARAMS" (ID, BETA0, BETA1, BETA2, GAMMA0, GAMMA1, GAMMA2, LOW_FREQUENCY, HIGH_FREQUENCY,MIN_SNR, Q, S1, S2, VELOCITY0, VELOCITY1, VELOCITY2, VERSION, XC, XT, MIN_LENGTH, MAX_LENGTH, MEASURE_TIME) VALUES ('7', '0', '0', '0', '0', '0', '0', '0.5000', '0.7000', '0.5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '150', '500', '100')
+INSERT INTO "SHARED_FB_PARAMS" (ID, BETA0, BETA1, BETA2, GAMMA0, GAMMA1, GAMMA2, LOW_FREQUENCY, HIGH_FREQUENCY,MIN_SNR, Q, S1, S2, VELOCITY0, VELOCITY1, VELOCITY2, VERSION, XC, XT, MIN_LENGTH, MAX_LENGTH, MEASURE_TIME) VALUES ('8', '0', '0', '0', '0', '0', '0', '0.7000', '1.0000', '0.5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '120', '450', '100')
+INSERT INTO "SHARED_FB_PARAMS" (ID, BETA0, BETA1, BETA2, GAMMA0, GAMMA1, GAMMA2, LOW_FREQUENCY, HIGH_FREQUENCY,MIN_SNR, Q, S1, S2, VELOCITY0, VELOCITY1, VELOCITY2, VERSION, XC, XT, MIN_LENGTH, MAX_LENGTH, MEASURE_TIME) VALUES ('9', '0', '0', '0', '0', '0', '0', '1.0000', '1.5000', '0.6', '0', '0', '0', '0', '0', '0', '0', '0', '0', '90', '450', '100')
+INSERT INTO "SHARED_FB_PARAMS" (ID, BETA0, BETA1, BETA2, GAMMA0, GAMMA1, GAMMA2, LOW_FREQUENCY, HIGH_FREQUENCY,MIN_SNR, Q, S1, S2, VELOCITY0, VELOCITY1, VELOCITY2, VERSION, XC, XT, MIN_LENGTH, MAX_LENGTH, MEASURE_TIME) VALUES ('10', '0', '0', '0', '0', '0', '0', '1.5000', '2.0000', '0.75', '0', '0', '0', '0', '0', '0', '0', '0', '0', '80', '400', '100')
+INSERT INTO "SHARED_FB_PARAMS" (ID, BETA0, BETA1, BETA2, GAMMA0, GAMMA1, GAMMA2, LOW_FREQUENCY, HIGH_FREQUENCY,MIN_SNR, Q, S1, S2, VELOCITY0, VELOCITY1, VELOCITY2, VERSION, XC, XT, MIN_LENGTH, MAX_LENGTH, MEASURE_TIME) VALUES ('11', '0', '0', '0', '0', '0', '0', '2.0000', '3.0000', '0.75', '0', '0', '0', '0', '0', '0', '0', '0', '0', '60', '400', '100')
+INSERT INTO "SHARED_FB_PARAMS" (ID, BETA0, BETA1, BETA2, GAMMA0, GAMMA1, GAMMA2, LOW_FREQUENCY, HIGH_FREQUENCY,MIN_SNR, Q, S1, S2, VELOCITY0, VELOCITY1, VELOCITY2, VERSION, XC, XT, MIN_LENGTH, MAX_LENGTH, MEASURE_TIME) VALUES ('12', '0', '0', '0', '0', '0', '0', '3.0000', '4.0000', '0.75', '0', '0', '0', '0', '0', '0', '0', '0', '0', '60', '400', '100')
+INSERT INTO "SHARED_FB_PARAMS" (ID, BETA0, BETA1, BETA2, GAMMA0, GAMMA1, GAMMA2, LOW_FREQUENCY, HIGH_FREQUENCY,MIN_SNR, Q, S1, S2, VELOCITY0, VELOCITY1, VELOCITY2, VERSION, XC, XT, MIN_LENGTH, MAX_LENGTH, MEASURE_TIME) VALUES ('13', '0', '0', '0', '0', '0', '0', '4.0000', '6.0000', '1.0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '60', '400', '100')
+INSERT INTO "SHARED_FB_PARAMS" (ID, BETA0, BETA1, BETA2, GAMMA0, GAMMA1, GAMMA2, LOW_FREQUENCY, HIGH_FREQUENCY,MIN_SNR, Q, S1, S2, VELOCITY0, VELOCITY1, VELOCITY2, VERSION, XC, XT, MIN_LENGTH, MAX_LENGTH, MEASURE_TIME) VALUES ('14', '0', '0', '0', '0', '0', '0', '6.0000', '8.0000', '1.0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '40', '350', '100')
\ No newline at end of file
diff --git a/calibration-service/integration/pom.xml b/calibration-service/integration/pom.xml
index 87531c45..b575b146 100644
--- a/calibration-service/integration/pom.xml
+++ b/calibration-service/integration/pom.xml
@@ -4,7 +4,7 @@
gov.llnl.gnem.apps.coda.calibration
calibration-service
- 1.0.1
+ 1.0.2
4.0.0
integration
diff --git a/calibration-service/model/pom.xml b/calibration-service/model/pom.xml
index 6c67cb8a..664faa56 100644
--- a/calibration-service/model/pom.xml
+++ b/calibration-service/model/pom.xml
@@ -4,7 +4,7 @@
gov.llnl.gnem.apps.coda.calibration
calibration-service
- 1.0.1
+ 1.0.2
4.0.0
model
diff --git a/calibration-service/model/src/main/java/gov/llnl/gnem/apps/coda/calibration/model/domain/messaging/PassFailEvent.java b/calibration-service/model/src/main/java/gov/llnl/gnem/apps/coda/calibration/model/domain/messaging/PassFailEvent.java
index 72db5871..eb91403b 100644
--- a/calibration-service/model/src/main/java/gov/llnl/gnem/apps/coda/calibration/model/domain/messaging/PassFailEvent.java
+++ b/calibration-service/model/src/main/java/gov/llnl/gnem/apps/coda/calibration/model/domain/messaging/PassFailEvent.java
@@ -23,10 +23,10 @@ public class PassFailEvent {
private String messageId;
- private Result