From 2b27d444810305d646ec1b9cecbced82e31ad4ac Mon Sep 17 00:00:00 2001 From: "steve.naples" Date: Mon, 12 Jan 2015 19:08:06 +0000 Subject: [PATCH 01/11] ASM #16993 - Restored code to DrawPolygonDlg to use Combo box for fields. Change-Id: I736af4ac43de16c3978c462fca22bb147846d81b Former-commit-id: ba353e25234df10ae8a7c1efa93784d7e4fb3886 [formerly 8d24e3800cf0f885880e7839f8c3f3c8be6e7754] [formerly ac7d03848832bc215a3884dcc167291f417ef3a7] [formerly ba353e25234df10ae8a7c1efa93784d7e4fb3886 [formerly 8d24e3800cf0f885880e7839f8c3f3c8be6e7754] [formerly ac7d03848832bc215a3884dcc167291f417ef3a7] [formerly 9a38ed0b4dca487207b9d60bb3a2ef5f3c6a0776 [formerly ac7d03848832bc215a3884dcc167291f417ef3a7 [formerly 3a8aaf4ab99e8ae93dd9f074c5671cc8f3dc5f8d]]]] Former-commit-id: 9a38ed0b4dca487207b9d60bb3a2ef5f3c6a0776 Former-commit-id: 7c959516609687acf09734f064810f44f908ebdb [formerly 72ada1bba551ef2d8042868a5590fe0f592fb94f] [formerly f0875decd6d0c4d7233cb94c35fa2af4fcb17c05 [formerly 122b1721c3fadd825baed4500f7be90467989a96]] Former-commit-id: 28c8ab01cfdabd4c97a26a6d91e9a53c4179561c [formerly a6a9c3b2e76cbd8c1f2802b7d6618c9a50c244f2] Former-commit-id: 49e3d561921c8f08e201f91a4f53b46ff031e998 --- .../viz/mpe/ui/actions/SaveLevel2Data.java | 6 +- .../ui/dialogs/polygon/DrawPolygonDlg.java | 464 +++--------------- .../raytheon/viz/mpe/util/DailyQcUtils.java | 3 + .../viz/mpe/util/MeanMonthlyPrecip.java | 3 +- 4 files changed, 87 insertions(+), 389 deletions(-) diff --git a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/actions/SaveLevel2Data.java b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/actions/SaveLevel2Data.java index e7cd5bc289..17bc4fb92c 100644 --- a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/actions/SaveLevel2Data.java +++ b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/actions/SaveLevel2Data.java @@ -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); diff --git a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/polygon/DrawPolygonDlg.java b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/polygon/DrawPolygonDlg.java index e011b4dc25..485d42cc88 100644 --- a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/polygon/DrawPolygonDlg.java +++ b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/polygon/DrawPolygonDlg.java @@ -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. * * * @@ -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. diff --git a/cave/com.raytheon.viz.mpe/src/com/raytheon/viz/mpe/util/DailyQcUtils.java b/cave/com.raytheon.viz.mpe/src/com/raytheon/viz/mpe/util/DailyQcUtils.java index 732e86dda5..3c83a3507e 100644 --- a/cave/com.raytheon.viz.mpe/src/com/raytheon/viz/mpe/util/DailyQcUtils.java +++ b/cave/com.raytheon.viz.mpe/src/com/raytheon/viz/mpe/util/DailyQcUtils.java @@ -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(); diff --git a/cave/com.raytheon.viz.mpe/src/com/raytheon/viz/mpe/util/MeanMonthlyPrecip.java b/cave/com.raytheon.viz.mpe/src/com/raytheon/viz/mpe/util/MeanMonthlyPrecip.java index 9be81678db..e204132de6 100644 --- a/cave/com.raytheon.viz.mpe/src/com/raytheon/viz/mpe/util/MeanMonthlyPrecip.java +++ b/cave/com.raytheon.viz.mpe/src/com/raytheon/viz/mpe/util/MeanMonthlyPrecip.java @@ -90,8 +90,9 @@ public class MeanMonthlyPrecip { displayUnit = NonSI.INCH; dataUnit = SI.MILLIMETER; cmc.setDisplayUnit(displayUnit); + cmc.setColorMapUnit(SI.MILLIMETER); cmc.setDataUnit(dataUnit); - UnitConverter dataToImage = cmc.getDataToImageConverter(); + UnitConverter dataToImage = cmc.getColorMapToDisplayConverter();//cmc.getDataToImageConverter(); /* * Loop over the months. Determine for which months PRISM data are From 906ad6794c18ad0fadc9191a4aab68e66f9f7018 Mon Sep 17 00:00:00 2001 From: Ron Anderson Date: Tue, 13 Jan 2015 11:00:05 -0600 Subject: [PATCH 02/11] Issue #3990 Remove multiple smartInit restriction added by DR #3146 Change-Id: I6231da05828bcc76489793c7cf8acd29468b4516 Former-commit-id: 1cd011163c6782403d03c7dfd21576ed70c5c131 [formerly 6248c878ffeb6a32c06644b2ad7c9cf421c8f05d] [formerly 03c265fc9f5c8cd3ee8c4a82d9418df451b98842] [formerly 1cd011163c6782403d03c7dfd21576ed70c5c131 [formerly 6248c878ffeb6a32c06644b2ad7c9cf421c8f05d] [formerly 03c265fc9f5c8cd3ee8c4a82d9418df451b98842] [formerly 0dab6f479707dec3c07b2a2578fd212f0332fc95 [formerly 03c265fc9f5c8cd3ee8c4a82d9418df451b98842 [formerly c4ba2394228935c7725688c11b91c3de130d586b]]]] Former-commit-id: 0dab6f479707dec3c07b2a2578fd212f0332fc95 Former-commit-id: 2785d2a3e4657684abe63de2e5c3a590b65c78b0 [formerly 6e2c48ea00f627a32eb71cc718e31292a7e5cdd9] [formerly 1189d29ab168ea07982b041314aa47e5d998adf1 [formerly 4abb7e718bd34a151d0379dc8c418924910b5313]] Former-commit-id: 58b1eb7a2744204d6518f3bdefdd3ac976cf06d3 [formerly f346f84150a68c1898b1a72adafb56a6e9936746] Former-commit-id: 46f8beb27dc9550c7879f39480700a49a6a0ba3c --- .../edex_static/base/config/gfe/doConfig.py | 38 +------------------ 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/config/gfe/doConfig.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/config/gfe/doConfig.py index 5c57230ee4..42d6d43356 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/config/gfe/doConfig.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/config/gfe/doConfig.py @@ -30,8 +30,6 @@ # ------------ ---------- ----------- -------------------------- # 08/09/2013 #1571 randerso Changed projections to use the Java # ProjectionType enumeration -# 07/09/2014 #3146 randerso Added check for duplicate smartInit -# rferrel Corrected log to alertviz. # ######################################################################## import types @@ -440,7 +438,7 @@ def otherParse(serverhost, mhsid, port, "not an int: " + `vtecRequestTime` if type(port) != int: raise TypeError, "GFESUITE_PORT not an int: " + `port` - javainitmodules = dictCheck(initmodules, list, str, "INITMODULES") + initmodules = dictCheck(initmodules, list, str, "INITMODULES") accumElem = dictCheck(accumElem, list, str, "D2DAccumulativeElements") initskips = dictCheck(initskips, list, int, "INITSKIPS") d2ddbver = dictCheck(d2ddbver, int, None, "D2DDBVERSIONS") @@ -509,41 +507,9 @@ def otherParse(serverhost, mhsid, port, 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) - 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." - - # 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) - - # remove duplicate - for module in modules[1:]: - javainitmodules.remove(module) return serverhost, mhsid, \ - port, javainitmodules, accumElem, \ + port, initmodules, accumElem, \ initskips, d2ddbver, logfilepurge, prddir, home,\ extraWEPrecision, vtecRequestTime, \ autoConfigureNotifyTextProd, \ From e90088526c76581b13b8ca0276069362683a3eb7 Mon Sep 17 00:00:00 2001 From: Michael Gamazaychikov Date: Thu, 15 Jan 2015 16:17:30 -0500 Subject: [PATCH 03/11] ASM #17035 - TextWS locks up when running spell checker. Change-Id: I7dd263367723f37e0ff3d368edcaca11d982a6b3 Former-commit-id: f8387593034fb6d3be78169aedd18a5b2e98f3fb [formerly 3465706d3b5099d0cacb4e12eeb55e7c44b758b3] [formerly a0ad2f71367d987ef572cc0bd3becb4bd2f8d9a8] [formerly f8387593034fb6d3be78169aedd18a5b2e98f3fb [formerly 3465706d3b5099d0cacb4e12eeb55e7c44b758b3] [formerly a0ad2f71367d987ef572cc0bd3becb4bd2f8d9a8] [formerly 544437c762fd4e405a5c805acc5fe4227efa56c8 [formerly a0ad2f71367d987ef572cc0bd3becb4bd2f8d9a8 [formerly 1843d3a64ff42d0533016fd4bb126dd0c86f3f22]]]] Former-commit-id: 544437c762fd4e405a5c805acc5fe4227efa56c8 Former-commit-id: 9e20dd22bcae514d79914baace8daf2f2a5101b2 [formerly e92486e70a86b8dc07984fa190da595501ae72f8] [formerly 03fe18824ae9ef528c9d3aa8c57d40196d705e7a [formerly 3947479184aead5d30a961a78a3802a306749e8e]] Former-commit-id: 4b60bd45c192ab440eadcd363acf6a5e8815c9bb [formerly 96f46b27705f470a0140b93d2f13dddf209cd8fc] Former-commit-id: 7a28ba150ffd8c234fc592600fd9d259fa35180f --- cave/build/cave/memorySettings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cave/build/cave/memorySettings.xml b/cave/build/cave/memorySettings.xml index 918392b814..346a351831 100644 --- a/cave/build/cave/memorySettings.xml +++ b/cave/build/cave/memorySettings.xml @@ -175,11 +175,11 @@ - 256M + 384M - 64M + 96M From 635359c75a2057d62a262831ce046b8f8c5bb75b Mon Sep 17 00:00:00 2001 From: "Qinglu.Lin" Date: Tue, 20 Jan 2015 11:45:21 -0500 Subject: [PATCH 04/11] ASM #14929 - Baseline change needed to prevent getting marine locations outside of CWA in impact SMW's Change-Id: I843e5dd289c9e2841a28b228a8dbc38dce965ad1 Former-commit-id: fe02279038a0a6f71063b72c406b615cfa40d268 [formerly 761fc43aadb4266b3e7ec191e8e81a7b9ba5957e] [formerly 94ee166aa18367d6fa0d122c4f43bfd7316a9e37] [formerly fe02279038a0a6f71063b72c406b615cfa40d268 [formerly 761fc43aadb4266b3e7ec191e8e81a7b9ba5957e] [formerly 94ee166aa18367d6fa0d122c4f43bfd7316a9e37] [formerly 30b5bc6a6249d897e040d6fd812538718e0e2ccd [formerly 94ee166aa18367d6fa0d122c4f43bfd7316a9e37 [formerly d4e1fca39f82eb39fc911c091eb579a785a6cef9]]]] Former-commit-id: 30b5bc6a6249d897e040d6fd812538718e0e2ccd Former-commit-id: bd61990f6d8a31bc9baa262be2c7eadce000a2e4 [formerly 2158f4d56bcf3e91dedd9d75eedd75e8da918aaa] [formerly 77629661f93a8b4db08c266b9e172fdcfbe7a3fe [formerly b85e72b5f88bf2c3ff504872e6726145e6b155fa]] Former-commit-id: c04dc62d08584f97f2852e80121a26f50869ed9f [formerly 1b6728d2362cebae4c920147248bf69b6f2aac93] Former-commit-id: 4d81846dd14b1b4a89b42e127a5737da64157913 --- .../base/warngen/geospatialConfig_MARINE.xml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/geospatialConfig_MARINE.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/geospatialConfig_MARINE.xml index 3b3531dda1..135a7f26a1 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/geospatialConfig_MARINE.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/geospatialConfig_MARINE.xml @@ -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 tags in , + . --> @@ -96,10 +101,7 @@ AREA - - false + true 1 10.0 5 @@ -131,7 +133,7 @@ 1 AREA TRACK - false + true 10 10 @@ -154,7 +156,7 @@ 1 AREA TRACK - false + true 20 10 From fc4473c08aaa108e50ad253cf083dee6a76ff79b Mon Sep 17 00:00:00 2001 From: "Shawn.Hooper" Date: Wed, 21 Jan 2015 12:44:47 -0500 Subject: [PATCH 05/11] ASM #17054 - Disable MRMS Menu in 14.3.1 Change-Id: I071606c7c14ed0332b3c714a67cebab29bfc67f0 Former-commit-id: 6ce0645ce9466cb96ccbc24d778366d6bb526346 [formerly 9e836015053213ba289b2de5f03b0eb620556719] [formerly bd5dfed07240a2e93590123184fba44ef2dfe6d0] [formerly 6ce0645ce9466cb96ccbc24d778366d6bb526346 [formerly 9e836015053213ba289b2de5f03b0eb620556719] [formerly bd5dfed07240a2e93590123184fba44ef2dfe6d0] [formerly d0b7b06d973da8a297049b87bb66b34a4b781726 [formerly bd5dfed07240a2e93590123184fba44ef2dfe6d0 [formerly 7f6638dd595b99d6592c58af42f898e0f1b2a02a]]]] Former-commit-id: d0b7b06d973da8a297049b87bb66b34a4b781726 Former-commit-id: e0efc469ad1cdf030c210a630ae2f18e982db6a0 [formerly 6f389bd80cc8a28976267122f54626dbe8c7f13b] [formerly 6cc36c12fc5dfa04a527ad1dbc3c03b38b5d90d3 [formerly dcf95652a7a6c9df6c058f466862c1cb5bb2b3de]] Former-commit-id: bac7039cc7209620970b4b851faefea252d74872 [formerly ac799987e37437cdb48e7666731eebd67b762350] Former-commit-id: 0a224087c8324a968fc4b0fc9b043cee9df0cc61 --- cave/com.raytheon.viz.grid/localization/menus/mrms/mrms.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cave/com.raytheon.viz.grid/localization/menus/mrms/mrms.xml b/cave/com.raytheon.viz.grid/localization/menus/mrms/mrms.xml index 2b25c6b781..6fec96a168 100644 --- a/cave/com.raytheon.viz.grid/localization/menus/mrms/mrms.xml +++ b/cave/com.raytheon.viz.grid/localization/menus/mrms/mrms.xml @@ -6,5 +6,5 @@ - - \ No newline at end of file + + From 16afd1cbfdec244489dbea1263a0f9a4f4c20c8a Mon Sep 17 00:00:00 2001 From: "steve.naples" Date: Fri, 23 Jan 2015 20:40:48 +0000 Subject: [PATCH 06/11] ASM #17051 MPE: Daily QC will not display Points+Grids together. Change-Id: Ic74de62f60769456e7fd2762690e539cc553062a Former-commit-id: 8d7fdfae670d6f5de6eb93707a2554421999f75b [formerly 6811eb83a7835fb83fa856ab9417fc6cbbcd8b9d] [formerly 64882421659585f4db191b4af900dd4659a8368b] [formerly 8d7fdfae670d6f5de6eb93707a2554421999f75b [formerly 6811eb83a7835fb83fa856ab9417fc6cbbcd8b9d] [formerly 64882421659585f4db191b4af900dd4659a8368b] [formerly 540ea64498a9d430cef422d84d091c79d68c2567 [formerly 64882421659585f4db191b4af900dd4659a8368b [formerly 8db85622ff4d0f7202c4d2c2e6eefeefe2ef39c3]]]] Former-commit-id: 540ea64498a9d430cef422d84d091c79d68c2567 Former-commit-id: cd5a0b88430244ff651704f44bc15640d5f7dca8 [formerly 7287103c0dc10d4eeca22aa08bdeb7103feb8232] [formerly 6c3edfceb91b218447b84c049d8cf0c0e0d47e2e [formerly b2b9d3905d0ca4c19b611a0cb4a20907cf377c9c]] Former-commit-id: 1a5cda28c5d25a3b402a8593b82f6fe749b9470b [formerly df1504f78170d715aa5138bd24f2e5126acb4aa4] Former-commit-id: 5734b0f998f7b05ebcb539cba3e491f90b846770 --- .../viz/mpe/ui/actions/DrawDQCStations.java | 103 +++++++++--------- .../mpe/ui/rsc/PlotGriddedPrecipResource.java | 73 ++++++------- .../mpe/ui/rsc/PointPrecipPlotResource.java | 36 +++--- .../raytheon/viz/mpe/util/DailyQcUtils.java | 54 ++++----- 4 files changed, 133 insertions(+), 133 deletions(-) diff --git a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/actions/DrawDQCStations.java b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/actions/DrawDQCStations.java index 8e829a6cfc..7b9f897daa 100644 --- a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/actions/DrawDQCStations.java +++ b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/actions/DrawDQCStations.java @@ -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 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 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"); diff --git a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/rsc/PlotGriddedPrecipResource.java b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/rsc/PlotGriddedPrecipResource.java index ce8e6d2158..63c093fea5 100644 --- a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/rsc/PlotGriddedPrecipResource.java +++ b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/rsc/PlotGriddedPrecipResource.java @@ -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 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 diff --git a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/rsc/PointPrecipPlotResource.java b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/rsc/PointPrecipPlotResource.java index 0462cb1aaf..b96e78864a 100644 --- a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/rsc/PointPrecipPlotResource.java +++ b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/rsc/PointPrecipPlotResource.java @@ -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 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; } /** diff --git a/cave/com.raytheon.viz.mpe/src/com/raytheon/viz/mpe/util/DailyQcUtils.java b/cave/com.raytheon.viz.mpe/src/com/raytheon/viz/mpe/util/DailyQcUtils.java index 3c83a3507e..3c2a7db395 100644 --- a/cave/com.raytheon.viz.mpe/src/com/raytheon/viz/mpe/util/DailyQcUtils.java +++ b/cave/com.raytheon.viz.mpe/src/com/raytheon/viz/mpe/util/DailyQcUtils.java @@ -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,23 +261,23 @@ 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 precip_stations = new ArrayList(); + public static ArrayList precip_stations = new ArrayList(); - public ArrayList temperature_stations = new ArrayList(); + public static ArrayList temperature_stations = new ArrayList(); - public ArrayList freezing_stations = new ArrayList(); + public static ArrayList freezing_stations = new ArrayList(); - 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(); @@ -289,11 +289,11 @@ public class DailyQcUtils { 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,7 +443,7 @@ 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]; @@ -476,25 +476,25 @@ public class DailyQcUtils { public 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); @@ -2130,7 +2130,7 @@ public class DailyQcUtils { /** * @return the hrap_grid */ - public Hrap_Grid getHrap_grid() { + public static Hrap_Grid getHrap_grid() { return hrap_grid; } From 48a9ef124e7044b8fca62b5fb76ab090699fcc9e Mon Sep 17 00:00:00 2001 From: "Shawn.Hooper" Date: Tue, 27 Jan 2015 11:22:56 -0500 Subject: [PATCH 07/11] ASM #17071 - Add tokens for Alert Alarm System Change-Id: Idec6bd4aabe6d317c1cc168113a346567d30b189 Former-commit-id: 28a4627f0c98a82af398019954672fc262d15dd0 [formerly 0a91e7cf4776c489ee52b563632b088f0c7da47d] [formerly 9ca10f111a675e37a023a8881c19e4a9599aa613] [formerly 28a4627f0c98a82af398019954672fc262d15dd0 [formerly 0a91e7cf4776c489ee52b563632b088f0c7da47d] [formerly 9ca10f111a675e37a023a8881c19e4a9599aa613] [formerly 875758538605b63507c0b7e6ed2e694103ddfe73 [formerly 9ca10f111a675e37a023a8881c19e4a9599aa613 [formerly 2bba487d259e87c20e43a8e10573392dca011206]]]] Former-commit-id: 875758538605b63507c0b7e6ed2e694103ddfe73 Former-commit-id: 50b771f5bed56c55ec006ea678939cf1197333d1 [formerly b081efacfdeacfc033bd9c31e964fe4d13dad165] [formerly e19a6c5584d3894971f49c5b69ea1674a9e6f6a4 [formerly 36e647e764a2fca825535fff5403e3bce7fdd7e5]] Former-commit-id: 35f1027150186dd7c9b7c24221fca600725d4980 [formerly 00d451f5c8bae8ab00b2a9a3469afe4350e30f3d] Former-commit-id: 1f177b82c0e3f769bf827b01fec78b421fd03cfb --- .../common_static/base/hydro/Apps_defaults | 44 ++++++++++++++++++- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/edexOsgi/com.raytheon.uf.common.ohd/utility/common_static/base/hydro/Apps_defaults b/edexOsgi/com.raytheon.uf.common.ohd/utility/common_static/base/hydro/Apps_defaults index 6b806b60c1..a0cfcd9dd6 100644 --- a/edexOsgi/com.raytheon.uf.common.ohd/utility/common_static/base/hydro/Apps_defaults +++ b/edexOsgi/com.raytheon.uf.common.ohd/utility/common_static/base/hydro/Apps_defaults @@ -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: # From 3c5b5e475c64de4fa5c96ad6063830e110fa123f Mon Sep 17 00:00:00 2001 From: "steve.naples" Date: Tue, 27 Jan 2015 18:36:07 +0000 Subject: [PATCH 08/11] ASM #559 - Updated PostAnalysisManager and SummedHourlyMpeDlg to fix issue when opening PostAnalysis. Change-Id: I9c2dcfd6af891b9ce0b60443a46e5cf9f3c7e99a Former-commit-id: eedecf76d0e7ab3684c96f8fa32a92e39f470a83 [formerly ffb1fbe0e608e32587787368799c1cf80a1750db] [formerly 349ff47f53dfea462797cd9430b96f0c7070b55e] [formerly eedecf76d0e7ab3684c96f8fa32a92e39f470a83 [formerly ffb1fbe0e608e32587787368799c1cf80a1750db] [formerly 349ff47f53dfea462797cd9430b96f0c7070b55e] [formerly 565c4d69da240529bb8c54e2c2b68e48b35ac676 [formerly 349ff47f53dfea462797cd9430b96f0c7070b55e [formerly fe5c51f43047d77202e6d5056d7d8be1736562bd]]]] Former-commit-id: 565c4d69da240529bb8c54e2c2b68e48b35ac676 Former-commit-id: 98edc2db58b1f79902f0ce583924c547dc2eb2f3 [formerly 2d1e742a7b89fbe3124727097c722206e11ad76a] [formerly 134ebd983a368ffd7a3b003163e80e544b23982d [formerly 19e9977a61e8b8d1ad02a8eca67ec3abea9196ca]] Former-commit-id: 46a10b7fd641faab8930cf246bd47c780ddce651 [formerly 9d178a199fc32100695cbef60153432b4a523562] Former-commit-id: bfa932f1e9a5043ff104411bbe5865fc0b905d8f --- .../postanalysis/PostAnalysisManager.java | 40 +++++++++---------- .../postanalysis/SummedHourlyMpeDlg.java | 14 +++---- 2 files changed, 25 insertions(+), 29 deletions(-) diff --git a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/postanalysis/PostAnalysisManager.java b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/postanalysis/PostAnalysisManager.java index 9cb80cc03d..5226197a40 100644 --- a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/postanalysis/PostAnalysisManager.java +++ b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/postanalysis/PostAnalysisManager.java @@ -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 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 precipStationList = dqc.precip_stations; + List 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; diff --git a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/postanalysis/SummedHourlyMpeDlg.java b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/postanalysis/SummedHourlyMpeDlg.java index ed6d482140..dea16fd548 100644 --- a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/postanalysis/SummedHourlyMpeDlg.java +++ b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/dialogs/postanalysis/SummedHourlyMpeDlg.java @@ -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]; From 2661d40e592158a28f0e9860e8ef97233fd8ba8a Mon Sep 17 00:00:00 2001 From: "steve.naples" Date: Tue, 27 Jan 2015 18:36:49 +0000 Subject: [PATCH 09/11] ASM #283 - MPE GroupEditPrecipStns updated to fix issue with selecting gages when filtered out with Reverse Point slider. Change-Id: I9743b37adfb8658d40458c00204ad87c50c10528 Former-commit-id: 00b3fb4c424f6bc445565196b5fd8ebd296b9c8f [formerly 86b405425172378bda2bd5e29caca76fc8e53c1a] [formerly d960e4bba16a17e5b86ffa35c1f145bc1bd06c7c] [formerly 00b3fb4c424f6bc445565196b5fd8ebd296b9c8f [formerly 86b405425172378bda2bd5e29caca76fc8e53c1a] [formerly d960e4bba16a17e5b86ffa35c1f145bc1bd06c7c] [formerly 0260da784ddfd35f35f86728f16a1d41c626b892 [formerly d960e4bba16a17e5b86ffa35c1f145bc1bd06c7c [formerly b10de7db401a9d4199c9eed98e41913a87b4b64a]]]] Former-commit-id: 0260da784ddfd35f35f86728f16a1d41c626b892 Former-commit-id: c24217ff0edc90fcaec345d059a2de82bd9fc3c8 [formerly 3c53be0a2855d17a8339ad48073a932d2bc2da41] [formerly 99a093ac1fddb033378e291a879ba19f680c6a0f [formerly 88dcd9b784f974575abbdb8869eeefa22d562c1a]] Former-commit-id: 3b383b82ad81bfd8d0cf64f93df9e47810c2a238 [formerly 6ddc4a0a1afd02dbd460f2b8c7f013e5fb34be12] Former-commit-id: 1baaa49edf07ed51b7cc042a47192c60fbc79164 --- .../mpe/ui/actions/GroupEditPrecipStns.java | 90 +++++++++++-------- .../raytheon/viz/mpe/util/DailyQcUtils.java | 10 +-- 2 files changed, 56 insertions(+), 44 deletions(-) diff --git a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/actions/GroupEditPrecipStns.java b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/actions/GroupEditPrecipStns.java index e32d951ae6..98b0bc8d00 100644 --- a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/actions/GroupEditPrecipStns.java +++ b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/actions/GroupEditPrecipStns.java @@ -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 * * * @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; diff --git a/cave/com.raytheon.viz.mpe/src/com/raytheon/viz/mpe/util/DailyQcUtils.java b/cave/com.raytheon.viz.mpe/src/com/raytheon/viz/mpe/util/DailyQcUtils.java index 3c2a7db395..6bede00384 100644 --- a/cave/com.raytheon.viz.mpe/src/com/raytheon/viz/mpe/util/DailyQcUtils.java +++ b/cave/com.raytheon.viz.mpe/src/com/raytheon/viz/mpe/util/DailyQcUtils.java @@ -283,9 +283,9 @@ public class DailyQcUtils { 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[]; @@ -445,13 +445,13 @@ public class DailyQcUtils { 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,7 +474,7 @@ 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 static int plot_view = 0; From ec1498a74e15881b57575ac3f741b9d670adf4e7 Mon Sep 17 00:00:00 2001 From: Chin Chen Date: Thu, 29 Jan 2015 08:24:56 -0500 Subject: [PATCH 10/11] VLab Issue #5930 - NSHARP Hodograph Does Not Loop in D2D Lite Configuration Change-Id: I20213e4e2bbcd7b69006d17c8dd61a273f52a13c Former-commit-id: 9078ac4550cb699db1665ff8a6c170a196c5b689 [formerly d6afb5e45a17d6b2fdffae00590731cc4477bf61] [formerly 0ef94ede96853e5b6eaec50a7c7728299a661421] [formerly 9078ac4550cb699db1665ff8a6c170a196c5b689 [formerly d6afb5e45a17d6b2fdffae00590731cc4477bf61] [formerly 0ef94ede96853e5b6eaec50a7c7728299a661421] [formerly 5da7d7e78bf30ce9d678398b97580ddb510449fa [formerly 0ef94ede96853e5b6eaec50a7c7728299a661421 [formerly 132751d6236f2bdede08f52072fc963743b1ba34]]]] Former-commit-id: 5da7d7e78bf30ce9d678398b97580ddb510449fa Former-commit-id: 0b03c615bcc70e9b066f19d34c913b76945b1cde [formerly db9f2fe96782f1b583e4bebe177e50db5a95691c] [formerly e4a98eec88332888c1a9e9168077017d66835116 [formerly de9cb710bf40e65ebc87368f837ddc27b6b261a1]] Former-commit-id: dc8e29c268f5bd276d26fa764c9f9fa6064dbf19 [formerly 76ea481366115fde5e3f5153d7a5b2c9eb44c313] Former-commit-id: 544e470b41f2f6feb5e72dd11c9484d81821bb31 --- .../display/NsharpAbstractPaneDescriptor.java | 79 ++++++++++++++++--- .../ncep/ui/nsharp/display/NsharpEditor.java | 36 ++++++--- .../display/NsharpHodoPaneDescriptor.java | 53 ++++++++++++- .../display/NsharpSkewTPaneDescriptor.java | 70 ++-------------- 4 files changed, 151 insertions(+), 87 deletions(-) diff --git a/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/NsharpAbstractPaneDescriptor.java b/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/NsharpAbstractPaneDescriptor.java index 2bbad12a99..d33f29f61f 100644 --- a/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/NsharpAbstractPaneDescriptor.java +++ b/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/NsharpAbstractPaneDescriptor.java @@ -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 * * * @@ -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"); + } + } + + }; + } } diff --git a/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/NsharpEditor.java b/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/NsharpEditor.java index f8a020eab7..35db1031d9 100644 --- a/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/NsharpEditor.java +++ b/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/NsharpEditor.java @@ -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 * * * @@ -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; + } + + } \ No newline at end of file diff --git a/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/NsharpHodoPaneDescriptor.java b/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/NsharpHodoPaneDescriptor.java index b52bf3cb3d..d6ac487932 100644 --- a/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/NsharpHodoPaneDescriptor.java +++ b/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/NsharpHodoPaneDescriptor.java @@ -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 * * * @@ -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 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); + + } + } } diff --git a/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/NsharpSkewTPaneDescriptor.java b/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/NsharpSkewTPaneDescriptor.java index 8bf47918b0..8bf1a70bca 100644 --- a/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/NsharpSkewTPaneDescriptor.java +++ b/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/NsharpSkewTPaneDescriptor.java @@ -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 * * * @@ -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 list = resourceList .getResourcesByTypeAsType(NsharpSkewTPaneResource.class); if (list != null && !list.isEmpty()) { From 7f77c349522d477a81431b74e36b36bc3a6bb944 Mon Sep 17 00:00:00 2001 From: Chin Chen Date: Thu, 29 Jan 2015 08:40:49 -0500 Subject: [PATCH 11/11] VLab Issue #5929 - NSHARP freezes when loading a sounding from MDCRS products in Volume Browser Change-Id: I6578174c6f446a2d702eeca0577717715d13fcfa Former-commit-id: 7a93024b68427f862e86bb44e0cc02f74742d8ac [formerly cae95251bbade7bf1e4af9500e4e06a92a52422b] [formerly ddaca01b1d3d4a72dfeb8824671eb571bf60b617] [formerly 7a93024b68427f862e86bb44e0cc02f74742d8ac [formerly cae95251bbade7bf1e4af9500e4e06a92a52422b] [formerly ddaca01b1d3d4a72dfeb8824671eb571bf60b617] [formerly ea9ef0f93eb9d90b2f123b1818c7228f59fe92d2 [formerly ddaca01b1d3d4a72dfeb8824671eb571bf60b617 [formerly 209e62cc40160cd023e42711a008afb0ef39d3ea]]]] Former-commit-id: ea9ef0f93eb9d90b2f123b1818c7228f59fe92d2 Former-commit-id: 4879b684cae292679db9b62de6cc71d555ffb282 [formerly 11ac77f233d028d94cd52d5f88b0815422f3801b] [formerly e9bf92a492fdf9a86e7909dcbc44c55359586346 [formerly 4d2a987a9f82702f0d9829ae47b12e21e3a88013]] Former-commit-id: 92005cfcdd47e1552b45a580f06d04990a9559a3 [formerly e1642ff74e89be85545b33786980482c6af174ab] Former-commit-id: 9b35775e37baa04127c3874e3d90d1601bf9556b --- .../NsharpSoundingElementStateProperty.java | 15 +- .../display/rsc/NsharpDataPaneResource.java | 39 +- .../display/rsc/NsharpHodoPaneResource.java | 24 +- .../display/rsc/NsharpInsetPaneResource.java | 7 +- .../display/rsc/NsharpResourceHandler.java | 119 ++- .../display/rsc/NsharpSkewTPaneResource.java | 798 +++++++++--------- .../rsc/NsharpSpcGraphsPaneResource.java | 6 +- .../display/rsc/NsharpWitoPaneResource.java | 60 +- 8 files changed, 597 insertions(+), 471 deletions(-) diff --git a/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/NsharpSoundingElementStateProperty.java b/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/NsharpSoundingElementStateProperty.java index fccb434c63..e014e6e015 100644 --- a/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/NsharpSoundingElementStateProperty.java +++ b/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/NsharpSoundingElementStateProperty.java @@ -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 * * * @@ -37,9 +40,10 @@ public class NsharpSoundingElementStateProperty { private int compColorIndex; private List sndLyLst; private List sndLyLstBk; + private boolean goodData = true; //#5929 public NsharpSoundingElementStateProperty(String elementDescription, String stnDescription, - String timeDescription, NsharpStationInfo stnInfo, List sndLyLst) { + String timeDescription, NsharpStationInfo stnInfo, List 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(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; + } } \ No newline at end of file diff --git a/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/rsc/NsharpDataPaneResource.java b/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/rsc/NsharpDataPaneResource.java index 1ea1597a9e..50f81bcafe 100644 --- a/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/rsc/NsharpDataPaneResource.java +++ b/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/rsc/NsharpDataPaneResource.java @@ -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 * * * @@ -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; diff --git a/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/rsc/NsharpHodoPaneResource.java b/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/rsc/NsharpHodoPaneResource.java index 3a32bf087d..460b89a7c6 100644 --- a/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/rsc/NsharpHodoPaneResource.java +++ b/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/rsc/NsharpHodoPaneResource.java @@ -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 * * * @@ -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() = 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 diff --git a/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/rsc/NsharpInsetPaneResource.java b/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/rsc/NsharpInsetPaneResource.java index 94d4c5a028..5b48dacb7e 100644 --- a/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/rsc/NsharpInsetPaneResource.java +++ b/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/rsc/NsharpInsetPaneResource.java @@ -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 * * * @@ -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); diff --git a/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/rsc/NsharpResourceHandler.java b/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/rsc/NsharpResourceHandler.java index a8cf1e5a6f..b100409d46 100644 --- a/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/rsc/NsharpResourceHandler.java +++ b/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/rsc/NsharpResourceHandler.java @@ -15,6 +15,9 @@ * 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 * * * @author Chin Chen @@ -161,6 +164,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. @@ -188,7 +193,7 @@ public class NsharpResourceHandler { private int currentSoundingLayerIndex = 0; private int hodoEditingSoundingLayerIndex = 0; - + private boolean plotInteractiveTemp = false; private Coordinate interactiveTempPointCoordinate; @@ -981,6 +986,7 @@ public class NsharpResourceHandler { if (skewtPaneRsc != null) skewtPaneRsc .setCurrentSkewTEditMode(NsharpConstants.SKEWT_EDIT_MODE_EDITPOINT); + elem.setGoodData(checkDataIntegrity(soundingLys));//#5929 resetData(); } @@ -993,7 +999,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); @@ -1013,7 +1024,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 @@ -1044,11 +1055,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) @@ -1057,7 +1064,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. @@ -1177,7 +1184,7 @@ public class NsharpResourceHandler { private void addElementToTableAndLists(String stnId_timeLine_sndType, String stnId, String tmLine, String sndType, - NsharpStationInfo stnInfo, List sndLyLst) { + NsharpStationInfo stnInfo, List sndLyLst, boolean goodData) { // System.out.println("stn to be added "+ stnId + " timeline "+tmLine); NsharpSoundingElementStateProperty newSndPropElem = null; int tmIndex = getIndexFromElementList(tmLine, timeElementList); @@ -1197,7 +1204,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); } @@ -1214,7 +1221,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); @@ -1231,7 +1238,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); @@ -1253,7 +1260,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); @@ -1274,7 +1281,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); @@ -1296,7 +1303,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); @@ -1321,7 +1328,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); @@ -1357,7 +1364,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 { @@ -1405,7 +1412,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); @@ -1862,6 +1869,21 @@ public class NsharpResourceHandler { * * } */ + //task#5929 + private boolean checkDataIntegrity(List 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, @@ -1875,8 +1897,8 @@ public class NsharpResourceHandler { // // newkey= // String newkey =key.replace("NCUAIR", "gpduair"); // String newkey = // String newkey= key.replace("NAMS", "SSS"); - //String newkey = key.replace("130925/00(Wed)V000", "130925/00(Thu)V000"); -// soundMap.put(newkey, sndLy); +// String newkey = key.replace("130925/17(Wed)V017", "131001/00(Thu)V000"); + // soundMap.put(newkey, sndLy); // } // // stnInfo.setSndType(stnInfo.getSndType().replace("NCUAIR", // // // "gpduair")); // stnInfo.setSndType(stnInfo.getSndType().replace( @@ -1931,9 +1953,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 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 @@ -2022,8 +2050,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 @@ -2627,10 +2657,7 @@ public class NsharpResourceHandler { break; } - if (compareSndIsOn) { - handleUserPickNewTimeLine(currentTimeElementListIndex) ; - return; - } + curTimeLinePage = currentTimeElementListIndex / numTimeLinePerPage + 1; setCurSndProfileProp(); @@ -2767,9 +2794,6 @@ public class NsharpResourceHandler { // we should get out of here break; } else if (compareSndIsOn) { - handleUserPickNewTimeLine(targetIndex) ; - return; - /* Chin TBD 12112014 boolean found = false; if (currentStnElementListIndex >= 0 && currentSndElementListIndex >= 0 @@ -2795,7 +2819,6 @@ public class NsharpResourceHandler { if (!found) { currentSndElementListIndex = -1; } else { - int colorIndex = NsharpConstants.LINE_COMP1; for (NsharpOperationElement elm : sndElementList) { if (elm.getActionState() == NsharpConstants.ActState.INACTIVE) @@ -2811,13 +2834,11 @@ public class NsharpResourceHandler { if (colorIndex > NsharpConstants.LINE_COMP10) colorIndex = NsharpConstants.LINE_COMP1; } - } // no matter we find current snd type for this stn or // not // we should get out of here break; - */ } else { break; } @@ -4043,7 +4064,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(); @@ -4069,6 +4096,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, @@ -4086,7 +4120,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(); @@ -4112,6 +4152,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) { @@ -4440,4 +4486,9 @@ public class NsharpResourceHandler { refreshPane(); return true; } + //#5929 + public boolean isGoodData() { + return goodData; + } + } diff --git a/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/rsc/NsharpSkewTPaneResource.java b/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/rsc/NsharpSkewTPaneResource.java index 5238c421e2..b4f5606f6b 100644 --- a/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/rsc/NsharpSkewTPaneResource.java +++ b/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/rsc/NsharpSkewTPaneResource.java @@ -14,7 +14,9 @@ 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 - * 12/11/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 * * * @@ -1740,6 +1742,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 @@ -1768,7 +1772,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; } @@ -1779,7 +1783,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; } @@ -1828,376 +1832,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 && !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 - && !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 - && !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 - && !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.isDcape() == true - && 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); + 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) { + 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 && rscHandler.isGoodData() //#5929 + && !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 && rscHandler.isGoodData() //#5929 + && !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 && rscHandler.isGoodData() //#5929 + && !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.isEffLayer() == true - && !compareStnIsOn && !compareTmIsOn && !compareSndIsOn) { - // draw effective layer lines - // drawEffectiveLayerLines(target); - target.drawWireframeShape(effectiveLayerLineShape, - NsharpConstants.color_cyan_md, 2, - commonLineStyle, font10); - } - // cloud - if (graphConfigProperty.isCloud() == true - && !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); - // 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 + && !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) { + // 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) { + 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); + 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 stnElemList = rscHandler + .getStnElementList(); + List timeElemList = rscHandler + .getTimeElementList(); + List sndElemList = rscHandler + .getSndElementList(); + List>> 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 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 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 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 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 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 stnElemList = rscHandler - .getStnElementList(); - List timeElemList = rscHandler - .getTimeElementList(); - List sndElemList = rscHandler - .getSndElementList(); - List>> 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 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 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 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 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 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); @@ -3506,31 +3518,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() { diff --git a/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/rsc/NsharpSpcGraphsPaneResource.java b/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/rsc/NsharpSpcGraphsPaneResource.java index d92226edb6..2a12ba4abb 100644 --- a/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/rsc/NsharpSpcGraphsPaneResource.java +++ b/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/rsc/NsharpSpcGraphsPaneResource.java @@ -17,7 +17,9 @@ package gov.noaa.nws.ncep.ui.nsharp.display.rsc; * 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 * * * @author Chin Chen @@ -1896,7 +1898,7 @@ 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); diff --git a/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/rsc/NsharpWitoPaneResource.java b/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/rsc/NsharpWitoPaneResource.java index 30ac01fe00..c41f087f53 100644 --- a/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/rsc/NsharpWitoPaneResource.java +++ b/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/display/rsc/NsharpWitoPaneResource.java @@ -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 * * * @@ -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