Issue #95
Change-Id: If9d3827df8c8d9e1798910113112415f98bdaa6b Former-commit-id:ab9a7b925b
[formerly51f7643752
] [formerly2b7b91c35b
[formerly 35ae75bbd4f542e437879191873fece08a463d46]] Former-commit-id:2b7b91c35b
Former-commit-id:41ff33c799
This commit is contained in:
parent
a23db3e2d8
commit
d4094866da
2 changed files with 188 additions and 10 deletions
|
@ -122,8 +122,8 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
|||
* Jun 06, 2013 2075 njensen Removed loading labels
|
||||
* Jul 09, 2013 2152 njensen Fix potential widget disposed error
|
||||
* Jun 20, 2013 14907 gzhang Thresholds menu ColorCell check fix.
|
||||
* Jan 09, 2014 DR16096 gzhang Fix QPFSCAN not showing M issue for different radar source.
|
||||
* </pre>
|
||||
*
|
||||
* @author lvenable
|
||||
* @version 1.0
|
||||
*/
|
||||
|
@ -1343,7 +1343,7 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
|||
// Update the data in the FFMPConfig with the selections
|
||||
this.ffmpConfig.setVisibleColumns(attrData);
|
||||
this.ffmpConfig.setAttrData(attrData);
|
||||
this.ffmpTable.showHideTableColumns();
|
||||
if( ! updateData) this.ffmpTable.showHideTableColumns(); // DR 16096
|
||||
boolean changeSplit = false;
|
||||
|
||||
if (timeDurScale.split != ffmpConfig.isSplit()) {
|
||||
|
|
|
@ -80,9 +80,9 @@ import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpTableConfigData;
|
|||
* July 1, 2013 2155 dhladky Fixed bug that created more rows than were actually needed.
|
||||
* Jul 15, 2013 2184 dhladky Remove all HUC's for storage except ALL
|
||||
* Jul 16, 2013 2197 njensen Use FFMPBasinData.hasAnyBasins() for efficiency
|
||||
* Jan 09, 2014 DR16096 gzhang Fix QPFSCAN not showing M issue for different radar source.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
* @version 1.0
|
||||
*/
|
||||
|
@ -189,7 +189,7 @@ public class FFMPDataGenerator {
|
|||
|
||||
FFMPBasinData fbd = baseRec.getBasinData();
|
||||
tData = new FFMPTableData(fbd.getBasins().size());
|
||||
|
||||
List<List<Long>> huclists = getOtherSiteQpfBasins(siteKey,huc, domains);// DR 16096
|
||||
for (Long key : fbd.getBasins().keySet()) {
|
||||
|
||||
FFMPBasinMetaData fmdb = ft.getBasin(siteKey, key);
|
||||
|
@ -199,7 +199,7 @@ public class FFMPDataGenerator {
|
|||
continue;
|
||||
|
||||
}
|
||||
|
||||
this.filterOtherSiteHucs(huclists, key);// DR 16096
|
||||
for (DomainXML domain : domains) {
|
||||
|
||||
String cwa = domain.getCwa();
|
||||
|
@ -249,7 +249,7 @@ public class FFMPDataGenerator {
|
|||
List<Long> keyList = ft
|
||||
.getHucKeyList(siteKey, huc, domains);
|
||||
tData = new FFMPTableData(keyList.size());
|
||||
|
||||
List<List<Long>> huclists = getOtherSiteQpfBasins(siteKey,huc, domains);// DR 16096
|
||||
for (Long key : keyList) {
|
||||
|
||||
List<Long> pfafs = ft.getAggregatePfafs(key, siteKey,
|
||||
|
@ -269,7 +269,7 @@ public class FFMPDataGenerator {
|
|||
if (fmdb != null) {
|
||||
|
||||
try {
|
||||
|
||||
this.filterOtherSiteHucs(huclists, key);// DR 16096
|
||||
FFMPBasin basin = new FFMPBasin(key, true);
|
||||
setFFMPRow(basin, tData, isVGB, null);
|
||||
|
||||
|
@ -298,7 +298,8 @@ public class FFMPDataGenerator {
|
|||
|
||||
FFMPBasinMetaData fmdb = ft.getBasin(siteKey, key);
|
||||
|
||||
if (fmdb != null) {
|
||||
if (fmdb != null) {
|
||||
checkCenteredAggregationKey();// DR 16096 aggregation_county-huc_click
|
||||
for (DomainXML domain : domains) {
|
||||
if ((domain.getCwa().equals(fmdb.getCwa()))
|
||||
|| (domain.isPrimary() && fmdb
|
||||
|
@ -430,7 +431,8 @@ public class FFMPDataGenerator {
|
|||
}
|
||||
}
|
||||
if (qpfRecord != null) {
|
||||
qpfBasin = qpfRecord.getBasinData();
|
||||
qpfBasin = qpfRecord.getBasinData();
|
||||
qpfBasinClone = qpfRecord.getBasinData();// DR 16096
|
||||
}
|
||||
if (guidRecords != null) {
|
||||
guidBasins = new HashMap<String, FFMPBasinData>();
|
||||
|
@ -465,5 +467,181 @@ public class FFMPDataGenerator {
|
|||
|
||||
return field;
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------------- Below is for DR 16096
|
||||
* use FfmpTableConfigData.setQpfType() to find the QPF type,
|
||||
* only one at a time with Radio Button on a Basin Table.
|
||||
*
|
||||
* see getBaseField() for qpfsource/qpftyp
|
||||
* and FfmpTableConfigData.setQpfType()
|
||||
*
|
||||
* update code one step at a time. correct first; performance,hard-coding second.
|
||||
*
|
||||
* @return Map<QPFSCAN type, ArrayList<datakey>> i.e.: <QPFSCANkccx, [kccx] list> / <QPFSCAN, [kakq,klwx] list>
|
||||
*/
|
||||
public Map<String,java.util.ArrayList<String>> getQpfDataKeyMap(){
|
||||
|
||||
}
|
||||
Map<String, java.util.ArrayList<String>> map = new HashMap<String,java.util.ArrayList<String>>();
|
||||
|
||||
java.util.ArrayList<com.raytheon.uf.common.monitor.xml.FFMPRunXML> runlist = FFMPRunConfigurationManager.getInstance().getFFMPRunners();
|
||||
java.util.ArrayList<String> qpflist = getQpfTypes();
|
||||
|
||||
for(com.raytheon.uf.common.monitor.xml.FFMPRunXML rxml : runlist){
|
||||
java.util.ArrayList<com.raytheon.uf.common.monitor.xml.SourceIngestConfigXML> sicList = rxml.getSourceIngests();
|
||||
for(com.raytheon.uf.common.monitor.xml.SourceIngestConfigXML sic : sicList){
|
||||
String sname = sic.getSourceName();
|
||||
|
||||
for(String qpf : qpflist){
|
||||
if(qpf.equalsIgnoreCase(sname))
|
||||
map.put(sname, sic.getDataKey());
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* Based on AttributesDlg.createAttributeControls(),
|
||||
* used for adding a QPF column.
|
||||
* Only qpfs in table column are of interest
|
||||
* @return
|
||||
*/
|
||||
public java.util.ArrayList<String> getQpfTypes(){
|
||||
|
||||
ProductXML prodXml = monitor.getProductXML(resource.getPrimarySource());
|
||||
FFMPRunConfigurationManager runManager = FFMPRunConfigurationManager.getInstance();
|
||||
ProductRunXML productRun = runManager.getProduct(resource.getSiteKey());
|
||||
java.util.ArrayList<String> qpfTypes = productRun.getQpfTypes(prodXml);
|
||||
|
||||
return qpfTypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* get displaying dataKeys of the displaying QPFSCAN
|
||||
* 2014-01-01
|
||||
*/
|
||||
public java.util.ArrayList<String> getDisplayingQpfDataKeys(String dqpf){
|
||||
Map<String,java.util.ArrayList<String>> map = getQpfDataKeyMap();
|
||||
java.util.ArrayList<String> list = map.get(dqpf);
|
||||
|
||||
return list==null ? new java.util.ArrayList<String>() : list;
|
||||
}
|
||||
|
||||
/**
|
||||
* filtering non-QPFSCAN basins/hucs
|
||||
* 2014-01-01
|
||||
* parameter sitekey same as resource.siteKey used for comparing.
|
||||
*/
|
||||
public List<List<Long>> getOtherSiteQpfBasins(String siteKey, String huc, List<DomainXML> domains){
|
||||
String dqpf = getQpfType();
|
||||
List<List<Long>> huclist = new java.util.ArrayList<List<Long>>();
|
||||
|
||||
//if(siteKey.equalsIgnoreCase(dqpf))//Basin Table same as QPFSCAN's datakey
|
||||
// return huclist;
|
||||
|
||||
System.out.println("@551----------- qpf: "+dqpf);//checking qpf type
|
||||
|
||||
java.util.ArrayList<String> dataKeys = this.getDisplayingQpfDataKeys(dqpf);//more than one datakey for mosaic QPFSCAN
|
||||
for(String site : dataKeys){
|
||||
huclist.add(ft.getHucKeyList(site, huc, domains));
|
||||
}
|
||||
|
||||
return huclist;
|
||||
}
|
||||
|
||||
private FFMPBasinData qpfBasinClone = null;// DR 16096 2014-01-06 initialized @435
|
||||
|
||||
public void filterOtherSiteHucs(List<List<Long>> huclists, Long key){
|
||||
if( huclists==null || huclists.size()==0) // QPFSCAN column is not on 2014-01-09
|
||||
return;
|
||||
boolean isInOtherSite = false;
|
||||
|
||||
for(List<Long> list : huclists){
|
||||
if(list.contains(key)){
|
||||
isInOtherSite = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(isInOtherSite)
|
||||
this.qpfBasin = this.qpfBasinClone;
|
||||
else{
|
||||
setQPFMissing();
|
||||
setMList(this.siteKey,this.huc, key);
|
||||
}// so in FFMPRowGenerator, qpf value will be Float.NaN
|
||||
|
||||
//if(key==31051 || key==31119){setQPFMissing(); setMList(this.siteKey,this.huc, key);}//hard-code for testing
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* based on FFMPConfig.isSplit() and AttributesDlg.createAttributeControls() @176/178
|
||||
* since Only using AttrData causing all "M" when QPFSCAN column already on.
|
||||
*/
|
||||
public String getQpfType(){
|
||||
String qCname = "";
|
||||
boolean qpfColOn = false;
|
||||
|
||||
try{
|
||||
qCname=this.ffmpTableCfgData.getTableColumnAttr(ffmpTableCfgData.getTableColumnKeys()[3]).getOriginalName().split("::")[0];//AttributesDlg @176/178
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
for (com.raytheon.uf.viz.monitor.ffmp.xml.FFMPTableColumnXML tcXML : monitor.getConfig().getFFMPConfigData().getTableColumnData()) {
|
||||
if (tcXML.getColumnName().compareTo(FIELDS.QPF.name()) == 0) {
|
||||
qpfColOn = tcXML.getDisplayedInTable();
|
||||
}
|
||||
}
|
||||
|
||||
return qpfColOn ? qCname : monitor.getConfig().getAttrData().getQpfType();
|
||||
}
|
||||
|
||||
// An example for below: <kccx,<county,Arrays.asList("NE,Cadar","NE,Dodge")>> so if a county/HUC is M then its basins are all M
|
||||
private static final Map<String, HashMap<String,java.util.ArrayList<Long>>> M_LIST = new HashMap<String, HashMap<String,java.util.ArrayList<Long>>>();
|
||||
|
||||
/**
|
||||
* Usage: if a County/HUC (aggregation) is M with the QPFSCAN, then its pfaf is cached in the M_LIST
|
||||
* so when it is clicked, all the basins under it get M as well without having to redo matching.
|
||||
*
|
||||
* @param site
|
||||
* @param huc
|
||||
* @param key
|
||||
*/
|
||||
private static void setMList(String site, String huc, Long key){
|
||||
|
||||
HashMap<String,java.util.ArrayList<Long>> map = FFMPDataGenerator.M_LIST.get(site);
|
||||
if(map==null){
|
||||
map = new HashMap<String, java.util.ArrayList<Long>>();
|
||||
M_LIST.put(site,map);
|
||||
}
|
||||
|
||||
java.util.ArrayList<Long> list = map.get(huc);
|
||||
if(list==null){
|
||||
list = new java.util.ArrayList<Long>();
|
||||
map.put(huc, list);
|
||||
}
|
||||
|
||||
list.add(key);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// fix for County/HUC M but post_click 0.0 issue
|
||||
private void checkCenteredAggregationKey(){
|
||||
if( ! (this.centeredAggregationKey instanceof Long) ) return;
|
||||
|
||||
HashMap<String,java.util.ArrayList<Long>> map = FFMPDataGenerator.M_LIST.get(this.siteKey);
|
||||
if(map==null) return;
|
||||
|
||||
java.util.ArrayList<Long> list = map.get(this.huc);
|
||||
if(list==null) return;
|
||||
|
||||
if(list.contains((Long)this.centeredAggregationKey))
|
||||
this.setQPFMissing();
|
||||
}
|
||||
|
||||
//Utilize the fact FFMPRowGenerator set QPFSCAN M if qpfBasin null
|
||||
private void setQPFMissing(){
|
||||
this.qpfBasin = null;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue