Merge pull request #465 from srcarter3/unidata_18.2.1

Small update to WWAs
This commit is contained in:
tiffanycmeyer13 2022-06-28 11:52:50 -06:00 committed by GitHub
commit 5e06eddf60
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 123 additions and 4 deletions

View file

@ -97,6 +97,7 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory;
* Dec 19, 2018 ---- mjames@ucar Added phensig color table lookup.
* Mar 15, 2022 srcarter@ucar Add support for display settings for outline, fill, text and time displays
* Jun 24, 2022 srcarter@ucar Add 'statement/other' display settings, set enabled for only relevant WWA types
* Jun 28, 2022 srcarter@ucar Display sampling based on new 'sampling' settings
*
* </pre>
*
@ -175,18 +176,22 @@ public abstract class AbstractWWAResource extends
private boolean warnFill = WARN_FILL_DEFAULT;
private boolean warnText = WARN_TEXT_DEFAULT;
private boolean warnTime = WARN_TIME_DEFAULT;
private boolean warnSample = true;
private boolean watchOutline = WATCH_OUTLINE_DEFAULT;
private boolean watchFill = WATCH_FILL_DEFAULT;
private boolean watchText = WATCH_TEXT_DEFAULT;
private boolean watchTime = WATCH_TIME_DEFAULT;
private boolean watchSample = true;
private boolean advOutline = ADV_OUTLINE_DEFAULT;
private boolean advFill = ADV_FILL_DEFAULT;
private boolean advText = ADV_TEXT_DEFAULT;
private boolean advTime = ADV_TIME_DEFAULT;
private boolean advSample = true;
private boolean otherOutline = OTHER_OUTLINE_DEFAULT;
private boolean otherFill = OTHER_FILL_DEFAULT;
private boolean otherText = OTHER_TEXT_DEFAULT;
private boolean otherTime = OTHER_TIME_DEFAULT;
private boolean otherSample = true;
private boolean enableWarnDisplay = false;
private boolean enableWatchDisplay = false;
private boolean enableAdvisoryDisplay = false;
@ -295,7 +300,22 @@ public abstract class AbstractWWAResource extends
WarningEntry entry = entryMap.get(key);
AbstractWarningRecord record = entry.record;
if (matchesFrame(entry, time, framePeriod, lastFrame)
String sig = record.getSig();
boolean samplingOn = false;
if(sig.equals(WATCH_SIG)){
if(showWatchSampling())
samplingOn = true;
}else if(sig.equals(WARN_SIG)){
if(showWarnSampling())
samplingOn = true;
}else if(sig.equals(ADVISORY_SIG)){
if(showAdvisorySampling())
samplingOn = true;
}else{
if(showOtherSampling())
samplingOn = true;
}
if (samplingOn && matchesFrame(entry, time, framePeriod, lastFrame)
&& record.getGeometry() != null) {
Geometry recordGeom = record.getGeometry();
@ -920,6 +940,15 @@ public abstract class AbstractWWAResource extends
public void setWarnTimeDisplay(boolean warnTime) {
this.warnTime = warnTime;
}
/**
* Set whether or not to display the sampling for warnings
* @param warnSample If true, will show the sampling output
* for warnings, when sampling is enabled
*/
public void setWarnSampleDisplay(boolean warnSample) {
this.warnSample = warnSample;
}
/**
* Set whether or not to display the outline for watches
@ -952,6 +981,15 @@ public abstract class AbstractWWAResource extends
public void setWatchTimeDisplay(boolean watchTime) {
this.watchTime = watchTime;
}
/**
* Set whether or not to display the sampling for watches
* @param watchSample If true, will show the sampling output
* for watches, when sampling is enabled
*/
public void setWatchSampleDisplay(boolean watchSample) {
this.watchSample = watchSample;
}
/**
* Set whether or not to display the outline for advisories
@ -985,6 +1023,16 @@ public abstract class AbstractWWAResource extends
public void setAdvisoryTimeDisplay(boolean advTime) {
this.advTime = advTime;
}
/**
* Set whether or not to display the sampling for advisories
* @param advSample If true, will show the sampling output
* for advisories, when sampling is enabled
*/
public void setAdvisorySampleDisplay(boolean advSample) {
this.advSample = advSample;
}
/**
* Set whether or not to display the outline for statements
* and other records
@ -1021,6 +1069,16 @@ public abstract class AbstractWWAResource extends
this.otherTime = otherTime;
}
/**
* Set whether or not to display the sampling for statements/
* other records
* @param otherSample If true, will show the sampling output
* for statements/other records, when sampling is enabled
*/
public void setOtherSampleDisplay(boolean otherSample) {
this.otherSample = otherSample;
}
/**
* @return True if the warning outline is displayed
*/
@ -1049,6 +1107,13 @@ public abstract class AbstractWWAResource extends
return warnTime;
}
/**
* @return True if the warning sampling is to be displayed
*/
public boolean showWarnSampling(){
return warnSample;
}
/**
* @return True if the watch outline is displayed
*/
@ -1077,6 +1142,13 @@ public abstract class AbstractWWAResource extends
return watchTime;
}
/**
* @return True if the watch sampling is to be displayed
*/
public boolean showWatchSampling(){
return watchSample;
}
/**
* @return True if the advisory outline is displayed
*/
@ -1105,6 +1177,13 @@ public abstract class AbstractWWAResource extends
return advTime;
}
/**
* @return True if the advisory sampling is to be displayed
*/
public boolean showAdvisorySampling(){
return advSample;
}
/**
* @return True if the statement/other outline is displayed
*/
@ -1133,6 +1212,13 @@ public abstract class AbstractWWAResource extends
return otherTime;
}
/**
* @return True if the other/statement sampling is to be displayed
*/
public boolean showOtherSampling(){
return otherSample;
}
/**
* @return True if the warning display settings are to
* be enabled

View file

@ -27,6 +27,7 @@ import com.raytheon.viz.warnings.rsc.AbstractWWAResource;
* Mar 15, 2022 srcarter@ucar Initial creation
* Mar 21, 2022 srcarter@ucar Set the current values every time initializeComponents is called (also called from .Open)
* Jun 24, 2022 srcarter@ucar Move Watches to top, add section for Other/Statement, add 'enabled' functionality
* Jun 28, 2022 srcarter@ucar Add 'Sampling' options
*
* </pre>
*
@ -40,18 +41,22 @@ public class DrawingPropertiesDialog extends CaveSWTDialog {
private Button warnFillChk;
private Button warnTextChk;
private Button warnTimeChk;
private Button warnSampleChk;
private Button watchOutlineChk;
private Button watchFillChk;
private Button watchTextChk;
private Button watchTimeChk;
private Button watchSampleChk;
private Button advOutlineChk;
private Button advFillChk;
private Button advTextChk;
private Button advTimeChk;
private Button advSampleChk;
private Button otherOutlineChk;
private Button otherFillChk;
private Button otherTextChk;
private Button otherTimeChk;
private Button otherSampleChk;
/**
* The WWA Resource associated with this properties dialog
@ -96,6 +101,9 @@ public class DrawingPropertiesDialog extends CaveSWTDialog {
watchTextChk = createButton(watchComp, "Show Text");
watchTimeChk = createButton(watchComp, "Show Time");
//sample
watchSampleChk = createButton(watchComp, "Show Sampling");
// --- end Watches ---
// --- Warnings ---
@ -110,6 +118,8 @@ public class DrawingPropertiesDialog extends CaveSWTDialog {
//text and time
warnTextChk = createButton(warnComp, "Show Text");
warnTimeChk = createButton(warnComp, "Show Time");
//sample
warnSampleChk = createButton(warnComp, "Show Sampling");
// --- end Warnings ---
@ -127,6 +137,9 @@ public class DrawingPropertiesDialog extends CaveSWTDialog {
advTextChk = createButton(advComp, "Show Text");
advTimeChk = createButton(advComp, "Show Time");
//sample
advSampleChk = createButton(advComp, "Show Sampling");
// --- end Advisories ---
// --- Other ---
@ -143,6 +156,9 @@ public class DrawingPropertiesDialog extends CaveSWTDialog {
otherTextChk = createButton(otherComp, "Show Text");
otherTimeChk = createButton(otherComp, "Show Time");
//sample
otherSampleChk = createButton(otherComp, "Show Sampling");
// --- end Other ---
// --- Bottom Buttons ---
@ -192,6 +208,7 @@ public class DrawingPropertiesDialog extends CaveSWTDialog {
warnFillChk.setEnabled(isEnabled);
warnTextChk.setEnabled(isEnabled);
warnTimeChk.setEnabled(isEnabled);
warnSampleChk.setEnabled(isEnabled);
}
private void setWatchControlsEnabled(boolean isEnabled){
@ -199,6 +216,7 @@ public class DrawingPropertiesDialog extends CaveSWTDialog {
watchFillChk.setEnabled(isEnabled);
watchTextChk.setEnabled(isEnabled);
watchTimeChk.setEnabled(isEnabled);
watchSampleChk.setEnabled(isEnabled);
}
private void setAdvisoryControlsEnabled(boolean isEnabled){
@ -206,6 +224,7 @@ public class DrawingPropertiesDialog extends CaveSWTDialog {
advFillChk.setEnabled(isEnabled);
advTextChk.setEnabled(isEnabled);
advTimeChk.setEnabled(isEnabled);
advSampleChk.setEnabled(isEnabled);
}
private void setOtherControlsEnabled(boolean isEnabled){
@ -213,6 +232,7 @@ public class DrawingPropertiesDialog extends CaveSWTDialog {
otherFillChk.setEnabled(isEnabled);
otherTextChk.setEnabled(isEnabled);
otherTimeChk.setEnabled(isEnabled);
otherSampleChk.setEnabled(isEnabled);
}
/**
@ -252,21 +272,25 @@ public class DrawingPropertiesDialog extends CaveSWTDialog {
myResource.setWarnFillDisplay(warnFillChk.getSelection());
myResource.setWarnTextDisplay(warnTextChk.getSelection());
myResource.setWarnTimeDisplay(warnTimeChk.getSelection());
myResource.setWarnSampleDisplay(warnSampleChk.getSelection());
myResource.setWatchOutlineDisplay(watchOutlineChk.getSelection());
myResource.setWatchFillDisplay(watchFillChk.getSelection());
myResource.setWatchTextDisplay(watchTextChk.getSelection());
myResource.setWatchTimeDisplay(watchTimeChk.getSelection());
myResource.setWatchSampleDisplay(watchSampleChk.getSelection());
myResource.setAdvisoryOutlineDisplay(advOutlineChk.getSelection());
myResource.setAdvisoryFillDisplay(advFillChk.getSelection());
myResource.setAdvisoryTextDisplay(advTextChk.getSelection());
myResource.setAdvisoryTimeDisplay(advTimeChk.getSelection());
myResource.setAdvisorySampleDisplay(advSampleChk.getSelection());
myResource.setOtherOutlineDisplay(otherOutlineChk.getSelection());
myResource.setOtherFillDisplay(otherFillChk.getSelection());
myResource.setOtherTextDisplay(otherTextChk.getSelection());
myResource.setOtherTimeDisplay(otherTimeChk.getSelection());
myResource.setOtherTimeDisplay(otherTimeChk.getSelection());
myResource.setOtherSampleDisplay(otherSampleChk.getSelection());
myResource.issueRefresh();
}
@ -280,22 +304,27 @@ public class DrawingPropertiesDialog extends CaveSWTDialog {
warnFillChk.setSelection(AbstractWWAResource.WARN_FILL_DEFAULT);
warnTextChk.setSelection(AbstractWWAResource.WARN_TEXT_DEFAULT);
warnTimeChk.setSelection(AbstractWWAResource.WARN_TIME_DEFAULT);
warnSampleChk.setSelection(true);
watchOutlineChk.setSelection(AbstractWWAResource.WATCH_OUTLINE_DEFAULT);
watchFillChk.setSelection(AbstractWWAResource.WATCH_FILL_DEFAULT);
watchTextChk.setSelection(AbstractWWAResource.WATCH_TEXT_DEFAULT);
watchTimeChk.setSelection(AbstractWWAResource.WATCH_TIME_DEFAULT);
watchSampleChk.setSelection(true);
advOutlineChk.setSelection(AbstractWWAResource.ADV_OUTLINE_DEFAULT);
advFillChk.setSelection(AbstractWWAResource.ADV_FILL_DEFAULT);
advTextChk.setSelection(AbstractWWAResource.ADV_TEXT_DEFAULT);
advTimeChk.setSelection(AbstractWWAResource.ADV_TIME_DEFAULT);
advSampleChk.setSelection(true);
otherOutlineChk.setSelection(AbstractWWAResource.OTHER_OUTLINE_DEFAULT);
otherFillChk.setSelection(AbstractWWAResource.OTHER_FILL_DEFAULT);
otherTextChk.setSelection(AbstractWWAResource.OTHER_TEXT_DEFAULT);
otherTimeChk.setSelection(AbstractWWAResource.OTHER_TIME_DEFAULT); }
otherTimeChk.setSelection(AbstractWWAResource.OTHER_TIME_DEFAULT);
otherSampleChk.setSelection(true);
}
/**
* Set all the GUI checkboxes to the current boolean values from
* the associated resource
@ -305,20 +334,24 @@ public class DrawingPropertiesDialog extends CaveSWTDialog {
warnFillChk.setSelection(myResource.showWarnFill());
warnTextChk.setSelection(myResource.showWarnText());
warnTimeChk.setSelection(myResource.showWarnTime());
warnSampleChk.setSelection(myResource.showWarnSampling());
watchOutlineChk.setSelection(myResource.showWatchOutline());
watchFillChk.setSelection(myResource.showWatchFill());
watchTextChk.setSelection(myResource.showWatchText());
watchTimeChk.setSelection(myResource.showWatchTime());
watchSampleChk.setSelection(myResource.showWatchSampling());
advOutlineChk.setSelection(myResource.showAdvisoryOutline());
advFillChk.setSelection(myResource.showAdvisoryFill());
advTextChk.setSelection(myResource.showAdvisoryText());
advTimeChk.setSelection(myResource.showAdvisoryTime());
advSampleChk.setSelection(myResource.showAdvisorySampling());
otherOutlineChk.setSelection(myResource.showOtherOutline());
otherFillChk.setSelection(myResource.showOtherFill());
otherTextChk.setSelection(myResource.showOtherText());
otherTimeChk.setSelection(myResource.showOtherTime());
otherSampleChk.setSelection(myResource.showOtherSampling());
}
}