Merge "Omaha #4888: Implement additional GFE DRT mode fixes." into omaha_16.2.1
Former-commit-id: 3cd5ddf5202b03b8dd2f3598c432d88e38b18b21
This commit is contained in:
commit
be12f4eb70
5 changed files with 38 additions and 47 deletions
|
@ -37,13 +37,14 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
|||
*
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Aug 27, 2015 4749 njensen Initial creation
|
||||
*
|
||||
* Oct 01, 2015 4888 dgilling Check return value from createDialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author njensen
|
||||
|
@ -66,15 +67,17 @@ public abstract class GfeShowDialogHandler extends AbstractHandler {
|
|||
.getShell();
|
||||
|
||||
dialog = createDialog(shell, dm, event);
|
||||
dialog.setBlockOnOpen(false);
|
||||
dialog.addCloseCallback(new ICloseCallback() {
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
dialog = null;
|
||||
}
|
||||
if (dialog != null) {
|
||||
dialog.setBlockOnOpen(false);
|
||||
dialog.addCloseCallback(new ICloseCallback() {
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
dialog = null;
|
||||
}
|
||||
|
||||
});
|
||||
dialog.open();
|
||||
});
|
||||
dialog.open();
|
||||
}
|
||||
} else {
|
||||
dialog.bringToTop();
|
||||
}
|
||||
|
|
|
@ -19,16 +19,14 @@
|
|||
**/
|
||||
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.dialogs.CaveJFACEDialog;
|
||||
import com.raytheon.viz.ui.simulatedtime.SimulatedTimeOperations;
|
||||
|
||||
/**
|
||||
|
@ -41,6 +39,7 @@ import com.raytheon.viz.ui.simulatedtime.SimulatedTimeOperations;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Sep 15, 2015 #4858 dgilling Initial creation
|
||||
* Oct 01, 2015 #4888 dgilling Refactor based on GfeShowDialogHandler.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -48,41 +47,18 @@ import com.raytheon.viz.ui.simulatedtime.SimulatedTimeOperations;
|
|||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class ShowSendIscGridsDialog extends AbstractHandler {
|
||||
public class ShowSendIscGridsDialog extends GfeShowDialogHandler {
|
||||
|
||||
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();
|
||||
protected CaveJFACEDialog createDialog(Shell shell, DataManager dm,
|
||||
ExecutionEvent event) {
|
||||
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;
|
||||
return new SendISCDialog(shell, dm);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -539,12 +539,16 @@ public class StoreTransmitDlg extends CaveSWTDialog {
|
|||
.transmitProduct(practice);
|
||||
|
||||
sendTransmissionStatus(state);
|
||||
this.parentEditor.setProductText(productText, false);
|
||||
this.parentEditor.brain();
|
||||
parentEditor.setProductText(productText, false);
|
||||
parentEditor.brain();
|
||||
} catch (VizException e) {
|
||||
statusHandler.handle(Priority.CRITICAL, "Error sending product", e);
|
||||
sendTransmissionStatus(ConfigData.ProductStateEnum.Failed);
|
||||
parentEditor.revive();
|
||||
} catch (SimulatedTimeProhibitedOpException e) {
|
||||
statusHandler.error(e.getLocalizedMessage(), e);
|
||||
sendTransmissionStatus(ConfigData.ProductStateEnum.Failed);
|
||||
parentEditor.brain();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -51,6 +51,7 @@ import com.raytheon.viz.ui.simulatedtime.SimulatedTimeProhibitedOpException;
|
|||
* varDict through.
|
||||
* Aug 26, 2015 4804 dgilling Add methods so SmartScript can run formatters.
|
||||
* Sep 15, 2015 4858 dgilling Disable store/transmit in DRT mode.
|
||||
* Oct 01, 2015 4888 dgilling Fix javadoc for exceptions.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -119,9 +120,6 @@ public class FormatterUtil {
|
|||
* @param listener
|
||||
* listener to fire when formatter finishes generating product
|
||||
* @throws SimulatedTimeProhibitedOpException
|
||||
* @throws InterruptedException
|
||||
* If something interrupts this thread before the formatter has
|
||||
* completed.
|
||||
*/
|
||||
public static void callFromSmartScript(String productName, String dbId,
|
||||
String varDict, String vtecMode, DataManager dataMgr,
|
||||
|
|
|
@ -40,6 +40,8 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
|||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||
import com.raytheon.viz.gfe.dialogs.formatterlauncher.ConfigData;
|
||||
import com.raytheon.viz.gfe.dialogs.formatterlauncher.ConfigData.ProductStateEnum;
|
||||
import com.raytheon.viz.ui.simulatedtime.SimulatedTimeOperations;
|
||||
import com.raytheon.viz.ui.simulatedtime.SimulatedTimeProhibitedOpException;
|
||||
|
||||
/**
|
||||
* Handles product transmission for GFE text products, using handleOUP for
|
||||
|
@ -53,6 +55,7 @@ import com.raytheon.viz.gfe.dialogs.formatterlauncher.ConfigData.ProductStateEnu
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Aug 28, 2015 #4806 dgilling Initial creation
|
||||
* Oct 01, 2015 #4888 dgilling Prevent transmission in DRT mode.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -100,9 +103,16 @@ public final class TextProductTransmitter {
|
|||
* @throws VizException
|
||||
* If the transmission request threw an exception during
|
||||
* server-side processing.
|
||||
* @throws SimulatedTimeProhibitedOpException
|
||||
* If transmit is prohibited because GFE is running in DRT mode.
|
||||
*/
|
||||
public ProductStateEnum transmitProduct(boolean practice)
|
||||
throws VizException {
|
||||
throws VizException, SimulatedTimeProhibitedOpException {
|
||||
if (SimulatedTimeOperations.isTransmitAllowed()) {
|
||||
throw SimulatedTimeOperations
|
||||
.constructProhibitedOpException("Transmit GFE text products.");
|
||||
}
|
||||
|
||||
IServerRequest req = (!practice) ? constructOperationalRequest()
|
||||
: constructPracticeRequest();
|
||||
Object response = ThriftClient.sendRequest(req);
|
||||
|
|
Loading…
Add table
Reference in a new issue