Merge "Omaha #3133 Removed dead hydro code and related dependencies" into omaha_14.4.1
Former-commit-id:e7dc89cddd
[formerly905fa8f283
[formerly 55cf25f0671f17e667f7c785f3580a93267f8790]] Former-commit-id:905fa8f283
Former-commit-id:719c53a044
This commit is contained in:
commit
e53ec8ab82
7 changed files with 104 additions and 293 deletions
|
@ -2,28 +2,20 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: Hydrocommon Plug-in
|
Bundle-Name: Hydrocommon Plug-in
|
||||||
Bundle-SymbolicName: com.raytheon.viz.hydrocommon;singleton:=true
|
Bundle-SymbolicName: com.raytheon.viz.hydrocommon;singleton:=true
|
||||||
Bundle-Version: 1.12.1174.qualifier
|
Bundle-Version: 1.14.0.qualifier
|
||||||
Bundle-Activator: com.raytheon.viz.hydrocommon.Activator
|
|
||||||
Bundle-Vendor: Raytheon
|
Bundle-Vendor: Raytheon
|
||||||
Eclipse-RegisterBuddy: com.raytheon.viz.core, com.raytheon.uf.viz.core
|
Eclipse-RegisterBuddy: com.raytheon.viz.core, com.raytheon.uf.viz.core
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
||||||
Require-Bundle: org.eclipse.ui,
|
Require-Bundle: org.eclipse.core.runtime,
|
||||||
org.eclipse.core.runtime,
|
|
||||||
com.raytheon.viz.core,
|
com.raytheon.viz.core,
|
||||||
com.raytheon.viz.ui,
|
com.raytheon.viz.ui,
|
||||||
com.raytheon.edex.common,
|
|
||||||
org.eclipse.core.expressions,
|
|
||||||
org.geotools;bundle-version="2.4.0",
|
|
||||||
javax.persistence;bundle-version="1.0.0",
|
|
||||||
javax.measure;bundle-version="1.0.0",
|
|
||||||
com.raytheon.uf.common.hydro;bundle-version="1.0.0",
|
com.raytheon.uf.common.hydro;bundle-version="1.0.0",
|
||||||
com.raytheon.uf.common.colormap;bundle-version="1.11.13",
|
com.raytheon.uf.common.colormap;bundle-version="1.11.13",
|
||||||
com.raytheon.uf.common.mpe;bundle-version="1.11.13",
|
com.raytheon.uf.common.mpe;bundle-version="1.11.13",
|
||||||
com.raytheon.uf.viz.core.maps;bundle-version="1.0.0",
|
|
||||||
com.raytheon.uf.common.dataplugin.grid,
|
com.raytheon.uf.common.dataplugin.grid,
|
||||||
com.raytheon.uf.common.dataplugin.shef;bundle-version="1.12.1174",
|
com.raytheon.uf.common.dataplugin.shef;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.common.gridcoverage;bundle-version="1.0.0",
|
com.raytheon.uf.viz.datacube,
|
||||||
com.raytheon.uf.viz.datacube
|
com.raytheon.uf.viz.core.maps
|
||||||
Bundle-ActivationPolicy: lazy
|
Bundle-ActivationPolicy: lazy
|
||||||
Export-Package: com.raytheon.viz.hydrocommon,
|
Export-Package: com.raytheon.viz.hydrocommon,
|
||||||
com.raytheon.viz.hydrocommon.actions,
|
com.raytheon.viz.hydrocommon.actions,
|
||||||
|
|
|
@ -1,69 +0,0 @@
|
||||||
/**
|
|
||||||
* This software was developed and / or modified by Raytheon Company,
|
|
||||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
|
||||||
*
|
|
||||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
|
||||||
* This software product contains export-restricted data whose
|
|
||||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
|
||||||
* to non-U.S. persons whether in the United States or abroad requires
|
|
||||||
* an export license or other authorization.
|
|
||||||
*
|
|
||||||
* Contractor Name: Raytheon Company
|
|
||||||
* Contractor Address: 6825 Pine Street, Suite 340
|
|
||||||
* Mail Stop B8
|
|
||||||
* Omaha, NE 68106
|
|
||||||
* 402.291.0100
|
|
||||||
*
|
|
||||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
|
||||||
* further licensing information.
|
|
||||||
**/
|
|
||||||
package com.raytheon.viz.hydrocommon;
|
|
||||||
|
|
||||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
|
||||||
import org.osgi.framework.BundleContext;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The activator class controls the plug-in life cycle
|
|
||||||
*/
|
|
||||||
public class Activator extends AbstractUIPlugin {
|
|
||||||
|
|
||||||
// The plug-in ID
|
|
||||||
public static final String PLUGIN_ID = "com.raytheon.viz.hydrocommon";
|
|
||||||
|
|
||||||
// The shared instance
|
|
||||||
private static Activator plugin;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The constructor
|
|
||||||
*/
|
|
||||||
public Activator() {
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
|
|
||||||
*/
|
|
||||||
public void start(BundleContext context) throws Exception {
|
|
||||||
super.start(context);
|
|
||||||
plugin = this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
|
|
||||||
*/
|
|
||||||
public void stop(BundleContext context) throws Exception {
|
|
||||||
plugin = null;
|
|
||||||
super.stop(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the shared instance
|
|
||||||
*
|
|
||||||
* @return the shared instance
|
|
||||||
*/
|
|
||||||
public static Activator getDefault() {
|
|
||||||
return plugin;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -47,8 +47,6 @@ import com.raytheon.uf.viz.core.rsc.AbstractResourceData;
|
||||||
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||||
import com.raytheon.uf.viz.core.rsc.capabilities.OutlineCapability;
|
import com.raytheon.uf.viz.core.rsc.capabilities.OutlineCapability;
|
||||||
import com.raytheon.viz.hydrocommon.Activator;
|
|
||||||
import com.raytheon.viz.hydrocommon.constants.StatusConstants;
|
|
||||||
import com.raytheon.viz.hydrocommon.radaroverlay.RadarRingOverlayDAO;
|
import com.raytheon.viz.hydrocommon.radaroverlay.RadarRingOverlayDAO;
|
||||||
import com.raytheon.viz.hydrocommon.radaroverlay.RadarRingOverlayData;
|
import com.raytheon.viz.hydrocommon.radaroverlay.RadarRingOverlayData;
|
||||||
|
|
||||||
|
@ -61,7 +59,8 @@ import com.raytheon.viz.hydrocommon.radaroverlay.RadarRingOverlayData;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Jan 18, 2010 1783 mpduff Initial creation.
|
* Jan 18, 2010 1783 mpduff Initial creation.
|
||||||
* Apr 4, 2011 8934 mnash Fix memory leaks, added timer to retrieve data
|
* Apr 04, 2011 8934 mnash Fix memory leaks, added timer to retrieve data
|
||||||
|
* May 27, 2014 3133 njensen Organized imports
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -71,7 +70,9 @@ import com.raytheon.viz.hydrocommon.radaroverlay.RadarRingOverlayData;
|
||||||
|
|
||||||
public class RadarRingOverlayResource extends
|
public class RadarRingOverlayResource extends
|
||||||
AbstractVizResource<AbstractResourceData, MapDescriptor> {
|
AbstractVizResource<AbstractResourceData, MapDescriptor> {
|
||||||
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(RadarRingOverlayResource.class);
|
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
|
.getHandler(RadarRingOverlayResource.class);
|
||||||
|
|
||||||
/** Number of segments in the circle */
|
/** Number of segments in the circle */
|
||||||
private static final int RANGE_CIRCLE_PTS = 360;
|
private static final int RANGE_CIRCLE_PTS = 360;
|
||||||
|
|
||||||
|
@ -206,8 +207,8 @@ public class RadarRingOverlayResource extends
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (VizException e1) {
|
} catch (VizException e1) {
|
||||||
statusHandler.handle(Priority.ERROR,
|
statusHandler.handle(Priority.ERROR, "Could not draw radar rings",
|
||||||
"Could not draw radar rings", e1);
|
e1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,8 +46,8 @@ import org.eclipse.swt.widgets.MessageBox;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.swt.widgets.ToolBar;
|
import org.eclipse.swt.widgets.ToolBar;
|
||||||
import org.eclipse.swt.widgets.ToolItem;
|
import org.eclipse.swt.widgets.ToolItem;
|
||||||
|
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||||
|
|
||||||
import com.raytheon.viz.hydrocommon.Activator;
|
|
||||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -61,6 +61,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* Sep 18, 2009 2772 mpduff Fixed NullPointer when opening in Read only.
|
* Sep 18, 2009 2772 mpduff Fixed NullPointer when opening in Read only.
|
||||||
* Jul 15, 2013 2088 rferrel Changes for non-blocking FindReplaceDlg.
|
* Jul 15, 2013 2088 rferrel Changes for non-blocking FindReplaceDlg.
|
||||||
* Make dialog non-blocking.
|
* Make dialog non-blocking.
|
||||||
|
* May 27, 2014 3133 njensen Removed references to Activator
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -69,6 +70,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
*/
|
*/
|
||||||
public class TextEditorDlg extends CaveSWTDialog {
|
public class TextEditorDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
|
private static final String PLUGIN = "com.raytheon.viz.hydrocommon";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Control font.
|
* Control font.
|
||||||
*/
|
*/
|
||||||
|
@ -849,36 +852,36 @@ public class TextEditorDlg extends CaveSWTDialog {
|
||||||
private void getImages() {
|
private void getImages() {
|
||||||
ImageDescriptor id;
|
ImageDescriptor id;
|
||||||
|
|
||||||
id = Activator.imageDescriptorFromPlugin(
|
id = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN,
|
||||||
"com.raytheon.viz.hydrocommon", "icons/media-floppy.png");
|
"icons/media-floppy.png");
|
||||||
saveImage = id.createImage();
|
saveImage = id.createImage();
|
||||||
|
|
||||||
id = Activator.imageDescriptorFromPlugin(
|
id = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN,
|
||||||
"com.raytheon.viz.hydrocommon", "icons/edit-cut.png");
|
"icons/edit-cut.png");
|
||||||
cutImage = id.createImage();
|
cutImage = id.createImage();
|
||||||
|
|
||||||
id = Activator.imageDescriptorFromPlugin(
|
id = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN,
|
||||||
"com.raytheon.viz.hydrocommon", "icons/edit-copy.png");
|
"icons/edit-copy.png");
|
||||||
copyImage = id.createImage();
|
copyImage = id.createImage();
|
||||||
|
|
||||||
id = Activator.imageDescriptorFromPlugin(
|
id = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN,
|
||||||
"com.raytheon.viz.hydrocommon", "icons/edit-paste.png");
|
"icons/edit-paste.png");
|
||||||
pasteImage = id.createImage();
|
pasteImage = id.createImage();
|
||||||
|
|
||||||
id = Activator.imageDescriptorFromPlugin(
|
id = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN,
|
||||||
"com.raytheon.viz.hydrocommon", "icons/edit-find-replace.png");
|
"icons/edit-find-replace.png");
|
||||||
findReplaceImage = id.createImage();
|
findReplaceImage = id.createImage();
|
||||||
|
|
||||||
id = Activator.imageDescriptorFromPlugin(
|
id = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN,
|
||||||
"com.raytheon.viz.hydrocommon", "icons/edit-select-all.png");
|
"icons/edit-select-all.png");
|
||||||
selectAllImage = id.createImage();
|
selectAllImage = id.createImage();
|
||||||
|
|
||||||
id = Activator.imageDescriptorFromPlugin(
|
id = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN,
|
||||||
"com.raytheon.viz.hydrocommon", "icons/edit-undo.png");
|
"icons/edit-undo.png");
|
||||||
undoImage = id.createImage();
|
undoImage = id.createImage();
|
||||||
|
|
||||||
id = Activator.imageDescriptorFromPlugin(
|
id = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN,
|
||||||
"com.raytheon.viz.hydrocommon", "icons/edit-redo.png");
|
"icons/edit-redo.png");
|
||||||
redoImage = id.createImage();
|
redoImage = id.createImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
**/
|
**/
|
||||||
package com.raytheon.viz.hydrocommon.whfslib;
|
package com.raytheon.viz.hydrocommon.whfslib;
|
||||||
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
@ -28,33 +27,28 @@ import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
import com.raytheon.uf.common.dataplugin.shef.tables.Dailypp;
|
import com.raytheon.uf.common.dataplugin.persist.PersistableDataObject;
|
||||||
import com.raytheon.uf.common.dataplugin.shef.tables.DailyppId;
|
|
||||||
import com.raytheon.uf.common.dataplugin.shef.tables.Hourlypc;
|
import com.raytheon.uf.common.dataplugin.shef.tables.Hourlypc;
|
||||||
import com.raytheon.uf.common.dataplugin.shef.tables.HourlypcId;
|
import com.raytheon.uf.common.dataplugin.shef.tables.HourlypcId;
|
||||||
import com.raytheon.uf.common.dataplugin.shef.tables.Hourlypp;
|
import com.raytheon.uf.common.dataplugin.shef.tables.Hourlypp;
|
||||||
import com.raytheon.uf.common.dataplugin.shef.tables.HourlyppId;
|
import com.raytheon.uf.common.dataplugin.shef.tables.HourlyppId;
|
||||||
import com.raytheon.uf.common.dataplugin.shef.tables.IHourlyTS;
|
import com.raytheon.uf.common.dataplugin.shef.tables.IHourlyTS;
|
||||||
import com.raytheon.uf.common.dataplugin.persist.PersistableDataObject;
|
|
||||||
import com.raytheon.uf.common.dataplugin.shef.util.ShefQC;
|
|
||||||
import com.raytheon.uf.common.dataquery.db.QueryResult;
|
|
||||||
import com.raytheon.uf.edex.database.dao.CoreDao;
|
|
||||||
import com.raytheon.uf.edex.database.dao.DaoConfig;
|
|
||||||
import com.raytheon.uf.viz.core.catalog.DirectDbQuery;
|
import com.raytheon.uf.viz.core.catalog.DirectDbQuery;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
import com.raytheon.viz.hydrocommon.whfslib.GagePPOptions.shef_dup;
|
import com.raytheon.viz.hydrocommon.whfslib.GagePPOptions.shef_dup;
|
||||||
import com.raytheon.viz.hydrocommon.whfslib.GagePPOptions.upd_action;
|
import com.raytheon.viz.hydrocommon.whfslib.GagePPOptions.upd_action;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* TODO
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
*
|
*
|
||||||
* SOFTWARE HISTORY
|
* SOFTWARE HISTORY
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Nov 5, 2008 1649 snaples Initial creation
|
* Nov 05, 2008 1649 snaples Initial creation
|
||||||
* Aug 8, 2012 15271 snaples Updated hourly slot
|
* Aug 08, 2012 15271 snaples Updated hourly slot
|
||||||
|
* May 27, 2014 3133 njensen Removed dead code
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -68,8 +62,6 @@ public final class GagePPWrite {
|
||||||
|
|
||||||
private static Date datetime;
|
private static Date datetime;
|
||||||
|
|
||||||
private static final char manual_qc_code = 'M';
|
|
||||||
|
|
||||||
private static final float MISSING_PRECIP = -9999f;
|
private static final float MISSING_PRECIP = -9999f;
|
||||||
|
|
||||||
private static final int MINUTES_PER_HOUR = 60;
|
private static final int MINUTES_PER_HOUR = 60;
|
||||||
|
@ -134,7 +126,7 @@ public final class GagePPWrite {
|
||||||
int is_pc = 0;
|
int is_pc = 0;
|
||||||
int six = 0;
|
int six = 0;
|
||||||
Date dto = new Date(obsdate.getTime());
|
Date dto = new Date(obsdate.getTime());
|
||||||
|
|
||||||
Calendar dt = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
|
Calendar dt = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
|
||||||
dt.setTime(dto);
|
dt.setTime(dto);
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
@ -142,14 +134,14 @@ public final class GagePPWrite {
|
||||||
GagePPOptions opts = options;
|
GagePPOptions opts = options;
|
||||||
int hr = dt.get(Calendar.HOUR_OF_DAY);
|
int hr = dt.get(Calendar.HOUR_OF_DAY);
|
||||||
int min = dt.get(Calendar.MINUTE);
|
int min = dt.get(Calendar.MINUTE);
|
||||||
|
|
||||||
//
|
//
|
||||||
if (hr==0) {
|
if (hr == 0) {
|
||||||
hr=24;
|
hr = 24;
|
||||||
dt.add(Calendar.DAY_OF_MONTH, -1);
|
dt.add(Calendar.DAY_OF_MONTH, -1);
|
||||||
dto=dt.getTime();
|
dto = dt.getTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
String obstime = sdf.format(dto);
|
String obstime = sdf.format(dto);
|
||||||
|
|
||||||
char sixhroffset = get_offset_code(min);
|
char sixhroffset = get_offset_code(min);
|
||||||
|
@ -157,7 +149,7 @@ public final class GagePPWrite {
|
||||||
char minoff = sixhroffset;
|
char minoff = sixhroffset;
|
||||||
char qcc = sixhrqc;
|
char qcc = sixhrqc;
|
||||||
hourly_rec = null;
|
hourly_rec = null;
|
||||||
|
|
||||||
//
|
//
|
||||||
String where = "WHERE lid='" + id + "' AND ts='" + ts
|
String where = "WHERE lid='" + id + "' AND ts='" + ts
|
||||||
+ "' AND obsdate ='" + obstime + "'";
|
+ "' AND obsdate ='" + obstime + "'";
|
||||||
|
@ -190,8 +182,8 @@ public final class GagePPWrite {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hourly_rec == null) {
|
if (hourly_rec == null) {
|
||||||
setMinOffset(minute_offset, hr, minoff);
|
setMinOffset(minute_offset, hr, minoff);
|
||||||
setHourlyQC(hourly_qc, hr, qcc);
|
setHourlyQC(hourly_qc, hr, qcc);
|
||||||
sixhr_offset[six] = sixhroffset;
|
sixhr_offset[six] = sixhroffset;
|
||||||
sixhr_qc[six] = sixhrqc;
|
sixhr_qc[six] = sixhrqc;
|
||||||
|
|
||||||
|
@ -253,11 +245,11 @@ public final class GagePPWrite {
|
||||||
}
|
}
|
||||||
old_offset = hourly_rec.getMinuteOffset().toCharArray();
|
old_offset = hourly_rec.getMinuteOffset().toCharArray();
|
||||||
int slot = getOffset(old_offset, hr);
|
int slot = getOffset(old_offset, hr);
|
||||||
slot=hr-1;
|
slot = hr - 1;
|
||||||
prev_offset = old_offset[slot];
|
prev_offset = old_offset[slot];
|
||||||
old_qc = hourly_rec.getHourlyQc().toCharArray();
|
old_qc = hourly_rec.getHourlyQc().toCharArray();
|
||||||
int qcslot = getOffset(old_qc, hr);
|
int qcslot = getOffset(old_qc, hr);
|
||||||
qcslot=hr-1;
|
qcslot = hr - 1;
|
||||||
prev_qc = old_qc[qcslot];
|
prev_qc = old_qc[qcslot];
|
||||||
|
|
||||||
int use_value = 1;
|
int use_value = 1;
|
||||||
|
@ -383,94 +375,6 @@ public final class GagePPWrite {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int gage_pp_write_daily_rec(Dailypp pDailyPP,
|
|
||||||
GagePPOptions pOptions, String obsdate, boolean rev_24hour_code,
|
|
||||||
long quality_code) {
|
|
||||||
|
|
||||||
int status = 0;
|
|
||||||
boolean record_exists;
|
|
||||||
Date dto = null;
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
||||||
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
|
|
||||||
try {
|
|
||||||
dto = sdf.parse(obsdate);
|
|
||||||
} catch (ParseException e) {
|
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
Calendar dt = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
|
|
||||||
dt.setTime(dto);
|
|
||||||
dt.set(Calendar.HOUR_OF_DAY, 0);
|
|
||||||
dt.set(Calendar.MINUTE, 0);
|
|
||||||
dt.set(Calendar.SECOND, 0);
|
|
||||||
Date starttime = dt.getTime();
|
|
||||||
dt.add(Calendar.DATE, +1);
|
|
||||||
Date endtime = dt.getTime();
|
|
||||||
String where = null;
|
|
||||||
String update_action;
|
|
||||||
String qcsym = ShefQC.buildQcSymbol(quality_code);
|
|
||||||
String id = pDailyPP.getId().getLid();
|
|
||||||
String ts = pDailyPP.getId().getTs();
|
|
||||||
pDailyPP.setQc(qcsym);
|
|
||||||
DailyppId pid = new DailyppId();
|
|
||||||
pid.setLid(id);
|
|
||||||
pid.setObstime(dto);
|
|
||||||
pid.setTs(ts);
|
|
||||||
pDailyPP.setId(pid);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This routine writes a record out to the DailyPP table. It tests the
|
|
||||||
* shef_duplicate token to determine how it should handle duplicate
|
|
||||||
* reports and revisions.
|
|
||||||
*/
|
|
||||||
update_action = determine_update_action(pOptions.shef_duplicate.name(),
|
|
||||||
rev_24hour_code);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The possible update actions are: DONT_UPDATE_ACTION, UPDATE_ACTION,
|
|
||||||
* IF_DIFFERENT_UPDATE_ACTION
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Check if there is already a record in the DailyPP table for this
|
|
||||||
* record.
|
|
||||||
*/
|
|
||||||
/* Construct the where clause. */
|
|
||||||
where = ("WHERE lid='" + id + "' and ts='" + ts + "' and obstime >='"
|
|
||||||
+ starttime + "' and obstime <='" + endtime + "'");
|
|
||||||
ArrayList<Dailypp> pRecord = GetDailyPP(where);
|
|
||||||
Dailypp daily_rec = null;
|
|
||||||
|
|
||||||
if (pRecord.size() >= 1) {
|
|
||||||
record_exists = true;
|
|
||||||
daily_rec = pRecord.get(0);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
record_exists = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((record_exists == false)
|
|
||||||
|| (update_action == upd_action.UPDATE_ACTION.name())) {
|
|
||||||
/* Perform a Insert or Update. */
|
|
||||||
update_gage_rec(pDailyPP);
|
|
||||||
} else {
|
|
||||||
/* The record exists and update action is not UPDATE_ACTION */
|
|
||||||
if (update_action == upd_action.IF_DIFFERENT_UPDATE_ACTION.name()) {
|
|
||||||
/*
|
|
||||||
* Check if the new value is different from the value which
|
|
||||||
* already exists in the database.
|
|
||||||
*/
|
|
||||||
if (daily_rec.getValue() != pDailyPP.getValue()) {
|
|
||||||
/* Update the record. */
|
|
||||||
update_gage_rec(pDailyPP);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a new hour slot based on current data. This is used to insert or
|
* Returns a new hour slot based on current data. This is used to insert or
|
||||||
* update an existing Hourlypp record.
|
* update an existing Hourlypp record.
|
||||||
|
@ -498,10 +402,10 @@ public final class GagePPWrite {
|
||||||
Arrays.fill(sixhr_qc, '-');
|
Arrays.fill(sixhr_qc, '-');
|
||||||
Arrays.fill(sixhr_offset, '-');
|
Arrays.fill(sixhr_offset, '-');
|
||||||
|
|
||||||
// if (hour_slot == 0) {
|
// if (hour_slot == 0) {
|
||||||
// hour_slot = 24;
|
// hour_slot = 24;
|
||||||
// dt.add(Calendar.HOUR_OF_DAY, -1);
|
// dt.add(Calendar.HOUR_OF_DAY, -1);
|
||||||
// }
|
// }
|
||||||
minute_offset[hour_slot] = zero_offset_code;
|
minute_offset[hour_slot] = zero_offset_code;
|
||||||
hourly_qc[hour_slot] = manual_qc_code;
|
hourly_qc[hour_slot] = manual_qc_code;
|
||||||
set_hour_slot_value(hourly_rec, hour_slot, new_hourly_value);
|
set_hour_slot_value(hourly_rec, hour_slot, new_hourly_value);
|
||||||
|
@ -529,33 +433,34 @@ public final class GagePPWrite {
|
||||||
* @param hour
|
* @param hour
|
||||||
* @param value
|
* @param value
|
||||||
*/
|
*/
|
||||||
public static final void setMinOffset(char [] minOffset, int hour, char value) {
|
public static final void setMinOffset(char[] minOffset, int hour, char value) {
|
||||||
if(hour == 0) {
|
if (hour == 0) {
|
||||||
hour = 23;
|
hour = 23;
|
||||||
} else {
|
} else {
|
||||||
hour--;
|
hour--;
|
||||||
}
|
}
|
||||||
minOffset[hour] = value;
|
minOffset[hour] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the correct offset slot in array based on hour
|
// get the correct offset slot in array based on hour
|
||||||
public static final int getOffset(char[] minOffset, int hour){
|
public static final int getOffset(char[] minOffset, int hour) {
|
||||||
int slot = 0;
|
int slot = 0;
|
||||||
if(hour == 0){
|
if (hour == 0) {
|
||||||
slot = 23;
|
slot = 23;
|
||||||
}else {
|
} else {
|
||||||
slot = hour--;
|
slot = hour--;
|
||||||
}
|
}
|
||||||
return slot;
|
return slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param qc
|
* @param qc
|
||||||
* @param hour
|
* @param hour
|
||||||
* @param value
|
* @param value
|
||||||
*/
|
*/
|
||||||
public static final void setHourlyQC(char [] qc, int hour, char value) {
|
public static final void setHourlyQC(char[] qc, int hour, char value) {
|
||||||
if(hour == 0) {
|
if (hour == 0) {
|
||||||
hour = 23;
|
hour = 23;
|
||||||
} else {
|
} else {
|
||||||
hour--;
|
hour--;
|
||||||
|
@ -751,8 +656,7 @@ public final class GagePPWrite {
|
||||||
&& shefrec_rev == 1) {
|
&& shefrec_rev == 1) {
|
||||||
up_action = upd_action.UPDATE_ACTION.name();
|
up_action = upd_action.UPDATE_ACTION.name();
|
||||||
} else if (options_duplicate == shef_dup.IF_DIFFERENT_AND_REVCODE
|
} else if (options_duplicate == shef_dup.IF_DIFFERENT_AND_REVCODE
|
||||||
.name()
|
.name() && shefrec_rev == 1) {
|
||||||
&& shefrec_rev == 1) {
|
|
||||||
up_action = upd_action.IF_DIFFERENT_UPDATE_ACTION.name();
|
up_action = upd_action.IF_DIFFERENT_UPDATE_ACTION.name();
|
||||||
} else if (options_duplicate != shef_dup.IF_DIFFERENT_AND_REVCODE
|
} else if (options_duplicate != shef_dup.IF_DIFFERENT_AND_REVCODE
|
||||||
.name()) {
|
.name()) {
|
||||||
|
@ -1101,33 +1005,10 @@ public final class GagePPWrite {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
precip_value = new Short((short) MISSING_PRECIP);
|
precip_value = new Short((short) MISSING_PRECIP);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return precip_value;
|
return precip_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ArrayList<Dailypp> GetDailyPP(String where) {
|
|
||||||
StringBuilder query = new StringBuilder("FROM ");
|
|
||||||
query.append(Dailypp.class.getName());
|
|
||||||
query.append(" ");
|
|
||||||
query.append(where);
|
|
||||||
|
|
||||||
ArrayList<Dailypp> retVal = new ArrayList<Dailypp>();
|
|
||||||
CoreDao dao = new CoreDao(DaoConfig.forDatabase("ihfs"));
|
|
||||||
QueryResult qu = dao.executeHQLQuery(query.toString());
|
|
||||||
List<Object[]> results = new ArrayList<Object[]>();
|
|
||||||
Object[] obj = new Object[qu.getColumnCount()];
|
|
||||||
for (int i = 0; i < qu.getResultCount(); i++) {
|
|
||||||
obj[0] = (qu.getRowColumnValue(i, 0));
|
|
||||||
results.add(obj);
|
|
||||||
}
|
|
||||||
retVal.ensureCapacity(results.size());
|
|
||||||
for (Object[] item : results) {
|
|
||||||
retVal.add((Dailypp) item[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return retVal;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,9 +31,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
import com.raytheon.uf.viz.core.catalog.DirectDbQuery;
|
import com.raytheon.uf.viz.core.catalog.DirectDbQuery;
|
||||||
import com.raytheon.uf.viz.core.catalog.DirectDbQuery.QueryLanguage;
|
import com.raytheon.uf.viz.core.catalog.DirectDbQuery.QueryLanguage;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
import com.raytheon.viz.hydrocommon.Activator;
|
|
||||||
import com.raytheon.viz.hydrocommon.HydroDisplayManager;
|
import com.raytheon.viz.hydrocommon.HydroDisplayManager;
|
||||||
import com.raytheon.viz.hydrocommon.constants.StatusConstants;
|
|
||||||
import com.raytheon.viz.hydrocommon.util.MPEColors;
|
import com.raytheon.viz.hydrocommon.util.MPEColors;
|
||||||
import com.raytheon.viz.hydrocommon.whfslib.IHFSDbGenerated;
|
import com.raytheon.viz.hydrocommon.whfslib.IHFSDbGenerated;
|
||||||
|
|
||||||
|
@ -45,6 +43,8 @@ import com.raytheon.viz.hydrocommon.whfslib.IHFSDbGenerated;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Nov 10, 2008 randerso Initial creation
|
* Nov 10, 2008 randerso Initial creation
|
||||||
|
* May 27, 2014 3133 njensen Organized imports, fixed == to equals
|
||||||
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author randerso
|
* @author randerso
|
||||||
|
@ -52,7 +52,8 @@ import com.raytheon.viz.hydrocommon.whfslib.IHFSDbGenerated;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class GetColorValues {
|
public class GetColorValues {
|
||||||
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(GetColorValues.class);
|
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
|
.getHandler(GetColorValues.class);
|
||||||
|
|
||||||
/** Return value if no close duration found */
|
/** Return value if no close duration found */
|
||||||
public static final int NO_DURATION_FOUND = -1;
|
public static final int NO_DURATION_FOUND = -1;
|
||||||
|
@ -130,14 +131,15 @@ public class GetColorValues {
|
||||||
+ "Metric\n"));
|
+ "Metric\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
//get color values from default setting in xml file.
|
// get color values from default setting in xml file.
|
||||||
if (application_name=="hydroview" && coloruse_name=="HEIGHT" ) {
|
if ("hydroview".equals(application_name)
|
||||||
cvHead = getDefaultColorSet(application_name, coloruse_name,
|
&& "HEIGHT".equals(coloruse_name)) {
|
||||||
threshold_unit);
|
cvHead = getDefaultColorSet(application_name, coloruse_name,
|
||||||
|
threshold_unit);
|
||||||
} else {
|
} else {
|
||||||
// Try to find a user defined color set.
|
// Try to find a user defined color set.
|
||||||
cvHead = getUserColorSet(user_id, application_name, coloruse_name,
|
cvHead = getUserColorSet(user_id, application_name, coloruse_name,
|
||||||
duration, threshold_unit);
|
duration, threshold_unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cvHead == null) {
|
if (cvHead == null) {
|
||||||
|
@ -150,17 +152,13 @@ public class GetColorValues {
|
||||||
|
|
||||||
// Try to find a default color set.
|
// Try to find a default color set.
|
||||||
cvHead = getDefaultColorSet(application_name, coloruse_name,
|
cvHead = getDefaultColorSet(application_name, coloruse_name,
|
||||||
threshold_unit);//, pColorSetGroup);
|
threshold_unit);// , pColorSetGroup);
|
||||||
|
|
||||||
if ((cvHead == null) || (cvHead.size() == 0)) {
|
if ((cvHead == null) || (cvHead.size() == 0)) {
|
||||||
statusHandler.handle(
|
statusHandler.handle(Priority.PROBLEM, "ERROR in " + method
|
||||||
Priority.PROBLEM,
|
+ " Colors/levels not defined for application "
|
||||||
"ERROR in "
|
+ application_name + " use_name = " + coloruse_name
|
||||||
+ method
|
+ " logname = user_id");
|
||||||
+ " Colors/levels not defined for application "
|
|
||||||
+ application_name + " use_name = "
|
|
||||||
+ coloruse_name
|
|
||||||
+ " logname = user_id");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -200,7 +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 && duration == closest_duration) {
|
if (closest_duration != NO_DURATION_FOUND
|
||||||
|
&& 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);
|
||||||
}
|
}
|
||||||
|
@ -225,15 +224,17 @@ public class GetColorValues {
|
||||||
*/
|
*/
|
||||||
private static List<Colorvalue> getDefaultColorSet(
|
private static List<Colorvalue> getDefaultColorSet(
|
||||||
final String application_name, final String coloruse_name,
|
final String application_name, final String coloruse_name,
|
||||||
String threshold_unit) {//, final List<NamedColorUseSet> pColorSetGroup) {
|
String threshold_unit) {// , final List<NamedColorUseSet>
|
||||||
|
// pColorSetGroup) {
|
||||||
|
|
||||||
List<NamedColorUseSet> pColorSetGroup = null;
|
List<NamedColorUseSet> pColorSetGroup = null;
|
||||||
if (application_name.equals("hmapmpe")) {
|
if (application_name.equals("hmapmpe")) {
|
||||||
pColorSetGroup = MPEColors.build_mpe_colors();
|
pColorSetGroup = MPEColors.build_mpe_colors();
|
||||||
} else {
|
} else {
|
||||||
pColorSetGroup = HydroDisplayManager.getInstance().getDefaultNamedColorUseSetList();
|
pColorSetGroup = HydroDisplayManager.getInstance()
|
||||||
|
.getDefaultNamedColorUseSetList();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loop over the default colors provided by the user.
|
// Loop over the default colors provided by the user.
|
||||||
// Look for the specified color use name.
|
// Look for the specified color use name.
|
||||||
if (pColorSetGroup == null) {
|
if (pColorSetGroup == null) {
|
||||||
|
@ -253,8 +254,8 @@ public class GetColorValues {
|
||||||
Colorvalue cvNode = new Colorvalue(new ColorvalueId(
|
Colorvalue cvNode = new Colorvalue(new ColorvalueId(
|
||||||
"default", application_name, coloruse_name,
|
"default", application_name, coloruse_name,
|
||||||
pColorSet.default_duration, threshold.getValue(),
|
pColorSet.default_duration, threshold.getValue(),
|
||||||
threshold_unit), new Colorname(threshold
|
threshold_unit), new Colorname(
|
||||||
.getColorName()));
|
threshold.getColorName()));
|
||||||
cvList.add(cvNode);
|
cvList.add(cvNode);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -362,7 +363,7 @@ public class GetColorValues {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Free the memory used for the linked list of distinct durations.
|
// Free the memory used for the linked list of distinct durations.
|
||||||
//
|
//
|
||||||
if (results != null) {
|
if (results != null) {
|
||||||
results.clear();
|
results.clear();
|
||||||
results = null;
|
results = null;
|
||||||
|
|
|
@ -30,8 +30,6 @@ import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||||
import com.raytheon.viz.hydrocommon.Activator;
|
|
||||||
import com.raytheon.viz.hydrocommon.constants.StatusConstants;
|
|
||||||
import com.raytheon.viz.hydrocommon.radaroverlay.RadarRingOverlayData;
|
import com.raytheon.viz.hydrocommon.radaroverlay.RadarRingOverlayData;
|
||||||
import com.raytheon.viz.hydrocommon.resource.RadarRingOverlayResource;
|
import com.raytheon.viz.hydrocommon.resource.RadarRingOverlayResource;
|
||||||
import com.raytheon.viz.hydrocommon.resource.RadarRingOverlayResourceData;
|
import com.raytheon.viz.hydrocommon.resource.RadarRingOverlayResourceData;
|
||||||
|
@ -47,7 +45,8 @@ import com.raytheon.viz.mpe.ui.MPEDisplayManager;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Jan 22, 2010 4356 mpduff Initial creation.
|
* Jan 22, 2010 4356 mpduff Initial creation.
|
||||||
* Apr 4, 2011 8934 mnash Fix memory leaks, added timer to retrieve data
|
* Apr 04, 2011 8934 mnash Fix memory leaks, added timer to retrieve data
|
||||||
|
* May 27, 2014 3133 njensen Organized imports
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author mpduff
|
* @author mpduff
|
||||||
|
@ -55,7 +54,9 @@ import com.raytheon.viz.mpe.ui.MPEDisplayManager;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class MPERadarRingOverlayResource extends RadarRingOverlayResource {
|
public class MPERadarRingOverlayResource extends RadarRingOverlayResource {
|
||||||
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(MPERadarRingOverlayResource.class);
|
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
|
.getHandler(MPERadarRingOverlayResource.class);
|
||||||
|
|
||||||
// utilizes the RadarRingOverlayResource, except adds an extra color and
|
// utilizes the RadarRingOverlayResource, except adds an extra color and
|
||||||
// also adds an extra query
|
// also adds an extra query
|
||||||
private final RGB RED = new RGB(255, 0, 0);
|
private final RGB RED = new RGB(255, 0, 0);
|
||||||
|
@ -87,7 +88,8 @@ public class MPERadarRingOverlayResource extends RadarRingOverlayResource {
|
||||||
MPEDisplayManager displayManager = MPEDisplayManager
|
MPEDisplayManager displayManager = MPEDisplayManager
|
||||||
.getCurrent();
|
.getCurrent();
|
||||||
if (displayManager != null) {
|
if (displayManager != null) {
|
||||||
Date displayDate = displayManager.getCurrentEditDate();
|
Date displayDate = displayManager
|
||||||
|
.getCurrentEditDate();
|
||||||
for (RadarRingOverlayData rdata : dataMap.values()) {
|
for (RadarRingOverlayData rdata : dataMap.values()) {
|
||||||
dao.getRadarAvailable(rdata, displayDate);
|
dao.getRadarAvailable(rdata, displayDate);
|
||||||
if (rdata.isRadAvail()) {
|
if (rdata.isRadAvail()) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue