Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ dependencies {
implementation 'com.github.haifengl:smile-core:2.6.0'

/* no remote repo */
implementation files('lib/EventWebService.jar')
api files('lib/flanagan.jar') // FFT and PSD library along with other tools

implementation project(path: ':opensha')
implementation project(path: ':opensha', configuration: 'implResolvable')

testImplementation 'junit:junit:4.12'
testImplementation 'junit:junit:4.13.2'
}
Binary file removed lib/EventWebService.jar
Binary file not shown.
14 changes: 7 additions & 7 deletions src/main/java/scratch/kevin/cfm/excelParse/CFM5ExcelParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,37 +140,37 @@ private static int getGroupID(HSSFRow row, int groupStartCol) {
return -1;
// HSSFCell cell = row.getCell(groupStartCol);
// Preconditions.checkNotNull(cell);
// if (cell.getCellType() == HSSFCell.CELL_TYPE_NUMERIC)
// if (cell.getCellType() == org.apache.poi.ss.usermodel.CellType.NUMERIC)
// return (int)cell.getNumericCellValue();
// else
// return Integer.parseInt(cell.getStringCellValue());


// Preconditions.checkState(cell != null && cell.getCellType() == HSSFCell.CELL_TYPE_NUMERIC);
// Preconditions.checkState(cell != null && cell.getCellType() == org.apache.poi.ss.usermodel.CellType.NUMERIC);
// return (int)cell.getNumericCellValue();
}

private static String getGroupName(HSSFRow row, int groupStartCol) {
HSSFCell cell = row.getCell(groupStartCol+1);
if (cell == null || cell.getCellType() == HSSFCell.CELL_TYPE_BLANK)
if (cell == null || cell.getCellType() == org.apache.poi.ss.usermodel.CellType.BLANK)
return ""; // blank ok for name
Preconditions.checkState(cell.getCellType() == HSSFCell.CELL_TYPE_STRING);
Preconditions.checkState(cell.getCellType() == org.apache.poi.ss.usermodel.CellType.STRING);
return cell.getStringCellValue();
}

private static String getGroupShortName(HSSFRow row, int groupStartCol) {
HSSFCell cell = row.getCell(groupStartCol+2);
if (cell == null || cell.getCellType() == HSSFCell.CELL_TYPE_BLANK)
if (cell == null || cell.getCellType() == org.apache.poi.ss.usermodel.CellType.BLANK)
return getGroupName(row, groupStartCol).replaceAll(" ", "");
Preconditions.checkNotNull(cell);
if (cell.getCellType() == HSSFCell.CELL_TYPE_NUMERIC) {
if (cell.getCellType() == org.apache.poi.ss.usermodel.CellType.NUMERIC) {
double val = cell.getNumericCellValue();
if (val == Math.round(val))
return (int)val+"";
else
return val+"";
}
Preconditions.checkState(cell.getCellType() == HSSFCell.CELL_TYPE_STRING);
Preconditions.checkState(cell.getCellType() == org.apache.poi.ss.usermodel.CellType.STRING);
if (cell.getStringCellValue().isEmpty())
return getGroupName(row, groupStartCol).replaceAll(" ", "");
return cell.getStringCellValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import java.util.List;

import org.apache.commons.math3.stat.StatUtils;
import org.apache.poi.hssf.util.HSSFColor.BLACK;
import org.jfree.chart.annotations.XYTextAnnotation;
import org.jfree.chart.ui.TextAnchor;
import org.jfree.data.Range;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import java.util.List;
import java.util.Map;

import org.apache.commons.lang3.text.WordUtils;
import org.apache.commons.text.WordUtils;
import org.opensha.commons.util.FileNameComparator;

import com.google.common.base.Joiner;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,7 @@ private void getPaleoSegRateConstraints() {
HSSFRow row = sheet.getRow(r);
if(row==null) continue;
HSSFCell cell = row.getCell( (short) 1);
if(cell==null || cell.getCellType()==HSSFCell.CELL_TYPE_STRING) continue;
if(cell==null || cell.getCellType()==org.apache.poi.ss.usermodel.CellType.STRING) continue;
lat = cell.getNumericCellValue();
siteName = row.getCell( (short) 0).getStringCellValue().trim();
lon = row.getCell( (short) 2).getNumericCellValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1546,7 +1546,7 @@ private void getPaleoSegRateConstraints() {
continue;
HSSFCell cell = row.getCell((short) 1);
if (cell == null
|| cell.getCellType() == HSSFCell.CELL_TYPE_STRING)
|| cell.getCellType() == org.apache.poi.ss.usermodel.CellType.STRING)
continue;
lat = cell.getNumericCellValue();
siteName = row.getCell((short) 0).getStringCellValue().trim();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1273,7 +1273,7 @@ private void getPaleoSegRateConstraints() {
HSSFRow row = sheet.getRow(r);
if(row==null) continue;
HSSFCell cell = row.getCell( (short) 1);
if(cell==null || cell.getCellType()==HSSFCell.CELL_TYPE_STRING) continue;
if(cell==null || cell.getCellType()==org.apache.poi.ss.usermodel.CellType.STRING) continue;
lat = cell.getNumericCellValue();
siteName = row.getCell( (short) 0).getStringCellValue().trim();
lon = row.getCell( (short) 2).getNumericCellValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,7 @@ private void getPaleoSegRateConstraints() {
continue;
HSSFCell cell = row.getCell((short) 1);
if (cell == null
|| cell.getCellType() == HSSFCell.CELL_TYPE_STRING)
|| cell.getCellType() == org.apache.poi.ss.usermodel.CellType.STRING)
continue;
lat = cell.getNumericCellValue();
siteName = row.getCell((short) 0).getStringCellValue().trim();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1546,7 +1546,7 @@ private void getPaleoSegRateConstraints() {
continue;
HSSFCell cell = row.getCell((short) 1);
if (cell == null
|| cell.getCellType() == HSSFCell.CELL_TYPE_STRING)
|| cell.getCellType() == org.apache.poi.ss.usermodel.CellType.STRING)
continue;
lat = cell.getNumericCellValue();
siteName = row.getCell((short) 0).getStringCellValue().trim();
Expand Down
Loading