Omaha #4858: Do not allow GFE to publish grids, transmit/generate text products or use ISC mode when DRT mode is enabled for operational mode.

Change-Id: Iefe86516fa941d6043b12fa6c7cebdd0803feff6

Former-commit-id: 5461d2ce24a95372902d58c8c8d43963d93ccd36
This commit is contained in:
David Gillingham 2015-09-09 11:27:51 -05:00
parent c1d2ca74a5
commit a2c9879dbc
19 changed files with 537 additions and 303 deletions

View file

@ -65,6 +65,7 @@
# time regardless of setting of os.environ['TZ'] # time regardless of setting of os.environ['TZ']
# Jan 13, 2015 3955 randerso Added optional parameter to availableParms to specify desired databases. # Jan 13, 2015 3955 randerso Added optional parameter to availableParms to specify desired databases.
# Fixed createGrid to accept a DatabaseID for model # Fixed createGrid to accept a DatabaseID for model
# Sep 11, 2015 4858 dgilling Remove notification processing from publishElements.
######################################################################## ########################################################################
import types, string, time, sys import types, string, time, sys
from math import * from math import *
@ -1915,16 +1916,7 @@ class SmartScript(BaseTool.BaseTool):
cgr = CommitGridRequest(parm.getParmID(), publishTimeRange.toJavaObj()) cgr = CommitGridRequest(parm.getParmID(), publishTimeRange.toJavaObj())
requests.add(cgr) requests.add(cgr)
resp = self.__dataMgr.getClient().commitGrid(requests) self.__parmOp.publish(requests)
r = resp.getPayload()
size = r.size()
for x in range(size):
notify = r.get(x)
pid = notify.getParmId()
p = self.__parmMgr.getParm(pid)
if not p:
p = self.__parmMgr.addParm(pid, False, False)
p.inventoryArrived(notify.getReplacementTimeRange(), notify.getHistories())
def combineMode(self): def combineMode(self):
from com.raytheon.viz.gfe.core.parm import ParmState from com.raytheon.viz.gfe.core.parm import ParmState

View file

@ -149,6 +149,12 @@
<command id="com.raytheon.viz.gfe.actions.ShowLoadSampleSetDialog" <command id="com.raytheon.viz.gfe.actions.ShowLoadSampleSetDialog"
name="ShowLoadSampleSetDialog"> name="ShowLoadSampleSetDialog">
</command> </command>
<command id="com.raytheon.viz.gfe.actions.ShowSendIsc"
name="ShowSendIscGridsDialog">
</command>
<command id="com.raytheon.viz.gfe.actions.ShowIscRequestReply"
name="ShowIscRequestReplyDialog">
</command>
<command id="com.raytheon.viz.gfe.actions.ShowSaveDeleteSampleSetDialog" <command id="com.raytheon.viz.gfe.actions.ShowSaveDeleteSampleSetDialog"
name="ShowSaveDeleteSampleSetDialog"> name="ShowSaveDeleteSampleSetDialog">
<commandParameter <commandParameter
@ -997,6 +1003,24 @@
definitionId="com.raytheon.viz.gfe.inGFEActionSet"> definitionId="com.raytheon.viz.gfe.inGFEActionSet">
</reference> </reference>
</activeWhen> </activeWhen>
</handler>
<handler
class="com.raytheon.viz.gfe.actions.ShowSendIscGridsDialog"
commandId="com.raytheon.viz.gfe.actions.ShowSendIsc">
<activeWhen>
<reference
definitionId="com.raytheon.viz.gfe.inGFEActionSet">
</reference>
</activeWhen>
</handler>
<handler
class="com.raytheon.viz.gfe.actions.ShowIscRequestReplyDialog"
commandId="com.raytheon.viz.gfe.actions.ShowIscRequestReply">
<activeWhen>
<reference
definitionId="com.raytheon.viz.gfe.inGFEActionSet">
</reference>
</activeWhen>
</handler> </handler>
</extension> </extension>
<extension point="com.raytheon.uf.viz.core.resource"> <extension point="com.raytheon.uf.viz.core.resource">
@ -1303,7 +1327,15 @@
name="com.raytheon.viz.gfe.separator2" name="com.raytheon.viz.gfe.separator2"
visible="true"> visible="true">
</separator> </separator>
<dynamic class="com.raytheon.viz.gfe.menu.ISCMenuEnabler" id="com.raytheon.viz.gfe.menu.ISCMenuEnabler"/> <command
commandId="com.raytheon.viz.gfe.actions.ShowSendIsc"
label="Send Intersite Grids" />
<command
commandId="com.raytheon.viz.gfe.actions.ShowIscRequestReply"
label="ISC Request/Reply" />
<command
commandId="com.raytheon.viz.gfe.iscSendEnable"
label="ISC Send Enable" style="toggle" />
</menu> </menu>
<menu label="Products" mnemonic="P"> <menu label="Products" mnemonic="P">
<visibleWhen> <visibleWhen>

View file

@ -28,6 +28,7 @@ import org.eclipse.ui.PlatformUI;
import com.raytheon.viz.gfe.core.DataManager; import com.raytheon.viz.gfe.core.DataManager;
import com.raytheon.viz.gfe.core.DataManagerUIFactory; import com.raytheon.viz.gfe.core.DataManagerUIFactory;
import com.raytheon.viz.gfe.dialogs.FormatterLauncherDialog; import com.raytheon.viz.gfe.dialogs.FormatterLauncherDialog;
import com.raytheon.viz.ui.simulatedtime.SimulatedTimeOperations;
/** /**
* Displays Formatter Launcher dialog. * Displays Formatter Launcher dialog.
@ -42,6 +43,8 @@ import com.raytheon.viz.gfe.dialogs.FormatterLauncherDialog;
* Oct 23, 2012 1287 rferrel Changes for non-blocking FormatterLauncherDialog. * Oct 23, 2012 1287 rferrel Changes for non-blocking FormatterLauncherDialog.
* Apr 24, 2013 1936 dgilling Pass DataManager to * Apr 24, 2013 1936 dgilling Pass DataManager to
* FormatterLauncherDialog via constructor. * FormatterLauncherDialog via constructor.
* Sep 15, 2015 4858 dgilling Prevent dialog from being launched in DRT
* mode.
* *
* </pre> * </pre>
* *
@ -62,10 +65,16 @@ public class FormatterlauncherAction extends AbstractHandler {
*/ */
@Override @Override
public Object execute(ExecutionEvent arg0) throws ExecutionException { public Object execute(ExecutionEvent arg0) throws ExecutionException {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
if (!SimulatedTimeOperations.isTransmitAllowed()) {
SimulatedTimeOperations.displayFeatureLevelWarning(shell,
"Formatter Launcher");
return null;
}
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) { if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
DataManager dm = DataManagerUIFactory.getCurrentInstance(); DataManager dm = DataManagerUIFactory.getCurrentInstance();
dialog = new FormatterLauncherDialog(shell, dm); dialog = new FormatterLauncherDialog(shell, dm);
dialog.setBlockOnOpen(false); dialog.setBlockOnOpen(false);

View file

@ -24,15 +24,23 @@ import java.util.Map;
import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.commands.ExecutionException;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.IElementUpdater; import org.eclipse.ui.commands.IElementUpdater;
import org.eclipse.ui.menus.UIElement; import org.eclipse.ui.menus.UIElement;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.viz.core.mode.CAVEMode;
import com.raytheon.viz.gfe.core.DataManager; import com.raytheon.viz.gfe.core.DataManager;
import com.raytheon.viz.gfe.core.DataManagerUIFactory;
import com.raytheon.viz.gfe.core.msgs.ISCSendStatusChangedMsg; import com.raytheon.viz.gfe.core.msgs.ISCSendStatusChangedMsg;
import com.raytheon.viz.gfe.core.msgs.Message; import com.raytheon.viz.gfe.core.msgs.Message;
import com.raytheon.viz.ui.simulatedtime.SimulatedTimeOperations;
import com.raytheon.viz.ui.simulatedtime.SimulatedTimeProhibitedOpException;
/** /**
* TODO Add Description * Menu handler for enabling and disabling send of ISC grids from GFE client.
* *
* <pre> * <pre>
* *
@ -40,6 +48,7 @@ import com.raytheon.viz.gfe.core.msgs.Message;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Mar 25, 2010 randerso Initial creation * Mar 25, 2010 randerso Initial creation
* Sep 15, 2015 #4858 dgilling Add isEnabled.
* *
* </pre> * </pre>
* *
@ -50,36 +59,43 @@ import com.raytheon.viz.gfe.core.msgs.Message;
public class IscSendEnableHandler extends AbstractHandler implements public class IscSendEnableHandler extends AbstractHandler implements
IElementUpdater { IElementUpdater {
/* private final IUFStatusHandler statusHandler = UFStatus
* (non-Javadoc) .getHandler(getClass());
*
* @see
* org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.
* ExecutionEvent)
*/
@Override @Override
public Object execute(ExecutionEvent event) throws ExecutionException { public Object execute(ExecutionEvent event) throws ExecutionException {
DataManager dm = DataManager.getCurrentInstance(); Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
if (!SimulatedTimeOperations.isTransmitAllowed()) {
SimulatedTimeOperations.displayFeatureLevelWarning(shell,
"ISC Send Enable");
return null;
}
DataManager dm = DataManagerUIFactory.getCurrentInstance();
if (dm != null) { if (dm != null) {
boolean newState = !Message.inquireLastMessage( boolean newState = !Message.inquireLastMessage(
ISCSendStatusChangedMsg.class).isEnabled(); ISCSendStatusChangedMsg.class).isEnabled();
dm.enableISCsend(newState); try {
dm.enableISCsend(newState);
} catch (SimulatedTimeProhibitedOpException e) {
statusHandler.error(e.getLocalizedMessage(), e);
}
} }
return null; return null;
} }
/* @Override
* (non-Javadoc) public boolean isEnabled() {
* DataManager dm = DataManagerUIFactory.getCurrentInstance();
* @see return (dm != null) ? CAVEMode.getMode().equals(CAVEMode.OPERATIONAL)
* org.eclipse.ui.commands.IElementUpdater#updateElement(org.eclipse.ui. && dm.requestISC() : false;
* menus.UIElement, java.util.Map) }
*/
@Override @Override
public void updateElement(UIElement element, Map parameters) { public void updateElement(UIElement element, Map parameters) {
element.setChecked(Message.inquireLastMessage( element.setChecked(Message.inquireLastMessage(
ISCSendStatusChangedMsg.class).isEnabled()); ISCSendStatusChangedMsg.class).isEnabled());
} }
} }

View file

@ -0,0 +1,96 @@
/**
* 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.
**/
package com.raytheon.viz.gfe.actions;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import com.raytheon.viz.core.mode.CAVEMode;
import com.raytheon.viz.gfe.core.DataManager;
import com.raytheon.viz.gfe.core.DataManagerUIFactory;
import com.raytheon.viz.gfe.dialogs.isc.ISCRequestReplyDlg;
import com.raytheon.viz.ui.dialogs.ICloseCallback;
import com.raytheon.viz.ui.simulatedtime.SimulatedTimeOperations;
/**
* Action to launch ISC request/reply dialog.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 15, 2015 #4858 dgilling Initial creation
*
* </pre>
*
* @author dgilling
* @version 1.0
*/
public class ShowIscRequestReplyDialog extends AbstractHandler {
private ISCRequestReplyDlg iscRequestDlg;
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
if (!SimulatedTimeOperations.isTransmitAllowed()) {
SimulatedTimeOperations.displayFeatureLevelWarning(shell,
"ISC Request/Reply");
return null;
}
if (iscRequestDlg == null || iscRequestDlg.getShell() == null
|| iscRequestDlg.isDisposed()) {
iscRequestDlg = new ISCRequestReplyDlg(shell);
iscRequestDlg.setCloseCallback(new ICloseCallback() {
@Override
public void dialogClosed(Object returnValue) {
iscRequestDlg = null;
}
});
iscRequestDlg.open();
} else {
iscRequestDlg.bringToTop();
}
return null;
}
@Override
public boolean isEnabled() {
DataManager dm = DataManagerUIFactory.getCurrentInstance();
if (dm != null) {
return (!dm.sendIscOnSave() || !dm.sendIscOnPublish())
&& CAVEMode.getMode().equals(CAVEMode.OPERATIONAL)
&& dm.requestISC();
}
return false;
}
}

View file

@ -26,7 +26,9 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI; import org.eclipse.ui.PlatformUI;
import com.raytheon.viz.gfe.core.DataManager; import com.raytheon.viz.gfe.core.DataManager;
import com.raytheon.viz.gfe.core.DataManagerUIFactory;
import com.raytheon.viz.gfe.dialogs.ProductScriptsDialog; import com.raytheon.viz.gfe.dialogs.ProductScriptsDialog;
import com.raytheon.viz.ui.simulatedtime.SimulatedTimeOperations;
/** /**
* Action to launch product generation script dialog. * Action to launch product generation script dialog.
@ -35,8 +37,9 @@ import com.raytheon.viz.gfe.dialogs.ProductScriptsDialog;
* SOFTWARE HISTORY * SOFTWARE HISTORY
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Mar 6, 2008 Eric Babin Initial Creation * Mar 6, 2008 Eric Babin Initial Creation
* Oct 25, 2012 12878 rferrel Changes for non-blocking ProductScriptsDialog. * Oct 25, 2012 12878 rferrel Changes for non-blocking ProductScriptsDialog.
* Sep 21, 2015 4858 dgilling Disable in DRT mode.
* *
* </pre> * </pre>
* *
@ -56,15 +59,20 @@ public class ShowProductScriptsDialog extends AbstractHandler {
*/ */
@Override @Override
public Object execute(ExecutionEvent arg0) throws ExecutionException { public Object execute(ExecutionEvent arg0) throws ExecutionException {
DataManager dm = DataManager.getCurrentInstance(); Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
if (!SimulatedTimeOperations.isTransmitAllowed()) {
SimulatedTimeOperations.displayFeatureLevelWarning(shell,
"Product Scripts dialog");
return null;
}
DataManager dm = DataManagerUIFactory.getCurrentInstance();
if (dm == null) { if (dm == null) {
return null; return null;
} }
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) { if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
dialog = new ProductScriptsDialog(shell, dm); dialog = new ProductScriptsDialog(shell, dm);
dialog.setBlockOnOpen(false); dialog.setBlockOnOpen(false);
dialog.open(); dialog.open();

View file

@ -26,7 +26,9 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI; import org.eclipse.ui.PlatformUI;
import com.raytheon.viz.gfe.core.DataManager; import com.raytheon.viz.gfe.core.DataManager;
import com.raytheon.viz.gfe.core.DataManagerUIFactory;
import com.raytheon.viz.gfe.dialogs.PublishDialog; import com.raytheon.viz.gfe.dialogs.PublishDialog;
import com.raytheon.viz.ui.simulatedtime.SimulatedTimeOperations;
/** /**
* Action to launch publish to official dialog. * Action to launch publish to official dialog.
@ -35,8 +37,10 @@ import com.raytheon.viz.gfe.dialogs.PublishDialog;
* SOFTWARE HISTORY * SOFTWARE HISTORY
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Mar 6, 2008 Eric Babin Initial Creation * Mar 6, 2008 Eric Babin Initial Creation
* Oct 25, 2012 1287 rferrel Changes for non-blocking PublishDialog. * Oct 25, 2012 1287 rferrel Changes for non-blocking PublishDialog.
* Sep 09, 2015 4858 dgilling Don't allow publishing when
* SimulatedTime is enabled.
* *
* </pre> * </pre>
* *
@ -45,6 +49,7 @@ import com.raytheon.viz.gfe.dialogs.PublishDialog;
*/ */
public class ShowPublishDialog extends AbstractHandler { public class ShowPublishDialog extends AbstractHandler {
private PublishDialog dialog; private PublishDialog dialog;
/* /*
@ -56,17 +61,21 @@ public class ShowPublishDialog extends AbstractHandler {
*/ */
@Override @Override
public Object execute(ExecutionEvent arg0) throws ExecutionException { public Object execute(ExecutionEvent arg0) throws ExecutionException {
DataManager dm = DataManager.getCurrentInstance(); Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
if (!SimulatedTimeOperations.isTransmitAllowed()) {
SimulatedTimeOperations.displayFeatureLevelWarning(shell,
"Publish Grids to Official");
return null;
}
DataManager dm = DataManagerUIFactory.getCurrentInstance();
if (dm == null) { if (dm == null) {
return null; return null;
} }
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) { if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow() dialog = new PublishDialog(shell, dm);
.getShell();
PublishDialog dialog = new PublishDialog(shell, dm);
dialog.setBlockOnOpen(false); dialog.setBlockOnOpen(false);
dialog.open(); dialog.open();
} else { } else {
@ -87,12 +96,11 @@ public class ShowPublishDialog extends AbstractHandler {
return false; return false;
} }
DataManager dm = DataManager.getCurrentInstance(); DataManager dm = DataManagerUIFactory.getCurrentInstance();
if (dm != null) { if (dm != null) {
return !dm.getParmManager().getMutableDatabase() return !dm.getParmManager().getMutableDatabase()
.equals(dm.getParmManager().getProductDB()); .equals(dm.getParmManager().getProductDB());
} }
return false; return false;
} }
} }

View file

@ -0,0 +1,99 @@
/**
* 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.
**/
package com.raytheon.viz.gfe.actions;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import com.raytheon.viz.core.mode.CAVEMode;
import com.raytheon.viz.gfe.core.DataManager;
import com.raytheon.viz.gfe.core.DataManagerUIFactory;
import com.raytheon.viz.gfe.dialogs.isc.SendISCDialog;
import com.raytheon.viz.ui.simulatedtime.SimulatedTimeOperations;
/**
* Action to launch Send ISC grids dialog.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 15, 2015 #4858 dgilling Initial creation
*
* </pre>
*
* @author dgilling
* @version 1.0
*/
public class ShowSendIscGridsDialog extends AbstractHandler {
private SendISCDialog dialog;
/*
* (non-Javadoc)
*
* @see
* org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.
* ExecutionEvent)
*/
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
if (!SimulatedTimeOperations.isTransmitAllowed()) {
SimulatedTimeOperations.displayFeatureLevelWarning(shell,
"Send ISC grids");
return null;
}
DataManager dm = DataManagerUIFactory.getCurrentInstance();
if (dm == null) {
return null;
}
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
dialog = new SendISCDialog(shell, dm);
dialog.setBlockOnOpen(false);
dialog.open();
} else {
dialog.bringToTop();
}
return null;
}
@Override
public boolean isEnabled() {
DataManager dm = DataManagerUIFactory.getCurrentInstance();
if (dm != null) {
return (!dm.sendIscOnSave() || !dm.sendIscOnPublish())
&& CAVEMode.getMode().equals(CAVEMode.OPERATIONAL)
&& dm.requestISC();
}
return false;
}
}

View file

@ -48,6 +48,8 @@ import com.raytheon.uf.common.python.PythonScript;
import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.ISimulatedTimeChangeListener;
import com.raytheon.uf.common.time.SimulatedTime;
import com.raytheon.uf.common.time.TimeRange; import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.viz.core.VizApp; import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.exception.VizException;
@ -75,6 +77,8 @@ import com.raytheon.viz.gfe.smarttool.script.SmartToolFactory;
import com.raytheon.viz.gfe.smarttool.script.SmartToolJobPool; import com.raytheon.viz.gfe.smarttool.script.SmartToolJobPool;
import com.raytheon.viz.gfe.smarttool.script.SmartToolUIController; import com.raytheon.viz.gfe.smarttool.script.SmartToolUIController;
import com.raytheon.viz.gfe.textformatter.TextProductManager; import com.raytheon.viz.gfe.textformatter.TextProductManager;
import com.raytheon.viz.ui.simulatedtime.SimulatedTimeOperations;
import com.raytheon.viz.ui.simulatedtime.SimulatedTimeProhibitedOpException;
/** /**
* DataManager is the central singleton in GFE upon which other managers are * DataManager is the central singleton in GFE upon which other managers are
@ -104,6 +108,7 @@ import com.raytheon.viz.gfe.textformatter.TextProductManager;
* 09/09/2014 3592 randerso Added call to SampleSetManager.dispose() * 09/09/2014 3592 randerso Added call to SampleSetManager.dispose()
* 10/30/2014 3775 randerso Added parmCacheInit to initStatus * 10/30/2014 3775 randerso Added parmCacheInit to initStatus
* 04/20/2015 4027 randerso Let TextProductManager know we are not running in a GUI * 04/20/2015 4027 randerso Let TextProductManager know we are not running in a GUI
* 09/15/2015 4858 dgilling Disable ISC when DRT mode is enabled.
* *
* </pre> * </pre>
* *
@ -111,7 +116,7 @@ import com.raytheon.viz.gfe.textformatter.TextProductManager;
* @version 1.0 * @version 1.0
*/ */
public class DataManager { public class DataManager implements ISimulatedTimeChangeListener {
private static final transient IUFStatusHandler statusHandler = UFStatus private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(DataManager.class); .getHandler(DataManager.class);
@ -204,6 +209,8 @@ public class DataManager {
private final SmartToolJobPool toolJobPool; private final SmartToolJobPool toolJobPool;
private boolean previousIscSendState;
public IISCDataAccess getIscDataAccess() { public IISCDataAccess getIscDataAccess() {
return iscDataAccess; return iscDataAccess;
} }
@ -270,8 +277,14 @@ public class DataManager {
// set the ISC send state, which initially sends the message // set the ISC send state, which initially sends the message
new ISCSendStatusChangedMsg(false).send(); // initial state new ISCSendStatusChangedMsg(false).send(); // initial state
if (CAVEMode.getMode().equals(CAVEMode.OPERATIONAL)) { if (CAVEMode.getMode().equals(CAVEMode.OPERATIONAL)
enableISCsend(true); && ((SimulatedTime.getSystemTime().isRealTime()))
|| (SimulatedTimeOperations.isTransmitAllowedinSimulatedTime())) {
try {
enableISCsend(true);
} catch (SimulatedTimeProhibitedOpException e) {
statusHandler.error(e.getLocalizedMessage(), e);
}
} }
// this.queryString = "siteID='" + this.getSiteID() + "'"; // this.queryString = "siteID='" + this.getSiteID() + "'";
this.router.start(); this.router.start();
@ -282,6 +295,11 @@ public class DataManager {
this.autoSaveJob = new AutoSaveJob(this); this.autoSaveJob = new AutoSaveJob(this);
new ParmEvictor(); new ParmEvictor();
if (CAVEMode.getMode() == CAVEMode.OPERATIONAL) {
SimulatedTime.getSystemTime().addSimulatedTimeChangeListener(this);
}
this.previousIscSendState = clientISCSendStatus();
} }
/** /**
@ -333,6 +351,11 @@ public class DataManager {
killPoolsThread.setDaemon(false); killPoolsThread.setDaemon(false);
killPoolsThread.start(); killPoolsThread.start();
if (CAVEMode.getMode() == CAVEMode.OPERATIONAL) {
SimulatedTime.getSystemTime().removeSimulatedTimeChangeListener(
this);
}
NotificationManagerJob.removeObserver("edex.alerts.gfe", router); NotificationManagerJob.removeObserver("edex.alerts.gfe", router);
} }
@ -684,8 +707,15 @@ public class DataManager {
* Sets the overall isc send capability for this user. * Sets the overall isc send capability for this user.
* *
* @param state * @param state
* @throws SimulatedTimeProhibitedOperationException
*/ */
public void enableISCsend(boolean state) { public void enableISCsend(boolean state)
throws SimulatedTimeProhibitedOpException {
if (state && !SimulatedTimeOperations.isTransmitAllowed()) {
throw SimulatedTimeOperations
.constructProhibitedOpException("ISC Send");
}
if (state == iscSendState) { if (state == iscSendState) {
return; // do nothing return; // do nothing
} }
@ -721,4 +751,34 @@ public class DataManager {
public SmartToolJobPool getSmartToolJobPool() { public SmartToolJobPool getSmartToolJobPool() {
return toolJobPool; return toolJobPool;
} }
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.common.time.ISimulatedTimeChangeListener#timechanged()
*/
@Override
public void timechanged() {
boolean tryToEnable = SimulatedTimeOperations.isTransmitAllowed();
boolean newState;
if (tryToEnable) {
newState = previousIscSendState;
} else {
newState = false;
previousIscSendState = clientISCSendStatus();
}
try {
enableISCsend(newState);
} catch (SimulatedTimeProhibitedOpException e) {
/*
* We should never hit this state...but better to log something just
* in case.
*/
statusHandler.handle(Priority.WARN,
"ISC send status got into an invalid state trying to change state to "
+ newState, e);
}
}
} }

View file

@ -69,6 +69,8 @@ import com.raytheon.viz.gfe.core.internal.IFPClient;
import com.raytheon.viz.gfe.core.parm.Parm.InterpState; import com.raytheon.viz.gfe.core.parm.Parm.InterpState;
import com.raytheon.viz.gfe.core.parm.ParmState.InterpMode; import com.raytheon.viz.gfe.core.parm.ParmState.InterpMode;
import com.raytheon.viz.gfe.core.wxvalue.WxValue; import com.raytheon.viz.gfe.core.wxvalue.WxValue;
import com.raytheon.viz.ui.simulatedtime.SimulatedTimeOperations;
import com.raytheon.viz.ui.simulatedtime.SimulatedTimeProhibitedOpException;
/** /**
* A ParmOp provides global functions to affect all parms. * A ParmOp provides global functions to affect all parms.
@ -89,6 +91,8 @@ import com.raytheon.viz.gfe.core.wxvalue.WxValue;
* overlapping grids since this is now done on * overlapping grids since this is now done on
* the server side * the server side
* 08/20/2014 #1664 randerso Fixed invalid thread access * 08/20/2014 #1664 randerso Fixed invalid thread access
* 09/15/2015 #4858 dgilling Disable publish and ISC send when DRT
* mode is enabled.
* *
* </pre> * </pre>
* *
@ -478,9 +482,17 @@ public class ParmOp {
* Publish * Publish
* *
* @param req * @param req
* @throws SimulatedTimeProhibitedOperationException
*/ */
public void publish(List<CommitGridRequest> req) { public void publish(List<CommitGridRequest> req)
throws SimulatedTimeProhibitedOpException {
CAVEMode mode = CAVEMode.getMode(); CAVEMode mode = CAVEMode.getMode();
if (!SimulatedTimeOperations.isTransmitAllowed()) {
throw SimulatedTimeOperations
.constructProhibitedOpException("Publish GFE grids");
}
if (mode.equals(CAVEMode.PRACTICE) || mode.equals(CAVEMode.TEST)) { if (mode.equals(CAVEMode.PRACTICE) || mode.equals(CAVEMode.TEST)) {
statusHandler.handle(Priority.EVENTA, "PUBLISH Simulated. "); statusHandler.handle(Priority.EVENTA, "PUBLISH Simulated. ");
return; return;
@ -1057,10 +1069,17 @@ public class ParmOp {
* This function is called to send grids. * This function is called to send grids.
* *
* @param req * @param req
* @throws SimulatedTimeProhibitedOperationException
*/ */
public void sendISC(List<SendISCRequest> req) { public void sendISC(List<SendISCRequest> req)
throws SimulatedTimeProhibitedOpException {
CAVEMode mode = CAVEMode.getMode(); CAVEMode mode = CAVEMode.getMode();
if (!SimulatedTimeOperations.isTransmitAllowed()) {
throw SimulatedTimeOperations
.constructProhibitedOpException("Send ISC grids");
}
if (mode.equals(CAVEMode.PRACTICE) || mode.equals(CAVEMode.TEST)) { if (mode.equals(CAVEMode.PRACTICE) || mode.equals(CAVEMode.TEST)) {
statusHandler.handle(Priority.EVENTA, "SEND ISC Simulated. "); statusHandler.handle(Priority.EVENTA, "SEND ISC Simulated. ");
return; return;

View file

@ -54,6 +54,7 @@ import com.raytheon.viz.gfe.smartscript.FieldDefinition.FieldType;
import com.raytheon.viz.gfe.tasks.TaskManager; import com.raytheon.viz.gfe.tasks.TaskManager;
import com.raytheon.viz.gfe.ui.runtimeui.ValuesDialog; import com.raytheon.viz.gfe.ui.runtimeui.ValuesDialog;
import com.raytheon.viz.ui.dialogs.CaveJFACEDialog; import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
import com.raytheon.viz.ui.simulatedtime.SimulatedTimeOperations;
import com.raytheon.viz.ui.widgets.ToggleSelectList; import com.raytheon.viz.ui.widgets.ToggleSelectList;
/** /**
@ -63,18 +64,19 @@ import com.raytheon.viz.ui.widgets.ToggleSelectList;
* SOFTWARE HISTORY * SOFTWARE HISTORY
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Mar 7, 2008 Eric Babin Initial Creation * Mar 7, 2008 Eric Babin Initial Creation
* Oct 27, 2012 1287 rferrel Code cleanup for non-blocking dialog. * Oct 27, 2012 1287 rferrel Code cleanup for non-blocking dialog.
* Oct 25, 2012 1287 rferrel Code changes for non-blocking PublishDialog. * Oct 25, 2012 1287 rferrel Code changes for non-blocking PublishDialog.
* Nov 30, 2012 15575 ryu Added variable replacement for SelectedStart, * Nov 30, 2012 15575 ryu Added variable replacement for SelectedStart,
* SelectedEnd, and home * SelectedEnd, and home
* Nov 13, 2012 1298 rferrel Code changes for non-blocking UserEntryDialog. * Nov 13, 2012 1298 rferrel Code changes for non-blocking UserEntryDialog.
* Jan 9, 2013 15635 jdynina Allowed to mix and match entry dialogs. Changed order * Jan 9, 2013 15635 jdynina Allowed to mix and match entry dialogs. Changed order
* of dialogs to match A1 displaying entry fields first. * of dialogs to match A1 displaying entry fields first.
* Mar 29, 2013 1790 rferrel Bug fix for non-blocking dialogs. * Mar 29, 2013 1790 rferrel Bug fix for non-blocking dialogs.
* Oct 23, 2013 DR16203 equintin Restore the "-c" argument when the command * Oct 23, 2013 DR16203 equintin Restore the "-c" argument when the command
* for Png Images... is rebuilt after * for Png Images... is rebuilt after
* return from the dialog. * return from the dialog.
* Sep 15, 2015 4858 dgilling Disable all features in DRT mode.
* *
* </pre> * </pre>
* *
@ -87,7 +89,7 @@ public class ProductScriptsDialog extends CaveJFACEDialog {
private final transient IUFStatusHandler statusHandler = UFStatus private final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(ProductScriptsDialog.class); .getHandler(ProductScriptsDialog.class);
private final int RUN_ID = IDialogConstants.CLIENT_ID + 1; private final int RUN_ID = IDialogConstants.CLIENT_ID + 1;
private String[] scripts; private String[] scripts;
@ -146,7 +148,12 @@ public class ProductScriptsDialog extends CaveJFACEDialog {
@Override @Override
protected void buttonPressed(int buttonId) { protected void buttonPressed(int buttonId) {
if (buttonId != IDialogConstants.CANCEL_ID) { if (buttonId != IDialogConstants.CANCEL_ID) {
runScripts(); if (SimulatedTimeOperations.isTransmitAllowed()) {
runScripts();
} else {
SimulatedTimeOperations.displayFeatureLevelWarning(getShell(),
"Run Product Scripts");
}
} }
super.buttonPressed(buttonId); super.buttonPressed(buttonId);
} }
@ -209,7 +216,7 @@ public class ProductScriptsDialog extends CaveJFACEDialog {
cmd = cmd.replace("{ztime}", curGMTTime); cmd = cmd.replace("{ztime}", curGMTTime);
cmd = cmd.replace("{home}", gfeHome); cmd = cmd.replace("{home}", gfeHome);
cmd = cmd.replace("{prddir}", prddir); cmd = cmd.replace("{prddir}", prddir);
// The user is prompted to enter the value with which to replace // The user is prompted to enter the value with which to replace
// the // the
// following variables: // following variables:
@ -228,7 +235,7 @@ public class ProductScriptsDialog extends CaveJFACEDialog {
int entryIdx = cmd.indexOf("{entry:"); int entryIdx = cmd.indexOf("{entry:");
if (entryIdx >= 0) { if (entryIdx >= 0) {
run = true; run = true;
int endEntryIdx = cmd.indexOf("}", entryIdx); int endEntryIdx = cmd.indexOf("}", entryIdx);
String[] entry = cmd.substring(entryIdx + 1, endEntryIdx) String[] entry = cmd.substring(entryIdx + 1, endEntryIdx)
.split(":"); .split(":");
@ -240,12 +247,11 @@ public class ProductScriptsDialog extends CaveJFACEDialog {
// Keep this a blocking dialog so the loop will only display // Keep this a blocking dialog so the loop will only display
// one dialog at a time. // one dialog at a time.
fieldDefs.add(new FieldDefinition((Object) entry[1], fieldDefs.add(new FieldDefinition(entry[1], entry[1],
entry[1], FieldType.ALPHANUMERIC, FieldType.ALPHANUMERIC, entry[2], Arrays
(Object) entry[2], Arrays.asList(Arrays.asList( .asList(Arrays.asList(configFile).toArray(
configFile).toArray( new Object[configFile.length])),
new Object[configFile.length])), (float) 1.0, 3));
(float) 1.0, (int) 3));
if (start == 0) { if (start == 0) {
start = entryIdx; start = entryIdx;
@ -253,8 +259,9 @@ public class ProductScriptsDialog extends CaveJFACEDialog {
start = entryIdx; start = entryIdx;
} }
if (entry[1].equals("ConfigFile")) { //DR 16203 eeq 10/23/2013 if (entry[1].equals("ConfigFile")) { // DR 16203 eeq
endIdx = endEntryIdx; // 10/23/2013
endIdx = endEntryIdx;
} }
} }
@ -277,15 +284,15 @@ public class ProductScriptsDialog extends CaveJFACEDialog {
fieldDefs fieldDefs
.add(new FieldDefinition( .add(new FieldDefinition(
(Object) entry[1], entry[1],
entry[1], entry[1],
FieldType.RADIO, FieldType.RADIO,
(Object) fields[0], fields[0],
Arrays.asList(Arrays Arrays.asList(Arrays
.asList(fields) .asList(fields)
.toArray( .toArray(
new Object[fields.length])), new Object[fields.length])),
(float) 1.0, (int) 3)); (float) 1.0, 3));
if (start == 0) { if (start == 0) {
start = entryIdx; start = entryIdx;
} else if ((start > 0) && (start > entryIdx) } else if ((start > 0) && (start > entryIdx)
@ -318,7 +325,7 @@ public class ProductScriptsDialog extends CaveJFACEDialog {
fieldDefs fieldDefs
.add(new FieldDefinition( .add(new FieldDefinition(
(Object) entry[1], entry[1],
entry[1], entry[1],
FieldType.CHECK, FieldType.CHECK,
(Object) null, (Object) null,
@ -326,7 +333,7 @@ public class ProductScriptsDialog extends CaveJFACEDialog {
.asList(fields) .asList(fields)
.toArray( .toArray(
new Object[fields.length])), new Object[fields.length])),
(float) 1.0, (int) 3)); (float) 1.0, 3));
if (start == 0) { if (start == 0) {
start = entryIdx; start = entryIdx;
} else if ((start > 0) && (start > entryIdx) } else if ((start > 0) && (start > entryIdx)
@ -356,16 +363,17 @@ public class ProductScriptsDialog extends CaveJFACEDialog {
if (dlgOpen <= 0) { if (dlgOpen <= 0) {
Map<Object, Object> map = scriptDlg.getValues(); Map<Object, Object> map = scriptDlg.getValues();
String returnMsg = ""; String returnMsg = "";
for (Map.Entry<Object, Object> entry : map.entrySet()) { for (Map.Entry<Object, Object> entry : map.entrySet()) {
returnMsg = returnMsg + entry.getValue().toString() returnMsg = returnMsg + entry.getValue().toString()
+ " "; + " ";
} }
if (endIdx > 0) { if (endIdx > 0) {
cmd = cmd.replace(cmd.substring(start, endIdx+2), returnMsg); cmd = cmd.replace(cmd.substring(start, endIdx + 2),
returnMsg);
} else { } else {
start = start - 3; start = start - 3;
cmd = cmd.substring(0, start) + returnMsg; cmd = cmd.substring(0, start) + returnMsg;
@ -374,7 +382,7 @@ public class ProductScriptsDialog extends CaveJFACEDialog {
} }
TaskManager.getInstance().createScriptTask(name, cmd); TaskManager.getInstance().createScriptTask(name, cmd);
} catch (Exception e) { } catch (Exception e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
e); e);
@ -403,7 +411,12 @@ public class ProductScriptsDialog extends CaveJFACEDialog {
publishToOfficialButton.addSelectionListener(new SelectionAdapter() { publishToOfficialButton.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
launchPublishToOfficial(); if (SimulatedTimeOperations.isTransmitAllowed()) {
launchPublishToOfficial();
} else {
SimulatedTimeOperations.displayFeatureLevelWarning(
getShell(), "Publish Grids to Official");
}
} }
}); });

View file

@ -35,6 +35,8 @@ import org.eclipse.swt.widgets.ProgressBar;
import org.eclipse.swt.widgets.TabFolder; import org.eclipse.swt.widgets.TabFolder;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID; import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.viz.gfe.Activator; import com.raytheon.viz.gfe.Activator;
import com.raytheon.viz.gfe.core.DataManager; import com.raytheon.viz.gfe.core.DataManager;
import com.raytheon.viz.gfe.dialogs.FormatterLauncherDialog; import com.raytheon.viz.gfe.dialogs.FormatterLauncherDialog;
@ -44,6 +46,7 @@ import com.raytheon.viz.gfe.tasks.TaskManager;
import com.raytheon.viz.gfe.textformatter.FormatterUtil; import com.raytheon.viz.gfe.textformatter.FormatterUtil;
import com.raytheon.viz.gfe.textformatter.TextProductFinishListener; import com.raytheon.viz.gfe.textformatter.TextProductFinishListener;
import com.raytheon.viz.gfe.textformatter.TextProductManager; import com.raytheon.viz.gfe.textformatter.TextProductManager;
import com.raytheon.viz.ui.simulatedtime.SimulatedTimeProhibitedOpException;
/** /**
* Composite containing the product area and its controls. * Composite containing the product area and its controls.
@ -58,7 +61,7 @@ import com.raytheon.viz.gfe.textformatter.TextProductManager;
* 2 SEP 2011 10654 gzhou Delete running/pending task and close tab. * 2 SEP 2011 10654 gzhou Delete running/pending task and close tab.
* 23 MAY 2012 14859 ryu Select VTEC formatting in practice mode * 23 MAY 2012 14859 ryu Select VTEC formatting in practice mode
* based on VTECMessageType setting. * based on VTECMessageType setting.
* 10 AUG 2012 15178 mli Add autoWrite and autoStore capability * 10 AUG 2012 15178 mli Add autoWrite and autoStore capability
* 26 SEP 2012 15423 ryu Fix product correction in practice mode * 26 SEP 2012 15423 ryu Fix product correction in practice mode
* 15 MAY 2013 1842 dgilling Change constructor signature to accept a * 15 MAY 2013 1842 dgilling Change constructor signature to accept a
* DataManager instance. * DataManager instance.
@ -68,6 +71,7 @@ import com.raytheon.viz.gfe.textformatter.TextProductManager;
* Passed dataMgr instance to FormatterUtil.runFormatterScript * Passed dataMgr instance to FormatterUtil.runFormatterScript
* 12 FEB 2014 2801 randerso Added prompting if formatter is run against non-normal database * 12 FEB 2014 2801 randerso Added prompting if formatter is run against non-normal database
* 20 APR 2015 4027 randerso Fixes for GFE formatter auto tests to support mixed case WA * 20 APR 2015 4027 randerso Fixes for GFE formatter auto tests to support mixed case WA
* 15 SEP 2015 4858 dgilling Handle exception from runFormatterScript.
* *
* </pre> * </pre>
* *
@ -77,6 +81,10 @@ import com.raytheon.viz.gfe.textformatter.TextProductManager;
*/ */
public class ProductAreaComp extends Composite implements public class ProductAreaComp extends Composite implements
TextProductFinishListener, ITransmissionState { TextProductFinishListener, ITransmissionState {
private final IUFStatusHandler statusHandler = UFStatus
.getHandler(getClass());
/** /**
* Zone combiner image. * Zone combiner image.
*/ */
@ -404,10 +412,14 @@ public class ProductAreaComp extends Composite implements
// Get the source database // Get the source database
zoneCombiner.applyZoneCombo(); zoneCombiner.applyZoneCombo();
FormatterUtil.runFormatterScript(dataMgr, try {
textProductMgr, productName, FormatterUtil.runFormatterScript(dataMgr,
dbId.toString(), vtecMode, textProductMgr, productName,
ProductAreaComp.this); dbId.toString(), vtecMode,
ProductAreaComp.this);
} catch (SimulatedTimeProhibitedOpException e) {
statusHandler.error(e.getLocalizedMessage(), e);
}
} }
} }
} }

View file

@ -119,6 +119,7 @@ import com.raytheon.viz.gfe.dialogs.formatterlauncher.ConfigData.ProductStateEnu
import com.raytheon.viz.gfe.product.ProductFileUtil; import com.raytheon.viz.gfe.product.ProductFileUtil;
import com.raytheon.viz.gfe.product.TextDBUtil; import com.raytheon.viz.gfe.product.TextDBUtil;
import com.raytheon.viz.ui.dialogs.ICloseCallback; import com.raytheon.viz.ui.dialogs.ICloseCallback;
import com.raytheon.viz.ui.simulatedtime.SimulatedTimeOperations;
/** /**
* Composite containing the product editor controls. * Composite containing the product editor controls.
@ -145,7 +146,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Changes for non-blocking FindReplaceDlg. * Changes for non-blocking FindReplaceDlg.
* Changes for non-blocking StoreTransmitDlg. * Changes for non-blocking StoreTransmitDlg.
* Changes for non-blocking WrapLengthDialog. * Changes for non-blocking WrapLengthDialog.
* 08 Feb 2013 12851 jzeng Add menuToAddTo in create*Menu * 08 Feb 2013 12851 jzeng Add menuToAddTo in create*Menu
* Create createEditorPopupMenu() * Create createEditorPopupMenu()
* Add mouselistener in createTextControl() for StyledText * Add mouselistener in createTextControl() for StyledText
* 28 Feb 2013 15889 ryu Removed detachAttributionPhrase and getVTECActionCodes * 28 Feb 2013 15889 ryu Removed detachAttributionPhrase and getVTECActionCodes
@ -168,6 +169,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* 04/20/2015 4027 randerso Renamed ProductStateEnum with an initial capital * 04/20/2015 4027 randerso Renamed ProductStateEnum with an initial capital
* Expunged Calendar from ActiveTableRecord * Expunged Calendar from ActiveTableRecord
* 08/10/2015 4721 randerso Changed getNNNid() to use the productID field (not textdbPil) * 08/10/2015 4721 randerso Changed getNNNid() to use the productID field (not textdbPil)
* 09/15/2015 4858 dgilling Disable store/transmit in DRT mode.
* </pre> * </pre>
* *
* @author lvenable * @author lvenable
@ -1082,9 +1084,14 @@ public class ProductEditorComp extends Composite implements
* dialog. AUTOSTORE: implement autoStore * dialog. AUTOSTORE: implement autoStore
*/ */
private void storeTransmit(Action action) { private void storeTransmit(Action action) {
if (!SimulatedTimeOperations.isTransmitAllowed()) {
SimulatedTimeOperations.displayFeatureLevelWarning(getShell(),
"Text Product Store/Transmit");
brain();
return;
}
ProductDataStruct pds = textComp.getProductDataStruct(); ProductDataStruct pds = textComp.getProductDataStruct();
if (pds == null) { if (pds == null) {
String msg = "There is no product to transmit.\n\nAction cancelled."; String msg = "There is no product to transmit.\n\nAction cancelled.";
MessageBox mb = new MessageBox(getShell(), SWT.OK MessageBox mb = new MessageBox(getShell(), SWT.OK

View file

@ -60,6 +60,8 @@ import com.raytheon.viz.gfe.product.TextDBUtil;
import com.raytheon.viz.gfe.vtec.GFEVtecUtil; import com.raytheon.viz.gfe.vtec.GFEVtecUtil;
import com.raytheon.viz.texteditor.util.VtecObject; import com.raytheon.viz.texteditor.util.VtecObject;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog; import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
import com.raytheon.viz.ui.simulatedtime.SimulatedTimeOperations;
import com.raytheon.viz.ui.simulatedtime.SimulatedTimeProhibitedOpException;
/** /**
* Display the Store/Transmit dialog. * Display the Store/Transmit dialog.
@ -89,6 +91,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* Feb 26, 2015 4126 randerso Ensure transmit/store is properly cancelled if dialog is closed * Feb 26, 2015 4126 randerso Ensure transmit/store is properly cancelled if dialog is closed
* Code cleanup * Code cleanup
* Apr 20, 2015 4027 randerso Renamed ProductStateEnum with an initial capital * Apr 20, 2015 4027 randerso Renamed ProductStateEnum with an initial capital
* Sep 15, 2015 4858 dgilling Disable store/transmit in DRT mode.
* *
* </pre> * </pre>
* *
@ -432,6 +435,11 @@ public class StoreTransmitDlg extends CaveSWTDialog {
transmitProduct(true); transmitProduct(true);
} }
} else { } else {
if (!SimulatedTimeOperations.isTransmitAllowed()) {
throw SimulatedTimeOperations
.constructProhibitedOpException("Store/Transmit GFE text products");
}
if (isStoreDialog) { if (isStoreDialog) {
TextDBUtil.storeProduct(pid, productText, TextDBUtil.storeProduct(pid, productText,
parentEditor.isTestVTEC()); parentEditor.isTestVTEC());
@ -443,7 +451,11 @@ public class StoreTransmitDlg extends CaveSWTDialog {
statusHandler.handle(Priority.CRITICAL, statusHandler.handle(Priority.CRITICAL,
"Error preparing product for transmission.", e); "Error preparing product for transmission.", e);
sendTransmissionStatus(ConfigData.ProductStateEnum.Failed); sendTransmissionStatus(ConfigData.ProductStateEnum.Failed);
StoreTransmitDlg.this.parentEditor.revive(); parentEditor.revive();
} catch (SimulatedTimeProhibitedOpException e) {
statusHandler.error(e.getLocalizedMessage(), e);
sendTransmissionStatus(ConfigData.ProductStateEnum.Failed);
parentEditor.brain();
} }
} }
@ -621,7 +633,7 @@ public class StoreTransmitDlg extends CaveSWTDialog {
} catch (VizException e) { } catch (VizException e) {
statusHandler.handle(Priority.CRITICAL, "Error sending product", e); statusHandler.handle(Priority.CRITICAL, "Error sending product", e);
sendTransmissionStatus(ConfigData.ProductStateEnum.Failed); sendTransmissionStatus(ConfigData.ProductStateEnum.Failed);
this.parentEditor.revive(); parentEditor.revive();
} }
SEQ_NUMBER++; SEQ_NUMBER++;

View file

@ -44,6 +44,8 @@ import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID; import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID; import com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID;
import com.raytheon.uf.common.dataplugin.gfe.server.request.SendISCRequest; import com.raytheon.uf.common.dataplugin.gfe.server.request.SendISCRequest;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.time.TimeRange; import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.viz.gfe.Activator; import com.raytheon.viz.gfe.Activator;
import com.raytheon.viz.gfe.PythonPreferenceStore; import com.raytheon.viz.gfe.PythonPreferenceStore;
@ -52,6 +54,7 @@ import com.raytheon.viz.gfe.core.IParmManager;
import com.raytheon.viz.gfe.core.ISelectTimeRangeManager; import com.raytheon.viz.gfe.core.ISelectTimeRangeManager;
import com.raytheon.viz.gfe.core.parm.ParmOp; import com.raytheon.viz.gfe.core.parm.ParmOp;
import com.raytheon.viz.ui.dialogs.CaveJFACEDialog; import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
import com.raytheon.viz.ui.simulatedtime.SimulatedTimeProhibitedOpException;
import com.raytheon.viz.ui.widgets.ToggleSelectList; import com.raytheon.viz.ui.widgets.ToggleSelectList;
/** /**
@ -66,6 +69,7 @@ import com.raytheon.viz.ui.widgets.ToggleSelectList;
* 08/20/09 1995 lvenable Initial creation * 08/20/09 1995 lvenable Initial creation
* 09/02/09 #1370 randerso Make the same as PublishDialog * 09/02/09 #1370 randerso Make the same as PublishDialog
* 10/26/2012 1287 rferrel Code cleanup for non-blocking dialog. * 10/26/2012 1287 rferrel Code cleanup for non-blocking dialog.
* 09/15/2015 4858 dgilling Handle exception from ParmOp.sendISC.
* *
* </pre> * </pre>
* *
@ -74,6 +78,9 @@ import com.raytheon.viz.ui.widgets.ToggleSelectList;
*/ */
public class SendISCDialog extends CaveJFACEDialog { public class SendISCDialog extends CaveJFACEDialog {
private final IUFStatusHandler statusHandler = UFStatus
.getHandler(getClass());
private final int MAX_LIST_HEIGHT = 10; private final int MAX_LIST_HEIGHT = 10;
private final PythonPreferenceStore prefs = Activator.getDefault() private final PythonPreferenceStore prefs = Activator.getDefault()
@ -438,7 +445,11 @@ public class SendISCDialog extends CaveJFACEDialog {
// LogStream.logUse("Send ISC: ", requests); // LogStream.logUse("Send ISC: ", requests);
// send the data by calling the parm op command // send the data by calling the parm op command
parmOp.sendISC(requests); try {
parmOp.sendISC(requests);
} catch (SimulatedTimeProhibitedOpException e) {
statusHandler.error(e.getLocalizedMessage(), e);
}
} }
protected TimeRange getTR(ParmID parm) { protected TimeRange getTR(ParmID parm) {

View file

@ -1,177 +0,0 @@
/**
* 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.
**/
package com.raytheon.viz.gfe.menu;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.CompoundContributionItem;
import com.raytheon.viz.core.mode.CAVEMode;
import com.raytheon.viz.gfe.core.DataManager;
import com.raytheon.viz.gfe.core.DataManagerUIFactory;
import com.raytheon.viz.gfe.core.msgs.ISCSendStatusChangedMsg;
import com.raytheon.viz.gfe.core.msgs.Message;
import com.raytheon.viz.gfe.dialogs.isc.ISCRequestReplyDlg;
import com.raytheon.viz.gfe.dialogs.isc.SendISCDialog;
/**
* Menu handler for enabling and disabling ISC related menu items
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 20, 2011 bphillip Initial creation
* Oct 25, 2012 1287 rferrel Changes for non-blocking SendISCDialog
* and ISCRequestReplyDlg.
* Aug 29, 2014 3527 mapeters Check for current DataManager instance to not
* be null before requesting ISC, updated deprecated
* {@link DataManager#getCurrentInstance()} calls.
*
* </pre>
*
* @author bphillip
* @version 1.0
*/
public class ISCMenuEnabler extends CompoundContributionItem {
private SendISCDialog sendISCDlg;
private ISCRequestReplyDlg iscRequestDlg;
/*
* (non-Javadoc)
*
* @see
* org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
*/
@Override
protected IContributionItem[] getContributionItems() {
ActionContributionItem sendIntersiteItem = new ActionContributionItem(
new Action("Send Intersite Grids") {
public void run() {
Shell shell = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getShell();
DataManager dm = DataManagerUIFactory
.getCurrentInstance();
if (dm == null) {
return;
}
if (sendISCDlg == null || sendISCDlg.getShell() == null
|| sendISCDlg.isDisposed()) {
sendISCDlg = new SendISCDialog(shell, dm);
sendISCDlg.setBlockOnOpen(false);
sendISCDlg.open();
} else {
sendISCDlg.bringToTop();
}
}
@Override
public boolean isEnabled() {
DataManager dm = DataManagerUIFactory
.getCurrentInstance();
if (dm == null) {
return false;
} else {
return (!dm.sendIscOnSave() || !dm
.sendIscOnPublish())
&& CAVEMode.getMode().equals(
CAVEMode.OPERATIONAL)
&& dm.requestISC();
}
}
});
ActionContributionItem iscRequestReplyItem = new ActionContributionItem(
new Action("ISC Request/Reply") {
@Override
public boolean isEnabled() {
DataManager dm = DataManagerUIFactory
.getCurrentInstance();
if (dm == null) {
return false;
} else {
return CAVEMode.getMode().equals(
CAVEMode.OPERATIONAL)
&& dm.requestISC();
}
}
@Override
public void run() {
if (iscRequestDlg == null
|| iscRequestDlg.getShell() == null
|| iscRequestDlg.isDisposed()) {
Shell shell = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getShell();
iscRequestDlg = new ISCRequestReplyDlg(shell);
iscRequestDlg.open();
} else {
iscRequestDlg.bringToTop();
}
}
});
ActionContributionItem iscSendEnableItem = new ActionContributionItem(
new Action("ISC Send Enable", IAction.AS_CHECK_BOX) {
@Override
public boolean isEnabled() {
return getIscEnabled();
}
public void run() {
DataManager dm = DataManagerUIFactory
.getCurrentInstance();
if (dm != null) {
boolean newState = !Message.inquireLastMessage(
ISCSendStatusChangedMsg.class).isEnabled();
dm.enableISCsend(newState);
}
}
private boolean getIscEnabled() {
DataManager dm = DataManagerUIFactory
.getCurrentInstance();
return (dm != null) ? CAVEMode.getMode().equals(
CAVEMode.OPERATIONAL)
&& dm.requestISC() : false;
}
public boolean isChecked() {
return Message.inquireLastMessage(
ISCSendStatusChangedMsg.class).isEnabled();
}
});
return new IContributionItem[] { sendIntersiteItem,
iscRequestReplyItem, iscSendEnableItem };
}
}

View file

@ -19,6 +19,7 @@
**/ **/
package com.raytheon.viz.gfe.perspective; package com.raytheon.viz.gfe.perspective;
import java.util.Arrays;
import java.util.List; import java.util.List;
import org.eclipse.core.commands.Command; import org.eclipse.core.commands.Command;
@ -44,6 +45,7 @@ import org.eclipse.ui.keys.IBindingService;
import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.ISimulatedTimeChangeListener;
import com.raytheon.uf.common.time.SimulatedTime; import com.raytheon.uf.common.time.SimulatedTime;
import com.raytheon.uf.viz.core.IDisplayPane; import com.raytheon.uf.viz.core.IDisplayPane;
import com.raytheon.uf.viz.core.IDisplayPaneContainer; import com.raytheon.uf.viz.core.IDisplayPaneContainer;
@ -53,7 +55,6 @@ import com.raytheon.uf.viz.core.drawables.ResourcePair;
import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.map.IMapDescriptor; import com.raytheon.uf.viz.core.map.IMapDescriptor;
import com.raytheon.uf.viz.core.maps.MapManager; import com.raytheon.uf.viz.core.maps.MapManager;
import com.raytheon.viz.core.mode.CAVEMode;
import com.raytheon.viz.gfe.Activator; import com.raytheon.viz.gfe.Activator;
import com.raytheon.viz.gfe.PythonPreferenceStore; import com.raytheon.viz.gfe.PythonPreferenceStore;
import com.raytheon.viz.gfe.actions.FormatterlauncherAction; import com.raytheon.viz.gfe.actions.FormatterlauncherAction;
@ -69,13 +70,14 @@ import com.raytheon.viz.ui.cmenu.ZoomMenuAction;
import com.raytheon.viz.ui.editor.AbstractEditor; import com.raytheon.viz.ui.editor.AbstractEditor;
import com.raytheon.viz.ui.perspectives.AbstractCAVEPerspectiveManager; import com.raytheon.viz.ui.perspectives.AbstractCAVEPerspectiveManager;
import com.raytheon.viz.ui.perspectives.VizPerspectiveListener; import com.raytheon.viz.ui.perspectives.VizPerspectiveListener;
import com.raytheon.viz.ui.simulatedtime.SimulatedTimeOperations;
/** /**
* Manages the life cycle of the GFE Perspectives * Manages the life cycle of the GFE Perspectives
* *
* Installs a perspective watcher that handles the transitions in and out of the * Installs a perspective watcher that handles the transitions in and out of the
* GFE perspectives. * GFE perspectives.
* *
* <pre> * <pre>
* SOFTWARE HISTORY * SOFTWARE HISTORY
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
@ -91,17 +93,26 @@ import com.raytheon.viz.ui.perspectives.VizPerspectiveListener;
* Dec 09, 2013 #2367 dgilling Remove shutdown of ProcedureJob and * Dec 09, 2013 #2367 dgilling Remove shutdown of ProcedureJob and
* SmartToolJob. * SmartToolJob.
* Jan 14, 2014 2594 bclement added low memory notification * Jan 14, 2014 2594 bclement added low memory notification
* Aug 31, 2015 #17970 yteng Notify user to close GFE if not in real-time * Sep 21, 2015 4858 dgilling Display warning message when DRT mode is enabled.
* </pre> * </pre>
* *
* @author randerso * @author randerso
* @version 1.0 * @version 1.0
*/ */
public class GFEPerspectiveManager extends AbstractCAVEPerspectiveManager { public class GFEPerspectiveManager extends AbstractCAVEPerspectiveManager
implements ISimulatedTimeChangeListener {
private static final transient IUFStatusHandler statusHandler = UFStatus private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(GFEPerspectiveManager.class); .getHandler(GFEPerspectiveManager.class);
private static final String PERSPECTIVE_NAME = "GFE";
private static final List<String> FEATURES_DISABLED_IN_SIM_TIME = Arrays
.asList("ISC send", "Publishing grids",
"Running text formatters and/or transmitting products",
"Running scripts from the Product Scripts Dialog");
/** The GFE Perspective Class */ /** The GFE Perspective Class */
public static final String GFE_PERSPECTIVE = "com.raytheon.viz.ui.GFEPerspective"; public static final String GFE_PERSPECTIVE = "com.raytheon.viz.ui.GFEPerspective";
@ -179,21 +190,16 @@ public class GFEPerspectiveManager extends AbstractCAVEPerspectiveManager {
+ GFESpatialDisplayManager.class.getName()); + GFESpatialDisplayManager.class.getName());
} }
} }
SimulatedTime.getSystemTime().addSimulatedTimeChangeListener(this);
} }
@Override @Override
public void activate() { public void activate() {
if (CAVEMode.getMode().equals(CAVEMode.OPERATIONAL) &&
!SimulatedTime.getSystemTime().isRealTime()
&& !CAVEMode.getFlagInDRT()) {
UFStatus.getHandler().handle(
Priority.WARN,
"CAVE in OPERATIONAL mode and CAVE clock is not set to real-time. Please close all GFE sessions, if any.");
}
super.activate(); super.activate();
displaySimulatedTimeWarning();
// Hack to disable editor closing // Hack to disable editor closing
IWorkbenchPage activePage = perspectiveWindow.getActivePage(); IWorkbenchPage activePage = perspectiveWindow.getActivePage();
if (activePage != null) { if (activePage != null) {
@ -227,6 +233,8 @@ public class GFEPerspectiveManager extends AbstractCAVEPerspectiveManager {
public void close() { public void close() {
super.close(); super.close();
SimulatedTime.getSystemTime().removeSimulatedTimeChangeListener(this);
try { try {
DataManager dm = DataManagerUIFactory DataManager dm = DataManagerUIFactory
.findInstance(perspectiveWindow); .findInstance(perspectiveWindow);
@ -423,4 +431,21 @@ public class GFEPerspectiveManager extends AbstractCAVEPerspectiveManager {
+ "\n\nConsider saving Fcst grids to free up memory."; + "\n\nConsider saving Fcst grids to free up memory.";
} }
@Override
public void timechanged() {
String activePerspective = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage().getPerspective()
.getId();
if (GFE_PERSPECTIVE.equals(activePerspective)) {
displaySimulatedTimeWarning();
}
}
private void displaySimulatedTimeWarning() {
if (!SimulatedTimeOperations.isTransmitAllowed()) {
SimulatedTimeOperations.displayPerspectiveLevelWarning(
perspectiveWindow.getShell(), PERSPECTIVE_NAME,
FEATURES_DISABLED_IN_SIM_TIME);
}
}
} }

View file

@ -23,14 +23,14 @@ import java.text.SimpleDateFormat;
import java.util.TimeZone; import java.util.TimeZone;
import com.raytheon.uf.common.activetable.ActiveTableMode; import com.raytheon.uf.common.activetable.ActiveTableMode;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.time.SimulatedTime; import com.raytheon.uf.common.time.SimulatedTime;
import com.raytheon.uf.common.time.TimeRange; import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.viz.core.mode.CAVEMode; import com.raytheon.viz.core.mode.CAVEMode;
import com.raytheon.viz.gfe.core.DataManager; import com.raytheon.viz.gfe.core.DataManager;
import com.raytheon.viz.gfe.dialogs.formatterlauncher.ConfigData; import com.raytheon.viz.gfe.dialogs.formatterlauncher.ConfigData;
import com.raytheon.viz.gfe.tasks.TaskManager; import com.raytheon.viz.gfe.tasks.TaskManager;
import com.raytheon.viz.ui.simulatedtime.SimulatedTimeOperations;
import com.raytheon.viz.ui.simulatedtime.SimulatedTimeProhibitedOpException;
/** /**
* Utilities for text formatter * Utilities for text formatter
@ -46,6 +46,7 @@ import com.raytheon.viz.gfe.tasks.TaskManager;
* Removed call to TextProductManager.reloadModule * Removed call to TextProductManager.reloadModule
* Apr 20, 2015 4027 randerso Renamed ProductStateEnum with an initial capital * Apr 20, 2015 4027 randerso Renamed ProductStateEnum with an initial capital
* Fixed hard coded active table mode in runFormatterScript * Fixed hard coded active table mode in runFormatterScript
* Sep 15, 2015 4858 dgilling Prevent formatters from being run in DRT mode.
* *
* </pre> * </pre>
* *
@ -54,11 +55,10 @@ import com.raytheon.viz.gfe.tasks.TaskManager;
*/ */
public class FormatterUtil { public class FormatterUtil {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(FormatterUtil.class);
public static String[] VTEC_MODES = { "Normal: NoVTEC", "Normal: O-Vtec", public static final String[] VTEC_MODES = { "Normal: NoVTEC",
"Normal: E-Vtec", "Normal: X-Vtec", "Test: NoVTEC", "Test: T-Vtec" }; "Normal: O-Vtec", "Normal: E-Vtec", "Normal: X-Vtec",
"Test: NoVTEC", "Test: T-Vtec" };
/** /**
* Runs a text formatter script for a given product * Runs a text formatter script for a given product
@ -76,10 +76,12 @@ public class FormatterUtil {
* VTEC mode * VTEC mode
* @param finish * @param finish
* listener to fire when formatter finishes generating product * listener to fire when formatter finishes generating product
* @throws SimulatedTimeProhibitedOperationException
*/ */
public static void runFormatterScript(DataManager dataMgr, public static void runFormatterScript(DataManager dataMgr,
TextProductManager productMgr, String productName, String dbId, TextProductManager productMgr, String productName, String dbId,
String vtecMode, TextProductFinishListener finish) { String vtecMode, TextProductFinishListener finish)
throws SimulatedTimeProhibitedOpException {
int testMode = 0; int testMode = 0;
ActiveTableMode atMode = ActiveTableMode.OPERATIONAL; ActiveTableMode atMode = ActiveTableMode.OPERATIONAL;
@ -129,11 +131,15 @@ public class FormatterUtil {
public static void runFormatterScript(String name, String vtecMode, public static void runFormatterScript(String name, String vtecMode,
String databaseID, String varDict, String vtecActiveTable, String databaseID, String varDict, String vtecActiveTable,
String drtTime, int testMode, TextProductFinishListener finish) { String drtTime, int testMode, TextProductFinishListener finish)
throws SimulatedTimeProhibitedOpException {
if (!SimulatedTimeOperations.isTransmitAllowed()) {
throw SimulatedTimeOperations
.constructProhibitedOpException("GFE Text formatters");
}
TextFormatter formatter = new TextFormatter(name, vtecMode, databaseID, TextFormatter formatter = new TextFormatter(name, vtecMode, databaseID,
varDict, vtecActiveTable, drtTime, testMode, finish); varDict, vtecActiveTable, drtTime, testMode, finish);
// Thread thread = new Thread(formatter);
// thread.start();
finish.textProductQueued(ConfigData.ProductStateEnum.Queued); finish.textProductQueued(ConfigData.ProductStateEnum.Queued);
TaskManager.getInstance().queueFormatter(formatter); TaskManager.getInstance().queueFormatter(formatter);
} }

View file

@ -19,9 +19,6 @@
**/ **/
package com.raytheon.viz.warngen.gui; package com.raytheon.viz.warngen.gui;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.SimulatedTime;
import com.raytheon.uf.viz.core.IDisplayPane; import com.raytheon.uf.viz.core.IDisplayPane;
import com.raytheon.uf.viz.core.drawables.IDescriptor; import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.core.drawables.ResourcePair; import com.raytheon.uf.viz.core.drawables.ResourcePair;
@ -29,7 +26,6 @@ import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.rsc.LoadProperties; import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.rsc.tools.GenericToolsResourceData; import com.raytheon.uf.viz.core.rsc.tools.GenericToolsResourceData;
import com.raytheon.uf.viz.core.rsc.tools.action.AbstractGenericToolAction; import com.raytheon.uf.viz.core.rsc.tools.action.AbstractGenericToolAction;
import com.raytheon.viz.core.mode.CAVEMode;
import com.raytheon.viz.ui.input.EditableManager; import com.raytheon.viz.ui.input.EditableManager;
/** /**
@ -44,7 +40,6 @@ import com.raytheon.viz.ui.input.EditableManager;
* Oct 10, 2010 6990 Qinglu Lin Used D. Friedman short solution, * Oct 10, 2010 6990 Qinglu Lin Used D. Friedman short solution,
* with minor changes. * with minor changes.
* Aug 15, 2013 DR 16418 D. Friedman Always show the dialog. * Aug 15, 2013 DR 16418 D. Friedman Always show the dialog.
* Sep 3, 2015 DR 17886 Qinglu Lin Updated for popping up alertViz when switching to DRT.
* *
* </pre> * </pre>
* *
@ -69,20 +64,11 @@ public class WarngenAction extends AbstractGenericToolAction<WarngenLayer> {
protected WarngenLayer getResource(LoadProperties loadProperties, protected WarngenLayer getResource(LoadProperties loadProperties,
IDescriptor descriptor) throws VizException { IDescriptor descriptor) throws VizException {
if (CAVEMode.getMode().equals(CAVEMode.OPERATIONAL) &&
!SimulatedTime.getSystemTime().isRealTime() &&
!CAVEMode.getFlagInDRT()) {
UFStatus.getHandler().handle(Priority.WARN,
"WarnGen cannot be launched while " +
"CAVE in OPERATIONAL mode and the CAVE clock is not set to real-time.");
return null;
}
for (IDisplayPane pane : getSelectedPanes()) { for (IDisplayPane pane : getSelectedPanes()) {
for (ResourcePair rp : pane.getDescriptor().getResourceList()) { for (ResourcePair rp : pane.getDescriptor().getResourceList()) {
if (rp.getResource() instanceof WarngenLayer) { if (rp.getResource() instanceof WarngenLayer) {
EditableManager.makeEditable(rp.getResource(), true); EditableManager.makeEditable(rp.getResource(), true);
((WarngenLayer) rp.getResource()) ((WarngenLayer) rp.getResource()).showDialog(true);
.showDialog(true);
return (WarngenLayer) rp.getResource(); return (WarngenLayer) rp.getResource();
} }
} }