Issue #1926 somewhat free up UI thread on scan startup
Change-Id: I51e704efa3df6abb6ec84b68d8dfcb46bac61d7b Former-commit-id:e06b6e7452
[formerlyeabd8e2ab2
] [formerlye917657497
] [formerlye7ef0a3b87
[formerlye917657497
[formerly dcb9b18777981409d109ecc314873914c8d27fbf]]] Former-commit-id:e7ef0a3b87
Former-commit-id: d579752889cfbfde3f676cee39986758df11a17b [formerly129feaee97
] Former-commit-id:7e6149c026
This commit is contained in:
parent
c643fb43ba
commit
71e5aafa7e
7 changed files with 142 additions and 60 deletions
|
@ -23,7 +23,6 @@
|
|||
<displays xsi:type="d2DMapRenderableDisplay" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<descriptor xsi:type="mapDescriptor">
|
||||
<resource>
|
||||
<resourceType>PLAN_VIEW</resourceType>
|
||||
<loadProperties loadWithoutData="false">
|
||||
<capabilities>
|
||||
<capability xsi:type="colorMapCapability">
|
||||
|
@ -31,6 +30,7 @@
|
|||
</capability>
|
||||
<capability xsi:type="imagingCapability" interpolationState="false" brightness="1.0" contrast="1.0" alpha="1.0"/>
|
||||
</capabilities>
|
||||
<resourceType>PLAN_VIEW</resourceType>
|
||||
<perspectiveProperty xsi:type="d2dLoadProperties" overlayMatchTolerance="1"/>
|
||||
</loadProperties>
|
||||
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true">
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
<displays xsi:type="d2DMapRenderableDisplay" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<descriptor xsi:type="mapDescriptor">
|
||||
<resource>
|
||||
<resourceType>PLAN_VIEW</resourceType>
|
||||
<loadProperties xsi:type="gridLoadProperties"
|
||||
displayType="CONTOUR" >
|
||||
<resourceType>PLAN_VIEW</resourceType>
|
||||
</loadProperties>
|
||||
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false"
|
||||
isVisible="true">
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
<displays xsi:type="d2DMapRenderableDisplay" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<descriptor xsi:type="mapDescriptor">
|
||||
<resource>
|
||||
<resourceType>PLAN_VIEW</resourceType>
|
||||
<loadProperties loadWithoutData="true">
|
||||
<capabilities>
|
||||
<capability xsi:type="colorMapCapability">
|
||||
|
@ -31,6 +30,7 @@
|
|||
</capability>
|
||||
<capability xsi:type="imagingCapability" interpolationState="false" brightness="1.0" contrast="1.0" alpha="1.0"/>
|
||||
</capabilities>
|
||||
<resourceType>PLAN_VIEW</resourceType>
|
||||
<perspectiveProperty xsi:type="d2dLoadProperties" overlayMatchTolerance="1"/>
|
||||
</loadProperties>
|
||||
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true">
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
<displays xsi:type="d2DMapRenderableDisplay" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<descriptor xsi:type="mapDescriptor">
|
||||
<resource>
|
||||
<resourceType>PLAN_VIEW</resourceType>
|
||||
<loadProperties loadWithoutData="true">
|
||||
<capabilities>
|
||||
<capability xsi:type="colorMapCapability">
|
||||
|
@ -31,6 +30,7 @@
|
|||
</capability>
|
||||
<capability xsi:type="imagingCapability" interpolationState="false" brightness="1.0" contrast="1.0" alpha="1.0"/>
|
||||
</capabilities>
|
||||
<resourceType>PLAN_VIEW</resourceType>
|
||||
<perspectiveProperty xsi:type="d2dLoadProperties" overlayMatchTolerance="1"/>
|
||||
</loadProperties>
|
||||
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true">
|
||||
|
|
|
@ -22,40 +22,36 @@ package com.raytheon.uf.viz.monitor.scan;
|
|||
import org.eclipse.core.commands.AbstractHandler;
|
||||
import org.eclipse.core.commands.ExecutionEvent;
|
||||
import org.eclipse.core.commands.ExecutionException;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
|
||||
|
||||
/**
|
||||
*
|
||||
* Action for launching the Scan Resource with Cell data
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 01/01/09 Initial Creation.
|
||||
* 04/23/13 1926 njensen Use ScanStarterJob
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class CellAction extends AbstractHandler {
|
||||
|
||||
@Override
|
||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||
|
||||
String icao = arg0.getParameter("icao");
|
||||
System.out.println("Activating/Action for Cell table...");
|
||||
final String ficao = icao;
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
|
||||
public void run() {
|
||||
Shell shell = PlatformUI.getWorkbench()
|
||||
.getActiveWorkbenchWindow().getShell();
|
||||
|
||||
ScanMonitor scan = ScanMonitor.getInstance();
|
||||
|
||||
// first time initialization, or re-init
|
||||
if (scan.icaos.size() == 0
|
||||
|| !scan.icaos.contains(ficao)) {
|
||||
scan.launchSplash(shell);
|
||||
scan.setup(ficao);
|
||||
}
|
||||
|
||||
scan.launchDialog(shell, ficao, ScanTables.CELL);
|
||||
}
|
||||
});
|
||||
ScanStarterJob job = new ScanStarterJob(icao, ScanTables.CELL);
|
||||
job.setSystem(false);
|
||||
job.schedule();
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,40 +22,34 @@ package com.raytheon.uf.viz.monitor.scan;
|
|||
import org.eclipse.core.commands.AbstractHandler;
|
||||
import org.eclipse.core.commands.ExecutionEvent;
|
||||
import org.eclipse.core.commands.ExecutionException;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
|
||||
|
||||
/**
|
||||
*
|
||||
* Action for launching the Scan Resource with DMD data
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 01/01/09 Initial Creation.
|
||||
* 04/23/13 1926 njensen Use ScanStarterJob
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class DmdAction extends AbstractHandler {
|
||||
|
||||
@Override
|
||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||
|
||||
String icao = arg0.getParameter("icao");
|
||||
|
||||
System.out.println("Activating/Action for DMD table...");
|
||||
final String ficao = icao;
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
|
||||
public void run() {
|
||||
Shell shell = PlatformUI.getWorkbench()
|
||||
.getActiveWorkbenchWindow().getShell();
|
||||
|
||||
ScanMonitor scan = ScanMonitor.getInstance();
|
||||
|
||||
// first time initialization, or re-init
|
||||
if (scan.icaos.size() == 0
|
||||
|| !scan.icaos.contains(ficao)) {
|
||||
scan.launchSplash(shell);
|
||||
scan.setup(ficao);
|
||||
}
|
||||
|
||||
scan.launchDialog(shell, ficao, ScanTables.DMD);
|
||||
|
||||
}
|
||||
});
|
||||
ScanStarterJob job = new ScanStarterJob(icao, ScanTables.DMD);
|
||||
job.setSystem(false);
|
||||
job.schedule();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,92 @@
|
|||
/**
|
||||
* 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.monitor.scan;
|
||||
|
||||
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 org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
|
||||
import com.raytheon.uf.viz.core.VizApp;
|
||||
|
||||
/**
|
||||
* A job that sets up the ScanMonitor then asks the UI thread to open the
|
||||
* associated dialog. By running the monitor's setup() on this job, the requests
|
||||
* to the server will not be blocking the UI thread.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 23, 2013 njensen Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author njensen
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class ScanStarterJob extends Job {
|
||||
|
||||
private String icao;
|
||||
|
||||
private ScanTables table;
|
||||
|
||||
public ScanStarterJob(String icao, ScanTables table) {
|
||||
super("Starting SCAN " + table.name());
|
||||
this.icao = icao;
|
||||
this.table = table;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.
|
||||
* IProgressMonitor)
|
||||
*/
|
||||
@Override
|
||||
protected IStatus run(IProgressMonitor monitor) {
|
||||
final ScanMonitor scan = ScanMonitor.getInstance();
|
||||
|
||||
// first time initialization, or re-init
|
||||
if (scan.icaos.size() == 0 || !scan.icaos.contains(icao)) {
|
||||
// scan.launchSplash(shell);
|
||||
scan.setup(icao);
|
||||
}
|
||||
|
||||
VizApp.runAsync(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
Shell shell = PlatformUI.getWorkbench()
|
||||
.getActiveWorkbenchWindow().getShell();
|
||||
scan.launchDialog(shell, icao, table);
|
||||
}
|
||||
|
||||
});
|
||||
return Status.OK_STATUS;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue