ASM #17445 - Set configurable alert interval for all AvnFPS alerts
Change-Id: I1683942429bd358daedca5c72dc2f635e20bd064 Former-commit-id: a3622c531fd3cc0702d341bb711dd002a5e8effb
This commit is contained in:
parent
4de037dba3
commit
7eea886ae0
5 changed files with 56 additions and 20 deletions
|
@ -2,19 +2,19 @@
|
|||
<!--
|
||||
This_software_was_developed_and_/_or_modified_by_Raytheon_Company,
|
||||
pursuant_to_Contract_DG133W-05-CQ-1067_with_the_US_Government.
|
||||
|
||||
|
||||
U.S._EXPORT_CONTROLLED_TECHNICAL_DATA
|
||||
This_software_product_contains_export-restricted_data_whose
|
||||
export/transfer/disclosure_is_restricted_by_U.S._law._Dissemination
|
||||
to_non-U.S._persons_whether_in_the_United_States_or_abroad_requires
|
||||
an_export_license_or_other_authorization.
|
||||
|
||||
|
||||
Contractor_Name:________Raytheon_Company
|
||||
Contractor_Address:_____6825_Pine_Street,_Suite_340
|
||||
________________________Mail_Stop_B8
|
||||
________________________Omaha,_NE_68106
|
||||
________________________402.291.0100
|
||||
|
||||
|
||||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
|
@ -59,6 +59,7 @@
|
|||
<notifyRaise>disabled</notifyRaise>
|
||||
<notifyPlay>disabled</notifyPlay>
|
||||
<playFile>None</playFile>
|
||||
<alertIntervalMinutes>10</alertIntervalMinutes>
|
||||
<blink>true</blink>
|
||||
<disallowSend>error</disallowSend>
|
||||
<loadOrder>latest</loadOrder>
|
||||
|
|
|
@ -24,6 +24,9 @@ import java.io.FileInputStream;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import com.raytheon.viz.aviation.resource.ResourceConfigMgr;
|
||||
import com.raytheon.viz.aviation.resource.ResourceConfigMgr.ResourceTag;
|
||||
|
||||
import sun.audio.AudioData;
|
||||
import sun.audio.AudioDataStream;
|
||||
import sun.audio.AudioPlayer;
|
||||
|
@ -35,9 +38,10 @@ import sun.audio.AudioStream;
|
|||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ --------- ----------- --------------------------
|
||||
* Dec 2, 2009 avarani Initial creation
|
||||
* Oct 20,2015 17445 yteng Set alert interval
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -46,6 +50,9 @@ import sun.audio.AudioStream;
|
|||
*/
|
||||
|
||||
public class NotifyAudioManager {
|
||||
|
||||
private static long lastAlertTime = 0;
|
||||
|
||||
private static NotifyAudioManager nam;
|
||||
|
||||
private String filename;
|
||||
|
@ -69,15 +76,27 @@ public class NotifyAudioManager {
|
|||
}
|
||||
|
||||
public void playFile(String filename) throws IOException {
|
||||
if (!filename.equals(this.filename)) {
|
||||
File soundFile = new File(filename);
|
||||
InputStream in = new FileInputStream(soundFile);
|
||||
AudioStream as = new AudioStream(in);
|
||||
AudioData data = as.getData();
|
||||
ads = new AudioDataStream(data);
|
||||
}
|
||||
|
||||
AudioPlayer.player.stop(ads);
|
||||
AudioPlayer.player.start(ads);
|
||||
ResourceConfigMgr configMgr = ResourceConfigMgr.getInstance();
|
||||
int alertIntervalMinutes = configMgr.getResourceAsInt(ResourceTag.AlertIntervalMinutes);
|
||||
|
||||
long currentTime = System.currentTimeMillis();
|
||||
if (currentTime >= (lastAlertTime + alertIntervalMinutes*60*1000)) {
|
||||
lastAlertTime = currentTime;
|
||||
|
||||
if (!filename.equals(this.filename)) {
|
||||
File soundFile = new File(filename);
|
||||
InputStream in = new FileInputStream(soundFile);
|
||||
AudioStream as = new AudioStream(in);
|
||||
AudioData data = as.getData();
|
||||
ads = new AudioDataStream(data);
|
||||
}
|
||||
AudioPlayer.player.stop(ads);
|
||||
AudioPlayer.player.start(ads);
|
||||
}
|
||||
}
|
||||
|
||||
public static void resetAlertTime() {
|
||||
lastAlertTime = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,6 +70,7 @@ import com.raytheon.viz.aviation.monitor.GfsMonitorObserver;
|
|||
import com.raytheon.viz.aviation.monitor.IGridDataRetrieveListener;
|
||||
import com.raytheon.viz.aviation.monitor.LtgMonitorObserver;
|
||||
import com.raytheon.viz.aviation.monitor.MetarMonitorObserver;
|
||||
import com.raytheon.viz.aviation.monitor.NotifyAudioManager;
|
||||
import com.raytheon.viz.aviation.monitor.PythonMonitorJob;
|
||||
import com.raytheon.viz.aviation.monitor.RltgMonitorObserver;
|
||||
import com.raytheon.viz.aviation.monitor.ScheduledMonitorTask;
|
||||
|
@ -95,11 +96,11 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
|||
|
||||
/**
|
||||
* TafMonitorDlg (Terminal Aerodome Forecast Monitor Dialog) class.
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 1/24/2008 817 grichard Initial creation.
|
||||
|
@ -147,9 +148,10 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
|||
* 03/07/2013 1735 rferrel Performance speed up for retrieving grid data.
|
||||
* 08/09/2013 2033 mschenke Switched File.separator to IPathManager.SEPARATOR
|
||||
* Sep 15, 2015 4880 njensen Removed reference to ForecastModel
|
||||
*
|
||||
* 10/20/2015 17445 yteng Reset alert time for audio alert.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* @author grichard
|
||||
* @version 1.0
|
||||
*/
|
||||
|
@ -331,6 +333,7 @@ public class TafMonitorDlg extends CaveSWTDialog implements
|
|||
initializeData();
|
||||
initializeComponents();
|
||||
setupMonitoring();
|
||||
NotifyAudioManager.resetAlertTime();
|
||||
|
||||
shell.addShellListener(new ShellAdapter() {
|
||||
@Override
|
||||
|
|
|
@ -52,6 +52,7 @@ import com.raytheon.viz.aviation.activator.Activator;
|
|||
* methods and method to reset data values.
|
||||
* Dec 9, 2010 7380 rferrel Changed spinner values for text fields.
|
||||
* Dec 14, 2010 5782 rferrel Fixed numTafs combo string array.
|
||||
* Oct 20, 2015 17445 yteng Add audio alert interval field.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -90,7 +91,8 @@ public class ResourceConfigMgr implements IResourceAction {
|
|||
"alertLevel3"), AlertLevel4("alertLevel4"), AlertLevel5(
|
||||
"alertLevel5"), AlertLevel6("alertLevel6"), NotifyDeiconify(
|
||||
"notifyDeiconify"), NotifyRaise("notifyRaise"), NotifyPlay(
|
||||
"notifyPlay"), PlayFile("playFile"), Blink("blink"), DisallowSend(
|
||||
"notifyPlay"), PlayFile("playFile"), AlertIntervalMinutes(
|
||||
"alertIntervalMinutes"), Blink("blink"), DisallowSend(
|
||||
"disallowSend"), LoadOrder("loadOrder"), AutoSave("autoSave"), UpdateTimes(
|
||||
"updateTimes"), AutoPrint("autoPrint"), Insert("insert"), Wrap(
|
||||
"wrap"), AmdButtons("amdbuttons"), NumTafs("numTafs"), NumHours(
|
||||
|
@ -228,6 +230,8 @@ public class ResourceConfigMgr implements IResourceAction {
|
|||
ResourceType.COMBO, "Alert level to play file"));
|
||||
resourceTypeMap.put(ResourceTag.PlayFile, new ResourceInfo(
|
||||
ResourceType.FILE, "Sound to play on TAF alert"));
|
||||
resourceTypeMap.put(ResourceTag.AlertIntervalMinutes, new ResourceInfo(
|
||||
ResourceType.SPINNER, "TAF alert interval in minutes"));
|
||||
resourceTypeMap.put(ResourceTag.Blink, new ResourceInfo(
|
||||
ResourceType.CHECK, "Blink on new notification"));
|
||||
resourceTypeMap.put(ResourceTag.DisallowSend, new ResourceInfo(
|
||||
|
@ -297,6 +301,9 @@ public class ResourceConfigMgr implements IResourceAction {
|
|||
final int htMin = 50;
|
||||
final int htMax = 1200;
|
||||
final int inc = 50;
|
||||
final int aiMin = 1;
|
||||
final int aiMax = 60;
|
||||
final int aiInc = 1;
|
||||
|
||||
if (resourceTag == ResourceTag.TextWidth) {
|
||||
return new SpinnerData(wdMin, wdMax, inc);
|
||||
|
@ -312,6 +319,8 @@ public class ResourceConfigMgr implements IResourceAction {
|
|||
return new SpinnerData(wdMin, wdMax, inc);
|
||||
} else if (resourceTag == ResourceTag.TextViewerHeight) {
|
||||
return new SpinnerData(htMin, htMax, inc);
|
||||
} else if (resourceTag == ResourceTag.AlertIntervalMinutes) {
|
||||
return new SpinnerData(aiMin, aiMax, aiInc);
|
||||
}
|
||||
|
||||
return new SpinnerData(0, 100, 10);
|
||||
|
|
|
@ -59,6 +59,7 @@ import com.raytheon.viz.aviation.resource.ResourceConfigMgr.ResourceTag;
|
|||
* 30 Aug 2013 #2164 bkowal Add default case statement for MSFT Windows
|
||||
* Java. Replaced platform-dependent code with
|
||||
* code that is not platform-dependent.
|
||||
* Oct 20, 2015 17445 yteng Add audio alert interval.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -526,6 +527,9 @@ public class ResourceDataManager {
|
|||
resourceMap.put(ResourceTag.NotifyPlay, notifyPlay);
|
||||
String playFile = resourceCB.getResourceAsString(ResourceTag.PlayFile);
|
||||
resourceMap.put(ResourceTag.PlayFile, playFile);
|
||||
int alertIntervalMinutes = resourceCB
|
||||
.getResourceAsInt(ResourceTag.TextEditorInsWidth);
|
||||
resourceMap.put(ResourceTag.AlertIntervalMinutes, alertIntervalMinutes);
|
||||
boolean blink = resourceCB.getResourceAsBoolean(ResourceTag.Blink);
|
||||
resourceMap.put(ResourceTag.Blink, Boolean.valueOf(blink));
|
||||
String disalowSend = resourceCB
|
||||
|
|
Loading…
Add table
Reference in a new issue