ASM #253 Update RadarBiasTableDialog to allow undo changes.
Change-Id: Ibfb87730fda8185b27777fd83606bc1397aca1f9 Former-commit-id:e994aa9482
[formerly2a49bbda2f
] [formerlyefe877d82b
] [formerlye994aa9482
[formerly2a49bbda2f
] [formerlyefe877d82b
] [formerly90ed511478
[formerlyefe877d82b
[formerly fcd20d35abf3617701cc797baf9ba2b3984379c8]]]] Former-commit-id:90ed511478
Former-commit-id:b8d5f833ec
[formerly2e77b74c44
] [formerly f502e650f306b12ad50f762f688616a9b1039de1 [formerly362e1ce880
]] Former-commit-id: d75382cb3e72ed1c52902aa0d9f71c8e7e9c77f6 [formerly5dcda5cabc
] Former-commit-id:3638879057
This commit is contained in:
parent
7e7529e482
commit
d7ff8a2638
1 changed files with 49 additions and 25 deletions
|
@ -23,6 +23,7 @@ import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.TimeZone;
|
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
|
* Feb 2, 2014 16201 snaples Added saved data flag support
|
||||||
* Apr 4, 2014 17223 snaples Updated other_office_id and rfc_bias to object
|
* 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.
|
* 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>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author snaples
|
* @author snaples
|
||||||
|
@ -147,6 +148,10 @@ public class RadarBiasTableDialog extends Dialog {
|
||||||
Button mbiasBtn = null;
|
Button mbiasBtn = null;
|
||||||
|
|
||||||
Button[] manEdit = null;
|
Button[] manEdit = null;
|
||||||
|
|
||||||
|
Text[] lbTxts = null;
|
||||||
|
|
||||||
|
private final Map<String, Integer> biasChgs = new HashMap<String, Integer>();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
|
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
|
||||||
|
@ -343,7 +348,7 @@ public class RadarBiasTableDialog extends Dialog {
|
||||||
dt = pgsdf.format(dt3);
|
dt = pgsdf.format(dt3);
|
||||||
rsList = new HashMap<String, MPERadarData>(radIds.length);
|
rsList = new HashMap<String, MPERadarData>(radIds.length);
|
||||||
rsList = MPEDataManager.getInstance().readRadarData(dt3);
|
rsList = MPEDataManager.getInstance().readRadarData(dt3);
|
||||||
Text[] lbTxts = new Text[radIds.length];
|
lbTxts = new Text[radIds.length];
|
||||||
manEdit = new Button[radIds.length];
|
manEdit = new Button[radIds.length];
|
||||||
|
|
||||||
for (int i = 0; i < radIds.length; i++) {
|
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();
|
oldbias[i] = (float) radarresultdata.getRwBiasValUsed();
|
||||||
editbias[i] = 0.0f;
|
editbias[i] = 0.0f;
|
||||||
|
editbias[i] = oldbias[i];
|
||||||
|
bias = String.format("%-1.2f", editbias[i]);
|
||||||
|
|
||||||
gd = new GridData(SWT.FILL, SWT.CENTER, true, true);
|
gd = new GridData(SWT.FILL, SWT.CENTER, true, true);
|
||||||
final Text lbiasTxt = new Text(biasListComp, SWT.SINGLE
|
final Text lbiasTxt = new Text(biasListComp, SWT.SINGLE
|
||||||
|
@ -442,16 +448,36 @@ public class RadarBiasTableDialog extends Dialog {
|
||||||
|
|
||||||
lbTxts[i] = lbiasTxt;
|
lbTxts[i] = lbiasTxt;
|
||||||
gd = new GridData(SWT.FILL, SWT.CENTER, true, true);
|
gd = new GridData(SWT.FILL, SWT.CENTER, true, true);
|
||||||
mbiasBtn = new Button(biasListComp, SWT.TOGGLE | SWT.READ_ONLY);
|
final Button mbiasBtn = new Button(biasListComp, SWT.TOGGLE);
|
||||||
// mbiasBtn.setEnabled(false);
|
|
||||||
mbias = ("n".equalsIgnoreCase(radarresultdata.getEditBias()) || radarresultdata
|
mbias = ("n".equalsIgnoreCase(radarresultdata.getEditBias()) || radarresultdata
|
||||||
.getEditBias() == null) ? "NO" : "YES";
|
.getEditBias() == null) ? "NO" : "YES";
|
||||||
mbiasBtn.setText(mbias);
|
mbiasBtn.setText(mbias);
|
||||||
mbiasBtn.setLayoutData(gd);
|
mbiasBtn.setLayoutData(gd);
|
||||||
mbiasBtn.setData(i);
|
mbiasBtn.setData(i);
|
||||||
mbiasBtn.setSelection(false);
|
|
||||||
manEdit[i] = mbiasBtn;
|
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);
|
gd = new GridData(SWT.FILL, SWT.CENTER, true, true);
|
||||||
Label acoefLbl = new Label(biasListComp, SWT.CENTER);
|
Label acoefLbl = new Label(biasListComp, SWT.CENTER);
|
||||||
if (abzerocoef.mlt_zrcoef == 0.0) {
|
if (abzerocoef.mlt_zrcoef == 0.0) {
|
||||||
|
@ -515,29 +541,27 @@ public class RadarBiasTableDialog extends Dialog {
|
||||||
final float memspan = -99.0f;
|
final float memspan = -99.0f;
|
||||||
ArrayList<Rwradarresult> rwr = new ArrayList<Rwradarresult>();
|
ArrayList<Rwradarresult> rwr = new ArrayList<Rwradarresult>();
|
||||||
Rwradarresult rwrr = new Rwradarresult();
|
Rwradarresult rwrr = new Rwradarresult();
|
||||||
for (int i = 0; i < radIds.length; i++) {
|
Iterator<String> bi = biasChgs.keySet().iterator();
|
||||||
if (radIds[i].equals("ZZZ")) {
|
while (bi.hasNext()) {
|
||||||
continue;
|
String rid = bi.next();
|
||||||
}
|
where = String.format("WHERE radid='%s' AND obstime='%s'",rid, obstime);
|
||||||
if (manEdit[i] != null
|
rwr = (ArrayList<Rwradarresult>) IHFSDbGenerated.GetRWRadarResult(where);
|
||||||
&& "YES".equalsIgnoreCase(manEdit[i].getText())) {
|
if (rwr.size() != 0) {
|
||||||
where = String.format("WHERE radid='%s' AND obstime='%s'",
|
rwrr = rwr.get(0);
|
||||||
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);
|
|
||||||
} else {
|
} else {
|
||||||
continue;
|
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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue