Merge branch 'ohd_15.1.1' of ssh://vlab.ncep.noaa.gov:29418/AWIPS2_Dev_Baseline into master_15.1.1
Former-commit-id: 366cd07d35f6e9f842ba72d1164a53fbb5fc6838
This commit is contained in:
commit
4718a036f1
8 changed files with 302 additions and 58 deletions
|
@ -19,9 +19,11 @@
|
||||||
**/
|
**/
|
||||||
package com.raytheon.viz.hydrobase.dialogs;
|
package com.raytheon.viz.hydrobase.dialogs;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
|
@ -46,6 +48,7 @@ import org.eclipse.swt.widgets.MessageBox;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.swt.widgets.Text;
|
import org.eclipse.swt.widgets.Text;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.ohd.AppsDefaults;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
import com.raytheon.viz.hydrobase.listeners.ICountyStateListener;
|
import com.raytheon.viz.hydrobase.listeners.ICountyStateListener;
|
||||||
import com.raytheon.viz.hydrobase.listeners.IStationListener;
|
import com.raytheon.viz.hydrobase.listeners.IStationListener;
|
||||||
|
@ -83,6 +86,9 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
* Changes for non-blocking CoopAgencyOfficeDlg.
|
* Changes for non-blocking CoopAgencyOfficeDlg.
|
||||||
* Changes for non-blocking CopyNewLocationDlg.
|
* Changes for non-blocking CopyNewLocationDlg.
|
||||||
* Changes for non-blocking CountyStateDlg.
|
* Changes for non-blocking CountyStateDlg.
|
||||||
|
* 08 Jan 2015 15695, 15488 djingtao fix the save/update text field with apostrophe, repleace the single
|
||||||
|
* apostrophe to two single apostrophe before save/update to database.
|
||||||
|
* 02 Feb 2015 13372 djingtao change the GMT time to local time for "revise" field
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
|
@ -1800,7 +1806,40 @@ public class AddModifyLocationDlg extends CaveSWTDialog implements
|
||||||
* If station is "Inactive", store an 'I' in the loc.type field.
|
* If station is "Inactive", store an 'I' in the loc.type field.
|
||||||
*/
|
*/
|
||||||
dataToSave.setType((inactiveChk.getSelection()) ? "I" : "");
|
dataToSave.setType((inactiveChk.getSelection()) ? "I" : "");
|
||||||
|
|
||||||
|
/* Check if text fields in dataToSave include single apostrophe, if it do, replace to
|
||||||
|
two single apostrophe */
|
||||||
|
|
||||||
|
AppsDefaults ad = AppsDefaults.getInstance();
|
||||||
|
boolean debug = ad.getBoolean(HydroConstants.DEBUG_HYDRO_DB_TOKEN, false);
|
||||||
|
|
||||||
|
Class<?> c = dataToSave.getClass();
|
||||||
|
|
||||||
|
Field fields[] = c.getDeclaredFields();
|
||||||
|
|
||||||
|
for (Field f : fields)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (f.getType().isAssignableFrom(String.class))
|
||||||
|
{
|
||||||
|
if (debug)
|
||||||
|
System.out.println("The field name is " + f.getName());
|
||||||
|
|
||||||
|
f.setAccessible(true);
|
||||||
|
String value = (String) f.get(dataToSave).toString();
|
||||||
|
|
||||||
|
if (value.contains("'"))
|
||||||
|
{
|
||||||
|
value = value.replace("'", "''");
|
||||||
|
f.set(dataToSave, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Save to DB via DataManager
|
// Save to DB via DataManager
|
||||||
try {
|
try {
|
||||||
HydroDBDataManager.getInstance().putData(dataToSave);
|
HydroDBDataManager.getInstance().putData(dataToSave);
|
||||||
|
@ -1905,9 +1944,14 @@ public class AddModifyLocationDlg extends CaveSWTDialog implements
|
||||||
// If the Revision Checkbox is checked, set the Revision Date to the
|
// If the Revision Checkbox is checked, set the Revision Date to the
|
||||||
// current date
|
// current date
|
||||||
// Else load the date from the database
|
// Else load the date from the database
|
||||||
|
|
||||||
|
Calendar now = Calendar.getInstance(Locale.getDefault());
|
||||||
|
String revise_str = new SimpleDateFormat("MM/dd/yyyy").format(now.getTime());
|
||||||
|
|
||||||
if (reviseChk.getSelection()) {
|
if (reviseChk.getSelection()) {
|
||||||
reviseTF.setText(locDate.format(Calendar.getInstance(
|
// reviseTF.setText(locDate.format(Calendar.getInstance(
|
||||||
TimeZone.getTimeZone("GMT")).getTime()));
|
// TimeZone.getTimeZone("GMT")).getTime()));
|
||||||
|
reviseTF.setText(revise_str);
|
||||||
} else if (locData != null) {
|
} else if (locData != null) {
|
||||||
reviseTF.setText((locData.getReviseDate() != null) ? locDate
|
reviseTF.setText((locData.getReviseDate() != null) ? locDate
|
||||||
.format(locData.getReviseDate()) : "");
|
.format(locData.getReviseDate()) : "");
|
||||||
|
|
|
@ -23,6 +23,7 @@ import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
|
@ -77,6 +78,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
* Apr 16,2012 14797 wkwock Change lat/lon from hour minute sec to decimal.
|
* Apr 16,2012 14797 wkwock Change lat/lon from hour minute sec to decimal.
|
||||||
* Jun 11,2013 2088 rferrel Make dialog non-blocking.
|
* Jun 11,2013 2088 rferrel Make dialog non-blocking.
|
||||||
* Changes for non-blocking FcstPointGroupDlg.
|
* Changes for non-blocking FcstPointGroupDlg.
|
||||||
|
* Feb.02, 2015 #13372 djingtao Change from GMT time to local time for "Revise" field
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -1531,11 +1533,16 @@ public class RiverGageDlg extends CaveSWTDialog implements
|
||||||
*/
|
*/
|
||||||
private void updateRevisionDate() {
|
private void updateRevisionDate() {
|
||||||
// If the Revision Checkbox is checked, set the Revision Date to the
|
// If the Revision Checkbox is checked, set the Revision Date to the
|
||||||
// current date
|
// current date in local time
|
||||||
// Else load the date from the database
|
// Else load the date from the database
|
||||||
Date now = Calendar.getInstance(TimeZone.getTimeZone("GMT")).getTime();
|
//Date now = Calendar.getInstance(TimeZone.getTimeZone("GMT")).getTime();
|
||||||
if (reviseChk.getSelection()) {
|
|
||||||
dateTF.setText(dateFormat.format(now));
|
Calendar now = Calendar.getInstance(Locale.getDefault());
|
||||||
|
String revise_str = new SimpleDateFormat("MM/dd/yyyy").format(now.getTime());
|
||||||
|
|
||||||
|
if (reviseChk.getSelection()) {
|
||||||
|
//dateTF.setText(dateFormat.format(now));
|
||||||
|
dateTF.setText(revise_str);
|
||||||
} else if (riverGageData != null) {
|
} else if (riverGageData != null) {
|
||||||
dateTF.setText((riverGageData.getReviseDate() != null) ? dateFormat
|
dateTF.setText((riverGageData.getReviseDate() != null) ? dateFormat
|
||||||
.format(riverGageData.getReviseDate()) : "");
|
.format(riverGageData.getReviseDate()) : "");
|
||||||
|
|
|
@ -22,6 +22,7 @@ package com.raytheon.viz.hydrocommon.colorscalemgr;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.eclipse.jface.dialogs.MessageDialog;
|
import org.eclipse.jface.dialogs.MessageDialog;
|
||||||
|
@ -54,7 +55,10 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
import com.raytheon.uf.viz.core.RGBColors;
|
import com.raytheon.uf.viz.core.RGBColors;
|
||||||
|
import com.raytheon.uf.viz.core.catalog.DirectDbQuery;
|
||||||
|
import com.raytheon.uf.viz.core.catalog.DirectDbQuery.QueryLanguage;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
|
import com.raytheon.viz.hydrocommon.HydroConstants;
|
||||||
import com.raytheon.viz.hydrocommon.data.ColorValueData;
|
import com.raytheon.viz.hydrocommon.data.ColorValueData;
|
||||||
import com.raytheon.viz.hydrocommon.datamanager.HydroDBDataManager;
|
import com.raytheon.viz.hydrocommon.datamanager.HydroDBDataManager;
|
||||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
|
@ -74,6 +78,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
* 01 Jul 2013 2088 rferrel Changes for non-blocking dialogs.
|
* 01 Jul 2013 2088 rferrel Changes for non-blocking dialogs.
|
||||||
* 06 Sep 2013 #2342 lvenable Fixed color memory leaks and a null point exception.
|
* 06 Sep 2013 #2342 lvenable Fixed color memory leaks and a null point exception.
|
||||||
* 04 Sep 2014 14448 cgobs Make MPE redisplay after save of color settings in ColorScaleMgr
|
* 04 Sep 2014 14448 cgobs Make MPE redisplay after save of color settings in ColorScaleMgr
|
||||||
|
* 26 Feb 2015 16848 cgobs Fix merging of color sets by deleting existing set before saving new set.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author lvenable
|
* @author lvenable
|
||||||
|
@ -1955,6 +1960,66 @@ public class ColorScaleMgrDlg extends CaveSWTDialog {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void deleteDataFromDb(String applicationName, String colorUseName, String userId, String durationString) {
|
||||||
|
HydroDBDataManager manager = HydroDBDataManager.getInstance();
|
||||||
|
|
||||||
|
String whereClause = " WHERE application_name = '" + applicationName + "' AND " +
|
||||||
|
"color_use_name = '" + colorUseName + "' AND " +
|
||||||
|
"userId = '" + userId + "' AND " +
|
||||||
|
"duration = '" + durationString + "' AND " +
|
||||||
|
"threshold_unit = 'E' ";
|
||||||
|
String statement = "delete from colorValue " + whereClause;
|
||||||
|
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
DirectDbQuery.executeStatement(statement,HydroConstants.IHFS, QueryLanguage.SQL);
|
||||||
|
}
|
||||||
|
|
||||||
|
catch (VizException e) {
|
||||||
|
statusHandler.handle(Priority.ERROR,
|
||||||
|
"Error deleting Color Value Data: ", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 0. Collect data to delete (user, dataType, duration
|
||||||
|
|
||||||
|
java.util.List<ColorScaleData> data = editColorData
|
||||||
|
.getUsedColorScaleDataArray(userId, durationString + "_" + colorUseName);
|
||||||
|
|
||||||
|
ColorValueData cvd = new ColorValueData();
|
||||||
|
cvd.setApplicationName(applicationName);
|
||||||
|
cvd.setColorUseName(colorUseName);
|
||||||
|
cvd.setUserId(userId);
|
||||||
|
cvd.setDuration(durationString);
|
||||||
|
|
||||||
|
System.out.println("Attempting to delete data from cvd = " + getStringFromColorValueData(cvd) );
|
||||||
|
|
||||||
|
// 1. Delete each record from database
|
||||||
|
for (ColorScaleData csd : data) {
|
||||||
|
cvd.setThresholdValue(csd.getDoubleVal().toString());
|
||||||
|
try {
|
||||||
|
manager.deleteRecord(cvd);
|
||||||
|
} catch (VizException e) {
|
||||||
|
statusHandler.handle(Priority.ERROR,
|
||||||
|
"Error deleting Color Value Data: ", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private String getStringFromColorValueData(ColorValueData cvd)
|
||||||
|
{
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
builder.append("appName: " + cvd.getApplicationName() +
|
||||||
|
" colorUseName: " + cvd.getColorUseName() +
|
||||||
|
" userId: " + cvd.getUserId() +
|
||||||
|
" duration: " + cvd.getDuration());
|
||||||
|
|
||||||
|
return builder.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* save the data to the database
|
* save the data to the database
|
||||||
*
|
*
|
||||||
|
@ -1966,6 +2031,69 @@ public class ColorScaleMgrDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
HydroDBDataManager manager = HydroDBDataManager.getInstance();
|
HydroDBDataManager manager = HydroDBDataManager.getInstance();
|
||||||
|
|
||||||
|
String userId = user;
|
||||||
|
String applicationName = colorManager.getApplicationName();
|
||||||
|
String colorUseName = colorManager.getDataTypeName(saveDataTypeCbo
|
||||||
|
.getText());
|
||||||
|
String duration = selectedDurationInSeconds.toString();
|
||||||
|
|
||||||
|
deleteDataFromDb(applicationName, colorUseName, userId, duration);
|
||||||
|
|
||||||
|
ColorValueData cvd = new ColorValueData();
|
||||||
|
for (ColorValueLabels cvls : colorValLblArray) {
|
||||||
|
String threshold = cvls.getValueText();
|
||||||
|
String colorName = cvls.getColorName();
|
||||||
|
String thresholdUnit = "E";
|
||||||
|
if (ColorScaleData.MISSING.equals(threshold)) {
|
||||||
|
threshold = "-9999";
|
||||||
|
} else if (ColorScaleData.LESS_THAN_MIN.equals(threshold)) {
|
||||||
|
threshold = "-8888";
|
||||||
|
}
|
||||||
|
|
||||||
|
cvd.setApplicationName(applicationName);
|
||||||
|
cvd.setUserId(userId);
|
||||||
|
cvd.setColorName(colorName);
|
||||||
|
cvd.setColorUseName(colorUseName);
|
||||||
|
cvd.setDuration(duration);
|
||||||
|
cvd.setThresholdUnit(thresholdUnit);
|
||||||
|
cvd.setThresholdValue(threshold);
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
manager.putData(cvd);
|
||||||
|
} catch (VizException e1) {
|
||||||
|
statusHandler.handle(Priority.ERROR,
|
||||||
|
"Error saving Color Value Data: ", e1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (sourceCbo.getText().equals(DEFAULT)) {
|
||||||
|
createDefaultData();
|
||||||
|
} else {
|
||||||
|
createColorData(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
updateDurationCombo();
|
||||||
|
updateColorValueLabelBar();
|
||||||
|
|
||||||
|
if (this.saveCallback != null) {
|
||||||
|
this.saveCallback.execute();
|
||||||
|
}
|
||||||
|
setReturnValue(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* save the data to the database
|
||||||
|
*
|
||||||
|
* @param user
|
||||||
|
* user to save current data as
|
||||||
|
*/
|
||||||
|
private void saveDataOrig(String user) {
|
||||||
|
setSelectedDuration(durationCbo.getText());
|
||||||
|
|
||||||
|
HydroDBDataManager manager = HydroDBDataManager.getInstance();
|
||||||
|
|
||||||
String userId = user;
|
String userId = user;
|
||||||
String applicationName = colorManager.getApplicationName();
|
String applicationName = colorManager.getApplicationName();
|
||||||
String colorUseName = colorManager.getDataTypeName(saveDataTypeCbo
|
String colorUseName = colorManager.getDataTypeName(saveDataTypeCbo
|
||||||
|
@ -1998,7 +2126,13 @@ public class ColorScaleMgrDlg extends CaveSWTDialog {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//delete all old records
|
||||||
|
|
||||||
for (ColorValueLabels cvls : usedColorValLblArray) {
|
for (ColorValueLabels cvls : usedColorValLblArray) {
|
||||||
|
|
||||||
|
System.out.printf(" value = %s, colorName = %s\n", cvls.getValueText(), cvls.getColorName() );
|
||||||
|
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
for (int i = 0; (i < colorValLblArray.size()) && !found; ++i) {
|
for (int i = 0; (i < colorValLblArray.size()) && !found; ++i) {
|
||||||
String val = colorValLblArray.get(i).getValueText();
|
String val = colorValLblArray.get(i).getValueText();
|
||||||
|
@ -2006,6 +2140,9 @@ public class ColorScaleMgrDlg extends CaveSWTDialog {
|
||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
System.out.printf("found = %b\n", found);
|
||||||
|
|
||||||
if (!found) {
|
if (!found) {
|
||||||
cvd.setApplicationName(applicationName);
|
cvd.setApplicationName(applicationName);
|
||||||
cvd.setUserId(userId);
|
cvd.setUserId(userId);
|
||||||
|
|
|
@ -48,6 +48,8 @@ import org.eclipse.swt.graphics.RGB;
|
||||||
* 29 NOV 2007 373 lvenable Initial creation
|
* 29 NOV 2007 373 lvenable Initial creation
|
||||||
* 18 APR 2013 1790 rferrel Cleanup method interfaces;
|
* 18 APR 2013 1790 rferrel Cleanup method interfaces;
|
||||||
* part of non-blocking dialogs.
|
* part of non-blocking dialogs.
|
||||||
|
* 26 Feb 2015 16777 cgobs Fix code so that undo in color manager works
|
||||||
|
* for missing and lessThanMin color-value pairs
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -104,7 +106,11 @@ public class ColorScaleSets {
|
||||||
public void updateMissingColor(RGB rgb) {
|
public void updateMissingColor(RGB rgb) {
|
||||||
for (int i = 0; i < updatedColorSet.size(); ++i) {
|
for (int i = 0; i < updatedColorSet.size(); ++i) {
|
||||||
if (updatedColorSet.get(i).value.compareTo(ColorScaleData.MISSING) == 0) {
|
if (updatedColorSet.get(i).value.compareTo(ColorScaleData.MISSING) == 0) {
|
||||||
updatedColorSet.get(i).setColor(rgb);
|
// updatedColorSet.get(i).setColor(rgb);
|
||||||
|
|
||||||
|
ColorScaleData newData = new ColorScaleData();
|
||||||
|
newData.missingScaleData(rgb);
|
||||||
|
updatedColorSet.set(i, newData);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -120,7 +126,12 @@ public class ColorScaleSets {
|
||||||
for (int i = 0; i < updatedColorSet.size(); ++i) {
|
for (int i = 0; i < updatedColorSet.size(); ++i) {
|
||||||
if (updatedColorSet.get(i).value
|
if (updatedColorSet.get(i).value
|
||||||
.compareTo(ColorScaleData.LESS_THAN_MIN) == 0) {
|
.compareTo(ColorScaleData.LESS_THAN_MIN) == 0) {
|
||||||
updatedColorSet.get(i).setColor(rgb);
|
//updatedColorSet.get(i).setColor(rgb);
|
||||||
|
|
||||||
|
ColorScaleData newData = new ColorScaleData();
|
||||||
|
newData.lessThanMinScaleData(rgb);
|
||||||
|
updatedColorSet.set(i, newData);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* Sep 10, 2008 lvenable Initial creation
|
* Sep 10, 2008 lvenable Initial creation
|
||||||
* Feb 13, 2013 15794 wkwock Make Sequence number goes up to 99
|
* Feb 13, 2013 15794 wkwock Make Sequence number goes up to 99
|
||||||
* Jul 10, 2013 2088 rferrel Make dialog non-blocking.
|
* Jul 10, 2013 2088 rferrel Make dialog non-blocking.
|
||||||
*
|
* Feb 03, 2015 16883 djingtao Contact "New" button causes record to be written to the db
|
||||||
|
* Feb 03, 2015 14147 djingtao "Sequence" number in Contact
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author lvenable
|
* @author lvenable
|
||||||
|
@ -391,7 +392,8 @@ public class ContactsDlg extends CaveSWTDialog {
|
||||||
newBtn.addSelectionListener(new SelectionAdapter() {
|
newBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
newContactFlag = true;
|
newContactFlag = true;
|
||||||
updateInsertContactData();
|
|
||||||
|
// updateInsertContactData();
|
||||||
clearInformationFields();
|
clearInformationFields();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -419,7 +421,18 @@ public class ContactsDlg extends CaveSWTDialog {
|
||||||
* Clear the informations fields.
|
* Clear the informations fields.
|
||||||
*/
|
*/
|
||||||
private void clearInformationFields() {
|
private void clearInformationFields() {
|
||||||
seqNumSpnr.setSelection(5);
|
// get how many contacts in the Contacts List
|
||||||
|
int contactNum = 0;
|
||||||
|
try {
|
||||||
|
contactNum = ContactsDataManager.getInstance().getContactData(locationId).size();
|
||||||
|
} catch (VizException e) {
|
||||||
|
statusHandler.handle(Priority.ERROR,
|
||||||
|
"Unable to determine if contact exits: ", e);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//seqNumSpnr.setSelection(1);
|
||||||
|
seqNumSpnr.setSelection(contactNum + 1);
|
||||||
contactNameTF.setText("");
|
contactNameTF.setText("");
|
||||||
phoneTF.setText("");
|
phoneTF.setText("");
|
||||||
emailTF.setText("");
|
emailTF.setText("");
|
||||||
|
@ -455,18 +468,13 @@ public class ContactsDlg extends CaveSWTDialog {
|
||||||
* Check if the contact already exists.
|
* Check if the contact already exists.
|
||||||
*/
|
*/
|
||||||
if (contactExits == true) {
|
if (contactExits == true) {
|
||||||
MessageBox mb = new MessageBox(shell, SWT.ICON_QUESTION
|
MessageBox mb = new MessageBox(shell, SWT.ICON_ERROR
|
||||||
| SWT.OK | SWT.CANCEL);
|
| SWT.OK);
|
||||||
mb.setText("Insert");
|
mb.setText("Error");
|
||||||
mb.setMessage("The contact you want to insert already exists.\n"
|
mb.setMessage("The contact you want to insert already exists.");
|
||||||
+ "Do you wish to update the existing data?");
|
mb.open();
|
||||||
int result = mb.open();
|
state = false;
|
||||||
|
|
||||||
if (result == SWT.CANCEL) {
|
|
||||||
state = false;
|
|
||||||
} else {
|
|
||||||
state = updateContact();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
state = insertNewContact();
|
state = insertNewContact();
|
||||||
}
|
}
|
||||||
|
@ -511,7 +519,7 @@ public class ContactsDlg extends CaveSWTDialog {
|
||||||
* @return true when update successful
|
* @return true when update successful
|
||||||
*/
|
*/
|
||||||
private boolean updateContact() {
|
private boolean updateContact() {
|
||||||
try {
|
try {
|
||||||
ContactsData data = new ContactsData();
|
ContactsData data = new ContactsData();
|
||||||
data.setLid(locationId);
|
data.setLid(locationId);
|
||||||
data.setContact(contactNameTF.getText().trim());
|
data.setContact(contactNameTF.getText().trim());
|
||||||
|
|
|
@ -30,7 +30,8 @@ package com.raytheon.viz.hydrocommon.cresthistory;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Dec 11, 2008 1628 dhladky initial
|
* Dec 11, 2008 1628 dhladky initial
|
||||||
* Nov 04, 2010 5518 lbousaid added all/above/bellow flag to
|
* Nov 04, 2010 5518 lbousaid added all/above/bellow flag to
|
||||||
* getRiverCrestData
|
* getRiverCrestData
|
||||||
|
* Jan 09, 2015 16698 JingtaoD Crest History failed validation dialog pops up when OK button clicked
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -207,14 +208,17 @@ public class CrestHistoryDataManager {
|
||||||
try {
|
try {
|
||||||
DirectDbQuery.executeStatement(insertCrest, HydroConstants.IHFS,
|
DirectDbQuery.executeStatement(insertCrest, HydroConstants.IHFS,
|
||||||
QueryLanguage.SQL);
|
QueryLanguage.SQL);
|
||||||
} catch (VizException e) {
|
} catch (VizException e) {
|
||||||
/* If this update fails then try an insert */
|
|
||||||
if (e.getMessage().contains("crest_pk")) {
|
e.printStackTrace();
|
||||||
|
|
||||||
|
//exception with duplicate key value is throwed in the 2nd cause
|
||||||
|
|
||||||
|
if (e.getCause().getCause().getMessage().contains("crest_pk")) {
|
||||||
executeUpdate = true;
|
executeUpdate = true;
|
||||||
} else {
|
} else {
|
||||||
errMsg = "Error inserting data into database.";
|
errMsg = "Error inserting data into database.";
|
||||||
}
|
}
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (executeUpdate) {
|
if (executeUpdate) {
|
||||||
|
|
|
@ -25,6 +25,8 @@ import org.eclipse.core.commands.ExecutionException;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.ui.PlatformUI;
|
import org.eclipse.ui.PlatformUI;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.ohd.AppsDefaults;
|
||||||
|
import com.raytheon.viz.mpe.ui.MPEDisplayManager;
|
||||||
import com.raytheon.viz.mpe.ui.dialogs.postanalysis.SummedHourlyMpeDlg;
|
import com.raytheon.viz.mpe.ui.dialogs.postanalysis.SummedHourlyMpeDlg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -37,7 +39,7 @@ import com.raytheon.viz.mpe.ui.dialogs.postanalysis.SummedHourlyMpeDlg;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Jun 12, 2011 lvenable Initial creation
|
* Jun 12, 2011 lvenable Initial creation
|
||||||
*
|
* Feb 26, 2015 9554 cgobs Enable button based on mpe_post_analysis token and MPE 1-hr vs DQC mode
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author lvenable
|
* @author lvenable
|
||||||
|
@ -60,4 +62,25 @@ public class SummedHourlyMpeAction extends AbstractHandler {
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isEnabled()
|
||||||
|
{
|
||||||
|
|
||||||
|
System.out.println("In SummedHourlyMpeAction.isEnabled()");
|
||||||
|
|
||||||
|
AppsDefaults appsDefaults = AppsDefaults.getInstance();
|
||||||
|
boolean isPostAnalysisOnByToken = appsDefaults.getBoolean("mpe_post_analysis", false);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
MPEDisplayManager mgr = MPEDisplayManager.getCurrent();
|
||||||
|
boolean isDailyQCOn = (mgr.isQpf() || mgr.isZflag() || mgr.isMaxmin());
|
||||||
|
|
||||||
|
boolean isPostAnalysisAvailable = isDailyQCOn && isPostAnalysisOnByToken;
|
||||||
|
|
||||||
|
return isPostAnalysisAvailable;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,34 +1,8 @@
|
||||||
#! /bin/ksh
|
#! /bin/ksh
|
||||||
# purge_mpe_files
|
# purge_mpe_files
|
||||||
# This script purges mpe (Multi-sensor-Precipitation Estimator)files
|
# This script purges mpe (Multi-sensor-Precipitation Estimator)files
|
||||||
# History: Deng, Jingtao August 09, 2001
|
|
||||||
# modified by P. Tilles 4/22/2002
|
|
||||||
# - removed stage3 directories
|
|
||||||
# - added jpeg, netCDF, grib directories
|
|
||||||
# modified by P. Tilles 10/2002
|
|
||||||
# - added DISAGG_LOG_DIR purge
|
|
||||||
# modified by P. Tilles 9/2003
|
|
||||||
# - added LIGHTNING_LOG_DIR purge
|
|
||||||
# March 9 2004 - added purge of mlmosaic files - pst
|
|
||||||
# March 25 2004 - added purge of lsatpre files - pst
|
|
||||||
# - removed delete from satel_precip dir
|
|
||||||
# March 30 2004 - added purge of state var files
|
|
||||||
# for local bias corr satellite - pst
|
|
||||||
# May 5, 2006 - Modified to fix mistakes made in logic
|
|
||||||
# to purge MAXRMOSAIC, AVGRMOSAIC, and
|
|
||||||
# P3LMOSAIC fields. Added logic to purge
|
|
||||||
# GAGETRIANGLES.
|
|
||||||
# May 5, 2006 - Modified to purge DailyQC files.
|
|
||||||
# Nov 17, 2006 - Modified to purge sbn grib and sbn qpe directories.
|
|
||||||
# May 2007 - Added SRG related fields (3 new fields)
|
|
||||||
# - added "-type f" to all find commands
|
|
||||||
# - added directories for RFC bias transfer RFC bias fields
|
|
||||||
# Sep 2007 - removed stray "i" from delete on FREEZEGRID directory
|
|
||||||
# Nov 2007 - added purge of disagg logs from mpe_editor dir
|
|
||||||
# - changed purge of mpe_fieldgen logs to purge filenames mpe_*
|
|
||||||
# Dec 2007 - removed purge of old disagg logs from old disagg app
|
|
||||||
# Jan 2008 - added purge of DailyQC freezing level preprocessor logs.
|
|
||||||
# April 2014 - add purge dualpol products
|
# April 2014 - add purge dualpol products
|
||||||
|
# March 2015 - added purge of localfield directories and auto_dailyqc logs
|
||||||
|
|
||||||
# This allows you to run this script from outside of ./whfs/bin
|
# This allows you to run this script from outside of ./whfs/bin
|
||||||
RUN_FROM_DIR=`dirname $0`
|
RUN_FROM_DIR=`dirname $0`
|
||||||
|
@ -50,6 +24,7 @@ export PPROC_LOG=$(get_apps_defaults pproc_log)
|
||||||
# Define directories for MPE data.
|
# Define directories for MPE data.
|
||||||
MPELOGS=$MPE_LOG_DIR
|
MPELOGS=$MPE_LOG_DIR
|
||||||
MPEEDITLOGS=$PPROC_LOG/mpe_editor
|
MPEEDITLOGS=$PPROC_LOG/mpe_editor
|
||||||
|
AUTODQCLOGDIR=$MPEEDITLOGS
|
||||||
RFCBIASLOGS=$PPROC_LOG/process_bias_message
|
RFCBIASLOGS=$PPROC_LOG/process_bias_message
|
||||||
GAQLOGS=$GAQ_LOG_DIR
|
GAQLOGS=$GAQ_LOG_DIR
|
||||||
|
|
||||||
|
@ -91,6 +66,10 @@ MPEMLDMOSAIC=$RFCWIDE_OUTPUT_DIR/mldmosaic
|
||||||
MPEAVGRDMOSAIC=$RFCWIDE_OUTPUT_DIR/avgrdmosaic
|
MPEAVGRDMOSAIC=$RFCWIDE_OUTPUT_DIR/avgrdmosaic
|
||||||
MPEMAXRDMOSAIC=$RFCWIDE_OUTPUT_DIR/maxrdmosaic
|
MPEMAXRDMOSAIC=$RFCWIDE_OUTPUT_DIR/maxrdmosaic
|
||||||
|
|
||||||
|
LOCALFIELD1DIR=$RFCWIDE_OUTPUT_DIR/localfield1
|
||||||
|
LOCALFIELD2DIR=$RFCWIDE_OUTPUT_DIR/localfield2
|
||||||
|
LOCALFIELD3DIR=$RFCWIDE_OUTPUT_DIR/localfield3
|
||||||
|
|
||||||
MPERFCBMOSAIC=$RFCWIDE_OUTPUT_DIR/rfcbmosaic
|
MPERFCBMOSAIC=$RFCWIDE_OUTPUT_DIR/rfcbmosaic
|
||||||
MPERFCMMOSAIC=$RFCWIDE_OUTPUT_DIR/rfcmmosaic
|
MPERFCMMOSAIC=$RFCWIDE_OUTPUT_DIR/rfcmmosaic
|
||||||
|
|
||||||
|
@ -331,6 +310,37 @@ find $MPESRDMOSAIC -name '*z' -type f -mtime +1 -print -exec rm {} \; \
|
||||||
find $MPESRDGMOSAIC -name '*z' -type f -mtime +1 -print -exec rm {} \; \
|
find $MPESRDGMOSAIC -name '*z' -type f -mtime +1 -print -exec rm {} \; \
|
||||||
>> $fnm
|
>> $fnm
|
||||||
|
|
||||||
|
# purge LOCALFIELD directories
|
||||||
|
|
||||||
|
if [[ -d $LOCALFIELD1DIR ]]
|
||||||
|
then
|
||||||
|
find $LOCALFIELD1DIR -name '*z' -type f -mtime +1 -print -exec rm {} \; \
|
||||||
|
>> $fnm
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -d $LOCALFIELD2DIR ]]
|
||||||
|
then
|
||||||
|
find $LOCALFIELD2DIR -name '*z' -type f -mtime +1 -print -exec rm {} \; \
|
||||||
|
>> $fnm
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -d $LOCALFIELD3DIR ]]
|
||||||
|
then
|
||||||
|
find $LOCALFIELD3DIR -name '*z' -type f -mtime +1 -print -exec rm {} \; \
|
||||||
|
>> $fnm
|
||||||
|
fi
|
||||||
|
|
||||||
|
# purge auto_dailyQC log files
|
||||||
|
|
||||||
|
echo " " >> $fnm
|
||||||
|
echo " auto_dailyqc log files " >> $fnm
|
||||||
|
|
||||||
|
if [[ -d $AUTODQCLOGDIR ]]
|
||||||
|
then
|
||||||
|
find $AUTODQCLOGDIR -name 'auto_dailyqc*' -type f -mtime +10 -print -exec rm {} \; \
|
||||||
|
>> $fnm
|
||||||
|
fi
|
||||||
|
|
||||||
Dte=`date -u`
|
Dte=`date -u`
|
||||||
echo "End purge_mpe_files at: " $Dte >> $fnm
|
echo "End purge_mpe_files at: " $Dte >> $fnm
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue