ASM #14578 - Added Hydrologic date field ti Choose Hour dialog for Daily QC
Change-Id: I954833e37c579ab1eaddf95347ba53d73909b138 Former-commit-id:1d99c3e89c
[formerlybf9924b0e9
] [formerly4205d83452
] [formerly4205d83452
[formerly1856a05319
]] [formerlyff52f1dc0a
[formerly4205d83452
[formerly1856a05319
] [formerlyff52f1dc0a
[formerly 2e8fb864f410b9b08ccc6de6c0d75666931da3a2]]]] Former-commit-id:ff52f1dc0a
Former-commit-id: aa28752be4c8f85d35fe287d2e4fd3c2ce5289f6 [formerly 2916716519dd7ee38032637d8a99f6fb81e1e7ba] [formerly1532c683a1
[formerly211e9f7546
]] Former-commit-id:1532c683a1
Former-commit-id:899ff32548
This commit is contained in:
parent
0bfd904a66
commit
6ebef19f10
7 changed files with 112 additions and 15 deletions
|
@ -455,12 +455,9 @@ public class OtherPrecipOptions {
|
|||
// // do nothing
|
||||
// }
|
||||
|
||||
if (clientdata == 1) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
|
||||
/* Rendering the grids and MAPs. */
|
||||
else if (clientdata == 0) {
|
||||
if (clientdata == 0) {
|
||||
|
||||
BadValues bv = new BadValues();
|
||||
bv.update_bad_values(DailyQcUtils.pcpn_day);
|
||||
|
@ -472,16 +469,18 @@ public class OtherPrecipOptions {
|
|||
if (DailyQcUtils.pcpn_day == 0
|
||||
&& (DailyQcUtils.curHr00_06 == 1
|
||||
|| DailyQcUtils.curHr06_12 == 1 || DailyQcUtils.curHr18_00 == 1)) {
|
||||
System.out.println("Not estimating partial point or daily stations.");
|
||||
// don't estimate
|
||||
} else {
|
||||
|
||||
EstDailyStations ed = new EstDailyStations();
|
||||
ed.estimate_daily_stations(DailyQcUtils.pcpn_day,
|
||||
DailyQcUtils.precip_stations, num_stations);
|
||||
|
||||
System.out.println("Estimating daily stations.");
|
||||
EstPartStations ep = new EstPartStations();
|
||||
ep.estimate_partial_stations(DailyQcUtils.pcpn_day,
|
||||
DailyQcUtils.precip_stations, num_stations);
|
||||
System.out.println("Estimating partial stations.");
|
||||
}
|
||||
|
||||
QCStations qs = new QCStations();
|
||||
|
|
|
@ -64,6 +64,7 @@ import com.raytheon.viz.ui.editor.IMultiPaneEditor;
|
|||
* Sep 23, 2008 randerso Initial creation
|
||||
* Apr 30, 2013 lbousaidi made seconds in the date/Time
|
||||
* fields visible.
|
||||
* Aug 26, 2014 14578 snaples Added Ending Hydrologic Date selection.
|
||||
* </pre>
|
||||
*
|
||||
* @author randerso
|
||||
|
@ -79,8 +80,12 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog {
|
|||
}
|
||||
|
||||
private Calendar cal;
|
||||
|
||||
private Calendar hydroCal;
|
||||
|
||||
public static Date prevDate;
|
||||
|
||||
public static Date prevHydDate;
|
||||
|
||||
public static String prevArea;
|
||||
|
||||
|
@ -93,6 +98,12 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog {
|
|||
private Spinner hourSpinner;
|
||||
|
||||
private Spinner daysSpinner;
|
||||
|
||||
private Text hydyearText;
|
||||
|
||||
private Text hydmonthText;
|
||||
|
||||
private Spinner hyddaySpinner;
|
||||
|
||||
private Map<Date, MPEDateInfo> dateMap;
|
||||
|
||||
|
@ -118,6 +129,8 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog {
|
|||
|
||||
private Combo areaCombo;
|
||||
|
||||
private static Date currentHydroEndingDate;
|
||||
|
||||
public ChooseDataPeriodDialog(Shell parentShell) {
|
||||
super(parentShell);
|
||||
setBlockOnOpen(false);
|
||||
|
@ -144,8 +157,13 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog {
|
|||
dateMap = dataMgr.getDateMap(false);
|
||||
qcEnable = MPEDisplayManager.isMpeQcOptionEnabled();
|
||||
cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
|
||||
hydroCal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
|
||||
prevDate = displayMgr.getCurrentEditDate();
|
||||
cal.setTime(prevDate);
|
||||
if(prevHydDate == null){
|
||||
prevHydDate = prevDate;
|
||||
}
|
||||
hydroCal.setTime(prevHydDate);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -313,8 +331,59 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog {
|
|||
gageOptionsGroup.setLayout(layout);
|
||||
gageOptionsGroup.setText("6/24 hr gage edit options");
|
||||
|
||||
new Label(gageOptionsGroup, SWT.NONE);
|
||||
// create ending hydro date area
|
||||
|
||||
Label hydrodateLabel = new Label(gageOptionsGroup, SWT.NONE);
|
||||
hydrodateLabel.setText("Ending Hydrologic Date: ");
|
||||
new Label(gageOptionsGroup, SWT.None);
|
||||
|
||||
Composite hydrodateComp = new Composite(gageOptionsGroup, SWT.NONE);
|
||||
GridData hydrodata = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||
hydrodateComp.setLayoutData(hydrodata);
|
||||
GridLayout hydlayout = new GridLayout(3, false);
|
||||
hydrodateComp.setLayout(hydlayout);
|
||||
|
||||
Label hydyearLabel = new Label(hydrodateComp, SWT.NONE);
|
||||
hydyearLabel.setText("Ending Year");
|
||||
|
||||
Label hydmonthLabel = new Label(hydrodateComp, SWT.NONE);
|
||||
hydmonthLabel.setText("Month");
|
||||
|
||||
Label hyddayLabel = new Label(hydrodateComp, SWT.NONE);
|
||||
hyddayLabel.setText("Day");
|
||||
|
||||
hydyearText = new Text(hydrodateComp, SWT.BORDER | SWT.READ_ONLY);
|
||||
hydrodata = new GridData(SWT.DEFAULT, SWT.DEFAULT, false, false);
|
||||
hydrodata.widthHint = 100;
|
||||
hydyearText.setLayoutData(hydrodata);
|
||||
|
||||
hydmonthText = new Text(hydrodateComp, SWT.BORDER | SWT.READ_ONLY);
|
||||
hydrodata = new GridData(SWT.DEFAULT, SWT.DEFAULT, false, false);
|
||||
hydrodata.widthHint = 50;
|
||||
hydmonthText.setLayoutData(hydrodata);
|
||||
|
||||
hyddaySpinner = new Spinner(hydrodateComp, SWT.BORDER | SWT.READ_ONLY);
|
||||
hydrodata = new GridData(SWT.DEFAULT, SWT.DEFAULT, false, false);
|
||||
hydrodata.widthHint = 50;
|
||||
hyddaySpinner.setLayoutData(data);
|
||||
hyddaySpinner.setMinimum(0);
|
||||
hyddaySpinner.setMaximum(32);
|
||||
hyddaySpinner.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
int day = hyddaySpinner.getSelection();
|
||||
|
||||
hydroCal.set(Calendar.DAY_OF_MONTH, day);
|
||||
|
||||
updateTimeControls();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
new Label(gageOptionsGroup, SWT.None);
|
||||
new Label(gageOptionsGroup, SWT.None);
|
||||
Label selectAreaLabel = new Label(gageOptionsGroup, SWT.NONE);
|
||||
selectAreaLabel.setText("Select Area");
|
||||
data = new GridData(SWT.CENTER, SWT.DEFAULT, false, false);
|
||||
|
@ -373,6 +442,8 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog {
|
|||
public void widgetSelected(SelectionEvent e) {
|
||||
displayMgr.setDqcDays(daysSpinner.getSelection());
|
||||
prevArea = areaCombo.getItem(areaCombo.getSelectionIndex());
|
||||
setCurrentHydroEditDate(getHydroTime());
|
||||
|
||||
if (QcPrecipOptionsDialog.isFinished() == false) {
|
||||
QcPrecipOptionsDialog.destroy(false);
|
||||
}
|
||||
|
@ -400,6 +471,8 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog {
|
|||
public void widgetSelected(SelectionEvent e) {
|
||||
displayMgr.setDqcDays(daysSpinner.getSelection());
|
||||
prevArea = areaCombo.getItem(areaCombo.getSelectionIndex());
|
||||
setCurrentHydroEditDate(getHydroTime());
|
||||
|
||||
if (QcTempOptionsDialog.isFinished() == false) {
|
||||
QcTempOptionsDialog.destroy(false);
|
||||
}
|
||||
|
@ -427,6 +500,8 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog {
|
|||
public void widgetSelected(SelectionEvent e) {
|
||||
displayMgr.setDqcDays(daysSpinner.getSelection());
|
||||
prevArea = areaCombo.getItem(areaCombo.getSelectionIndex());
|
||||
setCurrentHydroEditDate(getHydroTime());
|
||||
|
||||
if (QcFreezeOptionsDialog.isFinished() == false) {
|
||||
QcFreezeOptionsDialog.destroy(false);
|
||||
}
|
||||
|
@ -454,13 +529,19 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog {
|
|||
if (cal.getTime().before(dataMgr.getEarliestDate())
|
||||
|| cal.getTime().after(dataMgr.getLatestDate())) {
|
||||
cal.setTime(prevDate);
|
||||
hydroCal.setTime(prevHydDate);
|
||||
}
|
||||
prevDate = cal.getTime();
|
||||
prevHydDate = hydroCal.getTime();
|
||||
|
||||
yearText.setText(Integer.toString(cal.get(Calendar.YEAR)));
|
||||
monthText.setText(Integer.toString(cal.get(Calendar.MONTH) + 1));
|
||||
daySpinner.setSelection(cal.get(Calendar.DAY_OF_MONTH));
|
||||
|
||||
|
||||
hydyearText.setText(Integer.toString(hydroCal.get(Calendar.YEAR)));
|
||||
hydmonthText.setText(Integer.toString(hydroCal.get(Calendar.MONTH) + 1));
|
||||
hyddaySpinner.setSelection(hydroCal.get(Calendar.DAY_OF_MONTH));
|
||||
|
||||
hourSpinner.setSelection(cal.get(Calendar.HOUR_OF_DAY));
|
||||
|
||||
if (dateMap.containsKey(cal.getTime()) == false) {
|
||||
|
@ -502,6 +583,19 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog {
|
|||
public Date getTime() {
|
||||
return cal.getTime();
|
||||
}
|
||||
|
||||
public Date getHydroTime(){
|
||||
return hydroCal.getTime();
|
||||
}
|
||||
|
||||
private void setCurrentHydroEditDate(Date hydroTime) {
|
||||
currentHydroEndingDate = hydroTime;
|
||||
}
|
||||
|
||||
public static Date getCurrentHydroEditDate(){
|
||||
return currentHydroEndingDate;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the selected year;
|
||||
|
|
|
@ -67,6 +67,7 @@ import com.raytheon.viz.ui.perspectives.VizPerspectiveListener;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul, 7 2009 snaples Initial creation
|
||||
* Sep 11, 2013 #2353 lvenable Fixed cursor memory leak.
|
||||
* Aug 26, 2014 14578 snaples Changed the way we get current data to use new ending hydologic date.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -195,8 +196,8 @@ public class QcFreezeOptionsDialog 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();
|
||||
|
|
|
@ -67,6 +67,7 @@ import com.raytheon.viz.mpe.util.DailyQcUtils.Ts;
|
|||
* Mar 7, 2013 15657 lbousaidi fixed DQC slider and added listener to the Keys
|
||||
* when pressed.
|
||||
* Sep 11, 2013 #2353 lvenable Fixed cursor memory leak.
|
||||
* Aug 26, 2014 14578 snaples Changed the way we get the date, to use new ending hydro date field.
|
||||
* </pre>
|
||||
*
|
||||
* @author snaples
|
||||
|
@ -207,8 +208,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();
|
||||
|
|
|
@ -64,6 +64,7 @@ import com.raytheon.viz.mpe.util.DailyQcUtils.Ts;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 12, 2008 snaples Initial creation
|
||||
* Sep 11, 2013 #2353 lvenable Fixed cursor memory leak.
|
||||
* Aug 26, 2014 14578 snaples Changed the way we get current data to use new ending hydologic date.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -196,8 +197,8 @@ public class QcTempOptionsDialog 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();
|
||||
|
|
|
@ -184,8 +184,8 @@ public class InitPrecipClimo {
|
|||
precip_stations.set(index, nstation);
|
||||
nstation = null;
|
||||
}
|
||||
++index;
|
||||
}
|
||||
++index;
|
||||
}
|
||||
|
||||
in.close();
|
||||
|
|
|
@ -84,6 +84,7 @@ public class ReadPrecipA {
|
|||
try {
|
||||
|
||||
in = new BufferedReader(new FileReader(preca));
|
||||
System.out.println("Reading point file: " + preca);
|
||||
|
||||
for (j = 0; j < 5; j++) {
|
||||
number_found[j] = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue