Omaha #4234 remove code that doesn't work anyway

Change-Id: I6747dcc1ccb3f7c3b424b996d63417f4a86a171b

Former-commit-id: 26b21f4db52aa6dd802a5de460b98e1758bc6872
This commit is contained in:
Nate Jensen 2015-03-18 11:47:19 -05:00
parent 429d904d3e
commit f5e4751703
7 changed files with 35 additions and 302 deletions

View file

@ -1,8 +1,8 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Ui Plug-in
Bundle-Name: AlertViz UI Plugin
Bundle-SymbolicName: com.raytheon.uf.viz.alertviz.ui
Bundle-Version: 1.14.0.qualifier
Bundle-Version: 1.15.0.qualifier
Bundle-Activator: com.raytheon.uf.viz.alertviz.ui.Activator
Bundle-Vendor: Raytheon
Require-Bundle: org.eclipse.ui,

View file

@ -19,7 +19,6 @@
package com.raytheon.uf.viz.alertviz.ui.dialogs;
import java.io.File;
import java.io.FileNotFoundException;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.jface.dialogs.MessageDialog;
@ -49,7 +48,6 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.message.StatusMessage;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.alertviz.AlertVizPython;
import com.raytheon.uf.viz.alertviz.AlertvizJob;
import com.raytheon.uf.viz.alertviz.ConfigContext;
import com.raytheon.uf.viz.alertviz.ConfigurationManager;
@ -95,6 +93,7 @@ import com.raytheon.uf.viz.core.VizApp;
* 09 Mar 2015 3856 lvenable Added a check to determine if the timer is running before
* changing the icon on the timer action. If it isn't running
* then set the icon to the default image.
* 18 Mar 2015 4234 njensen Remove reference to non-working python
*
* </pre>
*
@ -628,17 +627,6 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
return;
}
// Run python script (this is done early since this will not block)
if (amd.isPythonEnabled() == true) {
try {
AlertVizPython.enqueue(statMsg, amd.clone(), gConfig);
} catch (FileNotFoundException e) {
Container.logInternal(Priority.ERROR,
"AlertVizualization: exception python script not found: "
+ amd.getPythonScript(), e);
}
}
boolean isGdnAdminMessage = statMsg.getCategory().equals("GDN_ADMIN")
|| statMsg.getSourceKey().equals("GDN_ADMIN");

View file

@ -43,7 +43,6 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.alertviz.AlertVizPython;
import com.raytheon.uf.viz.alertviz.INeedsSaveListener;
import com.raytheon.uf.viz.alertviz.config.AlertMetadata;
@ -63,7 +62,8 @@ import com.raytheon.uf.viz.alertviz.config.AlertMetadata;
* 08 Sep 2012 13528 Xiaochuan Run setNewConfig to update priorities
* setting.
* 14 Dec 2012 4827 Xiaochuan Set toolTip on changeActionBtn.
*
* 18 Mar 2015 4234 njensen Remove reference to dead code
*
* </pre>
*
* @author lvenable
@ -74,7 +74,7 @@ public class PriorityControls {
/**
* Parent composite.
*/
private Composite parentComp;
private final Composite parentComp;
/**
* Canvas displaying the priority.
@ -99,7 +99,7 @@ public class PriorityControls {
/**
* Priority number.
*/
private int priority = 0;;
private int priority = 0;
/**
* Text message check box.
@ -144,7 +144,7 @@ public class PriorityControls {
/**
* Control font.
*/
private Font controlFont;
private final Font controlFont;
/**
* Canvas width.
@ -169,11 +169,11 @@ public class PriorityControls {
/**
* Parent shell.
*/
private Shell parentShell;
private final Shell parentShell;
private Button actionChk;
private AlertVisConfigDlg configDialog;
private final AlertVisConfigDlg configDialog;
/**
* Button used to change the audio file.
@ -184,7 +184,7 @@ public class PriorityControls {
private FileSelectDlg audioDlg;
private INeedsSaveListener needsSaveListener;
private final INeedsSaveListener needsSaveListener;
/**
* Constructor.
@ -197,12 +197,13 @@ public class PriorityControls {
* Priority number.
*/
public PriorityControls(Shell parentShell, Composite parentComp,
int priority, INeedsSaveListener needsSaveListener, AlertVisConfigDlg configDialog ) {
int priority, INeedsSaveListener needsSaveListener,
AlertVisConfigDlg configDialog) {
this.parentComp = parentComp;
this.priority = priority;
this.parentShell = parentShell;
this.configDialog = configDialog;
createPriorityColor();
this.controlFont = new Font(parentComp.getDisplay(), "Monospace", 10,
@ -222,12 +223,14 @@ public class PriorityControls {
priorityCanvas.setSize(CANVAS_WIDTH, CANVAS_HEIGHT);
priorityCanvas.setLayoutData(gd);
priorityCanvas.addPaintListener(new PaintListener() {
@Override
public void paintControl(PaintEvent e) {
drawCanvas(e.gc);
}
});
priorityCanvas.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
priorityColor.dispose();
controlFont.dispose();
@ -247,6 +250,7 @@ public class PriorityControls {
textChk = new Button(parentComp, SWT.CHECK);
textChk.setLayoutData(gd);
textChk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
updateBlinkButton();
configDialog.setNewConfig();
@ -266,8 +270,9 @@ public class PriorityControls {
blinkChk.setEnabled(false);
blinkChk.setLayoutData(gd);
blinkChk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
alertMetadata.setBlink(blinkChk.getSelection());
alertMetadata.setBlink(blinkChk.getSelection());
configDialog.setNewConfig();
needsSaveListener.saveNeeded(true);
}
@ -284,6 +289,7 @@ public class PriorityControls {
popupChk = new Button(parentComp, SWT.CHECK);
popupChk.setLayoutData(gd);
popupChk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
alertMetadata.setPopup(popupChk.getSelection());
configDialog.setNewConfig();
@ -310,8 +316,9 @@ public class PriorityControls {
audioChk.setLayoutData(gd);
audioChk.setToolTipText("");
audioChk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
updateAudioChangeButton();
updateAudioChangeButton();
alertMetadata.setAudioEnabled(audioChk.getSelection());
configDialog.setNewConfig();
needsSaveListener.saveNeeded(true);
@ -322,6 +329,7 @@ public class PriorityControls {
changeAudioBtn.setText("...");
changeAudioBtn.setToolTipText("Change audio file");
changeAudioBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
selectAudioFile();
configDialog.setNewConfig();
@ -346,6 +354,7 @@ public class PriorityControls {
actionChk.setLayoutData(gd);
actionChk.setToolTipText("Action File not available...");
actionChk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
updateActionChangeButton();
alertMetadata.setPythonEnabled(actionChk.getSelection());
@ -358,6 +367,7 @@ public class PriorityControls {
changeActionBtn.setText("...");
changeActionBtn.setToolTipText("Change action file");
changeActionBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
selectActionFile();
configDialog.setNewConfig();
@ -377,6 +387,7 @@ public class PriorityControls {
logChk = new Button(parentComp, SWT.CHECK);
logChk.setLayoutData(gd);
logChk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
alertMetadata.setLog(logChk.getSelection());
configDialog.setNewConfig();
@ -417,8 +428,9 @@ public class PriorityControls {
changeTextColorBtn.setText("...");
changeTextColorBtn.setToolTipText("Change foreground/background color");
changeTextColorBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
showColorDialog();
showColorDialog();
configDialog.setNewConfig();
}
@ -764,8 +776,8 @@ public class PriorityControls {
filteredExtensions.put(".py~", ".py~");
actionDlg = new FileSelectDlg(parentComp.getShell(),
SWT.APPLICATION_MODAL, AlertVizPython.ALERTVIZ_PYTHON_PATH,
new String[] { ".py", "*", "*.*" }, false, filteredExtensions);
SWT.APPLICATION_MODAL, "alertViz/python", new String[] { ".py",
"*", "*.*" }, false, filteredExtensions);
actionDlg.setSelectedFile(actionFile);
Boolean retVal = (Boolean) actionDlg.open("Action Selection File",
@ -784,7 +796,7 @@ public class PriorityControls {
saveNeeded = !selectedFileName.equals(actionFile);
alertMetadata.setPythonScript(selectedFileName);
changeActionBtn.setToolTipText(selectedFileName);
} else {
alertMetadata.setAudioFile(null);
alertMetadata.setAudioEnabled(false);

View file

@ -1,8 +1,8 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Notification Plug-in
Bundle-Name: AlertViz Plugin
Bundle-SymbolicName: com.raytheon.uf.viz.alertviz;singleton:=true
Bundle-Version: 1.14.0.qualifier
Bundle-Version: 1.15.0.qualifier
Bundle-Activator: com.raytheon.uf.viz.alertviz.Activator
Bundle-Vendor: Raytheon
Require-Bundle: org.eclipse.ui,
@ -12,7 +12,6 @@ Require-Bundle: org.eclipse.ui,
com.raytheon.uf.common.serialization;visibility:=reexport,
com.raytheon.uf.viz.core;visibility:=reexport,
com.raytheon.uf.common.status,
org.jep;bundle-version="1.0.0",
com.raytheon.uf.common.message;bundle-version="1.11.11",
com.raytheon.uf.common.alertviz,
javax.jms;bundle-version="1.0.0",
@ -22,10 +21,7 @@ Require-Bundle: org.eclipse.ui,
Export-Package: com.raytheon.uf.viz.alertviz,
com.raytheon.uf.viz.alertviz.config
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Import-Package: com.raytheon.uf.common.python,
com.raytheon.uf.common.time,
com.raytheon.uf.viz.python.swt,
com.raytheon.uf.viz.python.swt.widgets,
Import-Package: com.raytheon.uf.common.time,
org.apache.log4j
Bundle-ActivationPolicy: lazy
Eclipse-RegisterBuddy: ch.qos.logback

View file

@ -1,191 +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.uf.viz.alertviz;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.HashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
import jep.JepException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.message.StatusMessage;
import com.raytheon.uf.common.python.PythonScript;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.alertviz.config.AlertMetadata;
import com.raytheon.uf.viz.alertviz.config.TrayConfiguration;
/**
* TODO Add Description
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 9, 2009 chammack Initial creation
* May 5, 2011 9101 cjeanbap Check Python Script type
*
* </pre>
*
* @author chammack
* @version 1.0
*/
public class AlertVizPython extends Job {
private String alertVizPythonDir;
private static ConcurrentLinkedQueue<ExecObj> execQueue = new ConcurrentLinkedQueue<ExecObj>();
private static ConcurrentLinkedQueue<Runnable> runQueue = new ConcurrentLinkedQueue<Runnable>();
private static AlertVizPython pythonThread;
public static final String ALERTVIZ_PYTHON_PATH = "alertViz/python";
private static class ExecObj {
public StatusMessage statusMessage;
public AlertMetadata alertMetadata;
public TrayConfiguration globalConfiguration;
}
public static void enqueue(StatusMessage statusMessage,
AlertMetadata alertMetadata, TrayConfiguration globalConfiguration)
throws FileNotFoundException {
File file = PathManagerFactory.getPathManager().getStaticFile(
ALERTVIZ_PYTHON_PATH + "/" + alertMetadata.getPythonScript());
if (file == null) {
throw new FileNotFoundException(
"Unable to find file in localization with name: "
+ alertMetadata.getPythonScript());
}
if (!alertMetadata.getPythonScript().endsWith(".py")) {
statusMessage.setDetails(file.getAbsolutePath());
alertMetadata.setPythonScript("PyShellScriptWrapper.py");
}
ExecObj eo = new ExecObj();
eo.statusMessage = statusMessage;
eo.alertMetadata = alertMetadata;
eo.globalConfiguration = globalConfiguration;
execQueue.add(eo);
if (pythonThread == null) {
pythonThread = new AlertVizPython();
pythonThread.setSystem(true);
pythonThread.schedule();
}
}
public static void run(Runnable run) {
runQueue.add(run);
}
private AlertVizPython() {
super("Alertviz Python Executor");
IPathManager pathMgr = PathManagerFactory.getPathManager();
LocalizationContext cx = pathMgr.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.BASE);
File file = pathMgr.getFile(cx, ALERTVIZ_PYTHON_PATH);
cx = pathMgr.getContext(LocalizationType.CAVE_STATIC,
LocalizationLevel.SITE);
File file2 = pathMgr.getFile(cx, ALERTVIZ_PYTHON_PATH);
cx = pathMgr.getContext(LocalizationType.CAVE_STATIC,
LocalizationLevel.USER);
File file3 = pathMgr.getFile(cx, ALERTVIZ_PYTHON_PATH);
this.alertVizPythonDir = file.getAbsolutePath() + ":"
+ file2.getAbsolutePath() + ":" + file3.getAbsolutePath();
}
@Override
protected IStatus run(IProgressMonitor monitor) {
final String processorPython = ALERTVIZ_PYTHON_PATH
+ "/MasterProcessor.py";
PythonScript pythonScript = null;
try {
File file = PathManagerFactory.getPathManager().getStaticFile(
processorPython);
if (file == null) {
throw new RuntimeException("Master processor file missing");
}
pythonScript = new PythonScript(file.getAbsolutePath(),
alertVizPythonDir, this.getClass().getClassLoader());
while (!pythonThread.getThread().isInterrupted()) {
while (!runQueue.isEmpty()) {
runQueue.remove().run();
}
while (!execQueue.isEmpty()) {
ExecObj eo = execQueue.remove();
try {
HashMap<String, Object> args = new HashMap<String, Object>();
args.put("statusMessage", eo.statusMessage);
args.put("alertMetadata", eo.alertMetadata);
args.put("globalConfiguration", eo.globalConfiguration);
pythonScript.execute("process", args);
} catch (JepException e) {
Container.logInternal(Priority.ERROR,
"AlertVizPython: JEPP exception executing python script: "
+ processorPython, e);
}
}
try {
Thread.sleep(50);
} catch (InterruptedException e) {
return Status.OK_STATUS;
}
}
} catch (JepException e) {
Container.logInternal(Priority.ERROR,
"AlertVizPython: exception creating JEPP python script: "
+ processorPython, e);
} finally {
if (pythonScript != null) {
pythonScript.dispose();
}
}
return Status.OK_STATUS;
}
}

View file

@ -1,52 +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.uf.viz.alertviz;
/**
* Provides a level of indirection to make sure that runnables are called back
* on the original python thread
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 14, 2009 chammack Initial creation
*
* </pre>
*
* @author chammack
* @version 1.0
*/
public class AlertVizPythonCallback implements Runnable {
private Runnable run;
public AlertVizPythonCallback(Runnable run) {
this.run = run;
}
@Override
public void run() {
AlertVizPython.run(run);
}
}

View file

@ -199,25 +199,12 @@
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.common.python"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.postgres"
download-size="0"
install-size="0"
version="0.0.0"/>
<plugin
id="org.jep"
download-size="0"
install-size="0"
version="0.0.0"/>
<plugin
id="org.apache.velocity"
download-size="0"
@ -275,13 +262,6 @@
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.viz.python.swt"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.common.serialization.comm"
download-size="0"