Omaha #4500 - Update hydro blind casts to use Number
Change-Id: Ide22b937047d254cb3fb003df630c936d601fe22 Former-commit-id: 877a65681207ae7d93ac385e88dbc213980a49de
This commit is contained in:
parent
32b5f874cf
commit
7a79834265
26 changed files with 1813 additions and 1668 deletions
|
@ -76,7 +76,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* 29 NOV 2007 373 lvenable Initial creation.
|
* 29 NOV 2007 373 lvenable Initial creation.
|
||||||
* 13 Oct 2009 2256 mpduff Implement the dialog.
|
* 13 Oct 2009 2256 mpduff Implement the dialog.
|
||||||
* 07 Feb 2013 1578 rferrel Changes for non-blocking dialog.
|
* 07 Feb 2013 1578 rferrel Changes for non-blocking dialog.
|
||||||
*
|
* Jul 21, 2015 4500 rjpeter Use Number in blind cast.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author lvenable
|
* @author lvenable
|
||||||
|
@ -218,7 +218,7 @@ public class FlashFloodGuidanceDlg extends CaveSWTDialog {
|
||||||
private Button closeBtn;
|
private Button closeBtn;
|
||||||
|
|
||||||
/** Bundle variables */
|
/** Bundle variables */
|
||||||
private Map<String, String> parameters = new HashMap<String, String>();
|
private final Map<String, String> parameters = new HashMap<String, String>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The selected RFC.
|
* The selected RFC.
|
||||||
|
@ -243,12 +243,12 @@ public class FlashFloodGuidanceDlg extends CaveSWTDialog {
|
||||||
/**
|
/**
|
||||||
* Holds the display string and insert time for later use.
|
* Holds the display string and insert time for later use.
|
||||||
*/
|
*/
|
||||||
private Map<String, Date> dataMap = new HashMap<String, Date>();
|
private final Map<String, Date> dataMap = new HashMap<String, Date>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the display string and the xmrg File object.
|
* Holds the display string and the xmrg File object.
|
||||||
*/
|
*/
|
||||||
private Map<String, File> fileMap = new HashMap<String, File>();
|
private final Map<String, File> fileMap = new HashMap<String, File>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The wait mouse pointer.
|
* The wait mouse pointer.
|
||||||
|
@ -1073,8 +1073,8 @@ public class FlashFloodGuidanceDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
for (Object[] oa : rs) {
|
for (Object[] oa : rs) {
|
||||||
Timestamp validTime = (Timestamp) oa[0];
|
Timestamp validTime = (Timestamp) oa[0];
|
||||||
int shefDur = (Integer) oa[1];
|
int shefDur = ((Number) oa[1]).intValue();
|
||||||
int dur = shefDur - (shefDur / 1000) * 1000;
|
int dur = shefDur - ((shefDur / 1000) * 1000);
|
||||||
|
|
||||||
// Dur is FFG03, FFG06, etc
|
// Dur is FFG03, FFG06, etc
|
||||||
// selectedDur is 1hr, 3hr, etc
|
// selectedDur is 1hr, 3hr, etc
|
||||||
|
|
|
@ -29,7 +29,7 @@ package com.raytheon.viz.hydro.pointdatacontrol.data;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Nov 17, 2008 mpduff Initial creation
|
* Nov 17, 2008 mpduff Initial creation
|
||||||
*
|
* Jul 21, 2015 4500 rjpeter Use Number in blind cast.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author mpduff
|
* @author mpduff
|
||||||
|
@ -38,10 +38,15 @@ package com.raytheon.viz.hydro.pointdatacontrol.data;
|
||||||
|
|
||||||
public class IngestFilter {
|
public class IngestFilter {
|
||||||
private String lid = null;
|
private String lid = null;
|
||||||
|
|
||||||
private String pe = null;
|
private String pe = null;
|
||||||
|
|
||||||
private int dur;
|
private int dur;
|
||||||
|
|
||||||
private String ts = null;
|
private String ts = null;
|
||||||
|
|
||||||
private String extremum = null;
|
private String extremum = null;
|
||||||
|
|
||||||
private int tsRank;
|
private int tsRank;
|
||||||
|
|
||||||
public IngestFilter() {
|
public IngestFilter() {
|
||||||
|
@ -52,79 +57,97 @@ public class IngestFilter {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
setLid((String) data[i++]);
|
setLid((String) data[i++]);
|
||||||
setPe((String) data[i++]);
|
setPe((String) data[i++]);
|
||||||
setDur((Integer)data[i++]);
|
setDur(((Number) data[i++]).intValue());
|
||||||
setTs((String) data[i++]);
|
setTs((String) data[i++]);
|
||||||
setExtremum((String) data[i++]);
|
setExtremum((String) data[i++]);
|
||||||
setTsRank((Integer)data[i++]);
|
setTsRank(((Number) data[i++]).intValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the lid
|
* @return the lid
|
||||||
*/
|
*/
|
||||||
public String getLid() {
|
public String getLid() {
|
||||||
return lid;
|
return lid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param lid the lid to set
|
* @param lid
|
||||||
|
* the lid to set
|
||||||
*/
|
*/
|
||||||
public void setLid(String lid) {
|
public void setLid(String lid) {
|
||||||
this.lid = lid;
|
this.lid = lid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the pe
|
* @return the pe
|
||||||
*/
|
*/
|
||||||
public String getPe() {
|
public String getPe() {
|
||||||
return pe;
|
return pe;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param pe the pe to set
|
* @param pe
|
||||||
|
* the pe to set
|
||||||
*/
|
*/
|
||||||
public void setPe(String pe) {
|
public void setPe(String pe) {
|
||||||
this.pe = pe;
|
this.pe = pe;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the dur
|
* @return the dur
|
||||||
*/
|
*/
|
||||||
public int getDur() {
|
public int getDur() {
|
||||||
return dur;
|
return dur;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param dur the dur to set
|
* @param dur
|
||||||
|
* the dur to set
|
||||||
*/
|
*/
|
||||||
public void setDur(int dur) {
|
public void setDur(int dur) {
|
||||||
this.dur = dur;
|
this.dur = dur;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the ts
|
* @return the ts
|
||||||
*/
|
*/
|
||||||
public String getTs() {
|
public String getTs() {
|
||||||
return ts;
|
return ts;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param ts the ts to set
|
* @param ts
|
||||||
|
* the ts to set
|
||||||
*/
|
*/
|
||||||
public void setTs(String ts) {
|
public void setTs(String ts) {
|
||||||
this.ts = ts;
|
this.ts = ts;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the extremum
|
* @return the extremum
|
||||||
*/
|
*/
|
||||||
public String getExtremum() {
|
public String getExtremum() {
|
||||||
return extremum;
|
return extremum;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param extremum the extremum to set
|
* @param extremum
|
||||||
|
* the extremum to set
|
||||||
*/
|
*/
|
||||||
public void setExtremum(String extremum) {
|
public void setExtremum(String extremum) {
|
||||||
this.extremum = extremum;
|
this.extremum = extremum;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the tsRank
|
* @return the tsRank
|
||||||
*/
|
*/
|
||||||
public int getTsRank() {
|
public int getTsRank() {
|
||||||
return tsRank;
|
return tsRank;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param tsRank the tsRank to set
|
* @param tsRank
|
||||||
|
* the tsRank to set
|
||||||
*/
|
*/
|
||||||
public void setTsRank(int tsRank) {
|
public void setTsRank(int tsRank) {
|
||||||
this.tsRank = tsRank;
|
this.tsRank = tsRank;
|
||||||
|
|
|
@ -27,6 +27,7 @@ package com.raytheon.viz.hydro.pointdatacontrol.data;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Nov 24, 2008 mpduff Initial creation
|
* Nov 24, 2008 mpduff Initial creation
|
||||||
|
* Jul 21, 2015 4500 rjpeter Use Number in blind cast.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author mpduff
|
* @author mpduff
|
||||||
|
@ -125,7 +126,7 @@ public class LocPDC {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data[++i] != null) { // post
|
if (data[++i] != null) { // post
|
||||||
setPost((Integer)data[i]);
|
setPost(((Number) data[i]).intValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data[++i] != null) { // elev
|
if (data[++i] != null) { // elev
|
||||||
|
|
|
@ -63,7 +63,9 @@ import com.raytheon.viz.hydrocommon.whfslib.PrecipUtil;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Oct 22, 2008 mpduff Initial creation
|
* Oct 22, 2008 mpduff Initial creation
|
||||||
|
* Jul 21, 2015 4500 rjpeter Use Number in blind cast.
|
||||||
* </pre>
|
* </pre>
|
||||||
|
*
|
||||||
* @author mpduff
|
* @author mpduff
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
|
@ -114,7 +116,8 @@ public class PDCDataManager extends HydroDataManager {
|
||||||
ArrayList<String> peList = new ArrayList<String>();
|
ArrayList<String> peList = new ArrayList<String>();
|
||||||
|
|
||||||
String query = "select distinct(pe) from ingestfilter";
|
String query = "select distinct(pe) from ingestfilter";
|
||||||
List<Object[]> rs = DirectDbQuery.executeQuery(query, HydroConstants.IHFS, QueryLanguage.SQL);
|
List<Object[]> rs = DirectDbQuery.executeQuery(query,
|
||||||
|
HydroConstants.IHFS, QueryLanguage.SQL);
|
||||||
|
|
||||||
for (Object[] oa : rs) {
|
for (Object[] oa : rs) {
|
||||||
peList.add((String) oa[0]);
|
peList.add((String) oa[0]);
|
||||||
|
@ -153,7 +156,7 @@ public class PDCDataManager extends HydroDataManager {
|
||||||
PointDataPreset pdp = new PointDataPreset();
|
PointDataPreset pdp = new PointDataPreset();
|
||||||
pdp.setPresetId((String) oa[0]);
|
pdp.setPresetId((String) oa[0]);
|
||||||
pdp.setDescription((String) oa[1]);
|
pdp.setDescription((String) oa[1]);
|
||||||
pdp.setPresetRank((Integer) oa[2]);
|
pdp.setPresetRank(((Number) oa[2]).intValue());
|
||||||
pdp.setPresetString((String) oa[3]);
|
pdp.setPresetString((String) oa[3]);
|
||||||
presetList.add(pdp);
|
presetList.add(pdp);
|
||||||
}
|
}
|
||||||
|
@ -203,9 +206,7 @@ public class PDCDataManager extends HydroDataManager {
|
||||||
"insert into pointdatapresets (preset_id, descr, preset_rank, preset_string) ");
|
"insert into pointdatapresets (preset_id, descr, preset_rank, preset_string) ");
|
||||||
sql.append("values ('" + node.getPresetId() + "', '"
|
sql.append("values ('" + node.getPresetId() + "', '"
|
||||||
+ node.getDescription() + "', ");
|
+ node.getDescription() + "', ");
|
||||||
sql
|
sql.append(node.getPresetRank() + ", '" + node.getPresetString() + "')");
|
||||||
.append(node.getPresetRank() + ", '" + node.getPresetString()
|
|
||||||
+ "')");
|
|
||||||
|
|
||||||
runStatement(sql.toString());
|
runStatement(sql.toString());
|
||||||
}
|
}
|
||||||
|
@ -417,7 +418,8 @@ public class PDCDataManager extends HydroDataManager {
|
||||||
* observed or forecast, or can be any designated type-source.
|
* observed or forecast, or can be any designated type-source.
|
||||||
*/
|
*/
|
||||||
public void getRiverData(PDCOptions pcOptions) {
|
public void getRiverData(PDCOptions pcOptions) {
|
||||||
PointDataControlManager pdcManager = PointDataControlManager.getInstance();
|
PointDataControlManager pdcManager = PointDataControlManager
|
||||||
|
.getInstance();
|
||||||
String where = null;
|
String where = null;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -514,7 +516,8 @@ public class PDCDataManager extends HydroDataManager {
|
||||||
* Get the PC and/or PP rain data.
|
* Get the PC and/or PP rain data.
|
||||||
*/
|
*/
|
||||||
public void getRainData() {
|
public void getRainData() {
|
||||||
PointDataControlManager pdcManager = PointDataControlManager.getInstance();
|
PointDataControlManager pdcManager = PointDataControlManager
|
||||||
|
.getInstance();
|
||||||
PDCOptionData pcOptions = PDCOptionData.getInstance();
|
PDCOptionData pcOptions = PDCOptionData.getInstance();
|
||||||
PrecipUtil precipUtil = PrecipUtil.getInstance();
|
PrecipUtil precipUtil = PrecipUtil.getInstance();
|
||||||
List<String> typeSourceArray = null;
|
List<String> typeSourceArray = null;
|
||||||
|
@ -591,11 +594,11 @@ public class PDCDataManager extends HydroDataManager {
|
||||||
id.setExtremum((String) oa[4]);
|
id.setExtremum((String) oa[4]);
|
||||||
id.setObstime((Date) oa[12]);
|
id.setObstime((Date) oa[12]);
|
||||||
pc.setPe((String) oa[1]);
|
pc.setPe((String) oa[1]);
|
||||||
pc.setDur(((Integer)oa[2]).shortValue());
|
pc.setDur(((Number) oa[2]).shortValue());
|
||||||
pc.setValue((Double) oa[5]);
|
pc.setValue((Double) oa[5]);
|
||||||
pc.setShefQualCode((String) oa[6]);
|
pc.setShefQualCode((String) oa[6]);
|
||||||
pc.setQualityCode((Integer) oa[7]);
|
pc.setQualityCode(((Number) oa[7]).intValue());
|
||||||
pc.setRevision(((Integer)(oa[8])).shortValue());
|
pc.setRevision(((Number) (oa[8])).shortValue());
|
||||||
pc.setProductId((String) oa[9]);
|
pc.setProductId((String) oa[9]);
|
||||||
pc.setProducttime((Date) oa[10]);
|
pc.setProducttime((Date) oa[10]);
|
||||||
pc.setPostingtime((Date) oa[11]);
|
pc.setPostingtime((Date) oa[11]);
|
||||||
|
@ -619,15 +622,15 @@ public class PDCDataManager extends HydroDataManager {
|
||||||
Curpp pp = new Curpp();
|
Curpp pp = new Curpp();
|
||||||
CurppId id = new CurppId();
|
CurppId id = new CurppId();
|
||||||
id.setLid((String) oa[0]);
|
id.setLid((String) oa[0]);
|
||||||
id.setDur(((Integer) oa[2]).shortValue());
|
id.setDur(((Number) oa[2]).shortValue());
|
||||||
id.setTs((String) oa[3]);
|
id.setTs((String) oa[3]);
|
||||||
id.setExtremum((String) oa[4]);
|
id.setExtremum((String) oa[4]);
|
||||||
id.setObstime((Date) oa[12]);
|
id.setObstime((Date) oa[12]);
|
||||||
pp.setPe((String) oa[1]);
|
pp.setPe((String) oa[1]);
|
||||||
pp.setValue((Double) oa[5]);
|
pp.setValue((Double) oa[5]);
|
||||||
pp.setShefQualCode((String) oa[6]);
|
pp.setShefQualCode((String) oa[6]);
|
||||||
pp.setQualityCode((Integer) oa[7]);
|
pp.setQualityCode(((Number) oa[7]).intValue());
|
||||||
pp.setRevision(((Integer) oa[8]).shortValue());
|
pp.setRevision(((Number) oa[8]).shortValue());
|
||||||
pp.setProductId((String) oa[9]);
|
pp.setProductId((String) oa[9]);
|
||||||
pp.setProducttime((Date) oa[10]);
|
pp.setProducttime((Date) oa[10]);
|
||||||
pp.setPostingtime((Date) oa[11]);
|
pp.setPostingtime((Date) oa[11]);
|
||||||
|
@ -640,7 +643,8 @@ public class PDCDataManager extends HydroDataManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getSnowTempOtherData() {
|
public void getSnowTempOtherData() {
|
||||||
PointDataControlManager pdcManager = PointDataControlManager.getInstance();
|
PointDataControlManager pdcManager = PointDataControlManager
|
||||||
|
.getInstance();
|
||||||
PDCOptionData pcOptions = PDCOptionData.getInstance();
|
PDCOptionData pcOptions = PDCOptionData.getInstance();
|
||||||
String typeSource = null;
|
String typeSource = null;
|
||||||
String tablename = null;
|
String tablename = null;
|
||||||
|
@ -684,8 +688,8 @@ public class PDCDataManager extends HydroDataManager {
|
||||||
|
|
||||||
typeSource = pcOptions.getTypeSourceChosenList().get(0);
|
typeSource = pcOptions.getTypeSourceChosenList().get(0);
|
||||||
|
|
||||||
tablename = DbUtils.getTableName(pcOptions
|
tablename = DbUtils.getTableName(
|
||||||
.getSelectedAdHocElementString(), typeSource);
|
pcOptions.getSelectedAdHocElementString(), typeSource);
|
||||||
|
|
||||||
obsResult = getObservationData(tablename, where);
|
obsResult = getObservationData(tablename, where);
|
||||||
}
|
}
|
||||||
|
@ -758,8 +762,7 @@ public class PDCDataManager extends HydroDataManager {
|
||||||
Map<String, LocPDC> returnMap = new HashMap<String, LocPDC>();
|
Map<String, LocPDC> returnMap = new HashMap<String, LocPDC>();
|
||||||
|
|
||||||
StringBuilder sql = new StringBuilder();
|
StringBuilder sql = new StringBuilder();
|
||||||
sql
|
sql.append("Select lid, name, lat, lon, hsa, post, elev, primary_pe, fs, fq, ");
|
||||||
.append("Select lid, name, lat, lon, hsa, post, elev, primary_pe, fs, fq, ");
|
|
||||||
sql.append("disp_class, is_dcp, is_observer, telem_type from locPDC");
|
sql.append("disp_class, is_dcp, is_observer, telem_type from locPDC");
|
||||||
|
|
||||||
ArrayList<Object[]> results = runQuery(sql.toString());
|
ArrayList<Object[]> results = runQuery(sql.toString());
|
||||||
|
|
|
@ -104,8 +104,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* 09/29/2010 4384 lbousaidi Fixed PC/PP display and make Save button
|
* 09/29/2010 4384 lbousaidi Fixed PC/PP display and make Save button
|
||||||
* save to tokenized directory
|
* save to tokenized directory
|
||||||
* 03/14/2013 1790 rferrel Changes for non-blocking dialog.
|
* 03/14/2013 1790 rferrel Changes for non-blocking dialog.
|
||||||
*
|
* Jul 21, 2015 4500 rjpeter Use Number in blind cast.
|
||||||
*
|
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author lvenable
|
* @author lvenable
|
||||||
|
@ -180,7 +179,7 @@ public class PointPrecipAccumDlg extends CaveSWTDialog {
|
||||||
/**
|
/**
|
||||||
* Selected Durations.
|
* Selected Durations.
|
||||||
*/
|
*/
|
||||||
private int[] selectedDurations = new int[durationValues.length];
|
private final int[] selectedDurations = new int[durationValues.length];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Durations.
|
* Durations.
|
||||||
|
@ -250,7 +249,7 @@ public class PointPrecipAccumDlg extends CaveSWTDialog {
|
||||||
/**
|
/**
|
||||||
* List of PTS values.
|
* List of PTS values.
|
||||||
*/
|
*/
|
||||||
private java.util.List<String> pTs = new ArrayList<String>();
|
private final java.util.List<String> pTs = new ArrayList<String>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sort combo box.
|
* Sort combo box.
|
||||||
|
@ -544,13 +543,13 @@ public class PointPrecipAccumDlg extends CaveSWTDialog {
|
||||||
// durList has the pa_options.duration_set of values (indirectly)
|
// durList has the pa_options.duration_set of values (indirectly)
|
||||||
durList = new List(durComp, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
|
durList = new List(durComp, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
|
||||||
durList.setLayoutData(gd);
|
durList.setLayoutData(gd);
|
||||||
durList.add(((Integer) durationValues[0]).toString() + " Hour");
|
durList.add(((Number) durationValues[0]).toString() + " Hour");
|
||||||
durList.add(((Integer) durationValues[1]).toString() + " Hour");
|
durList.add(((Number) durationValues[1]).toString() + " Hour");
|
||||||
durList.add(((Integer) durationValues[2]).toString() + " Hour");
|
durList.add(((Number) durationValues[2]).toString() + " Hour");
|
||||||
durList.add(((Integer) durationValues[3]).toString() + " Hour");
|
durList.add(((Number) durationValues[3]).toString() + " Hour");
|
||||||
durList.add(((Integer) durationValues[4]).toString() + " Hour");
|
durList.add(((Number) durationValues[4]).toString() + " Hour");
|
||||||
durList.add(((Integer) durationValues[5]).toString() + " Hour");
|
durList.add(((Number) durationValues[5]).toString() + " Hour");
|
||||||
durList.add(((Integer) durationValues[6]).toString() + " Hour");
|
durList.add(((Number) durationValues[6]).toString() + " Hour");
|
||||||
durList.add("Other");
|
durList.add("Other");
|
||||||
durList.setFont(font);
|
durList.setFont(font);
|
||||||
durList.setSelection(4);
|
durList.setSelection(4);
|
||||||
|
@ -980,8 +979,8 @@ public class PointPrecipAccumDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
// Determine the length (i.e., NUMDURATIONS) of the new durations array
|
// Determine the length (i.e., NUMDURATIONS) of the new durations array
|
||||||
int NUMDURATIONS = 0;
|
int NUMDURATIONS = 0;
|
||||||
for (int i = 0; i < selectedDurations.length; i++) {
|
for (int selectedDuration : selectedDurations) {
|
||||||
if (selectedDurations[i] == 9999) {
|
if (selectedDuration == 9999) {
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
NUMDURATIONS++;
|
NUMDURATIONS++;
|
||||||
|
@ -1263,9 +1262,9 @@ public class PointPrecipAccumDlg extends CaveSWTDialog {
|
||||||
int index = hdr.indexOf("<duration>");
|
int index = hdr.indexOf("<duration>");
|
||||||
index += 10;
|
index += 10;
|
||||||
|
|
||||||
for (int i = 0; i < durations.length; i++) {
|
for (int duration : durations) {
|
||||||
hdr.insert(index, durations[i]);
|
hdr.insert(index, duration);
|
||||||
index += Integer.toString(durations[i]).length();
|
index += Integer.toString(duration).length();
|
||||||
hdr.insert(index, ",");
|
hdr.insert(index, ",");
|
||||||
index++;
|
index++;
|
||||||
hdr.insert(index, " ");
|
hdr.insert(index, " ");
|
||||||
|
@ -1298,13 +1297,13 @@ public class PointPrecipAccumDlg extends CaveSWTDialog {
|
||||||
hdr.append("\n");
|
hdr.append("\n");
|
||||||
hdr.append(String.format(FMT_DUR_HD_TR, "Location", "Name", "PE", "TS"));
|
hdr.append(String.format(FMT_DUR_HD_TR, "Location", "Name", "PE", "TS"));
|
||||||
|
|
||||||
for (int i = 0; i < durations.length; i++) {
|
for (int duration : durations) {
|
||||||
hdr.append(String.format(FMT_DUR, durations[i], "hr"));
|
hdr.append(String.format(FMT_DUR, duration, "hr"));
|
||||||
}
|
}
|
||||||
hdr.append("\n");
|
hdr.append("\n");
|
||||||
hdr.append(String.format(FMT_DUR_HD_TR, "========", "====", "==", "=="));
|
hdr.append(String.format(FMT_DUR_HD_TR, "========", "====", "==", "=="));
|
||||||
|
|
||||||
for (int i = 0; i < durations.length; i++) {
|
for (int duration : durations) {
|
||||||
hdr.append(String.format(FMT_DUR_TR, "===", "=="));
|
hdr.append(String.format(FMT_DUR_TR, "===", "=="));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1675,11 +1674,11 @@ public class PointPrecipAccumDlg extends CaveSWTDialog {
|
||||||
Point dpi = printer.getDPI();
|
Point dpi = printer.getDPI();
|
||||||
leftMargin = dpi.x + trim.x; // one inch from left side of paper
|
leftMargin = dpi.x + trim.x; // one inch from left side of paper
|
||||||
// one inch from right side of paper
|
// one inch from right side of paper
|
||||||
rightMargin = clientArea.width - dpi.x + trim.x + trim.width;
|
rightMargin = (clientArea.width - dpi.x) + trim.x + trim.width;
|
||||||
// one inch from top edge of paper
|
// one inch from top edge of paper
|
||||||
topMargin = dpi.y + trim.y;
|
topMargin = dpi.y + trim.y;
|
||||||
// one inch from bottom edge of paper
|
// one inch from bottom edge of paper
|
||||||
bottomMargin = clientArea.height - dpi.y + trim.y + trim.height;
|
bottomMargin = (clientArea.height - dpi.y) + trim.y + trim.height;
|
||||||
|
|
||||||
/* Create a buffer for computing tab width. */
|
/* Create a buffer for computing tab width. */
|
||||||
int tabSize = 4; // is tab width a user setting in your UI?
|
int tabSize = 4; // is tab width a user setting in your UI?
|
||||||
|
@ -1757,7 +1756,7 @@ public class PointPrecipAccumDlg extends CaveSWTDialog {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (y + lineHeight <= bottomMargin) {
|
if ((y + lineHeight) <= bottomMargin) {
|
||||||
printer.endPage();
|
printer.endPage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1769,7 +1768,7 @@ public class PointPrecipAccumDlg extends CaveSWTDialog {
|
||||||
if (wordBuffer.length() > 0) {
|
if (wordBuffer.length() > 0) {
|
||||||
String word = wordBuffer.toString();
|
String word = wordBuffer.toString();
|
||||||
int wordWidth = gc.stringExtent(word).x;
|
int wordWidth = gc.stringExtent(word).x;
|
||||||
if (x + wordWidth > rightMargin) {
|
if ((x + wordWidth) > rightMargin) {
|
||||||
/* word doesn't fit on current line, so wrap */
|
/* word doesn't fit on current line, so wrap */
|
||||||
newline();
|
newline();
|
||||||
}
|
}
|
||||||
|
@ -1785,9 +1784,9 @@ public class PointPrecipAccumDlg extends CaveSWTDialog {
|
||||||
private void newline() {
|
private void newline() {
|
||||||
x = leftMargin;
|
x = leftMargin;
|
||||||
y += lineHeight;
|
y += lineHeight;
|
||||||
if (y + lineHeight > bottomMargin) {
|
if ((y + lineHeight) > bottomMargin) {
|
||||||
printer.endPage();
|
printer.endPage();
|
||||||
if (index + 1 < end) {
|
if ((index + 1) < end) {
|
||||||
y = topMargin;
|
y = topMargin;
|
||||||
printer.startPage();
|
printer.startPage();
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,6 @@ import com.raytheon.viz.hydro.pointprecipitation.PointPrecipConstants.RawPrecipT
|
||||||
import com.raytheon.viz.hydrocommon.HydroConstants;
|
import com.raytheon.viz.hydrocommon.HydroConstants;
|
||||||
import com.raytheon.viz.hydrocommon.datamanager.HydroDataManager;
|
import com.raytheon.viz.hydrocommon.datamanager.HydroDataManager;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class for managing database query calls. PointPrecipDataManager.java
|
* Class for managing database query calls. PointPrecipDataManager.java
|
||||||
*
|
*
|
||||||
|
@ -48,7 +47,7 @@ import com.raytheon.viz.hydrocommon.datamanager.HydroDataManager;
|
||||||
* 31Aug2009 #2257 mpduff Adding data access methods.
|
* 31Aug2009 #2257 mpduff Adding data access methods.
|
||||||
* sep292010 #4384 lbousaidi Fixed quality_code and change name of table
|
* sep292010 #4384 lbousaidi Fixed quality_code and change name of table
|
||||||
* that retrieves PC data from rawpp to rawpc
|
* that retrieves PC data from rawpp to rawpc
|
||||||
*
|
* Jul 21, 2015 4500 rjpeter Use Number in blind cast.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author dhladky
|
* @author dhladky
|
||||||
|
@ -115,7 +114,6 @@ public class PointPrecipDataManager extends HydroDataManager {
|
||||||
return items.toArray(new String[items.size()]);
|
return items.toArray(new String[items.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------
|
// ---------------------------------------------------------------
|
||||||
// Query 'ingestfilter' table in ihfs database for selected fields
|
// Query 'ingestfilter' table in ihfs database for selected fields
|
||||||
// using SQL.
|
// using SQL.
|
||||||
|
@ -163,8 +161,8 @@ public class PointPrecipDataManager extends HydroDataManager {
|
||||||
// Query 'curpc' table in ihfs database for selected fields
|
// Query 'curpc' table in ihfs database for selected fields
|
||||||
// using SQL.
|
// using SQL.
|
||||||
// ---------------------------------------------------------------
|
// ---------------------------------------------------------------
|
||||||
public ArrayList<Curpc> queryCurPc(Date queryBeginTime,
|
public ArrayList<Curpc> queryCurPc(Date queryBeginTime, Date queryEndTime,
|
||||||
Date queryEndTime, String lid, List<String> pTs) {
|
String lid, List<String> pTs) {
|
||||||
ArrayList<Object[]> pcData;
|
ArrayList<Object[]> pcData;
|
||||||
String tsClause = null;
|
String tsClause = null;
|
||||||
StringBuilder where = new StringBuilder();
|
StringBuilder where = new StringBuilder();
|
||||||
|
@ -173,7 +171,8 @@ public class PointPrecipDataManager extends HydroDataManager {
|
||||||
/*
|
/*
|
||||||
* In order to consider cases that there is no PC data during dry
|
* In order to consider cases that there is no PC data during dry
|
||||||
* periods, retrieve more wider data for gages, use token
|
* periods, retrieve more wider data for gages, use token
|
||||||
* adjust_PC_startingtime to specify the PC data retrieval starting point
|
* adjust_PC_startingtime to specify the PC data retrieval starting
|
||||||
|
* point
|
||||||
*/
|
*/
|
||||||
if (adjustedPCStartTime == HydroConstants.MISSING_VALUE) {
|
if (adjustedPCStartTime == HydroConstants.MISSING_VALUE) {
|
||||||
AppsDefaults ad = AppsDefaults.getInstance();
|
AppsDefaults ad = AppsDefaults.getInstance();
|
||||||
|
@ -189,7 +188,8 @@ public class PointPrecipDataManager extends HydroDataManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adjust the start hours
|
// Adjust the start hours
|
||||||
Calendar adjustedBeginTime = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
|
Calendar adjustedBeginTime = Calendar.getInstance(TimeZone
|
||||||
|
.getTimeZone("GMT"));
|
||||||
adjustedBeginTime.setTimeInMillis(queryBeginTime.getTime());
|
adjustedBeginTime.setTimeInMillis(queryBeginTime.getTime());
|
||||||
adjustedBeginTime.add(Calendar.HOUR, adjustedPCStartTime * -1);
|
adjustedBeginTime.add(Calendar.HOUR, adjustedPCStartTime * -1);
|
||||||
|
|
||||||
|
@ -201,10 +201,12 @@ public class PointPrecipDataManager extends HydroDataManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((lid.length() > 0) && (pTs.size() > 0)) {
|
if ((lid.length() > 0) && (pTs.size() > 0)) {
|
||||||
where.append(String.format(" where lid = '%s' and %s ", lid, tsClause));
|
where.append(String.format(" where lid = '%s' and %s ", lid,
|
||||||
|
tsClause));
|
||||||
where.append(" AND value != '-9999.0' AND ");
|
where.append(" AND value != '-9999.0' AND ");
|
||||||
where.append(String.format(" obstime >= '%s' AND ",
|
where.append(String.format(" obstime >= '%s' AND ",
|
||||||
HydroConstants.DATE_FORMAT.format(adjustedBeginTime.getTime())));
|
HydroConstants.DATE_FORMAT.format(adjustedBeginTime
|
||||||
|
.getTime())));
|
||||||
where.append(String.format(" obstime <= '%s' ",
|
where.append(String.format(" obstime <= '%s' ",
|
||||||
HydroConstants.DATE_FORMAT.format(queryEndTime)));
|
HydroConstants.DATE_FORMAT.format(queryEndTime)));
|
||||||
where.append("AND value IS NOT NULL AND ");
|
where.append("AND value IS NOT NULL AND ");
|
||||||
|
@ -214,7 +216,8 @@ public class PointPrecipDataManager extends HydroDataManager {
|
||||||
where.append(String.format(" WHERE %s ", tsClause));
|
where.append(String.format(" WHERE %s ", tsClause));
|
||||||
where.append(" AND value != '-9999.0' AND ");
|
where.append(" AND value != '-9999.0' AND ");
|
||||||
where.append(String.format("obstime >= '%s' AND ",
|
where.append(String.format("obstime >= '%s' AND ",
|
||||||
HydroConstants.DATE_FORMAT.format(adjustedBeginTime.getTime())));
|
HydroConstants.DATE_FORMAT.format(adjustedBeginTime
|
||||||
|
.getTime())));
|
||||||
where.append(String.format(" obstime <= '%s' ",
|
where.append(String.format(" obstime <= '%s' ",
|
||||||
HydroConstants.DATE_FORMAT.format(queryEndTime)));
|
HydroConstants.DATE_FORMAT.format(queryEndTime)));
|
||||||
where.append("AND value IS NOT NULL AND ");
|
where.append("AND value IS NOT NULL AND ");
|
||||||
|
@ -224,7 +227,8 @@ public class PointPrecipDataManager extends HydroDataManager {
|
||||||
where.append(String.format(" WHERE lid = '%s' ", lid));
|
where.append(String.format(" WHERE lid = '%s' ", lid));
|
||||||
where.append(" AND value != '-9999.0' AND ");
|
where.append(" AND value != '-9999.0' AND ");
|
||||||
where.append(String.format("obstime >= '%s' AND ",
|
where.append(String.format("obstime >= '%s' AND ",
|
||||||
HydroConstants.DATE_FORMAT.format(adjustedBeginTime.getTime())));
|
HydroConstants.DATE_FORMAT.format(adjustedBeginTime
|
||||||
|
.getTime())));
|
||||||
where.append(String.format(" obstime <= '%s' ",
|
where.append(String.format(" obstime <= '%s' ",
|
||||||
HydroConstants.DATE_FORMAT.format(queryEndTime)));
|
HydroConstants.DATE_FORMAT.format(queryEndTime)));
|
||||||
where.append("AND value IS NOT NULL AND ");
|
where.append("AND value IS NOT NULL AND ");
|
||||||
|
@ -233,7 +237,8 @@ public class PointPrecipDataManager extends HydroDataManager {
|
||||||
} else {
|
} else {
|
||||||
where.append(" WHERE value != '-9999.0' AND ");
|
where.append(" WHERE value != '-9999.0' AND ");
|
||||||
where.append(String.format("obstime >= '%s' AND ",
|
where.append(String.format("obstime >= '%s' AND ",
|
||||||
HydroConstants.DATE_FORMAT.format(adjustedBeginTime.getTime())));
|
HydroConstants.DATE_FORMAT.format(adjustedBeginTime
|
||||||
|
.getTime())));
|
||||||
where.append(String.format(" obstime <= '%s' ",
|
where.append(String.format(" obstime <= '%s' ",
|
||||||
HydroConstants.DATE_FORMAT.format(queryEndTime)));
|
HydroConstants.DATE_FORMAT.format(queryEndTime)));
|
||||||
where.append("AND value IS NOT NULL AND ");
|
where.append("AND value IS NOT NULL AND ");
|
||||||
|
@ -249,13 +254,13 @@ public class PointPrecipDataManager extends HydroDataManager {
|
||||||
Curpc curpc = new Curpc();
|
Curpc curpc = new Curpc();
|
||||||
curpc.getId().setLid((String) rowData[i]);
|
curpc.getId().setLid((String) rowData[i]);
|
||||||
curpc.setPe((String) rowData[++i]);
|
curpc.setPe((String) rowData[++i]);
|
||||||
curpc.setDur((Short) rowData[++i]);
|
curpc.setDur(((Number) rowData[++i]).shortValue());
|
||||||
curpc.getId().setTs((String) rowData[++i]);
|
curpc.getId().setTs((String) rowData[++i]);
|
||||||
curpc.getId().setExtremum((String) rowData[++i]);
|
curpc.getId().setExtremum((String) rowData[++i]);
|
||||||
curpc.getId().setObstime((Date) rowData[++i]);
|
curpc.getId().setObstime((Date) rowData[++i]);
|
||||||
curpc.setValue((Double) rowData[++i]);
|
curpc.setValue((Double) rowData[++i]);
|
||||||
curpc.setShefQualCode((String) rowData[++i]);
|
curpc.setShefQualCode((String) rowData[++i]);
|
||||||
curpc.setRevision((Short) rowData[++i]);
|
curpc.setRevision(((Number) rowData[++i]).shortValue());
|
||||||
curpc.setProductId((String) rowData[++i]);
|
curpc.setProductId((String) rowData[++i]);
|
||||||
curpc.setProducttime((Date) rowData[++i]);
|
curpc.setProducttime((Date) rowData[++i]);
|
||||||
curpc.setPostingtime((Date) rowData[++i]);
|
curpc.setPostingtime((Date) rowData[++i]);
|
||||||
|
@ -272,11 +277,11 @@ public class PointPrecipDataManager extends HydroDataManager {
|
||||||
*
|
*
|
||||||
* @param lid
|
* @param lid
|
||||||
* The lid to query on
|
* The lid to query on
|
||||||
* @return
|
* @return Object[] - 0 = lat, 1 = lon, 2 = name
|
||||||
* Object[] - 0 = lat, 1 = lon, 2 = name
|
|
||||||
*/
|
*/
|
||||||
public Object[] getLocInfo(String lid) {
|
public Object[] getLocInfo(String lid) {
|
||||||
String query = "select lat, lon, name from location where lid = '" + lid + "'";
|
String query = "select lat, lon, name from location where lid = '"
|
||||||
|
+ lid + "'";
|
||||||
|
|
||||||
Object[] result = null;
|
Object[] result = null;
|
||||||
|
|
||||||
|
@ -290,7 +295,8 @@ public class PointPrecipDataManager extends HydroDataManager {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList<Rawpc> loadPcRaw(Date beginTime, Date endTime, String lid, List<String> tsList, RawPrecipTable table) {
|
public ArrayList<Rawpc> loadPcRaw(Date beginTime, Date endTime, String lid,
|
||||||
|
List<String> tsList, RawPrecipTable table) {
|
||||||
String tsClause = null;
|
String tsClause = null;
|
||||||
StringBuilder where = new StringBuilder();
|
StringBuilder where = new StringBuilder();
|
||||||
ArrayList<Object[]> pcData;
|
ArrayList<Object[]> pcData;
|
||||||
|
@ -302,7 +308,8 @@ public class PointPrecipDataManager extends HydroDataManager {
|
||||||
/*
|
/*
|
||||||
* In order to consider cases that there is no PC data during dry
|
* In order to consider cases that there is no PC data during dry
|
||||||
* periods, retrieve more wider data for gages, use token
|
* periods, retrieve more wider data for gages, use token
|
||||||
* adjust_PC_startingtime to specify the PC data retrieval starting point
|
* adjust_PC_startingtime to specify the PC data retrieval starting
|
||||||
|
* point
|
||||||
*/
|
*/
|
||||||
if (adjustedPCStartTime == HydroConstants.MISSING_VALUE) {
|
if (adjustedPCStartTime == HydroConstants.MISSING_VALUE) {
|
||||||
AppsDefaults ad = AppsDefaults.getInstance();
|
AppsDefaults ad = AppsDefaults.getInstance();
|
||||||
|
@ -317,18 +324,17 @@ public class PointPrecipDataManager extends HydroDataManager {
|
||||||
adjustedPCStartTime = PointPrecipConstants.DEFAULT_ADJUSTED_STARTTIME_HRS;
|
adjustedPCStartTime = PointPrecipConstants.DEFAULT_ADJUSTED_STARTTIME_HRS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Adjust the start hours
|
// Adjust the start hours
|
||||||
Calendar adjustedBeginTime = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
|
Calendar adjustedBeginTime = Calendar.getInstance(TimeZone
|
||||||
|
.getTimeZone("GMT"));
|
||||||
adjustedBeginTime.setTimeInMillis(beginTime.getTime());
|
adjustedBeginTime.setTimeInMillis(beginTime.getTime());
|
||||||
/*if (adjustedPCStartTime != -9999) {
|
/*
|
||||||
adjustedBeginTime.add(Calendar.HOUR, adjustedPCStartTime * -1);
|
* if (adjustedPCStartTime != -9999) {
|
||||||
}*/
|
* adjustedBeginTime.add(Calendar.HOUR, adjustedPCStartTime * -1); }
|
||||||
|
*/
|
||||||
|
|
||||||
adjustedBeginTime.add(Calendar.HOUR_OF_DAY, adjustedPCStartTime * -1);
|
adjustedBeginTime.add(Calendar.HOUR_OF_DAY, adjustedPCStartTime * -1);
|
||||||
|
|
||||||
|
|
||||||
if (tsList.size() > 0) {
|
if (tsList.size() > 0) {
|
||||||
tsClause = build_ts_clause(tsList);
|
tsClause = build_ts_clause(tsList);
|
||||||
if (tsClause == null) {
|
if (tsClause == null) {
|
||||||
|
@ -337,10 +343,12 @@ public class PointPrecipDataManager extends HydroDataManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((lid.length() > 0) && (tsList.size() > 0)) {
|
if ((lid.length() > 0) && (tsList.size() > 0)) {
|
||||||
where.append(String.format(" where lid = '%s' and %s ", lid, tsClause));
|
where.append(String.format(" where lid = '%s' and %s ", lid,
|
||||||
|
tsClause));
|
||||||
where.append(" AND value != '-9999.0' AND ");
|
where.append(" AND value != '-9999.0' AND ");
|
||||||
where.append(String.format(" obstime >= '%s' AND ",
|
where.append(String.format(" obstime >= '%s' AND ",
|
||||||
HydroConstants.DATE_FORMAT.format(adjustedBeginTime.getTime())));
|
HydroConstants.DATE_FORMAT.format(adjustedBeginTime
|
||||||
|
.getTime())));
|
||||||
where.append(String.format(" obstime <= '%s' ",
|
where.append(String.format(" obstime <= '%s' ",
|
||||||
HydroConstants.DATE_FORMAT.format(endTime)));
|
HydroConstants.DATE_FORMAT.format(endTime)));
|
||||||
where.append("AND value IS NOT NULL AND ");
|
where.append("AND value IS NOT NULL AND ");
|
||||||
|
@ -350,7 +358,8 @@ public class PointPrecipDataManager extends HydroDataManager {
|
||||||
where.append(String.format(" WHERE %s ", tsClause));
|
where.append(String.format(" WHERE %s ", tsClause));
|
||||||
where.append(" AND value != '-9999.0' AND ");
|
where.append(" AND value != '-9999.0' AND ");
|
||||||
where.append(String.format("obstime >= '%s' AND ",
|
where.append(String.format("obstime >= '%s' AND ",
|
||||||
HydroConstants.DATE_FORMAT.format(adjustedBeginTime.getTime())));
|
HydroConstants.DATE_FORMAT.format(adjustedBeginTime
|
||||||
|
.getTime())));
|
||||||
where.append(String.format(" obstime <= '%s' ",
|
where.append(String.format(" obstime <= '%s' ",
|
||||||
HydroConstants.DATE_FORMAT.format(endTime)));
|
HydroConstants.DATE_FORMAT.format(endTime)));
|
||||||
where.append("AND value IS NOT NULL AND ");
|
where.append("AND value IS NOT NULL AND ");
|
||||||
|
@ -360,7 +369,8 @@ public class PointPrecipDataManager extends HydroDataManager {
|
||||||
where.append(String.format(" WHERE lid = '%s' ", lid));
|
where.append(String.format(" WHERE lid = '%s' ", lid));
|
||||||
where.append(" AND value != '-9999.0' AND ");
|
where.append(" AND value != '-9999.0' AND ");
|
||||||
where.append(String.format("obstime >= '%s' AND ",
|
where.append(String.format("obstime >= '%s' AND ",
|
||||||
HydroConstants.DATE_FORMAT.format(adjustedBeginTime.getTime())));
|
HydroConstants.DATE_FORMAT.format(adjustedBeginTime
|
||||||
|
.getTime())));
|
||||||
where.append(String.format(" obstime <= '%s' ",
|
where.append(String.format(" obstime <= '%s' ",
|
||||||
HydroConstants.DATE_FORMAT.format(endTime)));
|
HydroConstants.DATE_FORMAT.format(endTime)));
|
||||||
where.append("AND value IS NOT NULL AND ");
|
where.append("AND value IS NOT NULL AND ");
|
||||||
|
@ -370,7 +380,8 @@ public class PointPrecipDataManager extends HydroDataManager {
|
||||||
} else {
|
} else {
|
||||||
where.append(" WHERE value != '-9999.0' AND ");
|
where.append(" WHERE value != '-9999.0' AND ");
|
||||||
where.append(String.format("obstime >= '%s' AND ",
|
where.append(String.format("obstime >= '%s' AND ",
|
||||||
HydroConstants.DATE_FORMAT.format(adjustedBeginTime.getTime())));
|
HydroConstants.DATE_FORMAT.format(adjustedBeginTime
|
||||||
|
.getTime())));
|
||||||
where.append(String.format(" obstime <= '%s' ",
|
where.append(String.format(" obstime <= '%s' ",
|
||||||
HydroConstants.DATE_FORMAT.format(endTime)));
|
HydroConstants.DATE_FORMAT.format(endTime)));
|
||||||
where.append("AND value IS NOT NULL AND ");
|
where.append("AND value IS NOT NULL AND ");
|
||||||
|
@ -392,14 +403,14 @@ public class PointPrecipDataManager extends HydroDataManager {
|
||||||
rawpc.setId(id);
|
rawpc.setId(id);
|
||||||
rawpc.getId().setLid((String) oa[i]);
|
rawpc.getId().setLid((String) oa[i]);
|
||||||
rawpc.setPe((String) oa[++i]);
|
rawpc.setPe((String) oa[++i]);
|
||||||
rawpc.setDur(((Integer) oa[++i]).shortValue());
|
rawpc.setDur(((Number) oa[++i]).shortValue());
|
||||||
rawpc.getId().setTs((String) oa[++i]);
|
rawpc.getId().setTs((String) oa[++i]);
|
||||||
rawpc.getId().setExtremum((String) oa[++i]);
|
rawpc.getId().setExtremum((String) oa[++i]);
|
||||||
rawpc.getId().setObstime((Date) oa[++i]);
|
rawpc.getId().setObstime((Date) oa[++i]);
|
||||||
rawpc.setValue((Double) oa[++i]);
|
rawpc.setValue((Double) oa[++i]);
|
||||||
rawpc.setShefQualCode((String) oa[++i]);
|
rawpc.setShefQualCode((String) oa[++i]);
|
||||||
rawpc.setQualityCode((Integer) oa[++i]);
|
rawpc.setQualityCode(((Number) oa[++i]).intValue());
|
||||||
rawpc.setRevision(((Integer) oa[++i]).shortValue());
|
rawpc.setRevision(((Number) oa[++i]).shortValue());
|
||||||
rawpc.setProductId((String) oa[++i]);
|
rawpc.setProductId((String) oa[++i]);
|
||||||
rawpc.setProducttime((Date) oa[++i]);
|
rawpc.setProducttime((Date) oa[++i]);
|
||||||
rawpc.setPostingtime((Date) oa[++i]);
|
rawpc.setPostingtime((Date) oa[++i]);
|
||||||
|
@ -418,14 +429,14 @@ public class PointPrecipDataManager extends HydroDataManager {
|
||||||
Rawpc rawpc = new Rawpc();
|
Rawpc rawpc = new Rawpc();
|
||||||
rawpc.getId().setLid((String) oa[i]);
|
rawpc.getId().setLid((String) oa[i]);
|
||||||
rawpc.setPe((String) oa[++i]);
|
rawpc.setPe((String) oa[++i]);
|
||||||
rawpc.setDur((Short) oa[++i]);
|
rawpc.setDur(((Number) oa[++i]).shortValue());
|
||||||
rawpc.getId().setTs((String) oa[++i]);
|
rawpc.getId().setTs((String) oa[++i]);
|
||||||
rawpc.getId().setExtremum((String) oa[++i]);
|
rawpc.getId().setExtremum((String) oa[++i]);
|
||||||
rawpc.getId().setObstime((Date) oa[++i]);
|
rawpc.getId().setObstime((Date) oa[++i]);
|
||||||
rawpc.setValue((Double) oa[++i]);
|
rawpc.setValue((Double) oa[++i]);
|
||||||
rawpc.setShefQualCode((String) oa[++i]);
|
rawpc.setShefQualCode((String) oa[++i]);
|
||||||
rawpc.setQualityCode((Integer) oa[++i]);
|
rawpc.setQualityCode(((Number) oa[++i]).intValue());
|
||||||
rawpc.setRevision((Short) oa[++i]);
|
rawpc.setRevision(((Number) oa[++i]).shortValue());
|
||||||
rawpc.setProductId((String) oa[++i]);
|
rawpc.setProductId((String) oa[++i]);
|
||||||
rawpc.setProducttime((Date) oa[++i]);
|
rawpc.setProducttime((Date) oa[++i]);
|
||||||
rawpc.setPostingtime((Date) oa[++i]);
|
rawpc.setPostingtime((Date) oa[++i]);
|
||||||
|
@ -438,7 +449,8 @@ public class PointPrecipDataManager extends HydroDataManager {
|
||||||
return pRawPc;
|
return pRawPc;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList<Rawpp> loadPpRaw(Date beginTime, Date endTime, String lid, List<String> tsList, RawPrecipTable table) {
|
public ArrayList<Rawpp> loadPpRaw(Date beginTime, Date endTime, String lid,
|
||||||
|
List<String> tsList, RawPrecipTable table) {
|
||||||
StringBuilder where = new StringBuilder();
|
StringBuilder where = new StringBuilder();
|
||||||
String tsClause = null;
|
String tsClause = null;
|
||||||
ArrayList<Object[]> pcData;
|
ArrayList<Object[]> pcData;
|
||||||
|
@ -458,8 +470,10 @@ public class PointPrecipDataManager extends HydroDataManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((lid.length() > 0) && (tsList.size() > 0)) {
|
if ((lid.length() > 0) && (tsList.size() > 0)) {
|
||||||
where.append(String.format(" WHERE lid = '%s' AND %s ", lid, tsClause));
|
where.append(String.format(" WHERE lid = '%s' AND %s ", lid,
|
||||||
where.append(String.format(" AND value != '-9999.0' AND obstime >= '%s' ",
|
tsClause));
|
||||||
|
where.append(String.format(
|
||||||
|
" AND value != '-9999.0' AND obstime >= '%s' ",
|
||||||
HydroConstants.DATE_FORMAT.format(beginTime)));
|
HydroConstants.DATE_FORMAT.format(beginTime)));
|
||||||
where.append(String.format(" AND obstime <= '%s' AND",
|
where.append(String.format(" AND obstime <= '%s' AND",
|
||||||
HydroConstants.DATE_FORMAT.format(endTime)));
|
HydroConstants.DATE_FORMAT.format(endTime)));
|
||||||
|
@ -480,7 +494,6 @@ public class PointPrecipDataManager extends HydroDataManager {
|
||||||
HydroConstants.DATE_FORMAT.format(endTime), qcWhere));
|
HydroConstants.DATE_FORMAT.format(endTime), qcWhere));
|
||||||
where.append(" ORDER BY ts ASC, DUR DESC, obstime DESC");
|
where.append(" ORDER BY ts ASC, DUR DESC, obstime DESC");
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
where.append(" WHERE value != '-9999.0' AND ");
|
where.append(" WHERE value != '-9999.0' AND ");
|
||||||
where.append(String.format("obstime >= '%s' AND ",
|
where.append(String.format("obstime >= '%s' AND ",
|
||||||
|
@ -504,14 +517,14 @@ public class PointPrecipDataManager extends HydroDataManager {
|
||||||
rawpp.setId(id);
|
rawpp.setId(id);
|
||||||
rawpp.getId().setLid((String) oa[i]);
|
rawpp.getId().setLid((String) oa[i]);
|
||||||
rawpp.setPe((String) oa[++i]);
|
rawpp.setPe((String) oa[++i]);
|
||||||
rawpp.getId().setDur(((Integer) oa[++i]).shortValue());
|
rawpp.getId().setDur(((Number) oa[++i]).shortValue());
|
||||||
rawpp.getId().setTs((String) oa[++i]);
|
rawpp.getId().setTs((String) oa[++i]);
|
||||||
rawpp.getId().setExtremum((String) oa[++i]);
|
rawpp.getId().setExtremum((String) oa[++i]);
|
||||||
rawpp.getId().setObstime((Date) oa[++i]);
|
rawpp.getId().setObstime((Date) oa[++i]);
|
||||||
rawpp.setValue((Double) oa[++i]);
|
rawpp.setValue((Double) oa[++i]);
|
||||||
rawpp.setShefQualCode((String) oa[++i]);
|
rawpp.setShefQualCode((String) oa[++i]);
|
||||||
rawpp.setQualityCode((Integer) oa[++i]);
|
rawpp.setQualityCode(((Number) oa[++i]).intValue());
|
||||||
rawpp.setRevision(((Integer) oa[++i]).shortValue());
|
rawpp.setRevision(((Number) oa[++i]).shortValue());
|
||||||
rawpp.setProductId((String) oa[++i]);
|
rawpp.setProductId((String) oa[++i]);
|
||||||
rawpp.setProducttime((Date) oa[++i]);
|
rawpp.setProducttime((Date) oa[++i]);
|
||||||
rawpp.setPostingtime((Date) oa[++i]);
|
rawpp.setPostingtime((Date) oa[++i]);
|
||||||
|
@ -529,13 +542,13 @@ public class PointPrecipDataManager extends HydroDataManager {
|
||||||
Rawpp rawpp = new Rawpp();
|
Rawpp rawpp = new Rawpp();
|
||||||
rawpp.getId().setLid((String) oa[i]);
|
rawpp.getId().setLid((String) oa[i]);
|
||||||
rawpp.setPe((String) oa[++i]);
|
rawpp.setPe((String) oa[++i]);
|
||||||
rawpp.getId().setDur((Short) oa[++i]);
|
rawpp.getId().setDur(((Number) oa[++i]).shortValue());
|
||||||
rawpp.getId().setTs((String) oa[++i]);
|
rawpp.getId().setTs((String) oa[++i]);
|
||||||
rawpp.getId().setExtremum((String) oa[++i]);
|
rawpp.getId().setExtremum((String) oa[++i]);
|
||||||
rawpp.getId().setObstime((Date) oa[++i]);
|
rawpp.getId().setObstime((Date) oa[++i]);
|
||||||
rawpp.setValue((Double) oa[++i]);
|
rawpp.setValue((Double) oa[++i]);
|
||||||
rawpp.setShefQualCode((String) oa[++i]);
|
rawpp.setShefQualCode((String) oa[++i]);
|
||||||
rawpp.setRevision((Short) oa[++i]);
|
rawpp.setRevision(((Number) oa[++i]).shortValue());
|
||||||
rawpp.setProductId((String) oa[++i]);
|
rawpp.setProductId((String) oa[++i]);
|
||||||
rawpp.setProducttime((Date) oa[++i]);
|
rawpp.setProducttime((Date) oa[++i]);
|
||||||
rawpp.setPostingtime((Date) oa[++i]);
|
rawpp.setPostingtime((Date) oa[++i]);
|
||||||
|
@ -552,23 +565,37 @@ public class PointPrecipDataManager extends HydroDataManager {
|
||||||
|
|
||||||
/* The data value is valid as per all checks. */
|
/* The data value is valid as per all checks. */
|
||||||
if (request == PointPrecipConstants.QC_PASSED) {
|
if (request == PointPrecipConstants.QC_PASSED) {
|
||||||
where = "quality_code >= " + PointPrecipConstants.GOOD_QUESTIONABLE_THRESHOLD;
|
where = "quality_code >= "
|
||||||
|
+ PointPrecipConstants.GOOD_QUESTIONABLE_THRESHOLD;
|
||||||
} else if (request == PointPrecipConstants.QC_NOT_PASSED) {
|
} else if (request == PointPrecipConstants.QC_NOT_PASSED) {
|
||||||
/* The gross range certainty check did not pass. The data is not usable. */
|
/*
|
||||||
where = "quality_code < " + PointPrecipConstants.GOOD_QUESTIONABLE_THRESHOLD;
|
* The gross range certainty check did not pass. The data is not
|
||||||
|
* usable.
|
||||||
|
*/
|
||||||
|
where = "quality_code < "
|
||||||
|
+ PointPrecipConstants.GOOD_QUESTIONABLE_THRESHOLD;
|
||||||
} else if (request == PointPrecipConstants.QC_FAILED) {
|
} else if (request == PointPrecipConstants.QC_FAILED) {
|
||||||
/* The data value is invalid because it failed at least one
|
/*
|
||||||
certainty check */
|
* The data value is invalid because it failed at least one
|
||||||
where = "quality_code < " + PointPrecipConstants.QUESTIONABLE_BAD_THRESHOLD;
|
* certainty check
|
||||||
|
*/
|
||||||
|
where = "quality_code < "
|
||||||
|
+ PointPrecipConstants.QUESTIONABLE_BAD_THRESHOLD;
|
||||||
} else if (request == PointPrecipConstants.QC_QUESTIONABLE) {
|
} else if (request == PointPrecipConstants.QC_QUESTIONABLE) {
|
||||||
/* The data value is questionable. It passed all certainty checks
|
/*
|
||||||
but failed at least one quality check. */
|
* The data value is questionable. It passed all certainty checks
|
||||||
where = "quality_code BETWEEN " + PointPrecipConstants.QUESTIONABLE_BAD_THRESHOLD +
|
* but failed at least one quality check.
|
||||||
" and " + (PointPrecipConstants.GOOD_QUESTIONABLE_THRESHOLD - 1);
|
*/
|
||||||
|
where = "quality_code BETWEEN "
|
||||||
|
+ PointPrecipConstants.QUESTIONABLE_BAD_THRESHOLD + " and "
|
||||||
|
+ (PointPrecipConstants.GOOD_QUESTIONABLE_THRESHOLD - 1);
|
||||||
} else if (request == PointPrecipConstants.QC_NOT_FAILED) {
|
} else if (request == PointPrecipConstants.QC_NOT_FAILED) {
|
||||||
/* The data is deemed full valid or is questionable, but it is
|
/*
|
||||||
not deemed bad with certainty. */
|
* The data is deemed full valid or is questionable, but it is not
|
||||||
where = "quality_code >= " + PointPrecipConstants.QUESTIONABLE_BAD_THRESHOLD;
|
* deemed bad with certainty.
|
||||||
|
*/
|
||||||
|
where = "quality_code >= "
|
||||||
|
+ PointPrecipConstants.QUESTIONABLE_BAD_THRESHOLD;
|
||||||
}
|
}
|
||||||
|
|
||||||
return where;
|
return where;
|
||||||
|
@ -579,8 +606,7 @@ public class PointPrecipDataManager extends HydroDataManager {
|
||||||
*
|
*
|
||||||
* @param lid
|
* @param lid
|
||||||
* The lid to check
|
* The lid to check
|
||||||
* @return
|
* @return true if alert station, false if not
|
||||||
* true if alert station, false if not
|
|
||||||
*/
|
*/
|
||||||
public boolean isAlertStation(String lid) {
|
public boolean isAlertStation(String lid) {
|
||||||
boolean alert = false;
|
boolean alert = false;
|
||||||
|
@ -590,7 +616,7 @@ public class PointPrecipDataManager extends HydroDataManager {
|
||||||
ArrayList<Object[]> rs = runQuery(query);
|
ArrayList<Object[]> rs = runQuery(query);
|
||||||
if ((rs != null) && (rs.size() > 0)) {
|
if ((rs != null) && (rs.size() > 0)) {
|
||||||
Object[] oa = rs.get(0);
|
Object[] oa = rs.get(0);
|
||||||
if (oa[0] != null && ((String) oa[0]).equalsIgnoreCase("ALERT")) {
|
if ((oa[0] != null) && ((String) oa[0]).equalsIgnoreCase("ALERT")) {
|
||||||
alert = true;
|
alert = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -602,7 +628,8 @@ public class PointPrecipDataManager extends HydroDataManager {
|
||||||
ArrayList<Object[]> rs = null;
|
ArrayList<Object[]> rs = null;
|
||||||
ArrayList<IngestFilter> filterList = null;
|
ArrayList<IngestFilter> filterList = null;
|
||||||
String query = "select lid, pe, duration, ts, extremum, ts_rank from ingestFilter";
|
String query = "select lid, pe, duration, ts, extremum, ts_rank from ingestFilter";
|
||||||
String where = " where lid = '" + lid + "' and ingest = 'T' order by ts asc";
|
String where = " where lid = '" + lid
|
||||||
|
+ "' and ingest = 'T' order by ts asc";
|
||||||
|
|
||||||
rs = runQuery(query + where);
|
rs = runQuery(query + where);
|
||||||
if ((rs != null) && (rs.size() > 0)) {
|
if ((rs != null) && (rs.size() > 0)) {
|
||||||
|
|
|
@ -49,7 +49,7 @@ import com.raytheon.viz.hydrocommon.HydroDataCache;
|
||||||
* 04Sept2008 1509 dhladky abstraction.
|
* 04Sept2008 1509 dhladky abstraction.
|
||||||
* 13Oct2008 1580 askripsky Refactored
|
* 13Oct2008 1580 askripsky Refactored
|
||||||
* 21 Feb 2010 2915 mpduff Fixed Time Zone problem.
|
* 21 Feb 2010 2915 mpduff Fixed Time Zone problem.
|
||||||
*
|
* Jul 21, 2015 4500 rjpeter Use Number in blind cast.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author ebabin
|
* @author ebabin
|
||||||
|
@ -66,7 +66,7 @@ public class StationReportingDataManager {
|
||||||
|
|
||||||
private HashMap<String, StationReportingTimingData> stationTime;
|
private HashMap<String, StationReportingTimingData> stationTime;
|
||||||
|
|
||||||
private String LATEST_OBS_FOR_LID_QUERY = "select lid,pe,dur,ts,extremum,obstime,value,shef_Qual_Code,quality_Code,revision,product_Id,producttime,postingtime from latestobsvalue where lid = ':lid' order by obstime desc, pe desc,ts desc,dur desc,extremum desc";
|
private final String LATEST_OBS_FOR_LID_QUERY = "select lid,pe,dur,ts,extremum,obstime,value,shef_Qual_Code,quality_Code,revision,product_Id,producttime,postingtime from latestobsvalue where lid = ':lid' order by obstime desc, pe desc,ts desc,dur desc,extremum desc";
|
||||||
|
|
||||||
private String previousWhere = " ";
|
private String previousWhere = " ";
|
||||||
|
|
||||||
|
@ -127,8 +127,9 @@ public class StationReportingDataManager {
|
||||||
|
|
||||||
List<Object[]> data;
|
List<Object[]> data;
|
||||||
try {
|
try {
|
||||||
data = DirectDbQuery.executeQuery(LATEST_OBS_FOR_LID_QUERY.replace(
|
data = DirectDbQuery.executeQuery(
|
||||||
":lid", lid), HydroConstants.IHFS, QueryLanguage.SQL);
|
LATEST_OBS_FOR_LID_QUERY.replace(":lid", lid),
|
||||||
|
HydroConstants.IHFS, QueryLanguage.SQL);
|
||||||
for (Object[] rowData : data) {
|
for (Object[] rowData : data) {
|
||||||
retVal.add(convertObsToDataRecord(rowData));
|
retVal.add(convertObsToDataRecord(rowData));
|
||||||
}
|
}
|
||||||
|
@ -162,7 +163,8 @@ public class StationReportingDataManager {
|
||||||
StationReportingConstants.Duration duration, int durationHours)
|
StationReportingConstants.Duration duration, int durationHours)
|
||||||
throws VizException {
|
throws VizException {
|
||||||
HydroDataCache hydroCache = HydroDataCache.getInstance();
|
HydroDataCache hydroCache = HydroDataCache.getInstance();
|
||||||
SimpleDateFormat currentTimeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat currentTimeFormat = new SimpleDateFormat(
|
||||||
|
"yyyy-MM-dd HH:mm:ss");
|
||||||
currentTimeFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
|
currentTimeFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
|
||||||
previousWhere = "";
|
previousWhere = "";
|
||||||
|
|
||||||
|
@ -182,8 +184,7 @@ public class StationReportingDataManager {
|
||||||
+ " FROM latestobsvalue WHERE obstime > '" + obsTimeString
|
+ " FROM latestobsvalue WHERE obstime > '" + obsTimeString
|
||||||
+ "')");
|
+ "')");
|
||||||
} else if (listType == ListType.NEVER) {
|
} else if (listType == ListType.NEVER) {
|
||||||
where
|
where.append(" WHERE lid = 'X-N/A-X' "
|
||||||
.append(" WHERE lid = 'X-N/A-X' "
|
|
||||||
+ "UNION "
|
+ "UNION "
|
||||||
+ "SELECT lid, "
|
+ "SELECT lid, "
|
||||||
+ " '', 0, '', '', "
|
+ " '', 0, '', '', "
|
||||||
|
@ -243,17 +244,20 @@ public class StationReportingDataManager {
|
||||||
StationReportingData srd = new StationReportingData(
|
StationReportingData srd = new StationReportingData(
|
||||||
lid, hydroCache.getLocationMap().get(lid));
|
lid, hydroCache.getLocationMap().get(lid));
|
||||||
srd.setPe((String) oa[1]);
|
srd.setPe((String) oa[1]);
|
||||||
srd.setDur(((Integer) oa[2]).shortValue());
|
srd.setDur(((Number) oa[2]).shortValue());
|
||||||
srd.setTs((String) oa[3]);
|
srd.setTs((String) oa[3]);
|
||||||
srd.setExtremum((String) oa[4]);
|
srd.setExtremum((String) oa[4]);
|
||||||
srd.setObstime(currentTimeFormat.format((Date) oa[5]));
|
srd.setObstime(currentTimeFormat
|
||||||
|
.format((Date) oa[5]));
|
||||||
srd.setValue((Double) oa[6]);
|
srd.setValue((Double) oa[6]);
|
||||||
srd.setRevision(((Integer) oa[7]).shortValue());
|
srd.setRevision(((Number) oa[7]).shortValue());
|
||||||
srd.setShefQualCode((String) oa[8]);
|
srd.setShefQualCode((String) oa[8]);
|
||||||
srd.setQualityCode((Integer) oa[9]);
|
srd.setQualityCode(((Number) oa[9]).intValue());
|
||||||
srd.setProductId((String) oa[10]);
|
srd.setProductId((String) oa[10]);
|
||||||
srd.setProducttime(currentTimeFormat.format((Date) oa[11]));
|
srd.setProducttime(currentTimeFormat
|
||||||
srd.setPostingtime(currentTimeFormat.format((Date) oa[12]));
|
.format((Date) oa[11]));
|
||||||
|
srd.setPostingtime(currentTimeFormat
|
||||||
|
.format((Date) oa[12]));
|
||||||
|
|
||||||
rval.add(srd);
|
rval.add(srd);
|
||||||
lidList.add(lid);
|
lidList.add(lid);
|
||||||
|
@ -286,7 +290,7 @@ public class StationReportingDataManager {
|
||||||
retVal.setPe(dataRow[1].toString());
|
retVal.setPe(dataRow[1].toString());
|
||||||
|
|
||||||
if (dataRow[2] != null) {
|
if (dataRow[2] != null) {
|
||||||
retVal.setDur(((Integer) dataRow[2]).shortValue());
|
retVal.setDur(((Number) dataRow[2]).shortValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
retVal.setTs(dataRow[3].toString());
|
retVal.setTs(dataRow[3].toString());
|
||||||
|
@ -299,11 +303,11 @@ public class StationReportingDataManager {
|
||||||
retVal.setShefQualCode(dataRow[7].toString());
|
retVal.setShefQualCode(dataRow[7].toString());
|
||||||
|
|
||||||
if (dataRow[8] != null) {
|
if (dataRow[8] != null) {
|
||||||
retVal.setQualityCode((Integer) dataRow[8]);
|
retVal.setQualityCode(((Number) dataRow[8]).intValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dataRow[9] != null) {
|
if (dataRow[9] != null) {
|
||||||
retVal.setRevision(((Integer) dataRow[9]).shortValue());
|
retVal.setRevision(((Number) dataRow[9]).shortValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
retVal.setProductId(dataRow[10].toString());
|
retVal.setProductId(dataRow[10].toString());
|
||||||
|
|
|
@ -129,7 +129,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* Feb 27,2013 1790 rferrel Bug fix for non-blocking dialogs.
|
* Feb 27,2013 1790 rferrel Bug fix for non-blocking dialogs.
|
||||||
* Jun 07, 2013 1981 mpduff Set user's id on the OUPRequest as it is now protected.
|
* Jun 07, 2013 1981 mpduff Set user's id on the OUPRequest as it is now protected.
|
||||||
* Jul 16, 2013 2088 rferrel Changes for non-blocking TextEditorDlg.
|
* Jul 16, 2013 2088 rferrel Changes for non-blocking TextEditorDlg.
|
||||||
*
|
* Jul 21, 2015 4500 rjpeter Use Number in blind cast.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author lvenable
|
* @author lvenable
|
||||||
|
@ -1033,7 +1033,7 @@ public class TabularTimeSeriesDlg extends CaveSWTDialog implements
|
||||||
reviewSendScriptBtn.addSelectionListener(new SelectionAdapter() {
|
reviewSendScriptBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
if (sendConfigDlg == null || sendConfigDlg.isDisposed()) {
|
if ((sendConfigDlg == null) || sendConfigDlg.isDisposed()) {
|
||||||
sendConfigDlg = new SendConfigDlg(shell);
|
sendConfigDlg = new SendConfigDlg(shell);
|
||||||
sendConfigDlg.open();
|
sendConfigDlg.open();
|
||||||
} else {
|
} else {
|
||||||
|
@ -1883,8 +1883,8 @@ public class TabularTimeSeriesDlg extends CaveSWTDialog implements
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
ArrayList<DataRecord> dataRecordList = new ArrayList<DataRecord>();
|
ArrayList<DataRecord> dataRecordList = new ArrayList<DataRecord>();
|
||||||
|
|
||||||
for (int i = 0; i < selectionIndices.length; i++) {
|
for (int selectionIndice : selectionIndices) {
|
||||||
TabularData td = tabularDataList.get(selectionIndices[i]);
|
TabularData td = tabularDataList.get(selectionIndice);
|
||||||
|
|
||||||
/* set the update structure with data which doesn't change */
|
/* set the update structure with data which doesn't change */
|
||||||
dr = new DataRecord();
|
dr = new DataRecord();
|
||||||
|
@ -1997,8 +1997,8 @@ public class TabularTimeSeriesDlg extends CaveSWTDialog implements
|
||||||
/* Loop through the data values selected and delete each one */
|
/* Loop through the data values selected and delete each one */
|
||||||
int[] selectionIndices = bottomListControl.getSelectionIndices();
|
int[] selectionIndices = bottomListControl.getSelectionIndices();
|
||||||
|
|
||||||
for (int i = 0; i < selectionIndices.length; i++) {
|
for (int selectionIndice : selectionIndices) {
|
||||||
TabularData td = tabularDataList.get(selectionIndices[i]);
|
TabularData td = tabularDataList.get(selectionIndice);
|
||||||
// SiteInfo si = tabInfo.getSiteInfo(topDataList
|
// SiteInfo si = tabInfo.getSiteInfo(topDataList
|
||||||
// .getSelectionIndex());
|
// .getSelectionIndex());
|
||||||
DataRecord dr = new DataRecord();
|
DataRecord dr = new DataRecord();
|
||||||
|
@ -2134,8 +2134,8 @@ public class TabularTimeSeriesDlg extends CaveSWTDialog implements
|
||||||
DataRecord dr = new DataRecord();
|
DataRecord dr = new DataRecord();
|
||||||
|
|
||||||
/* code to update an observation qc info */
|
/* code to update an observation qc info */
|
||||||
for (int i = 0; i < selectionIndices.length; i++) {
|
for (int selectionIndice : selectionIndices) {
|
||||||
TabularData td = tabularDataList.get(selectionIndices[i]);
|
TabularData td = tabularDataList.get(selectionIndice);
|
||||||
|
|
||||||
/* set the update structure with data which doesn't change */
|
/* set the update structure with data which doesn't change */
|
||||||
dr.setLid(lid);
|
dr.setLid(lid);
|
||||||
|
@ -2325,11 +2325,11 @@ public class TabularTimeSeriesDlg extends CaveSWTDialog implements
|
||||||
// one inch from left side of paper
|
// one inch from left side of paper
|
||||||
leftMargin = dpi.x + trim.x;
|
leftMargin = dpi.x + trim.x;
|
||||||
// one inch from right side of paper
|
// one inch from right side of paper
|
||||||
rightMargin = clientArea.width - dpi.x + trim.x + trim.width;
|
rightMargin = (clientArea.width - dpi.x) + trim.x + trim.width;
|
||||||
// one inch from top edge of paper
|
// one inch from top edge of paper
|
||||||
topMargin = dpi.y + trim.y;
|
topMargin = dpi.y + trim.y;
|
||||||
// one inch from bottom edge of paper
|
// one inch from bottom edge of paper
|
||||||
bottomMargin = clientArea.height - dpi.y + trim.y + trim.height;
|
bottomMargin = (clientArea.height - dpi.y) + trim.y + trim.height;
|
||||||
|
|
||||||
// Create a buffer for computing tab width.
|
// Create a buffer for computing tab width.
|
||||||
int tabSize = 4; // is tab width a user setting in your UI?
|
int tabSize = 4; // is tab width a user setting in your UI?
|
||||||
|
@ -2541,7 +2541,7 @@ public class TabularTimeSeriesDlg extends CaveSWTDialog implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (y + lineHeight <= bottomMargin) {
|
if ((y + lineHeight) <= bottomMargin) {
|
||||||
printer.endPage();
|
printer.endPage();
|
||||||
}
|
}
|
||||||
wordBuffer = null;
|
wordBuffer = null;
|
||||||
|
@ -2554,7 +2554,7 @@ public class TabularTimeSeriesDlg extends CaveSWTDialog implements
|
||||||
if (wordBuffer.length() > 0) {
|
if (wordBuffer.length() > 0) {
|
||||||
String word = wordBuffer.toString();
|
String word = wordBuffer.toString();
|
||||||
int wordWidth = gc.stringExtent(word).x;
|
int wordWidth = gc.stringExtent(word).x;
|
||||||
if (x + wordWidth > rightMargin) {
|
if ((x + wordWidth) > rightMargin) {
|
||||||
// word doesn't fit on current line, so wrap
|
// word doesn't fit on current line, so wrap
|
||||||
newline();
|
newline();
|
||||||
}
|
}
|
||||||
|
@ -2570,9 +2570,9 @@ public class TabularTimeSeriesDlg extends CaveSWTDialog implements
|
||||||
private void newline() {
|
private void newline() {
|
||||||
x = leftMargin;
|
x = leftMargin;
|
||||||
y += lineHeight;
|
y += lineHeight;
|
||||||
if (y + lineHeight > bottomMargin) {
|
if ((y + lineHeight) > bottomMargin) {
|
||||||
printer.endPage();
|
printer.endPage();
|
||||||
if (index + 1 < end) {
|
if ((index + 1) < end) {
|
||||||
y = topMargin;
|
y = topMargin;
|
||||||
printer.startPage();
|
printer.startPage();
|
||||||
}
|
}
|
||||||
|
@ -2715,7 +2715,7 @@ public class TabularTimeSeriesDlg extends CaveSWTDialog implements
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Should only be one here, lid is primary key */
|
/* Should only be one here, lid is primary key */
|
||||||
if (floodList != null && floodList.size() > 0) {
|
if ((floodList != null) && (floodList.size() > 0)) {
|
||||||
Object[] oa = floodList.get(0);
|
Object[] oa = floodList.get(0);
|
||||||
String floodStage = "0.0";
|
String floodStage = "0.0";
|
||||||
String floodFlow = "0";
|
String floodFlow = "0";
|
||||||
|
@ -2785,7 +2785,7 @@ public class TabularTimeSeriesDlg extends CaveSWTDialog implements
|
||||||
FcstheightId fhid = new FcstheightId();
|
FcstheightId fhid = new FcstheightId();
|
||||||
fhid.setLid(si.getLid());
|
fhid.setLid(si.getLid());
|
||||||
fhid.setPe(si.getPe());
|
fhid.setPe(si.getPe());
|
||||||
fhid.setDur(((Integer) si.getDur()).shortValue());
|
fhid.setDur((short) si.getDur());
|
||||||
fhid.setExtremum(si.getExt());
|
fhid.setExtremum(si.getExt());
|
||||||
fcstRow.setPostingtime(postingTime);
|
fcstRow.setPostingtime(postingTime);
|
||||||
|
|
||||||
|
@ -2928,7 +2928,7 @@ public class TabularTimeSeriesDlg extends CaveSWTDialog implements
|
||||||
BufferedWriter out = new BufferedWriter(new FileWriter(
|
BufferedWriter out = new BufferedWriter(new FileWriter(
|
||||||
shefFileName, true));
|
shefFileName, true));
|
||||||
int[] indices = bottomListControl.getSelectionIndices();
|
int[] indices = bottomListControl.getSelectionIndices();
|
||||||
for (int i = 0; i < indices.length; i++) {
|
for (int indice : indices) {
|
||||||
|
|
||||||
String data = topDataList.getItem(topDataList
|
String data = topDataList.getItem(topDataList
|
||||||
.getSelectionIndex());
|
.getSelectionIndex());
|
||||||
|
@ -2957,7 +2957,7 @@ public class TabularTimeSeriesDlg extends CaveSWTDialog implements
|
||||||
endingTime, basisTime, forecast);
|
endingTime, basisTime, forecast);
|
||||||
|
|
||||||
/* if manually edited data then format as .AR message */
|
/* if manually edited data then format as .AR message */
|
||||||
TabularData td = tabularDataList.get(indices[i]);
|
TabularData td = tabularDataList.get(indice);
|
||||||
if (td.getShefQualCode().startsWith("M")) {
|
if (td.getShefQualCode().startsWith("M")) {
|
||||||
fmtType = ".AR";
|
fmtType = ".AR";
|
||||||
}
|
}
|
||||||
|
@ -3027,7 +3027,7 @@ public class TabularTimeSeriesDlg extends CaveSWTDialog implements
|
||||||
if ((shefFileName != null) && (shefFileName.length() > 0)) {
|
if ((shefFileName != null) && (shefFileName.length() > 0)) {
|
||||||
File shefFile = new File(shefFileName);
|
File shefFile = new File(shefFileName);
|
||||||
if (shefFile.exists()) {
|
if (shefFile.exists()) {
|
||||||
if (editor == null || editor.isDisposed()) {
|
if ((editor == null) || editor.isDisposed()) {
|
||||||
editor = new TextEditorDlg(shell, false, shefFile);
|
editor = new TextEditorDlg(shell, false, shefFile);
|
||||||
editor.open();
|
editor.open();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -73,8 +73,8 @@ import com.raytheon.viz.hydrocommon.util.DbUtils;
|
||||||
* Mar 25, 2013 1781 mpduff Constrain time series table query with a start time.
|
* Mar 25, 2013 1781 mpduff Constrain time series table query with a start time.
|
||||||
* May 12 2014 16705 lbousaidi update revision and shef_qual_code in edit routine.
|
* May 12 2014 16705 lbousaidi update revision and shef_qual_code in edit routine.
|
||||||
* Dec 14, 2014 16388 xwei updated the insertion of rejecteddata table.
|
* Dec 14, 2014 16388 xwei updated the insertion of rejecteddata table.
|
||||||
*
|
* Jul 21, 2015 4500 rjpeter Use Number in blind cast.
|
||||||
</pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author dhladky
|
* @author dhladky
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
|
@ -251,7 +251,7 @@ public class TimeSeriesDataManager extends HydroDataManager {
|
||||||
SiteInfo si = new SiteInfo();
|
SiteInfo si = new SiteInfo();
|
||||||
si.setLid((String) oa[0]);
|
si.setLid((String) oa[0]);
|
||||||
si.setPe((String) oa[1]);
|
si.setPe((String) oa[1]);
|
||||||
si.setDur((Integer) oa[2]);
|
si.setDur(((Number) oa[2]).intValue());
|
||||||
si.setTs((String) oa[3]);
|
si.setTs((String) oa[3]);
|
||||||
si.setExt((String) oa[4]);
|
si.setExt((String) oa[4]);
|
||||||
returnData.add(si);
|
returnData.add(si);
|
||||||
|
@ -561,15 +561,15 @@ public class TimeSeriesDataManager extends HydroDataManager {
|
||||||
td.setLid((String) oa[0]);
|
td.setLid((String) oa[0]);
|
||||||
td.setObsTime((Date) oa[1]);
|
td.setObsTime((Date) oa[1]);
|
||||||
td.setValue((Double) oa[2]);
|
td.setValue((Double) oa[2]);
|
||||||
td.setRevision((Integer) oa[3]);
|
td.setRevision(((Number) oa[3]).intValue());
|
||||||
td.setShefQualCode((String) oa[4]);
|
td.setShefQualCode((String) oa[4]);
|
||||||
td.setQualityCode((Integer) oa[5]);
|
td.setQualityCode(((Number) oa[5]).intValue());
|
||||||
td.setProductId((String) oa[6]);
|
td.setProductId((String) oa[6]);
|
||||||
td.setProductTime((Date) oa[7]);
|
td.setProductTime((Date) oa[7]);
|
||||||
td.setPostingTime((Date) oa[8]);
|
td.setPostingTime((Date) oa[8]);
|
||||||
if (forecastData) {
|
if (forecastData) {
|
||||||
td.setValidTime((Date) oa[9]);
|
td.setValidTime((Date) oa[9]);
|
||||||
td.setProbability((Float) oa[10]);
|
td.setProbability(((Number) oa[10]).floatValue());
|
||||||
}
|
}
|
||||||
tabularData.add(td);
|
tabularData.add(td);
|
||||||
}
|
}
|
||||||
|
@ -612,7 +612,7 @@ public class TimeSeriesDataManager extends HydroDataManager {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (Long) results.get(0)[0];
|
return ((Number) results.get(0)[0]).longValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -927,8 +927,8 @@ public class TimeSeriesDataManager extends HydroDataManager {
|
||||||
try {
|
try {
|
||||||
sqlResult = (DirectDbQuery.executeQuery(sql.toString(),
|
sqlResult = (DirectDbQuery.executeQuery(sql.toString(),
|
||||||
HydroConstants.IHFS, QueryLanguage.SQL));
|
HydroConstants.IHFS, QueryLanguage.SQL));
|
||||||
if (sqlResult != null && sqlResult.size() > 0
|
if ((sqlResult != null) && (sqlResult.size() > 0)
|
||||||
&& sqlResult.get(0)[0] != null) {
|
&& (sqlResult.get(0)[0] != null)) {
|
||||||
return sqlResult.get(0)[0];
|
return sqlResult.get(0)[0];
|
||||||
}
|
}
|
||||||
} catch (VizException e) {
|
} catch (VizException e) {
|
||||||
|
@ -950,7 +950,8 @@ public class TimeSeriesDataManager extends HydroDataManager {
|
||||||
int probability = -1;
|
int probability = -1;
|
||||||
int revision = 1;
|
int revision = 1;
|
||||||
|
|
||||||
if ( dr.getTs().toUpperCase().startsWith("F") || dr.getTs().toUpperCase().startsWith("C") ) {
|
if (dr.getTs().toUpperCase().startsWith("F")
|
||||||
|
|| dr.getTs().toUpperCase().startsWith("C")) {
|
||||||
probability = 0;
|
probability = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1302,18 +1303,18 @@ public class TimeSeriesDataManager extends HydroDataManager {
|
||||||
FcstheightId fhid = new FcstheightId();
|
FcstheightId fhid = new FcstheightId();
|
||||||
fhid.setLid((String) item[i++]);
|
fhid.setLid((String) item[i++]);
|
||||||
fhid.setPe((String) item[i++]);
|
fhid.setPe((String) item[i++]);
|
||||||
Integer in = (Integer) item[i++];
|
Number in = (Number) item[i++];
|
||||||
fhid.setDur(in.shortValue());
|
fhid.setDur(in.shortValue());
|
||||||
fhid.setTs((String) item[i++]);
|
fhid.setTs((String) item[i++]);
|
||||||
fhid.setExtremum((String) item[i++]);
|
fhid.setExtremum((String) item[i++]);
|
||||||
fhid.setProbability((Float) item[i++]);
|
fhid.setProbability(((Number) item[i++]).floatValue());
|
||||||
fhid.setValidtime((Date) item[i++]);
|
fhid.setValidtime((Date) item[i++]);
|
||||||
fhid.setBasistime((Date) item[i++]);
|
fhid.setBasistime((Date) item[i++]);
|
||||||
fh.setId(fhid);
|
fh.setId(fhid);
|
||||||
fh.setValue((Double) item[i++]);
|
fh.setValue((Double) item[i++]);
|
||||||
fh.setShefQualCode((String) item[i++]);
|
fh.setShefQualCode((String) item[i++]);
|
||||||
fh.setQualityCode((Integer) item[i++]);
|
fh.setQualityCode(((Number) item[i++]).intValue());
|
||||||
in = (Integer) item[i++];
|
in = (Number) item[i++];
|
||||||
fh.setRevision(in.shortValue());
|
fh.setRevision(in.shortValue());
|
||||||
fh.setProductId((String) item[i++]);
|
fh.setProductId((String) item[i++]);
|
||||||
fh.setProducttime((Date) item[i++]);
|
fh.setProducttime((Date) item[i++]);
|
||||||
|
|
|
@ -123,6 +123,7 @@ import com.raytheon.viz.hydrocommon.util.StnClassSyncUtil;
|
||||||
* 06 May 2013 1976 mpduff Code cleanup.
|
* 06 May 2013 1976 mpduff Code cleanup.
|
||||||
* 06 Jun 2013 2076 mpduff Fix station list selection and graph button enabling.
|
* 06 Jun 2013 2076 mpduff Fix station list selection and graph button enabling.
|
||||||
* 0 Jun 2013 15980 wkwock Fix selected station not update
|
* 0 Jun 2013 15980 wkwock Fix selected station not update
|
||||||
|
* Jul 21, 2015 4500 rjpeter Use Number in blind cast.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author lvenable
|
* @author lvenable
|
||||||
|
@ -490,7 +491,7 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
|
||||||
*/
|
*/
|
||||||
public final static TimeSeriesDlg getInstance() {
|
public final static TimeSeriesDlg getInstance() {
|
||||||
// Independent shell must be recreated after closing.
|
// Independent shell must be recreated after closing.
|
||||||
if (instance == null || !instance.isOpen()) {
|
if ((instance == null) || !instance.isOpen()) {
|
||||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||||
.getShell();
|
.getShell();
|
||||||
instance = new TimeSeriesDlg(shell);
|
instance = new TimeSeriesDlg(shell);
|
||||||
|
@ -528,12 +529,12 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
|
||||||
|
|
||||||
this.standaloneMode = true;
|
this.standaloneMode = true;
|
||||||
// Ensure That The Group Configuration File Exists.
|
// Ensure That The Group Configuration File Exists.
|
||||||
if (groupConfigFile == null || !groupConfigFile.exists()) {
|
if ((groupConfigFile == null) || !groupConfigFile.exists()) {
|
||||||
// if it does not, check localization for the file
|
// if it does not, check localization for the file
|
||||||
IPathManager pm = PathManagerFactory.getPathManager();
|
IPathManager pm = PathManagerFactory.getPathManager();
|
||||||
groupConfigFile = pm.getStaticFile(HydroConstants.GROUP_DEFINITION);
|
groupConfigFile = pm.getStaticFile(HydroConstants.GROUP_DEFINITION);
|
||||||
|
|
||||||
if (groupConfigFile == null || !groupConfigFile.exists()) {
|
if ((groupConfigFile == null) || !groupConfigFile.exists()) {
|
||||||
String name = HydroConstants.GROUP_DEFINITION;
|
String name = HydroConstants.GROUP_DEFINITION;
|
||||||
if (name.startsWith("/")) {
|
if (name.startsWith("/")) {
|
||||||
name = name.substring(1);
|
name = name.substring(1);
|
||||||
|
@ -1527,7 +1528,7 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
|
||||||
si.setPe((String) row[1]);
|
si.setPe((String) row[1]);
|
||||||
si.setTs((String) row[2]);
|
si.setTs((String) row[2]);
|
||||||
si.setExt((String) row[3]);
|
si.setExt((String) row[3]);
|
||||||
si.setDur((Integer) row[4]);
|
si.setDur(((Number) row[4]).intValue());
|
||||||
|
|
||||||
if (si.getPe().startsWith("H")) {
|
if (si.getPe().startsWith("H")) {
|
||||||
if (!si.getPe().equals(prevPE)) {
|
if (!si.getPe().equals(prevPE)) {
|
||||||
|
@ -1692,8 +1693,9 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
|
||||||
if (values.length > 1) {
|
if (values.length > 1) {
|
||||||
if ((values[0] != null)
|
if ((values[0] != null)
|
||||||
&& values[0].equalsIgnoreCase(NAME)) {
|
&& values[0].equalsIgnoreCase(NAME)) {
|
||||||
if (values[1] != null)
|
if (values[1] != null) {
|
||||||
groupInfo.setGroupName(values[1]);
|
groupInfo.setGroupName(values[1]);
|
||||||
|
}
|
||||||
groupDataList.add(groupInfo.getGroupName());
|
groupDataList.add(groupInfo.getGroupName());
|
||||||
} else if (values[0].equalsIgnoreCase(DESCRIPT)) {
|
} else if (values[0].equalsIgnoreCase(DESCRIPT)) {
|
||||||
groupInfo.setDescription(values[1]);
|
groupInfo.setDescription(values[1]);
|
||||||
|
@ -1788,10 +1790,11 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
|
||||||
} else if (values[0]
|
} else if (values[0]
|
||||||
.equalsIgnoreCase(HydroConstants.PC)) {
|
.equalsIgnoreCase(HydroConstants.PC)) {
|
||||||
td.setPc(values[1]);
|
td.setPc(values[1]);
|
||||||
if (showpp_flag == true)
|
if (showpp_flag == true) {
|
||||||
graphData.setShowpp(true);
|
graphData.setShowpp(true);
|
||||||
else
|
} else {
|
||||||
graphData.setShowpp(false);
|
graphData.setShowpp(false);
|
||||||
|
}
|
||||||
} else if (values[0].equalsIgnoreCase(COLOR)) {
|
} else if (values[0].equalsIgnoreCase(COLOR)) {
|
||||||
td.setColorName(values[1]);
|
td.setColorName(values[1]);
|
||||||
}
|
}
|
||||||
|
@ -1959,9 +1962,9 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] dataString2 = bottomDataList.getSelection();
|
String[] dataString2 = bottomDataList.getSelection();
|
||||||
for (int i = 0; i < dataString2.length; i++) {
|
for (String element : dataString2) {
|
||||||
LIDData tmpLidData = new LIDData();
|
LIDData tmpLidData = new LIDData();
|
||||||
tmpLidData.setData(dataString2[i]);
|
tmpLidData.setData(element);
|
||||||
|
|
||||||
check1 = lidCheck(prevLidData, tmpLidData);
|
check1 = lidCheck(prevLidData, tmpLidData);
|
||||||
check2 = lidCheck(currLidData, tmpLidData);
|
check2 = lidCheck(currLidData, tmpLidData);
|
||||||
|
@ -2182,12 +2185,12 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
|
||||||
|
|
||||||
ArrayList<TraceData> dataList = new ArrayList<TraceData>();
|
ArrayList<TraceData> dataList = new ArrayList<TraceData>();
|
||||||
|
|
||||||
for (int i = 0; i < indices.length; i++) {
|
for (int indice : indices) {
|
||||||
/*
|
/*
|
||||||
* Check the selections and determine if 1 or 2 graphs are
|
* Check the selections and determine if 1 or 2 graphs are
|
||||||
* needed
|
* needed
|
||||||
*/
|
*/
|
||||||
String selection = bottomDataList.getItem(indices[i]);
|
String selection = bottomDataList.getItem(indice);
|
||||||
String[] pieces2 = selection.split("\\s+");
|
String[] pieces2 = selection.split("\\s+");
|
||||||
LIDData lidData = new LIDData();
|
LIDData lidData = new LIDData();
|
||||||
|
|
||||||
|
@ -2301,7 +2304,7 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
|
||||||
GroupInfo groupInfo = groupList.get(groupDataList
|
GroupInfo groupInfo = groupList.get(groupDataList
|
||||||
.getSelectionIndex());
|
.getSelectionIndex());
|
||||||
|
|
||||||
if (prevGroupInfo == null || !prevGroupInfo.equals(groupInfo)) {
|
if ((prevGroupInfo == null) || !prevGroupInfo.equals(groupInfo)) {
|
||||||
int pastHours = groupInfo.getPastHours();
|
int pastHours = groupInfo.getPastHours();
|
||||||
int futureHours = groupInfo.getFutureHours();
|
int futureHours = groupInfo.getFutureHours();
|
||||||
beginCal = Calendar
|
beginCal = Calendar
|
||||||
|
@ -2344,7 +2347,7 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
|
||||||
private boolean validateForm() {
|
private boolean validateForm() {
|
||||||
boolean valid = true;
|
boolean valid = true;
|
||||||
if (modeCbo.getText().equals(STATION_SELECTION)) {
|
if (modeCbo.getText().equals(STATION_SELECTION)) {
|
||||||
if (endCal.getTimeInMillis() - beginCal.getTimeInMillis() < 0) {
|
if ((endCal.getTimeInMillis() - beginCal.getTimeInMillis()) < 0) {
|
||||||
MessageDialog.openWarning(shell, "Invalid Date Selection",
|
MessageDialog.openWarning(shell, "Invalid Date Selection",
|
||||||
"Ending Time is prior to Beginning Time");
|
"Ending Time is prior to Beginning Time");
|
||||||
valid = false;
|
valid = false;
|
||||||
|
@ -2621,7 +2624,7 @@ public class TimeSeriesDlg extends CaveHydroSWTDialog {
|
||||||
public void updateFromDisplayManager() {
|
public void updateFromDisplayManager() {
|
||||||
HydroDisplayManager hdm = HydroDisplayManager.getInstance();
|
HydroDisplayManager hdm = HydroDisplayManager.getInstance();
|
||||||
String newLid = hdm.getCurrentLid();
|
String newLid = hdm.getCurrentLid();
|
||||||
if (newLid!=null && !newLid.equalsIgnoreCase(currentLid)) {
|
if ((newLid != null) && !newLid.equalsIgnoreCase(currentLid)) {
|
||||||
updateAndOpen(newLid, this.displayGraph);
|
updateAndOpen(newLid, this.displayGraph);
|
||||||
openGraph();
|
openGraph();
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ import com.raytheon.viz.hydrocommon.whfslib.IHFSDbGenerated;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Mar 31, 2009 mpduff Initial creation.
|
* Mar 31, 2009 mpduff Initial creation.
|
||||||
* Nov 06, 2009 2639 mpduff Added getRiverStat method.
|
* Nov 06, 2009 2639 mpduff Added getRiverStat method.
|
||||||
*
|
* Jul 21, 2015 4500 rjpeter Use Number in blind cast.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author mpduff
|
* @author mpduff
|
||||||
|
@ -66,7 +66,8 @@ public class HydroData {
|
||||||
* @return list of Rpfparams data
|
* @return list of Rpfparams data
|
||||||
* @throws VizException
|
* @throws VizException
|
||||||
*/
|
*/
|
||||||
public static List<Rpfparams> getRpfParams(String where) throws VizException {
|
public static List<Rpfparams> getRpfParams(String where)
|
||||||
|
throws VizException {
|
||||||
ArrayList<Rpfparams> returnList = new ArrayList<Rpfparams>();
|
ArrayList<Rpfparams> returnList = new ArrayList<Rpfparams>();
|
||||||
String query = null;
|
String query = null;
|
||||||
if ((where == null) || (where.length() == 0)) {
|
if ((where == null) || (where.length() == 0)) {
|
||||||
|
@ -79,7 +80,8 @@ public class HydroData {
|
||||||
.getName() + " " + where;
|
.getName() + " " + where;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Object[]> results = DirectDbQuery.executeQuery(query, HydroConstants.IHFS, QueryLanguage.HQL);
|
List<Object[]> results = DirectDbQuery.executeQuery(query,
|
||||||
|
HydroConstants.IHFS, QueryLanguage.HQL);
|
||||||
|
|
||||||
for (Object[] item : results) {
|
for (Object[] item : results) {
|
||||||
returnList.add((Rpfparams) item[0]);
|
returnList.add((Rpfparams) item[0]);
|
||||||
|
@ -88,9 +90,10 @@ public class HydroData {
|
||||||
return returnList;
|
return returnList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ArrayList<Forecast> bldTsFcstRiv(String lid, String pe, String tsFilter,
|
public static ArrayList<Forecast> bldTsFcstRiv(String lid, String pe,
|
||||||
boolean useLatest, Date basisTime) {
|
String tsFilter, boolean useLatest, Date basisTime) {
|
||||||
String useTs = null;;
|
String useTs = null;
|
||||||
|
;
|
||||||
ArrayList<Forecast> fcstList = null;
|
ArrayList<Forecast> fcstList = null;
|
||||||
String where = null;
|
String where = null;
|
||||||
String qcwhere = null;
|
String qcwhere = null;
|
||||||
|
@ -101,11 +104,12 @@ public class HydroData {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
/* define which typesource code to use, whether it is passed in
|
/*
|
||||||
whether it is determined by the ingestfilter ranks */
|
* define which typesource code to use, whether it is passed in
|
||||||
|
* whether it is determined by the ingestfilter ranks
|
||||||
|
*/
|
||||||
|
|
||||||
if ((tsFilter == null) || (tsFilter.length() == 0))
|
if ((tsFilter == null) || (tsFilter.length() == 0)) {
|
||||||
{
|
|
||||||
ordinal = 0;
|
ordinal = 0;
|
||||||
useTs = getBestTs(lid, pe, "F%", ordinal);
|
useTs = getBestTs(lid, pe, "F%", ordinal);
|
||||||
} else {
|
} else {
|
||||||
|
@ -113,8 +117,8 @@ public class HydroData {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* define the qc filter to apply */
|
/* define the qc filter to apply */
|
||||||
qcwhere = QualityCodeUtil.buildQcWhere(QualityCodeUtil.QC_NOT_FAILED);
|
qcwhere = QualityCodeUtil
|
||||||
|
.buildQcWhere(QualityCodeUtil.QC_NOT_FAILED);
|
||||||
|
|
||||||
/* set the tablename to use */
|
/* set the tablename to use */
|
||||||
tablename = DbUtils.getTableName(pe, useTs);
|
tablename = DbUtils.getTableName(pe, useTs);
|
||||||
|
@ -128,42 +132,43 @@ public class HydroData {
|
||||||
/* convert the local current time to ansi time in GMT format */
|
/* convert the local current time to ansi time in GMT format */
|
||||||
String currentTime = HydroConstants.DATE_FORMAT.format(now);
|
String currentTime = HydroConstants.DATE_FORMAT.format(now);
|
||||||
|
|
||||||
/* retrieve a list of unique basis times; use descending sort.
|
/*
|
||||||
only consider forecast data before some ending time,
|
* retrieve a list of unique basis times; use descending sort. only
|
||||||
and with some limited basis time ago */
|
* consider forecast data before some ending time, and with some
|
||||||
where = "WHERE lid = '" + lid + "' and pe ='" + pe + "' " +
|
* limited basis time ago
|
||||||
"and ts = '" + useTs + "' and probability < 0.0 and " +
|
*/
|
||||||
"validtime >= '" + currentTime + "' and " +
|
where = "WHERE lid = '" + lid + "' and pe ='" + pe + "' "
|
||||||
"basistime >= '" + basisTimeStr + "' and " +
|
+ "and ts = '" + useTs + "' and probability < 0.0 and "
|
||||||
"value != " + HydroConstants.MISSING_VALUE +
|
+ "validtime >= '" + currentTime + "' and "
|
||||||
" and " + qcwhere + " ORDER BY basistime DESC ";
|
+ "basistime >= '" + basisTimeStr + "' and " + "value != "
|
||||||
|
+ HydroConstants.MISSING_VALUE + " and " + qcwhere
|
||||||
|
+ " ORDER BY basistime DESC ";
|
||||||
|
|
||||||
ArrayList<String[]> uniqueResults = loadUnique("basistime", tablename, where);
|
ArrayList<String[]> uniqueResults = loadUnique("basistime",
|
||||||
|
tablename, where);
|
||||||
|
|
||||||
if (uniqueResults.size() <= 0) {
|
if (uniqueResults.size() <= 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* retrieve the data; the ordering by validtime is important.
|
/*
|
||||||
as before, limit the forecast time valid time window
|
* retrieve the data; the ordering by validtime is important. as
|
||||||
and as needed, the age of the forecast (basistime). */
|
* before, limit the forecast time valid time window and as needed,
|
||||||
|
* the age of the forecast (basistime).
|
||||||
|
*/
|
||||||
if (useLatest || (uniqueResults.size() == 1)) {
|
if (useLatest || (uniqueResults.size() == 1)) {
|
||||||
where = String.format(" WHERE lid = '%s' AND pe = '%s' AND " +
|
where = String.format(" WHERE lid = '%s' AND pe = '%s' AND "
|
||||||
" ts = '%s' AND " +
|
+ " ts = '%s' AND " + " probability < 0.0 AND "
|
||||||
" probability < 0.0 AND " +
|
+ " validtime >= '%s' AND basistime = '%s' AND "
|
||||||
" validtime >= '%s' AND basistime = '%s' AND " +
|
+ " value != %d AND %s " + " ORDER BY validtime ASC",
|
||||||
" value != %d AND %s " +
|
|
||||||
" ORDER BY validtime ASC",
|
|
||||||
lid, pe, useTs, currentTime, uniqueResults.get(0)[0],
|
lid, pe, useTs, currentTime, uniqueResults.get(0)[0],
|
||||||
HydroConstants.MISSING_VALUE, qcwhere);
|
HydroConstants.MISSING_VALUE, qcwhere);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
where = String.format(" WHERE lid = '%s' AND pe = '%s' AND " +
|
where = String.format(" WHERE lid = '%s' AND pe = '%s' AND "
|
||||||
" ts = '%s' AND " +
|
+ " ts = '%s' AND " + " probability < 0.0 AND "
|
||||||
" probability < 0.0 AND " +
|
+ " validtime >= '%s' AND basistime >= '%s' AND "
|
||||||
" validtime >= '%s' AND basistime >= '%s' AND " +
|
+ " value != %d AND %s" + " ORDER BY validtime ASC",
|
||||||
" value != %d AND %s" +
|
|
||||||
" ORDER BY validtime ASC",
|
|
||||||
lid, pe, useTs, currentTime, basisTimeStr,
|
lid, pe, useTs, currentTime, basisTimeStr,
|
||||||
HydroConstants.MISSING_VALUE, qcwhere);
|
HydroConstants.MISSING_VALUE, qcwhere);
|
||||||
}
|
}
|
||||||
|
@ -171,10 +176,9 @@ public class HydroData {
|
||||||
fcstList = getForecast(where, tablename);
|
fcstList = getForecast(where, tablename);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* if only getting the latest basis time's data
|
* if only getting the latest basis time's data or only one basis
|
||||||
* or only one basis time was found, then consider all;
|
* time was found, then consider all; otherwise, need to adjoin/butt
|
||||||
* otherwise, need to adjoin/butt the time series together
|
* the time series together for the multiple basis times.
|
||||||
* for the multiple basis times.
|
|
||||||
*/
|
*/
|
||||||
doKeep = new boolean[fcstList.size()];
|
doKeep = new boolean[fcstList.size()];
|
||||||
if (useLatest || (uniqueResults.size() <= 1)) {
|
if (useLatest || (uniqueResults.size() <= 1)) {
|
||||||
|
@ -185,9 +189,11 @@ public class HydroData {
|
||||||
setFcstKeep(uniqueResults, fcstList, doKeep);
|
setFcstKeep(uniqueResults, fcstList, doKeep);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now load the values and info to return, knowing which items
|
/*
|
||||||
to keep since all the values have been tagged. first get
|
* now load the values and info to return, knowing which items to
|
||||||
the count of the number of values to keep and allocate the data */
|
* keep since all the values have been tagged. first get the count
|
||||||
|
* of the number of values to keep and allocate the data
|
||||||
|
*/
|
||||||
for (int i = 0; i < fcstList.size(); i++) {
|
for (int i = 0; i < fcstList.size(); i++) {
|
||||||
if (doKeep[i]) {
|
if (doKeep[i]) {
|
||||||
keepCnt++;
|
keepCnt++;
|
||||||
|
@ -208,32 +214,29 @@ public class HydroData {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* For a given location and pe code and type-source prefix, this function
|
||||||
For a given location and pe code and type-source prefix, this function
|
* returns the type-source code with the lowest rank in IngestFilter.
|
||||||
returns the type-source code with the lowest rank in IngestFilter.
|
* Alternatively, if a specific ordinal number is passed, then the Nth
|
||||||
Alternatively, if a specific ordinal number is passed, then the
|
* ranking ts is returned. If no (<= 0) ordinal number (i.e. 1st, 2nd) is
|
||||||
Nth ranking ts is returned. If no (<= 0) ordinal number (i.e. 1st, 2nd)
|
* requested, then the highest rank (1st) is returned. The type-source
|
||||||
is requested, then the highest rank (1st) is returned.
|
* prefix is normally given as a one-character string, R for observed data
|
||||||
The type-source prefix is normally given as a one-character string,
|
* and F for forecast data.
|
||||||
R for observed data and F for forecast data.
|
*
|
||||||
|
* The function argument returns a status variable indicating whether the
|
||||||
The function argument returns a status variable indicating
|
* request was satisfied.
|
||||||
whether the request was satisfied.
|
|
||||||
|
|
||||||
**************************************************************/
|
**************************************************************/
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For a given location and pe code and type-source prefix, this function
|
* For a given location and pe code and type-source prefix, this function
|
||||||
* returns the type-source code with the lowest rank in IngestFilter.
|
* returns the type-source code with the lowest rank in IngestFilter.
|
||||||
* Alternatively, if a specific ordinal number is passed, then the
|
* Alternatively, if a specific ordinal number is passed, then the Nth
|
||||||
* Nth ranking ts is returned. If no (<= 0) ordinal number (i.e. 1st, 2nd)
|
* ranking ts is returned. If no (<= 0) ordinal number (i.e. 1st, 2nd) is
|
||||||
* is requested, then the highest rank (1st) is returned.
|
* requested, then the highest rank (1st) is returned. The type-source
|
||||||
* The type-source prefix is normally given as a one-character string,
|
* prefix is normally given as a one-character string, R for observed data
|
||||||
* R for observed data and F for forecast data.
|
* and F for forecast data.
|
||||||
*
|
*
|
||||||
* @param lid
|
* @param lid
|
||||||
* The location id
|
* The location id
|
||||||
|
@ -252,20 +255,24 @@ public class HydroData {
|
||||||
List<Ingestfilter> ingestFilterList = null;
|
List<Ingestfilter> ingestFilterList = null;
|
||||||
Ingestfilter ingestPtr;
|
Ingestfilter ingestPtr;
|
||||||
|
|
||||||
/* get the ingest filter entries for this location. note that the
|
/*
|
||||||
retrieval is ordered so that if multiple best ranks exist, there
|
* get the ingest filter entries for this location. note that the
|
||||||
is some predicatibility for the identified best one. also note that
|
* retrieval is ordered so that if multiple best ranks exist, there is
|
||||||
this approach ignores the duration, extremum, and probabilty code. */
|
* some predicatibility for the identified best one. also note that this
|
||||||
|
* approach ignores the duration, extremum, and probabilty code.
|
||||||
|
*/
|
||||||
|
|
||||||
where = String.format(" WHERE lid = '%s' AND pe = '%s' AND " +
|
where = String.format(" WHERE lid = '%s' AND pe = '%s' AND "
|
||||||
" ts LIKE '%s%%' AND ingest = 'T' ORDER BY ts_rank, ts",
|
+ " ts LIKE '%s%%' AND ingest = 'T' ORDER BY ts_rank, ts", lid,
|
||||||
lid, pe, tsPrefix);
|
pe, tsPrefix);
|
||||||
|
|
||||||
ingestFilterList = IHFSDbGenerated.GetIngestFilter(where);
|
ingestFilterList = IHFSDbGenerated.GetIngestFilter(where);
|
||||||
|
|
||||||
if ((ingestFilterList != null) && (ingestFilterList.size() > 0)) {
|
if ((ingestFilterList != null) && (ingestFilterList.size() > 0)) {
|
||||||
/* if no specific ordinal number was requested, return with
|
/*
|
||||||
the highest rank. */
|
* if no specific ordinal number was requested, return with the
|
||||||
|
* highest rank.
|
||||||
|
*/
|
||||||
|
|
||||||
if (ordinal <= 0) {
|
if (ordinal <= 0) {
|
||||||
tsFound = ingestFilterList.get(0).getId().getTs();
|
tsFound = ingestFilterList.get(0).getId().getTs();
|
||||||
|
@ -274,9 +281,11 @@ public class HydroData {
|
||||||
} else { /* if a specific ordinal number was requested. */
|
} else { /* if a specific ordinal number was requested. */
|
||||||
/* if a specific ordinal number was requested. */
|
/* if a specific ordinal number was requested. */
|
||||||
|
|
||||||
/* get a count of the number of matching ts entries.
|
/*
|
||||||
if the requested ordinal number is greater than
|
* get a count of the number of matching ts entries. if the
|
||||||
the number available then return with a not found status. */
|
* requested ordinal number is greater than the number available
|
||||||
|
* then return with a not found status.
|
||||||
|
*/
|
||||||
|
|
||||||
if (ordinal <= ingestFilterList.size()) {
|
if (ordinal <= ingestFilterList.size()) {
|
||||||
ingestPtr = ingestFilterList.get(ordinal);
|
ingestPtr = ingestFilterList.get(ordinal);
|
||||||
|
@ -287,7 +296,8 @@ public class HydroData {
|
||||||
return tsFound;
|
return tsFound;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ArrayList<String[]> loadUnique(String field, String table, String where) throws VizException {
|
public static ArrayList<String[]> loadUnique(String field, String table,
|
||||||
|
String where) throws VizException {
|
||||||
ArrayList<String[]> returnList = new ArrayList<String[]>();
|
ArrayList<String[]> returnList = new ArrayList<String[]>();
|
||||||
StringBuilder sql = new StringBuilder("SELECT DISTINCT ");
|
StringBuilder sql = new StringBuilder("SELECT DISTINCT ");
|
||||||
|
|
||||||
|
@ -304,16 +314,18 @@ public class HydroData {
|
||||||
|
|
||||||
sql.append(" from " + table + " " + where);
|
sql.append(" from " + table + " " + where);
|
||||||
|
|
||||||
List<Object[]> results = DirectDbQuery.executeQuery(sql.toString(), HydroConstants.IHFS, QueryLanguage.SQL);
|
List<Object[]> results = DirectDbQuery.executeQuery(sql.toString(),
|
||||||
|
HydroConstants.IHFS, QueryLanguage.SQL);
|
||||||
|
|
||||||
for (int i = 0; i < results.size(); i++) {
|
for (int i = 0; i < results.size(); i++) {
|
||||||
Object[] oa = results.get(i);
|
Object[] oa = results.get(i);
|
||||||
ArrayList<String> al = new ArrayList<String>();
|
ArrayList<String> al = new ArrayList<String>();
|
||||||
for (Object o : oa) {
|
for (Object o : oa) {
|
||||||
if (o instanceof java.sql.Timestamp) {
|
if (o instanceof java.sql.Timestamp) {
|
||||||
al.add(HydroConstants.DATE_FORMAT.format((java.sql.Timestamp) o));
|
al.add(HydroConstants.DATE_FORMAT
|
||||||
} else if (o instanceof Integer){
|
.format((java.sql.Timestamp) o));
|
||||||
al.add(((Integer) o).toString());
|
} else if (o instanceof Number) {
|
||||||
|
al.add(((Number) o).toString());
|
||||||
} else {
|
} else {
|
||||||
al.add((String) o);
|
al.add((String) o);
|
||||||
}
|
}
|
||||||
|
@ -324,7 +336,8 @@ public class HydroData {
|
||||||
return returnList;
|
return returnList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ArrayList<Forecast> getForecast(String where, String tablename) throws VizException {
|
public static ArrayList<Forecast> getForecast(String where, String tablename)
|
||||||
|
throws VizException {
|
||||||
List<Forecast> fcstList = new ArrayList<Forecast>();
|
List<Forecast> fcstList = new ArrayList<Forecast>();
|
||||||
List<Object[]> result = null;
|
List<Object[]> result = null;
|
||||||
|
|
||||||
|
@ -333,7 +346,8 @@ public class HydroData {
|
||||||
+ com.raytheon.uf.common.dataplugin.shef.tables.Fcstheight.class
|
+ com.raytheon.uf.common.dataplugin.shef.tables.Fcstheight.class
|
||||||
.getName() + " " + where;
|
.getName() + " " + where;
|
||||||
|
|
||||||
result = DirectDbQuery.executeQuery(query, HydroConstants.IHFS, QueryLanguage.HQL);
|
result = DirectDbQuery.executeQuery(query, HydroConstants.IHFS,
|
||||||
|
QueryLanguage.HQL);
|
||||||
|
|
||||||
/* Convert to Forecast object */
|
/* Convert to Forecast object */
|
||||||
for (Object[] item : result) {
|
for (Object[] item : result) {
|
||||||
|
@ -358,13 +372,12 @@ public class HydroData {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return (ArrayList<Forecast>) fcstList;
|
return (ArrayList<Forecast>) fcstList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine which items in the forecast time series to keep,
|
* Determine which items in the forecast time series to keep, as there may
|
||||||
* as there may be overlap due to multiple time_series.
|
* be overlap due to multiple time_series.
|
||||||
*
|
*
|
||||||
* @param uniqueResults
|
* @param uniqueResults
|
||||||
* List of results from the unique query
|
* List of results from the unique query
|
||||||
|
@ -374,9 +387,12 @@ public class HydroData {
|
||||||
* Array of boolean flags on which to keep
|
* Array of boolean flags on which to keep
|
||||||
* @return array of flags determining which time series to keep
|
* @return array of flags determining which time series to keep
|
||||||
*/
|
*/
|
||||||
private static boolean[] setFcstKeep(ArrayList<String[]> uniqueResults, ArrayList<Forecast> fcstList, boolean[] doKeep) {
|
private static boolean[] setFcstKeep(ArrayList<String[]> uniqueResults,
|
||||||
/* get counts of linked lists, one for the forecast values themselves
|
ArrayList<Forecast> fcstList, boolean[] doKeep) {
|
||||||
and one for the number of unique basis times */
|
/*
|
||||||
|
* get counts of linked lists, one for the forecast values themselves
|
||||||
|
* and one for the number of unique basis times
|
||||||
|
*/
|
||||||
boolean[] tsFirstChk = new boolean[uniqueResults.size()];
|
boolean[] tsFirstChk = new boolean[uniqueResults.size()];
|
||||||
int[] basisIndex = new int[fcstList.size()];
|
int[] basisIndex = new int[fcstList.size()];
|
||||||
Date[] tsStartTime = new Date[fcstList.size()];
|
Date[] tsStartTime = new Date[fcstList.size()];
|
||||||
|
@ -402,13 +418,15 @@ public class HydroData {
|
||||||
tsBasisTime[i] = now;
|
tsBasisTime[i] = now;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
/* now loop thru the retrieved time series data values and get the
|
* now loop thru the retrieved time series data values and get the start
|
||||||
start and end times for each of the basis times found. */
|
* and end times for each of the basis times found.
|
||||||
|
*/
|
||||||
for (int i = 0; i < fcstList.size(); i++) {
|
for (int i = 0; i < fcstList.size(); i++) {
|
||||||
/* find out which basis time's time series this value belongs to */
|
/* find out which basis time's time series this value belongs to */
|
||||||
basisIndex[i] = HydroConstants.MISSING_VALUE;
|
basisIndex[i] = HydroConstants.MISSING_VALUE;
|
||||||
basisTimeStr = HydroConstants.DATE_FORMAT.format(fcstList.get(i).getBasistime());
|
basisTimeStr = HydroConstants.DATE_FORMAT.format(fcstList.get(i)
|
||||||
|
.getBasistime());
|
||||||
|
|
||||||
for (int j = 0; ((j < uniqueResults.size()) && (basisIndex[i] == HydroConstants.MISSING_VALUE)); j++) {
|
for (int j = 0; ((j < uniqueResults.size()) && (basisIndex[i] == HydroConstants.MISSING_VALUE)); j++) {
|
||||||
if (uniqueResults.get(j)[0].equalsIgnoreCase(basisTimeStr)) {
|
if (uniqueResults.get(j)[0].equalsIgnoreCase(basisTimeStr)) {
|
||||||
|
@ -418,11 +436,14 @@ public class HydroData {
|
||||||
|
|
||||||
if (basisIndex[i] == HydroConstants.MISSING_VALUE) {
|
if (basisIndex[i] == HydroConstants.MISSING_VALUE) {
|
||||||
// TODO error log this message:
|
// TODO error log this message:
|
||||||
// fprintf(stderr, "Unexpected error assigning basis_index for %d\n", i);
|
// fprintf(stderr,
|
||||||
|
// "Unexpected error assigning basis_index for %d\n", i);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check if the values constitute the start or end times
|
/*
|
||||||
for the time series and record these times if they do */
|
* check if the values constitute the start or end times for the
|
||||||
|
* time series and record these times if they do
|
||||||
|
*/
|
||||||
Date validTime = fcstList.get(i).getValidtime();
|
Date validTime = fcstList.get(i).getValidtime();
|
||||||
if (tsFirstChk[basisIndex[i]]) {
|
if (tsFirstChk[basisIndex[i]]) {
|
||||||
if (validTime.before(tsStartTime[basisIndex[i]])) {
|
if (validTime.before(tsStartTime[basisIndex[i]])) {
|
||||||
|
@ -437,9 +458,10 @@ public class HydroData {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* for each of the unique basis times, assign the basis time
|
/*
|
||||||
in a convenient array for use in the adjust_startend
|
* for each of the unique basis times, assign the basis time in a
|
||||||
function. */
|
* convenient array for use in the adjust_startend function.
|
||||||
|
*/
|
||||||
for (int j = 0; j < uniqueResults.size(); j++) {
|
for (int j = 0; j < uniqueResults.size(); j++) {
|
||||||
String bTimeStr = uniqueResults.get(j)[0];
|
String bTimeStr = uniqueResults.get(j)[0];
|
||||||
Date bTime;
|
Date bTime;
|
||||||
|
@ -452,25 +474,26 @@ public class HydroData {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* knowing the actual start and end times for the multiple
|
/*
|
||||||
time series, loop thru the time series and adjust the start
|
* knowing the actual start and end times for the multiple time series,
|
||||||
and end times so that they reflect the time span to use;
|
* loop thru the time series and adjust the start and end times so that
|
||||||
i.e. there is no overlap. THIS IS THE KEY STEP IN THE
|
* they reflect the time span to use; i.e. there is no overlap. THIS IS
|
||||||
PROCESS OF DEFINING AN AGGREGATE VIRTUAL TIME SERIES!!! */
|
* THE KEY STEP IN THE PROCESS OF DEFINING AN AGGREGATE VIRTUAL TIME
|
||||||
adjustStartEnd(uniqueResults.size(), tsBasisTime, tsStartTime, tsEndTime);
|
* SERIES!!!
|
||||||
|
*/
|
||||||
|
adjustStartEnd(uniqueResults.size(), tsBasisTime, tsStartTime,
|
||||||
|
tsEndTime);
|
||||||
|
|
||||||
return doKeep;
|
return doKeep;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method uses the time series with the latest basis time first,
|
* This method uses the time series with the latest basis time first, and
|
||||||
* and uses it in its entirety. Then the time series with the next
|
* uses it in its entirety. Then the time series with the next latest basis
|
||||||
* latest basis time is used. If it overlaps portions of the already
|
* time is used. If it overlaps portions of the already saved time series,
|
||||||
* saved time series, then only that portion which doesn't
|
* then only that portion which doesn't overlap is used. This process
|
||||||
* overlap is used. This process continues until all time series
|
* continues until all time series have been considered. In essences, this
|
||||||
* have been considered. In essences, this method adjoins adjacent
|
* method adjoins adjacent time series.
|
||||||
* time series.
|
|
||||||
*
|
*
|
||||||
* @param basisTime
|
* @param basisTime
|
||||||
* Date[] of basis times
|
* Date[] of basis times
|
||||||
|
@ -479,32 +502,37 @@ public class HydroData {
|
||||||
* @param endValidTime
|
* @param endValidTime
|
||||||
* Date[] of ending valid times
|
* Date[] of ending valid times
|
||||||
*/
|
*/
|
||||||
private static void adjustStartEnd(int ulCount, Date[] basisTime, Date[] startValidTime, Date[] endValidTime) {
|
private static void adjustStartEnd(int ulCount, Date[] basisTime,
|
||||||
|
Date[] startValidTime, Date[] endValidTime) {
|
||||||
int[] basisOrder = new int[ulCount];
|
int[] basisOrder = new int[ulCount];
|
||||||
Date tmpTime = Calendar.getInstance(TimeZone.getTimeZone("GMT")).getTime();
|
Date tmpTime = Calendar.getInstance(TimeZone.getTimeZone("GMT"))
|
||||||
|
.getTime();
|
||||||
int curIndex = 0;
|
int curIndex = 0;
|
||||||
Date fullStartValidTime;
|
Date fullStartValidTime;
|
||||||
Date fullEndValidTime;
|
Date fullEndValidTime;
|
||||||
|
|
||||||
/* initialize array to keep track of order
|
/*
|
||||||
of the basis time series' */
|
* initialize array to keep track of order of the basis time series'
|
||||||
|
*/
|
||||||
for (int i = 0; i < ulCount; i++) {
|
for (int i = 0; i < ulCount; i++) {
|
||||||
basisOrder[i] = -1;
|
basisOrder[i] = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* find the order of the time series by their latest basis time.
|
* find the order of the time series by their latest basis time. if two
|
||||||
* if two time series have the same basis time, use the one that
|
* time series have the same basis time, use the one that has the
|
||||||
* has the earlier starting time. note that the order is such
|
* earlier starting time. note that the order is such that the latest
|
||||||
* that the latest basis time is last in the resulting order array.
|
* basis time is last in the resulting order array.
|
||||||
*/
|
*/
|
||||||
for (int i = 0; i < ulCount; i++) {
|
for (int i = 0; i < ulCount; i++) {
|
||||||
curIndex = 0;
|
curIndex = 0;
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
|
|
||||||
for (int j = 0; j < ulCount; j++) {
|
for (int j = 0; j < ulCount; j++) {
|
||||||
/* only consider the time series if it hasn't been accounted
|
/*
|
||||||
for in the order array */
|
* only consider the time series if it hasn't been accounted for
|
||||||
|
* in the order array
|
||||||
|
*/
|
||||||
found = false;
|
found = false;
|
||||||
for (int k = 0; k < i; k++) {
|
for (int k = 0; k < i; k++) {
|
||||||
if (j == basisOrder[k]) {
|
if (j == basisOrder[k]) {
|
||||||
|
@ -527,11 +555,12 @@ public class HydroData {
|
||||||
basisOrder[i] = curIndex;
|
basisOrder[i] = curIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* do NOT adjust the start and end time of the time series
|
/*
|
||||||
with the latest ending time. loop through all the other
|
* do NOT adjust the start and end time of the time series with the
|
||||||
time series and adjust their start and end times as necessary
|
* latest ending time. loop through all the other time series and adjust
|
||||||
so that they do not overlap the time limits of the
|
* their start and end times as necessary so that they do not overlap
|
||||||
being-built aggregate time series. */
|
* the time limits of the being-built aggregate time series.
|
||||||
|
*/
|
||||||
curIndex = basisOrder[0];
|
curIndex = basisOrder[0];
|
||||||
|
|
||||||
fullStartValidTime = startValidTime[curIndex];
|
fullStartValidTime = startValidTime[curIndex];
|
||||||
|
@ -539,43 +568,56 @@ public class HydroData {
|
||||||
|
|
||||||
for (int i = 1; i < ulCount; i++) {
|
for (int i = 1; i < ulCount; i++) {
|
||||||
curIndex = basisOrder[i];
|
curIndex = basisOrder[i];
|
||||||
/* each additional time series being considered is checked to
|
/*
|
||||||
see if it falls outside the time window already encompassed
|
* each additional time series being considered is checked to see if
|
||||||
by the assembled time series. there are four cases that can
|
* it falls outside the time window already encompassed by the
|
||||||
occur; each is handled below. */
|
* assembled time series. there are four cases that can occur; each
|
||||||
|
* is handled below.
|
||||||
|
*/
|
||||||
|
|
||||||
/* if the basis time series being considered is fully within the
|
/*
|
||||||
time of the already existing time series, then
|
* if the basis time series being considered is fully within the
|
||||||
ignore it completely, and reset its times. */
|
* time of the already existing time series, then ignore it
|
||||||
|
* completely, and reset its times.
|
||||||
|
*/
|
||||||
|
|
||||||
if (startValidTime[curIndex].after(fullStartValidTime) && endValidTime[curIndex].before(fullEndValidTime)) {
|
if (startValidTime[curIndex].after(fullStartValidTime)
|
||||||
|
&& endValidTime[curIndex].before(fullEndValidTime)) {
|
||||||
startValidTime[curIndex].setTime(0);
|
startValidTime[curIndex].setTime(0);
|
||||||
endValidTime[curIndex].setTime(0);
|
endValidTime[curIndex].setTime(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (startValidTime[curIndex].before(fullStartValidTime)
|
||||||
else if (startValidTime[curIndex].before(fullStartValidTime) && endValidTime[curIndex].after(fullEndValidTime)) {
|
&& endValidTime[curIndex].after(fullEndValidTime)) {
|
||||||
/* if the basis time series being considered covers time both before
|
/*
|
||||||
and after the existing time series, use the portion of it
|
* if the basis time series being considered covers time both
|
||||||
that is before the time series. it is not desirable to use
|
* before and after the existing time series, use the portion of
|
||||||
both the before and after portion (this results in a
|
* it that is before the time series. it is not desirable to use
|
||||||
non-contiguous time-series that is weird), and given a choice
|
* both the before and after portion (this results in a
|
||||||
it is better to use the forecast data early on than the
|
* non-contiguous time-series that is weird), and given a choice
|
||||||
later forecast data, so use the before portion */
|
* it is better to use the forecast data early on than the later
|
||||||
|
* forecast data, so use the before portion
|
||||||
|
*/
|
||||||
fullStartValidTime.setTime(fullStartValidTime.getTime() - 1000);
|
fullStartValidTime.setTime(fullStartValidTime.getTime() - 1000);
|
||||||
endValidTime[curIndex] = fullStartValidTime;
|
endValidTime[curIndex] = fullStartValidTime;
|
||||||
fullStartValidTime = startValidTime[curIndex];
|
fullStartValidTime = startValidTime[curIndex];
|
||||||
} else if (startValidTime[curIndex].before(fullStartValidTime) && endValidTime[curIndex].before(fullEndValidTime)) {
|
} else if (startValidTime[curIndex].before(fullStartValidTime)
|
||||||
/* if the basis time series being considered straddles the beginning
|
&& endValidTime[curIndex].before(fullEndValidTime)) {
|
||||||
or is completely before the existing time series, then use the
|
/*
|
||||||
portion of it that is before the time series. */
|
* if the basis time series being considered straddles the
|
||||||
|
* beginning or is completely before the existing time series,
|
||||||
|
* then use the portion of it that is before the time series.
|
||||||
|
*/
|
||||||
fullStartValidTime.setTime(fullStartValidTime.getTime() - 1000);
|
fullStartValidTime.setTime(fullStartValidTime.getTime() - 1000);
|
||||||
endValidTime[curIndex] = fullStartValidTime;
|
endValidTime[curIndex] = fullStartValidTime;
|
||||||
fullStartValidTime = startValidTime[curIndex];
|
fullStartValidTime = startValidTime[curIndex];
|
||||||
} else if (startValidTime[curIndex].after(fullStartValidTime) && endValidTime[curIndex].after(fullEndValidTime)) {
|
} else if (startValidTime[curIndex].after(fullStartValidTime)
|
||||||
/* if the basis time series being considered straddles the end
|
&& endValidTime[curIndex].after(fullEndValidTime)) {
|
||||||
or is completely after the existing time series, then use the
|
/*
|
||||||
portion of it that is after the time series. */
|
* if the basis time series being considered straddles the end
|
||||||
|
* or is completely after the existing time series, then use the
|
||||||
|
* portion of it that is after the time series.
|
||||||
|
*/
|
||||||
fullEndValidTime.setTime(fullEndValidTime.getTime() - 1000);
|
fullEndValidTime.setTime(fullEndValidTime.getTime() - 1000);
|
||||||
startValidTime[curIndex] = fullEndValidTime;
|
startValidTime[curIndex] = fullEndValidTime;
|
||||||
fullEndValidTime = endValidTime[curIndex];
|
fullEndValidTime = endValidTime[curIndex];
|
||||||
|
@ -584,8 +626,8 @@ public class HydroData {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the max fcst info into the RiverStatus table for the
|
* Loads the max fcst info into the RiverStatus table for the current
|
||||||
* current location and pe.
|
* location and pe.
|
||||||
*
|
*
|
||||||
* @param record
|
* @param record
|
||||||
* Forecast record to load
|
* Forecast record to load
|
||||||
|
@ -594,9 +636,11 @@ public class HydroData {
|
||||||
Riverstatus rstatus = new Riverstatus();
|
Riverstatus rstatus = new Riverstatus();
|
||||||
RiverstatusId rsid = new RiverstatusId();
|
RiverstatusId rsid = new RiverstatusId();
|
||||||
|
|
||||||
/* update the value in the RiverStatus table. if no record
|
/*
|
||||||
currently in the table, then insert/put a new record.
|
* update the value in the RiverStatus table. if no record currently in
|
||||||
first build the record to update/insert */
|
* the table, then insert/put a new record. first build the record to
|
||||||
|
* update/insert
|
||||||
|
*/
|
||||||
rsid.setLid(record.getLid());
|
rsid.setLid(record.getLid());
|
||||||
rsid.setPe(record.getPe());
|
rsid.setPe(record.getPe());
|
||||||
rsid.setTs(record.getTs());
|
rsid.setTs(record.getTs());
|
||||||
|
@ -611,11 +655,13 @@ public class HydroData {
|
||||||
DirectDbQuery.saveOrUpdate(rstatus, HydroConstants.IHFS);
|
DirectDbQuery.saveOrUpdate(rstatus, HydroConstants.IHFS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void deleteRiverStatus(String lid, String pe, String ts) throws VizException {
|
public static void deleteRiverStatus(String lid, String pe, String ts)
|
||||||
String where = String.format(" WHERE lid='%s' AND pe='%s' AND ts='%s' ",
|
throws VizException {
|
||||||
lid, pe, ts);
|
String where = String.format(
|
||||||
|
" WHERE lid='%s' AND pe='%s' AND ts='%s' ", lid, pe, ts);
|
||||||
String query = "delete from RiverStatus " + where;
|
String query = "delete from RiverStatus " + where;
|
||||||
|
|
||||||
DirectDbQuery.executeStatement(query, HydroConstants.IHFS, QueryLanguage.SQL);
|
DirectDbQuery.executeStatement(query, HydroConstants.IHFS,
|
||||||
|
QueryLanguage.SQL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,7 @@ import com.raytheon.viz.hydrocommon.IGetSortType;
|
||||||
* 16Oct2008 1636 askripsky Initial Creation
|
* 16Oct2008 1636 askripsky Initial Creation
|
||||||
* Oct 27, 2011 11267 lbousaidi change showNoPost initial value to false
|
* Oct 27, 2011 11267 lbousaidi change showNoPost initial value to false
|
||||||
* to match AWIPS I default setting
|
* to match AWIPS I default setting
|
||||||
|
* Jul 21, 2015 4500 rjpeter Use Number in blind cast.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author askripsky
|
* @author askripsky
|
||||||
|
@ -123,8 +124,8 @@ public class HydroStationDataManager {
|
||||||
hydroStationQuery.append(getWhereClause());
|
hydroStationQuery.append(getWhereClause());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
List<Object[]> data = DirectDbQuery.executeQuery(hydroStationQuery
|
List<Object[]> data = DirectDbQuery.executeQuery(
|
||||||
.toString(), HydroConstants.IHFS,
|
hydroStationQuery.toString(), HydroConstants.IHFS,
|
||||||
DirectDbQuery.QueryLanguage.SQL);
|
DirectDbQuery.QueryLanguage.SQL);
|
||||||
|
|
||||||
for (Object[] currData : data) {
|
for (Object[] currData : data) {
|
||||||
|
@ -141,10 +142,11 @@ public class HydroStationDataManager {
|
||||||
StringBuffer rval = new StringBuffer();
|
StringBuffer rval = new StringBuffer();
|
||||||
|
|
||||||
if (showPost) {
|
if (showPost) {
|
||||||
if (showNoPost)
|
if (showNoPost) {
|
||||||
rval.append(" WHERE post IS NOT NULL ");
|
rval.append(" WHERE post IS NOT NULL ");
|
||||||
else
|
} else {
|
||||||
rval.append(" WHERE post = 1 ");
|
rval.append(" WHERE post = 1 ");
|
||||||
|
}
|
||||||
} else if (showNoPost) {
|
} else if (showNoPost) {
|
||||||
rval.append(" WHERE post = 0 ");
|
rval.append(" WHERE post = 0 ");
|
||||||
} else {
|
} else {
|
||||||
|
@ -176,13 +178,10 @@ public class HydroStationDataManager {
|
||||||
/* specify the lat-lon filter if it is enabled */
|
/* specify the lat-lon filter if it is enabled */
|
||||||
|
|
||||||
if (filterByLatLon) {
|
if (filterByLatLon) {
|
||||||
rval
|
rval.append(String
|
||||||
.append(String
|
.format(" AND ((lat > %f) AND (lat < %f)) AND ((lon > %f) AND (lon < %f)) ",
|
||||||
.format(
|
latCenter - latOffset, latCenter + latOffset,
|
||||||
" AND ((lat > %f) AND (lat < %f)) AND ((lon > %f) AND (lon < %f)) ",
|
lonCenter - lonOffset, lonCenter + lonOffset));
|
||||||
latCenter - latOffset, latCenter
|
|
||||||
+ latOffset, lonCenter - lonOffset,
|
|
||||||
lonCenter + lonOffset));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Determine sort selection criteria */
|
/* Determine sort selection criteria */
|
||||||
|
@ -196,7 +195,6 @@ public class HydroStationDataManager {
|
||||||
rval.append(" order by lid");
|
rval.append(" order by lid");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return rval.toString();
|
return rval.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -205,19 +203,20 @@ public class HydroStationDataManager {
|
||||||
*
|
*
|
||||||
* @param lid
|
* @param lid
|
||||||
* The lid to check
|
* The lid to check
|
||||||
* @return
|
* @return True if site is a river site
|
||||||
* True if site is a river site
|
|
||||||
*/
|
*/
|
||||||
public boolean isRiverSite(String lid) {
|
public boolean isRiverSite(String lid) {
|
||||||
boolean riverSite = false;
|
boolean riverSite = false;
|
||||||
|
|
||||||
String query = "select count(*) from riverstat where lid = '" + lid + "'";
|
String query = "select count(*) from riverstat where lid = '" + lid
|
||||||
|
+ "'";
|
||||||
List<Object[]> rs;
|
List<Object[]> rs;
|
||||||
try {
|
try {
|
||||||
rs = DirectDbQuery.executeQuery(query, HydroConstants.IHFS, QueryLanguage.SQL);
|
rs = DirectDbQuery.executeQuery(query, HydroConstants.IHFS,
|
||||||
|
QueryLanguage.SQL);
|
||||||
|
|
||||||
if ((rs != null) && (rs.size() > 0)) {
|
if ((rs != null) && (rs.size() > 0)) {
|
||||||
long num = (Long) rs.get(0)[0];
|
long num = ((Number) rs.get(0)[0]).longValue();
|
||||||
if (num > 0) {
|
if (num > 0) {
|
||||||
riverSite = true;
|
riverSite = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,21 @@ import com.raytheon.viz.hydrocommon.whfslib.colorthreshold.ColorThreshold;
|
||||||
import com.raytheon.viz.hydrocommon.whfslib.colorthreshold.ColorThresholdArray;
|
import com.raytheon.viz.hydrocommon.whfslib.colorthreshold.ColorThresholdArray;
|
||||||
import com.raytheon.viz.hydrocommon.whfslib.colorthreshold.NamedColorUseSet;
|
import com.raytheon.viz.hydrocommon.whfslib.colorthreshold.NamedColorUseSet;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hydro Color Manager
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
*
|
||||||
|
* SOFTWARE HISTORY
|
||||||
|
*
|
||||||
|
* Date Ticket# Engineer Description
|
||||||
|
* ------------ ---------- ----------- --------------------------
|
||||||
|
* Jul 21, 2015 4500 rjpeter Use Number in blind cast.
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author rjpeter
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
public abstract class ColorManager {
|
public abstract class ColorManager {
|
||||||
protected static final String HARDCODED = "HARDCODED";
|
protected static final String HARDCODED = "HARDCODED";
|
||||||
|
|
||||||
|
@ -121,8 +136,7 @@ public abstract class ColorManager {
|
||||||
rval.add(data);
|
rval.add(data);
|
||||||
|
|
||||||
ColorThreshold[] thresholds = arr.getThresholds();
|
ColorThreshold[] thresholds = arr.getThresholds();
|
||||||
for (int i = 0; i < thresholds.length; ++i) {
|
for (ColorThreshold ct : thresholds) {
|
||||||
ColorThreshold ct = thresholds[i];
|
|
||||||
double tmpVal = ct.getValue();
|
double tmpVal = ct.getValue();
|
||||||
data = new ColorScaleData();
|
data = new ColorScaleData();
|
||||||
// We already added the default and missing values... replace them?
|
// We already added the default and missing values... replace them?
|
||||||
|
@ -201,7 +215,8 @@ public abstract class ColorManager {
|
||||||
rval = entry.getValue().getColor_use_display_string();
|
rval = entry.getValue().getColor_use_display_string();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (dataType.equals(entry.getValue().getColor_use_display_string())) {
|
} else if (dataType.equals(entry.getValue()
|
||||||
|
.getColor_use_display_string())) {
|
||||||
// if the display string is passed in just return it
|
// if the display string is passed in just return it
|
||||||
rval = dataType;
|
rval = dataType;
|
||||||
break;
|
break;
|
||||||
|
@ -391,7 +406,7 @@ public abstract class ColorManager {
|
||||||
colorValue.setUserID((String) oa[0]);
|
colorValue.setUserID((String) oa[0]);
|
||||||
colorValue.setApplicationName((String) oa[1]);
|
colorValue.setApplicationName((String) oa[1]);
|
||||||
colorValue.setColorUseName((String) oa[2]);
|
colorValue.setColorUseName((String) oa[2]);
|
||||||
colorValue.setDuration(((Integer) oa[3]) / 3600);
|
colorValue.setDuration(((Number) oa[3]).intValue() / 3600);
|
||||||
colorValue.setThresholdValue((Double) oa[4]);
|
colorValue.setThresholdValue((Double) oa[4]);
|
||||||
colorValue.setThresholdUnit((String) oa[5]);
|
colorValue.setThresholdUnit((String) oa[5]);
|
||||||
colorValue.setColorName((String) oa[6]);
|
colorValue.setColorName((String) oa[6]);
|
||||||
|
|
|
@ -36,7 +36,7 @@ import com.raytheon.viz.hydrocommon.HydroConstants;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* 02 Sep 2008 lvenable Initial creation.
|
* 02 Sep 2008 lvenable Initial creation.
|
||||||
* 18 Nov 2008 dhladky Made Interactive.
|
* 18 Nov 2008 dhladky Made Interactive.
|
||||||
*
|
* Jul 21, 2015 4500 rjpeter Use Number in blind cast.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author lvenable
|
* @author lvenable
|
||||||
|
@ -82,7 +82,7 @@ public class CrestData implements Comparable<CrestData> {
|
||||||
/**
|
/**
|
||||||
* Flag indicating if the data is record data or not.
|
* Flag indicating if the data is record data or not.
|
||||||
*/
|
*/
|
||||||
private boolean record = false;
|
private final boolean record = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicator on how to sort the data.
|
* Indicator on how to sort the data.
|
||||||
|
@ -104,7 +104,7 @@ public class CrestData implements Comparable<CrestData> {
|
||||||
setStage((Double) objects[0]);
|
setStage((Double) objects[0]);
|
||||||
}
|
}
|
||||||
if (objects[1] != null) {
|
if (objects[1] != null) {
|
||||||
setFlow((Integer) objects[1]);
|
setFlow(((Number) objects[1]).intValue());
|
||||||
}
|
}
|
||||||
if (objects[2] != null) {
|
if (objects[2] != null) {
|
||||||
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
|
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
|
||||||
|
@ -328,14 +328,16 @@ public class CrestData implements Comparable<CrestData> {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stage == HydroConstants.MISSING_VALUE) {
|
if (stage == HydroConstants.MISSING_VALUE) {
|
||||||
str = String.format("%10s %8s %10s %10s %-6s", HydroConstants.MISSING_STRING, flow,
|
str = String.format("%10s %8s %10s %10s %-6s",
|
||||||
getDateString(), getTimeString(), crestType);
|
HydroConstants.MISSING_STRING, flow, getDateString(),
|
||||||
|
getTimeString(), crestType);
|
||||||
} else if (flow == HydroConstants.MISSING_VALUE) {
|
} else if (flow == HydroConstants.MISSING_VALUE) {
|
||||||
str = String.format(" %8.2f %8s %10s %10s %-6s", stage, HydroConstants.MISSING_STRING,
|
str = String.format(" %8.2f %8s %10s %10s %-6s", stage,
|
||||||
getDateString(), getTimeString(), crestType);
|
HydroConstants.MISSING_STRING, getDateString(),
|
||||||
|
getTimeString(), crestType);
|
||||||
} else {
|
} else {
|
||||||
str = String.format(" %8.2f %8s %10s %10s %-6s", stage, flow,
|
str = String.format(" %8.2f %8s %10s %10s %-6s", stage,
|
||||||
getDateString(), getTimeString(), crestType);
|
flow, getDateString(), getTimeString(), crestType);
|
||||||
}
|
}
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
|
@ -344,6 +346,7 @@ public class CrestData implements Comparable<CrestData> {
|
||||||
/**
|
/**
|
||||||
* Compare method used to determine what data type to sort on.
|
* Compare method used to determine what data type to sort on.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int compareTo(CrestData obj) {
|
public int compareTo(CrestData obj) {
|
||||||
CrestData otherObject = obj;
|
CrestData otherObject = obj;
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ public class DataLimitData extends HydroDBData implements IHydroDBData {
|
||||||
public DataLimitData(Object[] data) {
|
public DataLimitData(Object[] data) {
|
||||||
setPe((String) data[0]);
|
setPe((String) data[0]);
|
||||||
// limitQuery.append("pe,");
|
// limitQuery.append("pe,");
|
||||||
setDur((Short) data[1]);
|
setDur(((Number) data[1]).shortValue());
|
||||||
// limitQuery.append("dur,");
|
// limitQuery.append("dur,");
|
||||||
setMonthDayStart((String) data[2]);
|
setMonthDayStart((String) data[2]);
|
||||||
// limitQuery.append("monthdaystart,");
|
// limitQuery.append("monthdaystart,");
|
||||||
|
|
|
@ -36,7 +36,7 @@ import com.raytheon.viz.hydrocommon.util.QualityCodeUtil;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Oct 28, 2008 1636 askripsky Initial creation
|
* Oct 28, 2008 1636 askripsky Initial creation
|
||||||
* 11/5/2008 1662 grichard Added another constructor.
|
* 11/5/2008 1662 grichard Added another constructor.
|
||||||
*
|
* Jul 21, 2015 4500 rjpeter Use Number in blind cast.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author askripsky
|
* @author askripsky
|
||||||
|
@ -150,7 +150,7 @@ public class HydroData extends HydroDBData {
|
||||||
setLid((String) data[0]);
|
setLid((String) data[0]);
|
||||||
setName((String) data[1]);
|
setName((String) data[1]);
|
||||||
setPe((String) data[2]);
|
setPe((String) data[2]);
|
||||||
setDur((Integer) data[3]);
|
setDur(((Number) data[3]).intValue());
|
||||||
setTs((String) data[4]);
|
setTs((String) data[4]);
|
||||||
setExtremum((String) data[5]);
|
setExtremum((String) data[5]);
|
||||||
setValue(data[6]);
|
setValue(data[6]);
|
||||||
|
@ -171,7 +171,7 @@ public class HydroData extends HydroDBData {
|
||||||
public HydroData(Object[] data, Object name) {
|
public HydroData(Object[] data, Object name) {
|
||||||
setLid((String) data[0]);
|
setLid((String) data[0]);
|
||||||
setPe((String) data[1]);
|
setPe((String) data[1]);
|
||||||
setDur((Integer) data[2]);
|
setDur(((Number) data[2]).intValue());
|
||||||
setTs((String) data[3]);
|
setTs((String) data[3]);
|
||||||
setExtremum((String) data[4]);
|
setExtremum((String) data[4]);
|
||||||
setValue(data[5]);
|
setValue(data[5]);
|
||||||
|
@ -187,7 +187,7 @@ public class HydroData extends HydroDBData {
|
||||||
public HydroData(Object[] data, String table) {
|
public HydroData(Object[] data, String table) {
|
||||||
setLid((String) data[0]);
|
setLid((String) data[0]);
|
||||||
setPe((String) data[1]);
|
setPe((String) data[1]);
|
||||||
setDur((Integer) data[2]);
|
setDur(((Number) data[2]).intValue());
|
||||||
setTs((String) data[3]);
|
setTs((String) data[3]);
|
||||||
setExtremum((String) data[4]);
|
setExtremum((String) data[4]);
|
||||||
setObsTime((Date) data[5]);
|
setObsTime((Date) data[5]);
|
||||||
|
@ -282,8 +282,8 @@ public class HydroData extends HydroDBData {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setQualityCode(Object qualityCode) {
|
public void setQualityCode(Object qualityCode) {
|
||||||
this.qualityCode = (qualityCode != null) ? (Integer) qualityCode
|
this.qualityCode = (qualityCode != null) ? ((Number) qualityCode)
|
||||||
: HydroConstants.MISSING_VALUE;
|
.intValue() : HydroConstants.MISSING_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getRevision() {
|
public int getRevision() {
|
||||||
|
@ -291,7 +291,7 @@ public class HydroData extends HydroDBData {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRevision(Object revision) {
|
public void setRevision(Object revision) {
|
||||||
this.revision = (revision != null) ? (Integer) revision : 0;
|
this.revision = (revision != null) ? ((Number) revision).intValue() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getProductID() {
|
public String getProductID() {
|
||||||
|
@ -373,7 +373,8 @@ public class HydroData extends HydroDBData {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param previousValue the previousValue to set
|
* @param previousValue
|
||||||
|
* the previousValue to set
|
||||||
*/
|
*/
|
||||||
public void setPreviousValue(double previousValue) {
|
public void setPreviousValue(double previousValue) {
|
||||||
this.previousValue = previousValue;
|
this.previousValue = previousValue;
|
||||||
|
|
|
@ -35,7 +35,7 @@ import com.raytheon.uf.common.dataquery.db.QueryResultRow;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Nov 11, 2008 askripsky Initial creation
|
* Nov 11, 2008 askripsky Initial creation
|
||||||
*
|
* Jul 21, 2015 4500 rjpeter Use Number in blind cast.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author askripsky
|
* @author askripsky
|
||||||
|
@ -75,7 +75,8 @@ public class LowWaterData {
|
||||||
/**
|
/**
|
||||||
* Date format.
|
* Date format.
|
||||||
*/
|
*/
|
||||||
private SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");
|
private final SimpleDateFormat dateFormat = new SimpleDateFormat(
|
||||||
|
"MM/dd/yyyy");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
@ -136,7 +137,7 @@ public class LowWaterData {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFlow(Object q) {
|
public void setFlow(Object q) {
|
||||||
flow = (q != null) ? (Integer) q : MISSING_VALUE;
|
flow = (q != null) ? ((Number) q).intValue() : MISSING_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getRemark() {
|
public String getRemark() {
|
||||||
|
@ -152,8 +153,8 @@ public class LowWaterData {
|
||||||
return String
|
return String
|
||||||
.format("%-24s %-27s %-12s",
|
.format("%-24s %-27s %-12s",
|
||||||
(stage != MISSING_VALUE_D) ? String.format("%8.2f",
|
(stage != MISSING_VALUE_D) ? String.format("%8.2f",
|
||||||
stage) : "", (flow != MISSING_VALUE) ? String
|
stage) : "",
|
||||||
.format("%8d", flow) : "", dateFormat
|
(flow != MISSING_VALUE) ? String.format("%8d", flow)
|
||||||
.format(lwDate));
|
: "", dateFormat.format(lwDate));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ import com.raytheon.viz.hydrocommon.HydroConstants;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Nov 14, 2008 1697 askripsky Initial creation
|
* Nov 14, 2008 1697 askripsky Initial creation
|
||||||
*
|
* Jul 21, 2015 4500 rjpeter Use Number in blind cast.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author askripsky
|
* @author askripsky
|
||||||
|
@ -112,7 +112,8 @@ public class LowWaterStatementData {
|
||||||
setUpperValue((Double) data.getColumn(dataMap.get("upper_value")));
|
setUpperValue((Double) data.getColumn(dataMap.get("upper_value")));
|
||||||
}
|
}
|
||||||
|
|
||||||
setCriteriaRank((Integer) data.getColumn(dataMap.get("criteria_rank")));
|
setCriteriaRank(((Number) data.getColumn(dataMap.get("criteria_rank")))
|
||||||
|
.intValue());
|
||||||
|
|
||||||
if (data.getColumn(dataMap.get("statement")) != null) {
|
if (data.getColumn(dataMap.get("statement")) != null) {
|
||||||
setStatement((String) data.getColumn(dataMap.get("statement")));
|
setStatement((String) data.getColumn(dataMap.get("statement")));
|
||||||
|
|
|
@ -31,7 +31,7 @@ import java.util.Date;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Nov 19, 2008 mpduff Initial creation
|
* Nov 19, 2008 mpduff Initial creation
|
||||||
*
|
* Jul 21, 2015 4500 rjpeter Use Number in blind cast.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author mpduff
|
* @author mpduff
|
||||||
|
@ -105,7 +105,7 @@ public class Observation {
|
||||||
public Observation(Object[] oa) {
|
public Observation(Object[] oa) {
|
||||||
setLid((String) oa[0]);
|
setLid((String) oa[0]);
|
||||||
setPe((String) oa[1]);
|
setPe((String) oa[1]);
|
||||||
setDur((Integer)oa[2]);
|
setDur(((Number) oa[2]).intValue());
|
||||||
setTs((String) oa[3]);
|
setTs((String) oa[3]);
|
||||||
setExtremum((String) oa[4]);
|
setExtremum((String) oa[4]);
|
||||||
setObstime((Date) oa[5]);
|
setObstime((Date) oa[5]);
|
||||||
|
@ -114,10 +114,10 @@ public class Observation {
|
||||||
setShefQualCode((String) oa[7]);
|
setShefQualCode((String) oa[7]);
|
||||||
}
|
}
|
||||||
if (oa[8] != null) {
|
if (oa[8] != null) {
|
||||||
setQualityCode((Integer)oa[8]);
|
setQualityCode(((Number) oa[8]).intValue());
|
||||||
}
|
}
|
||||||
if (oa[9] != null) {
|
if (oa[9] != null) {
|
||||||
setRevision((Integer)oa[9]);
|
setRevision(((Number) oa[9]).intValue());
|
||||||
}
|
}
|
||||||
if (oa[10] != null) {
|
if (oa[10] != null) {
|
||||||
setProductId((String) oa[10]);
|
setProductId((String) oa[10]);
|
||||||
|
@ -132,7 +132,8 @@ public class Observation {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param lid the lid to set
|
* @param lid
|
||||||
|
* the lid to set
|
||||||
*/
|
*/
|
||||||
public void setLid(String lid) {
|
public void setLid(String lid) {
|
||||||
this.lid = lid;
|
this.lid = lid;
|
||||||
|
@ -146,7 +147,8 @@ public class Observation {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param pe the pe to set
|
* @param pe
|
||||||
|
* the pe to set
|
||||||
*/
|
*/
|
||||||
public void setPe(String pe) {
|
public void setPe(String pe) {
|
||||||
this.pe = pe;
|
this.pe = pe;
|
||||||
|
@ -160,7 +162,8 @@ public class Observation {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param dur the dur to set
|
* @param dur
|
||||||
|
* the dur to set
|
||||||
*/
|
*/
|
||||||
public void setDur(int dur) {
|
public void setDur(int dur) {
|
||||||
this.dur = dur;
|
this.dur = dur;
|
||||||
|
@ -174,7 +177,8 @@ public class Observation {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param ts the ts to set
|
* @param ts
|
||||||
|
* the ts to set
|
||||||
*/
|
*/
|
||||||
public void setTs(String ts) {
|
public void setTs(String ts) {
|
||||||
this.ts = ts;
|
this.ts = ts;
|
||||||
|
@ -188,7 +192,8 @@ public class Observation {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param extremum the extremum to set
|
* @param extremum
|
||||||
|
* the extremum to set
|
||||||
*/
|
*/
|
||||||
public void setExtremum(String extremum) {
|
public void setExtremum(String extremum) {
|
||||||
this.extremum = extremum;
|
this.extremum = extremum;
|
||||||
|
@ -202,7 +207,8 @@ public class Observation {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param obstime the obstime to set
|
* @param obstime
|
||||||
|
* the obstime to set
|
||||||
*/
|
*/
|
||||||
public void setObstime(Date obstime) {
|
public void setObstime(Date obstime) {
|
||||||
this.obstime = obstime;
|
this.obstime = obstime;
|
||||||
|
@ -216,7 +222,8 @@ public class Observation {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param value the value to set
|
* @param value
|
||||||
|
* the value to set
|
||||||
*/
|
*/
|
||||||
public void setValue(Double value) {
|
public void setValue(Double value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
|
@ -230,7 +237,8 @@ public class Observation {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param shefQualCode the shefQualCode to set
|
* @param shefQualCode
|
||||||
|
* the shefQualCode to set
|
||||||
*/
|
*/
|
||||||
public void setShefQualCode(String shefQualCode) {
|
public void setShefQualCode(String shefQualCode) {
|
||||||
this.shefQualCode = shefQualCode;
|
this.shefQualCode = shefQualCode;
|
||||||
|
@ -244,7 +252,8 @@ public class Observation {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param qualityCode the qualityCode to set
|
* @param qualityCode
|
||||||
|
* the qualityCode to set
|
||||||
*/
|
*/
|
||||||
public void setQualityCode(Integer qualityCode) {
|
public void setQualityCode(Integer qualityCode) {
|
||||||
this.qualityCode = qualityCode;
|
this.qualityCode = qualityCode;
|
||||||
|
@ -258,7 +267,8 @@ public class Observation {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param revision the revision to set
|
* @param revision
|
||||||
|
* the revision to set
|
||||||
*/
|
*/
|
||||||
public void setRevision(int revision) {
|
public void setRevision(int revision) {
|
||||||
this.revision = revision;
|
this.revision = revision;
|
||||||
|
@ -272,7 +282,8 @@ public class Observation {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param productId the productId to set
|
* @param productId
|
||||||
|
* the productId to set
|
||||||
*/
|
*/
|
||||||
public void setProductId(String productId) {
|
public void setProductId(String productId) {
|
||||||
this.productId = productId;
|
this.productId = productId;
|
||||||
|
@ -286,7 +297,8 @@ public class Observation {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param basisTime the basisTime to set
|
* @param basisTime
|
||||||
|
* the basisTime to set
|
||||||
*/
|
*/
|
||||||
public void setBasisTime(Date basisTime) {
|
public void setBasisTime(Date basisTime) {
|
||||||
this.basisTime = basisTime;
|
this.basisTime = basisTime;
|
||||||
|
|
|
@ -38,7 +38,7 @@ import com.raytheon.viz.hydrocommon.util.HydroDataUtils;
|
||||||
* Dec 15, 2008 1787 askripsky Initial Creation
|
* Dec 15, 2008 1787 askripsky Initial Creation
|
||||||
* Apr 18, 2013 1790 rferrel Cleanup method interfaces;
|
* Apr 18, 2013 1790 rferrel Cleanup method interfaces;
|
||||||
* part of non-blocking dialogs.
|
* part of non-blocking dialogs.
|
||||||
*
|
* Jul 21, 2015 4500 rjpeter Use Number in blind cast.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author askripsky
|
* @author askripsky
|
||||||
|
@ -66,7 +66,7 @@ public class DataAdjustFactorDataManager {
|
||||||
manager = new DataAdjustFactorDataManager();
|
manager = new DataAdjustFactorDataManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
return (DataAdjustFactorDataManager) manager;
|
return manager;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -87,8 +87,8 @@ public class DataAdjustFactorDataManager {
|
||||||
for (QueryResultRow currNet : data.getRows()) {
|
for (QueryResultRow currNet : data.getRows()) {
|
||||||
String name = (String) currNet.getColumn(data.getColumnNames()
|
String name = (String) currNet.getColumn(data.getColumnNames()
|
||||||
.get("name"));
|
.get("name"));
|
||||||
int dur = (Integer) currNet.getColumn(data.getColumnNames()
|
int dur = ((Number) currNet.getColumn(data.getColumnNames()
|
||||||
.get("dur"));
|
.get("dur"))).intValue();
|
||||||
rval.add(String.format("%s (%s)", name, dur));
|
rval.add(String.format("%s (%s)", name, dur));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -156,7 +156,7 @@ public class DataAdjustFactorDataManager {
|
||||||
|
|
||||||
public List<DataAdjustFactorData> getAdjustFactorData(boolean forceLoad)
|
public List<DataAdjustFactorData> getAdjustFactorData(boolean forceLoad)
|
||||||
throws VizException {
|
throws VizException {
|
||||||
if (adjustFactorData == null || forceLoad) {
|
if ((adjustFactorData == null) || forceLoad) {
|
||||||
adjustFactorData = HydroDBDataManager.getInstance().getData(
|
adjustFactorData = HydroDBDataManager.getInstance().getData(
|
||||||
DataAdjustFactorData.class);
|
DataAdjustFactorData.class);
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,8 +38,7 @@ import com.raytheon.viz.hydrocommon.data.DataIngestFilterData;
|
||||||
* Dec 11, 2008 1787 askripsky Initial Creation
|
* Dec 11, 2008 1787 askripsky Initial Creation
|
||||||
* Apr 18, 2013 1790 rferrel Code clean up with non-blocking dialogs.
|
* Apr 18, 2013 1790 rferrel Code clean up with non-blocking dialogs.
|
||||||
* May 1, 2014 17096 xwei Updated the filter list SQL statement
|
* May 1, 2014 17096 xwei Updated the filter list SQL statement
|
||||||
*
|
* Jul 21, 2015 4500 rjpeter Use Number in blind cast.
|
||||||
*
|
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author askripsky
|
* @author askripsky
|
||||||
|
@ -84,8 +83,8 @@ public class DataIngestFilterDataManager {
|
||||||
for (QueryResultRow currNet : data.getRows()) {
|
for (QueryResultRow currNet : data.getRows()) {
|
||||||
String name = (String) currNet.getColumn(data.getColumnNames()
|
String name = (String) currNet.getColumn(data.getColumnNames()
|
||||||
.get("name"));
|
.get("name"));
|
||||||
int dur = (Integer) currNet.getColumn(data.getColumnNames()
|
int dur = ((Number) currNet.getColumn(data.getColumnNames()
|
||||||
.get("dur"));
|
.get("dur"))).intValue();
|
||||||
rval.add(String.format("%s (%s)", name, dur));
|
rval.add(String.format("%s (%s)", name, dur));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ import com.raytheon.viz.hydrocommon.util.HydroDataUtils;
|
||||||
* Dec 8, 2008 1697 askripsky Initial Creation
|
* Dec 8, 2008 1697 askripsky Initial Creation
|
||||||
* Apr 18,2013 1790 rferrel Cleanup method interfaces;
|
* Apr 18,2013 1790 rferrel Cleanup method interfaces;
|
||||||
* part of non-blocking dialogs.
|
* part of non-blocking dialogs.
|
||||||
*
|
* Jul 21, 2015 4500 rjpeter Use Number in blind cast.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author askripsky
|
* @author askripsky
|
||||||
|
@ -73,7 +73,7 @@ public class QcAlertAlarmLimitsDataManager {
|
||||||
manager = new QcAlertAlarmLimitsDataManager();
|
manager = new QcAlertAlarmLimitsDataManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
return (QcAlertAlarmLimitsDataManager) manager;
|
return manager;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -94,8 +94,8 @@ public class QcAlertAlarmLimitsDataManager {
|
||||||
for (QueryResultRow currNet : data.getRows()) {
|
for (QueryResultRow currNet : data.getRows()) {
|
||||||
String name = (String) currNet.getColumn(data.getColumnNames()
|
String name = (String) currNet.getColumn(data.getColumnNames()
|
||||||
.get("name"));
|
.get("name"));
|
||||||
int dur = (Integer) currNet.getColumn(data.getColumnNames()
|
int dur = ((Number) currNet.getColumn(data.getColumnNames()
|
||||||
.get("dur"));
|
.get("dur"))).intValue();
|
||||||
rval.add(String.format("%s (%s)", name, dur));
|
rval.add(String.format("%s (%s)", name, dur));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ public class QcAlertAlarmLimitsDataManager {
|
||||||
|
|
||||||
public List<DataLimitData> getDefaultLimits(boolean filterByPE,
|
public List<DataLimitData> getDefaultLimits(boolean filterByPE,
|
||||||
List<String> selectedPE, boolean forceLoad) throws VizException {
|
List<String> selectedPE, boolean forceLoad) throws VizException {
|
||||||
if (defaultData == null || forceLoad) {
|
if ((defaultData == null) || forceLoad) {
|
||||||
defaultData = HydroDBDataManager.getInstance().getData(
|
defaultData = HydroDBDataManager.getInstance().getData(
|
||||||
DataLimitData.class);
|
DataLimitData.class);
|
||||||
}
|
}
|
||||||
|
@ -198,7 +198,7 @@ public class QcAlertAlarmLimitsDataManager {
|
||||||
public List<LocationDataLimitData> getLocationLimits(boolean filterByLID,
|
public List<LocationDataLimitData> getLocationLimits(boolean filterByLID,
|
||||||
String lidFilter, boolean filterByPE, List<String> selectedPE,
|
String lidFilter, boolean filterByPE, List<String> selectedPE,
|
||||||
boolean forceLoad) throws VizException {
|
boolean forceLoad) throws VizException {
|
||||||
if (locationData == null || forceLoad) {
|
if ((locationData == null) || forceLoad) {
|
||||||
locationData = HydroDBDataManager.getInstance().getData(
|
locationData = HydroDBDataManager.getInstance().getData(
|
||||||
LocationDataLimitData.class);
|
LocationDataLimitData.class);
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,14 +42,14 @@ import com.raytheon.viz.hydrocommon.datamanager.HydroDataManager;
|
||||||
* 24 Nov 2008 1682 dhladky Made interactive.
|
* 24 Nov 2008 1682 dhladky Made interactive.
|
||||||
* 15 Dec 2009 2422 mpduff Added query for rating date and
|
* 15 Dec 2009 2422 mpduff Added query for rating date and
|
||||||
* USGS rating number.
|
* USGS rating number.
|
||||||
*
|
* Jul 21, 2015 4500 rjpeter Use Number in blind cast.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
public class RatingCurveDataManager extends HydroDataManager {
|
public class RatingCurveDataManager extends HydroDataManager {
|
||||||
|
|
||||||
private SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
|
private final SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
|
||||||
|
|
||||||
public RatingCurveDataManager() {
|
public RatingCurveDataManager() {
|
||||||
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
|
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
|
||||||
|
@ -191,12 +191,15 @@ public class RatingCurveDataManager extends HydroDataManager {
|
||||||
public void insertRatingCurveShift(RatingCurveShiftData rcsd) {
|
public void insertRatingCurveShift(RatingCurveShiftData rcsd) {
|
||||||
if (rcsd.getLid() != null) {
|
if (rcsd.getLid() != null) {
|
||||||
// Check to see if we need to update or insert
|
// Check to see if we need to update or insert
|
||||||
ArrayList<RatingCurveShiftData> dataList = getRatingCurveShift(rcsd.getLid());
|
ArrayList<RatingCurveShiftData> dataList = getRatingCurveShift(rcsd
|
||||||
|
.getLid());
|
||||||
boolean doUpdate = false;
|
boolean doUpdate = false;
|
||||||
if (dataList.size() > 0) {
|
if (dataList.size() > 0) {
|
||||||
for (RatingCurveShiftData data : dataList) {
|
for (RatingCurveShiftData data : dataList) {
|
||||||
// if a pk match, then need to update
|
// if a pk match, then need to update
|
||||||
if (data.getLid().equals(rcsd.getLid()) && data.getDate().getTime().equals(rcsd.getDate().getTime())) {
|
if (data.getLid().equals(rcsd.getLid())
|
||||||
|
&& data.getDate().getTime()
|
||||||
|
.equals(rcsd.getDate().getTime())) {
|
||||||
doUpdate = true;
|
doUpdate = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -216,11 +219,19 @@ public class RatingCurveDataManager extends HydroDataManager {
|
||||||
String query = null;
|
String query = null;
|
||||||
if (doUpdate) {
|
if (doUpdate) {
|
||||||
// do an update
|
// do an update
|
||||||
query = "update ratingShift set shift_amount = " + value + ", active = '" + active + "' "
|
query = "update ratingShift set shift_amount = " + value
|
||||||
+ " where lid = '" + lid + "' and date = '" + date + "'";
|
+ ", active = '" + active + "' " + " where lid = '"
|
||||||
|
+ lid + "' and date = '" + date + "'";
|
||||||
} else {
|
} else {
|
||||||
query = "INSERT INTO ratingshift (lid, date, shift_amount, active) VALUES ('"
|
query = "INSERT INTO ratingshift (lid, date, shift_amount, active) VALUES ('"
|
||||||
+ lid + "', '" + date + "', " + value + ", '" + active + "')";
|
+ lid
|
||||||
|
+ "', '"
|
||||||
|
+ date
|
||||||
|
+ "', "
|
||||||
|
+ value
|
||||||
|
+ ", '"
|
||||||
|
+ active
|
||||||
|
+ "')";
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -261,19 +272,21 @@ public class RatingCurveDataManager extends HydroDataManager {
|
||||||
public void insertRatingCurveData(RatingCurveData rcd, String lid) {
|
public void insertRatingCurveData(RatingCurveData rcd, String lid) {
|
||||||
if (lid != null) {
|
if (lid != null) {
|
||||||
// Check for update or insert
|
// Check for update or insert
|
||||||
String countQuery = "select count(*) from rating where lid = '" + lid + "'"
|
String countQuery = "select count(*) from rating where lid = '"
|
||||||
+ " and stage = " + rcd.getStage();
|
+ lid + "'" + " and stage = " + rcd.getStage();
|
||||||
try {
|
try {
|
||||||
List<Object[]> rs = DirectDbQuery.executeQuery(countQuery, HydroConstants.IHFS, QueryLanguage.SQL);
|
List<Object[]> rs = DirectDbQuery.executeQuery(countQuery,
|
||||||
|
HydroConstants.IHFS, QueryLanguage.SQL);
|
||||||
if ((rs != null) && (rs.size() > 0)) {
|
if ((rs != null) && (rs.size() > 0)) {
|
||||||
Object[] oa = rs.get(0);
|
Object[] oa = rs.get(0);
|
||||||
if ((oa != null) && (oa.length > 0)) {
|
if ((oa != null) && (oa.length > 0)) {
|
||||||
long count = (Long) oa[0];
|
long count = ((Number) oa[0]).longValue();
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
// need to delete, then insert
|
// need to delete, then insert
|
||||||
String query = "delete from rating where lid = '" + lid + "' and stage = " + rcd.getStage();
|
String query = "delete from rating where lid = '"
|
||||||
DirectDbQuery.executeStatement(query, HydroConstants.IHFS,
|
+ lid + "' and stage = " + rcd.getStage();
|
||||||
QueryLanguage.SQL);
|
DirectDbQuery.executeStatement(query,
|
||||||
|
HydroConstants.IHFS, QueryLanguage.SQL);
|
||||||
}
|
}
|
||||||
// need to do an insert
|
// need to do an insert
|
||||||
String query = "INSERT INTO rating (lid, stage, discharge) VALUES ('"
|
String query = "INSERT INTO rating (lid, stage, discharge) VALUES ('"
|
||||||
|
@ -281,10 +294,9 @@ public class RatingCurveDataManager extends HydroDataManager {
|
||||||
+ "', "
|
+ "', "
|
||||||
+ rcd.getStage()
|
+ rcd.getStage()
|
||||||
+ ", "
|
+ ", "
|
||||||
+ rcd.getDischarge()
|
+ rcd.getDischarge() + ")";
|
||||||
+ ")";
|
DirectDbQuery.executeStatement(query,
|
||||||
DirectDbQuery.executeStatement(query, HydroConstants.IHFS,
|
HydroConstants.IHFS, QueryLanguage.SQL);
|
||||||
QueryLanguage.SQL);
|
|
||||||
} else {
|
} else {
|
||||||
throw new Exception("Error accessing Hydor Database");
|
throw new Exception("Error accessing Hydor Database");
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ import com.raytheon.viz.hydrocommon.textreport.TextReportData.StaffGageData;
|
||||||
* Dec 08, 2011 11728 lbousaidi changed the routines that retrieve data
|
* Dec 08, 2011 11728 lbousaidi changed the routines that retrieve data
|
||||||
* Apr 25, 2012 14499 wkwock Refine format, query, etc
|
* Apr 25, 2012 14499 wkwock Refine format, query, etc
|
||||||
* Nov 06, 2012 15454 wkwock Fix query for get data from gage table
|
* Nov 06, 2012 15454 wkwock Fix query for get data from gage table
|
||||||
*
|
* Jul 21, 2015 4500 rjpeter Use Number in blind cast.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author mpduff
|
* @author mpduff
|
||||||
|
@ -63,7 +63,7 @@ public class TextReportDataManager extends HydroDataManager {
|
||||||
|
|
||||||
private HashMap<String, TextReportData> reportDataMap = new HashMap<String, TextReportData>();
|
private HashMap<String, TextReportData> reportDataMap = new HashMap<String, TextReportData>();
|
||||||
|
|
||||||
private HashMap<String, TextReportData.Stnclass> stnclassMap = new HashMap<String, TextReportData.Stnclass>();
|
private final HashMap<String, TextReportData.Stnclass> stnclassMap = new HashMap<String, TextReportData.Stnclass>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Private constructor.
|
* Private constructor.
|
||||||
|
@ -478,11 +478,11 @@ public class TextReportDataManager extends HydroDataManager {
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private TextReportData getCresList(String lid) {
|
private TextReportData getCresList(String lid) {
|
||||||
TextReportData data = new TextReportData();
|
TextReportData data = new TextReportData();
|
||||||
|
|
||||||
//String crestQuery = "select datcrst, cremark, hw, jam, olddatum, q, stage, suppress, timcrst, prelim from crest where lid = '"
|
// String crestQuery =
|
||||||
|
// "select datcrst, cremark, hw, jam, olddatum, q, stage, suppress, timcrst, prelim from crest where lid = '"
|
||||||
// + lid + "' order by datcrst";
|
// + lid + "' order by datcrst";
|
||||||
|
|
||||||
String where = "where lid = '" + lid + "' order by datcrst, timcrst";
|
String where = "where lid = '" + lid + "' order by datcrst, timcrst";
|
||||||
|
@ -510,7 +510,7 @@ public class TextReportDataManager extends HydroDataManager {
|
||||||
LowWater lw = data.new LowWater();
|
LowWater lw = data.new LowWater();
|
||||||
lw.setDate((Date) oa[i]);
|
lw.setDate((Date) oa[i]);
|
||||||
if (oa[++i] != null) {
|
if (oa[++i] != null) {
|
||||||
lw.setQ((Integer) oa[i]);
|
lw.setQ(((Number) oa[i]).intValue());
|
||||||
}
|
}
|
||||||
if (oa[++i] != null) {
|
if (oa[++i] != null) {
|
||||||
lw.setStage((Double) oa[i]);
|
lw.setStage((Double) oa[i]);
|
||||||
|
@ -542,6 +542,7 @@ public class TextReportDataManager extends HydroDataManager {
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TextReportData getStaffGageData(String lid) {
|
public TextReportData getStaffGageData(String lid) {
|
||||||
|
|
||||||
TextReportData data = getStaffGageList(lid);
|
TextReportData data = getStaffGageList(lid);
|
||||||
|
@ -564,7 +565,7 @@ public class TextReportDataManager extends HydroDataManager {
|
||||||
contacts.setEmail((String) oa[++i]);
|
contacts.setEmail((String) oa[++i]);
|
||||||
contacts.setRemark((String) oa[++i]);
|
contacts.setRemark((String) oa[++i]);
|
||||||
if (oa[++i] != null) {
|
if (oa[++i] != null) {
|
||||||
contacts.setPriority((Integer) oa[i]);
|
contacts.setPriority(((Number) oa[i]).intValue());
|
||||||
}
|
}
|
||||||
contactList.add(contacts);
|
contactList.add(contacts);
|
||||||
i = 0;
|
i = 0;
|
||||||
|
@ -600,7 +601,7 @@ public class TextReportDataManager extends HydroDataManager {
|
||||||
crest.setJam((String) oa[++i]);
|
crest.setJam((String) oa[++i]);
|
||||||
crest.setOldDatum((String) oa[++i]);
|
crest.setOldDatum((String) oa[++i]);
|
||||||
if (oa[++i] != null) {
|
if (oa[++i] != null) {
|
||||||
crest.setQ((Integer) oa[i]);
|
crest.setQ(((Number) oa[i]).intValue());
|
||||||
}
|
}
|
||||||
if (oa[++i] != null) {
|
if (oa[++i] != null) {
|
||||||
crest.setStage((Double) oa[i]);
|
crest.setStage((Double) oa[i]);
|
||||||
|
@ -820,7 +821,6 @@ public class TextReportDataManager extends HydroDataManager {
|
||||||
return runQuery(query);
|
return runQuery(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the data for the report
|
* Get the data for the report
|
||||||
*
|
*
|
||||||
|
@ -842,14 +842,9 @@ public class TextReportDataManager extends HydroDataManager {
|
||||||
* @param lid
|
* @param lid
|
||||||
* The site to get data for
|
* The site to get data for
|
||||||
* @param page
|
* @param page
|
||||||
* which table to query from 0 = descrip and RiverStat
|
* which table to query from 0 = descrip and RiverStat 1 =
|
||||||
* 1 = benchmark
|
* benchmark 2 = Dcp and Telem 3 = pub and Datum 4 = lowwater 5 =
|
||||||
* 2 = Dcp and Telem
|
* crest 6 = contacts 7 = Observer
|
||||||
* 3 = pub and Datum
|
|
||||||
* 4 = lowwater
|
|
||||||
* 5 = crest
|
|
||||||
* 6 = contacts
|
|
||||||
* 7 = Observer
|
|
||||||
*/
|
*/
|
||||||
public TextReportData getDataList(String lid, int page) {
|
public TextReportData getDataList(String lid, int page) {
|
||||||
TextReportData data = null;
|
TextReportData data = null;
|
||||||
|
|
|
@ -44,7 +44,7 @@ import com.raytheon.viz.hydrocommon.whfslib.IHFSDbGenerated;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Nov 10, 2008 randerso Initial creation
|
* Nov 10, 2008 randerso Initial creation
|
||||||
* May 27, 2014 3133 njensen Organized imports, fixed == to equals
|
* May 27, 2014 3133 njensen Organized imports, fixed == to equals
|
||||||
*
|
* Jul 21, 2015 4500 rjpeter Use Number in blind cast.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author randerso
|
* @author randerso
|
||||||
|
@ -198,8 +198,8 @@ public class GetColorValues {
|
||||||
application_name, coloruse_name, duration, threshold_unit);
|
application_name, coloruse_name, duration, threshold_unit);
|
||||||
|
|
||||||
// does the closest one match?
|
// does the closest one match?
|
||||||
if (closest_duration != NO_DURATION_FOUND
|
if ((closest_duration != NO_DURATION_FOUND)
|
||||||
&& duration == closest_duration) {
|
&& (duration == closest_duration)) {
|
||||||
cvHead = getColorValueTableEntries(user_id, application_name,
|
cvHead = getColorValueTableEntries(user_id, application_name,
|
||||||
coloruse_name, closest_duration, threshold_unit);
|
coloruse_name, closest_duration, threshold_unit);
|
||||||
}
|
}
|
||||||
|
@ -347,7 +347,7 @@ public class GetColorValues {
|
||||||
|
|
||||||
if ((results != null) && (results.size() > 0)) {
|
if ((results != null) && (results.size() > 0)) {
|
||||||
for (Object[] item : results) {
|
for (Object[] item : results) {
|
||||||
duration_value = (Integer) item[0];
|
duration_value = ((Number) item[0]).intValue();
|
||||||
duration_diff = Math.abs(duration - duration_value);
|
duration_diff = Math.abs(duration - duration_value);
|
||||||
|
|
||||||
// Is this duration the closest to the original duration
|
// Is this duration the closest to the original duration
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
</property>
|
</property>
|
||||||
<property
|
<property
|
||||||
name="windowImages"
|
name="windowImages"
|
||||||
value="icons/cave_16x16.gif,icons/cave_32x32.gif">
|
value="platform:/plugin/com.raytheon.viz.ui.personalities.awips/cave_16x16.png,platform:/plugin/com.raytheon.viz.ui.personalities.awips/cave_32x32.png,platform:/plugin/com.raytheon.viz.ui.personalities.awips/cave_48x48.png,platform:/plugin/com.raytheon.viz.ui.personalities.awips/cave_64x64.png,platform:/plugin/com.raytheon.viz.ui.personalities.awips/cave_128x128.png">
|
||||||
</property>
|
</property>
|
||||||
</product>
|
</product>
|
||||||
</extension>
|
</extension>
|
||||||
|
|
Loading…
Add table
Reference in a new issue