Merge "Omaha #3133 Removed dead hydro code and related dependencies" into omaha_14.4.1
Former-commit-id:e53ec8ab82
[formerly719c53a044
] [formerly905fa8f283
] [formerlye7dc89cddd
[formerly905fa8f283
[formerly 55cf25f0671f17e667f7c785f3580a93267f8790]]] Former-commit-id:e7dc89cddd
Former-commit-id: 438dc2f8d1d87ff82e08c3c62233bc895b389264 [formerly05b1401849
] Former-commit-id:3f434ea6e9
This commit is contained in:
commit
f0e019a24e
7 changed files with 104 additions and 293 deletions
|
@ -2,28 +2,20 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Hydrocommon Plug-in
|
||||
Bundle-SymbolicName: com.raytheon.viz.hydrocommon;singleton:=true
|
||||
Bundle-Version: 1.12.1174.qualifier
|
||||
Bundle-Activator: com.raytheon.viz.hydrocommon.Activator
|
||||
Bundle-Version: 1.14.0.qualifier
|
||||
Bundle-Vendor: Raytheon
|
||||
Eclipse-RegisterBuddy: com.raytheon.viz.core, com.raytheon.uf.viz.core
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
org.eclipse.core.runtime,
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
||||
Require-Bundle: org.eclipse.core.runtime,
|
||||
com.raytheon.viz.core,
|
||||
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.colormap;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.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
|
||||
Export-Package: com.raytheon.viz.hydrocommon,
|
||||
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.LoadProperties;
|
||||
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.RadarRingOverlayData;
|
||||
|
||||
|
@ -61,7 +59,8 @@ import com.raytheon.viz.hydrocommon.radaroverlay.RadarRingOverlayData;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 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>
|
||||
*
|
||||
|
@ -71,7 +70,9 @@ import com.raytheon.viz.hydrocommon.radaroverlay.RadarRingOverlayData;
|
|||
|
||||
public class RadarRingOverlayResource extends
|
||||
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 */
|
||||
private static final int RANGE_CIRCLE_PTS = 360;
|
||||
|
||||
|
@ -206,8 +207,8 @@ public class RadarRingOverlayResource extends
|
|||
}
|
||||
}
|
||||
} catch (VizException e1) {
|
||||
statusHandler.handle(Priority.ERROR,
|
||||
"Could not draw radar rings", e1);
|
||||
statusHandler.handle(Priority.ERROR, "Could not draw radar rings",
|
||||
e1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,8 +46,8 @@ import org.eclipse.swt.widgets.MessageBox;
|
|||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.swt.widgets.ToolBar;
|
||||
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;
|
||||
|
||||
/**
|
||||
|
@ -61,6 +61,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* Sep 18, 2009 2772 mpduff Fixed NullPointer when opening in Read only.
|
||||
* Jul 15, 2013 2088 rferrel Changes for non-blocking FindReplaceDlg.
|
||||
* Make dialog non-blocking.
|
||||
* May 27, 2014 3133 njensen Removed references to Activator
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -69,6 +70,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
*/
|
||||
public class TextEditorDlg extends CaveSWTDialog {
|
||||
|
||||
private static final String PLUGIN = "com.raytheon.viz.hydrocommon";
|
||||
|
||||
/**
|
||||
* Control font.
|
||||
*/
|
||||
|
@ -849,36 +852,36 @@ public class TextEditorDlg extends CaveSWTDialog {
|
|||
private void getImages() {
|
||||
ImageDescriptor id;
|
||||
|
||||
id = Activator.imageDescriptorFromPlugin(
|
||||
"com.raytheon.viz.hydrocommon", "icons/media-floppy.png");
|
||||
id = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN,
|
||||
"icons/media-floppy.png");
|
||||
saveImage = id.createImage();
|
||||
|
||||
id = Activator.imageDescriptorFromPlugin(
|
||||
"com.raytheon.viz.hydrocommon", "icons/edit-cut.png");
|
||||
id = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN,
|
||||
"icons/edit-cut.png");
|
||||
cutImage = id.createImage();
|
||||
|
||||
id = Activator.imageDescriptorFromPlugin(
|
||||
"com.raytheon.viz.hydrocommon", "icons/edit-copy.png");
|
||||
id = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN,
|
||||
"icons/edit-copy.png");
|
||||
copyImage = id.createImage();
|
||||
|
||||
id = Activator.imageDescriptorFromPlugin(
|
||||
"com.raytheon.viz.hydrocommon", "icons/edit-paste.png");
|
||||
id = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN,
|
||||
"icons/edit-paste.png");
|
||||
pasteImage = id.createImage();
|
||||
|
||||
id = Activator.imageDescriptorFromPlugin(
|
||||
"com.raytheon.viz.hydrocommon", "icons/edit-find-replace.png");
|
||||
id = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN,
|
||||
"icons/edit-find-replace.png");
|
||||
findReplaceImage = id.createImage();
|
||||
|
||||
id = Activator.imageDescriptorFromPlugin(
|
||||
"com.raytheon.viz.hydrocommon", "icons/edit-select-all.png");
|
||||
id = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN,
|
||||
"icons/edit-select-all.png");
|
||||
selectAllImage = id.createImage();
|
||||
|
||||
id = Activator.imageDescriptorFromPlugin(
|
||||
"com.raytheon.viz.hydrocommon", "icons/edit-undo.png");
|
||||
id = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN,
|
||||
"icons/edit-undo.png");
|
||||
undoImage = id.createImage();
|
||||
|
||||
id = Activator.imageDescriptorFromPlugin(
|
||||
"com.raytheon.viz.hydrocommon", "icons/edit-redo.png");
|
||||
id = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN,
|
||||
"icons/edit-redo.png");
|
||||
redoImage = id.createImage();
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
**/
|
||||
package com.raytheon.viz.hydrocommon.whfslib;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
@ -28,33 +27,28 @@ import java.util.Date;
|
|||
import java.util.List;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.shef.tables.Dailypp;
|
||||
import com.raytheon.uf.common.dataplugin.shef.tables.DailyppId;
|
||||
import com.raytheon.uf.common.dataplugin.persist.PersistableDataObject;
|
||||
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.Hourlypp;
|
||||
import com.raytheon.uf.common.dataplugin.shef.tables.HourlyppId;
|
||||
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.exception.VizException;
|
||||
import com.raytheon.viz.hydrocommon.whfslib.GagePPOptions.shef_dup;
|
||||
import com.raytheon.viz.hydrocommon.whfslib.GagePPOptions.upd_action;
|
||||
|
||||
/**
|
||||
*
|
||||
* TODO
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 5, 2008 1649 snaples Initial creation
|
||||
* Aug 8, 2012 15271 snaples Updated hourly slot
|
||||
* Nov 05, 2008 1649 snaples Initial creation
|
||||
* Aug 08, 2012 15271 snaples Updated hourly slot
|
||||
* May 27, 2014 3133 njensen Removed dead code
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -68,8 +62,6 @@ public final class GagePPWrite {
|
|||
|
||||
private static Date datetime;
|
||||
|
||||
private static final char manual_qc_code = 'M';
|
||||
|
||||
private static final float MISSING_PRECIP = -9999f;
|
||||
|
||||
private static final int MINUTES_PER_HOUR = 60;
|
||||
|
@ -134,7 +126,7 @@ public final class GagePPWrite {
|
|||
int is_pc = 0;
|
||||
int six = 0;
|
||||
Date dto = new Date(obsdate.getTime());
|
||||
|
||||
|
||||
Calendar dt = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
|
||||
dt.setTime(dto);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
@ -142,14 +134,14 @@ public final class GagePPWrite {
|
|||
GagePPOptions opts = options;
|
||||
int hr = dt.get(Calendar.HOUR_OF_DAY);
|
||||
int min = dt.get(Calendar.MINUTE);
|
||||
|
||||
|
||||
//
|
||||
if (hr==0) {
|
||||
hr=24;
|
||||
dt.add(Calendar.DAY_OF_MONTH, -1);
|
||||
dto=dt.getTime();
|
||||
if (hr == 0) {
|
||||
hr = 24;
|
||||
dt.add(Calendar.DAY_OF_MONTH, -1);
|
||||
dto = dt.getTime();
|
||||
}
|
||||
|
||||
|
||||
String obstime = sdf.format(dto);
|
||||
|
||||
char sixhroffset = get_offset_code(min);
|
||||
|
@ -157,7 +149,7 @@ public final class GagePPWrite {
|
|||
char minoff = sixhroffset;
|
||||
char qcc = sixhrqc;
|
||||
hourly_rec = null;
|
||||
|
||||
|
||||
//
|
||||
String where = "WHERE lid='" + id + "' AND ts='" + ts
|
||||
+ "' AND obsdate ='" + obstime + "'";
|
||||
|
@ -190,8 +182,8 @@ public final class GagePPWrite {
|
|||
}
|
||||
|
||||
if (hourly_rec == null) {
|
||||
setMinOffset(minute_offset, hr, minoff);
|
||||
setHourlyQC(hourly_qc, hr, qcc);
|
||||
setMinOffset(minute_offset, hr, minoff);
|
||||
setHourlyQC(hourly_qc, hr, qcc);
|
||||
sixhr_offset[six] = sixhroffset;
|
||||
sixhr_qc[six] = sixhrqc;
|
||||
|
||||
|
@ -253,11 +245,11 @@ public final class GagePPWrite {
|
|||
}
|
||||
old_offset = hourly_rec.getMinuteOffset().toCharArray();
|
||||
int slot = getOffset(old_offset, hr);
|
||||
slot=hr-1;
|
||||
slot = hr - 1;
|
||||
prev_offset = old_offset[slot];
|
||||
old_qc = hourly_rec.getHourlyQc().toCharArray();
|
||||
int qcslot = getOffset(old_qc, hr);
|
||||
qcslot=hr-1;
|
||||
qcslot = hr - 1;
|
||||
prev_qc = old_qc[qcslot];
|
||||
|
||||
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
|
||||
* update an existing Hourlypp record.
|
||||
|
@ -498,10 +402,10 @@ public final class GagePPWrite {
|
|||
Arrays.fill(sixhr_qc, '-');
|
||||
Arrays.fill(sixhr_offset, '-');
|
||||
|
||||
// if (hour_slot == 0) {
|
||||
// hour_slot = 24;
|
||||
// dt.add(Calendar.HOUR_OF_DAY, -1);
|
||||
// }
|
||||
// if (hour_slot == 0) {
|
||||
// hour_slot = 24;
|
||||
// dt.add(Calendar.HOUR_OF_DAY, -1);
|
||||
// }
|
||||
minute_offset[hour_slot] = zero_offset_code;
|
||||
hourly_qc[hour_slot] = manual_qc_code;
|
||||
set_hour_slot_value(hourly_rec, hour_slot, new_hourly_value);
|
||||
|
@ -529,33 +433,34 @@ public final class GagePPWrite {
|
|||
* @param hour
|
||||
* @param value
|
||||
*/
|
||||
public static final void setMinOffset(char [] minOffset, int hour, char value) {
|
||||
if(hour == 0) {
|
||||
public static final void setMinOffset(char[] minOffset, int hour, char value) {
|
||||
if (hour == 0) {
|
||||
hour = 23;
|
||||
} else {
|
||||
hour--;
|
||||
}
|
||||
minOffset[hour] = value;
|
||||
}
|
||||
|
||||
|
||||
// get the correct offset slot in array based on hour
|
||||
public static final int getOffset(char[] minOffset, int hour){
|
||||
int slot = 0;
|
||||
if(hour == 0){
|
||||
slot = 23;
|
||||
}else {
|
||||
slot = hour--;
|
||||
}
|
||||
return slot;
|
||||
public static final int getOffset(char[] minOffset, int hour) {
|
||||
int slot = 0;
|
||||
if (hour == 0) {
|
||||
slot = 23;
|
||||
} else {
|
||||
slot = hour--;
|
||||
}
|
||||
return slot;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param qc
|
||||
* @param hour
|
||||
* @param value
|
||||
*/
|
||||
public static final void setHourlyQC(char [] qc, int hour, char value) {
|
||||
if(hour == 0) {
|
||||
public static final void setHourlyQC(char[] qc, int hour, char value) {
|
||||
if (hour == 0) {
|
||||
hour = 23;
|
||||
} else {
|
||||
hour--;
|
||||
|
@ -751,8 +656,7 @@ public final class GagePPWrite {
|
|||
&& shefrec_rev == 1) {
|
||||
up_action = upd_action.UPDATE_ACTION.name();
|
||||
} else if (options_duplicate == shef_dup.IF_DIFFERENT_AND_REVCODE
|
||||
.name()
|
||||
&& shefrec_rev == 1) {
|
||||
.name() && shefrec_rev == 1) {
|
||||
up_action = upd_action.IF_DIFFERENT_UPDATE_ACTION.name();
|
||||
} else if (options_duplicate != shef_dup.IF_DIFFERENT_AND_REVCODE
|
||||
.name()) {
|
||||
|
@ -1101,33 +1005,10 @@ public final class GagePPWrite {
|
|||
break;
|
||||
|
||||
default:
|
||||
precip_value = new Short((short) MISSING_PRECIP);
|
||||
precip_value = new Short((short) MISSING_PRECIP);
|
||||
break;
|
||||
}
|
||||
|
||||
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.QueryLanguage;
|
||||
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.constants.StatusConstants;
|
||||
import com.raytheon.viz.hydrocommon.util.MPEColors;
|
||||
import com.raytheon.viz.hydrocommon.whfslib.IHFSDbGenerated;
|
||||
|
||||
|
@ -45,6 +43,8 @@ import com.raytheon.viz.hydrocommon.whfslib.IHFSDbGenerated;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 10, 2008 randerso Initial creation
|
||||
* May 27, 2014 3133 njensen Organized imports, fixed == to equals
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author randerso
|
||||
|
@ -52,7 +52,8 @@ import com.raytheon.viz.hydrocommon.whfslib.IHFSDbGenerated;
|
|||
*/
|
||||
|
||||
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 */
|
||||
public static final int NO_DURATION_FOUND = -1;
|
||||
|
@ -130,14 +131,15 @@ public class GetColorValues {
|
|||
+ "Metric\n"));
|
||||
}
|
||||
|
||||
//get color values from default setting in xml file.
|
||||
if (application_name=="hydroview" && coloruse_name=="HEIGHT" ) {
|
||||
cvHead = getDefaultColorSet(application_name, coloruse_name,
|
||||
threshold_unit);
|
||||
// get color values from default setting in xml file.
|
||||
if ("hydroview".equals(application_name)
|
||||
&& "HEIGHT".equals(coloruse_name)) {
|
||||
cvHead = getDefaultColorSet(application_name, coloruse_name,
|
||||
threshold_unit);
|
||||
} else {
|
||||
// Try to find a user defined color set.
|
||||
cvHead = getUserColorSet(user_id, application_name, coloruse_name,
|
||||
duration, threshold_unit);
|
||||
// Try to find a user defined color set.
|
||||
cvHead = getUserColorSet(user_id, application_name, coloruse_name,
|
||||
duration, threshold_unit);
|
||||
}
|
||||
|
||||
if (cvHead == null) {
|
||||
|
@ -150,17 +152,13 @@ public class GetColorValues {
|
|||
|
||||
// Try to find a default color set.
|
||||
cvHead = getDefaultColorSet(application_name, coloruse_name,
|
||||
threshold_unit);//, pColorSetGroup);
|
||||
threshold_unit);// , pColorSetGroup);
|
||||
|
||||
if ((cvHead == null) || (cvHead.size() == 0)) {
|
||||
statusHandler.handle(
|
||||
Priority.PROBLEM,
|
||||
"ERROR in "
|
||||
+ method
|
||||
+ " Colors/levels not defined for application "
|
||||
+ application_name + " use_name = "
|
||||
+ coloruse_name
|
||||
+ " logname = user_id");
|
||||
statusHandler.handle(Priority.PROBLEM, "ERROR in " + method
|
||||
+ " 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);
|
||||
|
||||
// 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,
|
||||
coloruse_name, closest_duration, threshold_unit);
|
||||
}
|
||||
|
@ -225,15 +224,17 @@ public class GetColorValues {
|
|||
*/
|
||||
private static List<Colorvalue> getDefaultColorSet(
|
||||
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;
|
||||
if (application_name.equals("hmapmpe")) {
|
||||
pColorSetGroup = MPEColors.build_mpe_colors();
|
||||
} else {
|
||||
pColorSetGroup = HydroDisplayManager.getInstance().getDefaultNamedColorUseSetList();
|
||||
pColorSetGroup = HydroDisplayManager.getInstance()
|
||||
.getDefaultNamedColorUseSetList();
|
||||
}
|
||||
|
||||
|
||||
// Loop over the default colors provided by the user.
|
||||
// Look for the specified color use name.
|
||||
if (pColorSetGroup == null) {
|
||||
|
@ -253,8 +254,8 @@ public class GetColorValues {
|
|||
Colorvalue cvNode = new Colorvalue(new ColorvalueId(
|
||||
"default", application_name, coloruse_name,
|
||||
pColorSet.default_duration, threshold.getValue(),
|
||||
threshold_unit), new Colorname(threshold
|
||||
.getColorName()));
|
||||
threshold_unit), new Colorname(
|
||||
threshold.getColorName()));
|
||||
cvList.add(cvNode);
|
||||
}
|
||||
break;
|
||||
|
@ -362,7 +363,7 @@ public class GetColorValues {
|
|||
}
|
||||
|
||||
// Free the memory used for the linked list of distinct durations.
|
||||
//
|
||||
//
|
||||
if (results != null) {
|
||||
results.clear();
|
||||
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.viz.core.exception.VizException;
|
||||
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.resource.RadarRingOverlayResource;
|
||||
import com.raytheon.viz.hydrocommon.resource.RadarRingOverlayResourceData;
|
||||
|
@ -47,7 +45,8 @@ import com.raytheon.viz.mpe.ui.MPEDisplayManager;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 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>
|
||||
*
|
||||
* @author mpduff
|
||||
|
@ -55,7 +54,9 @@ import com.raytheon.viz.mpe.ui.MPEDisplayManager;
|
|||
*/
|
||||
|
||||
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
|
||||
// also adds an extra query
|
||||
private final RGB RED = new RGB(255, 0, 0);
|
||||
|
@ -87,7 +88,8 @@ public class MPERadarRingOverlayResource extends RadarRingOverlayResource {
|
|||
MPEDisplayManager displayManager = MPEDisplayManager
|
||||
.getCurrent();
|
||||
if (displayManager != null) {
|
||||
Date displayDate = displayManager.getCurrentEditDate();
|
||||
Date displayDate = displayManager
|
||||
.getCurrentEditDate();
|
||||
for (RadarRingOverlayData rdata : dataMap.values()) {
|
||||
dao.getRadarAvailable(rdata, displayDate);
|
||||
if (rdata.isRadAvail()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue