Skip to content
Snippets Groups Projects
Commit 04b4804e authored by Clayton, Brandon Scott's avatar Clayton, Brandon Scott
Browse files

Merge branch 'type' into 'main'

Add GMM Type

Closes #69

See merge request !221
parents b2a6a85f f82cd878
No related branches found
No related tags found
1 merge request!221Add GMM Type
Pipeline #386180 passed
......@@ -9,7 +9,7 @@ micronautRxVersion = 2.1.1
nodePluginVersion = 3.0.1
nodeVersion = 16.3.0
nshmFaultSectionsTag = v0.1
nshmpLibVersion = 1.4.9
nshmpLibVersion = 1.4.13
nshmpUtilsJavaVersion = 0.4.0
shadowVersion = 7.1.2
spotbugsVersion = 4.7.0
......
......@@ -44,6 +44,7 @@ import gov.usgs.earthquake.nshmp.gmm.GmmInput;
import gov.usgs.earthquake.nshmp.gmm.GmmInput.Constraints;
import gov.usgs.earthquake.nshmp.gmm.GmmInput.Field;
import gov.usgs.earthquake.nshmp.gmm.Imt;
import gov.usgs.earthquake.nshmp.model.TectonicSetting;
import gov.usgs.earthquake.nshmp.www.ResponseBody;
import gov.usgs.earthquake.nshmp.www.ResponseMetadata;
import gov.usgs.earthquake.nshmp.www.WsUtils;
......@@ -387,12 +388,14 @@ class ServiceUtil {
final String id;
final String label;
final Gmm.Type type;
final ArrayList<String> supportedImts;
final Constraints constraints;
Value(Gmm gmm) {
this.id = gmm.name();
this.label = gmm.toString();
this.type = gmm.type();
this.supportedImts = supportedImts(gmm.supportedImts());
this.constraints = gmm.constraints();
}
......@@ -435,11 +438,21 @@ class ServiceUtil {
final String id;
final String label;
final List<Gmm> data;
final String type;
Value(Gmm.Group group) {
this.id = group.name();
this.label = group.toString();
this.data = group.gmms();
if (group.toString().contains("Active Volcanic (HI)")) {
this.type = TectonicSetting.VOLCANIC.name();
} else {
this.type = group.gmms().stream()
.map(gmm -> gmm.type().name())
.findFirst()
.orElseThrow();
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment