Merge branch 'asm_14.2.2' of ssh://10.201.30.8:29418/AWIPS2_baseline into master_14.2.2

Former-commit-id: 625eefb5f53e292d947233c1cd0aa031e61ca9ea
This commit is contained in:
Brian.Dyke 2014-07-01 15:41:10 -04:00
commit f8759e2317
4 changed files with 107 additions and 29 deletions

View file

@ -23,6 +23,7 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.TimeZone;
@ -72,7 +73,7 @@ import com.raytheon.viz.mpe.ui.radartable.ReadBiasTableParam;
* Feb 2, 2014 16201 snaples Added saved data flag support
* Apr 4, 2014 17223 snaples Updated other_office_id and rfc_bias to object
* array so that called procedure can update and return values properly.
*
* May 1, 2014 16626 snaples Updated the Manual Bias button to allow revert to original value.
* </pre>
*
* @author snaples
@ -147,6 +148,10 @@ public class RadarBiasTableDialog extends Dialog {
Button mbiasBtn = null;
Button[] manEdit = null;
Text[] lbTxts = null;
private final Map<String, Integer> biasChgs = new HashMap<String, Integer>();
static {
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
@ -343,7 +348,7 @@ public class RadarBiasTableDialog extends Dialog {
dt = pgsdf.format(dt3);
rsList = new HashMap<String, MPERadarData>(radIds.length);
rsList = MPEDataManager.getInstance().readRadarData(dt3);
Text[] lbTxts = new Text[radIds.length];
lbTxts = new Text[radIds.length];
manEdit = new Button[radIds.length];
for (int i = 0; i < radIds.length; i++) {
@ -398,9 +403,10 @@ public class RadarBiasTableDialog extends Dialog {
});
bias = String.format("%-1.2f", radarresultdata.getRwBiasValUsed());
oldbias[i] = (float) radarresultdata.getRwBiasValUsed();
editbias[i] = 0.0f;
editbias[i] = oldbias[i];
bias = String.format("%-1.2f", editbias[i]);
gd = new GridData(SWT.FILL, SWT.CENTER, true, true);
final Text lbiasTxt = new Text(biasListComp, SWT.SINGLE
@ -442,16 +448,36 @@ public class RadarBiasTableDialog extends Dialog {
lbTxts[i] = lbiasTxt;
gd = new GridData(SWT.FILL, SWT.CENTER, true, true);
mbiasBtn = new Button(biasListComp, SWT.TOGGLE | SWT.READ_ONLY);
// mbiasBtn.setEnabled(false);
final Button mbiasBtn = new Button(biasListComp, SWT.TOGGLE);
mbias = ("n".equalsIgnoreCase(radarresultdata.getEditBias()) || radarresultdata
.getEditBias() == null) ? "NO" : "YES";
mbiasBtn.setText(mbias);
mbiasBtn.setLayoutData(gd);
mbiasBtn.setData(i);
mbiasBtn.setSelection(false);
manEdit[i] = mbiasBtn;
mbiasBtn.addSelectionListener(new SelectionAdapter() {
/**
* (non-Javadoc)
*
* @see
* org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse
* .swt.events.SelectionEvent)
*/
@Override
public void widgetSelected(SelectionEvent e) {
final int ai = (Integer) mbiasBtn.getData();
if ("YES".equalsIgnoreCase(mbiasBtn.getText())) {
manEdit[ai].setSelection(false);
editbias[ai] = oldbias[ai];
lbTxts[ai].setText(String.format("%-1.2f", editbias[ai]));
biasChgs.put(radIds[ai], ai);
applyBtn.setEnabled(false);
manEdit[ai].setText("NO");
}
}
});
gd = new GridData(SWT.FILL, SWT.CENTER, true, true);
Label acoefLbl = new Label(biasListComp, SWT.CENTER);
if (abzerocoef.mlt_zrcoef == 0.0) {
@ -515,29 +541,27 @@ public class RadarBiasTableDialog extends Dialog {
final float memspan = -99.0f;
ArrayList<Rwradarresult> rwr = new ArrayList<Rwradarresult>();
Rwradarresult rwrr = new Rwradarresult();
for (int i = 0; i < radIds.length; i++) {
if (radIds[i].equals("ZZZ")) {
continue;
}
if (manEdit[i] != null
&& "YES".equalsIgnoreCase(manEdit[i].getText())) {
where = String.format("WHERE radid='%s' AND obstime='%s'",
radIds[i], obstime);
rwr = (ArrayList<Rwradarresult>) IHFSDbGenerated
.GetRWRadarResult(where);
if (rwr.size() != 0) {
rwrr = rwr.get(0);
} else {
continue;
}
rwrr.setEditBias("y");
rwrr.setMemSpanUsed((double) memspan);
rwrr.setRwBiasValUsed((double) editbias[i]);
IHFSDbGenerated.UpdateRWRadarResult(rwrr);
Iterator<String> bi = biasChgs.keySet().iterator();
while (bi.hasNext()) {
String rid = bi.next();
where = String.format("WHERE radid='%s' AND obstime='%s'",rid, obstime);
rwr = (ArrayList<Rwradarresult>) IHFSDbGenerated.GetRWRadarResult(where);
if (rwr.size() != 0) {
rwrr = rwr.get(0);
} else {
continue;
}
int indexval = biasChgs.get(rid);
if("YES".equalsIgnoreCase(manEdit[indexval].getText())){
rwrr.setEditBias("y");
rwrr.setMemSpanUsed((double) memspan);
} else {
rwrr.setEditBias("n");
}
rwrr.setRwBiasValUsed((double) editbias[indexval]);
IHFSDbGenerated.UpdateRWRadarResult(rwrr);
}
biasChgs.clear();
return;
}
}

View file

@ -76,6 +76,7 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometry;
* Aug 19, 2013 2177 jsanchez Used portionsUtil to calculate area portion descriptions.
* Apr 29, 2014 3033 jsanchez Updated method to retrieve files in localization.
* May 16, 2014 DR 17365 D. Friedman Reduce precision of warning area to avoid topology errors.
* Jun 30, 2014 DR 17447 Qinglu lin Updated findAffectedAreas().
* </pre>
*
* @author chammack
@ -178,6 +179,7 @@ public class Area {
}
List<String> uniqueFips = new ArrayList<String>();
List<String> uniqueCountyname = new ArrayList<String>();
List<AffectedAreas> areas = new ArrayList<AffectedAreas>();
for (GeospatialData regionFeature : countyMap.values()) {
Geometry regionGeom = regionFeature.geometry;
@ -257,8 +259,12 @@ public class Area {
area.points = pointList.toArray(new String[pointList.size()]);
}
if (uniqueFips.contains(area.fips) == false) {
String countyName = (String)regionFeature.attributes.get("COUNTYNAME");
if (uniqueFips.contains(area.fips) == false || !uniqueCountyname.contains(countyName)) {
uniqueFips.add(area.fips);
if (countyName != null) {
uniqueCountyname.add(countyName);
}
areas.add(area);
}
}

View file

@ -86,6 +86,8 @@ import com.vividsolutions.jts.precision.SimpleGeometryPrecisionReducer;
* 01/09/2014 DR 16974 D. Friedman Improve followup redraw-from-hatched-area polygons.
* 04/15/2014 DR 17247 D. Friedman Prevent some invalid coordinates in adjustVertex.
* 05/16/2014 DR 17365 D. Friedman Prevent some Coordinate reuse. Add reducePrecision.
* 06/27/2014 DR 17443 D. Friedman Fix some odd cases in which parts of a polygon not covering a
* hatched area would be retained after redrawing.
* </pre>
*
* @author mschenke
@ -417,12 +419,15 @@ public class PolygonUtil {
p1--;
if (p1 >= 0) {
Coordinate last = new Coordinate();
int n, best1, best2;
for (n = k = 0; k < npoints; k++) {
if (match[k] == nv)
continue;
best1 = match[p1];
best2 = match[k];
last.x = longest[p1].x;
last.y = longest[p1].y;
p1 = k;
if (best1 < 0 && best2 < 0) {
if (k == n)
@ -460,16 +465,59 @@ public class PolygonUtil {
best1 += nv;
else if (dn - da < -len2)
best2 += nv;
if (best1 < best2)
/*
* We have apparently jumped from side best1 to side
* best2. Should we add all of the original
* vert[best1] -> vert[best2] vertices? If this is
* significantly longer then the distance from the
* last contour point to this one, it is probably
* the wrong thing to do.
*
* The factor of 3 assumes that all points along the
* contour we ware redrawing are fairly close so
* that three times the length from any one point to
* another is not very long.
*/
double maxPatchLen = last.distance(longest[k]) * 3;
double patchLen = 0;
int va = Math.min(best1, best2);
int vb = Math.max(best1, best2);
if (va < nv) {
patchLen = totlen[Math.min(nv, vb)] - totlen[va];
if (vb >= nv)
patchLen += totlen[vb % nv];
} else {
patchLen = totlen[vb % nv] - totlen[va % nv];
}
if (patchLen >= maxPatchLen) {
/*
* Adding all of the other vertices would be
* going of the rails, so just add a vertex for
* the last point (since it may be far from
* vert[best1] and the current point. Only add
* one point if adding two would cause the
* output in longest to overtake the input.
*/
if (n + 1 < k) {
fixed[n] = 1;
longest[n++] = new Coordinate(last);
}
fixed[n] = 1;
longest[n++] = longest[k];
} else if (best1 < best2) {
for (best1++; best1 <= best2; best1++) {
fixed[n] = 1;
longest[n++] = new Coordinate(vert[best1]);
}
else
} else {
for (; best1 > best2; best1--) {
fixed[n] = 1;
longest[n++] = new Coordinate(vert[best1]);
}
}
continue;
}
fixed[n] = 1;

View file

@ -61,7 +61,7 @@ listen_addresses = '*' # what IP address(es) to listen on;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
port = 5432 # (change requires restart)
max_connections = 300 # (change requires restart)
max_connections = 400 # (change requires restart)
# Note: Increasing max_connections costs ~400 bytes of shared memory per
# connection slot, plus lock space (see max_locks_per_transaction).
#superuser_reserved_connections = 3 # (change requires restart)