Merge branch master_14.3.2 'OB_14.3.2-15m' into tcv_14.3.2
Change-Id: I798ce412136ee0f30123835338920a4607909e1d Former-commit-id: 70ac082595e5c9719807136ed2f2bebf61510016
This commit is contained in:
commit
3d882eed46
81 changed files with 2669 additions and 1975 deletions
|
@ -175,11 +175,11 @@
|
|||
|
||||
<ini-substitutions>
|
||||
<max-memory>
|
||||
<value>256M</value>
|
||||
<value>384M</value>
|
||||
</max-memory>
|
||||
|
||||
<max-perm>
|
||||
<value>64M</value>
|
||||
<value>96M</value>
|
||||
</max-perm>
|
||||
</ini-substitutions>
|
||||
</memory-setting>
|
||||
|
|
BIN
cave/build/static/win32.x86/cave/lib/zlib1.dll
Normal file
BIN
cave/build/static/win32.x86/cave/lib/zlib1.dll
Normal file
Binary file not shown.
|
@ -58,6 +58,7 @@ import com.vividsolutions.jts.geom.impl.PackedCoordinateSequenceFactory;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Aug 10, 2011 randerso Initial creation
|
||||
* Apr 17, 2014 #2997 randerso Moved buildBoundingGeometry up from DbMapResource
|
||||
* Jan 29, 2015 #4062 randerso Added a buffer to bounding Geometry
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -272,6 +273,10 @@ public abstract class AbstractDbMapResource<T extends AbstractDbMapResourceData,
|
|||
.handle(Priority.PROBLEM, e1.getLocalizedMessage(), e1);
|
||||
}
|
||||
|
||||
// Add just a little buffer to get past EnvelopeIntersection limiting
|
||||
// us to 179.99999 instead of going clear to 180
|
||||
g = g.buffer(0.0001);
|
||||
|
||||
// long t1 = System.currentTimeMillis();
|
||||
// System.out.println("buildBoundingGeometry took: " + (t1 - t0));
|
||||
return g;
|
||||
|
|
|
@ -65,6 +65,7 @@ import com.raytheon.viz.grid.rsc.general.D2DGridResource;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* May 5, 2014 3026 mpduff Initial creation
|
||||
* Dec 16, 2014 3026 mpduff Change location of text
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -121,7 +122,7 @@ public class HpeLabelResource extends
|
|||
.getResourcesByTypeAsType(D2DGridResource.class);
|
||||
if (!list.isEmpty()) {
|
||||
double[] pixel = paintProps.getView().getDisplayCoords(
|
||||
new double[] { 125, 50 }, target);
|
||||
new double[] { 125, 100 }, target);
|
||||
RGB color = getCapability(ColorableCapability.class).getColor();
|
||||
for (D2DGridResource rsc : list) {
|
||||
GridRecord currentGridRec = rsc.getCurrentGridRecord();
|
||||
|
|
|
@ -32,7 +32,8 @@ import com.raytheon.uf.common.dataplugin.grid.dataset.DatasetInfoLookup;
|
|||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* May 6, 2014 3026 mpduff Initial creation
|
||||
* May 6, 2014 3026 mpduff Initial creation.
|
||||
* Jan 6, 2015 3026 mpduff Added Bias HPE.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -43,6 +44,8 @@ import com.raytheon.uf.common.dataplugin.grid.dataset.DatasetInfoLookup;
|
|||
public class HpeUtils {
|
||||
private static final String HPE = "HPE";
|
||||
|
||||
private static final String BIAS_HPE = "BiasHPE";
|
||||
|
||||
/**
|
||||
* Determine if this title represents an HPE model.
|
||||
*
|
||||
|
@ -64,6 +67,7 @@ public class HpeUtils {
|
|||
if (title == null) {
|
||||
return false;
|
||||
}
|
||||
return HPE.equals(title);
|
||||
|
||||
return HPE.equals(title) || BIAS_HPE.equals(title);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -185,6 +185,7 @@ import com.vividsolutions.jts.geom.Point;
|
|||
* May 05, 2014 3026 mpduff Display Hpe bias source.
|
||||
* May 19, 2014 DR 16096 gzhang Make getBasin() protected for FFMPDataGenerator.
|
||||
* Nov 10, 2014 3026 dhladky HPE BIAS displays.
|
||||
* Dec 16, 2014 3026 mpduff Change location of text
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
|
@ -1466,7 +1467,7 @@ public class FFMPResource extends
|
|||
private void paintProductString(IGraphicsTarget target,
|
||||
PaintProperties paintProps) throws VizException {
|
||||
double[] pixel = paintProps.getView().getDisplayCoords(
|
||||
new double[] { 110, 50 }, target);
|
||||
new double[] { 110, 100 }, target);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (isAutoRefresh || isQuery) {
|
||||
sb.append("FFMP ").append(df.format(getTime())).append(" hour ")
|
||||
|
@ -3152,7 +3153,7 @@ public class FFMPResource extends
|
|||
boolean guid = false;
|
||||
Date oldestRefTime = getOldestTime();
|
||||
Date mostRecentRefTime = getPaintTime().getRefTime();
|
||||
|
||||
|
||||
Date barrierTime = getTableTime();// DR 16148
|
||||
Date minUriTime = getTimeOrderedKeys().get(0);// DR 16148
|
||||
|
||||
|
@ -3167,10 +3168,11 @@ public class FFMPResource extends
|
|||
|
||||
if (rateBasin != null) {
|
||||
for (Date date : rateBasin.getValues().keySet()) {
|
||||
|
||||
if (date.before(minUriTime) || date.before(barrierTime) || date.after(mostRecentRefTime))
|
||||
|
||||
if (date.before(minUriTime) || date.before(barrierTime)
|
||||
|| date.after(mostRecentRefTime))
|
||||
continue;// DR 16148
|
||||
|
||||
|
||||
double dtime = FFMPGuiUtils.getTimeDiff(mostRecentRefTime,
|
||||
date);
|
||||
fgd.setRate(dtime, (double) rateBasin.getValue(date));
|
||||
|
@ -3195,8 +3197,9 @@ public class FFMPResource extends
|
|||
if (qpeBasin != null) {
|
||||
|
||||
for (Date date : qpeBasin.getValues().keySet()) {
|
||||
|
||||
if (date.before(minUriTime) || date.before(barrierTime) || date.after(mostRecentRefTime))
|
||||
|
||||
if (date.before(minUriTime) || date.before(barrierTime)
|
||||
|| date.after(mostRecentRefTime))
|
||||
continue;// DR 16148
|
||||
|
||||
double dtime = FFMPGuiUtils.getTimeDiff(mostRecentRefTime,
|
||||
|
@ -4141,8 +4144,9 @@ public class FFMPResource extends
|
|||
}
|
||||
|
||||
/**
|
||||
* This method creates the upper left legend text for HPE derived QPE sources.
|
||||
* It is only used for HPE QPE sources.
|
||||
* This method creates the upper left legend text for HPE derived QPE
|
||||
* sources. It is only used for HPE QPE sources.
|
||||
*
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
|
@ -4160,18 +4164,18 @@ public class FFMPResource extends
|
|||
}
|
||||
|
||||
/**
|
||||
* HPE source lookup job
|
||||
* HPE source lookup job
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 11, 2014 3026 dhladky Initial creation
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1.0
|
||||
*/
|
||||
|
|
|
@ -28,12 +28,12 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import com.raytheon.uf.common.inventory.exception.DataCubeException;
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataquery.requests.DbQueryRequest;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
|
||||
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
|
||||
import com.raytheon.uf.common.inventory.exception.DataCubeException;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
|
@ -62,6 +62,7 @@ import com.raytheon.viz.grid.util.RadarAdapter;
|
|||
* Dec 13, 2011 bsteffen Initial creation
|
||||
* Feb 21, 2014 DR 16744 D. Friedman Add radar/grid updates
|
||||
* Apr 1, 2014 DR 17220 D. Friedman Handle uninitialized grid inventory
|
||||
* Dec 15, 2014 3923 bsteffen Retrieve pdo for grid instead of dataURI.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -179,14 +180,14 @@ public class ThinClientDataUpdateTree extends DataUpdateTree {
|
|||
newQuery.put("insertTime", new RequestConstraint(time,
|
||||
ConstraintType.GREATER_THAN));
|
||||
dbRequest.setConstraints(newQuery);
|
||||
dbRequest.addRequestField("dataURI");
|
||||
DbQueryResponse response = null;
|
||||
try {
|
||||
response = (DbQueryResponse) ThriftClient.sendRequest(dbRequest);
|
||||
for (String dataURI : response.getFieldObjects("dataURI",
|
||||
String.class)) {
|
||||
|
||||
for (PluginDataObject pdo : response
|
||||
.getEntityObjects(PluginDataObject.class)) {
|
||||
AlertMessage am = new AlertMessage();
|
||||
am.dataURI = dataURI;
|
||||
am.dataURI = pdo.getDataURI();
|
||||
am.decodedAlert = RecordFactory.getInstance().loadMapFromUri(
|
||||
am.dataURI);
|
||||
messages.add(am);
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
package com.raytheon.viz.core.rsc.jts;
|
||||
|
||||
import org.eclipse.swt.graphics.RGB;
|
||||
import org.geotools.referencing.operation.projection.ProjectionException;
|
||||
import org.opengis.referencing.FactoryException;
|
||||
|
||||
import com.raytheon.uf.common.geospatial.ReferencedGeometry;
|
||||
|
@ -54,6 +55,7 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory;
|
|||
* Oct 24, 2006 chammack Initial Creation.
|
||||
* Feb 14, 2014 2804 mschenke Rewrote to move clipping from GLWireframeShape2D to here
|
||||
* Apr 21, 2014 2997 randerso Improved error handling in handle(ReferencedGeometry, JTSGeometryData)
|
||||
* Jan 29, 2015 4062 randerso Don't throw errors for ProjectionExceptions
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -476,6 +478,8 @@ public class JTSCompiler {
|
|||
corrector.correct(geom.asLatLon()));
|
||||
} catch (FactoryException e) {
|
||||
throw new VizException("Error creating transform to Lat/Lon", e);
|
||||
} catch (ProjectionException e) {
|
||||
// ignore this exception so it doesn't cause pop ups
|
||||
} catch (Exception e) {
|
||||
throw new VizException(
|
||||
"Error transforming geometry into Lat/Lon", e);
|
||||
|
@ -487,6 +491,8 @@ public class JTSCompiler {
|
|||
} catch (FactoryException e) {
|
||||
throw new VizException(
|
||||
"Error creating transform to descriptor pixel space", e);
|
||||
} catch (ProjectionException e) {
|
||||
// ignore this exception so it doesn't cause pop ups
|
||||
} catch (Exception e) {
|
||||
throw new VizException(
|
||||
"Error transforming geometry into descriptor pixel space",
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
Darrel Kingfield NOAA/NSSL/CIMMS 09-02-2014 Initial File Creation
|
||||
-->
|
||||
<menuContributionFile>
|
||||
<include installTo="menu:org.eclipse.ui.main.menu?after=radar"
|
||||
<include installTo="menu:mrms?after=MRMS_MENU_START"
|
||||
fileName="menus/mrms/mrms.xml">
|
||||
</include>
|
||||
</menuContributionFile>
|
|
@ -5,8 +5,6 @@
|
|||
-->
|
||||
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<!-- Set the initial top level menu -->
|
||||
<contribute xsi:type="subMenu" menuText="MRMS">
|
||||
<contribute xsi:type="titleItem" titleText="---Multiple-Radar/Multiple-Sensor---" id="MRMS-SVR"/>
|
||||
<contribute xsi:type="subinclude" fileName="menus/mrms/mrmsProducts.xml"/>
|
||||
</contribute>
|
||||
</menuTemplate>
|
||||
<contribute xsi:type="titleItem" titleText="---Multiple-Radar/Multiple-Sensor---" id="MRMS-SVR"/>
|
||||
<!-- <contribute xsi:type="subinclude" fileName="menus/mrms/mrmsProducts.xml"/> -->
|
||||
</menuTemplate>
|
||||
|
|
|
@ -53,4 +53,21 @@
|
|||
name="Grid"
|
||||
category="com.raytheon.uf.viz.productbrowser.productbrowserpreferencespage"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.menus">
|
||||
<menuContribution
|
||||
locationURI="menu:org.eclipse.ui.main.menu?after=radar">
|
||||
<menu
|
||||
id="mrms"
|
||||
label="MRMS">
|
||||
<visibleWhen>
|
||||
<reference
|
||||
definitionId="com.raytheon.uf.viz.d2d.ui.inD2DActionSet">
|
||||
</reference>
|
||||
</visibleWhen>
|
||||
|
||||
<separator name="MRMS_MENU_START" visible="false"/>
|
||||
</menu>
|
||||
</menuContribution>
|
||||
</extension>
|
||||
</plugin>
|
||||
|
|
|
@ -11,7 +11,7 @@ package com.raytheon.viz.mpe.ui;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Jun 9, 2011 rgeorge Initial creation
|
||||
* Jun 30, 2014 17457 snaples Updated getCv_use to return name
|
||||
*
|
||||
* Jan 7, 2015 16954 cgobs Fix for cv_use issue - using getFieldName() in certain parts.
|
||||
* </pre>
|
||||
*
|
||||
* @author rgeorge
|
||||
|
@ -56,7 +56,7 @@ public enum DisplayFieldData {
|
|||
mlqmosaic("mpe_mlqmosaic_dir", "Q2 MultiSensor Mosaic", 3600, "PRECIP_ACCUM"),
|
||||
|
||||
//best estimate QPE
|
||||
Xmrg("rfcwide_xmrg_dir", "Best Estimate QPE (in)"), //
|
||||
Xmrg("rfcwide_xmrg_dir", "Best Estimate QPE (in)", 3600, "PRECIP_ACCUM" ), //
|
||||
|
||||
p3lMosaic("rfcwide_p3lmosaic_dir",
|
||||
"P3 Local Bias Corrected Radar-Derived Precip (in)", 3600, "PRECIP_ACCUM"), //
|
||||
|
@ -146,11 +146,18 @@ public enum DisplayFieldData {
|
|||
}
|
||||
}
|
||||
|
||||
public String getFieldName() {
|
||||
return name().toUpperCase();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the cv_use
|
||||
*/
|
||||
public String getCv_use() {
|
||||
cv_use = name().toUpperCase();
|
||||
if (cv_use == null) {
|
||||
cv_use = getFieldName();
|
||||
}
|
||||
return cv_use;
|
||||
}
|
||||
|
||||
|
|
|
@ -84,8 +84,6 @@ import com.raytheon.viz.mpe.util.DailyQcUtils;
|
|||
public class DrawDQCStations {
|
||||
|
||||
private static DrawDQCStations instance = null;
|
||||
|
||||
private DailyQcUtils dqc = DailyQcUtils.getInstance();
|
||||
|
||||
private static final List<NamedColorUseSet> pColorSetGroup = MPEColors
|
||||
.build_mpe_colors();
|
||||
|
@ -101,13 +99,13 @@ public class DrawDQCStations {
|
|||
|
||||
int points_flag;
|
||||
|
||||
boolean qpf_on = MPEDisplayManager.getCurrent().isQpf();
|
||||
boolean qpf_on = false;
|
||||
|
||||
boolean flf_on = false;
|
||||
|
||||
boolean maxmin_on = false;
|
||||
|
||||
int isom = dqc.isom;
|
||||
int isom = DailyQcUtils.isom;
|
||||
|
||||
int pcpn_time_step = 0;
|
||||
|
||||
|
@ -119,7 +117,7 @@ public class DrawDQCStations {
|
|||
|
||||
public static int grids_flag = 0;
|
||||
|
||||
int dflag[] = dqc.dflag;
|
||||
int dflag[] = DailyQcUtils.dflag;
|
||||
|
||||
int pcpn_time = 0;
|
||||
|
||||
|
@ -298,25 +296,25 @@ public class DrawDQCStations {
|
|||
time_pos = 0;
|
||||
display_flag = 0;
|
||||
hed = 0;
|
||||
plot_view = dqc.plot_view;
|
||||
contour_flag = dqc.contour_flag;
|
||||
points_flag = dqc.points_flag;
|
||||
plot_view = DailyQcUtils.plot_view;
|
||||
contour_flag = DailyQcUtils.contour_flag;
|
||||
points_flag = DailyQcUtils.points_flag;
|
||||
qpf_on = MPEDisplayManager.getCurrent().isQpf();
|
||||
flf_on = MPEDisplayManager.getCurrent().isZflag();
|
||||
maxmin_on = MPEDisplayManager.getCurrent().isMaxmin();
|
||||
tbuf = new StringBuilder();
|
||||
isom = dqc.isom;
|
||||
isom = DailyQcUtils.isom;
|
||||
pcpn_time_step = MPEDisplayManager.pcpn_time_step;
|
||||
map_flag = dqc.map_flag;
|
||||
pcp_flag = dqc.pcp_flag;
|
||||
pcpn_day = dqc.pcpn_day;
|
||||
grids_flag = dqc.grids_flag;
|
||||
dflag = dqc.dflag;
|
||||
pcpn_time = dqc.pcpn_time;
|
||||
// pdata = DailyQcUtils.pdata;
|
||||
old_isom = dqc.old_isom;
|
||||
// tdata = DailyQcUtils.tdata;
|
||||
// zdata = DailyQcUtils.zdata;
|
||||
map_flag = DailyQcUtils.map_flag;
|
||||
pcp_flag = DailyQcUtils.pcp_flag;
|
||||
pcpn_day = DailyQcUtils.pcpn_day;
|
||||
grids_flag = DailyQcUtils.grids_flag;
|
||||
dflag = DailyQcUtils.dflag;
|
||||
pcpn_time = DailyQcUtils.pcpn_time;
|
||||
// pdata = DailyQcUtils.pdata;
|
||||
old_isom = DailyQcUtils.old_isom;
|
||||
// tdata = DailyQcUtils.tdata;
|
||||
// zdata = DailyQcUtils.zdata;
|
||||
|
||||
/*
|
||||
* get the token dqc_preprocessor_basetime, the default value is 12Z
|
||||
|
@ -431,14 +429,17 @@ public class DrawDQCStations {
|
|||
if (contour_flag == 1) {
|
||||
|
||||
Set<DisplayMode> mode = mpd.getDisplayMode();
|
||||
if (md.getResourceList().containsRsc(pgp)) {
|
||||
md.getResourceList().removeRsc(pgp);
|
||||
if (display.getDescriptor().getResourceList()
|
||||
.containsRsc(pgp)) {
|
||||
display.getDescriptor().getResourceList()
|
||||
.removeRsc(pgp);
|
||||
pgp.dispose();
|
||||
}
|
||||
if (mode.contains(DisplayMode.Contour)) {
|
||||
// we are ok
|
||||
} else {
|
||||
mpd.toggleDisplayMode(DisplayMode.Contour);
|
||||
mode = mpd.getDisplayMode();
|
||||
if (mode.contains(DisplayMode.Image)) {
|
||||
mpd.toggleDisplayMode(DisplayMode.Image);
|
||||
}
|
||||
|
@ -717,7 +718,7 @@ public class DrawDQCStations {
|
|||
|
||||
Calendar ltime = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
|
||||
StringBuilder mbuf = new StringBuilder();
|
||||
int dqcEndingObsTime = dqc.getEnding6HourObsTime();
|
||||
int dqcEndingObsTime = DailyQcUtils.getEnding6HourObsTime();
|
||||
tbuf = new StringBuilder();
|
||||
|
||||
if (qpf_on == true) {
|
||||
|
@ -731,10 +732,10 @@ public class DrawDQCStations {
|
|||
|
||||
/* Precipitation period is always 12z-12z. */
|
||||
if ((pcpn_time < 2) && (pcpn_time_step == 0)) {
|
||||
ltime.setTime(dqc.pdata[pcpn_day].data_time);
|
||||
ltime.setTime(DailyQcUtils.pdata[pcpn_day].data_time);
|
||||
ltime.add(Calendar.SECOND, -86400);
|
||||
} else {
|
||||
ltime.setTime(dqc.pdata[pcpn_day].data_time);
|
||||
ltime.setTime(DailyQcUtils.pdata[pcpn_day].data_time);
|
||||
}
|
||||
|
||||
tbuf.append("Precipitation ");
|
||||
|
@ -784,18 +785,18 @@ public class DrawDQCStations {
|
|||
tbuf.append(" ending at 12z");
|
||||
}
|
||||
|
||||
if (dqc.pdata[pcpn_day].level == 1) {
|
||||
if (DailyQcUtils.pdata[pcpn_day].level == 1) {
|
||||
tbuf.append(" - Level 1");
|
||||
} else if (dqc.pdata[pcpn_day].level == 2) {
|
||||
} else if (DailyQcUtils.pdata[pcpn_day].level == 2) {
|
||||
tbuf.append(" - Level 2");
|
||||
}
|
||||
|
||||
if (dqc.pdata[pcpn_day].used[ptime_pos] == 4) {
|
||||
if (DailyQcUtils.pdata[pcpn_day].used[ptime_pos] == 4) {
|
||||
tbuf.append(" Saved");
|
||||
} else if ((dqc.pdata[pcpn_day].used[ptime_pos] == 3)
|
||||
|| (dqc.pdata[pcpn_day].used[ptime_pos] == 2)) {
|
||||
} else if ((DailyQcUtils.pdata[pcpn_day].used[ptime_pos] == 3)
|
||||
|| (DailyQcUtils.pdata[pcpn_day].used[ptime_pos] == 2)) {
|
||||
tbuf.append(" Modified");
|
||||
} else if (dqc.pdata[pcpn_day].used[ptime_pos] == 1) {
|
||||
} else if (DailyQcUtils.pdata[pcpn_day].used[ptime_pos] == 1) {
|
||||
tbuf.append(" Not Modified");
|
||||
} else {
|
||||
tbuf.append(" - No Data");
|
||||
|
@ -810,19 +811,19 @@ public class DrawDQCStations {
|
|||
if (dqcEndingObsTime == 12) {
|
||||
/* Times: 18, 00, 06, 12 */
|
||||
if (pcpn_time < 1) {
|
||||
ltime.setTime(dqc.zdata[pcpn_day].data_time);
|
||||
ltime.setTime(DailyQcUtils.zdata[pcpn_day].data_time);
|
||||
ltime.add(Calendar.SECOND, -86400);
|
||||
} else {
|
||||
ltime.setTime(dqc.zdata[pcpn_day].data_time);
|
||||
ltime.setTime(DailyQcUtils.zdata[pcpn_day].data_time);
|
||||
}
|
||||
|
||||
} else {
|
||||
/* Times 12, 18, 00, 06 */
|
||||
if (pcpn_time < 2) {
|
||||
ltime.setTime(dqc.zdata[pcpn_day].data_time);
|
||||
ltime.setTime(DailyQcUtils.zdata[pcpn_day].data_time);
|
||||
ltime.add(Calendar.SECOND, -86400);
|
||||
} else {
|
||||
ltime.setTime(dqc.zdata[pcpn_day].data_time);
|
||||
ltime.setTime(DailyQcUtils.zdata[pcpn_day].data_time);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -882,20 +883,20 @@ public class DrawDQCStations {
|
|||
|
||||
}
|
||||
|
||||
if (dqc.zdata[pcpn_day].level[ptime_pos] == 1) {
|
||||
if (DailyQcUtils.zdata[pcpn_day].level[ptime_pos] == 1) {
|
||||
tbuf.append(" - Level 1");
|
||||
} else if (dqc.zdata[pcpn_day].level[ptime_pos] == 2) {
|
||||
} else if (DailyQcUtils.zdata[pcpn_day].level[ptime_pos] == 2) {
|
||||
tbuf.append(" - Level 2");
|
||||
}
|
||||
|
||||
if (dqc.zdata[pcpn_day].used[ptime_pos] == 6) {
|
||||
if (DailyQcUtils.zdata[pcpn_day].used[ptime_pos] == 6) {
|
||||
tbuf.append(" Calculated");
|
||||
} else if (dqc.zdata[pcpn_day].used[ptime_pos] == 4) {
|
||||
} else if (DailyQcUtils.zdata[pcpn_day].used[ptime_pos] == 4) {
|
||||
tbuf.append(" Saved");
|
||||
} else if ((dqc.zdata[pcpn_day].used[ptime_pos] == 3)
|
||||
|| (dqc.zdata[pcpn_day].used[ptime_pos] == 2)) {
|
||||
} else if ((DailyQcUtils.zdata[pcpn_day].used[ptime_pos] == 3)
|
||||
|| (DailyQcUtils.zdata[pcpn_day].used[ptime_pos] == 2)) {
|
||||
tbuf.append(" Modified");
|
||||
} else if (dqc.zdata[pcpn_day].used[ptime_pos] == 1) {
|
||||
} else if (DailyQcUtils.zdata[pcpn_day].used[ptime_pos] == 1) {
|
||||
tbuf.append(" Not Modified");
|
||||
} else {
|
||||
tbuf.append(" - No Data");
|
||||
|
@ -915,18 +916,18 @@ public class DrawDQCStations {
|
|||
|
||||
if (dqcEndingObsTime == 12) {
|
||||
if ((pcpn_time < 1) && (pcpn_time_step == 0)) {
|
||||
ltime.setTime(dqc.tdata[pcpn_day].data_time);
|
||||
ltime.setTime(DailyQcUtils.tdata[pcpn_day].data_time);
|
||||
ltime.add(Calendar.SECOND, -86400);
|
||||
} else {
|
||||
ltime.setTime(dqc.tdata[pcpn_day].data_time);
|
||||
ltime.setTime(DailyQcUtils.tdata[pcpn_day].data_time);
|
||||
}
|
||||
|
||||
} else {
|
||||
if ((pcpn_time < 2) && (pcpn_time_step == 0)) {
|
||||
ltime.setTime(dqc.tdata[pcpn_day].data_time);
|
||||
ltime.setTime(DailyQcUtils.tdata[pcpn_day].data_time);
|
||||
ltime.add(Calendar.SECOND, -86400);
|
||||
} else {
|
||||
ltime.setTime(dqc.tdata[pcpn_day].data_time);
|
||||
ltime.setTime(DailyQcUtils.tdata[pcpn_day].data_time);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -994,18 +995,18 @@ public class DrawDQCStations {
|
|||
tbuf.append(" ending at 12z");
|
||||
}
|
||||
|
||||
if (dqc.tdata[pcpn_day].level[ptime_pos] == 1) {
|
||||
if (DailyQcUtils.tdata[pcpn_day].level[ptime_pos] == 1) {
|
||||
tbuf.append(" - Level 1");
|
||||
} else if (dqc.tdata[pcpn_day].level[ptime_pos] == 2) {
|
||||
} else if (DailyQcUtils.tdata[pcpn_day].level[ptime_pos] == 2) {
|
||||
tbuf.append(" - Level 2");
|
||||
}
|
||||
|
||||
if (dqc.tdata[pcpn_day].used[ptime_pos] == 4) {
|
||||
if (DailyQcUtils.tdata[pcpn_day].used[ptime_pos] == 4) {
|
||||
tbuf.append(" Saved");
|
||||
} else if ((dqc.tdata[pcpn_day].used[ptime_pos] == 3)
|
||||
|| (dqc.tdata[pcpn_day].used[ptime_pos] == 2)) {
|
||||
} else if ((DailyQcUtils.tdata[pcpn_day].used[ptime_pos] == 3)
|
||||
|| (DailyQcUtils.tdata[pcpn_day].used[ptime_pos] == 2)) {
|
||||
tbuf.append(" Modified");
|
||||
} else if (dqc.tdata[pcpn_day].used[ptime_pos] == 1) {
|
||||
} else if (DailyQcUtils.tdata[pcpn_day].used[ptime_pos] == 1) {
|
||||
tbuf.append(" Not Modified");
|
||||
} else {
|
||||
tbuf.append(" - No Data");
|
||||
|
|
|
@ -43,6 +43,7 @@ import com.raytheon.viz.mpe.util.ReadTemperatureStationList;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 31, 2009 snaples Initial creation
|
||||
* Feb 5, 2015 17101 snaples Updated max_stations to use size of dqc.precip_stations.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -72,13 +73,9 @@ public class GroupEditCalls {
|
|||
|
||||
int pcpn_time = dqc.pcpn_time;
|
||||
|
||||
ReadPrecipStationList rp = new ReadPrecipStationList();
|
||||
int max_stations = dqc.precip_stations.size();
|
||||
|
||||
ReadTemperatureStationList rt = new ReadTemperatureStationList();
|
||||
|
||||
int max_stations = rp.getNumPstations();
|
||||
|
||||
int max_tstations = rt.getNumTstations();
|
||||
int max_tstations = dqc.temperature_stations.size();
|
||||
|
||||
public void apply_group()
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Jun 17, 2009 snaples Initial creation
|
||||
* May 06, 2011 #8994 jpiatt Added set precipitation value as zero
|
||||
*
|
||||
* Sep 04, 2014 283 cgobs Fixed possible selection of filtered-out gages
|
||||
* </pre>
|
||||
*
|
||||
* @author snaples
|
||||
|
@ -45,15 +45,13 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
|
||||
public class GroupEditPrecipStns {
|
||||
|
||||
private DailyQcUtils dqc = DailyQcUtils.getInstance();
|
||||
|
||||
public void group_edit_precip_stations(ReferencedCoordinate rcoord) {
|
||||
int time_pos;
|
||||
int i, m, k;
|
||||
float lat, lon;
|
||||
double testdist, maxdist;
|
||||
int isave;
|
||||
int max_stations = dqc.precip_stations.size();
|
||||
int max_stations = DailyQcUtils.precip_stations.size();
|
||||
Coordinate coord = new Coordinate();
|
||||
|
||||
try {
|
||||
|
@ -64,7 +62,7 @@ public class GroupEditPrecipStns {
|
|||
}
|
||||
|
||||
if (MPEDisplayManager.pcpn_time_step == 0) {
|
||||
time_pos = dqc.pcpn_time;
|
||||
time_pos = DailyQcUtils.pcpn_time;
|
||||
} else {
|
||||
time_pos = 4;
|
||||
|
||||
|
@ -78,47 +76,61 @@ public class GroupEditPrecipStns {
|
|||
* mouse click point.
|
||||
*/
|
||||
for (i = 0; i < max_stations; i++) {
|
||||
if (dqc.pdata[dqc.pcpn_day].stn[i].frain[time_pos].data < 0) {
|
||||
if (DailyQcUtils.pdata[DailyQcUtils.pcpn_day].stn[i].frain[time_pos].data < 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (dqc.pdata[dqc.pcpn_day].stn[i].frain[time_pos].data < QcPrecipOptionsDialog
|
||||
//precip filter
|
||||
if (DailyQcUtils.pdata[DailyQcUtils.pcpn_day].stn[i].frain[time_pos].data < QcPrecipOptionsDialog
|
||||
.getPointFilterValue()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//reverse precip filter
|
||||
if (DailyQcUtils.pdata[DailyQcUtils.pcpn_day].stn[i].frain[time_pos].data > QcPrecipOptionsDialog
|
||||
.getPointFilterReverseValue()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//elevation filter
|
||||
if (DailyQcUtils.precip_stations.get(i).elev < DailyQcUtils.elevation_filter_value)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
/* Retrieve the latitude and longitude of this station. */
|
||||
lat = dqc.precip_stations.get(i).lat;
|
||||
lon = dqc.precip_stations.get(i).lon;
|
||||
lat = DailyQcUtils.precip_stations.get(i).lat;
|
||||
lon = DailyQcUtils.precip_stations.get(i).lon;
|
||||
|
||||
if (dqc.precip_stations.get(i).tip == 0
|
||||
&& dqc.gage_char[0] == -1) {
|
||||
if (DailyQcUtils.precip_stations.get(i).tip == 0
|
||||
&& DailyQcUtils.gage_char[0] == -1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (dqc.precip_stations.get(i).tip == 1
|
||||
&& dqc.gage_char[1] == -1) {
|
||||
if (DailyQcUtils.precip_stations.get(i).tip == 1
|
||||
&& DailyQcUtils.gage_char[1] == -1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (m = 0; m < dqc.tsmax; m++) {
|
||||
for (m = 0; m < DailyQcUtils.tsmax; m++) {
|
||||
|
||||
if ((dqc.precip_stations.get(i).parm.substring(3, 5)
|
||||
.equalsIgnoreCase(dqc.ts[m].abr))
|
||||
&& dqc.dflag[m + 1] == 1) {
|
||||
if ((DailyQcUtils.precip_stations.get(i).parm.substring(3, 5)
|
||||
.equalsIgnoreCase(DailyQcUtils.ts[m].abr))
|
||||
&& DailyQcUtils.dflag[m + 1] == 1) {
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (m == dqc.tsmax) {
|
||||
if (m == DailyQcUtils.tsmax) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (m = 0; m < 9; m++) {
|
||||
|
||||
if (m == dqc.pdata[dqc.pcpn_day].stn[i].frain[time_pos].qual
|
||||
&& dqc.qflag[m] == 1) {
|
||||
if (m == DailyQcUtils.pdata[DailyQcUtils.pcpn_day].stn[i].frain[time_pos].qual
|
||||
&& DailyQcUtils.qflag[m] == 1) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -143,19 +155,19 @@ public class GroupEditPrecipStns {
|
|||
return;
|
||||
}
|
||||
|
||||
if (dqc.pdata[dqc.pcpn_day].stn[isave].frain[time_pos].qual != GroupEditStationsDialog.group_qual) {
|
||||
if (DailyQcUtils.pdata[DailyQcUtils.pcpn_day].stn[isave].frain[time_pos].qual != GroupEditStationsDialog.group_qual) {
|
||||
QcPrecipOptionsDialog.renderGridsBtn.setEnabled(true);
|
||||
}
|
||||
|
||||
dqc.pdata[dqc.pcpn_day].stn[isave].frain[time_pos].qual = (short) GroupEditStationsDialog.group_qual;
|
||||
DailyQcUtils.pdata[DailyQcUtils.pcpn_day].stn[isave].frain[time_pos].qual = (short) GroupEditStationsDialog.group_qual;
|
||||
|
||||
if (GroupEditStationsDialog.group_qual == 1
|
||||
&& time_pos == 4
|
||||
&& dqc.pdata[dqc.pcpn_day].stn[isave].sflag[time_pos] == 1) {
|
||||
&& DailyQcUtils.pdata[DailyQcUtils.pcpn_day].stn[isave].sflag[time_pos] == 1) {
|
||||
|
||||
dqc.pdata[dqc.pcpn_day].stn[isave].frain[time_pos].data = dqc.pdata[dqc.pcpn_day].stn[isave].rrain[time_pos].data;
|
||||
DailyQcUtils.pdata[DailyQcUtils.pcpn_day].stn[isave].frain[time_pos].data = DailyQcUtils.pdata[DailyQcUtils.pcpn_day].stn[isave].rrain[time_pos].data;
|
||||
|
||||
dqc.pdata[dqc.pcpn_day].stn[isave].sflag[time_pos] = -1;
|
||||
DailyQcUtils.pdata[DailyQcUtils.pcpn_day].stn[isave].sflag[time_pos] = -1;
|
||||
|
||||
}
|
||||
|
||||
|
@ -164,7 +176,7 @@ public class GroupEditPrecipStns {
|
|||
|| GroupEditStationsDialog.group_qual == 0 || GroupEditStationsDialog.group_qual == 8)) {
|
||||
|
||||
for (k = 0; k < 4; k++) {
|
||||
dqc.pdata[dqc.pcpn_day].stn[isave].frain[k].qual = (short) GroupEditStationsDialog.group_qual;
|
||||
DailyQcUtils.pdata[DailyQcUtils.pcpn_day].stn[isave].frain[k].qual = (short) GroupEditStationsDialog.group_qual;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -176,12 +188,12 @@ public class GroupEditPrecipStns {
|
|||
* and QC codes to "Manual"
|
||||
*/
|
||||
if (GroupEditStationsDialog.group_qual == 2) {
|
||||
dqc.pdata[dqc.pcpn_day].stn[isave].frain[time_pos].data = 0.0f;
|
||||
dqc.pdata[dqc.pcpn_day].stn[isave].frain[time_pos].qual = 2;
|
||||
if ((dqc.pdata[dqc.pcpn_day].stn[isave].frain[4].data - 0.0) < 0.0001) {
|
||||
DailyQcUtils.pdata[DailyQcUtils.pcpn_day].stn[isave].frain[time_pos].data = 0.0f;
|
||||
DailyQcUtils.pdata[DailyQcUtils.pcpn_day].stn[isave].frain[time_pos].qual = 2;
|
||||
if ((DailyQcUtils.pdata[DailyQcUtils.pcpn_day].stn[isave].frain[4].data - 0.0) < 0.0001) {
|
||||
for (k = 0; k < 4; k++) {
|
||||
dqc.pdata[dqc.pcpn_day].stn[isave].frain[k].data = 0.0f;
|
||||
dqc.pdata[dqc.pcpn_day].stn[isave].frain[k].qual = 2;
|
||||
DailyQcUtils.pdata[DailyQcUtils.pcpn_day].stn[isave].frain[k].data = 0.0f;
|
||||
DailyQcUtils.pdata[DailyQcUtils.pcpn_day].stn[isave].frain[k].qual = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -190,23 +202,23 @@ public class GroupEditPrecipStns {
|
|||
|
||||
if (time_pos != 4
|
||||
&& GroupEditStationsDialog.group_qual == 1
|
||||
&& dqc.pdata[dqc.pcpn_day].stn[isave].frain[4].qual != 5
|
||||
&& dqc.pdata[dqc.pcpn_day].stn[isave].frain[4].qual != 4) {
|
||||
dqc.pdata[dqc.pcpn_day].stn[isave].frain[4].qual = (short) GroupEditStationsDialog.group_qual;
|
||||
&& DailyQcUtils.pdata[DailyQcUtils.pcpn_day].stn[isave].frain[4].qual != 5
|
||||
&& DailyQcUtils.pdata[DailyQcUtils.pcpn_day].stn[isave].frain[4].qual != 4) {
|
||||
DailyQcUtils.pdata[DailyQcUtils.pcpn_day].stn[isave].frain[4].qual = (short) GroupEditStationsDialog.group_qual;
|
||||
}
|
||||
|
||||
for (k = 0; k < 5; k++) {
|
||||
|
||||
if (k < 4) {
|
||||
time_pos = dqc.pcpn_day * 4 + k;
|
||||
time_pos = DailyQcUtils.pcpn_day * 4 + k;
|
||||
} else {
|
||||
time_pos = 40 + dqc.pcpn_day;
|
||||
time_pos = 40 + DailyQcUtils.pcpn_day;
|
||||
}
|
||||
|
||||
dqc.pcp_in_use[time_pos] = -1;
|
||||
DailyQcUtils.pcp_in_use[time_pos] = -1;
|
||||
|
||||
if (dqc.pdata[dqc.pcpn_day].used[k] != 0) {
|
||||
dqc.pdata[dqc.pcpn_day].used[k] = 2;
|
||||
if (DailyQcUtils.pdata[DailyQcUtils.pcpn_day].used[k] != 0) {
|
||||
DailyQcUtils.pdata[DailyQcUtils.pcpn_day].used[k] = 2;
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
|
|
@ -45,7 +45,6 @@ import com.raytheon.viz.mpe.util.MakeRsel;
|
|||
import com.raytheon.viz.mpe.util.QCStations;
|
||||
import com.raytheon.viz.mpe.util.QCTStations;
|
||||
import com.raytheon.viz.mpe.util.ReadFreezingStationList;
|
||||
import com.raytheon.viz.mpe.util.ReadPrecipStationList;
|
||||
import com.raytheon.viz.mpe.util.ReadTemperatureStationList;
|
||||
import com.raytheon.viz.mpe.util.RenderPcp;
|
||||
import com.raytheon.viz.mpe.util.RenderT;
|
||||
|
@ -442,8 +441,8 @@ public class OtherPrecipOptions {
|
|||
MakeRsel mr = new MakeRsel();
|
||||
// Hrap_Grid hrap_grid = DailyQcUtils.getHrap_grid();
|
||||
Calendar tmtime = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
|
||||
ReadPrecipStationList rp = new ReadPrecipStationList();
|
||||
int num_stations = rp.getNumPstations();
|
||||
// ReadPrecipStationList rp = new ReadPrecipStationList();
|
||||
int num_stations = dqc.precip_stations.size();
|
||||
String s = appsDefaults.getToken(dqc_ending_6hour_obstime_tok);
|
||||
int dqc_ending_6hour_obstime = ((!(null == s)) ? Integer.parseInt(s)
|
||||
: -1);
|
||||
|
|
|
@ -16,6 +16,15 @@
|
|||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 7, 2015 16954 cgobs Fix for cv_use issue - using getFieldName() in certain parts.
|
||||
* Feb 4, 2015 17094 cgobs Fix for fieldType being too long for mapx_field_type column in RWResult table.
|
||||
* </pre>
|
||||
**/
|
||||
package com.raytheon.viz.mpe.ui.actions;
|
||||
|
||||
|
@ -25,8 +34,10 @@ import java.io.IOException;
|
|||
import java.text.SimpleDateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.imageio.ImageWriter;
|
||||
|
@ -116,7 +127,7 @@ public class SaveBestEstimate {
|
|||
|
||||
String rfc = MPEDataManager.getInstance().getRFC();
|
||||
|
||||
update_rwr_save(rfc, editDate, bestEstField.getCv_use());
|
||||
update_rwr_save(rfc, editDate, bestEstField.getFieldName());
|
||||
|
||||
XmrgFile xmrgFile = MPEDisplayManager.getXmrgFile(bestEstField,
|
||||
editDate);
|
||||
|
@ -329,7 +340,10 @@ public class SaveBestEstimate {
|
|||
Rwresult pRWResultNode = pRWResultHead.get(0);
|
||||
|
||||
/* Update the elements in the RWResult node. */
|
||||
pRWResultNode.setMapxFieldType(fldtype);
|
||||
|
||||
fldtype = checkAndModifyMapxFieldType(fldtype);
|
||||
|
||||
pRWResultNode.setMapxFieldType(fldtype.toLowerCase());
|
||||
pRWResultNode.setAutoSave(asave);
|
||||
pRWResultNode.setDrawPrecip(drpr);
|
||||
pRWResultNode.setLastSaveTime(SimulatedTime.getSystemTime()
|
||||
|
@ -351,4 +365,32 @@ public class SaveBestEstimate {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
private static String checkAndModifyMapxFieldType(String fieldType) {
|
||||
|
||||
// This method changes fieldType to lowercase.
|
||||
// It also shortens fieldTypes as needed to fit into the mapx_field_type column in the RWResult table.
|
||||
// Note: the mapx_field_type column is informational only. It is not used by the code
|
||||
// other than reading and writing from and to the database.
|
||||
|
||||
String newFieldType = null;
|
||||
String lowerCaseFieldType = fieldType.toLowerCase();
|
||||
|
||||
final Map<String,String> conversionTable = new HashMap<String , String>();
|
||||
|
||||
conversionTable.put("localfield1", "localfld1");
|
||||
conversionTable.put("localfield2", "localfld2");
|
||||
conversionTable.put("localfield3", "localfld3");
|
||||
|
||||
conversionTable.put("avgrdmosaic", "avgrdmos");
|
||||
conversionTable.put("maxrdmosaic", "maxrdmos");
|
||||
|
||||
|
||||
newFieldType = conversionTable.get(lowerCaseFieldType);
|
||||
if (newFieldType == null)
|
||||
{
|
||||
newFieldType = lowerCaseFieldType;
|
||||
}
|
||||
return newFieldType;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1032,7 +1032,7 @@ public class SaveLevel2Data {
|
|||
|
||||
/* build map file */
|
||||
System.out.println("Building MAP .");
|
||||
found: for (m = 0; mean_areal_precip_global[m].hb5 != ""; m++) {
|
||||
found: for (m = 0; mean_areal_precip_global[m] != null; m++) {
|
||||
for (k = 0; k < 4; k++) {
|
||||
|
||||
num = j * 4 + 3 - k;
|
||||
|
@ -1047,9 +1047,11 @@ public class SaveLevel2Data {
|
|||
|
||||
}
|
||||
|
||||
if (mean_areal_precip_global[m].hb5 == "") {
|
||||
if (mean_areal_precip_global[m] != null) {
|
||||
if (mean_areal_precip_global[m].hb5 == "") {
|
||||
System.out.println("MAP.hb5 is empty, continuing. ");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
gm.setTime(dqc.pdata[j].data_time);
|
||||
|
|
|
@ -165,7 +165,6 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog {
|
|||
cal.setTime(prevDate);
|
||||
|
||||
if( prevHydDate == null ){
|
||||
// prevHydDate = prevDate;
|
||||
prevHydDate = displayMgr.getCurrentEditDate();
|
||||
|
||||
hydroCal.setTime(prevHydDate);
|
||||
|
|
|
@ -387,6 +387,7 @@ public class EditPrecipStationsDialog extends AbstractMPEDialog implements
|
|||
if (srain.data > -98) {
|
||||
if (time_pos == HOURS_24 && srain.data >= 0) {
|
||||
snow = true;
|
||||
System.out.println("Snow data is true for station.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -476,6 +477,7 @@ public class EditPrecipStationsDialog extends AbstractMPEDialog implements
|
|||
"Snow water change is %5.2f in.", srain.data));
|
||||
if (time_pos == HOURS_24 && srain.data >= 0) {
|
||||
snow = true;
|
||||
System.out.println("Snow water change is available for " + selectedStation.hb5);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -210,8 +210,8 @@ public class QcPrecipOptionsDialog extends AbstractMPEDialog {
|
|||
Shell parent = this.getParent();
|
||||
Display display = parent.getDisplay();
|
||||
MPEDisplayManager displayMgr = MPEDisplayManager.getCurrent();
|
||||
Date prevDate = displayMgr.getCurrentEditDate();
|
||||
Date currDate = ChooseDataPeriodDialog.prevDate;
|
||||
Date prevDate = ChooseDataPeriodDialog.getCurrentHydroEditDate();
|
||||
Date currDate = ChooseDataPeriodDialog.prevHydDate;
|
||||
String QcArea = ChooseDataPeriodDialog.prevArea;
|
||||
AppsDefaults appDefaults = AppsDefaults.getInstance();
|
||||
DisplayFieldData df = displayMgr.getDisplayFieldType();
|
||||
|
|
|
@ -56,7 +56,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* Polygon values will now be
|
||||
* displayed for polygons with
|
||||
* the "sub" action.
|
||||
*
|
||||
* Jan 7, 2015 16954 cgobs Fix for cv_use issue - using getFieldName() in certain parts.
|
||||
* </pre>
|
||||
*
|
||||
* @author mpduff
|
||||
|
@ -286,8 +286,8 @@ public class DeletePolygonDlg extends CaveSWTDialog {
|
|||
|
||||
polygonListBox.removeAll();
|
||||
|
||||
String type = displayManager.getDisplayFieldType().getCv_use()
|
||||
.toUpperCase();
|
||||
String type = displayManager.getDisplayFieldType().getFieldName();
|
||||
|
||||
productTF.setText(type);
|
||||
polygonList = PolygonEditManager.getPolygonEdits(fieldData, editDate);
|
||||
recreatePolygonListBox();
|
||||
|
@ -314,7 +314,7 @@ public class DeletePolygonDlg extends CaveSWTDialog {
|
|||
|
||||
PolygonEditAction action = data.getEditAction();
|
||||
if (action == PolygonEditAction.SUB) {
|
||||
String value = data.getSubDrawSource().getCv_use();
|
||||
String value = data.getSubDrawSource().getFieldName();
|
||||
polygonListBox.add(String.format(format2, number, displayed,
|
||||
persist, action.toPrettyName(), value));
|
||||
} else {
|
||||
|
|
|
@ -33,6 +33,7 @@ import org.eclipse.swt.graphics.Font;
|
|||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Combo;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Group;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
|
@ -63,6 +64,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* Jan 29, 2014 16561 snaples Updated processDrawPrecipValue to remove polygon wireframe after setting value.
|
||||
* Feb 2, 2014 16201 snaples Added saved data flag support
|
||||
* Apr 28, 2014 16707 snaples Added code to save and set location of dialog box when moved.
|
||||
* Jan 12, 2015 16993 snaples Restored code for Substitute Field Combo box.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
|
@ -78,6 +80,9 @@ public class DrawPolygonDlg extends CaveSWTDialog {
|
|||
|
||||
private static final String MAKE_PERSISTENT = "Make Persistent";
|
||||
|
||||
private DisplayFieldData[] displayFieldDataArray;
|
||||
private String[] displayTypeNameArray;
|
||||
|
||||
/**
|
||||
* Bold Font.
|
||||
*/
|
||||
|
@ -88,6 +93,11 @@ public class DrawPolygonDlg extends CaveSWTDialog {
|
|||
*/
|
||||
private Font font = null;
|
||||
|
||||
/**
|
||||
* The field type selection Combo control.
|
||||
*/
|
||||
private Combo fieldTypeCombo = null;
|
||||
|
||||
/**
|
||||
* The precip value spinner control.
|
||||
*/
|
||||
|
@ -227,7 +237,7 @@ public class DrawPolygonDlg extends CaveSWTDialog {
|
|||
GridData gd = new GridData(345, SWT.DEFAULT);
|
||||
subGroup.setLayoutData(gd);
|
||||
|
||||
getSubChecks(subGroup);
|
||||
createFieldCombo(subGroup);
|
||||
|
||||
// Create Substitute button
|
||||
final Button subBtn = new Button(subGroup, SWT.PUSH);
|
||||
|
@ -349,398 +359,80 @@ public class DrawPolygonDlg extends CaveSWTDialog {
|
|||
* @param groupComp
|
||||
* The group composite
|
||||
*/
|
||||
private void getSubChecks(Group groupComp) {
|
||||
private void createFieldCombo(Group groupComp) {
|
||||
// Spacer
|
||||
Label spaceLabel = new Label(groupComp, SWT.NONE);
|
||||
spaceLabel.setText(" ");
|
||||
|
||||
// Create a container to hold the label and the combo box.
|
||||
GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||
Composite prodListComp = new Composite(shell, SWT.NONE);
|
||||
GridLayout prodListCompLayout = new GridLayout(2, false);
|
||||
prodListComp.setLayout(prodListCompLayout);
|
||||
prodListComp.setLayoutData(gd);
|
||||
|
||||
Button radarMosaicChk = new Button(groupComp, SWT.RADIO);
|
||||
GridData gd = new GridData(SWT.LEFT, SWT.DEFAULT, true, false);
|
||||
radarMosaicChk.setLayoutData(gd);
|
||||
radarMosaicChk.setText("Radar Mosaic");
|
||||
radarMosaicChk.setFont(font);
|
||||
radarMosaicChk.setLayoutData(gd);
|
||||
// Default to radar mosaic on dialog creation
|
||||
radarMosaicChk.setSelection(true);
|
||||
subType = DisplayFieldData.rMosaic;
|
||||
radarMosaicChk.addSelectionListener(new SelectionAdapter() {
|
||||
gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
|
||||
Label fieldTypeLabel = new Label(prodListComp, SWT.CENTER);
|
||||
fieldTypeLabel.setText(SUBSTITUTE_VALUE_TEXT);
|
||||
fieldTypeLabel.setLayoutData(gd);
|
||||
|
||||
gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||
fieldTypeCombo = new Combo(groupComp, SWT.LEFT | SWT.DROP_DOWN
|
||||
| SWT.READ_ONLY);
|
||||
|
||||
if (displayFieldDataArray == null)
|
||||
{
|
||||
displayFieldDataArray = MPEDisplayManager.mpe_qpe_fields;
|
||||
}
|
||||
|
||||
// Label spaceLabel = new Label(groupComp, SWT.NONE);
|
||||
// spaceLabel.setText("***** ");
|
||||
|
||||
int selectedFieldIndex = 0;
|
||||
|
||||
//find the index of the selected field
|
||||
for (selectedFieldIndex = 0; selectedFieldIndex < displayFieldDataArray.length; selectedFieldIndex++)
|
||||
{
|
||||
if (displayFieldDataArray[selectedFieldIndex] == subType)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//create and initialize the display field type name array
|
||||
displayTypeNameArray = new String[displayFieldDataArray.length];
|
||||
|
||||
for (int i = 0; i < displayFieldDataArray.length; i++) {
|
||||
|
||||
String fieldName = displayFieldDataArray[i].toString();
|
||||
// System.out.println("DrawPolygon.createFieldCombo(): FieldName = :" + fieldName + ":");
|
||||
displayTypeNameArray[i] = fieldName;
|
||||
}
|
||||
|
||||
//select the field
|
||||
fieldTypeCombo.setTextLimit(35);
|
||||
fieldTypeCombo.setLayoutData(gd);
|
||||
fieldTypeCombo.setItems(displayTypeNameArray);
|
||||
fieldTypeCombo.select(selectedFieldIndex);
|
||||
|
||||
fieldTypeCombo.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
subType = DisplayFieldData.rMosaic;
|
||||
}
|
||||
String selectedFieldString = fieldTypeCombo.getText();
|
||||
// System.out.println("DrawPolygon.createFieldCombo(): selectedFieldString = " +
|
||||
// selectedFieldString);
|
||||
|
||||
subType = DisplayFieldData.fromDisplayNameString(selectedFieldString);
|
||||
|
||||
// if (subType != null)
|
||||
// {
|
||||
// System.out.println("DrawPolygon.createFieldCombo(): subType = " +
|
||||
// subType.toString());
|
||||
// }
|
||||
}
|
||||
});
|
||||
|
||||
spaceLabel = new Label(groupComp, SWT.NONE);
|
||||
spaceLabel.setText(" ");
|
||||
|
||||
Button avgRadarMosaicChk = new Button(groupComp, SWT.RADIO);
|
||||
gd = new GridData(SWT.LEFT, SWT.DEFAULT, true, false);
|
||||
avgRadarMosaicChk.setLayoutData(gd);
|
||||
avgRadarMosaicChk.setText("Average Radar Mosaic");
|
||||
avgRadarMosaicChk.setFont(font);
|
||||
avgRadarMosaicChk.setLayoutData(gd);
|
||||
avgRadarMosaicChk.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
subType = DisplayFieldData.avgrMosaic;
|
||||
}
|
||||
});
|
||||
|
||||
spaceLabel = new Label(groupComp, SWT.NONE);
|
||||
spaceLabel.setText(" ");
|
||||
|
||||
Button maxRadarMosaicChk = new Button(groupComp, SWT.RADIO);
|
||||
gd = new GridData(SWT.LEFT, SWT.DEFAULT, true, false);
|
||||
maxRadarMosaicChk.setLayoutData(gd);
|
||||
maxRadarMosaicChk.setText("Max Radar Mosaic");
|
||||
maxRadarMosaicChk.setFont(font);
|
||||
maxRadarMosaicChk.setLayoutData(gd);
|
||||
maxRadarMosaicChk.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
subType = DisplayFieldData.maxrMosaic;
|
||||
}
|
||||
});
|
||||
|
||||
spaceLabel = new Label(groupComp, SWT.NONE);
|
||||
spaceLabel.setText(" ");
|
||||
|
||||
Button fieldBiasRadarMosaicChk = new Button(groupComp, SWT.RADIO);
|
||||
gd = new GridData(SWT.LEFT, SWT.DEFAULT, true, false);
|
||||
fieldBiasRadarMosaicChk.setLayoutData(gd);
|
||||
fieldBiasRadarMosaicChk.setText("Field Bias Radar Mosaic");
|
||||
fieldBiasRadarMosaicChk.setFont(font);
|
||||
fieldBiasRadarMosaicChk.setLayoutData(gd);
|
||||
fieldBiasRadarMosaicChk.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
subType = DisplayFieldData.bMosaic;
|
||||
}
|
||||
});
|
||||
|
||||
spaceLabel = new Label(groupComp, SWT.NONE);
|
||||
spaceLabel.setText(" ");
|
||||
|
||||
Button localBiasRadarMosaicChk = new Button(groupComp, SWT.RADIO);
|
||||
gd = new GridData(SWT.LEFT, SWT.DEFAULT, true, false);
|
||||
localBiasRadarMosaicChk.setLayoutData(gd);
|
||||
localBiasRadarMosaicChk.setText("Local Bias Radar Mosaic");
|
||||
localBiasRadarMosaicChk.setFont(font);
|
||||
localBiasRadarMosaicChk.setLayoutData(gd);
|
||||
localBiasRadarMosaicChk.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
subType = DisplayFieldData.lMosaic;
|
||||
}
|
||||
});
|
||||
|
||||
spaceLabel = new Label(groupComp, SWT.NONE);
|
||||
spaceLabel.setText(" ");
|
||||
|
||||
Button gageOnlyChk = new Button(groupComp, SWT.RADIO);
|
||||
gd = new GridData(SWT.LEFT, SWT.DEFAULT, true, false);
|
||||
gageOnlyChk.setLayoutData(gd);
|
||||
gageOnlyChk.setText("Gage Only Analysis");
|
||||
gageOnlyChk.setFont(font);
|
||||
gageOnlyChk.setLayoutData(gd);
|
||||
gageOnlyChk.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
subType = DisplayFieldData.gageOnly;
|
||||
}
|
||||
});
|
||||
|
||||
spaceLabel = new Label(groupComp, SWT.NONE);
|
||||
spaceLabel.setText(" ");
|
||||
|
||||
Button multiSensorMosaicChk = new Button(groupComp, SWT.RADIO);
|
||||
gd = new GridData(SWT.LEFT, SWT.DEFAULT, true, false);
|
||||
multiSensorMosaicChk.setLayoutData(gd);
|
||||
multiSensorMosaicChk.setText("Multisensor Mosaic");
|
||||
multiSensorMosaicChk.setFont(font);
|
||||
multiSensorMosaicChk.setLayoutData(gd);
|
||||
multiSensorMosaicChk.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
subType = DisplayFieldData.mMosaic;
|
||||
}
|
||||
});
|
||||
|
||||
spaceLabel = new Label(groupComp, SWT.NONE);
|
||||
spaceLabel.setText(" ");
|
||||
|
||||
Button localBiasMultiSensorMosaicChk = new Button(groupComp, SWT.RADIO);
|
||||
gd = new GridData(SWT.LEFT, SWT.DEFAULT, true, false);
|
||||
localBiasMultiSensorMosaicChk.setLayoutData(gd);
|
||||
localBiasMultiSensorMosaicChk.setText("Local Bias Multisensor Mosaic");
|
||||
localBiasMultiSensorMosaicChk.setFont(font);
|
||||
localBiasMultiSensorMosaicChk.setLayoutData(gd);
|
||||
localBiasMultiSensorMosaicChk
|
||||
.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
subType = DisplayFieldData.mlMosaic;
|
||||
}
|
||||
});
|
||||
|
||||
spaceLabel = new Label(groupComp, SWT.NONE);
|
||||
spaceLabel.setText(" ");
|
||||
|
||||
Button satPrecipChk = new Button(groupComp, SWT.RADIO);
|
||||
gd = new GridData(SWT.LEFT, SWT.DEFAULT, true, false);
|
||||
satPrecipChk.setLayoutData(gd);
|
||||
satPrecipChk.setText("Satellite Precip");
|
||||
satPrecipChk.setFont(font);
|
||||
satPrecipChk.setLayoutData(gd);
|
||||
satPrecipChk.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
subType = DisplayFieldData.satPre;
|
||||
}
|
||||
});
|
||||
|
||||
spaceLabel = new Label(groupComp, SWT.NONE);
|
||||
spaceLabel.setText(" ");
|
||||
|
||||
Button localBiasSatPrecipChk = new Button(groupComp, SWT.RADIO);
|
||||
gd = new GridData(SWT.LEFT, SWT.DEFAULT, true, false);
|
||||
localBiasSatPrecipChk.setLayoutData(gd);
|
||||
localBiasSatPrecipChk.setText("Local Bias Satellite Precip");
|
||||
localBiasSatPrecipChk.setFont(font);
|
||||
localBiasSatPrecipChk.setLayoutData(gd);
|
||||
localBiasSatPrecipChk.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
subType = DisplayFieldData.lsatPre;
|
||||
}
|
||||
});
|
||||
|
||||
spaceLabel = new Label(groupComp, SWT.NONE);
|
||||
spaceLabel.setText(" ");
|
||||
|
||||
Button satRadarMosaicChk = new Button(groupComp, SWT.RADIO);
|
||||
gd = new GridData(SWT.LEFT, SWT.DEFAULT, true, false);
|
||||
satRadarMosaicChk.setLayoutData(gd);
|
||||
satRadarMosaicChk.setText("Satellite Radar Mosaic");
|
||||
satRadarMosaicChk.setFont(font);
|
||||
satRadarMosaicChk.setLayoutData(gd);
|
||||
satRadarMosaicChk.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
subType = DisplayFieldData.srMosaic;
|
||||
}
|
||||
});
|
||||
|
||||
spaceLabel = new Label(groupComp, SWT.NONE);
|
||||
spaceLabel.setText(" ");
|
||||
|
||||
Button satGageMosaicChk = new Button(groupComp, SWT.RADIO);
|
||||
gd = new GridData(SWT.LEFT, SWT.DEFAULT, true, false);
|
||||
satGageMosaicChk.setLayoutData(gd);
|
||||
satGageMosaicChk.setText("Satellite Gage Mosaic");
|
||||
satGageMosaicChk.setFont(font);
|
||||
satGageMosaicChk.setLayoutData(gd);
|
||||
satGageMosaicChk.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
subType = DisplayFieldData.sgMosaic;
|
||||
}
|
||||
});
|
||||
|
||||
spaceLabel = new Label(groupComp, SWT.NONE);
|
||||
spaceLabel.setText(" ");
|
||||
|
||||
Button satRadarGageMosaicChk = new Button(groupComp, SWT.RADIO);
|
||||
gd = new GridData(SWT.LEFT, SWT.DEFAULT, true, false);
|
||||
satRadarGageMosaicChk.setLayoutData(gd);
|
||||
satRadarGageMosaicChk.setText("Satellite Radar Gage Mosaic");
|
||||
satRadarGageMosaicChk.setFont(font);
|
||||
satRadarGageMosaicChk.setLayoutData(gd);
|
||||
satRadarGageMosaicChk.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
subType = DisplayFieldData.srgMosaic;
|
||||
}
|
||||
});
|
||||
|
||||
spaceLabel = new Label(groupComp, SWT.NONE);
|
||||
spaceLabel.setText(" ");
|
||||
|
||||
Button triangulatedLocalBiasMosaicChk = new Button(groupComp, SWT.RADIO);
|
||||
gd = new GridData(SWT.LEFT, SWT.DEFAULT, true, false);
|
||||
triangulatedLocalBiasMosaicChk.setLayoutData(gd);
|
||||
triangulatedLocalBiasMosaicChk
|
||||
.setText("Triangulated Local Bias Mosaic");
|
||||
triangulatedLocalBiasMosaicChk.setFont(font);
|
||||
triangulatedLocalBiasMosaicChk.setLayoutData(gd);
|
||||
triangulatedLocalBiasMosaicChk
|
||||
.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
subType = DisplayFieldData.p3lMosaic;
|
||||
}
|
||||
});
|
||||
|
||||
spaceLabel = new Label(groupComp, SWT.NONE);
|
||||
spaceLabel.setText(" ");
|
||||
|
||||
Button bestEstQPEChk = new Button(groupComp, SWT.RADIO);
|
||||
gd = new GridData(SWT.LEFT, SWT.DEFAULT, true, false);
|
||||
bestEstQPEChk.setLayoutData(gd);
|
||||
bestEstQPEChk.setText("Best Estimate QPE");
|
||||
bestEstQPEChk.setFont(font);
|
||||
bestEstQPEChk.setLayoutData(gd);
|
||||
bestEstQPEChk.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
subType = DisplayFieldData.Xmrg;
|
||||
}
|
||||
});
|
||||
|
||||
spaceLabel = new Label(groupComp, SWT.NONE);
|
||||
spaceLabel.setText(" ");
|
||||
|
||||
Button rfcFieldBiasMosaic = new Button(groupComp, SWT.RADIO);
|
||||
gd = new GridData(SWT.LEFT, SWT.DEFAULT, true, false);
|
||||
rfcFieldBiasMosaic.setLayoutData(gd);
|
||||
rfcFieldBiasMosaic.setText("RFC Field Bias Mosaic");
|
||||
rfcFieldBiasMosaic.setFont(font);
|
||||
rfcFieldBiasMosaic.setLayoutData(gd);
|
||||
rfcFieldBiasMosaic.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
subType = DisplayFieldData.rfcbMosaic;
|
||||
}
|
||||
});
|
||||
|
||||
spaceLabel = new Label(groupComp, SWT.NONE);
|
||||
spaceLabel.setText(" ");
|
||||
|
||||
Button rfcMultiSensorMosaic = new Button(groupComp, SWT.RADIO);
|
||||
gd = new GridData(SWT.LEFT, SWT.DEFAULT, true, false);
|
||||
rfcMultiSensorMosaic.setLayoutData(gd);
|
||||
rfcMultiSensorMosaic.setText("RFC Multisensor Mosaic");
|
||||
rfcMultiSensorMosaic.setFont(font);
|
||||
rfcMultiSensorMosaic.setLayoutData(gd);
|
||||
rfcMultiSensorMosaic.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
subType = DisplayFieldData.rfcmMosaic;
|
||||
}
|
||||
});
|
||||
|
||||
spaceLabel = new Label(groupComp, SWT.NONE);
|
||||
spaceLabel.setText(" ");
|
||||
|
||||
Button rawQ2Mosaic = new Button(groupComp, SWT.RADIO);
|
||||
gd = new GridData(SWT.LEFT, SWT.DEFAULT, true, false);
|
||||
rawQ2Mosaic.setLayoutData(gd);
|
||||
rawQ2Mosaic.setText("Raw Q2 Mosaic");
|
||||
rawQ2Mosaic.setFont(font);
|
||||
rawQ2Mosaic.setLayoutData(gd);
|
||||
rawQ2Mosaic.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
subType = DisplayFieldData.qmosaic;
|
||||
}
|
||||
});
|
||||
|
||||
spaceLabel = new Label(groupComp, SWT.NONE);
|
||||
spaceLabel.setText(" ");
|
||||
|
||||
Button localBQ2Mosaic = new Button(groupComp, SWT.RADIO);
|
||||
gd = new GridData(SWT.LEFT, SWT.DEFAULT, true, false);
|
||||
localBQ2Mosaic.setLayoutData(gd);
|
||||
localBQ2Mosaic.setText("Local Bias Q2 Mosaic");
|
||||
localBQ2Mosaic.setFont(font);
|
||||
localBQ2Mosaic.setLayoutData(gd);
|
||||
localBQ2Mosaic.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
subType = DisplayFieldData.lqmosaic;
|
||||
}
|
||||
});
|
||||
|
||||
spaceLabel = new Label(groupComp, SWT.NONE);
|
||||
spaceLabel.setText(" ");
|
||||
|
||||
Button mQ2Mosaic = new Button(groupComp, SWT.RADIO);
|
||||
gd = new GridData(SWT.LEFT, SWT.DEFAULT, true, false);
|
||||
mQ2Mosaic.setLayoutData(gd);
|
||||
mQ2Mosaic.setText("Multisensor Q2 Mosaic");
|
||||
mQ2Mosaic.setFont(font);
|
||||
mQ2Mosaic.setLayoutData(gd);
|
||||
mQ2Mosaic.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
subType = DisplayFieldData.mlqmosaic;
|
||||
}
|
||||
});
|
||||
|
||||
spaceLabel = new Label(groupComp, SWT.NONE);
|
||||
spaceLabel.setText(" ");
|
||||
|
||||
Button local1Mosaic = new Button(groupComp, SWT.RADIO);
|
||||
gd = new GridData(SWT.LEFT, SWT.DEFAULT, true, false);
|
||||
local1Mosaic.setLayoutData(gd);
|
||||
local1Mosaic.setText("Local Field #1");
|
||||
local1Mosaic.setFont(font);
|
||||
local1Mosaic.setLayoutData(gd);
|
||||
local1Mosaic.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
subType = DisplayFieldData.localField1;
|
||||
}
|
||||
});
|
||||
|
||||
spaceLabel = new Label(groupComp, SWT.NONE);
|
||||
spaceLabel.setText(" ");
|
||||
|
||||
Button local2Mosaic = new Button(groupComp, SWT.RADIO);
|
||||
gd = new GridData(SWT.LEFT, SWT.DEFAULT, true, false);
|
||||
local2Mosaic.setLayoutData(gd);
|
||||
local2Mosaic.setText("Local Field #2");
|
||||
local2Mosaic.setFont(font);
|
||||
local2Mosaic.setLayoutData(gd);
|
||||
local2Mosaic.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
subType = DisplayFieldData.localField2;
|
||||
}
|
||||
});
|
||||
|
||||
spaceLabel = new Label(groupComp, SWT.NONE);
|
||||
spaceLabel.setText(" ");
|
||||
|
||||
Button local3Mosaic = new Button(groupComp, SWT.RADIO);
|
||||
gd = new GridData(SWT.LEFT, SWT.DEFAULT, true, false);
|
||||
local3Mosaic.setLayoutData(gd);
|
||||
local3Mosaic.setText("Local Field #3");
|
||||
local3Mosaic.setFont(font);
|
||||
local3Mosaic.setLayoutData(gd);
|
||||
local3Mosaic.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
subType = DisplayFieldData.localField3;
|
||||
}
|
||||
});
|
||||
|
||||
spaceLabel = new Label(groupComp, SWT.NONE);
|
||||
spaceLabel.setText(" ");
|
||||
|
||||
Button rfcQpeMosaic = new Button(groupComp, SWT.RADIO);
|
||||
gd = new GridData(SWT.LEFT, SWT.DEFAULT, true, false);
|
||||
rfcQpeMosaic.setLayoutData(gd);
|
||||
rfcQpeMosaic.setText("RFC QPE Mosaic");
|
||||
rfcQpeMosaic.setFont(font);
|
||||
rfcQpeMosaic.setLayoutData(gd);
|
||||
rfcQpeMosaic.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
subType = DisplayFieldData.rfcMosaic;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Process the selection.
|
||||
|
|
|
@ -16,6 +16,14 @@
|
|||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 7, 2015 16954 cgobs Fix for cv_use issue - using getFieldName() in certain parts.
|
||||
* </pre>
|
||||
**/
|
||||
package com.raytheon.viz.mpe.ui.dialogs.polygon;
|
||||
|
||||
|
@ -233,7 +241,7 @@ public class PolygonEditManager {
|
|||
|
||||
String polyEditStr = editAction.toPrettyName()
|
||||
+ " "
|
||||
+ (subDrawSource != null ? subDrawSource.getCv_use()
|
||||
+ (subDrawSource != null ? subDrawSource.getFieldName()
|
||||
: String.format("%6.2f", precipValue)) + " "
|
||||
+ editPoints.length + " " + (visible ? "1" : "0");
|
||||
toUse.append(idx + " " + polyEditStr + "\n");
|
||||
|
@ -288,7 +296,7 @@ public class PolygonEditManager {
|
|||
}
|
||||
|
||||
private static File getHourlyEditFile(DisplayFieldData fieldData, Date date) {
|
||||
String fieldname = fieldData.getCv_use();
|
||||
String fieldname = fieldData.getFieldName();
|
||||
String polygonDir = MPEDisplayManager.getPolygonEditDir();
|
||||
|
||||
/* Build the polygon filename. */
|
||||
|
@ -299,7 +307,7 @@ public class PolygonEditManager {
|
|||
|
||||
private static File getPersistentEditFile(DisplayFieldData fieldData,
|
||||
Date date) {
|
||||
String fieldname = fieldData.getCv_use();
|
||||
String fieldname = fieldData.getFieldName();
|
||||
String polygonDir = MPEDisplayManager.getPolygonEditDir();
|
||||
/* Build the persistent polygon filename. */
|
||||
String persistentFilename = String.format("%s/DrawPoly%s", polygonDir,
|
||||
|
@ -345,7 +353,7 @@ public class PolygonEditManager {
|
|||
DisplayFieldData subData = null;
|
||||
for (DisplayFieldData fieldData : DisplayFieldData
|
||||
.values()) {
|
||||
if (fieldData.getCv_use()
|
||||
if (fieldData.getFieldName()
|
||||
.equalsIgnoreCase(subCvUse)) {
|
||||
subData = fieldData;
|
||||
break;
|
||||
|
|
|
@ -58,8 +58,6 @@ public class PostAnalysisManager
|
|||
private XmrgFile.XmrgHeader xmrgHeader = null;
|
||||
private boolean misbin[][] = getMisBin();
|
||||
|
||||
private DailyQcUtils dqc = DailyQcUtils.getInstance();
|
||||
|
||||
private static final double MISSING_VALUE = -9999.0;
|
||||
|
||||
private static final double MM_PER_INCH = 25.4;
|
||||
|
@ -88,14 +86,14 @@ public class PostAnalysisManager
|
|||
|
||||
}
|
||||
|
||||
public Date getSelectedDate()
|
||||
public static Date getSelectedDate()
|
||||
{
|
||||
Date date = dqc.pdata[dqc.pcpn_day].data_time;
|
||||
Date date = DailyQcUtils.pdata[DailyQcUtils.pcpn_day].data_time;
|
||||
|
||||
return date;
|
||||
}
|
||||
|
||||
public String getSelectedDateString()
|
||||
public static String getSelectedDateString()
|
||||
{
|
||||
String header = "postAnalysisManager.getSelectedDateString(): ";
|
||||
|
||||
|
@ -116,7 +114,7 @@ public class PostAnalysisManager
|
|||
|
||||
}
|
||||
|
||||
public String get24HourGageOnlyFilePath()
|
||||
public static String get24HourGageOnlyFilePath()
|
||||
{
|
||||
String filePath = null;
|
||||
final String mpe_grid_precip_dir_tok = "mpe_grid_precip_dir";
|
||||
|
@ -124,9 +122,9 @@ public class PostAnalysisManager
|
|||
|
||||
String mpe_grid_precip_dir = ad.getToken(mpe_grid_precip_dir_tok);
|
||||
|
||||
String currentQcArea = dqc.currentQcArea;
|
||||
String currentQcArea = DailyQcUtils.currentQcArea;
|
||||
|
||||
String dateString = getSelectedDateString();
|
||||
String dateString = PostAnalysisManager.getSelectedDateString();
|
||||
|
||||
// String dateString = "20140112";
|
||||
|
||||
|
@ -232,7 +230,7 @@ public class PostAnalysisManager
|
|||
|
||||
String[] fileNameArray = fileDirectory.list();
|
||||
|
||||
int precipDay = dqc.pcpn_day;
|
||||
int precipDay = DailyQcUtils.pcpn_day;
|
||||
|
||||
|
||||
List<String> filteredFileNameList = filterFileNames(precipDay, fileNameArray);
|
||||
|
@ -270,9 +268,9 @@ public class PostAnalysisManager
|
|||
return endTime;
|
||||
}
|
||||
|
||||
public double[][] get24HourTotalPrecip(int height, int width, double scaleFactor)
|
||||
public static double[][] get24HourTotalPrecip(int height, int width, double scaleFactor)
|
||||
{
|
||||
Date endDate = getSelectedDate();
|
||||
Date endDate = PostAnalysisManager.getSelectedDate();
|
||||
// System.out.println("PostAnalysisManager.getEndTime() = " + endDate);
|
||||
double missingValue = -999.0;
|
||||
|
||||
|
@ -352,8 +350,8 @@ public class PostAnalysisManager
|
|||
double distanceSquared;
|
||||
double nearestDistanceSquared = 9999999.0;
|
||||
|
||||
int XOR = dqc.getHrap_grid().hrap_minx;
|
||||
int YOR = dqc.getHrap_grid().hrap_miny;
|
||||
int XOR = DailyQcUtils.getHrap_grid().hrap_minx;
|
||||
int YOR = DailyQcUtils.getHrap_grid().hrap_miny;
|
||||
|
||||
// Find the distance to the nearest precip station from this HRAP
|
||||
// bin at [i][j]
|
||||
|
@ -389,7 +387,7 @@ public class PostAnalysisManager
|
|||
{
|
||||
String header = "PostAnalysisManager.create3DGridArray(): ";
|
||||
|
||||
Hrap_Grid hrap_grid = dqc.getHrap_grid();
|
||||
Hrap_Grid hrap_grid = DailyQcUtils.getHrap_grid();
|
||||
int maxI = hrap_grid.maxi;
|
||||
int maxJ = hrap_grid.maxj;
|
||||
|
||||
|
@ -408,7 +406,7 @@ public class PostAnalysisManager
|
|||
{
|
||||
//String header = "PostAnalysisManager.create2DGridArray(): ";
|
||||
|
||||
Hrap_Grid hrap_grid = dqc.getHrap_grid();
|
||||
Hrap_Grid hrap_grid = DailyQcUtils.getHrap_grid();
|
||||
int maxCols = hrap_grid.maxi;
|
||||
int maxRows = hrap_grid.maxj;
|
||||
|
||||
|
@ -992,7 +990,7 @@ public class PostAnalysisManager
|
|||
}
|
||||
*/
|
||||
|
||||
Hrap_Grid grid = dqc.getHrap_grid();
|
||||
Hrap_Grid grid = DailyQcUtils.getHrap_grid();
|
||||
|
||||
int maxJ = grid.maxj;
|
||||
int maxI = grid.maxi;
|
||||
|
@ -1249,8 +1247,8 @@ public class PostAnalysisManager
|
|||
|
||||
{
|
||||
String header = "PostAnalysisManager.mergeData(): ";
|
||||
int MAXX = dqc.getHrap_grid().maxi;
|
||||
int MAXY = dqc.getHrap_grid().maxj;
|
||||
int MAXX = DailyQcUtils.getHrap_grid().maxi;
|
||||
int MAXY = DailyQcUtils.getHrap_grid().maxj;
|
||||
|
||||
double logRHat;
|
||||
int i, j;
|
||||
|
@ -1258,10 +1256,10 @@ public class PostAnalysisManager
|
|||
double weightingFactor;
|
||||
int precipStationCount;
|
||||
|
||||
// List<Station> precipStationList = dqc.precip_stations;
|
||||
List<Station> precipStationList = DailyQcUtils.precip_stations;
|
||||
|
||||
|
||||
precipStationCount = dqc.precip_stations.size();
|
||||
precipStationCount = precipStationList.size();
|
||||
|
||||
logRHat = Math.log((double) rhat);
|
||||
|
||||
|
@ -1316,7 +1314,7 @@ public class PostAnalysisManager
|
|||
//System.out.println(header + "merge section");
|
||||
|
||||
weightingFactor = computeObservedWeight (i, j, logRHat,
|
||||
dqc.precip_stations, precipStationCount, estimatedScale);
|
||||
precipStationList, precipStationCount, estimatedScale);
|
||||
|
||||
double mergedValueInInches = weightingFactor * gageOnlyGridValueInInches +
|
||||
(1.0 - weightingFactor) * qpeInches;
|
||||
|
|
|
@ -63,7 +63,6 @@ public class SummedHourlyMpeDlg extends BasePostAnalysisDlg
|
|||
|
||||
private static final int SECONDS_PER_HOUR = 3600;
|
||||
private static final int SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;
|
||||
private DailyQcUtils dqc = DailyQcUtils.getInstance();
|
||||
|
||||
/** Bundle file location */
|
||||
//private static final String BUNDLE_LOC = "bundles/MPE/postAnalysisBundle.xml";
|
||||
|
@ -80,11 +79,10 @@ public class SummedHourlyMpeDlg extends BasePostAnalysisDlg
|
|||
|
||||
setResourceType1(PAResourceType.XMRG);
|
||||
setResourceType2(PAResourceType.ASCII_XMRG);
|
||||
PostAnalysisManager paMgr = new PostAnalysisManager();
|
||||
|
||||
// 24 accumulated 1-hour precip grids
|
||||
|
||||
Hrap_Grid grid = dqc.getHrap_grid();
|
||||
Hrap_Grid grid = DailyQcUtils.getHrap_grid();
|
||||
int wfoMinX = grid.hrap_minx;
|
||||
int wfoMinY = grid.hrap_miny;
|
||||
int width = grid.maxi;
|
||||
|
@ -97,7 +95,7 @@ public class SummedHourlyMpeDlg extends BasePostAnalysisDlg
|
|||
|
||||
|
||||
float scaleFactor = 25.4f * 100.0f;
|
||||
double[][] totalPrecipGrid = paMgr.get24HourTotalPrecip(height, width, scaleFactor);
|
||||
double[][] totalPrecipGrid = PostAnalysisManager.get24HourTotalPrecip(height, width, scaleFactor);
|
||||
|
||||
|
||||
//floatArray units are hundredths of MM
|
||||
|
@ -106,7 +104,7 @@ public class SummedHourlyMpeDlg extends BasePostAnalysisDlg
|
|||
setDataArray1(floatArray);
|
||||
|
||||
//24 hour gage only
|
||||
String dataFilePath2 = paMgr.get24HourGageOnlyFilePath();
|
||||
String dataFilePath2 = PostAnalysisManager.get24HourGageOnlyFilePath();
|
||||
setDataFileName2(dataFilePath2);
|
||||
|
||||
return;
|
||||
|
@ -116,12 +114,12 @@ public class SummedHourlyMpeDlg extends BasePostAnalysisDlg
|
|||
private float[] convertToFloatArray(double[][] totalPrecipGrid, float unitConversionFactor)
|
||||
{
|
||||
String header = "SummedHourlyMpeDlg.convertToFloatArray(qpeAccum24hr): ";
|
||||
Hrap_Grid hrap_grid = dqc.getHrap_grid();
|
||||
Hrap_Grid hrap_grid = DailyQcUtils.getHrap_grid();
|
||||
int maxCols = hrap_grid.maxi;
|
||||
int maxRows = hrap_grid.maxj;
|
||||
int precipDay = dqc.pcpn_day;
|
||||
int precipDay = DailyQcUtils.pcpn_day;
|
||||
|
||||
System.out.println(header + "DailyQcUtils.pcpn_day = " + dqc.pcpn_day);
|
||||
System.out.println(header + "DailyQcUtils.pcpn_day = " + DailyQcUtils.pcpn_day);
|
||||
System.out.println(header + "precipDay = " + precipDay);
|
||||
float[] valueArray = new float[maxRows*maxCols];
|
||||
|
||||
|
|
|
@ -16,6 +16,14 @@
|
|||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 7, 2015 16954 cgobs Fix for cv_use issue - using getFieldName() in certain parts.
|
||||
* </pre>
|
||||
**/
|
||||
package com.raytheon.viz.mpe.ui.rsc;
|
||||
|
||||
|
@ -580,7 +588,7 @@ public class DisplayMeanArealPrecipResource extends
|
|||
// this will accumulate all hours requested and display it
|
||||
// this holds current xmrg values
|
||||
short[] tempdata = null;
|
||||
String cv_use = displayMgr.getDisplayFieldType().getCv_use();
|
||||
String cv_use = displayMgr.getDisplayFieldType().getFieldName();
|
||||
String dirname = appsDefaults.getToken(displayMgr.getDisplayFieldType()
|
||||
.getDirToken());
|
||||
String fname = "";
|
||||
|
|
|
@ -73,6 +73,8 @@ import com.raytheon.viz.mpe.ui.actions.DrawDQCStations;
|
|||
import com.raytheon.viz.mpe.ui.actions.OtherPrecipOptions;
|
||||
import com.raytheon.viz.mpe.util.CreateMap;
|
||||
import com.raytheon.viz.mpe.util.DailyQcUtils;
|
||||
import com.raytheon.viz.mpe.util.DailyQcUtils.Hrap_Grid;
|
||||
import com.raytheon.viz.mpe.util.DailyQcUtils.Pcp;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
import com.vividsolutions.jts.geom.GeometryFactory;
|
||||
|
||||
|
@ -97,10 +99,6 @@ public class PlotGriddedPrecipResource extends
|
|||
IMpeResource {
|
||||
|
||||
MPEDisplayManager displayMgr = null;
|
||||
|
||||
private DailyQcUtils dqc = DailyQcUtils.getInstance();
|
||||
|
||||
private DrawDQCStations ddq = DrawDQCStations.getInstance();
|
||||
|
||||
private GriddedImageDisplay2 gridDisplay;
|
||||
|
||||
|
@ -124,11 +122,11 @@ public class PlotGriddedPrecipResource extends
|
|||
|
||||
int display_flag;
|
||||
|
||||
// Hrap_Grid hrap_grid = DailyQcUtils.getHrap_grid();
|
||||
Hrap_Grid hrap_grid = DailyQcUtils.getHrap_grid();
|
||||
|
||||
// Pcp pcp = DailyQcUtils.pcp;
|
||||
Pcp pcp = DailyQcUtils.pcp;
|
||||
|
||||
// Pcp spf = DailyQcUtils.spf;
|
||||
Pcp spf = DailyQcUtils.spf;
|
||||
|
||||
private ColorMapParameters parameters = new ColorMapParameters();
|
||||
|
||||
|
@ -143,7 +141,7 @@ public class PlotGriddedPrecipResource extends
|
|||
this.colorSet = colorSet;
|
||||
}
|
||||
|
||||
ColorMap precip_colormap = ddq.colorMap;
|
||||
ColorMap precip_colormap = DrawDQCStations.colorMap;
|
||||
|
||||
RGB color = null;
|
||||
|
||||
|
@ -154,8 +152,8 @@ public class PlotGriddedPrecipResource extends
|
|||
public void plot_gridded_precip(String prefix, int num, int mnum) {
|
||||
int pcpn_time_step = MPEDisplayManager.pcpn_time_step;
|
||||
int rsmode = OtherPrecipOptions.rsmode;
|
||||
boolean wfo_all = dqc.wfo_all;
|
||||
int[] wfo_in_use = dqc.wfo_in_use;
|
||||
boolean wfo_all = DailyQcUtils.wfo_all;
|
||||
int[] wfo_in_use = DailyQcUtils.wfo_in_use;
|
||||
CreateMap cm = new CreateMap();
|
||||
float value = 0;
|
||||
|
||||
|
@ -225,37 +223,37 @@ public class PlotGriddedPrecipResource extends
|
|||
if (num == 0) {
|
||||
i1 = 0;
|
||||
}
|
||||
if (dqc.pcp_in_use[num + mnum] != -1
|
||||
&& dqc.pcp_in_use[num + mnum - i1] != -1) {
|
||||
cm.read_file(file, num + mnum, dqc.spf);
|
||||
cm.read_file(file, num + mnum - i1, dqc.pcp);
|
||||
if (DailyQcUtils.pcp_in_use[num + mnum] != -1
|
||||
&& DailyQcUtils.pcp_in_use[num + mnum - i1] != -1) {
|
||||
cm.read_file(file, num + mnum, spf);
|
||||
cm.read_file(file, num + mnum - i1, pcp);
|
||||
|
||||
for (i = 0; i < (dqc.getHrap_grid().maxi - dqc.getHrap_grid().hrap_minx) - 1; i++) {
|
||||
for (j = 0; j < dqc.getHrap_grid().maxj - dqc.getHrap_grid().hrap_miny - 1; j++) {
|
||||
dqc.spf.value[i][j] = (dqc.spf.value[i][j] + dqc.pcp.value[i][j]) / 2;
|
||||
for (i = 0; i < (hrap_grid.maxi - hrap_grid.hrap_minx) - 1; i++) {
|
||||
for (j = 0; j < hrap_grid.maxj - hrap_grid.hrap_miny - 1; j++) {
|
||||
spf.value[i][j] = (spf.value[i][j] + pcp.value[i][j]) / 2;
|
||||
}
|
||||
}
|
||||
} else if (dqc.pcp_in_use[num + mnum] == 1) {
|
||||
cm.read_file(file, num + mnum, dqc.spf);
|
||||
} else if (dqc.pcp_in_use[num + mnum - i1] == 1) {
|
||||
cm.read_file(file, num + mnum - i1, dqc.spf);
|
||||
} else if (DailyQcUtils.pcp_in_use[num + mnum] == 1) {
|
||||
cm.read_file(file, num + mnum, spf);
|
||||
} else if (DailyQcUtils.pcp_in_use[num + mnum - i1] == 1) {
|
||||
cm.read_file(file, num + mnum - i1, spf);
|
||||
}
|
||||
}
|
||||
|
||||
if (dqc.pcp_in_use[num] == -1) {
|
||||
if (DailyQcUtils.pcp_in_use[num] == -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
cm.read_file(file, num, dqc.pcp);
|
||||
cm.read_file(file, num, pcp);
|
||||
|
||||
buf = FloatBuffer.allocate(dqc.getHrap_grid().maxi * dqc.getHrap_grid().maxj);
|
||||
buf = FloatBuffer.allocate(hrap_grid.maxi * hrap_grid.maxj);
|
||||
|
||||
/* Get value in the HRAP grid bins. */
|
||||
// for (i = 0; i < (hrap_grid.maxi); i++) {
|
||||
// for (j = 0; j < hrap_grid.maxj; j++) {
|
||||
for (j = dqc.getHrap_grid().maxj - 1; j >= 0; j--) {
|
||||
for (i = 0; i < dqc.getHrap_grid().maxi; i++) {
|
||||
if (dqc.getHrap_grid().owner[i][j] == -1) {
|
||||
for (j = hrap_grid.maxj - 1; j >= 0; j--) {
|
||||
for (i = 0; i < hrap_grid.maxi; i++) {
|
||||
if (hrap_grid.owner[i][j] == -1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -266,14 +264,14 @@ public class PlotGriddedPrecipResource extends
|
|||
break;
|
||||
}
|
||||
|
||||
if (dqc.getHrap_grid().owner[i][j] == wfo_in_use[m]) {
|
||||
if (hrap_grid.owner[i][j] == wfo_in_use[m]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Float fg = 0f;
|
||||
value = dqc.pcp.value[i][j];
|
||||
value = pcp.value[i][j];
|
||||
// fg = (float) (value / 100.0);
|
||||
if (fg.isNaN() || value < 0) {
|
||||
fg = -9999f;
|
||||
|
@ -302,8 +300,8 @@ public class PlotGriddedPrecipResource extends
|
|||
}
|
||||
buf.rewind();
|
||||
|
||||
Rectangle extent = new Rectangle(dqc.getHrap_grid().hrap_minx,
|
||||
dqc.getHrap_grid().hrap_miny, dqc.getHrap_grid().maxi, dqc.getHrap_grid().maxj);
|
||||
Rectangle extent = new Rectangle(hrap_grid.hrap_minx,
|
||||
hrap_grid.hrap_miny, hrap_grid.maxi, hrap_grid.maxj);
|
||||
|
||||
if (extent.x == 0 && extent.y == 0) {
|
||||
Rectangle coord = null;
|
||||
|
@ -388,7 +386,7 @@ public class PlotGriddedPrecipResource extends
|
|||
int x = p.x - extent.x;
|
||||
int y = p.y - extent.y;
|
||||
|
||||
short s = (short) dqc.pcp.value[x][y];
|
||||
short s = (short) pcp.value[x][y];
|
||||
|
||||
double d = parameters.getDataToDisplayConverter().convert(s);
|
||||
|
||||
|
@ -464,20 +462,21 @@ public class PlotGriddedPrecipResource extends
|
|||
@Override
|
||||
protected void initInternal(IGraphicsTarget target) throws VizException {
|
||||
this.target = target;
|
||||
time_pos = ddq.time_pos;
|
||||
plot_gridded_precip(ddq.prefix, time_pos, 100);
|
||||
time_pos = DrawDQCStations.time_pos;
|
||||
plot_gridded_precip(DrawDQCStations.prefix, time_pos, 100);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void paintInternal(IGraphicsTarget target,
|
||||
PaintProperties paintProps) throws VizException {
|
||||
if (buf == null || dqc.grids_flag != 1
|
||||
if (buf == null || (DailyQcUtils.grids_flag != 1 && DailyQcUtils.contour_flag != 1)
|
||||
|| displayMgr.isQpf() != true) {
|
||||
return;
|
||||
}
|
||||
|
||||
Set<DisplayMode> mode = displayMgr.getDisplayMode();
|
||||
System.out.println("Mode is: "+mode.toString());
|
||||
|
||||
if (mode.contains(DisplayMode.Image)) {
|
||||
if (gridDisplay == null) {
|
||||
|
@ -514,11 +513,11 @@ public class PlotGriddedPrecipResource extends
|
|||
*/
|
||||
@Override
|
||||
public String getName() {
|
||||
if (ddq.qcmode == "") {
|
||||
if (DrawDQCStations.qcmode == "") {
|
||||
return "No Data Available";
|
||||
}
|
||||
|
||||
return ddq.qcmode;
|
||||
return DrawDQCStations.qcmode;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -151,7 +151,7 @@ public class PointPrecipPlotResource extends
|
|||
|
||||
private DailyQcUtils dqc = DailyQcUtils.getInstance();
|
||||
|
||||
private DrawDQCStations ddq = DrawDQCStations.getInstance();
|
||||
// private DrawDQCStations ddq = DrawDQCStations.getInstance();
|
||||
|
||||
static int prevPcpnDay;
|
||||
|
||||
|
@ -212,7 +212,7 @@ public class PointPrecipPlotResource extends
|
|||
kv.append(":");
|
||||
kv.append(pm);
|
||||
dataMap.put(kv.toString(), gageData);
|
||||
pdataMap.put(kv.toString(), dqc.pdata[dqc.pcpn_day].stn[i]);
|
||||
pdataMap.put(kv.toString(), DailyQcUtils.pdata[DailyQcUtils.pcpn_day].stn[i]);
|
||||
|
||||
/* Create a small envelope around the point */
|
||||
Coordinate p1 = new Coordinate(xy.x + .02, xy.y + .02);
|
||||
|
@ -223,11 +223,11 @@ public class PointPrecipPlotResource extends
|
|||
data.add("STATION: "
|
||||
+ gageData.hb5
|
||||
+ " VALUE: "
|
||||
+ dqc.pdata[dqc.pcpn_day].stn[i].frain[time_pos].data);
|
||||
+ DailyQcUtils.pdata[DailyQcUtils.pcpn_day].stn[i].frain[time_pos].data);
|
||||
strTree.insert(env, data);
|
||||
i++;
|
||||
}
|
||||
prevPcpnDay = dqc.pcpn_day;
|
||||
prevPcpnDay = DailyQcUtils.pcpn_day;
|
||||
}
|
||||
// target.setNeedsRefresh(true);
|
||||
}
|
||||
|
@ -292,8 +292,8 @@ public class PointPrecipPlotResource extends
|
|||
throws VizException {
|
||||
|
||||
if (MPEDisplayManager.getCurrent().isQpf() == true
|
||||
&& (dqc.points_flag == 1)) {
|
||||
int type = dqc.plot_view;
|
||||
&& (DailyQcUtils.points_flag == 1)) {
|
||||
int type = DailyQcUtils.plot_view;
|
||||
int i = 0;
|
||||
int m = 0;
|
||||
int dcmode = OtherPrecipOptions.dcmode;
|
||||
|
@ -311,7 +311,7 @@ public class PointPrecipPlotResource extends
|
|||
String val = "";
|
||||
|
||||
if (MPEDisplayManager.pcpn_time_step == 0) {
|
||||
time_pos = dqc.pcpn_time;
|
||||
time_pos = DailyQcUtils.pcpn_time;
|
||||
} else {
|
||||
time_pos = 4;
|
||||
}
|
||||
|
@ -323,7 +323,7 @@ public class PointPrecipPlotResource extends
|
|||
double[] centerpixels = descriptor.worldToPixel(new double[] { c.x,
|
||||
c.y });
|
||||
color = RGBColors.getRGBColor(color_map_n[15]);
|
||||
if (dqc.points_flag == 1
|
||||
if (DailyQcUtils.points_flag == 1
|
||||
&& QcPrecipOptionsDialog.isOpen == true
|
||||
&& MPEDisplayManager.getCurrent().isQpf() == true) {
|
||||
} else {
|
||||
|
@ -360,7 +360,7 @@ public class PointPrecipPlotResource extends
|
|||
|
||||
for (m = 0; m < tsmax; m++) {
|
||||
if (station.parm.substring(3, 5).equalsIgnoreCase(dqc.ts[m].abr)
|
||||
&& dqc.dflag[m + 1] == 1) {
|
||||
&& DailyQcUtils.dflag[m + 1] == 1) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -388,8 +388,8 @@ public class PointPrecipPlotResource extends
|
|||
|
||||
/* locate station in data stream */
|
||||
if ((type == 4 || type == 5)
|
||||
&& (dqc.pdata[dqc.pcpn_day].used[time_pos] == 0)
|
||||
&& (dqc.pdata[dqc.pcpn_day].level == 0)) {
|
||||
&& (DailyQcUtils.pdata[DailyQcUtils.pcpn_day].used[time_pos] == 0)
|
||||
&& (DailyQcUtils.pdata[DailyQcUtils.pcpn_day].level == 0)) {
|
||||
return;
|
||||
}
|
||||
if ((type == 4 || type == 5)
|
||||
|
@ -429,8 +429,8 @@ public class PointPrecipPlotResource extends
|
|||
tbuf = station.name;
|
||||
|
||||
} else if (type == 4) {
|
||||
if ((dqc.pdata[dqc.pcpn_day].used[time_pos] == 0)
|
||||
&& (dqc.pdata[dqc.pcpn_day].level == 0)) {
|
||||
if ((DailyQcUtils.pdata[DailyQcUtils.pcpn_day].used[time_pos] == 0)
|
||||
&& (DailyQcUtils.pdata[DailyQcUtils.pcpn_day].level == 0)) {
|
||||
return;
|
||||
|
||||
}
|
||||
|
@ -454,8 +454,8 @@ public class PointPrecipPlotResource extends
|
|||
tbuf = mbuf;
|
||||
|
||||
} else if (type == 5) {
|
||||
if ((dqc.pdata[dqc.pcpn_day].used[time_pos] == 0)
|
||||
&& (dqc.pdata[dqc.pcpn_day].level == 0)) {
|
||||
if ((DailyQcUtils.pdata[DailyQcUtils.pcpn_day].used[time_pos] == 0)
|
||||
&& (DailyQcUtils.pdata[DailyQcUtils.pcpn_day].level == 0)) {
|
||||
return;
|
||||
|
||||
}
|
||||
|
@ -716,7 +716,7 @@ public class PointPrecipPlotResource extends
|
|||
// Fonts are shared and cached, no need to init or dispose
|
||||
font = fontFactory.getMPEFont(MPEDisplayManager.getFontId());
|
||||
|
||||
if (dqc.points_flag == 1 && displayMgr.isQpf() == true) {
|
||||
if (DailyQcUtils.points_flag == 1 && displayMgr.isQpf() == true) {
|
||||
Iterator<String> iter = dataMap.keySet().iterator();
|
||||
|
||||
while (iter.hasNext()) {
|
||||
|
@ -972,11 +972,11 @@ public class PointPrecipPlotResource extends
|
|||
*/
|
||||
@Override
|
||||
public String getName() {
|
||||
if (ddq.qcmode == "") {
|
||||
if (DrawDQCStations.qcmode == "") {
|
||||
return "No Data Available";
|
||||
}
|
||||
|
||||
return ddq.qcmode;
|
||||
return DrawDQCStations.qcmode;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -41,6 +41,7 @@ import com.raytheon.viz.mpe.util.DailyQcUtils.Station;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 9, 2009 snaples Initial creation
|
||||
* Feb 5, 2015 17101 snaples Fixed issue with writing zero length bad values file.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -51,8 +52,7 @@ import com.raytheon.viz.mpe.util.DailyQcUtils.Station;
|
|||
public class BadValues {
|
||||
BufferedReader in = null;
|
||||
DailyQcUtils dqc = DailyQcUtils.getInstance();
|
||||
ReadPrecipStationList rp = new ReadPrecipStationList();
|
||||
private int max_stations = rp.getNumPstations();
|
||||
private int max_stations = dqc.precip_stations.size();
|
||||
|
||||
|
||||
public void read_bad_values(String precd, int m) {
|
||||
|
@ -194,7 +194,7 @@ public class BadValues {
|
|||
// ier=sprintf(ibuf,"%s %s %d %f\n",bad_values[i].hb5,bad_values[i].parm,
|
||||
// bad_values[i].quart,bad_values[i].fvalue);
|
||||
|
||||
ibuf = String.format("%s %s %d %f", bad_values[i].hb5,
|
||||
ibuf = String.format("%s %s %d %4.2f", bad_values[i].hb5,
|
||||
bad_values[i].parm, bad_values[i].quart,
|
||||
bad_values[i].fvalue);
|
||||
out.write(ibuf);
|
||||
|
|
|
@ -85,7 +85,7 @@ public class DailyQcUtils {
|
|||
|
||||
private String lastQcArea = "";
|
||||
|
||||
public String currentQcArea;
|
||||
public static String currentQcArea;
|
||||
|
||||
private Date currDate;
|
||||
|
||||
|
@ -101,7 +101,7 @@ public class DailyQcUtils {
|
|||
|
||||
public int init_maxmin = -1;
|
||||
|
||||
public int pcp_in_use[] = new int[500];
|
||||
public static int pcp_in_use[] = new int[500];
|
||||
|
||||
boolean newarea = false;
|
||||
|
||||
|
@ -171,13 +171,13 @@ public class DailyQcUtils {
|
|||
|
||||
public int method = 2;
|
||||
|
||||
public boolean wfo_all = false;
|
||||
public static boolean wfo_all = false;
|
||||
|
||||
public boolean render_all = true;
|
||||
|
||||
public int wfo_orig;
|
||||
|
||||
public int[] wfo_in_use = new int[20];
|
||||
public static int[] wfo_in_use = new int[20];
|
||||
|
||||
public String[] tag = new String[20];
|
||||
|
||||
|
@ -261,39 +261,39 @@ public class DailyQcUtils {
|
|||
|
||||
public String mpe_show_missing_gage;
|
||||
|
||||
public int isom = -1;
|
||||
public static int isom = -1;
|
||||
|
||||
public int old_isom = -1;
|
||||
public static int old_isom = -1;
|
||||
|
||||
public ArrayList<Station> precip_stations = new ArrayList<Station>();
|
||||
public static ArrayList<Station> precip_stations = new ArrayList<Station>();
|
||||
|
||||
public ArrayList<Station> temperature_stations = new ArrayList<Station>();
|
||||
public static ArrayList<Station> temperature_stations = new ArrayList<Station>();
|
||||
|
||||
public ArrayList<Station> freezing_stations = new ArrayList<Station>();
|
||||
public static ArrayList<Station> freezing_stations = new ArrayList<Station>();
|
||||
|
||||
public Pdata pdata[];
|
||||
public static Pdata pdata[];
|
||||
|
||||
public Tdata tdata[];
|
||||
public static Tdata tdata[];
|
||||
|
||||
public Zdata zdata[];
|
||||
public static Zdata zdata[];
|
||||
|
||||
private Hrap_Grid hrap_grid = new Hrap_Grid();
|
||||
private static Hrap_Grid hrap_grid = new Hrap_Grid();
|
||||
|
||||
// public static Hrap_Grid hrap_tgrid = new Hrap_Grid();
|
||||
|
||||
public static String type = "QME ";
|
||||
|
||||
public Ts[] ts;
|
||||
public static Ts[] ts;
|
||||
|
||||
public int tsmax = 0;
|
||||
public static int tsmax = 0;
|
||||
|
||||
public Maps mean_areal_precip_global[];
|
||||
|
||||
public Pcp pcp = new Pcp();
|
||||
public static Pcp pcp = new Pcp();
|
||||
|
||||
public Pcp spf = new Pcp();
|
||||
public static Pcp spf = new Pcp();
|
||||
|
||||
public Pcp tpf = new Pcp();
|
||||
public static Pcp tpf = new Pcp();
|
||||
|
||||
public Bad_Daily_Values bad_values[];
|
||||
|
||||
|
@ -443,15 +443,15 @@ public class DailyQcUtils {
|
|||
|
||||
public static int hrgt12z = -1;
|
||||
|
||||
public int[] dflag = new int[10];
|
||||
public static int[] dflag = new int[10];
|
||||
|
||||
public int[] qflag = new int[10];
|
||||
public static int[] qflag = new int[10];
|
||||
|
||||
public float pxtemp = 1.0f;
|
||||
|
||||
public int dmvalue = (int) (1.0 * 100 * 3.28 / .55);
|
||||
|
||||
public int elevation_filter_value = 0;
|
||||
public static int elevation_filter_value = 0;
|
||||
|
||||
public int temperature_filter_value = -50;
|
||||
|
||||
|
@ -474,27 +474,27 @@ public class DailyQcUtils {
|
|||
/* Function which associates the Gage QC edit levels with a value. */
|
||||
public int funct[] = { 8, 0, 6, 2, 3, 4, 5, 1, 7, 9 };
|
||||
|
||||
public int gage_char[] = new int[2];
|
||||
public static int gage_char[] = new int[2];
|
||||
|
||||
public int plot_view = 0;
|
||||
public static int plot_view = 0;
|
||||
|
||||
public boolean frzlvl_flag = true;
|
||||
|
||||
public int find_station_flag = -1;
|
||||
|
||||
public int pcpn_time = 0;
|
||||
public static int pcpn_time = 0;
|
||||
|
||||
public int pcp_flag = -1;
|
||||
public static int pcp_flag = -1;
|
||||
|
||||
public int pcpn_day = 0;
|
||||
public static int pcpn_day = 0;
|
||||
|
||||
public int contour_flag = -1;
|
||||
public static int contour_flag = -1;
|
||||
|
||||
public int points_flag = 1;
|
||||
public static int points_flag = 1;
|
||||
|
||||
public int grids_flag = -1;
|
||||
public static int grids_flag = -1;
|
||||
|
||||
public int map_flag = -1;
|
||||
public static int map_flag = -1;
|
||||
|
||||
static int curHrMinSec = -1;
|
||||
|
||||
|
@ -903,7 +903,7 @@ public class DailyQcUtils {
|
|||
return retval;
|
||||
}
|
||||
|
||||
public int getEnding6HourObsTime() {
|
||||
public static int getEnding6HourObsTime() {
|
||||
String s = appsDefaults.getToken(dqc_ending_6hour_obstime_tok);
|
||||
int value = ((!(null == s)) ? Integer.parseInt(s) : -1);
|
||||
|
||||
|
@ -917,6 +917,9 @@ public class DailyQcUtils {
|
|||
String currntQcArea, int days, boolean autoqc) {
|
||||
currentQcArea = currntQcArea;
|
||||
currDate = currentDate;
|
||||
if (prevDate == null){
|
||||
prevDate = currDate;
|
||||
}
|
||||
selDate = prevDate;
|
||||
auto_dailyqc_flag = autoqc;
|
||||
qcDays = MPEDataManager.getInstance().getDQCDays();
|
||||
|
@ -1045,7 +1048,7 @@ public class DailyQcUtils {
|
|||
*/
|
||||
Calendar currentTime = Calendar
|
||||
.getInstance(TimeZone.getTimeZone("GMT"));
|
||||
|
||||
// btime.set(Calendar.DAY_OF_MONTH, hydro_curDay);
|
||||
emonth = btime.get(Calendar.MONTH);
|
||||
Calendar otime = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
|
||||
otime.setTime(btime.getTime());
|
||||
|
@ -2127,7 +2130,7 @@ public class DailyQcUtils {
|
|||
/**
|
||||
* @return the hrap_grid
|
||||
*/
|
||||
public Hrap_Grid getHrap_grid() {
|
||||
public static Hrap_Grid getHrap_grid() {
|
||||
return hrap_grid;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@ import com.raytheon.viz.mpe.util.DailyQcUtils.Station;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 11, 2009 snaples Initial creation
|
||||
* Feb 5, 2015 17101 snaples Updated max_stations to use size of dqc.precip_stations.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -68,8 +69,7 @@ public class GetBadSnotel {
|
|||
/* Retrieve the number of days to QC data for. */
|
||||
num_qc_days = dqc.qcDays;
|
||||
|
||||
ReadPrecipStationList pl = new ReadPrecipStationList();
|
||||
int max_stations = pl.getNumPstations();
|
||||
int max_stations = dqc.precip_stations.size();
|
||||
// Pdata[] pdata = DailyQcUtils.pdata;
|
||||
|
||||
for (j = 0; j < num_qc_days; j++) {
|
||||
|
|
|
@ -36,6 +36,7 @@ import com.raytheon.viz.mpe.util.DailyQcUtils.Station;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 23, 2009 snaples Initial creation
|
||||
* Feb 3, 2015 16993 snaples Fixed if condition on cparm.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -133,8 +134,8 @@ public class InitPrecipClimo {
|
|||
continue;
|
||||
}
|
||||
|
||||
if (tokens[1].equalsIgnoreCase("PPMPBCM")
|
||||
&& tokens[1].equalsIgnoreCase("PPMRZCM")) {
|
||||
if (!(tokens[1].equalsIgnoreCase("PPMPBCM"))
|
||||
&& !(tokens[1].equalsIgnoreCase("PPMRZCM"))) {
|
||||
line = in.readLine();
|
||||
++record_count;
|
||||
continue;
|
||||
|
|
|
@ -44,6 +44,7 @@ import com.raytheon.viz.mpe.core.MPEDataManager;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 24, 2009 snaples Initial creation
|
||||
* April , 2012 8672 lbousaidi fixed the reading of the PRISM data.
|
||||
* Feb 3, 2015 16993 snaples fixed color scale data conversion issue.
|
||||
* </pre>
|
||||
*
|
||||
* @author snaples
|
||||
|
|
|
@ -73,8 +73,7 @@ public class ReadPrecipStationList {
|
|||
e.printStackTrace();
|
||||
}
|
||||
|
||||
ReadPrecipStationList.max_pstations = dqc.precip_stations
|
||||
.size();
|
||||
max_pstations = dqc.precip_stations.size();
|
||||
|
||||
return dqc.precip_stations;
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ public class ReadQPFGrids {
|
|||
} else {
|
||||
iflag = 0;
|
||||
}
|
||||
for (i = 0; i < gmaxi; i++) {
|
||||
for (i = 0; i < (dqc.getHrap_grid().maxi); i++) {
|
||||
|
||||
if (iflag == 0) {
|
||||
kbuf = in.readLine().trim();
|
||||
|
@ -130,7 +130,7 @@ public class ReadQPFGrids {
|
|||
|
||||
// if (ghrapi > minhrapi && ghrapi <= maxhrapi) {
|
||||
|
||||
for (j = 0; j < gmaxj; j++) {
|
||||
for (j = 0; j < (dqc.getHrap_grid().maxj); j++) {
|
||||
|
||||
// ghrapj = gminj + j;
|
||||
//
|
||||
|
|
|
@ -86,6 +86,7 @@ public class ReadSnowData {
|
|||
}
|
||||
}
|
||||
in = new BufferedReader(new FileReader(prece));
|
||||
System.out.println("Reading Snow data from : " + prece);
|
||||
|
||||
// int p = 1;
|
||||
// String sn = cbuf;
|
||||
|
@ -168,6 +169,7 @@ public class ReadSnowData {
|
|||
dqc.pdata[i].stn[j].srain[kk].data = Float.parseFloat(qbuf);
|
||||
|
||||
dqc.pdata[i].stn[j].srain[kk].qual = 8;
|
||||
System.out.println("Loading Snow Data for Station "+ hb5 +" with value: "+ dqc.pdata[i].stn[j].srain[kk].data);
|
||||
|
||||
break;
|
||||
|
||||
|
|
71
edexOsgi/build.edex/esb/bin/ndmMenuIngester.sh
Normal file
71
edexOsgi/build.edex/esb/bin/ndmMenuIngester.sh
Normal file
|
@ -0,0 +1,71 @@
|
|||
#!/bin/bash
|
||||
##
|
||||
# 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.
|
||||
##
|
||||
# NDM Menu File Ingester
|
||||
|
||||
if [ "$1" == "-help" ];
|
||||
then
|
||||
echo ""
|
||||
echo "ndmMenuIngester.sh <ndmFileDirectory> <ndmMenuFileName>"
|
||||
echo " ndmFileDirectory is the directory holding the ndm files"
|
||||
echo " ndmMenuFileName is the name of the ndm menu file to convert"
|
||||
echo ""
|
||||
echo " Required files: redbookDataKeys.txt, redbookDepictKeys.txt,"
|
||||
echo " redbookProductButtons.txt, and the menu file to convert"
|
||||
exit;
|
||||
fi
|
||||
if [ ! -d "$1" ];
|
||||
then
|
||||
echo "Directory [$1] does not exist!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ ! -f "$1/$2" ];
|
||||
then
|
||||
echo "File [$2] does not exist!"
|
||||
exit
|
||||
fi
|
||||
SRC_DIR=$1
|
||||
MENU_FILE=$2
|
||||
path_to_script=`readlink -f $0`
|
||||
dir=$(dirname $path_to_script)
|
||||
dir=$(dirname $dir)
|
||||
AWIPS_HOME=$(dirname $dir)
|
||||
|
||||
# Search for jars
|
||||
EDEX_PLUGINS="$AWIPS_HOME/edex/lib/"
|
||||
JARS=$(find $EDEX_PLUGINS -name "*.jar")
|
||||
|
||||
# Add jars to classpath
|
||||
addSep=false
|
||||
for i in $JARS
|
||||
do
|
||||
if [[ "$addSep" == true ]];
|
||||
then
|
||||
LOCAL_CLASSPATH=$LOCAL_CLASSPATH":"$i
|
||||
else
|
||||
LOCAL_CLASSPATH=$i
|
||||
addSep=true
|
||||
fi
|
||||
done
|
||||
|
||||
JAVA_INSTALL=/awips2/java/
|
||||
${JAVA_INSTALL}/bin/java -classpath $LOCAL_CLASSPATH com.raytheon.uf.edex.plugin.redbook.menu.NdmMenuConverter $SRC_DIR $MENU_FILE
|
||||
|
|
@ -1,26 +1,26 @@
|
|||
##
|
||||
# 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
|
||||
# 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
|
||||
#
|
||||
# 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.
|
||||
##
|
||||
# doConfig - validate and convert serverConfig into simple Java objects
|
||||
#
|
||||
# this file was originally config.py
|
||||
# it was renamed to avoid a conflict with jep's built-in config module
|
||||
# this file was originally config.py
|
||||
# it was renamed to avoid a conflict with jep's built-in config module
|
||||
#
|
||||
# ----------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -35,37 +35,37 @@
|
|||
# 11/18/2014 #4953 randerso Added check for empty unit string
|
||||
#
|
||||
########################################################################
|
||||
import types
|
||||
|
||||
from java.util import ArrayList,LinkedHashMap
|
||||
from java.lang import Integer,Float
|
||||
from com.vividsolutions.jts.geom import Coordinate
|
||||
from java.awt import Point
|
||||
|
||||
Databases = {}
|
||||
Projections = {}
|
||||
DiscreteDef = LinkedHashMap() #from parseKeys()
|
||||
|
||||
# Check a python sequence to see that
|
||||
# it matches the format.
|
||||
# data: is a sequence of objects
|
||||
# fmt : is a parallel sequence of type objects
|
||||
# message : optional message to print on exception
|
||||
#
|
||||
# Returns data.
|
||||
# If len(data) != len(fmt)
|
||||
# or the type of each element in data does not
|
||||
# match the coresponding type in fmt, then
|
||||
# a TypeError is raised.
|
||||
# Example: a, b = check(([1, 3], "foo"), (list, str))
|
||||
def check(data, fmt, message, allData = None):
|
||||
if len(data) != len(fmt):
|
||||
m = message + ": Wrong number of items found, " + \
|
||||
"Expected " + `len(fmt)` + ", got " + `len(data)` + \
|
||||
" Input: " + `data`
|
||||
if allData is not None:
|
||||
m = m + ' All: ' + `allData`
|
||||
raise AssertionError, m
|
||||
import types
|
||||
|
||||
from java.util import ArrayList,LinkedHashMap
|
||||
from java.lang import Integer,Float
|
||||
from com.vividsolutions.jts.geom import Coordinate
|
||||
from java.awt import Point
|
||||
|
||||
Databases = {}
|
||||
Projections = {}
|
||||
DiscreteDef = LinkedHashMap() #from parseKeys()
|
||||
|
||||
# Check a python sequence to see that
|
||||
# it matches the format.
|
||||
# data: is a sequence of objects
|
||||
# fmt : is a parallel sequence of type objects
|
||||
# message : optional message to print on exception
|
||||
#
|
||||
# Returns data.
|
||||
# If len(data) != len(fmt)
|
||||
# or the type of each element in data does not
|
||||
# match the coresponding type in fmt, then
|
||||
# a TypeError is raised.
|
||||
# Example: a, b = check(([1, 3], "foo"), (list, str))
|
||||
def check(data, fmt, message, allData = None):
|
||||
if len(data) != len(fmt):
|
||||
m = message + ": Wrong number of items found, " + \
|
||||
"Expected " + `len(fmt)` + ", got " + `len(data)` + \
|
||||
" Input: " + `data`
|
||||
if allData is not None:
|
||||
m = m + ' All: ' + `allData`
|
||||
raise AssertionError, m
|
||||
for i in xrange(len(data)):
|
||||
obj = data[i]
|
||||
if hasattr(obj, "jclassname"):
|
||||
|
@ -73,328 +73,328 @@ def check(data, fmt, message, allData = None):
|
|||
else:
|
||||
t = type(obj)
|
||||
|
||||
if t != fmt[i]:
|
||||
m = message + ": Wrong data type found, " + \
|
||||
"Expected " + `fmt[i]` + ", got " + `t` + \
|
||||
" for position #" + `i+1` + " Input: " + `data`
|
||||
if allData is not None:
|
||||
m = m + ' All: ' + `allData`
|
||||
raise AssertionError, m
|
||||
return data
|
||||
|
||||
# dictionary check, keys are strings, values/subvalues as specified
|
||||
def dictCheck(dictionary, value, subvalue, configName):
|
||||
map = LinkedHashMap()
|
||||
if type(dictionary) == dict:
|
||||
for k in dictionary.keys():
|
||||
if type(k) != str:
|
||||
raise TypeError, configName + " key [" + `k` + "] not a str"
|
||||
l = dictionary[k]
|
||||
if type(l) != value:
|
||||
raise TypeError, configName + " value [" + `l` + "] not a " \
|
||||
+ `value`
|
||||
if value == list or value == tuple:
|
||||
n = ArrayList()
|
||||
for m in l:
|
||||
if type(m) != subvalue:
|
||||
raise TypeError, configName + " value [" + `l` \
|
||||
+ "] isn't a " + `subvalue` + ": " + `m`
|
||||
elif subvalue == int:
|
||||
n.add(Integer(m))
|
||||
elif subvalue == float:
|
||||
n.add(Float(m))
|
||||
else:
|
||||
n.add(m)
|
||||
map.put(k, n)
|
||||
else:
|
||||
if value == int:
|
||||
map.put(k,Integer(l))
|
||||
elif value == float:
|
||||
map.put(k,Float(l))
|
||||
else:
|
||||
map.put(k, l)
|
||||
else:
|
||||
raise TypeError, configName + " not a dict:" + `dictionary`
|
||||
return map
|
||||
|
||||
def getWx(wxtypes, wxvisibilities):
|
||||
from com.raytheon.uf.common.dataplugin.gfe.weather import WeatherCoverage, WeatherIntensity, WeatherAttribute
|
||||
from com.raytheon.edex.plugin.gfe.config import SimpleWeatherTypeConfig
|
||||
types = ArrayList()
|
||||
for t in wxtypes:
|
||||
symbol, description, cov, inten, attr = \
|
||||
check(t, (str, str, list, list, list), "Error in WeatherType")
|
||||
coverages = ArrayList()
|
||||
intensities = ArrayList()
|
||||
attributes = ArrayList()
|
||||
for c in cov:
|
||||
csym, cdes = check(c, (str, str), "Error in Weather Coverage", t)
|
||||
coverages.add(WeatherCoverage(csym, cdes))
|
||||
for i in inten:
|
||||
isym, ides = check(i, (str, str), "Error in Weather Intensity", t)
|
||||
intensities.add(WeatherIntensity(isym, ides))
|
||||
for a in attr:
|
||||
asym, ades = check(a, (str, str), "Error in Weather Attributes", t)
|
||||
attributes.add(WeatherAttribute(asym, ades))
|
||||
|
||||
types.add(SimpleWeatherTypeConfig(symbol, description, coverages,
|
||||
intensities, attributes))
|
||||
vis = ArrayList()
|
||||
for v in wxvisibilities:
|
||||
vis.add(v)
|
||||
return (vis, types)
|
||||
|
||||
#note that DiscreteDef is a dictionary that contains the following
|
||||
#coded strings: ['OVERLAPS', 'AuxLength', sym1, des1, sym2, des2, ....]
|
||||
#We do this to pass to C++ as a InitDict, which
|
||||
#is a Dict<TextString, SeqOf<TextString>.
|
||||
def parseKeys(name, overlaps, auxLength, keys):
|
||||
if not DiscreteDef.containsKey(name):
|
||||
ts = ArrayList()
|
||||
if overlaps:
|
||||
ts.add("OVERLAPS")
|
||||
else:
|
||||
ts.add("MUTEXC")
|
||||
ts.add(`auxLength`)
|
||||
for symdes in keys:
|
||||
sym, des = check(symdes, (str, str),
|
||||
"Error in DiscreteKey Definition", keys)
|
||||
ts.add(sym)
|
||||
ts.add(des)
|
||||
if overlaps and len(keys) > 0 and keys[0][0] != "<None>":
|
||||
s = "1st discrete key must be <None> for OVERLAP-defined " +\
|
||||
"weather element. [" + name + "]" + `keys`
|
||||
raise Exception, s
|
||||
DiscreteDef.put(name, ts);
|
||||
|
||||
def createParm(parminfo, domain, tc):
|
||||
from com.raytheon.edex.plugin.gfe.config import SimpleGridParmConfig
|
||||
|
||||
m = "Format Error in Weather Element Definition"
|
||||
if len(parminfo) < 2:
|
||||
raise TypeError, m + ': ' + `parminfo`
|
||||
|
||||
dim, origin, extent, timezone, projection,officeType = domain
|
||||
|
||||
if parminfo[1] == 'Scalar' or parminfo[1] == 'Vector':
|
||||
parmInfoFmt = (str, str, str, str, float, float, int, int)
|
||||
name, type, units, description, max, min, precision, \
|
||||
rateParm = check(parminfo, parmInfoFmt, m)
|
||||
|
||||
elif parminfo[1] == 'Weather':
|
||||
name, type, units, description = \
|
||||
check(parminfo, (str, str, str, str), m)
|
||||
max = 0
|
||||
min = 0
|
||||
precision = 0
|
||||
rateParm = False
|
||||
|
||||
elif parminfo[1] == 'Discrete':
|
||||
if len(parminfo) == 6:
|
||||
parmInfoFmt = (str, str, str, str, int, list)
|
||||
name, type, units, description, overlaps, keys = \
|
||||
check(parminfo, parmInfoFmt, m)
|
||||
auxSize = 0
|
||||
else:
|
||||
parmInfoFmt = (str, str, str, str, int, list, int)
|
||||
name, type, units, description, overlaps, keys, auxSize = \
|
||||
check(parminfo, parmInfoFmt, m)
|
||||
max = 0.0
|
||||
min = 0.0
|
||||
precision = 0
|
||||
rateParm = False
|
||||
parseKeys(name, overlaps, auxSize, keys)
|
||||
|
||||
else:
|
||||
raise Exception, "Illegal WE type specified for " + `parminfo[0]`
|
||||
|
||||
#don't add parms with your own office type in the name.
|
||||
if name.find(officeType) != -1:
|
||||
if t != fmt[i]:
|
||||
m = message + ": Wrong data type found, " + \
|
||||
"Expected " + `fmt[i]` + ", got " + `t` + \
|
||||
" for position #" + `i+1` + " Input: " + `data`
|
||||
if allData is not None:
|
||||
m = m + ' All: ' + `allData`
|
||||
raise AssertionError, m
|
||||
return data
|
||||
|
||||
# dictionary check, keys are strings, values/subvalues as specified
|
||||
def dictCheck(dictionary, value, subvalue, configName):
|
||||
map = LinkedHashMap()
|
||||
if type(dictionary) == dict:
|
||||
for k in dictionary.keys():
|
||||
if type(k) != str:
|
||||
raise TypeError, configName + " key [" + `k` + "] not a str"
|
||||
l = dictionary[k]
|
||||
if type(l) != value:
|
||||
raise TypeError, configName + " value [" + `l` + "] not a " \
|
||||
+ `value`
|
||||
if value == list or value == tuple:
|
||||
n = ArrayList()
|
||||
for m in l:
|
||||
if type(m) != subvalue:
|
||||
raise TypeError, configName + " value [" + `l` \
|
||||
+ "] isn't a " + `subvalue` + ": " + `m`
|
||||
elif subvalue == int:
|
||||
n.add(Integer(m))
|
||||
elif subvalue == float:
|
||||
n.add(Float(m))
|
||||
else:
|
||||
n.add(m)
|
||||
map.put(k, n)
|
||||
else:
|
||||
if value == int:
|
||||
map.put(k,Integer(l))
|
||||
elif value == float:
|
||||
map.put(k,Float(l))
|
||||
else:
|
||||
map.put(k, l)
|
||||
else:
|
||||
raise TypeError, configName + " not a dict:" + `dictionary`
|
||||
return map
|
||||
|
||||
def getWx(wxtypes, wxvisibilities):
|
||||
from com.raytheon.uf.common.dataplugin.gfe.weather import WeatherCoverage, WeatherIntensity, WeatherAttribute
|
||||
from com.raytheon.edex.plugin.gfe.config import SimpleWeatherTypeConfig
|
||||
types = ArrayList()
|
||||
for t in wxtypes:
|
||||
symbol, description, cov, inten, attr = \
|
||||
check(t, (str, str, list, list, list), "Error in WeatherType")
|
||||
coverages = ArrayList()
|
||||
intensities = ArrayList()
|
||||
attributes = ArrayList()
|
||||
for c in cov:
|
||||
csym, cdes = check(c, (str, str), "Error in Weather Coverage", t)
|
||||
coverages.add(WeatherCoverage(csym, cdes))
|
||||
for i in inten:
|
||||
isym, ides = check(i, (str, str), "Error in Weather Intensity", t)
|
||||
intensities.add(WeatherIntensity(isym, ides))
|
||||
for a in attr:
|
||||
asym, ades = check(a, (str, str), "Error in Weather Attributes", t)
|
||||
attributes.add(WeatherAttribute(asym, ades))
|
||||
|
||||
types.add(SimpleWeatherTypeConfig(symbol, description, coverages,
|
||||
intensities, attributes))
|
||||
vis = ArrayList()
|
||||
for v in wxvisibilities:
|
||||
vis.add(v)
|
||||
return (vis, types)
|
||||
|
||||
#note that DiscreteDef is a dictionary that contains the following
|
||||
#coded strings: ['OVERLAPS', 'AuxLength', sym1, des1, sym2, des2, ....]
|
||||
#We do this to pass to C++ as a InitDict, which
|
||||
#is a Dict<TextString, SeqOf<TextString>.
|
||||
def parseKeys(name, overlaps, auxLength, keys):
|
||||
if not DiscreteDef.containsKey(name):
|
||||
ts = ArrayList()
|
||||
if overlaps:
|
||||
ts.add("OVERLAPS")
|
||||
else:
|
||||
ts.add("MUTEXC")
|
||||
ts.add(`auxLength`)
|
||||
for symdes in keys:
|
||||
sym, des = check(symdes, (str, str),
|
||||
"Error in DiscreteKey Definition", keys)
|
||||
ts.add(sym)
|
||||
ts.add(des)
|
||||
if overlaps and len(keys) > 0 and keys[0][0] != "<None>":
|
||||
s = "1st discrete key must be <None> for OVERLAP-defined " +\
|
||||
"weather element. [" + name + "]" + `keys`
|
||||
raise Exception, s
|
||||
DiscreteDef.put(name, ts);
|
||||
|
||||
def createParm(parminfo, domain, tc):
|
||||
from com.raytheon.edex.plugin.gfe.config import SimpleGridParmConfig
|
||||
|
||||
m = "Format Error in Weather Element Definition"
|
||||
if len(parminfo) < 2:
|
||||
raise TypeError, m + ': ' + `parminfo`
|
||||
|
||||
dim, origin, extent, timezone, projection,officeType = domain
|
||||
|
||||
if parminfo[1] == 'Scalar' or parminfo[1] == 'Vector':
|
||||
parmInfoFmt = (str, str, str, str, float, float, int, int)
|
||||
name, type, units, description, max, min, precision, \
|
||||
rateParm = check(parminfo, parmInfoFmt, m)
|
||||
|
||||
elif parminfo[1] == 'Weather':
|
||||
name, type, units, description = \
|
||||
check(parminfo, (str, str, str, str), m)
|
||||
max = 0
|
||||
min = 0
|
||||
precision = 0
|
||||
rateParm = False
|
||||
|
||||
elif parminfo[1] == 'Discrete':
|
||||
if len(parminfo) == 6:
|
||||
parmInfoFmt = (str, str, str, str, int, list)
|
||||
name, type, units, description, overlaps, keys = \
|
||||
check(parminfo, parmInfoFmt, m)
|
||||
auxSize = 0
|
||||
else:
|
||||
parmInfoFmt = (str, str, str, str, int, list, int)
|
||||
name, type, units, description, overlaps, keys, auxSize = \
|
||||
check(parminfo, parmInfoFmt, m)
|
||||
max = 0.0
|
||||
min = 0.0
|
||||
precision = 0
|
||||
rateParm = False
|
||||
parseKeys(name, overlaps, auxSize, keys)
|
||||
|
||||
else:
|
||||
raise Exception, "Illegal WE type specified for " + `parminfo[0]`
|
||||
|
||||
#don't add parms with your own office type in the name.
|
||||
if name.find(officeType) != -1:
|
||||
return None #skip this one
|
||||
|
||||
if len(units) == 0:
|
||||
raise Exception, 'Unit string must not be empty. For unitless quantities enter "1"'
|
||||
|
||||
updateProjections(projection)
|
||||
start, repeat, duration = tc
|
||||
timeIndependentParm = (repeat == 0 and duration == 0)
|
||||
|
||||
# return WeatherElement(name, type, units, description, max, min,
|
||||
# precision, timeIndependentParm, dim, origin,
|
||||
# extent, start, repeat, duration, rateParm)
|
||||
return SimpleGridParmConfig(name, type, units, description, 1.0*max, 1.0*min,
|
||||
precision, timeIndependentParm, Point(dim[0], dim[1]), Coordinate(origin[0], origin[1]),
|
||||
Coordinate(extent[0], extent[1]), start, repeat, duration, rateParm)
|
||||
|
||||
def getDB(site, projID, dbinfo):
|
||||
from com.raytheon.edex.plugin.gfe.config import SimpleModelConfig
|
||||
|
||||
dbinfoFmt = (str, str, str, int, int, int, int)
|
||||
name, format, type, single, official, numVer, purgeAge = \
|
||||
check(dbinfo, dbinfoFmt, "Error in Database Attribute Definition")
|
||||
|
||||
if not Databases.has_key(name+type):
|
||||
Databases[name+type] = SimpleModelConfig(site, format, type, name, projID,
|
||||
single, official, numVer, purgeAge)
|
||||
|
||||
return Databases[name+type]
|
||||
|
||||
def parseDBItm(site, domain, item):
|
||||
# import serverConfig
|
||||
# domain = serverConfig.SITES[site]
|
||||
|
||||
dbinfo, parminfo = check(item, (tuple, list),
|
||||
"Database Definition or Parm Group Format Error")
|
||||
projID = domain[4][0]
|
||||
|
||||
db = getDB(site, projID, dbinfo)
|
||||
grids = db.grids
|
||||
for ptc in parminfo:
|
||||
parms, tc = check(ptc, (list, tuple),
|
||||
"Parm Group/Time Constraint Tuple Error")
|
||||
check(tc, (int, int, int), "Time Constraint Format Error", ptc)
|
||||
for parm in parms:
|
||||
grids.add(createParm(parm, domain, tc))
|
||||
db.grids = grids
|
||||
|
||||
def updateProjections(projection):
|
||||
from com.raytheon.uf.common.dataplugin.gfe.config import ProjectionData
|
||||
# extract projection data
|
||||
raise Exception, 'Unit string must not be empty. For unitless quantities enter "1"'
|
||||
|
||||
updateProjections(projection)
|
||||
start, repeat, duration = tc
|
||||
timeIndependentParm = (repeat == 0 and duration == 0)
|
||||
|
||||
# return WeatherElement(name, type, units, description, max, min,
|
||||
# precision, timeIndependentParm, dim, origin,
|
||||
# extent, start, repeat, duration, rateParm)
|
||||
return SimpleGridParmConfig(name, type, units, description, 1.0*max, 1.0*min,
|
||||
precision, timeIndependentParm, Point(dim[0], dim[1]), Coordinate(origin[0], origin[1]),
|
||||
Coordinate(extent[0], extent[1]), start, repeat, duration, rateParm)
|
||||
|
||||
def getDB(site, projID, dbinfo):
|
||||
from com.raytheon.edex.plugin.gfe.config import SimpleModelConfig
|
||||
|
||||
dbinfoFmt = (str, str, str, int, int, int, int)
|
||||
name, format, type, single, official, numVer, purgeAge = \
|
||||
check(dbinfo, dbinfoFmt, "Error in Database Attribute Definition")
|
||||
|
||||
if not Databases.has_key(name+type):
|
||||
Databases[name+type] = SimpleModelConfig(site, format, type, name, projID,
|
||||
single, official, numVer, purgeAge)
|
||||
|
||||
return Databases[name+type]
|
||||
|
||||
def parseDBItm(site, domain, item):
|
||||
# import serverConfig
|
||||
# domain = serverConfig.SITES[site]
|
||||
|
||||
dbinfo, parminfo = check(item, (tuple, list),
|
||||
"Database Definition or Parm Group Format Error")
|
||||
projID = domain[4][0]
|
||||
|
||||
db = getDB(site, projID, dbinfo)
|
||||
grids = db.grids
|
||||
for ptc in parminfo:
|
||||
parms, tc = check(ptc, (list, tuple),
|
||||
"Parm Group/Time Constraint Tuple Error")
|
||||
check(tc, (int, int, int), "Time Constraint Format Error", ptc)
|
||||
for parm in parms:
|
||||
grids.add(createParm(parm, domain, tc))
|
||||
db.grids = grids
|
||||
|
||||
def updateProjections(projection):
|
||||
from com.raytheon.uf.common.dataplugin.gfe.config import ProjectionData
|
||||
# extract projection data
|
||||
projFmt = (str,
|
||||
"com.raytheon.uf.common.dataplugin.gfe.config.ProjectionData$ProjectionType",
|
||||
tuple, tuple, tuple, float, float, tuple, tuple, float, float, float)
|
||||
projID, ptype, pllll, pllur, pllo, pspo, pspt, pgpll, pgpur, pli, \
|
||||
plc, plo = check(projection, projFmt, "Format error in Projection")
|
||||
check(pllll, (float, float),
|
||||
"Format error lower left long/lat in Projection", projection)
|
||||
check(pllur, (float, float),
|
||||
"Format error upper right long/lat in Projection", projection)
|
||||
check(pllo, (float, float),
|
||||
"Format error long/lat origin in Projection", projection)
|
||||
check(pgpll, (int, int),
|
||||
"Format error lower left grid point in Projection", projection)
|
||||
check(pgpur, (int, int),
|
||||
"Format error upper right grid point in Projection", projection)
|
||||
|
||||
if not Projections.has_key(projID):
|
||||
Projections[projID] = ProjectionData(projID, ptype,
|
||||
Coordinate(pllll[0],pllll[1]),
|
||||
Coordinate(pllur[0],pllur[1]),
|
||||
Coordinate(pllo[0],pllo[1]),
|
||||
pspo, pspt,
|
||||
Point(pgpll[0], pgpll[1]),
|
||||
Point(pgpur[0], pgpur[1]),
|
||||
pli, plc, plo)
|
||||
|
||||
def parseGridLocation(domain):
|
||||
from com.raytheon.edex.plugin.gfe.config import SimpleGridLocation
|
||||
|
||||
#if office type is present:
|
||||
if len(domain) == 6:
|
||||
domainFmt = (list,tuple,tuple,str,tuple,str)
|
||||
gridSize, origin, extent, tz, proj, officeType = check(domain, domainFmt, "Format error in SITES line")
|
||||
#if office type is not present:
|
||||
else:
|
||||
domainFmt = (list, tuple, tuple, str, tuple)
|
||||
gridSize, origin, extent, tz, proj = check(domain, domainFmt,
|
||||
"Format error in SITES line")
|
||||
check(gridSize, (int, int), "GridSize format error from SITES", domain)
|
||||
check(origin, (float, float), "Origin format error from SITES", domain)
|
||||
check(extent, (float, float), "Extent format error from SITES", domain)
|
||||
|
||||
tuple, tuple, tuple, float, float, tuple, tuple, float, float, float)
|
||||
projID, ptype, pllll, pllur, pllo, pspo, pspt, pgpll, pgpur, pli, \
|
||||
plc, plo = check(projection, projFmt, "Format error in Projection")
|
||||
check(pllll, (float, float),
|
||||
"Format error lower left long/lat in Projection", projection)
|
||||
check(pllur, (float, float),
|
||||
"Format error upper right long/lat in Projection", projection)
|
||||
check(pllo, (float, float),
|
||||
"Format error long/lat origin in Projection", projection)
|
||||
check(pgpll, (int, int),
|
||||
"Format error lower left grid point in Projection", projection)
|
||||
check(pgpur, (int, int),
|
||||
"Format error upper right grid point in Projection", projection)
|
||||
|
||||
if not Projections.has_key(projID):
|
||||
Projections[projID] = ProjectionData(projID, ptype,
|
||||
Coordinate(pllll[0],pllll[1]),
|
||||
Coordinate(pllur[0],pllur[1]),
|
||||
Coordinate(pllo[0],pllo[1]),
|
||||
pspo, pspt,
|
||||
Point(pgpll[0], pgpll[1]),
|
||||
Point(pgpur[0], pgpur[1]),
|
||||
pli, plc, plo)
|
||||
|
||||
def parseGridLocation(domain):
|
||||
from com.raytheon.edex.plugin.gfe.config import SimpleGridLocation
|
||||
|
||||
#if office type is present:
|
||||
if len(domain) == 6:
|
||||
domainFmt = (list,tuple,tuple,str,tuple,str)
|
||||
gridSize, origin, extent, tz, proj, officeType = check(domain, domainFmt, "Format error in SITES line")
|
||||
#if office type is not present:
|
||||
else:
|
||||
domainFmt = (list, tuple, tuple, str, tuple)
|
||||
gridSize, origin, extent, tz, proj = check(domain, domainFmt,
|
||||
"Format error in SITES line")
|
||||
check(gridSize, (int, int), "GridSize format error from SITES", domain)
|
||||
check(origin, (float, float), "Origin format error from SITES", domain)
|
||||
check(extent, (float, float), "Extent format error from SITES", domain)
|
||||
|
||||
projFmt = (str,
|
||||
"com.raytheon.uf.common.dataplugin.gfe.config.ProjectionData$ProjectionType",
|
||||
tuple, tuple, tuple, float, float, tuple, tuple, float, float, float)
|
||||
projID, projType, llll, llur, llo, sp1, sp2, gpll, gpur, li, lc, lo = \
|
||||
check(proj, projFmt, "Format error in Projection")
|
||||
check(llll, (float, float),
|
||||
"Format error lower left long/lat in Projection", proj)
|
||||
check(llur, (float, float),
|
||||
"Format error upper right long/lat in Projection", proj)
|
||||
check(llo, (float, float),
|
||||
"Format error long/lat origin in Projection", proj)
|
||||
check(gpll, (int, int),
|
||||
"Format error lower left grid point in Projection", proj)
|
||||
check(gpur, (int, int),
|
||||
"Format error upper right grid point in Projection", proj)
|
||||
|
||||
gloc = SimpleGridLocation(Point(gridSize[0], gridSize[1]),
|
||||
Coordinate(origin[0], origin[1]),
|
||||
Coordinate(extent[0], extent[1]),
|
||||
projID, projType,
|
||||
Coordinate(llll[0], llll[1]),
|
||||
Coordinate(llur[0], llur[1]),
|
||||
Coordinate(llo[0], llo[1]),
|
||||
sp1, sp2,
|
||||
Point(gpll[0], gpll[1]),
|
||||
Point(gpur[0], gpur[1]),
|
||||
li, lc, lo)
|
||||
return gloc
|
||||
|
||||
def parse(site, databases, wxtypes, wxvisibilities, allSites, inProjections):
|
||||
from com.raytheon.edex.plugin.gfe.config import SimpleGridLocation
|
||||
domain = parseGridLocation(allSites[site])
|
||||
for itm in databases:
|
||||
parseDBItm(site, allSites[site], itm)
|
||||
|
||||
if type(wxtypes) != list:
|
||||
raise TypeError, "Format Error in WeatherTypes, not a list: " \
|
||||
+ `wxtypes`
|
||||
if type(wxvisibilities) != list:
|
||||
raise TypeError, "Format Error in visibilities, not a list: " \
|
||||
+ `wxvisibilities`
|
||||
vis, types = getWx(wxtypes, wxvisibilities)
|
||||
|
||||
models = ArrayList()
|
||||
for key in Databases.keys():
|
||||
models.add(Databases[key])
|
||||
|
||||
projections = ArrayList()
|
||||
if type(inProjections) != list:
|
||||
raise TypeError, "Format Error in Projections, not a list: " \
|
||||
+ `inProjections`
|
||||
for p in inProjections:
|
||||
updateProjections(p)
|
||||
for key in Projections.keys():
|
||||
projections.add(Projections[key])
|
||||
|
||||
allSiteIDs = ArrayList()
|
||||
allOfficeTypes = ArrayList()
|
||||
for key in allSites.keys():
|
||||
allSiteIDs.add(key)
|
||||
try:
|
||||
ot = allSites[key][5]
|
||||
if type(ot) != str:
|
||||
raise TypeError, "Format Error in office type, not a str:",allSites[key]
|
||||
except:
|
||||
ot = "wfo" #assumes wfo if not present
|
||||
allOfficeTypes.add(ot)
|
||||
|
||||
siteId = ArrayList()
|
||||
siteId.add(site)
|
||||
|
||||
timeZone = ArrayList()
|
||||
timeZone.add(allSites[site][3])
|
||||
|
||||
return models, projections, vis, types, DiscreteDef, allSiteIDs, domain, siteId, timeZone, allOfficeTypes
|
||||
|
||||
def d2dParse(d2dmodels):
|
||||
dict = LinkedHashMap()
|
||||
for entry in d2dmodels:
|
||||
if type(entry) is types.TupleType:
|
||||
d2dModelName, gfeModelName = check(entry, (str, str),
|
||||
"Format error in D2DMODELS entry", d2dmodels)
|
||||
|
||||
dict.put(d2dModelName, gfeModelName)
|
||||
|
||||
elif type(entry) is types.StringType:
|
||||
d2dModelName = entry
|
||||
dict.put(d2dModelName, d2dModelName)
|
||||
|
||||
else:
|
||||
raise SyntaxError, "Invalid syntax for D2DMODELS" + `d2dmodels`
|
||||
|
||||
return dict
|
||||
tuple, tuple, tuple, float, float, tuple, tuple, float, float, float)
|
||||
projID, projType, llll, llur, llo, sp1, sp2, gpll, gpur, li, lc, lo = \
|
||||
check(proj, projFmt, "Format error in Projection")
|
||||
check(llll, (float, float),
|
||||
"Format error lower left long/lat in Projection", proj)
|
||||
check(llur, (float, float),
|
||||
"Format error upper right long/lat in Projection", proj)
|
||||
check(llo, (float, float),
|
||||
"Format error long/lat origin in Projection", proj)
|
||||
check(gpll, (int, int),
|
||||
"Format error lower left grid point in Projection", proj)
|
||||
check(gpur, (int, int),
|
||||
"Format error upper right grid point in Projection", proj)
|
||||
|
||||
gloc = SimpleGridLocation(Point(gridSize[0], gridSize[1]),
|
||||
Coordinate(origin[0], origin[1]),
|
||||
Coordinate(extent[0], extent[1]),
|
||||
projID, projType,
|
||||
Coordinate(llll[0], llll[1]),
|
||||
Coordinate(llur[0], llur[1]),
|
||||
Coordinate(llo[0], llo[1]),
|
||||
sp1, sp2,
|
||||
Point(gpll[0], gpll[1]),
|
||||
Point(gpur[0], gpur[1]),
|
||||
li, lc, lo)
|
||||
return gloc
|
||||
|
||||
def parse(site, databases, wxtypes, wxvisibilities, allSites, inProjections):
|
||||
from com.raytheon.edex.plugin.gfe.config import SimpleGridLocation
|
||||
domain = parseGridLocation(allSites[site])
|
||||
for itm in databases:
|
||||
parseDBItm(site, allSites[site], itm)
|
||||
|
||||
if type(wxtypes) != list:
|
||||
raise TypeError, "Format Error in WeatherTypes, not a list: " \
|
||||
+ `wxtypes`
|
||||
if type(wxvisibilities) != list:
|
||||
raise TypeError, "Format Error in visibilities, not a list: " \
|
||||
+ `wxvisibilities`
|
||||
vis, types = getWx(wxtypes, wxvisibilities)
|
||||
|
||||
models = ArrayList()
|
||||
for key in Databases.keys():
|
||||
models.add(Databases[key])
|
||||
|
||||
projections = ArrayList()
|
||||
if type(inProjections) != list:
|
||||
raise TypeError, "Format Error in Projections, not a list: " \
|
||||
+ `inProjections`
|
||||
for p in inProjections:
|
||||
updateProjections(p)
|
||||
for key in Projections.keys():
|
||||
projections.add(Projections[key])
|
||||
|
||||
allSiteIDs = ArrayList()
|
||||
allOfficeTypes = ArrayList()
|
||||
for key in allSites.keys():
|
||||
allSiteIDs.add(key)
|
||||
try:
|
||||
ot = allSites[key][5]
|
||||
if type(ot) != str:
|
||||
raise TypeError, "Format Error in office type, not a str:",allSites[key]
|
||||
except:
|
||||
ot = "wfo" #assumes wfo if not present
|
||||
allOfficeTypes.add(ot)
|
||||
|
||||
siteId = ArrayList()
|
||||
siteId.add(site)
|
||||
|
||||
timeZone = ArrayList()
|
||||
timeZone.add(allSites[site][3])
|
||||
|
||||
return models, projections, vis, types, DiscreteDef, allSiteIDs, domain, siteId, timeZone, allOfficeTypes
|
||||
|
||||
def d2dParse(d2dmodels):
|
||||
dict = LinkedHashMap()
|
||||
for entry in d2dmodels:
|
||||
if type(entry) is types.TupleType:
|
||||
d2dModelName, gfeModelName = check(entry, (str, str),
|
||||
"Format error in D2DMODELS entry", d2dmodels)
|
||||
|
||||
dict.put(d2dModelName, gfeModelName)
|
||||
|
||||
elif type(entry) is types.StringType:
|
||||
d2dModelName = entry
|
||||
dict.put(d2dModelName, d2dModelName)
|
||||
|
||||
else:
|
||||
raise SyntaxError, "Invalid syntax for D2DMODELS" + `d2dmodels`
|
||||
|
||||
return dict
|
||||
|
||||
def netcdfParse(netcdfDirs):
|
||||
dict = LinkedHashMap()
|
||||
|
@ -417,139 +417,107 @@ def netcdfParse(netcdfDirs):
|
|||
raise SyntaxError, "Invalid syntax for NETCDFDIRS" + `netcdfDirs`
|
||||
|
||||
return dict
|
||||
|
||||
def parseSat(satdata):
|
||||
rval = LinkedHashMap()
|
||||
for e in satdata:
|
||||
if type(e) is types.TupleType:
|
||||
direct, name = check(e, (str, str),
|
||||
"Format error in SATDATA entry", satdata)
|
||||
rval.put(direct, name)
|
||||
else:
|
||||
raise SyntaxError, "Invalid syntax for SATDATA" + `satdata`
|
||||
return rval
|
||||
|
||||
def otherParse(serverhost, mhsid, port,
|
||||
initmodules, accumElem,
|
||||
initskips, d2ddbver, logfilepurge, prddir, home,
|
||||
extraWEPrec, vtecRequestTime, autoConfigureNotifyTextProd,
|
||||
iscRoutingTableAddress, requestedISCsites, requestISC, sendiscOnSave,
|
||||
sendiscOnPublish, requestedISCparms, transmitScript):
|
||||
if type(serverhost) != str:
|
||||
raise TypeError, "GFESUITE_HOST not an str: " + `serverhost`
|
||||
if type(mhsid) != str:
|
||||
raise TypeError, "GFESUITE_MHSID not an str: " + `mhsid`
|
||||
|
||||
def parseSat(satdata):
|
||||
rval = LinkedHashMap()
|
||||
for e in satdata:
|
||||
if type(e) is types.TupleType:
|
||||
direct, name = check(e, (str, str),
|
||||
"Format error in SATDATA entry", satdata)
|
||||
rval.put(direct, name)
|
||||
else:
|
||||
raise SyntaxError, "Invalid syntax for SATDATA" + `satdata`
|
||||
return rval
|
||||
|
||||
def otherParse(serverhost, mhsid, port,
|
||||
initmodules, accumElem,
|
||||
initskips, d2ddbver, logfilepurge, prddir, home,
|
||||
extraWEPrec, vtecRequestTime, autoConfigureNotifyTextProd,
|
||||
iscRoutingTableAddress, requestedISCsites, requestISC, sendiscOnSave,
|
||||
sendiscOnPublish, requestedISCparms, transmitScript):
|
||||
if type(serverhost) != str:
|
||||
raise TypeError, "GFESUITE_HOST not an str: " + `serverhost`
|
||||
if type(mhsid) != str:
|
||||
raise TypeError, "GFESUITE_MHSID not an str: " + `mhsid`
|
||||
if type(vtecRequestTime) != int:
|
||||
raise TypeError, "VTECPartners: VTEC_REMOTE_TABLE_FETCH_TIME " + \
|
||||
"not an int: " + `vtecRequestTime`
|
||||
if type(port) != int:
|
||||
raise TypeError, "GFESUITE_PORT not an int: " + `port`
|
||||
javainitmodules = dictCheck(initmodules, list, str, "INITMODULES")
|
||||
accumElem = dictCheck(accumElem, list, str, "D2DAccumulativeElements")
|
||||
initskips = dictCheck(initskips, list, int, "INITSKIPS")
|
||||
d2ddbver = dictCheck(d2ddbver, int, None, "D2DDBVERSIONS")
|
||||
if type(logfilepurge) != int:
|
||||
raise TypeError, "LOG_FILE_PURGE_AFTER not an int: " + `logfilepurge`
|
||||
if type(autoConfigureNotifyTextProd) != int:
|
||||
raise TypeError, "AUTO_CONFIGURE_NOTIFYTEXTPROD not an int: " + \
|
||||
`logfilepurge`
|
||||
if type(prddir) != str:
|
||||
raise TypeError, "GFESUITE_PRDDIR not an str: " + `prddir`
|
||||
if type(home) != str:
|
||||
raise TypeError, "GFESUITE_HOME not an str: " + `home`
|
||||
if type(extraWEPrec) != list:
|
||||
raise TypeError, "ExtraWEPrec not an list: " + `extraWEPrec`
|
||||
else:
|
||||
extraWEPrecision = LinkedHashMap()
|
||||
for e in extraWEPrec:
|
||||
if type(e) == str:
|
||||
extraWEPrecision.put(e, Integer(1))
|
||||
elif type(e) == tuple and len(e) == 2 and type(e[0]) == str and \
|
||||
type(e[1]) == int:
|
||||
extraWEPrecision.put(e[0], Integer(e[1]))
|
||||
else:
|
||||
raise TypeError, \
|
||||
"Entry in ExtraWEPrec not str or (str, int): " + `e`
|
||||
|
||||
iscRoutingTableAddress = dictCheck(iscRoutingTableAddress,str,str,"ISC_ROUTING_TABLE_ADDRESS")
|
||||
#if type(iscRoutingTableAddress) not in [str, types.NoneType]:
|
||||
# raise TypeError, "ISC_ROUTING_TABLE_ADDRESS not None or a str: " + \
|
||||
# `iscRoutingTableAddress`
|
||||
#elif iscRoutingTableAddress is None:
|
||||
# iscRoutingTableAddress = ""
|
||||
|
||||
reqISCsites = ArrayList()
|
||||
if type(requestedISCsites) not in [list, types.NoneType]:
|
||||
raise TypeError, "REQUESTED_ISC_SITES not None or a list: " + \
|
||||
`requestedISCsites`
|
||||
elif type(requestedISCsites) is list:
|
||||
for r in requestedISCsites:
|
||||
if type(r) != str:
|
||||
raise TypeError, "REQUESTED_ISC_SITES not list of strings: " + \
|
||||
`requestedISCsites`
|
||||
else:
|
||||
reqISCsites.add(r);
|
||||
|
||||
reqISCparms = ArrayList()
|
||||
if type(requestedISCparms) not in [list, types.NoneType]:
|
||||
raise TypeError, "REQUESTED_ISC_PARMS not None or a list: " + \
|
||||
`requestedISCparms`
|
||||
elif type(requestedISCparms) is list:
|
||||
for r in requestedISCparms:
|
||||
if type(r) != str:
|
||||
raise TypeError, "REQUESTED_ISC_PARMS not list of strings: " + \
|
||||
`requestedISCparms`
|
||||
else:
|
||||
reqISCparms.add(r)
|
||||
|
||||
if type(requestISC) != int:
|
||||
raise TypeError, "REQUEST_ISC not an int: " + `requestISC`
|
||||
if type(sendiscOnSave) != int:
|
||||
raise TypeError, "SEND_ISC_ON_SAVE not an int: " + `sendiscOnSave`
|
||||
if type(sendiscOnPublish) != int:
|
||||
raise TypeError, "SEND_ISC_ON_PUBLISH not an int: " + `sendiscOnPublish`
|
||||
|
||||
if type(transmitScript) not in [str, types.NoneType]:
|
||||
raise TypeError, "TRANSMIT_SCRIPT not None or str: " + `transmitScript`
|
||||
elif transmitScript is None:
|
||||
transmitScript = ""
|
||||
|
||||
# build model to init mapping
|
||||
modelToInit = {}
|
||||
for module in initmodules:
|
||||
for model in initmodules[module]:
|
||||
if modelToInit.has_key(model):
|
||||
modelToInit[model].append(module)
|
||||
"not an int: " + `vtecRequestTime`
|
||||
if type(port) != int:
|
||||
raise TypeError, "GFESUITE_PORT not an int: " + `port`
|
||||
initmodules = dictCheck(initmodules, list, str, "INITMODULES")
|
||||
accumElem = dictCheck(accumElem, list, str, "D2DAccumulativeElements")
|
||||
initskips = dictCheck(initskips, list, int, "INITSKIPS")
|
||||
d2ddbver = dictCheck(d2ddbver, int, None, "D2DDBVERSIONS")
|
||||
if type(logfilepurge) != int:
|
||||
raise TypeError, "LOG_FILE_PURGE_AFTER not an int: " + `logfilepurge`
|
||||
if type(autoConfigureNotifyTextProd) != int:
|
||||
raise TypeError, "AUTO_CONFIGURE_NOTIFYTEXTPROD not an int: " + \
|
||||
`logfilepurge`
|
||||
if type(prddir) != str:
|
||||
raise TypeError, "GFESUITE_PRDDIR not an str: " + `prddir`
|
||||
if type(home) != str:
|
||||
raise TypeError, "GFESUITE_HOME not an str: " + `home`
|
||||
if type(extraWEPrec) != list:
|
||||
raise TypeError, "ExtraWEPrec not an list: " + `extraWEPrec`
|
||||
else:
|
||||
extraWEPrecision = LinkedHashMap()
|
||||
for e in extraWEPrec:
|
||||
if type(e) == str:
|
||||
extraWEPrecision.put(e, Integer(1))
|
||||
elif type(e) == tuple and len(e) == 2 and type(e[0]) == str and \
|
||||
type(e[1]) == int:
|
||||
extraWEPrecision.put(e[0], Integer(e[1]))
|
||||
else:
|
||||
modelToInit[model] = [module]
|
||||
|
||||
# check for duplicate init modules
|
||||
for model in modelToInit:
|
||||
modules = modelToInit[model]
|
||||
if len(modules) > 1:
|
||||
message = "Multiple smartInit modules " + str(modules) + \
|
||||
" are enabled for D2D model: " + model + ". " + str(modules[1:]) + \
|
||||
" will be disabled. Please edit your localConfig.py file and disable all but one."
|
||||
raise TypeError, \
|
||||
"Entry in ExtraWEPrec not str or (str, int): " + `e`
|
||||
|
||||
# log error message to edex log
|
||||
import LogStream
|
||||
LogStream.logProblem(message);
|
||||
|
||||
# log error to alertViz
|
||||
from com.raytheon.uf.edex.core import EDEXUtil
|
||||
from com.raytheon.uf.common.status import UFStatus_Priority as Priority
|
||||
EDEXUtil.sendMessageAlertViz(Priority.ERROR,
|
||||
"com.raytheon.edex.plugin.gfe", "GFE", "GFE", message,
|
||||
message, None)
|
||||
iscRoutingTableAddress = dictCheck(iscRoutingTableAddress,str,str,"ISC_ROUTING_TABLE_ADDRESS")
|
||||
#if type(iscRoutingTableAddress) not in [str, types.NoneType]:
|
||||
# raise TypeError, "ISC_ROUTING_TABLE_ADDRESS not None or a str: " + \
|
||||
# `iscRoutingTableAddress`
|
||||
#elif iscRoutingTableAddress is None:
|
||||
# iscRoutingTableAddress = ""
|
||||
|
||||
# remove duplicate
|
||||
for module in modules[1:]:
|
||||
javainitmodules.remove(module)
|
||||
|
||||
return serverhost, mhsid, \
|
||||
port, javainitmodules, accumElem, \
|
||||
initskips, d2ddbver, logfilepurge, prddir, home,\
|
||||
extraWEPrecision, vtecRequestTime, \
|
||||
autoConfigureNotifyTextProd, \
|
||||
iscRoutingTableAddress, reqISCsites, requestISC, sendiscOnSave, \
|
||||
sendiscOnPublish, reqISCparms, transmitScript
|
||||
reqISCsites = ArrayList()
|
||||
if type(requestedISCsites) not in [list, types.NoneType]:
|
||||
raise TypeError, "REQUESTED_ISC_SITES not None or a list: " + \
|
||||
`requestedISCsites`
|
||||
elif type(requestedISCsites) is list:
|
||||
for r in requestedISCsites:
|
||||
if type(r) != str:
|
||||
raise TypeError, "REQUESTED_ISC_SITES not list of strings: " + \
|
||||
`requestedISCsites`
|
||||
else:
|
||||
reqISCsites.add(r);
|
||||
|
||||
reqISCparms = ArrayList()
|
||||
if type(requestedISCparms) not in [list, types.NoneType]:
|
||||
raise TypeError, "REQUESTED_ISC_PARMS not None or a list: " + \
|
||||
`requestedISCparms`
|
||||
elif type(requestedISCparms) is list:
|
||||
for r in requestedISCparms:
|
||||
if type(r) != str:
|
||||
raise TypeError, "REQUESTED_ISC_PARMS not list of strings: " + \
|
||||
`requestedISCparms`
|
||||
else:
|
||||
reqISCparms.add(r)
|
||||
|
||||
if type(requestISC) != int:
|
||||
raise TypeError, "REQUEST_ISC not an int: " + `requestISC`
|
||||
if type(sendiscOnSave) != int:
|
||||
raise TypeError, "SEND_ISC_ON_SAVE not an int: " + `sendiscOnSave`
|
||||
if type(sendiscOnPublish) != int:
|
||||
raise TypeError, "SEND_ISC_ON_PUBLISH not an int: " + `sendiscOnPublish`
|
||||
|
||||
if type(transmitScript) not in [str, types.NoneType]:
|
||||
raise TypeError, "TRANSMIT_SCRIPT not None or str: " + `transmitScript`
|
||||
elif transmitScript is None:
|
||||
transmitScript = ""
|
||||
|
||||
return serverhost, mhsid, \
|
||||
port, initmodules, accumElem, \
|
||||
initskips, d2ddbver, logfilepurge, prddir, home,\
|
||||
extraWEPrecision, vtecRequestTime, \
|
||||
autoConfigureNotifyTextProd, \
|
||||
iscRoutingTableAddress, reqISCsites, requestISC, sendiscOnSave, \
|
||||
sendiscOnPublish, reqISCparms, transmitScript
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
</model>
|
||||
|
||||
<model>
|
||||
<name>MPE-Local</name>
|
||||
<name>MPE-Mosaic</name>
|
||||
<center>9</center>
|
||||
<subcenter>0</subcenter>
|
||||
<grid>304</grid>
|
||||
|
@ -50,7 +50,6 @@
|
|||
</process>
|
||||
</model>
|
||||
|
||||
|
||||
<!-- END SUBCENTER 0 -->
|
||||
|
||||
<!-- SUBCENTER 105: San Juan PR WFO -->
|
||||
|
|
|
@ -1201,7 +1201,7 @@ C | 1 | 0 | 4 | | |..|8000F0FF| | 0 | 2
|
|||
<parameter>PLI</parameter>
|
||||
</paramLevelMatches>
|
||||
<contourStyle>
|
||||
<displayUnits label="C">K</displayUnits>
|
||||
<displayUnits>C</displayUnits>
|
||||
<contourLabeling labelSpacing="4">
|
||||
<increment>2</increment>
|
||||
</contourLabeling>
|
||||
|
@ -1212,7 +1212,7 @@ C | 1 | 0 | 4 | | |..|8000F0FF| | 0 | 2
|
|||
<parameter>SLI</parameter>
|
||||
</paramLevelMatches>
|
||||
<contourStyle>
|
||||
<displayUnits label="C">K</displayUnits>
|
||||
<displayUnits>C</displayUnits>
|
||||
<displayFlags>NoPlane</displayFlags>
|
||||
<contourLabeling labelSpacing="4">
|
||||
<increment>2</increment>
|
||||
|
@ -1229,7 +1229,7 @@ C | 1 | 0 | 4 | | |..|8000F0FF|,900| 0 | 2
|
|||
<creatingEntity>Laps</creatingEntity>
|
||||
</paramLevelMatches>
|
||||
<contourStyle>
|
||||
<displayUnits label="C">K</displayUnits>
|
||||
<displayUnits>C</displayUnits>
|
||||
<displayFlags>NoPlane</displayFlags>
|
||||
<contourLabeling labelSpacing="4">
|
||||
<increment>2</increment>
|
||||
|
@ -1244,7 +1244,7 @@ C | 1 | 0 | 4 | | |..|8000F0FF| | 0 | 2
|
|||
<parameter>BLI</parameter>
|
||||
</paramLevelMatches>
|
||||
<contourStyle>
|
||||
<displayUnits label="C">K</displayUnits>
|
||||
<displayUnits>C</displayUnits>
|
||||
<contourLabeling labelSpacing="4">
|
||||
<increment>2</increment>
|
||||
</contourLabeling>
|
||||
|
@ -2771,7 +2771,7 @@ C | 1 | 0 | 4 | | |..|8000F0FF|,,,80 | 0 | 2
|
|||
</paramLevelMatches>
|
||||
<contourStyle>
|
||||
<smoothingDistance>80</smoothingDistance>
|
||||
<displayUnits label="C">K</displayUnits>
|
||||
<displayUnits>C</displayUnits>
|
||||
<displayFlags>NoPlane</displayFlags>
|
||||
<contourLabeling labelSpacing="4">
|
||||
<increment>2</increment>
|
||||
|
|
|
@ -347,7 +347,7 @@
|
|||
<parameter>shWlt</parameter>
|
||||
</paramLevelMatches>
|
||||
<graphStyle>
|
||||
<displayUnits label="C">K</displayUnits>
|
||||
<displayUnits>C</displayUnits>
|
||||
</graphStyle>
|
||||
</styleRule>
|
||||
|
||||
|
|
|
@ -1780,7 +1780,7 @@
|
|||
<parameter>PLI</parameter>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits label="C">K</displayUnits>
|
||||
<displayUnits>C</displayUnits>
|
||||
<range scale="LINEAR">
|
||||
<minValue>-15</minValue>
|
||||
<maxValue>15</maxValue>
|
||||
|
@ -1800,7 +1800,7 @@
|
|||
<parameter>BLI</parameter>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits label="C">K</displayUnits>
|
||||
<displayUnits>C</displayUnits>
|
||||
<range scale="LINEAR">
|
||||
<minValue>-15</minValue>
|
||||
<maxValue>15</maxValue>
|
||||
|
|
|
@ -13,6 +13,11 @@
|
|||
THIS CHANGE WAS DONE SO THAT CONFIGURATIONS COULD BE MADE IN ONE LOCATION
|
||||
AND NOT ACROSS 20-30 TEMPLATES. A COUNTY-BASED and ZONE-BASED COUNTERPART
|
||||
EXISTS TO THIS FILE.
|
||||
|
||||
SOFTWARE HISTORY
|
||||
Date Ticket# Engineer Description
|
||||
01/20/15 RM #14929 Qinglu Lin Changed false to true for <withinPolygon> tags in <pathcastConfig>,
|
||||
<pointSource variable="otherPoints>, and <pointSource variable="locationList">.
|
||||
-->
|
||||
|
||||
<!-- CREATE DEFAULT OBJECTS. THIS SHOULD GENERALLY NOT BE TOUCHED-->
|
||||
|
@ -96,10 +101,7 @@
|
|||
<!-- CREATE pathcastConfig OBJECT FOR PATHCAST (4TH BULLET) -->
|
||||
<pathcastConfig>
|
||||
<type>AREA</type>
|
||||
<!-- the withinPolygon variable set to false will bring in points
|
||||
outside of the polygon which is necessary for the pathcast to reference
|
||||
points that are near the water but not on the water -->
|
||||
<withinPolygon>false</withinPolygon>
|
||||
<withinPolygon>true</withinPolygon>
|
||||
<inclusionPercent>1</inclusionPercent>
|
||||
<distanceThreshold>10.0</distanceThreshold>
|
||||
<interval>5</interval>
|
||||
|
@ -131,7 +133,7 @@
|
|||
<inclusionPercent>1</inclusionPercent>
|
||||
<type>AREA</type>
|
||||
<searchMethod>TRACK</searchMethod>
|
||||
<withinPolygon>false</withinPolygon>
|
||||
<withinPolygon>true</withinPolygon>
|
||||
<maxResults>10</maxResults>
|
||||
<distanceThreshold>10</distanceThreshold>
|
||||
<sortBy>
|
||||
|
@ -154,7 +156,7 @@
|
|||
<inclusionPercent>1</inclusionPercent>
|
||||
<type>AREA</type>
|
||||
<searchMethod>TRACK</searchMethod>
|
||||
<withinPolygon>false</withinPolygon>
|
||||
<withinPolygon>true</withinPolygon>
|
||||
<maxResults>20</maxResults>
|
||||
<distanceThreshold>10</distanceThreshold>
|
||||
<filter>
|
||||
|
|
|
@ -182,6 +182,42 @@ MpeRUCFreezingLevel : ON
|
|||
MpeLightningSrv : ON
|
||||
#====================================================================================
|
||||
|
||||
#===================== run_report_alarm Configuration ===============================
|
||||
# These settings modify behavior of the EDEX RunReportAlarmSrv service, which
|
||||
# replaced the original run_report_alarm script ported from A1 hydro.
|
||||
#
|
||||
## Mandatory Arguments:
|
||||
## alarm_product_id : The product id that will be used to write the alarm
|
||||
## report product into the textdb.
|
||||
##
|
||||
## Optional Arguments:
|
||||
## alarm_file_suffix : A Java date/time format string that will be used as
|
||||
## the alarm report's file extension when the product is
|
||||
## written to disk. Product file path is
|
||||
## ${whfs_product_dir}/PRODUCT_ID.FILE_SUFFIX.
|
||||
##
|
||||
## alarm_report_mode : Report mode. Valid values are one of the following:
|
||||
## ALL, FRESH, RECENT, UNREPORTED, NEAREST, NEAR_NOW,
|
||||
## LATEST_MAXFCST, or NEW_OR_INCREASED.
|
||||
##
|
||||
## alarm_filter : Additional filtering options for the product.
|
||||
## Valid values can one or many of the following:
|
||||
## 'O', 'F', 'T', 'M', 'R', 'L', 'U', 'D'.
|
||||
##
|
||||
## alarm_pe_filter : Physical element filter.
|
||||
##
|
||||
## alarm_minutes : For certain report modes, creates a window going back
|
||||
## or forward the specified number of minutes.
|
||||
## Valid values are 1 - 999999.
|
||||
##
|
||||
## alarm_verbose : Whether or not to create a "verbose mode" report.
|
||||
## Valid values are TRUE or FALSE.
|
||||
##
|
||||
|
||||
alarm_product_id : CCCACRXXX
|
||||
alarm_file_suffix : MMdd.HHmm
|
||||
alarm_report_mode : NEAREST
|
||||
|
||||
# ==============================================================================
|
||||
|
||||
# Executable directory tokens.
|
||||
|
@ -207,7 +243,7 @@ server_name : ONLINE # Informix database server name
|
|||
db_name : hd_ob92lwx # IHFS database name
|
||||
damcat_db_name : dc_ob5xxx # Dam Catalog database name
|
||||
hdb_db_name : ob81_histdata # Historical database.
|
||||
pghost : localhost # The machine PostGres is running on
|
||||
pghost : dx1f # The machine PostGres is running on
|
||||
pguser : awips # The user allowed to access PostGres
|
||||
pgport : 5432 # The PostGres Server port
|
||||
adb_name : adb_ob7xxx # RFC archive database name
|
||||
|
@ -1896,7 +1932,11 @@ mpe_post_output : $(mpe_fieldgen_product_dir)/post_analysis
|
|||
# add ,RDMOSAIC,BDMOSAIC,LDMOSAIC,MDMOSAIC,MLDMOSAIC,AVGRDMOSAIC,MAXRDMOSAIC,SRDMOSAIC,SRDGMOSAIC to existing mpe_generate_list token
|
||||
|
||||
# ================== end of SSHP Directory Structure tokens ========================
|
||||
|
||||
# nrldb tokens
|
||||
nrldb_log : $(whfs_log_dir)/nrldb
|
||||
nrldb_data : $(whfs_local_data_dir)/nrldb
|
||||
nrldb_config : $(whfs_config_dir)/nrldb
|
||||
nrldb_tmp : /awips/hydroapps/whfs/local/data/output
|
||||
|
||||
# The syntax needed in the file is:
|
||||
#
|
||||
|
|
|
@ -92,6 +92,11 @@ import com.raytheon.uf.edex.database.query.DatabaseQuery;
|
|||
* Added performance logging
|
||||
* Nov 14, 2014 4953 randerso Moved dumpProductToTempFile into PracticeVtecDecoder
|
||||
* since it had no reason to be in this class
|
||||
* Feb 05, 2015 16942 ryu Fix update of records for sites other than
|
||||
* the home site and its neighbors.
|
||||
* Pass issuance site id to getActiveTable()
|
||||
* in updateActiveTable() so records will
|
||||
* be updated correctly.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -286,11 +291,13 @@ public class ActiveTable {
|
|||
mode = ActiveTableMode.OPERATIONAL;
|
||||
}
|
||||
|
||||
String issueSiteId = newRecords.get(0).getOfficeid();
|
||||
|
||||
IPerformanceStatusHandler perfStat = PerformanceStatus
|
||||
.getHandler("ActiveTable");
|
||||
ITimer timer = TimeUtil.getTimer();
|
||||
timer.start();
|
||||
List<ActiveTableRecord> activeTable = getActiveTable(siteId, mode);
|
||||
List<ActiveTableRecord> activeTable = getActiveTable(issueSiteId, mode);
|
||||
timer.stop();
|
||||
perfStat.logDuration("getActiveTable", timer.getElapsedTime());
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* Dec 12, 2013 2624 rferrel Document Julian time stamp.
|
||||
* May 14, 2014 2881 rferrel Change retention times and data set modifications.
|
||||
* Aug 25, 2014 3537 rferrel Fixed dirPattern in Category Local.
|
||||
* Feb 02, 2015 4066 rferrel Added lightning to Observation category.
|
||||
*
|
||||
* @author rferrel
|
||||
* @version 1.0
|
||||
|
@ -208,7 +209,7 @@
|
|||
<name>Observation</name>
|
||||
<extRetentionHours>168</extRetentionHours>
|
||||
<dataSet>
|
||||
<dirPattern>(airep|binlightning|bufrascat|bufrhdw|bufrmthdw|bufrssmi|lsr|MAROB|maritime|metar|misc_sfc_obs|pirep|sfcobs|shef|svrwx|synoptic)/(\d{4})(\d{2})(\d{2})/(\d{2})</dirPattern>
|
||||
<dirPattern>(airep|binlightning|bufrascat|bufrhdw|bufrmthdw|bufrssmi|entlightning|lsr|MAROB|maritime|metar|misc_sfc_obs|pirep|sfcobs|shef|svrwx|synoptic)/(\d{4})(\d{2})(\d{2})/(\d{2})</dirPattern>
|
||||
<displayLabel>{1}</displayLabel>
|
||||
<dateGroupIndices>2,3,4,5</dateGroupIndices>
|
||||
</dataSet>
|
||||
|
|
|
@ -28,6 +28,8 @@ import java.util.Set;
|
|||
|
||||
import com.raytheon.uf.common.datadelivery.registry.AdhocSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.DataType;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SharedSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SiteSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.DataDeliveryHandlers;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.ISubscriptionHandler;
|
||||
|
@ -48,6 +50,7 @@ import com.raytheon.uf.edex.registry.ebxml.util.RegistryIdUtil;
|
|||
* Oct 24, 2013 2292 mpduff Initial creation
|
||||
* Nov 01, 2013 2292 dhladky Don't check against yourself for duplication
|
||||
* Feb 11, 2014 2771 bgonzale Use Data Delivery ID instead of Site.
|
||||
* Dec 08, 2014 3891 dhladky Allow for promotion of site subscriptions to shared.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -80,9 +83,21 @@ public class SubscriptionOverlapHandler implements
|
|||
DataType dataType = subscription.getDataSetType();
|
||||
Set<String> overlappingSubscriptions = new HashSet<String>();
|
||||
for (Subscription potentialDuplicate : potentialDuplicates) {
|
||||
// don't check against yourself
|
||||
if (potentialDuplicate.getId().equals(subscription.getId())) {
|
||||
continue;
|
||||
// Check for special promotion case
|
||||
if (subscription instanceof SharedSubscription
|
||||
&& potentialDuplicate instanceof SiteSubscription) {
|
||||
// Not as stringent a check as the ID's won't be equal
|
||||
// but the names still will
|
||||
if (potentialDuplicate.getName().equals(
|
||||
subscription.getName())) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
// Normal sequence, don't check self
|
||||
if (potentialDuplicate.getId().equals(
|
||||
subscription.getId())) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
OverlapData od = OverlapDataFactory.getOverlapData(
|
||||
subscription, potentialDuplicate);
|
||||
|
|
|
@ -21,6 +21,7 @@ package com.raytheon.uf.edex.plugin.hpe.util;
|
|||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.SortedMap;
|
||||
|
@ -44,7 +45,7 @@ import com.raytheon.uf.edex.plugin.hpe.util.HpeEnums.HpeDataSource;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 26, 2014 3026 mpduff Initial creation
|
||||
* Nov 12, 2014 3026 mpduff Fix handling of query results
|
||||
* Nov 12, 2014 3026 mpduff Fix handling of query results and query by current hour
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -94,6 +95,16 @@ public class HpeDataAccessor {
|
|||
Date recdate, String productName) throws Exception {
|
||||
SortedMap<String, List<BiasDynRecord>> dataMap = new TreeMap<String, List<BiasDynRecord>>();
|
||||
|
||||
/*
|
||||
* Bias data are by the hour. Get the current hour to query on
|
||||
*/
|
||||
long ms = recdate.getTime();
|
||||
Calendar currentHour = TimeUtil.newGmtCalendar();
|
||||
currentHour.setTimeInMillis(ms);
|
||||
currentHour.set(Calendar.MINUTE, 0);
|
||||
currentHour.set(Calendar.SECOND, 0);
|
||||
currentHour.set(Calendar.MILLISECOND, 0);
|
||||
|
||||
HpeRadarResult hpeResult = getHpeRadarResult(recdate, productName);
|
||||
|
||||
HpeDataSource source = hpeResult.getRadarDataSource();
|
||||
|
@ -115,7 +126,8 @@ public class HpeDataAccessor {
|
|||
query.append(" from ").append(table);
|
||||
query.append(" where office_id ").append(" = '").append(office)
|
||||
.append("'");
|
||||
query.append(" and obstime = '").append(sdf.get().format(recdate));
|
||||
query.append(" and obstime = '").append(
|
||||
sdf.get().format(currentHour.getTime()));
|
||||
query.append("'").append(" order by radid asc, memspan_ind asc");
|
||||
|
||||
Object[] results = dao.executeSQLQuery(query.toString());
|
||||
|
@ -126,14 +138,14 @@ public class HpeDataAccessor {
|
|||
rec.setRadarId((String) oa[0]);
|
||||
rec.setOfficeId((String) oa[1]);
|
||||
rec.setObsTime((Date) oa[2]);
|
||||
rec.setMemspanIndex((Integer) oa[3]);
|
||||
rec.setNumPairs((Float) oa[4]);
|
||||
rec.setMemspanIndex((Short) oa[3]);
|
||||
rec.setNumPairs((Double) oa[4]);
|
||||
rec.setSumGages((Float) oa[5]);
|
||||
rec.setSumRadars((Float) oa[6]);
|
||||
rec.setBias((Float) oa[7]);
|
||||
|
||||
if (!dataMap.containsKey(rec.getOfficeId())) {
|
||||
dataMap.put(rec.getOfficeId(),
|
||||
if (!dataMap.containsKey(rec.getRadarId())) {
|
||||
dataMap.put(rec.getRadarId(),
|
||||
new ArrayList<BiasDynRecord>());
|
||||
}
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@ import com.raytheon.uf.edex.plugin.hpe.util.HpeEnums.HpeDataSource;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 26, 2014 3026 mpduff Initial creation
|
||||
* Dec 16, 2014 3026 mpduff Add default value if numPairs < npairBiasSelect
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -172,7 +173,11 @@ public class HpeLabelGenerator {
|
|||
sb.append(bias).append(SLASH)
|
||||
.append((int) rec.getNumPairs());
|
||||
sb.append(StringUtil.NEWLINE);
|
||||
|
||||
return sb.toString();
|
||||
} else {
|
||||
sb.append("1.00").append(SLASH)
|
||||
.append((int) rec.getNumPairs());
|
||||
sb.append(StringUtil.NEWLINE);
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,8 @@ Require-Bundle: com.raytheon.edex.common,
|
|||
com.raytheon.uf.common.status;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.edex.ndm;bundle-version="1.14.0",
|
||||
com.raytheon.uf.edex.menus;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.dataplugin.redbook;bundle-version="1.14.0"
|
||||
com.raytheon.uf.common.dataplugin.redbook;bundle-version="1.14.0",
|
||||
org.apache.commons.lang;bundle-version="2.3.0"
|
||||
Export-Package: com.raytheon.uf.edex.plugin.redbook,
|
||||
com.raytheon.uf.edex.plugin.redbook.decoder
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
|
|
|
@ -47,6 +47,7 @@ import com.raytheon.uf.edex.plugin.redbook.menu.RedbookUaMenuUtil;
|
|||
* Mar 19, 2014 2857 mpduff Implement NCO.
|
||||
* Mar 19, 2014 2859 mpduff Implement MPC.
|
||||
* Mar 19, 2014 2860 mpduff Implement Upper Air.
|
||||
* Jan 28, 2015 4030 mpduff Changed constants to public.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -60,22 +61,22 @@ public class RedbookMenuSubscriber implements INationalDatasetSubscriber {
|
|||
.getHandler(RedbookMenuSubscriber.class);
|
||||
|
||||
/** Hazard menu file */
|
||||
private static final String HAZARD_MENU_FILE = "RedbookHazardMenus.xml";
|
||||
public static final String HAZARD_MENU_FILE = "RedbookHazardMenus.xml";
|
||||
|
||||
/** HPC menu file */
|
||||
private static final String HPC_MENU_FILE = "RedbookHPCMenus.xml";
|
||||
public static final String HPC_MENU_FILE = "RedbookHPCMenus.xml";
|
||||
|
||||
/** CPC menu file */
|
||||
private static final String CPC_MENU_FILE = "RedbookCPCMenus.xml";
|
||||
public static final String CPC_MENU_FILE = "RedbookCPCMenus.xml";
|
||||
|
||||
/** MPC menu file */
|
||||
private static final String MPC_MENU_FILE = "RedbookMPCMenus.xml";
|
||||
public static final String MPC_MENU_FILE = "RedbookMPCMenus.xml";
|
||||
|
||||
/** NCO menu file */
|
||||
private static final String NCO_MENU_FILE = "RedbookNCOMenus.xml";
|
||||
public static final String NCO_MENU_FILE = "RedbookNCOMenus.xml";
|
||||
|
||||
/** Upper air menu file */
|
||||
private static final String UA_MENU_FILE = "RedbookUAMenus.xml";
|
||||
public static final String UA_MENU_FILE = "RedbookUAMenus.xml";
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
|
|
|
@ -39,6 +39,7 @@ import javax.xml.bind.annotation.XmlElements;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 12, 2014 2855 mpduff Initial creation
|
||||
* Mar 19, 2014 2860 mpduff Added DataUri.
|
||||
* Jan 28, 2015 4030 mpduff Added addMenuEntry method.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -208,7 +209,7 @@ public class MenuEntry {
|
|||
* @param menuEntryList
|
||||
* the menuEntryList to set
|
||||
*/
|
||||
public void setMenuEntryyList(List<MenuEntry> menuEntryList) {
|
||||
public void setMenuEntryList(List<MenuEntry> menuEntryList) {
|
||||
this.menuEntryList = menuEntryList;
|
||||
}
|
||||
|
||||
|
@ -227,6 +228,18 @@ public class MenuEntry {
|
|||
this.dataUri = dataUri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a {@link MenuEntry}
|
||||
*
|
||||
* @param entry
|
||||
*/
|
||||
public void addMenuEntry(MenuEntry entry) {
|
||||
if (this.menuEntryList == null) {
|
||||
menuEntryList = new ArrayList<MenuEntry>();
|
||||
}
|
||||
menuEntryList.add(entry);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
|
|
@ -39,6 +39,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 07, 2014 2858 mpduff Initial creation.
|
||||
* Mar 17, 2014 2855 mpduff Renamed to RedbookMenusXML.java.
|
||||
* Jan 28, 2015 4030 mpduff Added addMenuEntry method.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -78,6 +79,10 @@ public class RedbookMenusXML {
|
|||
this.menuEntryList = menuEntryList;
|
||||
}
|
||||
|
||||
public void addMenuEntry(MenuEntry entry) {
|
||||
menuEntryList.add(entry);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
|
|
@ -0,0 +1,360 @@
|
|||
/**
|
||||
* 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.uf.edex.plugin.redbook.menu;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.file.Files;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.Marshaller;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import com.raytheon.uf.edex.plugin.redbook.ingest.RedbookMenuSubscriber;
|
||||
import com.raytheon.uf.edex.plugin.redbook.ingest.xml.MenuEntry;
|
||||
import com.raytheon.uf.edex.plugin.redbook.ingest.xml.MenuEntryType;
|
||||
import com.raytheon.uf.edex.plugin.redbook.ingest.xml.RedbookMenusXML;
|
||||
|
||||
/**
|
||||
* This class is called from /awips2/edex/bin/ndmMenuIngester.sh.
|
||||
*
|
||||
* It reads in the NDM menu files and outputs an A2 version into the NDM
|
||||
* endpoint on edex.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 30, 2015 4030 mpduff Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mpduff
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class NdmMenuConverter {
|
||||
private static final String WMO = "wmo";
|
||||
|
||||
private static final String OUTPUT_PATH = File.separator + "awips2"
|
||||
+ File.separator + "edex" + File.separator + "data"
|
||||
+ File.separator + "ndm" + File.separator;
|
||||
|
||||
private static final String HPC_FILE = "redbookHPCMenus.txt";
|
||||
|
||||
private static final String CPC_FILE = "redbookCPCMenus.txt";
|
||||
|
||||
private static final String NCO_FILE = "redbookNCOMenus.txt";
|
||||
|
||||
private static final String HAZARDS_FILE = "redbookHazardMenus.txt";
|
||||
|
||||
private static final String MARINE_FILE = "redbookMarineMenus.txt";
|
||||
|
||||
private static final String UPPER_AIR_FILE = "redbookUpperAirMenus.txt";
|
||||
|
||||
private String dataKeysPath;
|
||||
|
||||
private String depictKeysPath;
|
||||
|
||||
private String menuFilePath;
|
||||
|
||||
private String productButtonPath;
|
||||
|
||||
private JAXBContext jax;
|
||||
|
||||
private Marshaller marshaller;
|
||||
|
||||
private File depictFile;
|
||||
|
||||
public NdmMenuConverter() {
|
||||
createContext();
|
||||
}
|
||||
|
||||
public void convert() {
|
||||
RedbookMenusXML menuXml = new RedbookMenusXML();
|
||||
MenuEntry titleMenuEntry;
|
||||
int sepCounter = 0;
|
||||
List<MenuEntry> subMenuList = new ArrayList<MenuEntry>();
|
||||
|
||||
try {
|
||||
File dataFile = new File(this.dataKeysPath);
|
||||
File menuFile = new File(this.menuFilePath);
|
||||
depictFile = new File(this.depictKeysPath);
|
||||
File productButtonFile = new File(this.productButtonPath);
|
||||
|
||||
List<String> dataKeys = Files.readAllLines(dataFile.toPath(),
|
||||
Charset.defaultCharset());
|
||||
List<String> depictKeys = Files.readAllLines(depictFile.toPath(),
|
||||
Charset.defaultCharset());
|
||||
List<String> lines = Files.readAllLines(menuFile.toPath(),
|
||||
Charset.defaultCharset());
|
||||
List<String> productButtonKeys = Files.readAllLines(
|
||||
productButtonFile.toPath(), Charset.defaultCharset());
|
||||
Map<String, String> menuTextMap = getMenuTextMap(productButtonKeys);
|
||||
Map<String, String> dataKeyMap = getSubstitutionMap(dataKeys);
|
||||
|
||||
MenuEntry subMenuEntry = null;
|
||||
|
||||
int subMenuCount = -1;
|
||||
for (String line : lines) {
|
||||
line = line.trim();
|
||||
if (line.startsWith("submenu")) {
|
||||
subMenuCount++;
|
||||
if (line.contains("&")) {
|
||||
line = line.replace("&", "&&");
|
||||
}
|
||||
|
||||
String[] parts = line.split(":");
|
||||
String text = parts[1].replace("\"", "");
|
||||
|
||||
subMenuEntry = new MenuEntry();
|
||||
subMenuEntry.setFile(null);
|
||||
subMenuEntry.setType(MenuEntryType.Submenu);
|
||||
subMenuEntry.setText(text.trim());
|
||||
|
||||
subMenuList.add(subMenuEntry);
|
||||
} else if (line.startsWith("title")) {
|
||||
String[] parts = line.split(":");
|
||||
String text = parts[1].replace("\"", "");
|
||||
titleMenuEntry = new MenuEntry();
|
||||
titleMenuEntry.setFile(null);
|
||||
titleMenuEntry.setType(MenuEntryType.Title);
|
||||
titleMenuEntry.setText(text);
|
||||
titleMenuEntry.setId(text);
|
||||
subMenuList.get(subMenuCount).addMenuEntry(titleMenuEntry);
|
||||
} else if (line.startsWith("productButton")) {
|
||||
String[] parts = line.split(":");
|
||||
MenuEntry me = new MenuEntry();
|
||||
me.setFile(null);
|
||||
me.setType(MenuEntryType.ProductButton);
|
||||
/*
|
||||
* There are certain productButtons in the NCO menu data
|
||||
* keys in the (25000 range) that have data keys that don't
|
||||
* map to anything. This results in those menu items not
|
||||
* being created. The site will need to fix this after
|
||||
* generating the new menus.
|
||||
*/
|
||||
String dataKey = parts[1].trim().substring(0, 4);
|
||||
StringBuilder subValue = new StringBuilder();
|
||||
// Find the matching value
|
||||
for (String depictKeyLine : depictKeys) {
|
||||
if (depictKeyLine.trim().startsWith(dataKey)) {
|
||||
String[] depictKeyParts = depictKeyLine
|
||||
.split("\\|");
|
||||
me.setText(menuTextMap.get(dataKey));
|
||||
me.setId(depictKeyParts[6].trim());
|
||||
subMenuList.get(subMenuCount).addMenuEntry(me);
|
||||
|
||||
String[] subParts = depictKeyParts[2].split(",");
|
||||
MenuEntry subEntry = new MenuEntry();
|
||||
subEntry.setFile(null);
|
||||
subEntry.setType(MenuEntryType.Substitute);
|
||||
subEntry.setKey(WMO);
|
||||
|
||||
for (String subPart : subParts) {
|
||||
for (String key : dataKeyMap.keySet()) {
|
||||
if (key.startsWith(subPart)) {
|
||||
subValue.append(dataKeyMap.get(key))
|
||||
.append(",");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String subValueStr = subValue.toString();
|
||||
subValueStr = StringUtils.removeEnd(subValueStr,
|
||||
",");
|
||||
subEntry.setValue(subValueStr);
|
||||
me.addMenuEntry(subEntry);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (line.startsWith("endSubmenu")) {
|
||||
// subMenuList.add(subMenuEntry);
|
||||
MenuEntry closedSubMenu = subMenuList.remove(subMenuCount);
|
||||
subMenuCount--;
|
||||
if (subMenuCount == -1) {
|
||||
menuXml.addMenuEntry(closedSubMenu);
|
||||
} else {
|
||||
subMenuList.get(subMenuCount).addMenuEntry(
|
||||
closedSubMenu);
|
||||
}
|
||||
} else if (line.startsWith("separator")) {
|
||||
MenuEntry sep = new MenuEntry();
|
||||
sep.setFile(null);
|
||||
sep.setType(MenuEntryType.Separator);
|
||||
sep.setId("Separator" + sepCounter++);
|
||||
subMenuList.get(subMenuCount).addMenuEntry(sep);
|
||||
}
|
||||
}
|
||||
|
||||
// Set output file name
|
||||
String inputFileName = menuFile.getName();
|
||||
String outputFileName = null;
|
||||
if (inputFileName.equals(CPC_FILE)) {
|
||||
outputFileName = RedbookMenuSubscriber.CPC_MENU_FILE;
|
||||
} else if (inputFileName.equals(HPC_FILE)) {
|
||||
outputFileName = RedbookMenuSubscriber.HPC_MENU_FILE;
|
||||
} else if (inputFileName.equals(NCO_FILE)) {
|
||||
outputFileName = RedbookMenuSubscriber.NCO_MENU_FILE;
|
||||
} else if (inputFileName.equals(HAZARDS_FILE)) {
|
||||
outputFileName = RedbookMenuSubscriber.HAZARD_MENU_FILE;
|
||||
} else if (inputFileName.equals(MARINE_FILE)) {
|
||||
outputFileName = RedbookMenuSubscriber.MPC_MENU_FILE;
|
||||
} else if (inputFileName.equals(UPPER_AIR_FILE)) {
|
||||
outputFileName = RedbookMenuSubscriber.UA_MENU_FILE;
|
||||
} else {
|
||||
throw new IOException("Error processing file");
|
||||
}
|
||||
|
||||
marshaller.marshal(menuXml, new File(OUTPUT_PATH + outputFileName));
|
||||
} catch (Exception e) {
|
||||
System.err.println("Error occurred processing file: "
|
||||
+ menuFilePath);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a map of menu keys to menu text.
|
||||
*
|
||||
* @param productButtonKeys
|
||||
* List of strings from redbookProductButtons.txt
|
||||
*
|
||||
* @return Map for key -> menu text
|
||||
*/
|
||||
private Map<String, String> getMenuTextMap(List<String> productButtonKeys) {
|
||||
Map<String, String> menuTextMap = new HashMap<String, String>();
|
||||
for (String line : productButtonKeys) {
|
||||
line = line.trim();
|
||||
// Skip comment lines
|
||||
if (line.startsWith("#") || line.trim().length() == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String[] parts = line.split("\\|");
|
||||
menuTextMap.put(parts[0].trim(), parts[2].trim());
|
||||
}
|
||||
|
||||
return menuTextMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a map of key to substitution values.
|
||||
*
|
||||
* @param dataKeys
|
||||
* List of strings from the redbookDataKeys.txt file
|
||||
* @returnMap for key -> substitution string
|
||||
*/
|
||||
private Map<String, String> getSubstitutionMap(List<String> dataKeys) {
|
||||
Map<String, String> dataKeyMap = new HashMap<String, String>();
|
||||
for (String line : dataKeys) {
|
||||
line = line.trim();
|
||||
// Skip comment lines
|
||||
if (line.startsWith("#") || line.trim().length() == 0) {
|
||||
continue;
|
||||
}
|
||||
String[] parts = line.split("\\|");
|
||||
dataKeyMap.put(parts[0].trim(), parts[10].substring(0, 6));
|
||||
}
|
||||
|
||||
return dataKeyMap;
|
||||
}
|
||||
|
||||
public String getDataKeysPath() {
|
||||
return dataKeysPath;
|
||||
}
|
||||
|
||||
public void setDataKeysPath(String dataKeysPath) {
|
||||
this.dataKeysPath = dataKeysPath;
|
||||
}
|
||||
|
||||
public String getDepictKeysPath() {
|
||||
return depictKeysPath;
|
||||
}
|
||||
|
||||
public void setDepictKeysPath(String depictKeysPath) {
|
||||
this.depictKeysPath = depictKeysPath;
|
||||
}
|
||||
|
||||
public String getMenuFilePath() {
|
||||
return menuFilePath;
|
||||
}
|
||||
|
||||
public void setMenuFilePath(String menuFilePath) {
|
||||
this.menuFilePath = menuFilePath;
|
||||
}
|
||||
|
||||
public void setProductButtonPath(String productButtonPath) {
|
||||
this.productButtonPath = productButtonPath;
|
||||
}
|
||||
|
||||
public String getProductButtonPath() {
|
||||
return this.productButtonPath;
|
||||
}
|
||||
|
||||
private void createContext() {
|
||||
Class[] classes = new Class[] { MenuEntry.class, MenuEntryType.class,
|
||||
RedbookMenusXML.class };
|
||||
|
||||
try {
|
||||
jax = JAXBContext.newInstance(classes);
|
||||
this.marshaller = jax.createMarshaller();
|
||||
this.marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
if (args.length != 2) {
|
||||
System.err.println("Unexpected Arguments");
|
||||
System.err
|
||||
.println("Expecting local NDM directory and NDM File Menu Name");
|
||||
return;
|
||||
}
|
||||
|
||||
String dirPath = args[0];
|
||||
if (!dirPath.endsWith(File.separator)) {
|
||||
dirPath = dirPath.concat(File.separator);
|
||||
}
|
||||
String menuFile = dirPath + args[1];
|
||||
String dataKeysFile = dirPath + "redbookDataKeys.txt";
|
||||
String depictKeysFile = dirPath + "redbookDepictKeys.txt";
|
||||
String productButtonFile = dirPath + "redbookProductButtons.txt";
|
||||
|
||||
NdmMenuConverter converter = new NdmMenuConverter();
|
||||
converter.setDataKeysPath(dataKeysFile);
|
||||
converter.setMenuFilePath(menuFile);
|
||||
converter.setDepictKeysPath(depictKeysFile);
|
||||
converter.setProductButtonPath(productButtonFile);
|
||||
converter.convert();
|
||||
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
|
||||
if [ ${#AWIPS_HOME} = 0 ]
|
||||
then
|
||||
path_to_script=`readlink -f $0`
|
||||
|
@ -8,6 +9,12 @@ fi
|
|||
|
||||
. ${AWIPS_HOME}/GFESuite/ServiceBackup/configuration/svcbu.env
|
||||
|
||||
if [ ${#IFPS_LOG} = 0 ]
|
||||
then
|
||||
echo "ERROR: environment variable IFPS_LOG is undfined, exit."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
find ${IFPS_LOG}/* -mtime +7 -exec rm -fr {} \; 2>/dev/null
|
||||
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
# ------------ ---------- ----------- --------------------------
|
||||
# 03/20/14 #2933 randerso Changed PRDDIR and LOGDIR to use
|
||||
# Backup site's configuration
|
||||
# 01/30/15 #17081 lshi Added backup vtec
|
||||
##############################################################################
|
||||
|
||||
import_file=${1}
|
||||
|
@ -175,6 +176,9 @@ log_msg 80
|
|||
cp -r GFEconfig/edex_static/site/smartinit ${edex_site_si_dest}
|
||||
log_msg 90
|
||||
cp -r GFEconfig/cave_static/site/* ${cave_site_dest}
|
||||
# DR 17081
|
||||
log_msg 91
|
||||
cp -r GFEconfig/common_static/site/vtec ${common_site_dest}
|
||||
log_msg 93
|
||||
# DR 16464
|
||||
cp -a GFEConfig/site/rsync_parms.${SITE_CAPS} ${rsync_parms_dest}.${SITE_CAPS}
|
||||
|
|
|
@ -1 +1 @@
|
|||
198d9e1b995f9fcf55686c0992f4bb0612f429e0
|
||||
409f53ec4cfa407ad0854b18dafce4521e2bb99a
|
|
@ -1 +1 @@
|
|||
198d9e1b995f9fcf55686c0992f4bb0612f429e0
|
||||
409f53ec4cfa407ad0854b18dafce4521e2bb99a
|
|
@ -30,6 +30,7 @@
|
|||
* new local fields to
|
||||
* mpe_qpe_fields and
|
||||
* mpe_qpe_dependencies
|
||||
* 2/4/2015 C Gobs DR 17069 - mpe_generate_list - token value too short
|
||||
********************************************************************************
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
|
@ -130,6 +131,7 @@ const static char * mpe_qpe_dependencies [ NUM_BEST_PRODUCTS ] =
|
|||
/* GageOnly Generation rule in case mpe_del_gage_zeros token is OFF. */
|
||||
const static char * gageonly_del_gages_off = "" ;
|
||||
|
||||
#define MPE_GENERATE_LIST_REPLY_LEN 512
|
||||
|
||||
/*******************************************************************************
|
||||
* MODULE NUMBER: 1
|
||||
|
@ -514,7 +516,7 @@ void get_mpe_product_state ( const char * product , const int * product_len ,
|
|||
char mpe_del_gage_zeros_reply [ MPE_PRODUCT_REPLY_LEN ] = { '\0' } ;
|
||||
char mpe_generate_areal_qpe_reply [ MPE_PRODUCT_REPLY_LEN ] = {'\0'};
|
||||
static char * mpe_generate_list_token = MPE_GENERATE_LIST_TOKEN ;
|
||||
char mpe_generate_list_reply [ MPE_PRODUCT_REPLY_LEN ] = { '\0' } ;
|
||||
char mpe_generate_list_reply [ MPE_GENERATE_LIST_REPLY_LEN ] = { '\0' } ;
|
||||
static char mpe_qpe_fieldtype [ BESTFIELD_LEN] = { '\0' } ;
|
||||
char * pChar = NULL ;
|
||||
char * pString = NULL ;
|
||||
|
@ -598,9 +600,10 @@ void get_mpe_product_state ( const char * product , const int * product_len ,
|
|||
"empty.\n" , mpe_generate_list_token ) ;
|
||||
}
|
||||
|
||||
memset ( mpe_generate_list_reply , '\0' , MPE_PRODUCT_REPLY_LEN ) ;
|
||||
memset ( mpe_generate_list_reply , '\0' , MPE_GENERATE_LIST_REPLY_LEN ) ;
|
||||
}
|
||||
printf("get_mpe_product_state(): mpe_generate_list_reply = :%s: \n", mpe_generate_list_reply);
|
||||
printf("get_mpe_product_state(): mpe_generate_list_reply = :%s: characters in mpe_generate_list_reply = %d max = %d\n", mpe_generate_list_reply,
|
||||
strlen(mpe_generate_list_reply), MPE_GENERATE_LIST_REPLY_LEN);
|
||||
|
||||
/* Get the value of the mpe_del_gage_zeros token. */
|
||||
request_len = strlen ( mpe_del_gage_zeros_token ) ;
|
||||
|
|
|
@ -33,6 +33,7 @@ Import-Package: com.raytheon.uf.common.dataplugin.bufrua,
|
|||
com.raytheon.uf.common.dataplugin.level,
|
||||
com.raytheon.uf.common.pointdata,
|
||||
com.raytheon.uf.common.pointdata.spatial,
|
||||
com.raytheon.uf.common.topo,
|
||||
com.raytheon.uf.edex.pointdata,
|
||||
gov.noaa.nws.ncep.common.tools,
|
||||
gov.noaa.nws.ncep.edex.common.metparameters,
|
||||
|
|
|
@ -18,6 +18,9 @@ package gov.noaa.nws.ncep.edex.uengine.tasks.profile;
|
|||
* dataStore.retrieveGroups()
|
||||
* Oct 15, 2012 2473 bsteffen Remove ncgrib
|
||||
* 03/2014 1116 T. Lee Added DpD
|
||||
* 01/2015 DR#16959 Chin Chen Added DpT support to fix DR 16959 NSHARP freezes when loading a sounding from
|
||||
* HiRes-ARW/NMM models
|
||||
* 02/03/2015 DR#17084 Chin Chen Model soundings being interpolated below the surface for elevated sites
|
||||
* </pre>
|
||||
*
|
||||
* @author Chin Chen
|
||||
|
@ -51,6 +54,7 @@ import com.raytheon.uf.common.dataplugin.grid.GridRecord;
|
|||
import com.raytheon.uf.common.geospatial.ISpatialObject;
|
||||
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||
import com.raytheon.uf.common.geospatial.PointUtil;
|
||||
import com.raytheon.uf.common.topo.TopoQuery;
|
||||
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||
import com.raytheon.uf.edex.database.dao.CoreDao;
|
||||
import com.raytheon.uf.edex.database.dao.DaoConfig;
|
||||
|
@ -66,12 +70,12 @@ import com.vividsolutions.jts.geom.impl.CoordinateArraySequence;
|
|||
//import org.opengis.geometry.Envelope;
|
||||
|
||||
public class MdlSoundingQuery {
|
||||
private static final String D2DGRIB_TBL_NAME = "grid";
|
||||
private static final String GRID_TBL_NAME = "grid";
|
||||
|
||||
private static String D2D_PARMS = "GH, uW, vW,T, DWPK, SPFH,OMEG, RH, DpD";
|
||||
private static String GRID_PARMS = "GH, uW, vW,T, DWPK, SPFH,OMEG, RH, DpD, DpT";
|
||||
|
||||
private enum D2DParmNames {
|
||||
GH, uW, vW, T, DWPK, SPFH, OMEG, RH, DpD
|
||||
private enum GridParmNames {
|
||||
GH, uW, vW, T, DWPK, SPFH, OMEG, RH, DpD, DpT
|
||||
};
|
||||
|
||||
public static UnitConverter kelvinToCelsius = SI.KELVIN
|
||||
|
@ -415,7 +419,7 @@ public class MdlSoundingQuery {
|
|||
public static NcSoundingModel getMdls(String pluginName) {
|
||||
NcSoundingModel mdls = new NcSoundingModel();
|
||||
Object[] mdlName = null;
|
||||
if (pluginName.equalsIgnoreCase(D2DGRIB_TBL_NAME)) {
|
||||
if (pluginName.equalsIgnoreCase(GRID_TBL_NAME)) {
|
||||
CoreDao dao = new CoreDao(DaoConfig.forClass(GridInfoRecord.class));
|
||||
String queryStr = new String(
|
||||
"Select Distinct modelname FROM grib_models ORDER BY modelname");
|
||||
|
@ -437,7 +441,7 @@ public class MdlSoundingQuery {
|
|||
|
||||
ISpatialObject spatialArea = null;
|
||||
MathTransform crsFromLatLon = null;
|
||||
if (pluginName.equalsIgnoreCase(D2DGRIB_TBL_NAME)) {
|
||||
if (pluginName.equalsIgnoreCase(GRID_TBL_NAME)) {
|
||||
CoreDao dao = new CoreDao(DaoConfig.forClass(GridRecord.class));
|
||||
DatabaseQuery query = new DatabaseQuery(GridRecord.class.getName());
|
||||
|
||||
|
@ -524,7 +528,7 @@ public class MdlSoundingQuery {
|
|||
|
||||
ISpatialObject spatialArea = null;
|
||||
MathTransform crsFromLatLon = null;
|
||||
if (pluginName.equalsIgnoreCase(D2DGRIB_TBL_NAME)) {
|
||||
if (pluginName.equalsIgnoreCase(GRID_TBL_NAME)) {
|
||||
CoreDao dao = new CoreDao(DaoConfig.forClass(GridRecord.class));
|
||||
DatabaseQuery query = new DatabaseQuery(GridRecord.class.getName());
|
||||
|
||||
|
@ -583,7 +587,7 @@ public class MdlSoundingQuery {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the value of surface pressure for a specified location, time, and
|
||||
* Returns the value of surface layer for a specified location, time, and
|
||||
* model for grib or ncgrib data.
|
||||
*
|
||||
* @param pnt
|
||||
|
@ -593,45 +597,145 @@ public class MdlSoundingQuery {
|
|||
* @param modelName
|
||||
* the name of the model
|
||||
* @return surface pressure
|
||||
*
|
||||
* DR17084
|
||||
*/
|
||||
public static Float getModelSfcPressure(Point pnt, String refTime,
|
||||
String validTime, String pluginName, String modelName) {
|
||||
@SuppressWarnings("unchecked")
|
||||
public static NcSoundingLayer getModelSfcLayer(Point pnt, String refTime,
|
||||
String validTime, String pluginName, String modelName, Coordinate coordinate) {
|
||||
|
||||
if (pluginName.equalsIgnoreCase(D2DGRIB_TBL_NAME)) {
|
||||
CoreDao dao = new CoreDao(DaoConfig.forClass(GridRecord.class));
|
||||
DatabaseQuery query = new DatabaseQuery(GridRecord.class.getName());
|
||||
|
||||
query.addQueryParam(GridConstants.LEVEL_ONE, "0.0");
|
||||
query.addQueryParam(GridConstants.LEVEL_TWO, "-999999.0");
|
||||
query.addQueryParam(GridConstants.MASTER_LEVEL_NAME, "MSL");
|
||||
query.addQueryParam(GridConstants.PARAMETER_ABBREVIATION, "PMSL");
|
||||
query.addQueryParam(GridConstants.DATASET_ID, modelName);
|
||||
query.addQueryParam("dataTime.refTime", refTime);
|
||||
query.addQueryParam("dataTime.validPeriod.start", validTime);
|
||||
|
||||
GridRecord rec = null;
|
||||
if (pluginName.equalsIgnoreCase(GRID_TBL_NAME)) {
|
||||
NcSoundingLayer soundingLy = new NcSoundingLayer();
|
||||
TableQuery query;
|
||||
try {
|
||||
List<GridRecord> recList = ((List<GridRecord>) dao
|
||||
.queryByCriteria(query));
|
||||
if (recList.size() == 0) {
|
||||
return null;
|
||||
} else {
|
||||
rec = recList.get(0);
|
||||
PointIn pointIn = new PointIn(pluginName, rec, pnt.x, pnt.y);
|
||||
try {
|
||||
float fdata = pointIn.getPointData();
|
||||
return new Float(fdata);
|
||||
} catch (PluginException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
query = new TableQuery("metadata", GridRecord.class.getName());
|
||||
query.addParameter(GridConstants.LEVEL_ONE, "0.0");
|
||||
query.addParameter(GridConstants.LEVEL_TWO, "-999999.0");
|
||||
query.addParameter(GridConstants.MASTER_LEVEL_NAME, "SFC");
|
||||
query.addList(GridConstants.PARAMETER_ABBREVIATION, "P, GH");
|
||||
query.addParameter(GridConstants.DATASET_ID, modelName);
|
||||
query.addParameter("dataTime.refTime", refTime);
|
||||
query.addParameter("dataTime.validPeriod.start", validTime);
|
||||
List<GridRecord> recList = (List<GridRecord>) query.execute();
|
||||
boolean presureAvailable=false, heightAvailable=false;
|
||||
if (recList!=null && recList.size() > 0) {
|
||||
for(GridRecord rec:recList ){
|
||||
PointIn pointIn = new PointIn(pluginName, rec, pnt.x, pnt.y);
|
||||
try {
|
||||
|
||||
float fdata = pointIn.getPointData();
|
||||
String parm = rec.getParameter().getAbbreviation();
|
||||
if(parm.equals("P")){
|
||||
soundingLy.setPressure(fdata/100);
|
||||
presureAvailable = true;
|
||||
} if(parm.equals("GH")){
|
||||
soundingLy.setGeoHeight(fdata);
|
||||
heightAvailable = true;
|
||||
}
|
||||
//System.out.println("prm="+rec.getParameter().getAbbreviation()+" value="+fdata);
|
||||
|
||||
} catch (PluginException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
recList.clear();
|
||||
}
|
||||
query = new TableQuery("metadata", GridRecord.class.getName());
|
||||
query.addParameter(GridConstants.LEVEL_ONE, "2.0");
|
||||
query.addParameter(GridConstants.LEVEL_TWO, "-999999.0");
|
||||
query.addParameter(GridConstants.MASTER_LEVEL_NAME, "FHAG");
|
||||
query.addList(GridConstants.PARAMETER_ABBREVIATION, "T, RH");
|
||||
query.addParameter(GridConstants.DATASET_ID, modelName);
|
||||
query.addParameter("dataTime.refTime", refTime);
|
||||
query.addParameter("dataTime.validPeriod.start", validTime);
|
||||
recList = (List<GridRecord>) query.execute();
|
||||
if (recList!=null && recList.size() > 0) {
|
||||
for(GridRecord rec:recList ){
|
||||
PointIn pointIn = new PointIn(pluginName, rec, pnt.x, pnt.y);
|
||||
try {
|
||||
|
||||
float fdata = pointIn.getPointData();
|
||||
String parm = rec.getParameter().getAbbreviation();
|
||||
if(parm.equals("T")){
|
||||
soundingLy.setTemperature((float) kelvinToCelsius
|
||||
.convert(fdata));
|
||||
} if(parm.equals("RH")){
|
||||
soundingLy.setRelativeHumidity(fdata);
|
||||
}
|
||||
//System.out.println("prm="+rec.getParameter().getAbbreviation()+" value="+fdata);
|
||||
|
||||
} catch (PluginException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
recList.clear();
|
||||
}
|
||||
|
||||
query = new TableQuery("metadata", GridRecord.class.getName());
|
||||
query.addParameter(GridConstants.LEVEL_ONE, "10.0");
|
||||
query.addParameter(GridConstants.LEVEL_TWO, "-999999.0");
|
||||
query.addParameter(GridConstants.MASTER_LEVEL_NAME, "FHAG");
|
||||
query.addList(GridConstants.PARAMETER_ABBREVIATION, "vW, uW");
|
||||
query.addParameter(GridConstants.DATASET_ID, modelName);
|
||||
query.addParameter("dataTime.refTime", refTime);
|
||||
query.addParameter("dataTime.validPeriod.start", validTime);
|
||||
recList = (List<GridRecord>) query.execute();
|
||||
if (recList!=null && recList.size() > 0) {
|
||||
for(GridRecord rec:recList ){
|
||||
PointIn pointIn = new PointIn(pluginName, rec, pnt.x, pnt.y);
|
||||
try {
|
||||
|
||||
float fdata = pointIn.getPointData();
|
||||
String parm = rec.getParameter().getAbbreviation();
|
||||
if(parm.equals("vW")){
|
||||
soundingLy.setWindV((float) metersPerSecondToKnots
|
||||
.convert(fdata));
|
||||
} if(parm.equals("uW")){
|
||||
soundingLy.setWindU((float) metersPerSecondToKnots
|
||||
.convert(fdata));
|
||||
}
|
||||
//System.out.println("prm="+rec.getParameter().getAbbreviation()+" value="+fdata);
|
||||
|
||||
} catch (PluginException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (presureAvailable==false || heightAvailable==false) {
|
||||
float surfaceElevation = NcSoundingProfile.MISSING;
|
||||
TopoQuery topoQuery = TopoQuery.getInstance();
|
||||
if (topoQuery != null) {
|
||||
//System.out.println("Nsharp coordinate.x="+coordinate.x);
|
||||
surfaceElevation = (float) topoQuery
|
||||
.getHeight(coordinate);
|
||||
if(surfaceElevation >=0)
|
||||
soundingLy.setGeoHeight(surfaceElevation);
|
||||
else {
|
||||
if (presureAvailable==false)
|
||||
//no pressure and no height, no hope to continue.
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (presureAvailable==false)
|
||||
//no pressure and no height, no hope to continue.
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return soundingLy;
|
||||
} catch (DataAccessLayerException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
} catch (Exception e1) {
|
||||
// TODO Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
@ -662,7 +766,7 @@ public class MdlSoundingQuery {
|
|||
List<NcSoundingProfile> soundingProfileList = new ArrayList<NcSoundingProfile>();
|
||||
List<float[]> fdataArrayList = new ArrayList<float[]>();
|
||||
// long t01 = System.currentTimeMillis();
|
||||
if (pluginName.equalsIgnoreCase(D2DGRIB_TBL_NAME)) {
|
||||
if (pluginName.equalsIgnoreCase(GRID_TBL_NAME)) {
|
||||
List<GridRecord> recList = new ArrayList<GridRecord>();
|
||||
;
|
||||
TableQuery query;
|
||||
|
@ -670,7 +774,7 @@ public class MdlSoundingQuery {
|
|||
query = new TableQuery("metadata", GridRecord.class.getName());
|
||||
query.addParameter(GridConstants.MASTER_LEVEL_NAME, "MB");
|
||||
query.addParameter(GridConstants.DATASET_ID, modelName);
|
||||
query.addList(GridConstants.PARAMETER_ABBREVIATION, D2D_PARMS);
|
||||
query.addList(GridConstants.PARAMETER_ABBREVIATION, GRID_PARMS);
|
||||
query.addParameter("dataTime.refTime", refTime);
|
||||
query.addParameter("dataTime.validPeriod.start", validTime);
|
||||
query.setSortBy(GridConstants.LEVEL_ONE, false);
|
||||
|
@ -707,7 +811,8 @@ public class MdlSoundingQuery {
|
|||
float fdata = fdataArray[i];
|
||||
if (rec1.getLevel().getLevelonevalue() == pressure) {
|
||||
String prm = rec1.getParameter().getAbbreviation();
|
||||
switch (D2DParmNames.valueOf(prm)) {
|
||||
//System.out.println("prm="+prm+" value="+fdata);
|
||||
switch (GridParmNames.valueOf(prm)) {
|
||||
case GH:
|
||||
soundingLy.setGeoHeight(fdata);
|
||||
break;
|
||||
|
@ -743,6 +848,15 @@ public class MdlSoundingQuery {
|
|||
case DpD:
|
||||
soundingLy.setDpd(fdata);
|
||||
break;
|
||||
case DpT:
|
||||
soundingLy.setDewpoint((float) kelvinToCelsius
|
||||
.convert(fdata));
|
||||
break;
|
||||
case SPFH:
|
||||
soundingLy.setSpecHumidity(fdata);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -754,23 +868,48 @@ public class MdlSoundingQuery {
|
|||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
// System.out.println(" point coord.y="+coord.y+ " coord.x="+
|
||||
//System.out.println(" point coord.y="+coord.y+ " coord.x="+
|
||||
// coord.x);
|
||||
pf.setStationLatitude(coord.y);
|
||||
pf.setStationLongitude(coord.x);
|
||||
// Float sfcPressure = getModelSfcPressure(pnt, refTime,
|
||||
// validTime,
|
||||
// pluginName, modelName);
|
||||
// System.out.println("getModelSfcPressure took "+
|
||||
// (System.currentTimeMillis()-t013) + " ms");
|
||||
// /if (sfcPressure == null) {
|
||||
pf.setSfcPress(-9999.f);
|
||||
// }
|
||||
// else {
|
||||
// pf.setSfcPress(sfcPressure/100F);
|
||||
// }
|
||||
// System.out.println("surface pressure ="+pf.getSfcPress()+
|
||||
// " lat= "+lat+ " lon="+lon);
|
||||
// DR17084
|
||||
NcSoundingLayer sfcLayer = getModelSfcLayer(pnt, refTime,
|
||||
validTime,pluginName, modelName, coord);
|
||||
if (sfcLayer != null) {
|
||||
if(sfcLayer.getPressure()== NcSoundingLayer.MISSING &&
|
||||
sfcLayer.getGeoHeight()!= NcSoundingLayer.MISSING){
|
||||
//surface layer does not have pressure, but surface height is available
|
||||
//see if we can interpolate surface pressure from upper and lower layer pressure
|
||||
for (int i = 0; i < soundLyList.size(); i++) {
|
||||
if (soundLyList.get(i).getGeoHeight() > sfcLayer.getGeoHeight()) {
|
||||
if (i > 0) {
|
||||
float p1 = soundLyList.get(i - 1).getPressure();
|
||||
float p2 = soundLyList.get(i).getPressure();
|
||||
float h1 = soundLyList.get(i - 1).getGeoHeight();
|
||||
float h2 = soundLyList.get(i).getGeoHeight();
|
||||
float h = sfcLayer.getGeoHeight();
|
||||
float p = p1 + (h - h1) * (p1 - p2) / (h1 - h2);
|
||||
sfcLayer.setPressure(p);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(sfcLayer.getPressure()!= NcSoundingLayer.MISSING){
|
||||
// cut sounding layer under ground, i.e. below surface layer
|
||||
for(int i= soundLyList.size()-1; i>=0 ; i--){
|
||||
NcSoundingLayer ly = soundLyList.get(i);
|
||||
if(ly.getPressure() >= sfcLayer.getPressure()){
|
||||
soundLyList.remove(i);
|
||||
}
|
||||
}
|
||||
soundLyList.add(0, sfcLayer);
|
||||
}
|
||||
pf.setSfcPress(sfcLayer.getPressure());
|
||||
pf.setStationElevation(sfcLayer.getGeoHeight());
|
||||
}
|
||||
//System.out.println("surface pressure ="+pf.getSfcPress());
|
||||
//end DR17084
|
||||
// calculate dew point if necessary
|
||||
MergeSounding ms = new MergeSounding();
|
||||
// ms.spfhToDewpoint(layerList);
|
||||
|
@ -939,7 +1078,7 @@ public class MdlSoundingQuery {
|
|||
String pluginName, String modelName) {
|
||||
|
||||
// List<?>vals = null;
|
||||
if (pluginName.equalsIgnoreCase(D2DGRIB_TBL_NAME)) {
|
||||
if (pluginName.equalsIgnoreCase(GRID_TBL_NAME)) {
|
||||
CoreDao dao = new CoreDao(DaoConfig.forClass(GridRecord.class));
|
||||
DatabaseQuery query = new DatabaseQuery(GridRecord.class.getName());
|
||||
query.addDistinctParameter(GridConstants.LEVEL_ONE);
|
||||
|
@ -990,7 +1129,7 @@ public class MdlSoundingQuery {
|
|||
|
||||
Point pnt = null;
|
||||
|
||||
if (pluginName.equalsIgnoreCase(D2DGRIB_TBL_NAME)) {
|
||||
if (pluginName.equalsIgnoreCase(GRID_TBL_NAME)) {
|
||||
CoreDao dao = new CoreDao(DaoConfig.forClass(GridRecord.class));
|
||||
DatabaseQuery query = new DatabaseQuery(GridRecord.class.getName());
|
||||
|
||||
|
|
Binary file not shown.
|
@ -19,6 +19,9 @@ import java.util.List;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------- ------- -------- -----------
|
||||
* 04/23/2012 229 Chin Chen Initial coding
|
||||
* 01/27/2015 DR#17006,
|
||||
* Task#5929 Chin Chen NSHARP freezes when loading a sounding from MDCRS products
|
||||
* in Volume Browser
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -37,9 +40,10 @@ public class NsharpSoundingElementStateProperty {
|
|||
private int compColorIndex;
|
||||
private List<NcSoundingLayer> sndLyLst;
|
||||
private List<NcSoundingLayer> sndLyLstBk;
|
||||
private boolean goodData = true; //#5929
|
||||
public NsharpSoundingElementStateProperty(String elementDescription,
|
||||
String stnDescription,
|
||||
String timeDescription, NsharpStationInfo stnInfo, List<NcSoundingLayer> sndLyLst) {
|
||||
String timeDescription, NsharpStationInfo stnInfo, List<NcSoundingLayer> sndLyLst, boolean goodData) {
|
||||
super();
|
||||
this.elementDescription = elementDescription;
|
||||
//this.elementState = elementState;
|
||||
|
@ -49,6 +53,7 @@ public class NsharpSoundingElementStateProperty {
|
|||
this.sndType = stnInfo.getSndType();
|
||||
this.compColorIndex = NsharpConstants.LINE_COMP1;;
|
||||
this.sndLyLst = sndLyLst;
|
||||
this.goodData = goodData; //#5929
|
||||
sndLyLstBk= new ArrayList<NcSoundingLayer>(sndLyLst.size());
|
||||
for(NcSoundingLayer ly : sndLyLst){
|
||||
try {
|
||||
|
@ -134,5 +139,13 @@ public class NsharpSoundingElementStateProperty {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isGoodData() {
|
||||
return goodData;
|
||||
}
|
||||
|
||||
public void setGoodData(boolean goodData) {
|
||||
this.goodData = goodData;
|
||||
}
|
||||
|
||||
}
|
|
@ -13,7 +13,10 @@
|
|||
* 05/02/2012 229 Chin Chen Initial coding for multiple display panes implementation
|
||||
* 03/11/2013 972 Greg Hull rm paneNumber
|
||||
* 03/11/2013 2491 bsteffen extend IDescriptor derictly for better serialization detection.
|
||||
|
||||
* 01/13/2015 DR#17008,
|
||||
* task#5930 Chin Chen NSHARP Hodograph Does Not Loop in D2D Lite Configuration
|
||||
* moved "setFrameCoordinator()" from NsharpSkewTPaneDescriptor to here,
|
||||
* so it can be used by other descriptor
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -24,6 +27,7 @@ package gov.noaa.nws.ncep.ui.nsharp.display;
|
|||
|
||||
import gov.noaa.nws.ncep.ui.nsharp.display.rsc.NsharpAbstractPaneResource;
|
||||
import gov.noaa.nws.ncep.ui.nsharp.display.rsc.NsharpResourceHandler;
|
||||
import gov.noaa.nws.ncep.viz.ui.display.NCLoopProperties;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -34,15 +38,14 @@ import org.geotools.referencing.crs.DefaultEngineeringCRS;
|
|||
|
||||
import com.raytheon.uf.viz.core.PixelExtent;
|
||||
import com.raytheon.uf.viz.core.datastructure.LoopProperties;
|
||||
import com.raytheon.uf.viz.core.drawables.FrameCoordinator;
|
||||
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
||||
import com.raytheon.uf.viz.core.drawables.IFrameCoordinator;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.viz.core.graphing.GraphDescriptor;
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public class NsharpAbstractPaneDescriptor extends GraphDescriptor implements
|
||||
IDescriptor {
|
||||
// @XmlElement
|
||||
// protected int paneNumber;
|
||||
|
||||
protected NsharpResourceHandler rscHandler=null;
|
||||
|
||||
|
||||
|
@ -53,14 +56,6 @@ public class NsharpAbstractPaneDescriptor extends GraphDescriptor implements
|
|||
public void setRscHandler(NsharpResourceHandler rscHandler) {
|
||||
this.rscHandler = rscHandler;
|
||||
}
|
||||
|
||||
// public int getPaneNumber() {
|
||||
// return paneNumber;
|
||||
// }
|
||||
//
|
||||
// public void setPaneNumber(int paneNumber) {
|
||||
// this.paneNumber = paneNumber;
|
||||
// }
|
||||
|
||||
public NsharpAbstractPaneDescriptor() {
|
||||
super();
|
||||
|
@ -106,4 +101,64 @@ public class NsharpAbstractPaneDescriptor extends GraphDescriptor implements
|
|||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
//DR17008
|
||||
protected void setFrameCoordinator() {
|
||||
frameCoordinator = new FrameCoordinator(this) {
|
||||
@Override
|
||||
/*
|
||||
* Chin Note: this function handles keyboard up/down/left/right arrow keys for station and time line stepping.
|
||||
*/
|
||||
public void changeFrame(
|
||||
IFrameCoordinator.FrameChangeOperation operation,
|
||||
IFrameCoordinator.FrameChangeMode mode) {
|
||||
if(rscHandler == null)
|
||||
return;
|
||||
//System.out.println("NsharpSkewTPaneDescriptor changeFrame(operation) called op="+operation+" mode"+mode);
|
||||
if(mode == IFrameCoordinator.FrameChangeMode.SPACE_ONLY){
|
||||
//up/down arrow keys for stepping stations
|
||||
//editor.getRscHandler().setSteppingStnIdList(operation);
|
||||
rscHandler.setSteppingStnIdList(operation);
|
||||
} else if(mode == IFrameCoordinator.FrameChangeMode.TIME_ONLY || mode == IFrameCoordinator.FrameChangeMode.TIME_AND_SPACE){
|
||||
//left/right arrow keys for stepping time lines
|
||||
//editor.getRscHandler().setSteppingTimeLine(operation, mode);
|
||||
rscHandler.setSteppingTimeLine(operation, mode);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see com.raytheon.uf.viz.core.drawables.FrameCoordinator#changeFrame(com.raytheon.uf.viz.core.datastructure.LoopProperties)
|
||||
* This function handling nsharp looping.
|
||||
* Chin: 12.8.1: let skewtPaneDescriptor handle looping. All other pane descriptor will do nothing. Otherwise, we will looping X times faster when we
|
||||
* have X number of panes configured and each pane move frame once.
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public void changeFrame(LoopProperties loopProperties) {
|
||||
if(rscHandler == null)
|
||||
return;
|
||||
|
||||
long waitTime = Long.MAX_VALUE;
|
||||
//System.out.println("NsharpSkewTPaneDescriptor changeFrame(loop) called, loopDirection= "+loopDirection + " fwd="+loopProperties.getFwdFrameTime()+
|
||||
// " back="+loopProperties.getRevFrameTime() + " 1st dt="+loopProperties.getFirstFrameDwell()+ " lasDt="+loopProperties.getLastFrameDwell());
|
||||
if(loopProperties.getMode() == LoopProperties.LoopMode.Forward || loopProperties.getMode() == LoopProperties.LoopMode.Cycle)
|
||||
waitTime = loopProperties.getFwdFrameTime();
|
||||
else
|
||||
waitTime = loopProperties.getRevFrameTime();
|
||||
int frameSize= rscHandler.getTimeElementListSize();
|
||||
int curFrameIndex = rscHandler.getCurrentTimeElementListIndex();
|
||||
if(curFrameIndex == 0)
|
||||
waitTime = loopProperties.getFirstFrameDwell();
|
||||
else if(curFrameIndex == frameSize-1)
|
||||
waitTime = loopProperties.getLastFrameDwell();
|
||||
|
||||
loopProperties.drawAfterWait(waitTime);
|
||||
//System.out.println("wait time="+waitTime);
|
||||
if (loopProperties.isShouldDraw()) {
|
||||
rscHandler.setLoopingDataTimeLine(loopProperties);
|
||||
//System.out.println("loopinp step");
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,8 @@ package gov.noaa.nws.ncep.ui.nsharp.display;
|
|||
* 06/14/2011 11-5 Chin Chen migration
|
||||
* 03/11/2013 972 Greg Hull rm paneNum and editorNum; rm AbstractNcEditor
|
||||
* 03/25/2013 972 Greg Hull rm unused Add/RemoveListeners.
|
||||
* 01/13/2015 DR#17008,
|
||||
* task#5930 Chin Chen NSHARP Hodograph Does Not Loop in D2D Lite Configuration
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -178,7 +180,7 @@ public class NsharpEditor extends AbstractEditor implements
|
|||
private int futureHeightHint;
|
||||
|
||||
private int futureWidthHint;
|
||||
|
||||
|
||||
private String paneConfigurationName;
|
||||
|
||||
private IRenderableDisplay[] displayArray;
|
||||
|
@ -1382,13 +1384,17 @@ public class NsharpEditor extends AbstractEditor implements
|
|||
DISPLAY_SPC_GRAPHS = -1;
|
||||
} else if (paneConfigurationName // d2dlite start
|
||||
.equals(NsharpConstants.PANE_LITE_D2D_CFG_STR)) {
|
||||
if (rscHandler != null
|
||||
&& rscHandler.getCurrentGraphMode() == NsharpConstants.GRAPH_HODO) {
|
||||
DISPLAY_HODO = 0;
|
||||
//5930
|
||||
NsharpPaletteWindow win = NsharpPaletteWindow.getInstance();
|
||||
if (win != null &&
|
||||
win.getCurrentGraphMode() == NsharpConstants.GRAPH_HODO) {
|
||||
//#5930if (rscHandler != null
|
||||
// && rscHandler.getCurrentGraphMode() == NsharpConstants.GRAPH_HODO) {
|
||||
DISPLAY_HODO = 0 ;
|
||||
DISPLAY_TIMESTN = DISPLAY_HODO + 1;
|
||||
DISPLAY_SKEWT = -1;
|
||||
} else {
|
||||
DISPLAY_SKEWT = 0;
|
||||
DISPLAY_SKEWT = 0;
|
||||
DISPLAY_TIMESTN = DISPLAY_SKEWT + 1;
|
||||
DISPLAY_HODO = -1;
|
||||
}
|
||||
|
@ -1459,8 +1465,12 @@ public class NsharpEditor extends AbstractEditor implements
|
|||
// d2dlite start
|
||||
} else if (paneConfigurationName
|
||||
.equals(NsharpConstants.PANE_LITE_D2D_CFG_STR)) {
|
||||
if (rscHandler != null
|
||||
&& rscHandler.getCurrentGraphMode() == NsharpConstants.GRAPH_HODO) {
|
||||
//5930
|
||||
NsharpPaletteWindow win = NsharpPaletteWindow.getInstance();
|
||||
if (win != null &&
|
||||
win.getCurrentGraphMode() == NsharpConstants.GRAPH_HODO) {
|
||||
//#5930 if (rscHandler != null
|
||||
//&& rscHandler.getCurrentGraphMode() == NsharpConstants.GRAPH_HODO) {
|
||||
displayArray[DISPLAY_HODO] = new NsharpHodoPaneDisplay(
|
||||
new PixelExtent(NsharpConstants.HODO_DISPLAY_REC),
|
||||
DISPLAY_HODO);
|
||||
|
@ -1610,9 +1620,11 @@ public class NsharpEditor extends AbstractEditor implements
|
|||
nsharpComp = new Composite[DISPLAY_TOTAL];
|
||||
displayPane = new VizDisplayPane[DISPLAY_TOTAL];
|
||||
|
||||
EditorInput edInput = new EditorInput(new NCLoopProperties(),
|
||||
//EditorInput edInput = new EditorInput(new NsharpLoopProperties(),
|
||||
// displayArray);
|
||||
//CHIN task#5930 use same loop properties
|
||||
EditorInput edInput = new EditorInput(this.editorInput.getLoopProperties(),
|
||||
displayArray);
|
||||
|
||||
this.setInput(edInput);
|
||||
this.displaysToLoad = displayArray;
|
||||
for (IRenderableDisplay display : displayArray) {
|
||||
|
@ -2130,4 +2142,10 @@ public class NsharpEditor extends AbstractEditor implements
|
|||
// +
|
||||
// pane.toString()+" newRenderableDisplay="+newRenderableDisplay.toString());
|
||||
}
|
||||
|
||||
public String getPaneConfigurationName() {
|
||||
return paneConfigurationName;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -11,6 +11,8 @@
|
|||
* Date Ticket# Engineer Description
|
||||
* ------- ------- -------- -----------
|
||||
* 05/02/2012 229 Chin Chen Initial coding for multiple display panes implementation
|
||||
* 01/13/2015 DR#17008,
|
||||
* task#5930 Chin Chen NSHARP Hodograph Does Not Loop in D2D Lite Configuration
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -19,7 +21,9 @@
|
|||
*/
|
||||
package gov.noaa.nws.ncep.ui.nsharp.display;
|
||||
|
||||
import gov.noaa.nws.ncep.ui.nsharp.NsharpConstants;
|
||||
import gov.noaa.nws.ncep.ui.nsharp.display.rsc.NsharpHodoPaneResource;
|
||||
import gov.noaa.nws.ncep.viz.common.ui.NmapCommon;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -28,19 +32,36 @@ import javax.xml.bind.annotation.XmlAccessorType;
|
|||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
import com.raytheon.uf.viz.core.PixelExtent;
|
||||
import com.raytheon.uf.viz.core.drawables.IFrameCoordinator;
|
||||
import com.raytheon.uf.viz.d2d.core.time.D2DTimeMatcher;
|
||||
import com.raytheon.viz.ui.perspectives.VizPerspectiveListener;
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@XmlType(name = "nsharpHodoPaneDescriptor")
|
||||
public class NsharpHodoPaneDescriptor extends NsharpAbstractPaneDescriptor {
|
||||
|
||||
public NsharpHodoPaneDescriptor(PixelExtent pe) {
|
||||
super(pe);
|
||||
//System.out.println("NsharpHodoPaneDescriptor created " + this.toString());
|
||||
if((NsharpEditor.getActiveNsharpEditor() != null) && (NsharpEditor.getActiveNsharpEditor().getPaneConfigurationName().equals(NsharpConstants.PANE_LITE_D2D_CFG_STR)))
|
||||
{
|
||||
setTimeMatcher(new D2DTimeMatcher());
|
||||
setFrameCoordinator();
|
||||
}
|
||||
}
|
||||
public NsharpHodoPaneDescriptor(PixelExtent pe, int paneNumber) {
|
||||
super(pe, paneNumber);
|
||||
if((NsharpEditor.getActiveNsharpEditor() != null) && (NsharpEditor.getActiveNsharpEditor().getPaneConfigurationName().equals(NsharpConstants.PANE_LITE_D2D_CFG_STR)))
|
||||
{
|
||||
setTimeMatcher(new D2DTimeMatcher());
|
||||
setFrameCoordinator();
|
||||
}
|
||||
}
|
||||
public NsharpHodoPaneDescriptor() {
|
||||
super();
|
||||
if((NsharpEditor.getActiveNsharpEditor() != null) && (NsharpEditor.getActiveNsharpEditor().getPaneConfigurationName().equals(NsharpConstants.PANE_LITE_D2D_CFG_STR)))
|
||||
{
|
||||
setTimeMatcher(new D2DTimeMatcher());
|
||||
setFrameCoordinator();
|
||||
}
|
||||
}
|
||||
public NsharpHodoPaneResource getHodoResource() {
|
||||
List<NsharpHodoPaneResource> list = resourceList
|
||||
|
@ -50,5 +71,35 @@ public class NsharpHodoPaneDescriptor extends NsharpAbstractPaneDescriptor {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
/*
|
||||
* Chin Note: this function handles time line stepping from NC Perspective tool bar left/right/first/last arrow Buttons.
|
||||
*/
|
||||
public void changeFrame(FrameChangeOperation operation, FrameChangeMode mode) {
|
||||
synchronized (this) {
|
||||
//Chin Note: there are multiple (6) panes.
|
||||
//We only need to step one timeline. Therefore, we handle stepping by skewt pane.
|
||||
//However, for D2D LITE display configuration, when switched to HODO pane, skewT pane is no longer
|
||||
//in charge. therefore, we have to handle this special case here by HODO pane.
|
||||
|
||||
if((rscHandler == null) ||(!rscHandler.getPaneConfigurationName().equals(NsharpConstants.PANE_LITE_D2D_CFG_STR)))
|
||||
return;
|
||||
|
||||
if( VizPerspectiveListener.getCurrentPerspectiveManager()!= null){
|
||||
//System.out.println("changeFrame: current perspective ="+VizPerspectiveListener.getCurrentPerspectiveManager().getPerspectiveId());
|
||||
if(!VizPerspectiveListener.getCurrentPerspectiveManager().getPerspectiveId().equals(NmapCommon.NatlCntrsPerspectiveID)){
|
||||
if(mode != FrameChangeMode.TIME_ONLY)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// we will have to do conversion here
|
||||
IFrameCoordinator.FrameChangeOperation dop = IFrameCoordinator.FrameChangeOperation.valueOf(operation.name());
|
||||
IFrameCoordinator.FrameChangeMode dmode = IFrameCoordinator.FrameChangeMode.valueOf(mode.name());
|
||||
rscHandler.setSteppingTimeLine(dop, dmode);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,6 +11,10 @@
|
|||
* Date Ticket# Engineer Description
|
||||
* ------- ------- -------- -----------
|
||||
* 05/02/2012 229 Chin Chen Initial coding for multiple display panes implementation
|
||||
* 01/13/2015 DR#17008,
|
||||
* task#5930 Chin Chen NSHARP Hodograph Does Not Loop in D2D Lite Configuration
|
||||
* moved "setFrameCoordinator()" to NsharpAbstractPaneDescriptor,
|
||||
* so it can be used by other descriptor
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -29,8 +33,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
|
|||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
import com.raytheon.uf.viz.core.PixelExtent;
|
||||
import com.raytheon.uf.viz.core.datastructure.LoopProperties;
|
||||
import com.raytheon.uf.viz.core.drawables.FrameCoordinator;
|
||||
import com.raytheon.uf.viz.core.drawables.IFrameCoordinator;
|
||||
import com.raytheon.uf.viz.d2d.core.time.D2DTimeMatcher;
|
||||
import com.raytheon.viz.ui.perspectives.VizPerspectiveListener;
|
||||
|
@ -54,69 +56,7 @@ public class NsharpSkewTPaneDescriptor extends NsharpAbstractPaneDescriptor {
|
|||
setTimeMatcher(new D2DTimeMatcher());
|
||||
setFrameCoordinator();
|
||||
}
|
||||
|
||||
private void setFrameCoordinator() {
|
||||
frameCoordinator = new FrameCoordinator(this) {
|
||||
@Override
|
||||
/*
|
||||
* Chin Note: this function handles keyboard up/down/left/right arrow keys for station and time line stepping.
|
||||
*/
|
||||
public void changeFrame(
|
||||
IFrameCoordinator.FrameChangeOperation operation,
|
||||
IFrameCoordinator.FrameChangeMode mode) {
|
||||
//NsharpEditor editor = NsharpEditor.getActiveNsharpEditor() ;
|
||||
//if(editor== null || editor.getRscHandler()==null)
|
||||
// return;
|
||||
if(rscHandler == null)
|
||||
return;
|
||||
//System.out.println("NsharpSkewTPaneDescriptor changeFrame(operation) called op="+operation+" mode"+mode);
|
||||
if(mode == IFrameCoordinator.FrameChangeMode.SPACE_ONLY){
|
||||
//up/down arrow keys for stepping stations
|
||||
//editor.getRscHandler().setSteppingStnIdList(operation);
|
||||
rscHandler.setSteppingStnIdList(operation);
|
||||
} else if(mode == IFrameCoordinator.FrameChangeMode.TIME_ONLY || mode == IFrameCoordinator.FrameChangeMode.TIME_AND_SPACE){
|
||||
//left/right arrow keys for stepping time lines
|
||||
//editor.getRscHandler().setSteppingTimeLine(operation, mode);
|
||||
rscHandler.setSteppingTimeLine(operation, mode);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see com.raytheon.uf.viz.core.drawables.FrameCoordinator#changeFrame(com.raytheon.uf.viz.core.datastructure.LoopProperties)
|
||||
* This function handling nsharp looping.
|
||||
* Chin: 12.8.1: let skewtPaneDescriptor handle looping. All other pane descriptor will do nothing. Otherwise, we will looping X times faster when we
|
||||
* have X number of panes configured and each pane move frame once.
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public void changeFrame(LoopProperties loopProperties) {
|
||||
if(rscHandler == null)
|
||||
return;
|
||||
long waitTime = Long.MAX_VALUE;
|
||||
//System.out.println("NsharpSkewTPaneDescriptor changeFrame(loop) called, loopDirection= "+loopDirection + " fwd="+loopProperties.getFwdFrameTime()+
|
||||
// " back="+loopProperties.getRevFrameTime() + " 1st dt="+loopProperties.getFirstFrameDwell()+ " lasDt="+loopProperties.getLastFrameDwell());
|
||||
if(loopProperties.getMode() == LoopProperties.LoopMode.Forward || loopProperties.getMode() == LoopProperties.LoopMode.Cycle)
|
||||
waitTime = loopProperties.getFwdFrameTime();
|
||||
else
|
||||
waitTime = loopProperties.getRevFrameTime();
|
||||
int frameSize= rscHandler.getTimeElementListSize();
|
||||
int curFrameIndex = rscHandler.getCurrentTimeElementListIndex();
|
||||
if(curFrameIndex == 0)
|
||||
waitTime = loopProperties.getFirstFrameDwell();
|
||||
else if(curFrameIndex == frameSize-1)
|
||||
waitTime = loopProperties.getLastFrameDwell();
|
||||
|
||||
loopProperties.drawAfterWait(waitTime);
|
||||
|
||||
if (loopProperties.isShouldDraw()) {
|
||||
rscHandler.setLoopingDataTimeLine(loopProperties);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
public NsharpSkewTPaneResource getSkewtResource() {
|
||||
public NsharpSkewTPaneResource getSkewtResource() {
|
||||
List<NsharpSkewTPaneResource> list = resourceList
|
||||
.getResourcesByTypeAsType(NsharpSkewTPaneResource.class);
|
||||
if (list != null && !list.isEmpty()) {
|
||||
|
|
|
@ -13,6 +13,9 @@ package gov.noaa.nws.ncep.ui.nsharp.display.rsc;
|
|||
* 04/23/2012 229 Chin Chen Initial coding
|
||||
* 04/23/2014 Chin Chen Add d2d lite page
|
||||
* 08/11/2014 Chin Chen fix typo
|
||||
* 01/27/2015 DR#17006,
|
||||
* Task#5929 Chin Chen NSHARP freezes when loading a sounding from MDCRS products
|
||||
* in Volume Browser
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -60,7 +63,8 @@ public class NsharpDataPaneResource extends NsharpAbstractPaneResource {
|
|||
// number of this page. index 0
|
||||
// point to a dummy.
|
||||
|
||||
private static final String NO_DATA = "NO VALID DATA AVAILABLE";
|
||||
private static final String NO_DATA = "NO VALID DATA AVAILABLE FOR THIS PAGE";
|
||||
private static final String INSUFFICIENT_DATA = "INSUFFICIENT DATA FOR PARAMETERS COMPUTATION";
|
||||
|
||||
// private double charHeight = NsharpConstants.CHAR_HEIGHT_;
|
||||
private double curY;
|
||||
|
@ -160,7 +164,7 @@ public class NsharpDataPaneResource extends NsharpAbstractPaneResource {
|
|||
handleResize();
|
||||
}
|
||||
|
||||
if ((soundingLys != null) && (soundingLys.size() >= 4)) {
|
||||
if ((soundingLys != null) && (rscHandler.isGoodData())) {//#5929
|
||||
this.defaultFont.setSmoothing(false);
|
||||
this.defaultFont.setScaleFont(false);
|
||||
// write to panels
|
||||
|
@ -187,6 +191,9 @@ public class NsharpDataPaneResource extends NsharpAbstractPaneResource {
|
|||
}
|
||||
}
|
||||
}
|
||||
else { //#5929
|
||||
drawInsuffDataMessage(target, panelRectArray[0]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -239,6 +246,28 @@ public class NsharpDataPaneResource extends NsharpAbstractPaneResource {
|
|||
super.resetData(soundingLys, prevsoundingLys);
|
||||
currentParcel = NsharpNativeConstants.PARCELTYPE_MOST_UNSTABLE;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") //#5929
|
||||
private void drawInsuffDataMessage(IGraphicsTarget target, Rectangle rect)
|
||||
throws VizException {
|
||||
IFont myfont;
|
||||
if (paneConfigurationName.equals(NsharpConstants.PANE_LITE_D2D_CFG_STR))
|
||||
myfont = font9;
|
||||
else
|
||||
myfont = font20;
|
||||
|
||||
defineCharHeight(myfont);
|
||||
myfont.setSmoothing(false);
|
||||
myfont.setScaleFont(false);
|
||||
sumP1Visible = true;
|
||||
extent = new PixelExtent(rect);
|
||||
target.setupClippingPlane(extent);
|
||||
target.drawString(myfont, INSUFFICIENT_DATA, rect.x,
|
||||
rect.y, 0.0, TextStyle.NORMAL, NsharpConstants.color_cyan,
|
||||
HorizontalAlignment.LEFT, VerticalAlignment.TOP, null);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
private void drawPanel(IGraphicsTarget target, int pageOrderNumber,
|
||||
int dsiplayPanelNumber) throws VizException {
|
||||
|
@ -344,7 +373,7 @@ public class NsharpDataPaneResource extends NsharpAbstractPaneResource {
|
|||
// if we can not Interpolates a temp with 700 mb pressure, then we dont
|
||||
// have enough raw data
|
||||
if ((nsharpNative.nsharpLib.qc(nsharpNative.nsharpLib.itemp(700.0F)) == 0)) {
|
||||
target.drawString(myfont, " " + NO_DATA, rect.x,
|
||||
target.drawString(myfont, NO_DATA, rect.x,
|
||||
rect.y, 0.0, TextStyle.NORMAL, NsharpConstants.color_cyan,
|
||||
HorizontalAlignment.LEFT, VerticalAlignment.TOP, null);
|
||||
return;
|
||||
|
@ -1053,7 +1082,7 @@ public class NsharpDataPaneResource extends NsharpAbstractPaneResource {
|
|||
// if we can not Interpolates a temp with 700 mb pressure, then we dont
|
||||
// have enough raw data
|
||||
if (nsharpNative.nsharpLib.qc(nsharpNative.nsharpLib.itemp(700.0F)) == 0) {
|
||||
target.drawString(myfont, " " + NO_DATA, rect.x,
|
||||
target.drawString(myfont,NO_DATA, rect.x,
|
||||
rect.y, 0.0, TextStyle.NORMAL, NsharpConstants.color_cyan,
|
||||
HorizontalAlignment.LEFT, VerticalAlignment.TOP, null);
|
||||
return;
|
||||
|
@ -3749,7 +3778,7 @@ public class NsharpDataPaneResource extends NsharpAbstractPaneResource {
|
|||
// if we can not Interpolates a temp with 700 mb pressure, then we dont
|
||||
// have enough raw data
|
||||
if ((nsharpNative.nsharpLib.qc(nsharpNative.nsharpLib.itemp(700.0F)) == 0)) {
|
||||
target.drawString(myfont, " " + NO_DATA, rect.x,
|
||||
target.drawString(myfont, NO_DATA, rect.x,
|
||||
rect.y, 0.0, TextStyle.NORMAL, NsharpConstants.color_cyan,
|
||||
HorizontalAlignment.LEFT, VerticalAlignment.TOP, null);
|
||||
return;
|
||||
|
|
|
@ -10,6 +10,9 @@ package gov.noaa.nws.ncep.ui.nsharp.display.rsc;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------- ------- -------- -----------
|
||||
* 04/23/2012 229 Chin Chen Initial coding
|
||||
* 01/27/2015 DR#17006,
|
||||
* Task#5929 Chin Chen NSHARP freezes when loading a sounding from MDCRS products
|
||||
* in Volume Browser
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -127,7 +130,7 @@ public class NsharpHodoPaneResource extends NsharpAbstractPaneResource{
|
|||
hodoWindRscShapeList.add(shNcolor);
|
||||
}
|
||||
|
||||
|
||||
float surfaceLevel = soundingLays.get(0).getGeoHeight(); //#5929
|
||||
for (NcSoundingLayer layer : soundingLays){
|
||||
if(layer.getPressure() < 100 || layer.getWindSpeed() <0)
|
||||
continue;
|
||||
|
@ -138,15 +141,15 @@ public class NsharpHodoPaneResource extends NsharpAbstractPaneResource{
|
|||
double [][] lines = {{world.mapX(c0.x), world.mapY(c0.y)},{world
|
||||
.mapX(c1.x), world.mapY(c1.y)}};
|
||||
if(incolor == null){
|
||||
if(layer.getGeoHeight() <nsharpNative.nsharpLib.msl(3000)){
|
||||
//red
|
||||
//use MSL here, so Converts height from (meters) AGL to MSL. #5929
|
||||
if(layer.getGeoHeight() < (3000+surfaceLevel)){
|
||||
shapeR.addLineSegment(lines);
|
||||
}
|
||||
else if(layer.getGeoHeight() < nsharpNative.nsharpLib.msl(6000))
|
||||
else if(layer.getGeoHeight() < (6000+surfaceLevel))
|
||||
shapeG.addLineSegment(lines);
|
||||
else if(layer.getGeoHeight() < nsharpNative.nsharpLib.msl(9000))
|
||||
else if(layer.getGeoHeight() < (9000+surfaceLevel))
|
||||
shapeY.addLineSegment(lines);
|
||||
else if(layer.getGeoHeight() < nsharpNative.nsharpLib.msl(12000))
|
||||
else if(layer.getGeoHeight() < (12000+surfaceLevel))
|
||||
shapeC.addLineSegment(lines);
|
||||
else
|
||||
shapeV.addLineSegment(lines);
|
||||
|
@ -177,6 +180,7 @@ public class NsharpHodoPaneResource extends NsharpAbstractPaneResource{
|
|||
}
|
||||
hodoWindRscShapeList.clear();
|
||||
}
|
||||
|
||||
world = hodoBackground.computeWorld();
|
||||
boolean compareStnIsOn = rscHandler.isCompareStnIsOn();
|
||||
int currentTimeListIndex = rscHandler.getCurrentTimeElementListIndex();
|
||||
|
@ -575,7 +579,7 @@ public class NsharpHodoPaneResource extends NsharpAbstractPaneResource{
|
|||
return;
|
||||
|
||||
hodoBackground.paintInternal(target, paintProps);
|
||||
if((soundingLys != null) && (soundingLys.size()>= 4))
|
||||
if((soundingLys != null) && (soundingLys.size()> 2) )
|
||||
{
|
||||
this.font10.setSmoothing(false);
|
||||
this.font10.setScaleFont(false);
|
||||
|
@ -602,13 +606,11 @@ public class NsharpHodoPaneResource extends NsharpAbstractPaneResource{
|
|||
}
|
||||
target.clearClippingPlane();
|
||||
if(cursorInHodo){
|
||||
|
||||
|
||||
drawHodoDynamicData(target, currentZoomLevel);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -10,6 +10,9 @@ package gov.noaa.nws.ncep.ui.nsharp.display.rsc;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------- ------- -------- -----------
|
||||
* 04/23/2012 229 Chin Chen Initial coding
|
||||
* 01/27/2015 DR#17006,
|
||||
* Task#5929 Chin Chen NSHARP freezes when loading a sounding from MDCRS products
|
||||
* in Volume Browser
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -181,7 +184,7 @@ public class NsharpInsetPaneResource extends NsharpAbstractPaneResource{
|
|||
//Chin, since we only display 4 insets and their backgrounds have same size, only draws 4 backgrounds.
|
||||
//psblWatchTypeBackground.paint(target, paintProps);
|
||||
//thetaEPresureBackground.paint(target, paintProps);
|
||||
if((soundingLys != null) && (soundingLys.size()>= 4))
|
||||
if((soundingLys != null) && rscHandler.isGoodData()) //#5929)
|
||||
{
|
||||
this.font10.setSmoothing(false);
|
||||
this.font10.setScaleFont(false);
|
||||
|
@ -294,7 +297,7 @@ public class NsharpInsetPaneResource extends NsharpAbstractPaneResource{
|
|||
return;
|
||||
//System.out.println("createRscWireFrameShapes called");
|
||||
disposeInsetWireFrameShapes();
|
||||
if(soundingLys != null){
|
||||
if(soundingLys != null && rscHandler.isGoodData()){ //#5929
|
||||
|
||||
WGraphics WGc= thetaEPresureBackground.getWorld();
|
||||
createRscThetaEPressureShape(WGc);
|
||||
|
|
|
@ -14,6 +14,12 @@
|
|||
* 01/13/2014 Chin Chen TTR829- when interpolation, edit graph is allowed
|
||||
* 02/03/2014 1106 Chin Chen Need to be able to use clicking on the Src,Time, or StnId to select display
|
||||
* 08/12/2014 Chin Chen fixed issue that "load archive file with wrong time line displayed"
|
||||
* 12/04/2014 DR16888 Chin Chen fixed issue that "Comp(Src) button not functioning properly in NSHARP display"
|
||||
* 01/27/2015 DR#17006,
|
||||
* Task#5929 Chin Chen NSHARP freezes when loading a sounding from MDCRS products
|
||||
* in Volume Browser
|
||||
* 02/03/2015 DR#17079 Chin Chen Soundings listed out of order if frames go into new month
|
||||
* 02/05/2015 DR16888 CHin Chen merge 12/11/2014 fixes at version 14.2.2 and check in again to 14.3.1
|
||||
* </pre>
|
||||
*
|
||||
* @author Chin Chen
|
||||
|
@ -160,6 +166,8 @@ public class NsharpResourceHandler {
|
|||
|
||||
private int[] pageDisplayOrderNumberArray = new int[NsharpConstants.PAGE_MAX_NUMBER + 1];
|
||||
|
||||
//#5929
|
||||
private boolean goodData=false;
|
||||
// index is the real page defined in NsharpConstants to be shown, value is
|
||||
// the order number of this page.
|
||||
// index 0 point to a dummy.
|
||||
|
@ -187,7 +195,7 @@ public class NsharpResourceHandler {
|
|||
private int currentSoundingLayerIndex = 0;
|
||||
|
||||
private int hodoEditingSoundingLayerIndex = 0;
|
||||
|
||||
|
||||
private boolean plotInteractiveTemp = false;
|
||||
|
||||
private Coordinate interactiveTempPointCoordinate;
|
||||
|
@ -575,11 +583,14 @@ public class NsharpResourceHandler {
|
|||
* The following code is to create a list of stns within the range
|
||||
* of user defined radius (minimum distance) to "current" station
|
||||
* and also has data loaded with same time line as "current" time
|
||||
* line. Note that we have two time line formats, yymmdd/hh(day)Vxxx
|
||||
* and yymmdd/hh(day). A same time line is compared by yymmdd/hh
|
||||
* only. All qualified stations, including current station, found
|
||||
* will be listed and used for SND comparison.
|
||||
* line. Note that we have two time line formats, YYMMDD/HHVxxx(day)
|
||||
* and YYMMDD/HH(day) saved in NsharpSoundingElementStateProperty.
|
||||
* A same time line is compared by "YYMMDD/HH" only. All qualified
|
||||
* stations, including current station, found will be listed and used
|
||||
* for SND comparison.
|
||||
*/
|
||||
//DR#17079
|
||||
String TIME_COMPARE_STRING = "YYMMDD/HH";
|
||||
compSndSelectedElemList.clear();
|
||||
// CompSndSelectedElem curStnTimeIndexCouple = new
|
||||
// CompSndSelectedElem(currentStnElementListIndex,currentTimeElementListIndex,currentSndElementListIndex);
|
||||
|
@ -593,7 +604,12 @@ public class NsharpResourceHandler {
|
|||
.get(currentSndElementListIndex).getStnInfo();
|
||||
gc.setStartingGeographicPoint(currentStnInfo.getLongitude(),
|
||||
currentStnInfo.getLatitude());
|
||||
int timeLineLengthToComp = "yymmdd/hh".length();
|
||||
|
||||
// String curTimeString = timeElementList.get(currentTimeElementListIndex).getElementDescription();
|
||||
|
||||
int timeLineLengthToComp = TIME_COMPARE_STRING.length();
|
||||
|
||||
|
||||
String currentTimeLineToComp = timeElementList
|
||||
.get(currentTimeElementListIndex).getElementDescription()
|
||||
.substring(0, timeLineLengthToComp);
|
||||
|
@ -974,6 +990,7 @@ public class NsharpResourceHandler {
|
|||
if (skewtPaneRsc != null)
|
||||
skewtPaneRsc
|
||||
.setCurrentSkewTEditMode(NsharpConstants.SKEWT_EDIT_MODE_EDITPOINT);
|
||||
elem.setGoodData(checkDataIntegrity(soundingLys));//#5929
|
||||
resetData();
|
||||
}
|
||||
|
||||
|
@ -986,7 +1003,12 @@ public class NsharpResourceHandler {
|
|||
|
||||
// update active sounding layer and picked stn info
|
||||
// re-populate snd data to nsharp native code lib for later calculating
|
||||
nsharpNative.populateSndgData(soundingLys);
|
||||
//#5929 dont populate sounding data if data is bad
|
||||
|
||||
if(getCurSoundingElementStateProperty()!=null)
|
||||
goodData= getCurSoundingElementStateProperty().isGoodData();
|
||||
if(goodData)
|
||||
nsharpNative.populateSndgData(soundingLys);
|
||||
|
||||
if (skewtPaneRsc != null)
|
||||
skewtPaneRsc.resetData(soundingLys, previousSoundingLys);
|
||||
|
@ -1006,7 +1028,7 @@ public class NsharpResourceHandler {
|
|||
// if soundingLys is null, then we stop here, after reset data.
|
||||
if (soundingLys == null)
|
||||
return;
|
||||
if (soundingLys.size() > 0) {
|
||||
if (soundingLys.size() > 0 && (goodData)) {
|
||||
// set initial hodohouseC
|
||||
|
||||
// ----- set hodo circle at Bunkers Right, Chin according to TTR6065
|
||||
|
@ -1037,11 +1059,7 @@ public class NsharpResourceHandler {
|
|||
* that really meant to reset parcel type.
|
||||
*/
|
||||
}
|
||||
// Chin: TBD remove handle resize here to fix sizing issue when swapped
|
||||
// nsharp from side pane back to main pane
|
||||
// but, may cause other problem?
|
||||
// if(skewtPaneRsc!=null)
|
||||
// skewtPaneRsc.handleResize();
|
||||
|
||||
if (skewtPaneRsc != null)
|
||||
skewtPaneRsc.createRscWireFrameShapes();
|
||||
if (hodoPaneRsc != null)
|
||||
|
@ -1050,7 +1068,7 @@ public class NsharpResourceHandler {
|
|||
insetPaneRsc.createInsetWireFrameShapes();
|
||||
if (witoPaneRsc != null)
|
||||
witoPaneRsc.createAllWireFrameShapes();
|
||||
if (spcGraphsPaneRsc != null) {
|
||||
if (spcGraphsPaneRsc != null && (goodData) ){//#5929
|
||||
// Chin: SPC graphs performance concern, as it need to call get
|
||||
// info functions from bigSharo.so and cause long delay.
|
||||
// Therefore, do it once only when reset data.
|
||||
|
@ -1060,13 +1078,14 @@ public class NsharpResourceHandler {
|
|||
|
||||
private class NsharpOperationElementComparator implements
|
||||
Comparator<NsharpOperationElement> {
|
||||
@Override
|
||||
|
||||
@Override
|
||||
public int compare(NsharpOperationElement o1, NsharpOperationElement o2) {
|
||||
|
||||
String s1tok1 = "";// , s1tok2="";
|
||||
String s2tok1 = "";// , s2tok2="";
|
||||
StringTokenizer st1 = new StringTokenizer(
|
||||
o1.getElementDescription());
|
||||
String o1Desc = o1.getElementDescription();
|
||||
StringTokenizer st1 = new StringTokenizer(o1Desc);
|
||||
int tkCount1 = st1.countTokens();
|
||||
// System.out.println("ElementComparatorTimeLine o1="+o1.elementDescription+"c1 = "+tkCount1);
|
||||
if (tkCount1 >= 1) {
|
||||
|
@ -1076,8 +1095,8 @@ public class NsharpResourceHandler {
|
|||
|
||||
}
|
||||
// System.out.println("t1="+s1tok1+" t2="+s2tok1);
|
||||
StringTokenizer st2 = new StringTokenizer(
|
||||
o2.getElementDescription());
|
||||
String o2Desc = o2.getElementDescription();
|
||||
StringTokenizer st2 = new StringTokenizer(o2Desc);
|
||||
int tkCount2 = st2.countTokens();
|
||||
// System.out.println("ElementComparatorTimeLine o2="+o2.elementDescription+"c2 = "+tkCount2);
|
||||
if (tkCount2 >= 1) {
|
||||
|
@ -1170,7 +1189,7 @@ public class NsharpResourceHandler {
|
|||
|
||||
private void addElementToTableAndLists(String stnId_timeLine_sndType,
|
||||
String stnId, String tmLine, String sndType,
|
||||
NsharpStationInfo stnInfo, List<NcSoundingLayer> sndLyLst) {
|
||||
NsharpStationInfo stnInfo, List<NcSoundingLayer> sndLyLst, boolean goodData) {
|
||||
// System.out.println("stn to be added "+ stnId + " timeline "+tmLine);
|
||||
NsharpSoundingElementStateProperty newSndPropElem = null;
|
||||
int tmIndex = getIndexFromElementList(tmLine, timeElementList);
|
||||
|
@ -1190,7 +1209,7 @@ public class NsharpResourceHandler {
|
|||
// NsharpSoundingElementStateProperty object
|
||||
newSndPropElem = new NsharpSoundingElementStateProperty(
|
||||
stnId_timeLine_sndType, stnId, tmLine, stnInfo,
|
||||
sndLyLst);
|
||||
sndLyLst,goodData); //#5929
|
||||
stnTimeSndTable.get(stnIndex).get(tmIndex)
|
||||
.set(sndTpyeIndex, newSndPropElem);
|
||||
}
|
||||
|
@ -1207,7 +1226,7 @@ public class NsharpResourceHandler {
|
|||
// NsharpSoundingElementStateProperty object
|
||||
newSndPropElem = new NsharpSoundingElementStateProperty(
|
||||
stnId_timeLine_sndType, stnId, tmLine, stnInfo,
|
||||
sndLyLst);
|
||||
sndLyLst,goodData);
|
||||
stnTimeSndTable.get(currentStnElementListIndex)
|
||||
.get(currentTimeElementListIndex)
|
||||
.set(currentSndElementListIndex, newSndPropElem);
|
||||
|
@ -1224,7 +1243,7 @@ public class NsharpResourceHandler {
|
|||
// NsharpSoundingElementStateProperty object
|
||||
newSndPropElem = new NsharpSoundingElementStateProperty(
|
||||
stnId_timeLine_sndType, stnId, tmLine, stnInfo,
|
||||
sndLyLst);
|
||||
sndLyLst,goodData);
|
||||
stnTimeSndTable.get(currentStnElementListIndex)
|
||||
.get(currentTimeElementListIndex)
|
||||
.set(currentSndElementListIndex, newSndPropElem);
|
||||
|
@ -1246,7 +1265,7 @@ public class NsharpResourceHandler {
|
|||
// NsharpSoundingElementStateProperty object
|
||||
newSndPropElem = new NsharpSoundingElementStateProperty(
|
||||
stnId_timeLine_sndType, stnId, tmLine, stnInfo,
|
||||
sndLyLst);
|
||||
sndLyLst,goodData);
|
||||
stnTimeSndTable.get(currentStnElementListIndex)
|
||||
.get(currentTimeElementListIndex)
|
||||
.set(currentSndElementListIndex, newSndPropElem);
|
||||
|
@ -1267,7 +1286,7 @@ public class NsharpResourceHandler {
|
|||
// NsharpSoundingElementStateProperty object
|
||||
newSndPropElem = new NsharpSoundingElementStateProperty(
|
||||
stnId_timeLine_sndType, stnId, tmLine, stnInfo,
|
||||
sndLyLst);
|
||||
sndLyLst,goodData);
|
||||
stnTimeSndTable.get(currentStnElementListIndex)
|
||||
.get(currentTimeElementListIndex)
|
||||
.set(currentSndElementListIndex, newSndPropElem);
|
||||
|
@ -1289,7 +1308,7 @@ public class NsharpResourceHandler {
|
|||
// NsharpSoundingElementStateProperty object
|
||||
newSndPropElem = new NsharpSoundingElementStateProperty(
|
||||
stnId_timeLine_sndType, stnId, tmLine, stnInfo,
|
||||
sndLyLst);
|
||||
sndLyLst,goodData);
|
||||
stnTimeSndTable.get(currentStnElementListIndex)
|
||||
.get(currentTimeElementListIndex)
|
||||
.set(currentSndElementListIndex, newSndPropElem);
|
||||
|
@ -1314,7 +1333,7 @@ public class NsharpResourceHandler {
|
|||
// NsharpSoundingElementStateProperty object
|
||||
newSndPropElem = new NsharpSoundingElementStateProperty(
|
||||
stnId_timeLine_sndType, stnId, tmLine, stnInfo,
|
||||
sndLyLst);
|
||||
sndLyLst,goodData);
|
||||
stnTimeSndTable.get(currentStnElementListIndex)
|
||||
.get(currentTimeElementListIndex)
|
||||
.set(currentSndElementListIndex, newSndPropElem);
|
||||
|
@ -1350,7 +1369,7 @@ public class NsharpResourceHandler {
|
|||
// one new loaded sounding data
|
||||
newSndPropElem = new NsharpSoundingElementStateProperty(
|
||||
stnId_timeLine_sndType, stnId,
|
||||
tmLine, stnInfo, sndLyLst);
|
||||
tmLine, stnInfo, sndLyLst,goodData);
|
||||
|
||||
sndlistForTm.add(newSndPropElem);
|
||||
} else {
|
||||
|
@ -1398,7 +1417,7 @@ public class NsharpResourceHandler {
|
|||
|
||||
newSndPropElem = new NsharpSoundingElementStateProperty(
|
||||
stnId_timeLine_sndType, stnId, tmLine, stnInfo,
|
||||
sndLyLst);
|
||||
sndLyLst,goodData);
|
||||
newList.add(newSndPropElem);
|
||||
newListList.add(newList);
|
||||
stnTimeSndTable.add(newListList);
|
||||
|
@ -1855,27 +1874,43 @@ public class NsharpResourceHandler {
|
|||
*
|
||||
* }
|
||||
*/
|
||||
//task#5929
|
||||
private boolean checkDataIntegrity(List<NcSoundingLayer> sndLayers){
|
||||
boolean gooddata = false;
|
||||
int numberOfTemp=0;
|
||||
int numberOfGoodDewPt=0;
|
||||
for(NcSoundingLayer layer: sndLayers){
|
||||
if(layer.getTemperature() > -999)
|
||||
numberOfTemp++;
|
||||
if(layer.getDewpoint() > -999)
|
||||
numberOfGoodDewPt++;
|
||||
}
|
||||
if(numberOfGoodDewPt >= 2 && numberOfTemp>=2)
|
||||
gooddata=true;
|
||||
return gooddata;
|
||||
}
|
||||
|
||||
// This api peforms real load data function
|
||||
private void addRsc(boolean displayNewData,
|
||||
Map<String, List<NcSoundingLayer>> soundMap,
|
||||
NsharpStationInfo stnInfo, boolean fromArchive) {
|
||||
|
||||
// // testing code // stnInfo.setStnId("KUKI");
|
||||
// Set<String> keysettest = new HashSet<String>(soundMap.keySet());
|
||||
// for (String key : keysettest) {
|
||||
// List<NcSoundingLayer> sndLy = soundMap.remove(key); // String
|
||||
// // newkey=
|
||||
// // key.replace("NCUAIR", "gpduair"); // String newkey =
|
||||
// // key.replace("NAMS", "SSS");
|
||||
// String newkey = key.replace("140303/12", "120109/12");
|
||||
// soundMap.put(newkey, sndLy);
|
||||
// } //
|
||||
/*
|
||||
* testing code : this is helpful code. do not remove.
|
||||
*
|
||||
Set<String> keysettest = new HashSet<String>(soundMap.keySet());
|
||||
for (String key : keysettest) {
|
||||
List<NcSoundingLayer> sndLy = soundMap.remove(key);
|
||||
String newkey= key.replace("NAMS", "SSS");
|
||||
//String newkey = key.replace("130925", "150102");
|
||||
soundMap.put(newkey, sndLy);
|
||||
}
|
||||
// // stnInfo.setSndType(stnInfo.getSndType().replace("NCUAIR", //
|
||||
// // "gpduair")); // stnInfo.setSndType(stnInfo.getSndType().replace(
|
||||
// // "NAMS","SSS"));
|
||||
// //
|
||||
|
||||
*
|
||||
* END testing code
|
||||
*/
|
||||
if (stnInfo.getStnId() != null && stnInfo.getStnId().indexOf(" ") >= 0) {
|
||||
// take care stnId with SPACE case.
|
||||
String stnId = stnInfo.getStnId();
|
||||
|
@ -1924,9 +1959,15 @@ public class NsharpResourceHandler {
|
|||
// based on this KEY string format "KGRI 100616/03(Wed)Vxxx GFSSND"
|
||||
String stnId, sndType, timeLine, timeLine_sndType, stnId_timeLine_sndType;
|
||||
List<NcSoundingLayer> sndLyLst;
|
||||
|
||||
try {
|
||||
stnId_timeLine_sndType = tempTimeLineArr[i].toString();
|
||||
if(stnId_timeLine_sndType.equals("N/A"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
sndLyLst = soundMap.get(stnId_timeLine_sndType);
|
||||
|
||||
stnId = stnId_timeLine_sndType.substring(0,
|
||||
stnId_timeLine_sndType.indexOf(" "));
|
||||
timeLine_sndType = stnId_timeLine_sndType
|
||||
|
@ -1987,10 +2028,18 @@ public class NsharpResourceHandler {
|
|||
}
|
||||
|
||||
/*
|
||||
* As of 2014 April 9, current time description string is
|
||||
* Chin: 04092014, current time description string is
|
||||
* defined as "YYMMDD/HH(DOW)" or "YYMMDD/HH(DOW)Vxxx". Convert
|
||||
* them to "DD.HH(DOW)" or "DD.HHVxxx(DOW)" for GUI display.
|
||||
*/
|
||||
/*
|
||||
* Chin: 02032015
|
||||
* "DR17079: Soundings listed out of order if frames go into new month"
|
||||
* To fix DR17079, keep time line format as yymmdd/hh(day)Vxxx to be saved
|
||||
* in NsharpSoundingElementStateProperty.
|
||||
* We will convert display string while drawing.
|
||||
* This chunk code is to convert time line format from yymmdd/hh(day)Vxxx to dd.hh(day)Vxxx
|
||||
*
|
||||
timeLine = timeLine.substring(4); // get rid of YYMM
|
||||
if (timeLine.contains("V")) {
|
||||
String[] s1Str = timeLine.split("V"); // split
|
||||
|
@ -2007,6 +2056,9 @@ public class NsharpResourceHandler {
|
|||
// "DD/HHVxxx(DOW)"
|
||||
}
|
||||
timeLine = timeLine.replace("/", "."); // replace "/" with "."
|
||||
*
|
||||
* end DR17079
|
||||
*/
|
||||
}
|
||||
// recreate stnId_timeLine_sndType
|
||||
stnId_timeLine_sndType = stnId + " " + timeLine + " " + sndType;
|
||||
|
@ -2015,8 +2067,10 @@ public class NsharpResourceHandler {
|
|||
// No more needed? timeLine = timeLine.replace(" ", "-"); //fixed
|
||||
// DR15325 - sorting time line issue in D2D
|
||||
// add time line to stnTimeTable and set its index
|
||||
//task#5929
|
||||
boolean goodData = checkDataIntegrity( sndLyLst);
|
||||
addElementToTableAndLists(stnId_timeLine_sndType, stnId, timeLine,
|
||||
sndType, stnInfo, sndLyLst);
|
||||
sndType, stnInfo, sndLyLst, goodData);
|
||||
}
|
||||
if (displayNewData) {
|
||||
// Set default parcel trace data
|
||||
|
@ -2620,7 +2674,10 @@ public class NsharpResourceHandler {
|
|||
|
||||
break;
|
||||
}
|
||||
|
||||
if (compareSndIsOn) {
|
||||
handleUserPickNewTimeLine(currentTimeElementListIndex) ;
|
||||
return;
|
||||
}
|
||||
curTimeLinePage = currentTimeElementListIndex / numTimeLinePerPage
|
||||
+ 1;
|
||||
setCurSndProfileProp();
|
||||
|
@ -2757,7 +2814,10 @@ public class NsharpResourceHandler {
|
|||
// we should get out of here
|
||||
break;
|
||||
} else if (compareSndIsOn) {
|
||||
boolean found = false;
|
||||
handleUserPickNewTimeLine(targetIndex) ;
|
||||
return;
|
||||
/* DR16888 02052015
|
||||
* boolean found = false;
|
||||
if (currentStnElementListIndex >= 0
|
||||
&& currentSndElementListIndex >= 0
|
||||
&& stnTimeSndTable
|
||||
|
@ -2802,6 +2862,7 @@ public class NsharpResourceHandler {
|
|||
// not
|
||||
// we should get out of here
|
||||
break;
|
||||
*/
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
@ -4027,7 +4088,13 @@ public class NsharpResourceHandler {
|
|||
// re-populate snd data to nsharp native code lib for later calculating
|
||||
Collections.sort(soundingLys,
|
||||
NsharpDataHandling.reversePressureHeightWindComparator());
|
||||
nsharpNative.populateSndgData(soundingLys);
|
||||
//#5929
|
||||
goodData = checkDataIntegrity( soundingLys);
|
||||
if(getCurSoundingElementStateProperty()!=null){
|
||||
getCurSoundingElementStateProperty().setGoodData(goodData);
|
||||
}
|
||||
if(goodData)
|
||||
nsharpNative.populateSndgData(soundingLys);
|
||||
// get storm motion wind data after populate sounding from NsharpLib
|
||||
// refresh test area if it is shown now
|
||||
NsharpShowTextDialog textarea = NsharpShowTextDialog.getAccess();
|
||||
|
@ -4053,6 +4120,13 @@ public class NsharpResourceHandler {
|
|||
}
|
||||
if (dataPaneRsc != null)
|
||||
dataPaneRsc.setSoundingLys(soundingLys);
|
||||
|
||||
if (spcGraphsPaneRsc != null && (goodData) ){//#5929
|
||||
// Chin: SPC graphs performance concern, as it need to call get
|
||||
// info functions from bigSharo.so and cause long delay.
|
||||
// Therefore, do it once only when reset data.
|
||||
spcGraphsPaneRsc.getSpcGraphsInfo();
|
||||
}
|
||||
}
|
||||
|
||||
public void addNewLayer(float tp, float dp, float ws, float wd,
|
||||
|
@ -4070,7 +4144,13 @@ public class NsharpResourceHandler {
|
|||
// re-populate snd data to nsharp native code lib for later calculating
|
||||
Collections.sort(soundingLys,
|
||||
NsharpDataHandling.reversePressureHeightWindComparator());
|
||||
nsharpNative.populateSndgData(soundingLys);
|
||||
//#5929
|
||||
goodData = checkDataIntegrity( soundingLys);
|
||||
if(getCurSoundingElementStateProperty()!=null){
|
||||
getCurSoundingElementStateProperty().setGoodData(goodData);
|
||||
}
|
||||
if(goodData)
|
||||
nsharpNative.populateSndgData(soundingLys);
|
||||
// get storm motion wind data after populate sounding from NsharpLib
|
||||
// refresh text area if it is shown now
|
||||
NsharpShowTextDialog textarea = NsharpShowTextDialog.getAccess();
|
||||
|
@ -4096,6 +4176,12 @@ public class NsharpResourceHandler {
|
|||
}
|
||||
if (dataPaneRsc != null)
|
||||
dataPaneRsc.setSoundingLys(soundingLys);
|
||||
if (spcGraphsPaneRsc != null && (goodData) ){//#5929
|
||||
// Chin: SPC graphs performance concern, as it need to call get
|
||||
// info functions from bigSharo.so and cause long delay.
|
||||
// Therefore, do it once only when reset data.
|
||||
spcGraphsPaneRsc.getSpcGraphsInfo();
|
||||
}
|
||||
}
|
||||
|
||||
public void setGraphConfigProperty(NsharpGraphProperty graphConfigProperty) {
|
||||
|
@ -4424,4 +4510,9 @@ public class NsharpResourceHandler {
|
|||
refreshPane();
|
||||
return true;
|
||||
}
|
||||
//#5929
|
||||
public boolean isGoodData() {
|
||||
return goodData;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -14,7 +14,12 @@ package gov.noaa.nws.ncep.ui.nsharp.display.rsc;
|
|||
* May 08, 2013 1847 bsteffen Allow painting with no Wind Data.
|
||||
* 02/03/2014 1106 Chin Chen Need to be able to use clicking on the Src,Time, or StnId to select display
|
||||
* 08/04/2014 Chin Chen fixed effective level line drawing, height marker drawing
|
||||
*
|
||||
* 01/27/2015 DR#17006,
|
||||
* Task#5929 Chin Chen NSHARP freezes when loading a sounding from MDCRS products
|
||||
* in Volume Browser
|
||||
* 02/03/2015 DR#17084 Chin Chen Model soundings being interpolated below the surface for elevated sites
|
||||
* 02/05/2015 DR16888 Chin Chen fixed issue that "Comp(Src) button not functioning properly in NSHARP display"
|
||||
* merged 12/11/2014 fixes at version 14.2.2 and check in again to 14.3.1
|
||||
* </pre>
|
||||
*
|
||||
* @author Chin Chen
|
||||
|
@ -35,6 +40,7 @@ import gov.noaa.nws.ncep.ui.nsharp.background.NsharpSkewTPaneBackground;
|
|||
import gov.noaa.nws.ncep.ui.nsharp.background.NsharpTurbulencePaneBackground;
|
||||
import gov.noaa.nws.ncep.ui.nsharp.display.NsharpSkewTPaneDescriptor;
|
||||
import gov.noaa.nws.ncep.ui.nsharp.natives.NsharpNative;
|
||||
import gov.noaa.nws.ncep.ui.nsharp.natives.NsharpNative.NsharpLibrary;
|
||||
import gov.noaa.nws.ncep.ui.nsharp.natives.NsharpNative.NsharpLibrary._lplvalues;
|
||||
import gov.noaa.nws.ncep.ui.nsharp.natives.NsharpNative.NsharpLibrary._parcel;
|
||||
import gov.noaa.nws.ncep.ui.nsharp.natives.NsharpNativeConstants;
|
||||
|
@ -1253,32 +1259,40 @@ public class NsharpSkewTPaneResource extends NsharpAbstractPaneResource {
|
|||
double p_mb = c.y;
|
||||
double temp = c.x;
|
||||
float htFt, htM, relh = -1;
|
||||
String curStrFormat, curStrFormat1;
|
||||
String curStrFormat, curStrFormat1, htMStr, htFtStr;
|
||||
String curStr, curStr1;// , curStr2,curStr3;
|
||||
VerticalAlignment vAli;
|
||||
HorizontalAlignment hAli;
|
||||
|
||||
// curStr3 = rscHandler.getPickedStnInfoStr()+"\n";
|
||||
|
||||
htM = nsharpNative.nsharpLib.agl(nsharpNative.nsharpLib
|
||||
//Chin, DR17084
|
||||
if(soundingLys.get(0).getGeoHeight() <0){
|
||||
htMStr="M";
|
||||
htFtStr="M";
|
||||
}
|
||||
else {
|
||||
htM = nsharpNative.nsharpLib.agl(nsharpNative.nsharpLib
|
||||
.ihght((float) p_mb));
|
||||
htFt = nsharpNative.nsharpLib.mtof(htM);
|
||||
htFt = nsharpNative.nsharpLib.mtof(htM);
|
||||
htMStr = Integer.toString(Math.round(htM));
|
||||
htFtStr = Integer.toString(Math.round(htFt));
|
||||
}
|
||||
if (nsharpNative.nsharpLib.itemp((float) p_mb) > -9998.0
|
||||
&& nsharpNative.nsharpLib.idwpt((float) p_mb) > -9998.0) {
|
||||
FloatByReference parm = new FloatByReference(0);
|
||||
relh = nsharpNative.nsharpLib.relh((float) p_mb, parm);
|
||||
curStrFormat = "%4.0f/%.0fkt %4.0fmb %5.0fft/%.0fm agl %2.0f%%\n";
|
||||
curStrFormat = "%4.0f/%.0fkt %4.0fmb %sft/%sm agl %2.0f%%\n";
|
||||
curStr = String.format(curStrFormat,
|
||||
nsharpNative.nsharpLib.iwdir((float) p_mb),
|
||||
nsharpNative.nsharpLib.iwspd((float) p_mb), p_mb, htFt,
|
||||
htM, relh);
|
||||
nsharpNative.nsharpLib.iwspd((float) p_mb), p_mb, htFtStr,
|
||||
htMStr, relh);
|
||||
} else {
|
||||
curStrFormat = "%4.0f/%.0fkt %4.0fmb %5.0fft/%.0fm agl\n";
|
||||
curStrFormat = "%4.0f/%.0fkt %4.0fmb %sft/%sm agl\n";
|
||||
curStr = String
|
||||
.format(curStrFormat,
|
||||
nsharpNative.nsharpLib.iwdir((float) p_mb),
|
||||
nsharpNative.nsharpLib.iwspd((float) p_mb), p_mb,
|
||||
htFt, htM);
|
||||
htFtStr, htMStr);
|
||||
}
|
||||
/*
|
||||
* curStrFormat1 = "%s/%s %4.1f/%4.1f%cC %4.0f/%.0f kt\n"; curStr1 =
|
||||
|
@ -1739,6 +1753,8 @@ public class NsharpSkewTPaneResource extends NsharpAbstractPaneResource {
|
|||
// box
|
||||
}
|
||||
target.drawStrings(str, latlonstr);
|
||||
if(wwTypeColor == null)
|
||||
wwTypeColor = NsharpConstants.color_gold;
|
||||
target.drawRect(boxExt, wwTypeColor, 2f, 1f); // box border line colored
|
||||
// with "Psbl Watch Type"
|
||||
// color
|
||||
|
@ -1767,7 +1783,7 @@ public class NsharpSkewTPaneResource extends NsharpAbstractPaneResource {
|
|||
// to check a scenario that sounding data is removed while
|
||||
// thread is locked
|
||||
if (soundingLys == null
|
||||
|| (soundingLys != null && soundingLys.size() <= 0)) {
|
||||
|| (soundingLys != null && soundingLys.size() < 2)) {
|
||||
reentryLock.unlock();
|
||||
return;
|
||||
}
|
||||
|
@ -1778,7 +1794,7 @@ public class NsharpSkewTPaneResource extends NsharpAbstractPaneResource {
|
|||
} else if (justBackToMainPane) {
|
||||
reentryLock.lock();
|
||||
if (soundingLys == null
|
||||
|| (soundingLys != null && soundingLys.size() <= 0)) {
|
||||
|| (soundingLys != null && soundingLys.size() < 2)) {
|
||||
reentryLock.unlock();
|
||||
return;
|
||||
}
|
||||
|
@ -1827,376 +1843,384 @@ public class NsharpSkewTPaneResource extends NsharpAbstractPaneResource {
|
|||
this.font12.setScaleFont(false);
|
||||
// nsharpNative.populateSndgData(soundingLys);
|
||||
if (currentGraphMode == NsharpConstants.GRAPH_SKEWT) {
|
||||
target.setupClippingPlane(pe);
|
||||
// plot temp curve, when constructing pressureTempRscShapeList,
|
||||
// it already considered
|
||||
// comparison, overlay, etc..so, just draw it.
|
||||
for (NsharpShapeAndLineProperty shapeNLp : pressureTempRscShapeList) {
|
||||
target.drawWireframeShape(shapeNLp.getShape(), shapeNLp
|
||||
.getLp().getLineColor(), shapeNLp.getLp()
|
||||
.getLineWidth(), shapeNLp.getLp().getLineStyle(),
|
||||
font10);// commonLinewidth*2,commonLineStyle,font10);
|
||||
}
|
||||
// plot real temp parcel trace, when constructing
|
||||
// parcelRtShapeList, it already considered
|
||||
// comparison, overlay, etc..so, just draw it.
|
||||
// color is following comparison/overlay lines' configuration.
|
||||
// line width and line style are following parcel line
|
||||
// configuration
|
||||
if (graphConfigProperty.isParcel() == true) {
|
||||
NsharpLineProperty parcelLp = linePropertyMap
|
||||
.get(NsharpConstants.lineNameArray[NsharpConstants.LINE_PARCEL]);
|
||||
for (NsharpShapeAndLineProperty shapeNLp : parcelRtShapeList) {
|
||||
target.drawWireframeShape(shapeNLp.getShape(), shapeNLp
|
||||
.getLp().getLineColor(), parcelLp
|
||||
.getLineWidth(), parcelLp.getLineStyle(),
|
||||
font10);// commonLinewidth*2,commonLineStyle,font10);
|
||||
}
|
||||
}
|
||||
boolean compareStnIsOn = rscHandler.isCompareStnIsOn();
|
||||
boolean compareSndIsOn = rscHandler.isCompareSndIsOn();
|
||||
boolean compareTmIsOn = rscHandler.isCompareTmIsOn();
|
||||
boolean editGraphOn = rscHandler.isEditGraphOn();
|
||||
boolean overlayIsOn = rscHandler.isOverlayIsOn();
|
||||
if (graphConfigProperty != null) {
|
||||
if (graphConfigProperty.isTemp() == true && !compareStnIsOn
|
||||
&& !compareTmIsOn) {
|
||||
if (editGraphOn)
|
||||
plotPressureTempEditPoints(target, world,
|
||||
NsharpConstants.color_red, TEMP_TYPE,
|
||||
this.soundingLys);
|
||||
}
|
||||
// dew point curve
|
||||
if (graphConfigProperty.isDewp() == true && !compareStnIsOn
|
||||
&& !compareTmIsOn) {
|
||||
if (editGraphOn)
|
||||
plotPressureTempEditPoints(target, world,
|
||||
NsharpConstants.color_green, DEWPOINT_TYPE,
|
||||
this.soundingLys);
|
||||
}
|
||||
// plot wet bulb trace
|
||||
if (graphConfigProperty.isWetBulb() == true
|
||||
&& !compareStnIsOn && !compareTmIsOn) {
|
||||
NsharpLineProperty lp = linePropertyMap
|
||||
.get(NsharpConstants.lineNameArray[NsharpConstants.LINE_WETBULB]);
|
||||
target.drawWireframeShape(wetBulbTraceRscShape,
|
||||
lp.getLineColor(), lp.getLineWidth(),
|
||||
lp.getLineStyle(), font10);
|
||||
}
|
||||
// plot virtual temperature trace
|
||||
if (graphConfigProperty.isVTemp() == true
|
||||
&& !compareStnIsOn && !compareTmIsOn) {
|
||||
NsharpLineProperty lp = linePropertyMap
|
||||
.get(NsharpConstants.lineNameArray[NsharpConstants.LINE_VIRTUAL_TEMP]);
|
||||
target.drawWireframeShape(vtempTraceCurveRscShape,
|
||||
lp.getLineColor(), lp.getLineWidth(),
|
||||
lp.getLineStyle(), font10);
|
||||
}
|
||||
// virtual temperature parcel trace curve
|
||||
if (graphConfigProperty.isParcelTv() == true
|
||||
&& !compareStnIsOn && !compareTmIsOn
|
||||
&& !overlayIsOn) {
|
||||
if (soundingLys.size() > 0) {
|
||||
NsharpLineProperty lp = linePropertyMap
|
||||
.get(NsharpConstants.lineNameArray[NsharpConstants.LINE_PARCEL_TV]);
|
||||
target.drawWireframeShape(parcelVtTraceRscShape,
|
||||
lp.getLineColor(), lp.getLineWidth(),
|
||||
lp.getLineStyle(), font10);
|
||||
}
|
||||
}
|
||||
|
||||
if (graphConfigProperty.isDcape() == true
|
||||
&& dacpeTraceRscShape != null && !compareStnIsOn
|
||||
&& !compareTmIsOn && !overlayIsOn) {
|
||||
if (soundingLys.size() > 0) {
|
||||
NsharpLineProperty lp = linePropertyMap
|
||||
.get(NsharpConstants.lineNameArray[NsharpConstants.LINE_DCAPE]);
|
||||
target.drawWireframeShape(dacpeTraceRscShape,
|
||||
lp.getLineColor(), lp.getLineWidth(),
|
||||
lp.getLineStyle(), font10);
|
||||
target.setupClippingPlane(pe);
|
||||
// plot temp curve, when constructing pressureTempRscShapeList,
|
||||
// it already considered
|
||||
// comparison, overlay, etc..so, just draw it.
|
||||
for (NsharpShapeAndLineProperty shapeNLp : pressureTempRscShapeList) {
|
||||
target.drawWireframeShape(shapeNLp.getShape(), shapeNLp
|
||||
.getLp().getLineColor(), shapeNLp.getLp()
|
||||
.getLineWidth(), shapeNLp.getLp().getLineStyle(),
|
||||
font10);// commonLinewidth*2,commonLineStyle,font10);
|
||||
}
|
||||
// plot real temp parcel trace, when constructing
|
||||
// parcelRtShapeList, it already considered
|
||||
// comparison, overlay, etc..so, just draw it.
|
||||
// color is following comparison/overlay lines' configuration.
|
||||
// line width and line style are following parcel line
|
||||
// configuration
|
||||
if (graphConfigProperty.isParcel() == true && rscHandler.isGoodData()) { //#5929
|
||||
NsharpLineProperty parcelLp = linePropertyMap
|
||||
.get(NsharpConstants.lineNameArray[NsharpConstants.LINE_PARCEL]);
|
||||
for (NsharpShapeAndLineProperty shapeNLp : parcelRtShapeList) {
|
||||
target.drawWireframeShape(shapeNLp.getShape(), shapeNLp
|
||||
.getLp().getLineColor(), parcelLp
|
||||
.getLineWidth(), parcelLp.getLineStyle(),
|
||||
font10);// commonLinewidth*2,commonLineStyle,font10);
|
||||
}
|
||||
}
|
||||
boolean compareStnIsOn = rscHandler.isCompareStnIsOn();
|
||||
boolean compareSndIsOn = rscHandler.isCompareSndIsOn();
|
||||
boolean compareTmIsOn = rscHandler.isCompareTmIsOn();
|
||||
boolean editGraphOn = rscHandler.isEditGraphOn();
|
||||
boolean overlayIsOn = rscHandler.isOverlayIsOn();
|
||||
if (graphConfigProperty != null) {
|
||||
if (graphConfigProperty.isTemp() == true && !compareStnIsOn
|
||||
&& !compareTmIsOn && !compareSndIsOn) {
|
||||
if (editGraphOn)
|
||||
plotPressureTempEditPoints(target, world,
|
||||
NsharpConstants.color_red, TEMP_TYPE,
|
||||
this.soundingLys);
|
||||
}
|
||||
// dew point curve
|
||||
if (graphConfigProperty.isDewp() == true && !compareStnIsOn
|
||||
&& !compareTmIsOn && !compareSndIsOn) {
|
||||
if (editGraphOn)
|
||||
plotPressureTempEditPoints(target, world,
|
||||
NsharpConstants.color_green, DEWPOINT_TYPE,
|
||||
this.soundingLys);
|
||||
}
|
||||
// plot wet bulb trace
|
||||
if (graphConfigProperty.isWetBulb() == true && rscHandler.isGoodData() //#5929
|
||||
&& !compareStnIsOn && !compareTmIsOn && !compareSndIsOn) {
|
||||
NsharpLineProperty lp = linePropertyMap
|
||||
.get(NsharpConstants.lineNameArray[NsharpConstants.LINE_WETBULB]);
|
||||
target.drawWireframeShape(wetBulbTraceRscShape,
|
||||
lp.getLineColor(), lp.getLineWidth(),
|
||||
lp.getLineStyle(), font10);
|
||||
}
|
||||
// plot virtual temperature trace
|
||||
if (graphConfigProperty.isVTemp() == true && rscHandler.isGoodData() //#5929
|
||||
&& !compareStnIsOn && !compareTmIsOn && !compareSndIsOn) {
|
||||
NsharpLineProperty lp = linePropertyMap
|
||||
.get(NsharpConstants.lineNameArray[NsharpConstants.LINE_VIRTUAL_TEMP]);
|
||||
target.drawWireframeShape(vtempTraceCurveRscShape,
|
||||
lp.getLineColor(), lp.getLineWidth(),
|
||||
lp.getLineStyle(), font10);
|
||||
}
|
||||
// virtual temperature parcel trace curve
|
||||
if (graphConfigProperty.isParcelTv() == true && rscHandler.isGoodData() //#5929
|
||||
&& !compareStnIsOn && !compareTmIsOn && !compareSndIsOn
|
||||
&& !overlayIsOn) {
|
||||
if (soundingLys.size() > 0) {
|
||||
NsharpLineProperty lp = linePropertyMap
|
||||
.get(NsharpConstants.lineNameArray[NsharpConstants.LINE_PARCEL_TV]);
|
||||
target.drawWireframeShape(parcelVtTraceRscShape,
|
||||
lp.getLineColor(), lp.getLineWidth(),
|
||||
lp.getLineStyle(), font10);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (graphConfigProperty.isEffLayer() == true
|
||||
&& !compareStnIsOn && !compareTmIsOn) {
|
||||
// draw effective layer lines
|
||||
// drawEffectiveLayerLines(target);
|
||||
target.drawWireframeShape(effectiveLayerLineShape,
|
||||
NsharpConstants.color_cyan_md, 2,
|
||||
commonLineStyle, font10);
|
||||
}
|
||||
// cloud
|
||||
if (graphConfigProperty.isCloud() == true
|
||||
&& !compareStnIsOn && !compareTmIsOn) {
|
||||
if (cloudFMShape != null)
|
||||
target.drawShadedShape(cloudFMShape, 1f);
|
||||
if (cloudFMLabelShape != null)
|
||||
target.drawWireframeShape(cloudFMLabelShape,
|
||||
NsharpConstants.color_chocolate,
|
||||
commonLinewidth * 3, commonLineStyle, font9);
|
||||
if (cloudCEShape != null)
|
||||
target.drawShadedShape(cloudCEShape, 1f);
|
||||
}
|
||||
if (graphConfigProperty.isOmega() == true
|
||||
&& !compareStnIsOn && !compareTmIsOn) {
|
||||
if (NsharpLoadDialog.getAccess() != null
|
||||
&& (NsharpLoadDialog.getAccess()
|
||||
.getActiveLoadSoundingType() == NsharpLoadDialog.MODEL_SND || NsharpLoadDialog
|
||||
.getAccess()
|
||||
.getActiveLoadSoundingType() == NsharpLoadDialog.PFC_SND)) {
|
||||
// plot omega
|
||||
drawOmega();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// by default, draw everything
|
||||
if (!compareStnIsOn && !compareTmIsOn) {
|
||||
if (editGraphOn)
|
||||
plotPressureTempEditPoints(target, world,
|
||||
NsharpConstants.color_red, TEMP_TYPE,
|
||||
this.soundingLys);
|
||||
// dew point curve
|
||||
if (editGraphOn)
|
||||
plotPressureTempEditPoints(target, world,
|
||||
NsharpConstants.color_green, DEWPOINT_TYPE,
|
||||
this.soundingLys);
|
||||
// plot wetbulb trace
|
||||
NsharpLineProperty lp = linePropertyMap
|
||||
.get(NsharpConstants.lineNameArray[NsharpConstants.LINE_WETBULB]);
|
||||
target.drawWireframeShape(wetBulbTraceRscShape,
|
||||
lp.getLineColor(), lp.getLineWidth(),
|
||||
lp.getLineStyle(), font10);
|
||||
// plot virtual temp trace
|
||||
lp = linePropertyMap
|
||||
.get(NsharpConstants.lineNameArray[NsharpConstants.LINE_VIRTUAL_TEMP]);
|
||||
target.drawWireframeShape(vtempTraceCurveRscShape,
|
||||
lp.getLineColor(), lp.getLineWidth(),
|
||||
lp.getLineStyle(), font10);
|
||||
if (graphConfigProperty.isDcape() == true && rscHandler.isGoodData() //#5929
|
||||
&& dacpeTraceRscShape != null && !compareStnIsOn && !compareSndIsOn
|
||||
&& !compareTmIsOn && !overlayIsOn) {
|
||||
if (soundingLys.size() > 0) {
|
||||
NsharpLineProperty lp = linePropertyMap
|
||||
.get(NsharpConstants.lineNameArray[NsharpConstants.LINE_DCAPE]);
|
||||
target.drawWireframeShape(dacpeTraceRscShape,
|
||||
lp.getLineColor(), lp.getLineWidth(),
|
||||
lp.getLineStyle(), font10);
|
||||
|
||||
// virtual temperature parcel trace curve
|
||||
if (!overlayIsOn) {
|
||||
lp = linePropertyMap
|
||||
.get(NsharpConstants.lineNameArray[NsharpConstants.LINE_PARCEL_TV]);
|
||||
target.drawWireframeShape(parcelVtTraceRscShape,
|
||||
lp.getLineColor(), lp.getLineWidth(),
|
||||
lp.getLineStyle(), font10);
|
||||
if (dacpeTraceRscShape != null) {
|
||||
lp = linePropertyMap
|
||||
.get(NsharpConstants.lineNameArray[NsharpConstants.LINE_DCAPE]);
|
||||
target.drawWireframeShape(dacpeTraceRscShape,
|
||||
lp.getLineColor(), lp.getLineWidth(),
|
||||
lp.getLineStyle(), font10);
|
||||
}
|
||||
}
|
||||
// draw effective layer lines
|
||||
// drawEffectiveLayerLines(target);
|
||||
target.drawWireframeShape(effectiveLayerLineShape,
|
||||
NsharpConstants.color_cyan_md, 2,
|
||||
commonLineStyle, font10);
|
||||
if (NsharpLoadDialog.getAccess() != null
|
||||
&& (NsharpLoadDialog.getAccess()
|
||||
.getActiveLoadSoundingType() == NsharpLoadDialog.MODEL_SND || NsharpLoadDialog
|
||||
.getAccess()
|
||||
.getActiveLoadSoundingType() == NsharpLoadDialog.PFC_SND)) {
|
||||
// plot omega
|
||||
drawOmega();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (plotInteractiveTemp == true) {
|
||||
if (currentSkewTEditMode == NsharpConstants.SKEWT_EDIT_MODE_EDITPOINT)
|
||||
plotNsharpInteractiveEditingTemp(target,
|
||||
currentZoomLevel, world,
|
||||
NsharpConstants.color_white);
|
||||
else if (currentSkewTEditMode == NsharpConstants.SKEWT_EDIT_MODE_MOVELINE)
|
||||
plotNsharpMovingTempLine(target, world,
|
||||
NsharpConstants.color_white);
|
||||
}
|
||||
}
|
||||
if (graphConfigProperty.isEffLayer() == true && rscHandler.isGoodData() //#5929
|
||||
&& !compareStnIsOn && !compareTmIsOn && !compareSndIsOn) {
|
||||
// draw effective layer lines
|
||||
// drawEffectiveLayerLines(target);
|
||||
target.drawWireframeShape(effectiveLayerLineShape,
|
||||
NsharpConstants.color_cyan_md, 2,
|
||||
commonLineStyle, font10);
|
||||
}
|
||||
// cloud
|
||||
if (graphConfigProperty.isCloud() == true && rscHandler.isGoodData() //#5929
|
||||
&& !compareStnIsOn && !compareTmIsOn && !compareSndIsOn) {
|
||||
if (cloudFMShape != null)
|
||||
target.drawShadedShape(cloudFMShape, 1f);
|
||||
if (cloudFMLabelShape != null)
|
||||
target.drawWireframeShape(cloudFMLabelShape,
|
||||
NsharpConstants.color_chocolate,
|
||||
commonLinewidth * 3, commonLineStyle, font9);
|
||||
if (cloudCEShape != null)
|
||||
target.drawShadedShape(cloudCEShape, 1f);
|
||||
}
|
||||
if (graphConfigProperty.isOmega() == true
|
||||
&& !compareStnIsOn && !compareTmIsOn && !compareSndIsOn) {
|
||||
if (NsharpLoadDialog.getAccess() != null
|
||||
&& (NsharpLoadDialog.getAccess()
|
||||
.getActiveLoadSoundingType() == NsharpLoadDialog.MODEL_SND || NsharpLoadDialog
|
||||
.getAccess()
|
||||
.getActiveLoadSoundingType() == NsharpLoadDialog.PFC_SND)) {
|
||||
// plot omega
|
||||
drawOmega();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// by default, draw everything
|
||||
if (!compareStnIsOn && !compareTmIsOn && !compareSndIsOn) {
|
||||
if (editGraphOn)
|
||||
plotPressureTempEditPoints(target, world,
|
||||
NsharpConstants.color_red, TEMP_TYPE,
|
||||
this.soundingLys);
|
||||
// dew point curve
|
||||
if (editGraphOn)
|
||||
plotPressureTempEditPoints(target, world,
|
||||
NsharpConstants.color_green, DEWPOINT_TYPE,
|
||||
this.soundingLys);
|
||||
if(rscHandler.isGoodData()) { //#5929
|
||||
// plot wetbulb trace
|
||||
NsharpLineProperty lp = linePropertyMap
|
||||
.get(NsharpConstants.lineNameArray[NsharpConstants.LINE_WETBULB]);
|
||||
target.drawWireframeShape(wetBulbTraceRscShape,
|
||||
lp.getLineColor(), lp.getLineWidth(),
|
||||
lp.getLineStyle(), font10);
|
||||
// plot virtual temp trace
|
||||
lp = linePropertyMap
|
||||
.get(NsharpConstants.lineNameArray[NsharpConstants.LINE_VIRTUAL_TEMP]);
|
||||
target.drawWireframeShape(vtempTraceCurveRscShape,
|
||||
lp.getLineColor(), lp.getLineWidth(),
|
||||
lp.getLineStyle(), font10);
|
||||
|
||||
}
|
||||
target.clearClippingPlane();
|
||||
// virtual temperature parcel trace curve
|
||||
if (!overlayIsOn) {
|
||||
lp = linePropertyMap
|
||||
.get(NsharpConstants.lineNameArray[NsharpConstants.LINE_PARCEL_TV]);
|
||||
target.drawWireframeShape(parcelVtTraceRscShape,
|
||||
lp.getLineColor(), lp.getLineWidth(),
|
||||
lp.getLineStyle(), font10);
|
||||
if (dacpeTraceRscShape != null) {
|
||||
lp = linePropertyMap
|
||||
.get(NsharpConstants.lineNameArray[NsharpConstants.LINE_DCAPE]);
|
||||
target.drawWireframeShape(dacpeTraceRscShape,
|
||||
lp.getLineColor(), lp.getLineWidth(),
|
||||
lp.getLineStyle(), font10);
|
||||
}
|
||||
}
|
||||
// draw effective layer lines
|
||||
// drawEffectiveLayerLines(target);
|
||||
target.drawWireframeShape(effectiveLayerLineShape,
|
||||
NsharpConstants.color_cyan_md, 2,
|
||||
commonLineStyle, font10);
|
||||
}
|
||||
if (NsharpLoadDialog.getAccess() != null
|
||||
&& (NsharpLoadDialog.getAccess()
|
||||
.getActiveLoadSoundingType() == NsharpLoadDialog.MODEL_SND || NsharpLoadDialog
|
||||
.getAccess()
|
||||
.getActiveLoadSoundingType() == NsharpLoadDialog.PFC_SND)) {
|
||||
// plot omega
|
||||
drawOmega();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (plotInteractiveTemp == true) {
|
||||
if (currentSkewTEditMode == NsharpConstants.SKEWT_EDIT_MODE_EDITPOINT)
|
||||
plotNsharpInteractiveEditingTemp(target,
|
||||
currentZoomLevel, world,
|
||||
NsharpConstants.color_white);
|
||||
else if (currentSkewTEditMode == NsharpConstants.SKEWT_EDIT_MODE_MOVELINE)
|
||||
plotNsharpMovingTempLine(target, world,
|
||||
NsharpConstants.color_white);
|
||||
|
||||
}
|
||||
target.clearClippingPlane();
|
||||
|
||||
// Wind Barb
|
||||
if ((graphConfigProperty != null && graphConfigProperty
|
||||
.isWindBarb() == true) || graphConfigProperty == null) {
|
||||
double xPos = skewTBackground.getWindBarbXPosition();
|
||||
if (overlayIsOn == true && this.previousSoundingLys != null) {
|
||||
drawNsharpWindBarb(
|
||||
target,
|
||||
currentZoomLevel,
|
||||
world,
|
||||
linePropertyMap
|
||||
.get(NsharpConstants.lineNameArray[NsharpConstants.LINE_OVERLAY1])
|
||||
.getLineColor(), this.soundingLys,
|
||||
xPos, 100);
|
||||
if (!previousSoundingLys.equals(soundingLys))
|
||||
drawNsharpWindBarb(
|
||||
target,
|
||||
currentZoomLevel,
|
||||
world,
|
||||
linePropertyMap
|
||||
.get(NsharpConstants.lineNameArray[NsharpConstants.LINE_OVERLAY2])
|
||||
.getLineColor(),
|
||||
this.previousSoundingLys,
|
||||
xPos - NsharpResourceHandler.BARB_LENGTH,
|
||||
100);
|
||||
} else {
|
||||
if (!compareStnIsOn && !compareTmIsOn
|
||||
&& !compareSndIsOn) {
|
||||
drawNsharpWindBarb(target, currentZoomLevel, world,
|
||||
graphConfigProperty.getWindBarbColor(),
|
||||
this.soundingLys, xPos, 100);
|
||||
} else {
|
||||
int currentTimeListIndex = rscHandler
|
||||
.getCurrentTimeElementListIndex();
|
||||
int currentStnListIndex = rscHandler
|
||||
.getCurrentStnElementListIndex();
|
||||
int currentSndListIndex = rscHandler
|
||||
.getCurrentSndElementListIndex();
|
||||
List<NsharpOperationElement> stnElemList = rscHandler
|
||||
.getStnElementList();
|
||||
List<NsharpOperationElement> timeElemList = rscHandler
|
||||
.getTimeElementList();
|
||||
List<NsharpOperationElement> sndElemList = rscHandler
|
||||
.getSndElementList();
|
||||
List<List<List<NsharpSoundingElementStateProperty>>> stnTimeSndTable = rscHandler
|
||||
.getStnTimeSndTable();
|
||||
if (compareTmIsOn && currentStnListIndex >= 0
|
||||
&& currentSndListIndex >= 0) {
|
||||
int colorIndex;
|
||||
for (NsharpOperationElement elm : timeElemList) {
|
||||
if (elm.getActionState() == NsharpConstants.ActState.ACTIVE
|
||||
&& stnTimeSndTable
|
||||
.get(currentStnListIndex)
|
||||
.get(timeElemList
|
||||
.indexOf(elm))
|
||||
.get(currentSndListIndex) != null) {
|
||||
List<NcSoundingLayer> soundingLayeys = stnTimeSndTable
|
||||
.get(currentStnListIndex)
|
||||
.get(timeElemList.indexOf(elm))
|
||||
.get(currentSndListIndex)
|
||||
.getSndLyLst();
|
||||
colorIndex = stnTimeSndTable
|
||||
.get(currentStnListIndex)
|
||||
.get(timeElemList.indexOf(elm))
|
||||
.get(currentSndListIndex)
|
||||
.getCompColorIndex();
|
||||
NsharpLineProperty lp = linePropertyMap
|
||||
.get(NsharpConstants.lineNameArray[colorIndex]);
|
||||
drawNsharpWindBarb(target,
|
||||
currentZoomLevel, world,
|
||||
lp.getLineColor(),
|
||||
soundingLayeys, xPos, 100);
|
||||
}
|
||||
}
|
||||
} else if (compareStnIsOn
|
||||
&& currentTimeListIndex >= 0
|
||||
&& currentSndListIndex >= 0) {
|
||||
int colorIndex;
|
||||
for (NsharpOperationElement elm : stnElemList) {
|
||||
if (elm.getActionState() == NsharpConstants.ActState.ACTIVE
|
||||
&& stnTimeSndTable
|
||||
.get(stnElemList
|
||||
.indexOf(elm))
|
||||
.get(currentTimeListIndex)
|
||||
.get(currentSndListIndex) != null) {
|
||||
List<NcSoundingLayer> soundingLayeys = stnTimeSndTable
|
||||
.get(stnElemList.indexOf(elm))
|
||||
.get(currentTimeListIndex)
|
||||
.get(currentSndListIndex)
|
||||
.getSndLyLst();
|
||||
colorIndex = stnTimeSndTable
|
||||
.get(stnElemList.indexOf(elm))
|
||||
.get(currentTimeListIndex)
|
||||
.get(currentSndListIndex)
|
||||
.getCompColorIndex();
|
||||
NsharpLineProperty lp = linePropertyMap
|
||||
.get(NsharpConstants.lineNameArray[colorIndex]);
|
||||
drawNsharpWindBarb(target,
|
||||
currentZoomLevel, world,
|
||||
lp.getLineColor(),
|
||||
soundingLayeys, xPos, 100);
|
||||
}
|
||||
}
|
||||
} else if (compareSndIsOn
|
||||
&& currentStnListIndex >= 0
|
||||
&& currentTimeListIndex >= 0) {
|
||||
int colorIndex;
|
||||
// start FixMark:nearByStnCompSnd
|
||||
List<NsharpResourceHandler.CompSndSelectedElem> sndCompElementList = rscHandler
|
||||
.getCompSndSelectedElemList();
|
||||
for (NsharpResourceHandler.CompSndSelectedElem compElem : sndCompElementList) {
|
||||
NsharpSoundingElementStateProperty elemProp = stnTimeSndTable
|
||||
.get(compElem.getStnIndex())
|
||||
.get(compElem.getTimeIndex())
|
||||
.get(compElem.getSndIndex());
|
||||
if (sndElemList.get(compElem.getSndIndex())
|
||||
.getActionState() == NsharpConstants.ActState.ACTIVE
|
||||
&& elemProp != null) {
|
||||
List<NcSoundingLayer> soundingLayeys = elemProp
|
||||
.getSndLyLst();
|
||||
colorIndex = elemProp
|
||||
.getCompColorIndex();
|
||||
NsharpLineProperty lp = linePropertyMap
|
||||
.get(NsharpConstants.lineNameArray[colorIndex]);
|
||||
drawNsharpWindBarb(target,
|
||||
currentZoomLevel, world,
|
||||
lp.getLineColor(),
|
||||
soundingLayeys, xPos, 100);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* original code for(NsharpOperationElement elm:
|
||||
* sndElemList) { if(elm.getActionState() ==
|
||||
* NsharpConstants.ActState.ACTIVE &&
|
||||
* stnTimeSndTable.get(currentStnListIndex).get(
|
||||
* currentTimeListIndex
|
||||
* ).get(sndElemList.indexOf(elm))!=null){
|
||||
* List<NcSoundingLayer> soundingLayeys =
|
||||
* stnTimeSndTable.get(currentStnListIndex).get(
|
||||
* currentTimeListIndex
|
||||
* ).get(sndElemList.indexOf(
|
||||
* elm)).getSndLyLst(); colorIndex =
|
||||
* stnTimeSndTable.get(currentStnListIndex).get(
|
||||
* currentTimeListIndex
|
||||
* ).get(sndElemList.indexOf(
|
||||
* elm)).getCompColorIndex(); NsharpLineProperty
|
||||
* lp =
|
||||
* linePropertyMap.get(NsharpConstants.lineNameArray
|
||||
* [colorIndex]); drawNsharpWindBarb(target,
|
||||
* currentZoomLevel, world, lp.getLineColor(),
|
||||
* soundingLayeys, xPos,100); } }
|
||||
*/
|
||||
// end start FixMark:nearByStnCompSnd
|
||||
}
|
||||
}
|
||||
}
|
||||
// System.out.println("x1 pos"+xPos+ " x2 pos="+ (xPos -
|
||||
// NsharpResourceHandler.BARB_LENGTH));
|
||||
}
|
||||
if( rscHandler.isGoodData() ){ //#5929)
|
||||
drawHeightMark(target);
|
||||
// draw EL, LFC, LCL, FZL, -20C, -30C lines
|
||||
// drawLclLine(target);
|
||||
target.drawWireframeShape(lclShape,
|
||||
NsharpConstants.color_green, 2, LineStyle.SOLID, font10);
|
||||
target.drawWireframeShape(elShape, NsharpConstants.color_red,
|
||||
2, LineStyle.SOLID, font10);
|
||||
target.drawWireframeShape(lfcShape,
|
||||
NsharpConstants.color_yellow, 2, LineStyle.SOLID,
|
||||
font10);
|
||||
target.drawWireframeShape(fzlShape, NsharpConstants.color_cyan,
|
||||
2, LineStyle.SOLID, font10);
|
||||
|
||||
}
|
||||
drawNsharpFileNameAndSampling(target, currentZoomLevel);
|
||||
// draw cursor data
|
||||
if (cursorInSkewT == true && rscHandler.isGoodData()) {
|
||||
if ((curseToggledFontLevel < CURSER_STRING_OFF)
|
||||
&& (cursorTopWindBarb == false || windBarbMagnify == false))
|
||||
drawNsharpSkewtCursorData(target);
|
||||
}
|
||||
|
||||
// Wind Barb
|
||||
if ((graphConfigProperty != null && graphConfigProperty
|
||||
.isWindBarb() == true) || graphConfigProperty == null) {
|
||||
double xPos = skewTBackground.getWindBarbXPosition();
|
||||
if (overlayIsOn == true && this.previousSoundingLys != null) {
|
||||
drawNsharpWindBarb(
|
||||
target,
|
||||
currentZoomLevel,
|
||||
world,
|
||||
linePropertyMap
|
||||
.get(NsharpConstants.lineNameArray[NsharpConstants.LINE_OVERLAY1])
|
||||
.getLineColor(), this.soundingLys,
|
||||
xPos, 100);
|
||||
if (!previousSoundingLys.equals(soundingLys))
|
||||
drawNsharpWindBarb(
|
||||
target,
|
||||
currentZoomLevel,
|
||||
world,
|
||||
linePropertyMap
|
||||
.get(NsharpConstants.lineNameArray[NsharpConstants.LINE_OVERLAY2])
|
||||
.getLineColor(),
|
||||
this.previousSoundingLys,
|
||||
xPos - NsharpResourceHandler.BARB_LENGTH,
|
||||
100);
|
||||
} else {
|
||||
if (!compareStnIsOn && !compareTmIsOn
|
||||
&& !compareSndIsOn) {
|
||||
drawNsharpWindBarb(target, currentZoomLevel, world,
|
||||
graphConfigProperty.getWindBarbColor(),
|
||||
this.soundingLys, xPos, 100);
|
||||
} else {
|
||||
int currentTimeListIndex = rscHandler
|
||||
.getCurrentTimeElementListIndex();
|
||||
int currentStnListIndex = rscHandler
|
||||
.getCurrentStnElementListIndex();
|
||||
int currentSndListIndex = rscHandler
|
||||
.getCurrentSndElementListIndex();
|
||||
List<NsharpOperationElement> stnElemList = rscHandler
|
||||
.getStnElementList();
|
||||
List<NsharpOperationElement> timeElemList = rscHandler
|
||||
.getTimeElementList();
|
||||
List<NsharpOperationElement> sndElemList = rscHandler
|
||||
.getSndElementList();
|
||||
List<List<List<NsharpSoundingElementStateProperty>>> stnTimeSndTable = rscHandler
|
||||
.getStnTimeSndTable();
|
||||
if (compareTmIsOn && currentStnListIndex >= 0
|
||||
&& currentSndListIndex >= 0) {
|
||||
int colorIndex;
|
||||
for (NsharpOperationElement elm : timeElemList) {
|
||||
if (elm.getActionState() == NsharpConstants.ActState.ACTIVE
|
||||
&& stnTimeSndTable
|
||||
.get(currentStnListIndex)
|
||||
.get(timeElemList
|
||||
.indexOf(elm))
|
||||
.get(currentSndListIndex) != null) {
|
||||
List<NcSoundingLayer> soundingLayeys = stnTimeSndTable
|
||||
.get(currentStnListIndex)
|
||||
.get(timeElemList.indexOf(elm))
|
||||
.get(currentSndListIndex)
|
||||
.getSndLyLst();
|
||||
colorIndex = stnTimeSndTable
|
||||
.get(currentStnListIndex)
|
||||
.get(timeElemList.indexOf(elm))
|
||||
.get(currentSndListIndex)
|
||||
.getCompColorIndex();
|
||||
NsharpLineProperty lp = linePropertyMap
|
||||
.get(NsharpConstants.lineNameArray[colorIndex]);
|
||||
drawNsharpWindBarb(target,
|
||||
currentZoomLevel, world,
|
||||
lp.getLineColor(),
|
||||
soundingLayeys, xPos, 100);
|
||||
}
|
||||
}
|
||||
} else if (compareStnIsOn
|
||||
&& currentTimeListIndex >= 0
|
||||
&& currentSndListIndex >= 0) {
|
||||
int colorIndex;
|
||||
for (NsharpOperationElement elm : stnElemList) {
|
||||
if (elm.getActionState() == NsharpConstants.ActState.ACTIVE
|
||||
&& stnTimeSndTable
|
||||
.get(stnElemList
|
||||
.indexOf(elm))
|
||||
.get(currentTimeListIndex)
|
||||
.get(currentSndListIndex) != null) {
|
||||
List<NcSoundingLayer> soundingLayeys = stnTimeSndTable
|
||||
.get(stnElemList.indexOf(elm))
|
||||
.get(currentTimeListIndex)
|
||||
.get(currentSndListIndex)
|
||||
.getSndLyLst();
|
||||
colorIndex = stnTimeSndTable
|
||||
.get(stnElemList.indexOf(elm))
|
||||
.get(currentTimeListIndex)
|
||||
.get(currentSndListIndex)
|
||||
.getCompColorIndex();
|
||||
NsharpLineProperty lp = linePropertyMap
|
||||
.get(NsharpConstants.lineNameArray[colorIndex]);
|
||||
drawNsharpWindBarb(target,
|
||||
currentZoomLevel, world,
|
||||
lp.getLineColor(),
|
||||
soundingLayeys, xPos, 100);
|
||||
}
|
||||
}
|
||||
} else if (compareSndIsOn
|
||||
&& currentStnListIndex >= 0
|
||||
&& currentTimeListIndex >= 0) {
|
||||
int colorIndex;
|
||||
// start FixMark:nearByStnCompSnd
|
||||
List<NsharpResourceHandler.CompSndSelectedElem> sndCompElementList = rscHandler
|
||||
.getCompSndSelectedElemList();
|
||||
for (NsharpResourceHandler.CompSndSelectedElem compElem : sndCompElementList) {
|
||||
NsharpSoundingElementStateProperty elemProp = stnTimeSndTable
|
||||
.get(compElem.getStnIndex())
|
||||
.get(compElem.getTimeIndex())
|
||||
.get(compElem.getSndIndex());
|
||||
if (sndElemList.get(compElem.getSndIndex())
|
||||
.getActionState() == NsharpConstants.ActState.ACTIVE
|
||||
&& elemProp != null) {
|
||||
List<NcSoundingLayer> soundingLayeys = elemProp
|
||||
.getSndLyLst();
|
||||
colorIndex = elemProp
|
||||
.getCompColorIndex();
|
||||
NsharpLineProperty lp = linePropertyMap
|
||||
.get(NsharpConstants.lineNameArray[colorIndex]);
|
||||
drawNsharpWindBarb(target,
|
||||
currentZoomLevel, world,
|
||||
lp.getLineColor(),
|
||||
soundingLayeys, xPos, 100);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* original code for(NsharpOperationElement elm:
|
||||
* sndElemList) { if(elm.getActionState() ==
|
||||
* NsharpConstants.ActState.ACTIVE &&
|
||||
* stnTimeSndTable.get(currentStnListIndex).get(
|
||||
* currentTimeListIndex
|
||||
* ).get(sndElemList.indexOf(elm))!=null){
|
||||
* List<NcSoundingLayer> soundingLayeys =
|
||||
* stnTimeSndTable.get(currentStnListIndex).get(
|
||||
* currentTimeListIndex
|
||||
* ).get(sndElemList.indexOf(
|
||||
* elm)).getSndLyLst(); colorIndex =
|
||||
* stnTimeSndTable.get(currentStnListIndex).get(
|
||||
* currentTimeListIndex
|
||||
* ).get(sndElemList.indexOf(
|
||||
* elm)).getCompColorIndex(); NsharpLineProperty
|
||||
* lp =
|
||||
* linePropertyMap.get(NsharpConstants.lineNameArray
|
||||
* [colorIndex]); drawNsharpWindBarb(target,
|
||||
* currentZoomLevel, world, lp.getLineColor(),
|
||||
* soundingLayeys, xPos,100); } }
|
||||
*/
|
||||
// end start FixMark:nearByStnCompSnd
|
||||
}
|
||||
}
|
||||
}
|
||||
// System.out.println("x1 pos"+xPos+ " x2 pos="+ (xPos -
|
||||
// NsharpResourceHandler.BARB_LENGTH));
|
||||
}
|
||||
drawHeightMark(target);
|
||||
// draw EL, LFC, LCL, FZL, -20C, -30C lines
|
||||
// drawLclLine(target);
|
||||
target.drawWireframeShape(lclShape,
|
||||
NsharpConstants.color_green, 2, LineStyle.SOLID, font10);
|
||||
target.drawWireframeShape(elShape, NsharpConstants.color_red,
|
||||
2, LineStyle.SOLID, font10);
|
||||
target.drawWireframeShape(lfcShape,
|
||||
NsharpConstants.color_yellow, 2, LineStyle.SOLID,
|
||||
font10);
|
||||
target.drawWireframeShape(fzlShape, NsharpConstants.color_cyan,
|
||||
2, LineStyle.SOLID, font10);
|
||||
drawNsharpFileNameAndSampling(target, currentZoomLevel);
|
||||
// draw cursor data
|
||||
if (cursorInSkewT == true) {
|
||||
if ((curseToggledFontLevel < CURSER_STRING_OFF)
|
||||
&& (cursorTopWindBarb == false || windBarbMagnify == false))
|
||||
drawNsharpSkewtCursorData(target);
|
||||
}
|
||||
}// end of currentGraphMode= NsharpConstants.GRAPH_SKEWT
|
||||
else if (currentGraphMode == NsharpConstants.GRAPH_ICING) {
|
||||
else if (currentGraphMode == NsharpConstants.GRAPH_ICING && rscHandler.isGoodData()) {//#5929
|
||||
paintIcing(currentZoomLevel, target);
|
||||
} else if (currentGraphMode == NsharpConstants.GRAPH_TURB) {
|
||||
} else if (currentGraphMode == NsharpConstants.GRAPH_TURB && rscHandler.isGoodData()) {//#5929
|
||||
paintTurbulence(currentZoomLevel, target);
|
||||
}
|
||||
// drawNsharpFileNameAndSampling(target, currentZoomLevel);
|
||||
|
@ -2682,11 +2706,11 @@ public class NsharpSkewTPaneResource extends NsharpAbstractPaneResource {
|
|||
// Chin 08/04/2014, fixed surface height plotting bug
|
||||
// also fixed to draw height mraker based on AGL (i.e. above surface
|
||||
// level)
|
||||
int sfcIndex = nsharpNative.nsharpLib.sfc();
|
||||
int sfcIndex = 0; ////DR#17084 nnsharpNative.nsharpLib.sfc();
|
||||
int sfcAsl = 0;
|
||||
if (sfcIndex >= 0
|
||||
&& sfcIndex < soundingLys.size()
|
||||
&& soundingLys.get(sfcIndex).getGeoHeight() != NsharpNativeConstants.NSHARP_NATIVE_INVALID_DATA) {
|
||||
if (//DR#17084 sfcIndex >= 0
|
||||
//DR#17084 && sfcIndex < soundingLys.size()
|
||||
soundingLys.get(sfcIndex).getGeoHeight() != NsharpNativeConstants.NSHARP_NATIVE_INVALID_DATA) {
|
||||
double y = world.mapY(NsharpWxMath.getSkewTXY(
|
||||
soundingLys.get(sfcIndex).getPressure(), 0).y);
|
||||
try {
|
||||
|
@ -3505,31 +3529,37 @@ public class NsharpSkewTPaneResource extends NsharpAbstractPaneResource {
|
|||
*/
|
||||
|
||||
public void createRscWireFrameShapes() {
|
||||
// System.out.println("createRscWireFrameShapes called");
|
||||
if (target != null) {
|
||||
disposeRscWireFrameShapes();
|
||||
if (soundingLys != null) {
|
||||
// createRscOmegaShape();
|
||||
// createRscHeightMarkShape();
|
||||
createRscwetBulbTraceShape();
|
||||
createRscPressTempCurveShapeAll(target);
|
||||
createRscVTempTraceShape();
|
||||
createRscParcelRtTraceShapesList(rscHandler.getCurrentParcel(),
|
||||
rscHandler.getCurrentParcelLayerPressure());// real temp
|
||||
// trace
|
||||
createRscParcelTraceShapes(rscHandler.getCurrentParcel(),
|
||||
rscHandler.getCurrentParcelLayerPressure()); // Virtual
|
||||
// Temp
|
||||
// Trace
|
||||
// and
|
||||
// DCAPE
|
||||
// trace
|
||||
createLCLEtcLinesShape();
|
||||
createEffectiveLayerLinesShape();
|
||||
createCloudsShape();
|
||||
updatePsblWatchColor();
|
||||
}
|
||||
}
|
||||
// System.out.println("createRscWireFrameShapes called");
|
||||
if (target != null) {
|
||||
disposeRscWireFrameShapes();
|
||||
if (soundingLys != null){
|
||||
if( rscHandler.isGoodData()) {//#5929
|
||||
|
||||
// createRscOmegaShape();
|
||||
// createRscHeightMarkShape();
|
||||
createRscwetBulbTraceShape();
|
||||
createRscPressTempCurveShapeAll(target);
|
||||
createRscVTempTraceShape();
|
||||
createRscParcelRtTraceShapesList(rscHandler.getCurrentParcel(),
|
||||
rscHandler.getCurrentParcelLayerPressure());// real temp
|
||||
// trace
|
||||
createRscParcelTraceShapes(rscHandler.getCurrentParcel(),
|
||||
rscHandler.getCurrentParcelLayerPressure()); // Virtual
|
||||
// Temp
|
||||
// Trace
|
||||
// and
|
||||
// DCAPE
|
||||
// trace
|
||||
createLCLEtcLinesShape();
|
||||
createEffectiveLayerLinesShape();
|
||||
createCloudsShape();
|
||||
updatePsblWatchColor();
|
||||
}
|
||||
else {//#5929
|
||||
createRscPressTempCurveShapeAll(target);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void disposeRscWireFrameShapes() {
|
||||
|
|
|
@ -15,7 +15,11 @@ package gov.noaa.nws.ncep.ui.nsharp.display.rsc;
|
|||
* 05/23/2014 Chin Chen update SHIP, STP Stats based on bigsharp version 2013Jun12
|
||||
* 08/18/2014 Chin Chen implemented SARS, FIRE, HAIL, WINTER SPC graphs based on
|
||||
* bigsharp version 2013Jun12
|
||||
*
|
||||
* 12/03/2014 DR#16884 Chin Chen fixed issue, NSHARP crashes if user loops a product and
|
||||
* then clicks WINTER/FIRE buttons in Toolbar
|
||||
* 01/27/2015 DR#17006,
|
||||
* Task#5929 Chin Chen NSHARP freezes when loading a sounding from MDCRS products
|
||||
* in Volume Browser
|
||||
* </pre>
|
||||
*
|
||||
* @author Chin Chen
|
||||
|
@ -109,21 +113,11 @@ public class NsharpSpcGraphsPaneResource extends NsharpAbstractPaneResource {
|
|||
private float nonSupercell[] = { 8.2f, 12.2f, 14.4f, 15.8f, 17.0f, 20.0f,
|
||||
23.2f, 27.0f, 30.4f, 32.0f };
|
||||
|
||||
private String hailSize[][] = {
|
||||
{ "", "<1", "1-1.5", "1.75", "2", "2.5", "2.75", "3-4", ">4" },
|
||||
{ "+1 STD", "1.9", "2.0", "2.3", "2.8", "2.9", "3.0", "3.0", "3.0" },
|
||||
{ "AVG", "1.5", "1.5", "1.8", "2.3", "2.5", "2.5", "2.6", "2.7" },
|
||||
{ "-1 STD", "1.1", "1.1", "1.3", "1.7", "2.1", "2.1", "2.2", "2.4" } };
|
||||
|
||||
private RGB white = NsharpConstants.color_white;
|
||||
|
||||
private RGB cyan = NsharpConstants.color_cyan_md;
|
||||
|
||||
private RGB hailSizeColor[][] = {
|
||||
{ white, white, white, white, white, white, white, white, white },
|
||||
{ white, cyan, cyan, cyan, cyan, cyan, cyan, cyan, cyan },
|
||||
{ white, cyan, cyan, cyan, cyan, cyan, cyan, cyan, cyan },
|
||||
{ white, cyan, cyan, cyan, cyan, cyan, cyan, cyan, cyan } };
|
||||
|
||||
private NsharpNative.NsharpLibrary.HailInfoStr hailInfo = new NsharpNative.NsharpLibrary.HailInfoStr();
|
||||
|
||||
|
@ -133,6 +127,18 @@ public class NsharpSpcGraphsPaneResource extends NsharpAbstractPaneResource {
|
|||
|
||||
private NsharpNative.NsharpLibrary.WinterInfoStr winterInfo = new NsharpNative.NsharpLibrary.WinterInfoStr();
|
||||
|
||||
private String hailSize[][] = {
|
||||
{ "", "<1", "1-1.5", "1.75", "2", "2.5", "2.75", "3-4", ">4" },
|
||||
{ "+1 STD", "1.9", "2.0", "2.3", "2.8", "2.9", "3.0", "3.0", "3.0" },
|
||||
{ "AVG", "1.5", "1.5", "1.8", "2.3", "2.5", "2.5", "2.6", "2.7" },
|
||||
{ "-1 STD", "1.1", "1.1", "1.3", "1.7", "2.1", "2.1", "2.2", "2.4" } };
|
||||
|
||||
private RGB hailSizeColor[][] = {
|
||||
{ white, white, white, white, white, white, white, white, white },
|
||||
{ white, cyan, cyan, cyan, cyan, cyan, cyan, cyan, cyan },
|
||||
{ white, cyan, cyan, cyan, cyan, cyan, cyan, cyan, cyan },
|
||||
{ white, cyan, cyan, cyan, cyan, cyan, cyan, cyan, cyan } };
|
||||
|
||||
public NsharpSpcGraphsPaneResource(AbstractResourceData resourceData,
|
||||
LoadProperties loadProperties, NsharpAbstractPaneDescriptor desc) {
|
||||
super(resourceData, loadProperties, desc);
|
||||
|
@ -140,21 +146,6 @@ public class NsharpSpcGraphsPaneResource extends NsharpAbstractPaneResource {
|
|||
rightGraph = NsharpPaletteWindow.getRightGraph();
|
||||
}
|
||||
|
||||
private void underDevelopment(int side) throws VizException {
|
||||
double xpos;
|
||||
if (side == left)
|
||||
xpos = spcLeftXOrig + spcFrameWidth / 2;
|
||||
else
|
||||
xpos = spcRightXOrig + spcFrameWidth / 2;
|
||||
DrawableString str = new DrawableString("under development",
|
||||
NsharpConstants.color_green);
|
||||
str.font = font12;
|
||||
str.horizontalAlignment = HorizontalAlignment.LEFT;
|
||||
str.verticallAlignment = VerticalAlignment.TOP;
|
||||
ypos = spcYOrig + spcHeight / 2;
|
||||
str.setCoordinates(xpos, ypos);
|
||||
target.drawStrings(str);
|
||||
}
|
||||
|
||||
private void setXyStartingPosition(int side) {
|
||||
ystart = spcYOrig;
|
||||
|
@ -298,35 +289,6 @@ public class NsharpSpcGraphsPaneResource extends NsharpAbstractPaneResource {
|
|||
// System.out.println("java hail str #"+ (i+1)+ " "+ hailStr);
|
||||
|
||||
}
|
||||
/*
|
||||
* ypos = spcYEnd - 4 * charHeight; for(int i=0; i < 2; i++){ String
|
||||
* supStr = new String(sarsInfo.getTorStr(), (i*60), 60);
|
||||
* //System.out.println("tor str #"+ (1+ i)+ " "+ supStr); RGB strColor
|
||||
* = NsharpConstants.gempakColorToRGB.get(sarsInfo.getTorStrColor());
|
||||
* supStr = supStr.substring(0, supStr.indexOf('\0'));// get rid of
|
||||
* tailing null char(s), as DrawableString will print them out
|
||||
* DrawableString supercellMatchStr = new DrawableString(supStr,
|
||||
* strColor); supercellMatchStr.font = font10;
|
||||
* supercellMatchStr.horizontalAlignment = HorizontalAlignment.LEFT;
|
||||
* supercellMatchStr.verticallAlignment = VerticalAlignment.TOP; xpos =
|
||||
* xstart ; ypos = ypos + charHeight;
|
||||
* supercellMatchStr.setCoordinates(xpos, ypos);
|
||||
* strList.add(supercellMatchStr);
|
||||
*
|
||||
* String sighailStr = new String(sarsInfo.getSighailStr(), (i*60), 60);
|
||||
* //System.out.println("sighail str #"+ (1+ i)+ " "+ sighailStr); RGB
|
||||
* strColor1 =
|
||||
* NsharpConstants.gempakColorToRGB.get(sarsInfo.getSighailStrColor());
|
||||
* sighailStr = sighailStr.substring(0, sighailStr.indexOf('\0'));// get
|
||||
* rid of tailing null char(s), as DrawableString will print them out
|
||||
* DrawableString sighailMatchStr = new DrawableString(sighailStr,
|
||||
* strColor1); sighailMatchStr.font = font10;
|
||||
* sighailMatchStr.horizontalAlignment = HorizontalAlignment.LEFT;
|
||||
* sighailMatchStr.verticallAlignment = VerticalAlignment.TOP; xpos =
|
||||
* xstart + 0.51 *spcFrameWidth; sighailMatchStr.setCoordinates(xpos,
|
||||
* ypos); strList.add(sighailMatchStr); }
|
||||
*/
|
||||
|
||||
target.drawStrings(strList.toArray(new DrawableString[strList.size()]));
|
||||
target.drawLine(lineList.toArray(new DrawableLine[lineList.size()]));
|
||||
}
|
||||
|
@ -1621,13 +1583,15 @@ public class NsharpSpcGraphsPaneResource extends NsharpAbstractPaneResource {
|
|||
// logic statements for Thompson et al. (2012) WAF sample
|
||||
// 39 sigtor, 28 non-sigtor supercells
|
||||
if (cin >= 10) {
|
||||
// setcolor(7)
|
||||
psigt_stpcin = "0.58";
|
||||
stpcColor = NsharpConstants.color_magenta;// setcolor(7);
|
||||
stpcColor = NsharpConstants.color_magenta;;
|
||||
}
|
||||
// 39 sigtor, 32 non-sigtor supercells
|
||||
else if (cin >= 8) {
|
||||
// setcolor(7)
|
||||
psigt_stpcin = "0.55";
|
||||
stpcColor = NsharpConstants.color_magenta;// setcolor(7);
|
||||
stpcColor = NsharpConstants.color_magenta;
|
||||
}
|
||||
// 54 sigtor, 104 non-sigtor supercells
|
||||
else if (cin >= 6) {
|
||||
|
@ -1745,17 +1709,6 @@ public class NsharpSpcGraphsPaneResource extends NsharpAbstractPaneResource {
|
|||
valueStp.verticallAlignment = VerticalAlignment.TOP;
|
||||
valueStp.setCoordinates(tboxValueStart, ypos);
|
||||
strList.add(valueStp);
|
||||
|
||||
// reset parcel to previous "oldlplchoice" , TBD
|
||||
/*
|
||||
* float pres; if(oldlplchoice ==
|
||||
* NsharpNativeConstants.PARCELTYPE_USER_DEFINED){
|
||||
* if(NsharpParcelDialog.getAccess() != null){ pres =
|
||||
* NsharpParcelDialog.getAccess().getUserDefdParcelMb(); } else pres =
|
||||
* NsharpNativeConstants.parcelToLayerMap.get(oldlplchoice); } else pres
|
||||
* = NsharpNativeConstants.parcelToLayerMap.get(oldlplchoice);
|
||||
* nsharpNative.nsharpLib.define_parcel(oldlplchoice,pres);
|
||||
*/
|
||||
target.drawStrings(strList.toArray(new DrawableString[strList.size()]));
|
||||
target.drawLine(lineList.toArray(new DrawableLine[lineList.size()]));
|
||||
|
||||
|
@ -1876,7 +1829,7 @@ public class NsharpSpcGraphsPaneResource extends NsharpAbstractPaneResource {
|
|||
|
||||
short oldlplchoice;
|
||||
_parcel pcl = new _parcel();
|
||||
;
|
||||
|
||||
_lplvalues lpvls = new _lplvalues();
|
||||
nsharpNative.nsharpLib.get_lpvaluesData(lpvls);
|
||||
// oldlplchoice = lpvls.flag;
|
||||
|
@ -1931,12 +1884,6 @@ public class NsharpSpcGraphsPaneResource extends NsharpAbstractPaneResource {
|
|||
lineList.add(ebsline);
|
||||
}
|
||||
float pres;
|
||||
/*
|
||||
* if(oldlplchoice == NsharpNativeConstants.PARCELTYPE_USER_DEFINED){
|
||||
* if(NsharpParcelDialog.getAccess() != null){ pres =
|
||||
* NsharpParcelDialog.getAccess().getUserDefdParcelMb(); } else pres =
|
||||
* NsharpNativeConstants.parcelToLayerMap.get(oldlplchoice); } else
|
||||
*/
|
||||
oldlplchoice = rscHandler.getCurrentParcel();
|
||||
pres = NsharpNativeConstants.parcelToLayerMap.get(oldlplchoice);
|
||||
nsharpNative.nsharpLib.define_parcel(oldlplchoice, pres);
|
||||
|
@ -1951,27 +1898,24 @@ public class NsharpSpcGraphsPaneResource extends NsharpAbstractPaneResource {
|
|||
PaintProperties paintProps) throws VizException {
|
||||
super.paintInternal(target, paintProps);
|
||||
// defineCharHeight(font10);
|
||||
if (rscHandler == null || rscHandler.getSoundingLys() == null)
|
||||
if (rscHandler == null || rscHandler.getSoundingLys() == null || !rscHandler.isGoodData())//#5929
|
||||
return;
|
||||
this.font10.setSmoothing(false);
|
||||
this.font10.setScaleFont(false);
|
||||
hRatio = paintProps.getView().getExtent().getWidth()
|
||||
/ paintProps.getCanvasBounds().width;
|
||||
DrawableLine line = new DrawableLine();
|
||||
line.setCoordinates(spcRightXOrig, spcYOrig);
|
||||
line.addPoint(spcRightXOrig, spcYOrig + spcHeight);
|
||||
line.lineStyle = LineStyle.SOLID;
|
||||
line.basics.color = NsharpConstants.color_white;
|
||||
line.width = 1;
|
||||
line.setCoordinates(spcRightXOrig, spcYOrig);
|
||||
line.addPoint(spcRightXOrig, spcYOrig + spcHeight);
|
||||
target.drawLine(line);
|
||||
PixelExtent spcExt = new PixelExtent(new Rectangle((int) spcLeftXOrig,
|
||||
(int) spcYOrig, (int) spcWidth, (int) spcHeight));
|
||||
target.drawRect(spcExt, NsharpConstants.color_white, 1f, 1f); // box
|
||||
// border
|
||||
// line
|
||||
PixelExtent extent = new PixelExtent(new Rectangle((int) spcLeftXOrig,
|
||||
(int) spcYOrig, (int) spcFrameWidth, (int) spcHeight));
|
||||
// target.setupClippingPlane(extent);
|
||||
switch (leftGraph) {
|
||||
case EBS:
|
||||
plotEBS(left);
|
||||
|
@ -1995,10 +1939,6 @@ public class NsharpSpcGraphsPaneResource extends NsharpAbstractPaneResource {
|
|||
plotSars(left);
|
||||
break;
|
||||
}
|
||||
// target.clearClippingPlane();
|
||||
extent = new PixelExtent(new Rectangle((int) spcRightXOrig,
|
||||
(int) spcYOrig, (int) spcFrameWidth, (int) spcHeight));
|
||||
// target.setupClippingPlane(extent);
|
||||
switch (rightGraph) {
|
||||
case EBS:
|
||||
plotEBS(right);
|
||||
|
@ -2022,7 +1962,7 @@ public class NsharpSpcGraphsPaneResource extends NsharpAbstractPaneResource {
|
|||
plotSars(right);
|
||||
break;
|
||||
}
|
||||
// target.clearClippingPlane();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -2030,19 +1970,46 @@ public class NsharpSpcGraphsPaneResource extends NsharpAbstractPaneResource {
|
|||
super.initInternal(target);
|
||||
}
|
||||
|
||||
/*
|
||||
* private void disposeEbsShape(){ if(ebsBkgLblShape != null)
|
||||
* ebsBkgLblShape.dispose(); if(ebsBkgLineShape != null)
|
||||
* ebsBkgLineShape.dispose(); if(ebsSupercellShape != null)
|
||||
* ebsSupercellShape.dispose(); if(ebsMrglSupShape != null)
|
||||
* ebsMrglSupShape.dispose(); if(ebsNonSupSgape != null)
|
||||
* ebsNonSupSgape.dispose(); }
|
||||
*/
|
||||
@Override
|
||||
protected void disposeInternal() {
|
||||
super.disposeInternal();
|
||||
}
|
||||
|
||||
|
||||
public NsharpConstants.SPCGraph getLeftGraph() {
|
||||
return leftGraph;
|
||||
}
|
||||
|
||||
public void setGraphs(NsharpConstants.SPCGraph leftGraph,
|
||||
NsharpConstants.SPCGraph rightGraph) {
|
||||
this.leftGraph = leftGraph;
|
||||
this.rightGraph = rightGraph;
|
||||
getSpcGraphsInfo();
|
||||
rscHandler.refreshPane();
|
||||
}
|
||||
|
||||
public NsharpConstants.SPCGraph getRightGraph() {
|
||||
return rightGraph;
|
||||
}
|
||||
|
||||
public synchronized void getSpcGraphsInfo() {
|
||||
if (rightGraph == NsharpConstants.SPCGraph.SARS
|
||||
|| leftGraph == NsharpConstants.SPCGraph.SARS) {
|
||||
nsharpNative.nsharpLib.getSarsInfo(sarsInfo);
|
||||
}
|
||||
if (leftGraph == NsharpConstants.SPCGraph.WINTER
|
||||
|| rightGraph == NsharpConstants.SPCGraph.WINTER) {
|
||||
nsharpNative.nsharpLib.getWinterInfo(winterInfo);
|
||||
}
|
||||
if (rightGraph == NsharpConstants.SPCGraph.FIRE
|
||||
|| leftGraph == NsharpConstants.SPCGraph.FIRE) {
|
||||
nsharpNative.nsharpLib.getFireInfo(fireInfo);
|
||||
}
|
||||
if (leftGraph == NsharpConstants.SPCGraph.HAIL
|
||||
|| rightGraph == NsharpConstants.SPCGraph.HAIL) {
|
||||
nsharpNative.nsharpLib.getHailInfo(hailInfo);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void handleResize() {
|
||||
|
||||
|
@ -2064,38 +2031,4 @@ public class NsharpSpcGraphsPaneResource extends NsharpAbstractPaneResource {
|
|||
spcYEnd = ext.getMaxY();
|
||||
}
|
||||
|
||||
public NsharpConstants.SPCGraph getLeftGraph() {
|
||||
return leftGraph;
|
||||
}
|
||||
|
||||
public void setGraphs(NsharpConstants.SPCGraph leftGraph,
|
||||
NsharpConstants.SPCGraph rightGraph) {
|
||||
this.leftGraph = leftGraph;
|
||||
this.rightGraph = rightGraph;
|
||||
getSpcGraphsInfo();
|
||||
rscHandler.refreshPane();
|
||||
}
|
||||
|
||||
public NsharpConstants.SPCGraph getRightGraph() {
|
||||
return rightGraph;
|
||||
}
|
||||
|
||||
public void getSpcGraphsInfo() {
|
||||
if (leftGraph == NsharpConstants.SPCGraph.WINTER
|
||||
|| rightGraph == NsharpConstants.SPCGraph.WINTER) {
|
||||
nsharpNative.nsharpLib.getWinterInfo(winterInfo);
|
||||
}
|
||||
if (leftGraph == NsharpConstants.SPCGraph.FIRE
|
||||
|| rightGraph == NsharpConstants.SPCGraph.FIRE) {
|
||||
nsharpNative.nsharpLib.getFireInfo(fireInfo);
|
||||
}
|
||||
if (leftGraph == NsharpConstants.SPCGraph.HAIL
|
||||
|| rightGraph == NsharpConstants.SPCGraph.HAIL) {
|
||||
nsharpNative.nsharpLib.getHailInfo(hailInfo);
|
||||
}
|
||||
if (leftGraph == NsharpConstants.SPCGraph.SARS
|
||||
|| rightGraph == NsharpConstants.SPCGraph.SARS) {
|
||||
nsharpNative.nsharpLib.getSarsInfo(sarsInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ package gov.noaa.nws.ncep.ui.nsharp.display.rsc;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------- ------- -------- -----------
|
||||
* 04/23/2012 229 Chin Chen Initial coding
|
||||
* 02/03/2015 DR#17079 Chin Chen Soundings listed out of order if frames go into new month
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -244,6 +245,32 @@ public class NsharpTimeStnPaneResource extends NsharpAbstractPaneResource {
|
|||
target.clearClippingPlane();
|
||||
|
||||
}
|
||||
/*
|
||||
* Chin 02032015 - DR17079
|
||||
* currently time line description is YYMMDD/HHVxxx(day) or
|
||||
* YYMMDD/HH(day) saved in NsharpSoundingElementStateProperty
|
||||
* convert it to DD.HH for displaying
|
||||
*/
|
||||
private String convertTimeLineForDisplay(String tl){
|
||||
String timeLine = tl;
|
||||
timeLine = timeLine.substring(4); // get rid of YYMM
|
||||
if (timeLine.contains("V")) {
|
||||
String[] s1Str = timeLine.split("V"); // split
|
||||
// DD/HH(DOW)Vxxx to
|
||||
// "DD/HH(DOW)" and
|
||||
// "xxx"
|
||||
String[] s2Str = s1Str[0].split("\\("); // split
|
||||
// "DD/HH(DOW)" to
|
||||
// "DD/HH" and
|
||||
// "DOW)"
|
||||
timeLine = s2Str[0] + "V" + s1Str[1] + "(" + s2Str[1]; // put
|
||||
// together
|
||||
// to
|
||||
// "DD/HHVxxx(DOW)"
|
||||
}
|
||||
timeLine = timeLine.replace("/", "."); // replace "/" with "."
|
||||
return timeLine;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void drawNsharpTimelinBox(IGraphicsTarget target, Rectangle rect)
|
||||
|
@ -344,8 +371,8 @@ public class NsharpTimeStnPaneResource extends NsharpAbstractPaneResource {
|
|||
x = x + xGap;
|
||||
RGB tmLnColor = rscHandler.getElementColorMap().get(sta.name());
|
||||
String tmDesStr = elm.getElementDescription();
|
||||
// d2dlite - convert timeDesStr for GUI display
|
||||
|
||||
// DR17079: convert timeDesStr for GUI display
|
||||
tmDesStr = convertTimeLineForDisplay(tmDesStr);
|
||||
double tmX = x;
|
||||
|
||||
if (compareTmIsOn
|
||||
|
|
|
@ -10,6 +10,9 @@ package gov.noaa.nws.ncep.ui.nsharp.display.rsc;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------- ------- -------- -----------
|
||||
* 04/23/2012 229 Chin Chen Initial coding
|
||||
* 01/27/2015 DR#17006,
|
||||
* Task#5929 Chin Chen NSHARP freezes when loading a sounding from MDCRS products
|
||||
* in Volume Browser
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -159,11 +162,14 @@ public class NsharpWitoPaneResource extends NsharpAbstractPaneResource{
|
|||
float x1 = verticalWindXOrig+ (verticalWindWidth/2);
|
||||
target.drawLine(x1, verticalWindYOrig, 0, x1, verticalWindYOrig+verticalWindHeight, 0,
|
||||
NsharpConstants.color_white, 1, LineStyle.DASHED);
|
||||
target.drawWireframeShape(verticalWindLabelShape, NsharpConstants.color_white,
|
||||
if(verticalWindLabelShape!=null) //#5929
|
||||
target.drawWireframeShape(verticalWindLabelShape, NsharpConstants.color_white,
|
||||
0.3F, commonLineStyle,font10);
|
||||
target.drawWireframeShape(verticalWindRShape, NsharpConstants.color_red,
|
||||
if(verticalWindRShape!=null)
|
||||
target.drawWireframeShape(verticalWindRShape, NsharpConstants.color_red,
|
||||
0.3F, commonLineStyle,font10);
|
||||
target.drawWireframeShape(verticalWindSbShape, NsharpConstants.color_skyblue,
|
||||
if(verticalWindSbShape!=null)
|
||||
target.drawWireframeShape(verticalWindSbShape, NsharpConstants.color_skyblue,
|
||||
0.3F, commonLineStyle,font10);
|
||||
target.clearClippingPlane();
|
||||
}
|
||||
|
@ -304,7 +310,7 @@ public class NsharpWitoPaneResource extends NsharpAbstractPaneResource{
|
|||
windBoxWindRscShapeList.add(shNcolor);
|
||||
|
||||
|
||||
|
||||
float surfaceLevel = soundingLys.get(0).getGeoHeight(); //#5929
|
||||
//System.out.println("my wolrd minvY="+ myYViewMin+ " maxVY="+myYViewMax+ " YRange="+myYViewRange);
|
||||
for (NcSoundingLayer layer : soundingLys) {
|
||||
float pressure = layer.getPressure();
|
||||
|
@ -321,13 +327,14 @@ public class NsharpWitoPaneResource extends NsharpAbstractPaneResource{
|
|||
//System.out.println("Wind p="+pressure+" yP="+ windBoxY+ " ratio="+yRatio);
|
||||
float geoHt = layer.getGeoHeight();
|
||||
double [][] lines = {{windBoxX, windBoxY},{windBoxX + (spd) * xRatio,windBoxY}};
|
||||
if(geoHt <nsharpNative.nsharpLib.msl(3000))
|
||||
//use MSL here, so Converts height from (meters) AGL to MSL. #5929
|
||||
if(geoHt < (3000+surfaceLevel))
|
||||
shapeR.addLineSegment(lines);
|
||||
else if(geoHt < nsharpNative.nsharpLib.msl(6000))
|
||||
else if(geoHt < (6000+surfaceLevel))
|
||||
shapeG.addLineSegment(lines);
|
||||
else if(geoHt < nsharpNative.nsharpLib.msl(9000))
|
||||
else if(geoHt < (9000+surfaceLevel))
|
||||
shapeY.addLineSegment(lines);
|
||||
else if(geoHt < nsharpNative.nsharpLib.msl(12000))
|
||||
else if(geoHt < (12000+surfaceLevel))
|
||||
shapeC.addLineSegment(lines);
|
||||
else
|
||||
shapeV.addLineSegment(lines);
|
||||
|
@ -437,7 +444,6 @@ public class NsharpWitoPaneResource extends NsharpAbstractPaneResource{
|
|||
verticalWindLabelShape.compile();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Create all wire frame shapes at one place.
|
||||
* Should be used only when a new resource is becoming Current active resource to be displayed.
|
||||
|
@ -447,23 +453,24 @@ public class NsharpWitoPaneResource extends NsharpAbstractPaneResource{
|
|||
if(target== null || rscHandler== null || inSidePane )
|
||||
return;
|
||||
//System.out.println("whitoPane="+this.toString()+" createAllWireFrameShapes called");
|
||||
rscHandler.repopulateSndgData();
|
||||
|
||||
disposeAllWireFrameShapes();
|
||||
if(soundingLys != null){
|
||||
NsharpGenericPaneBackground skewtBgd = rscHandler.getSkewtPaneRsc().getActiveBackground();
|
||||
if(skewtBgd!=null){
|
||||
vpc = skewtBgd.getViewablePressureContainer(soundingLys);
|
||||
vplc = skewtBgd.getViewablePressureLinesContainer();
|
||||
}
|
||||
createRscOmegaShape();
|
||||
createRscWindBoxWindShape();
|
||||
createRscVerticalWindShape();
|
||||
//rscHandler.repopulateSndgData();//#5929 TBD why need this?????
|
||||
|
||||
disposeAllWireFrameShapes();
|
||||
if(soundingLys != null){
|
||||
NsharpGenericPaneBackground skewtBgd = rscHandler.getSkewtPaneRsc().getActiveBackground();
|
||||
if(skewtBgd!=null){
|
||||
vpc = skewtBgd.getViewablePressureContainer(soundingLys);
|
||||
vplc = skewtBgd.getViewablePressureLinesContainer();
|
||||
}
|
||||
//create static shape
|
||||
createBkgOmegaShape();
|
||||
createBkgWindBoxShape();
|
||||
|
||||
createRscOmegaShape();
|
||||
createRscWindBoxWindShape();
|
||||
if(rscHandler.isGoodData())//#5929
|
||||
createRscVerticalWindShape();
|
||||
}
|
||||
//create static shape
|
||||
createBkgOmegaShape();
|
||||
createBkgWindBoxShape();
|
||||
|
||||
}
|
||||
public void createRscWireFrameShapes(){
|
||||
//System.out.println("createRscWireFrameShapes called");
|
||||
|
@ -477,7 +484,8 @@ public class NsharpWitoPaneResource extends NsharpAbstractPaneResource{
|
|||
}
|
||||
createRscOmegaShape();
|
||||
createRscWindBoxWindShape();
|
||||
createRscVerticalWindShape();
|
||||
if(rscHandler.isGoodData())//#5929
|
||||
createRscVerticalWindShape();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -790,12 +790,12 @@ public class NsharpNative {
|
|||
|
||||
@Override
|
||||
protected List getFieldOrder() {
|
||||
return Arrays.asList(new String[] { "oprh", "layerDepth",
|
||||
"meanLayerRh", "meanLayerMixRat", "meanLayerPw",
|
||||
"meanLayerOmega", "initPhase", "tempProfile1",
|
||||
"tempProfile2", "tempProfile3", "wetbulbProfile1",
|
||||
"wetbulbProfile2", "wetbulbProfile3", "bestGuess1",
|
||||
"bestGuess2" });
|
||||
return Arrays.asList(new String[] { "mopw", "oprh",
|
||||
"layerDepth", "meanLayerRh", "meanLayerMixRat",
|
||||
"meanLayerPw", "meanLayerOmega", "initPhase",
|
||||
"tempProfile1", "tempProfile2", "tempProfile3",
|
||||
"wetbulbProfile1", "wetbulbProfile2",
|
||||
"wetbulbProfile3", "bestGuess1", "bestGuess2" });
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
* 01/13/2014 Chin Chen TTR829- when interpolation, edit graph is allowed
|
||||
* 01/22/2014 Chin Chen DR17003 issue: NSHARP sounding display throws errors when swapping into main pane when show text is turned on.
|
||||
* 10/20/2014 Chin Chen DR16864, D2D does not use unload button. Check to make sure not D2D instance before access unload button.
|
||||
* 02/04/2015 DR16888 Chin Chen do not allow swap between Skewt and hodo when comparison is on, check in with DR17079
|
||||
* </pre>
|
||||
*
|
||||
* @author Chin Chen
|
||||
|
@ -185,10 +186,13 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
|||
graphModeBtnSkew.setEnabled(true);
|
||||
graphModeBtnIcing.setEnabled(true);
|
||||
graphModeBtnTurb.setEnabled(true);
|
||||
if(graphModeBtnHodo!=null)
|
||||
graphModeBtnHodo.setEnabled(true);
|
||||
if (currentGraphMode == NsharpConstants.GRAPH_SKEWT) {
|
||||
graphModeBtnSkew.setBackground(colorBlue);
|
||||
graphModeBtnTurb.setBackground(colorGrey);
|
||||
graphModeBtnIcing.setBackground(colorGrey);
|
||||
if(graphModeBtnHodo!=null) graphModeBtnHodo.setBackground(colorGrey);
|
||||
graphEditBtn.setEnabled(true);
|
||||
dataEditBtn.setEnabled(true);
|
||||
compareTmBtn.setEnabled(true);
|
||||
|
@ -219,6 +223,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
|||
compareStnBtn.setEnabled(false);
|
||||
interpBtn.setEnabled(false);
|
||||
graphModeBtnIcing.setEnabled(false);
|
||||
if(graphModeBtnHodo!=null) graphModeBtnHodo.setEnabled(false);
|
||||
graphModeBtnTurb.setEnabled(false);
|
||||
if (!imD2d)
|
||||
unloadBtn.setEnabled(false); // FixMark:nearByStnCompSnd
|
||||
|
@ -232,6 +237,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
|||
interpBtn.setEnabled(false);
|
||||
graphModeBtnIcing.setEnabled(false);
|
||||
graphModeBtnTurb.setEnabled(false);
|
||||
if(graphModeBtnHodo!=null) graphModeBtnHodo.setEnabled(false);
|
||||
if (!imD2d)
|
||||
unloadBtn.setEnabled(false); // FixMark:nearByStnCompSnd
|
||||
} else if (compareSndIsOn) {
|
||||
|
@ -243,6 +249,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
|||
overlayBtn.setEnabled(false);
|
||||
interpBtn.setEnabled(false);
|
||||
graphModeBtnIcing.setEnabled(false);
|
||||
if(graphModeBtnHodo!=null) graphModeBtnHodo.setEnabled(false);
|
||||
graphModeBtnTurb.setEnabled(false);
|
||||
if (!imD2d)
|
||||
unloadBtn.setEnabled(false); // FixMark:nearByStnCompSnd
|
||||
|
@ -255,6 +262,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
|||
overlayBtn.setEnabled(false);
|
||||
interpBtn.setEnabled(false);
|
||||
graphModeBtnIcing.setEnabled(false);
|
||||
if(graphModeBtnHodo!=null) graphModeBtnHodo.setEnabled(false);
|
||||
graphModeBtnTurb.setEnabled(false);
|
||||
if (!imD2d)
|
||||
unloadBtn.setEnabled(false); // FixMark:nearByStnCompSnd
|
||||
|
@ -268,6 +276,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
|||
interpBtn.setEnabled(false);
|
||||
graphModeBtnIcing.setEnabled(false);
|
||||
graphModeBtnTurb.setEnabled(false);
|
||||
if(graphModeBtnHodo!=null) graphModeBtnHodo.setEnabled(false);
|
||||
if (!imD2d)
|
||||
unloadBtn.setEnabled(false); // FixMark:nearByStnCompSnd
|
||||
}
|
||||
|
@ -707,6 +716,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
|||
dataEditBtn.setEnabled(true);
|
||||
graphModeBtnIcing.setEnabled(true);
|
||||
graphModeBtnTurb.setEnabled(true);
|
||||
if(graphModeBtnHodo!=null) graphModeBtnHodo.setEnabled(true);
|
||||
graphEditBtn.setText(EDIT_GRAPH_OFF);
|
||||
currentGraphMode = NsharpConstants.GRAPH_SKEWT;
|
||||
NsharpEditor editor = NsharpEditor.getActiveNsharpEditor();
|
||||
|
@ -948,6 +958,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
|||
dataEditBtn.setEnabled(false);
|
||||
graphModeBtnTurb.setEnabled(false);
|
||||
graphModeBtnIcing.setEnabled(false);
|
||||
if(graphModeBtnHodo!=null) graphModeBtnHodo.setEnabled(false);
|
||||
interpBtn.setEnabled(false);
|
||||
cfgBtn.setEnabled(false);
|
||||
if (!imD2d)
|
||||
|
@ -962,6 +973,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
|||
dataEditBtn.setEnabled(true);
|
||||
graphModeBtnTurb.setEnabled(true);
|
||||
graphModeBtnIcing.setEnabled(true);
|
||||
if(graphModeBtnHodo!=null) graphModeBtnHodo.setEnabled(true);
|
||||
interpBtn.setEnabled(true);
|
||||
cfgBtn.setEnabled(true);
|
||||
if (!imD2d)
|
||||
|
@ -1006,6 +1018,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
|||
dataEditBtn.setEnabled(false);
|
||||
graphModeBtnTurb.setEnabled(false);
|
||||
graphModeBtnIcing.setEnabled(false);
|
||||
if(graphModeBtnHodo!=null)graphModeBtnHodo.setEnabled(false);
|
||||
interpBtn.setEnabled(false);
|
||||
cfgBtn.setEnabled(false);
|
||||
if (!imD2d)
|
||||
|
@ -1020,6 +1033,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
|||
dataEditBtn.setEnabled(true);
|
||||
graphModeBtnTurb.setEnabled(true);
|
||||
graphModeBtnIcing.setEnabled(true);
|
||||
if(graphModeBtnHodo!=null)graphModeBtnHodo.setEnabled(true);
|
||||
interpBtn.setEnabled(true);
|
||||
cfgBtn.setEnabled(true);
|
||||
if (!imD2d)
|
||||
|
@ -1066,6 +1080,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
|||
dataEditBtn.setEnabled(false);
|
||||
graphModeBtnTurb.setEnabled(false);
|
||||
graphModeBtnIcing.setEnabled(false);
|
||||
if(graphModeBtnHodo!=null)graphModeBtnHodo.setEnabled(false);
|
||||
interpBtn.setEnabled(false);
|
||||
cfgBtn.setEnabled(false);
|
||||
if (!imD2d)
|
||||
|
@ -1080,6 +1095,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
|||
dataEditBtn.setEnabled(true);
|
||||
graphModeBtnTurb.setEnabled(true);
|
||||
graphModeBtnIcing.setEnabled(true);
|
||||
if(graphModeBtnHodo!=null)graphModeBtnHodo.setEnabled(true);
|
||||
interpBtn.setEnabled(true);
|
||||
cfgBtn.setEnabled(true);
|
||||
if (!imD2d)
|
||||
|
@ -1124,6 +1140,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
|||
dataEditBtn.setEnabled(false);
|
||||
graphModeBtnTurb.setEnabled(false);
|
||||
graphModeBtnIcing.setEnabled(false);
|
||||
if(graphModeBtnHodo!=null)graphModeBtnHodo.setEnabled(false);
|
||||
interpBtn.setEnabled(false);
|
||||
cfgBtn.setEnabled(false);
|
||||
if (!imD2d)
|
||||
|
@ -1138,6 +1155,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
|||
dataEditBtn.setEnabled(true);
|
||||
graphModeBtnTurb.setEnabled(true);
|
||||
graphModeBtnIcing.setEnabled(true);
|
||||
if(graphModeBtnHodo!=null)graphModeBtnHodo.setEnabled(true);
|
||||
interpBtn.setEnabled(true);
|
||||
cfgBtn.setEnabled(true);
|
||||
if (!imD2d)
|
||||
|
@ -1603,6 +1621,7 @@ public class NsharpPaletteWindow extends ViewPart implements SelectionListener,
|
|||
} else {
|
||||
hailBtn.setEnabled(false);
|
||||
}
|
||||
hailBtn.setEnabled(false); //Chin ::: temporarily disable HAIL button
|
||||
hailBtn.addListener(SWT.MouseUp, new Listener() {
|
||||
public void handleEvent(Event event) {
|
||||
if (leftGraph != NsharpConstants.SPCGraph.HAIL
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
Name: awips2-java
|
||||
Summary: AWIPS II Java Distribution
|
||||
Version: %{_java_version}
|
||||
Release: 2
|
||||
Release: 3
|
||||
Group: AWIPSII
|
||||
BuildRoot: %{_build_root}
|
||||
BuildArch: %{_build_arch}
|
||||
|
@ -177,7 +177,7 @@ rm -f %{_build_root}/awips2/java/bin/jmc
|
|||
# The licenses
|
||||
mkdir -p %{_build_root}/awips2/java/licenses
|
||||
LEGAL_DIR="%{_baseline_workspace}/rpms/legal"
|
||||
cp -v ${LEGAL_DIR}/*.txt ${LEGAL_DIR}/*.pdf \
|
||||
cp -v ${LEGAL_DIR}/*.pdf \
|
||||
%{_build_root}/awips2/java/licenses
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#20130624 1966 rferrel The acars pattern changed to place files in the proper subdirectories.
|
||||
# Name changes to reflect plugin names for modelsounding, goessounding, poessounding.
|
||||
#20140424 3068 dgilling Add pattern for MetOp-B ASCAT T winds.
|
||||
#20150202 4066 rferrel Add pattern form Earth Networks Total Lightning: SFPA42
|
||||
#***************************************************************
|
||||
# AWIPS 1 PATTERN GRAPHIC ^[PQ].* /redbook/Raw
|
||||
# PGNA00 KWNS 010001 !redbook 1_1/NMCGPHMCD/MCDSUM/PXSF001CN/20110201 0001
|
||||
|
@ -384,6 +385,11 @@ HDS ^(IUS(Z[0-9]|Y4)[0-9]) ([A-Z]{4}) (..)(..)(..)
|
|||
HDS ^(SF(US|PA)41) ([A-Z]{4}) (..)(..)(..)
|
||||
FILE -overwrite -log -edex -close /data_store/binlightning/(\4:yyyy)(\4:mm)\4/\5/\1_\3_\4\5\6_(seq).nldn.%Y%m%d%H
|
||||
|
||||
# WMO Heading for Earth Networks Total Lightning
|
||||
|
||||
HDS ^(SF(US|PA)42) ([A-Z]{4}) (..)(..)(..)
|
||||
FILE -overwrite -log -edex -close /data_store/entlightning/(\4:yyyy)(\4:mm)\4/\5/\1_\3_\4\5\6_(seq).nldn.%Y%m%d%H
|
||||
|
||||
# AWIPS1: TEXT ^[ABCFMNRSUVW]......[KPTMC] /text/NO_STORE
|
||||
# TEXT ^[ABCFMNRSUVW].....[KPTMC] /text/NO_STORE
|
||||
# TEXT ^DF.* /text/NO_STORE
|
||||
|
|
|
@ -64,6 +64,11 @@ getCamelAndWrapperPids() {
|
|||
if [ "$_camel_pid" != "" ]; then
|
||||
# grab wrapper pid from edex process, run throw awk to throw away leading white space
|
||||
_wrapper_pid=`ps --no-headers -p $_camel_pid -o ppid | awk '{print $1}'`
|
||||
# if wrapper died, camel's parent will be 1, don't report that as the wrapper
|
||||
if [ "$_wrapper_pid" == "1" ]
|
||||
then
|
||||
_wrapper_pid=""
|
||||
fi
|
||||
else
|
||||
# camel not up, double check wrapper pid file
|
||||
pidfile=${EDEX_INSTALL}/bin/${1}.pid
|
||||
|
@ -138,7 +143,11 @@ stopEDEX() {
|
|||
savepid=$_wrapper_pid
|
||||
while [ "${_wrapper_pid}${_camel_pid}" != "" ]; do
|
||||
if [ "$_wrapper_pid" != "$savepid" ]; then
|
||||
echo "WARNING: EDEX ${1} instance running under new pid, started by another user?"
|
||||
# only display warning when other wrapper starts (not if wrapper died)
|
||||
if [ -n "$_wrapper_pid" ]
|
||||
then
|
||||
echo "WARNING: EDEX ${1} instance running under new pid, started by another user?"
|
||||
fi
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue