Issue #1328 Cleaned up time matching API for GFE use. Removed notion of time match basis from AbstractTimeMatcher and moved code using it into D2D specific plugins
Amend: Added back in TimeMatchBasisCapability. Someday will need to figure out bundle migration since this unused class can never die Change-Id: I3086daa43e553202565e2b88f455d4dd0bfc65f6 Former-commit-id:56ae27e172
[formerlyb648c5828e
] [formerlyed77d56a84
[formerly fa693a9bb802af2491c70c14aa7ab33485fb4915]] Former-commit-id:ed77d56a84
Former-commit-id:b24440cc37
This commit is contained in:
parent
569e19e755
commit
f681c1304c
25 changed files with 229 additions and 193 deletions
|
@ -21,6 +21,10 @@ package com.raytheon.uf.viz.core;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||||
import com.raytheon.uf.common.time.DataTime;
|
import com.raytheon.uf.common.time.DataTime;
|
||||||
import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay;
|
import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay;
|
||||||
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
||||||
|
@ -30,7 +34,7 @@ import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO Add Description
|
* Abstract time matching object, by default does nothing
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
*
|
*
|
||||||
|
@ -44,8 +48,8 @@ import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||||
* @author chammack
|
* @author chammack
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
|
@XmlAccessorType(XmlAccessType.NONE)
|
||||||
public abstract class AbstractTimeMatcher {
|
public abstract class AbstractTimeMatcher implements ISerializableObject {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Trigger the time matcher to update time information on this resource the
|
* Trigger the time matcher to update time information on this resource the
|
||||||
|
@ -77,21 +81,6 @@ public abstract class AbstractTimeMatcher {
|
||||||
public abstract void handleRemove(AbstractVizResource<?, ?> resource,
|
public abstract void handleRemove(AbstractVizResource<?, ?> resource,
|
||||||
IDescriptor descriptor);
|
IDescriptor descriptor);
|
||||||
|
|
||||||
/**
|
|
||||||
* Change time match basis
|
|
||||||
*
|
|
||||||
* @param resource
|
|
||||||
* @param descriptor
|
|
||||||
*/
|
|
||||||
public abstract void changeTimeMatchBasis(AbstractVizResource<?, ?> resource);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the time match basis
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public abstract AbstractVizResource<?, ?> getTimeMatchBasis();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform an initial load of PluginDataObjects utilizing the time matcher
|
* Perform an initial load of PluginDataObjects utilizing the time matcher
|
||||||
*
|
*
|
||||||
|
|
|
@ -179,28 +179,17 @@ public abstract class AbstractDescriptor extends ResourceGroup implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void notifyRemove(ResourcePair rp) throws VizException {
|
public void notifyRemove(ResourcePair rp) throws VizException {
|
||||||
AbstractTimeMatcher tm = getTimeMatcher();
|
|
||||||
AbstractVizResource<?, ?> basis = null;
|
|
||||||
if (tm != null) {
|
|
||||||
basis = tm.getTimeMatchBasis();
|
|
||||||
}
|
|
||||||
|
|
||||||
postRemoveListener(rp.getResource());
|
postRemoveListener(rp.getResource());
|
||||||
|
|
||||||
AbstractVizResource<?, ?> newBasis = null;
|
TimeMatchingJob.scheduleTimeMatch(AbstractDescriptor.this);
|
||||||
if (tm != null) {
|
if (renderableDisplay != null
|
||||||
newBasis = tm.getTimeMatchBasis();
|
&& renderableDisplay.getContainer() != null) {
|
||||||
}
|
IDisplayPaneContainer container = renderableDisplay
|
||||||
|
.getContainer();
|
||||||
if (basis != newBasis) {
|
for (IDisplayPane pane : container.getDisplayPanes()) {
|
||||||
TimeMatchingJob.scheduleTimeMatch(AbstractDescriptor.this);
|
if (pane.getDescriptor() != AbstractDescriptor.this) {
|
||||||
if (renderableDisplay != null
|
TimeMatchingJob.scheduleTimeMatch(pane
|
||||||
&& renderableDisplay.getContainer() != null) {
|
.getDescriptor());
|
||||||
IDisplayPaneContainer container = renderableDisplay.getContainer();
|
|
||||||
for (IDisplayPane pane : container.getDisplayPanes()) {
|
|
||||||
if (pane.getDescriptor() != AbstractDescriptor.this) {
|
|
||||||
TimeMatchingJob.scheduleTimeMatch(pane.getDescriptor());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -208,7 +197,6 @@ public abstract class AbstractDescriptor extends ResourceGroup implements
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void postAddListener(ResourcePair rp) {
|
protected void postAddListener(ResourcePair rp) {
|
||||||
if (rp.getResource() != null && getTimeMatcher() != null) {
|
if (rp.getResource() != null && getTimeMatcher() != null) {
|
||||||
// We need to run time matching immediately beacuse order
|
// We need to run time matching immediately beacuse order
|
||||||
|
@ -361,14 +349,6 @@ public abstract class AbstractDescriptor extends ResourceGroup implements
|
||||||
@Override
|
@Override
|
||||||
public void setNumberOfFrames(int frameCount) {
|
public void setNumberOfFrames(int frameCount) {
|
||||||
timeManager.numberOfFrames = frameCount;
|
timeManager.numberOfFrames = frameCount;
|
||||||
// This will clear out the times for the basis which should redo time
|
|
||||||
// matching for all resource next time redo is called for this
|
|
||||||
// descriptor
|
|
||||||
if (getTimeMatcher() != null
|
|
||||||
&& getTimeMatcher().getTimeMatchBasis() != null) {
|
|
||||||
getTimeMatcher().redoTimeMatching(
|
|
||||||
getTimeMatcher().getTimeMatchBasis());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -381,15 +361,6 @@ public abstract class AbstractDescriptor extends ResourceGroup implements
|
||||||
restoredTime = frames[frameIndex];
|
restoredTime = frames[frameIndex];
|
||||||
}
|
}
|
||||||
limitedNumberOfFrames = frameCount;
|
limitedNumberOfFrames = frameCount;
|
||||||
// This will clear out the times for the basis which should redo
|
|
||||||
// time
|
|
||||||
// matching for all resource next time redo is called for this
|
|
||||||
// descriptor
|
|
||||||
if (getTimeMatcher() != null
|
|
||||||
&& getTimeMatcher().getTimeMatchBasis() != null) {
|
|
||||||
getTimeMatcher().redoTimeMatching(
|
|
||||||
getTimeMatcher().getTimeMatchBasis());
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -405,15 +376,6 @@ public abstract class AbstractDescriptor extends ResourceGroup implements
|
||||||
restoredTime = frames[frameIndex];
|
restoredTime = frames[frameIndex];
|
||||||
}
|
}
|
||||||
limitedNumberOfFrames = Integer.MAX_VALUE;
|
limitedNumberOfFrames = Integer.MAX_VALUE;
|
||||||
// This will clear out the times for the basis which should redo
|
|
||||||
// time
|
|
||||||
// matching for all resource next time redo is called for this
|
|
||||||
// descriptor
|
|
||||||
if (getTimeMatcher() != null
|
|
||||||
&& getTimeMatcher().getTimeMatchBasis() != null) {
|
|
||||||
getTimeMatcher().redoTimeMatching(
|
|
||||||
getTimeMatcher().getTimeMatchBasis());
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
limitedNumberOfFrames = Integer.MAX_VALUE;
|
limitedNumberOfFrames = Integer.MAX_VALUE;
|
||||||
|
@ -497,6 +459,18 @@ public abstract class AbstractDescriptor extends ResourceGroup implements
|
||||||
this.timeManager.timeMatcher = timeMatcher;
|
this.timeManager.timeMatcher = timeMatcher;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see com.raytheon.uf.viz.core.drawables.IDescriptor#redoTimeMatching()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void redoTimeMatching() throws VizException {
|
||||||
|
if (timeManager.timeMatcher != null) {
|
||||||
|
timeManager.timeMatcher.redoTimeMatching(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DataTime getTimeForResource(AbstractVizResource<?, ?> rsc) {
|
public DataTime getTimeForResource(AbstractVizResource<?, ?> rsc) {
|
||||||
FramesInfo currInfo = getFramesInfo();
|
FramesInfo currInfo = getFramesInfo();
|
||||||
|
|
|
@ -19,6 +19,9 @@
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.viz.core.drawables;
|
package com.raytheon.uf.viz.core.drawables;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
import com.raytheon.uf.common.time.DataTime;
|
import com.raytheon.uf.common.time.DataTime;
|
||||||
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;
|
||||||
|
@ -105,6 +108,36 @@ public class FrameCoordinator implements IFrameCoordinator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see
|
||||||
|
* com.raytheon.uf.viz.core.drawables.IFrameCoordinator#changeFrame(java
|
||||||
|
* .util.Date)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void changeFrame(Date frameTime) {
|
||||||
|
changeFrame(new DataTime(frameTime));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see
|
||||||
|
* com.raytheon.uf.viz.core.drawables.IFrameCoordinator#changeFrame(com.
|
||||||
|
* raytheon.uf.common.time.DataTime)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void changeFrame(DataTime frameTime) {
|
||||||
|
// Default behavior for now
|
||||||
|
FramesInfo info = descriptor.getFramesInfo();
|
||||||
|
DataTime[] currTimes = info.getFrameTimes();
|
||||||
|
int idx = Arrays.binarySearch(currTimes, frameTime);
|
||||||
|
// Force within range
|
||||||
|
idx = Math.min(currTimes.length - 1, Math.max(0, idx));
|
||||||
|
descriptor.setFramesInfo(new FramesInfo(idx));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void changeFrame(FrameChangeOperation operation, FrameChangeMode mode) {
|
public void changeFrame(FrameChangeOperation operation, FrameChangeMode mode) {
|
||||||
// Grab the current frame information
|
// Grab the current frame information
|
||||||
|
|
|
@ -143,15 +143,23 @@ public interface IDescriptor extends IResourceGroup {
|
||||||
public DataTime getTimeForResource(AbstractVizResource<?, ?> rsc,
|
public DataTime getTimeForResource(AbstractVizResource<?, ?> rsc,
|
||||||
int idx) {
|
int idx) {
|
||||||
DataTime[] dt = timeMap.get(rsc);
|
DataTime[] dt = timeMap.get(rsc);
|
||||||
if (dt == null
|
return getFrame(dt, idx);
|
||||||
|| dt.length <= idx
|
}
|
||||||
|
|
||||||
|
public DataTime getCurrentFrame() {
|
||||||
|
return getFrame(frameTimes, frameIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
private DataTime getFrame(DataTime[] frames, int idx) {
|
||||||
|
if (frames == null
|
||||||
|
|| frames.length <= idx
|
||||||
|| idx < 0
|
|| idx < 0
|
||||||
|| (frameTimes != null && frameTimes.length > idx
|
|| (frameTimes != null && frameTimes.length > idx
|
||||||
&& frameTimes[idx] != null && !frameTimes[idx]
|
&& frameTimes[idx] != null && !frameTimes[idx]
|
||||||
.isVisible())) {
|
.isVisible())) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return dt[idx];
|
return frames[idx];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -377,6 +385,13 @@ public interface IDescriptor extends IResourceGroup {
|
||||||
*/
|
*/
|
||||||
public void setTimeMatcher(AbstractTimeMatcher timeMatcher);
|
public void setTimeMatcher(AbstractTimeMatcher timeMatcher);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Re-does time matching for the descriptor
|
||||||
|
*
|
||||||
|
* @throws VizException
|
||||||
|
*/
|
||||||
|
public void redoTimeMatching() throws VizException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Synchronize time matching with the other descriptor
|
* Synchronize time matching with the other descriptor
|
||||||
*
|
*
|
||||||
|
|
|
@ -19,6 +19,9 @@
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.viz.core.drawables;
|
package com.raytheon.uf.viz.core.drawables;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.time.DataTime;
|
||||||
import com.raytheon.uf.viz.core.datastructure.LoopProperties;
|
import com.raytheon.uf.viz.core.datastructure.LoopProperties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -87,6 +90,20 @@ public interface IFrameCoordinator {
|
||||||
*/
|
*/
|
||||||
public void changeFrame(FrameChangeOperation operation, FrameChangeMode mode);
|
public void changeFrame(FrameChangeOperation operation, FrameChangeMode mode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tell the coordinator to change the frame given the desired time
|
||||||
|
*
|
||||||
|
* @param frameTime
|
||||||
|
*/
|
||||||
|
public void changeFrame(Date frameTime);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tell the coordinator to change the frame given the desired time
|
||||||
|
*
|
||||||
|
* @param frameTime
|
||||||
|
*/
|
||||||
|
public void changeFrame(DataTime frameTime);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the coordinators current animation mode
|
* Get the coordinators current animation mode
|
||||||
*
|
*
|
||||||
|
|
|
@ -74,32 +74,41 @@ public class StatsJob extends Job {
|
||||||
runningThread = Thread.currentThread();
|
runningThread = Thread.currentThread();
|
||||||
run = true;
|
run = true;
|
||||||
while (run) {
|
while (run) {
|
||||||
System.out.println();
|
|
||||||
NetworkTraffic total = stats.getTotalTrafficStats();
|
NetworkTraffic total = stats.getTotalTrafficStats();
|
||||||
long sentInLastMinute = total.getBytesSent() - lastSent;
|
long sentInLastMinute = total.getBytesSent() - lastSent;
|
||||||
long receivedInLastMinute = total.getBytesReceived() - lastReceived;
|
long receivedInLastMinute = total.getBytesReceived() - lastReceived;
|
||||||
long requestCountInLastMinute = total.getRequestCount()
|
long requestCountInLastMinute = total.getRequestCount()
|
||||||
- lastRequestCount;
|
- lastRequestCount;
|
||||||
|
|
||||||
System.out.println("Last minute sent " + requestCountInLastMinute
|
boolean printed = false;
|
||||||
+ " messages for a total of "
|
if (sentInLastMinute != 0.0 || receivedInLastMinute != 0.0
|
||||||
+ NetworkStatistics.toString(sentInLastMinute)
|
|| requestCountInLastMinute != 0.0) {
|
||||||
+ " sent and "
|
printed = true;
|
||||||
+ NetworkStatistics.toString(receivedInLastMinute)
|
System.out.println();
|
||||||
+ " received");
|
System.out.println("Last minute sent "
|
||||||
|
+ requestCountInLastMinute
|
||||||
|
+ " messages for a total of "
|
||||||
|
+ NetworkStatistics.toString(sentInLastMinute)
|
||||||
|
+ " sent and "
|
||||||
|
+ NetworkStatistics.toString(receivedInLastMinute)
|
||||||
|
+ " received");
|
||||||
|
}
|
||||||
lastSent = total.getBytesSent();
|
lastSent = total.getBytesSent();
|
||||||
lastReceived = total.getBytesReceived();
|
lastReceived = total.getBytesReceived();
|
||||||
lastRequestCount = total.getRequestCount();
|
lastRequestCount = total.getRequestCount();
|
||||||
System.out.println("Total sent " + total.getRequestCount()
|
if (printed) {
|
||||||
+ " messages for a total of "
|
System.out.println("Total sent " + total.getRequestCount()
|
||||||
+ NetworkStatistics.toString(lastSent) + " sent and "
|
+ " messages for a total of "
|
||||||
+ NetworkStatistics.toString(lastReceived) + " received");
|
+ NetworkStatistics.toString(lastSent) + " sent and "
|
||||||
NetworkTraffic[] mapped = stats.getMappedTrafficStats();
|
+ NetworkStatistics.toString(lastReceived)
|
||||||
for (NetworkTraffic nt : mapped) {
|
+ " received");
|
||||||
System.out.println(nt);
|
NetworkTraffic[] mapped = stats.getMappedTrafficStats();
|
||||||
}
|
for (NetworkTraffic nt : mapped) {
|
||||||
|
System.out.println(nt);
|
||||||
|
}
|
||||||
|
|
||||||
System.out.println();
|
System.out.println();
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Thread.sleep(60 * 1000);
|
Thread.sleep(60 * 1000);
|
||||||
|
|
|
@ -626,7 +626,8 @@ public class LocalizationManager implements IPropertyChangeListener {
|
||||||
// Clean up any stale files that don't exist anymore
|
// Clean up any stale files that don't exist anymore
|
||||||
for (File check : toCheck) {
|
for (File check : toCheck) {
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||||
if (available.contains(check) == false) {
|
// hidden files are not returned from server so ignore those
|
||||||
|
if (check.isHidden() == false && available.contains(check) == false) {
|
||||||
String name = check.getName();
|
String name = check.getName();
|
||||||
// Make sure python object files don't get removed when
|
// Make sure python object files don't get removed when
|
||||||
// .py file is still available
|
// .py file is still available
|
||||||
|
|
|
@ -44,7 +44,6 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
import com.raytheon.uf.viz.core.rsc.RenderingOrderFactory.ResourceOrder;
|
import com.raytheon.uf.viz.core.rsc.RenderingOrderFactory.ResourceOrder;
|
||||||
import com.raytheon.uf.viz.core.rsc.capabilities.AbstractCapability;
|
import com.raytheon.uf.viz.core.rsc.capabilities.AbstractCapability;
|
||||||
import com.raytheon.uf.viz.core.rsc.capabilities.Capabilities;
|
import com.raytheon.uf.viz.core.rsc.capabilities.Capabilities;
|
||||||
import com.raytheon.uf.viz.core.rsc.capabilities.TimeMatchBasisCapability;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides a base implementation for creating visualizations that participate
|
* Provides a base implementation for creating visualizations that participate
|
||||||
|
@ -330,10 +329,6 @@ public abstract class AbstractVizResource<T extends AbstractResourceData, D exte
|
||||||
initInternal(target);
|
initInternal(target);
|
||||||
status = ResourceStatus.INITIALIZED;
|
status = ResourceStatus.INITIALIZED;
|
||||||
|
|
||||||
if (isTimeAgnostic() == false) {
|
|
||||||
getCapabilities().addCapability(TimeMatchBasisCapability.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (IInitListener listener : initListeners) {
|
for (IInitListener listener : initListeners) {
|
||||||
listener.inited(this);
|
listener.inited(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,8 +20,7 @@
|
||||||
package com.raytheon.uf.viz.core.rsc.capabilities;
|
package com.raytheon.uf.viz.core.rsc.capabilities;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Capability for resources to show they can be the time match basis. This
|
* Under no circumstances use this class
|
||||||
* capability will be removed from the actual time match basis resource
|
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
*
|
*
|
||||||
|
@ -35,7 +34,7 @@ package com.raytheon.uf.viz.core.rsc.capabilities;
|
||||||
* @author mschenke
|
* @author mschenke
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public class TimeMatchBasisCapability extends AbstractCapability {
|
public class TimeMatchBasisCapability extends AbstractCapability {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -120,23 +120,28 @@ public class TimeMatchingJob extends Job {
|
||||||
try {
|
try {
|
||||||
long t0 = System.currentTimeMillis();
|
long t0 = System.currentTimeMillis();
|
||||||
request.getTimeMatcher().redoTimeMatching(request);
|
request.getTimeMatcher().redoTimeMatching(request);
|
||||||
System.out.println("time matching took: "
|
long time = (System.currentTimeMillis() - t0);
|
||||||
+ (System.currentTimeMillis() - t0));
|
if (time > 0) {
|
||||||
|
System.out.println("time matching took: " + time + "ms");
|
||||||
|
}
|
||||||
if (!this.keepAround) {
|
if (!this.keepAround) {
|
||||||
map.remove(request);
|
map.remove(request);
|
||||||
} else {
|
} else {
|
||||||
this.keepAround = false;
|
this.keepAround = false;
|
||||||
}
|
}
|
||||||
request.getRenderableDisplay().refresh();
|
if (request.getRenderableDisplay() != null) {
|
||||||
if (request.getRenderableDisplay().getContainer() instanceof IEditorPart) {
|
request.getRenderableDisplay().refresh();
|
||||||
VizApp.runAsync(new Runnable() {
|
if (request.getRenderableDisplay().getContainer() instanceof IEditorPart) {
|
||||||
@Override
|
VizApp.runAsync(new Runnable() {
|
||||||
public void run() {
|
@Override
|
||||||
VizGlobalsManager.getCurrentInstance().updateUI(
|
public void run() {
|
||||||
request.getRenderableDisplay().getContainer(),
|
VizGlobalsManager.getCurrentInstance().updateUI(
|
||||||
request.getRenderableDisplay());
|
request.getRenderableDisplay()
|
||||||
}
|
.getContainer(),
|
||||||
});
|
request.getRenderableDisplay());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
statusHandler.handle(Priority.CRITICAL,
|
statusHandler.handle(Priority.CRITICAL,
|
||||||
|
|
|
@ -49,9 +49,9 @@ import com.raytheon.uf.viz.core.rsc.capabilities.GroupNamingCapability;
|
||||||
import com.raytheon.uf.viz.core.rsc.capabilities.ImagingCapability;
|
import com.raytheon.uf.viz.core.rsc.capabilities.ImagingCapability;
|
||||||
import com.raytheon.uf.viz.core.rsc.capabilities.MagnificationCapability;
|
import com.raytheon.uf.viz.core.rsc.capabilities.MagnificationCapability;
|
||||||
import com.raytheon.uf.viz.core.rsc.legend.AbstractLegendResource;
|
import com.raytheon.uf.viz.core.rsc.legend.AbstractLegendResource;
|
||||||
|
import com.raytheon.uf.viz.d2d.core.time.D2DTimeMatcher;
|
||||||
import com.raytheon.viz.core.rsc.BestResResource;
|
import com.raytheon.viz.core.rsc.BestResResource;
|
||||||
import com.raytheon.viz.ui.actions.DummyAction;
|
import com.raytheon.viz.ui.actions.DummyAction;
|
||||||
import com.raytheon.viz.ui.cmenu.SetTimeMatchBasisAction;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Legend decorator for d2d. Responsible for drawing and handling mouse input
|
* Legend decorator for d2d. Responsible for drawing and handling mouse input
|
||||||
|
@ -361,8 +361,11 @@ public class D2DLegendResource extends
|
||||||
|
|
||||||
AbstractDescriptor desc = (AbstractDescriptor) descriptor;
|
AbstractDescriptor desc = (AbstractDescriptor) descriptor;
|
||||||
if (!fromResourceGroup
|
if (!fromResourceGroup
|
||||||
&& resource == desc.getTimeMatcher().getTimeMatchBasis()) {
|
&& desc.getTimeMatcher() instanceof D2DTimeMatcher) {
|
||||||
name = "* " + name;
|
if (resource == ((D2DTimeMatcher) desc.getTimeMatcher())
|
||||||
|
.getTimeMatchBasis()) {
|
||||||
|
name = "* " + name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.mode == LegendMode.SHORT_PRODUCT && !fromResourceGroup
|
if (this.mode == LegendMode.SHORT_PRODUCT && !fromResourceGroup
|
||||||
|
@ -387,8 +390,12 @@ public class D2DLegendResource extends
|
||||||
ResourceList list = ((IResourceGroup) rscGroup.getResourceData())
|
ResourceList list = ((IResourceGroup) rscGroup.getResourceData())
|
||||||
.getResourceList();
|
.getResourceList();
|
||||||
boolean tmb = false;
|
boolean tmb = false;
|
||||||
AbstractVizResource<?, ?> basis = ((AbstractDescriptor) descriptor)
|
AbstractVizResource<?, ?> basis = null;
|
||||||
.getTimeMatcher().getTimeMatchBasis();
|
AbstractDescriptor desc = (AbstractDescriptor) descriptor;
|
||||||
|
if (desc.getTimeMatcher() instanceof D2DTimeMatcher) {
|
||||||
|
basis = ((D2DTimeMatcher) desc.getTimeMatcher())
|
||||||
|
.getTimeMatchBasis();
|
||||||
|
}
|
||||||
DataTime timeToUse = null;
|
DataTime timeToUse = null;
|
||||||
if (rscGroup.hasCapability(GroupNamingCapability.class) == false
|
if (rscGroup.hasCapability(GroupNamingCapability.class) == false
|
||||||
|| groupName == null) {
|
|| groupName == null) {
|
||||||
|
|
|
@ -17,13 +17,14 @@
|
||||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||||
* further licensing information.
|
* further licensing information.
|
||||||
**/
|
**/
|
||||||
package com.raytheon.viz.ui.cmenu;
|
package com.raytheon.uf.viz.d2d.core.legend;
|
||||||
|
|
||||||
import org.eclipse.jface.action.IAction;
|
import org.eclipse.jface.action.IAction;
|
||||||
|
|
||||||
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.viz.core.AbstractTimeMatcher;
|
||||||
import com.raytheon.uf.viz.core.IDisplayPane;
|
import com.raytheon.uf.viz.core.IDisplayPane;
|
||||||
import com.raytheon.uf.viz.core.drawables.AbstractDescriptor;
|
import com.raytheon.uf.viz.core.drawables.AbstractDescriptor;
|
||||||
import com.raytheon.uf.viz.core.drawables.ResourcePair;
|
import com.raytheon.uf.viz.core.drawables.ResourcePair;
|
||||||
|
@ -32,7 +33,8 @@ import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||||
import com.raytheon.uf.viz.core.rsc.IResourceGroup;
|
import com.raytheon.uf.viz.core.rsc.IResourceGroup;
|
||||||
import com.raytheon.uf.viz.core.rsc.ResourceList;
|
import com.raytheon.uf.viz.core.rsc.ResourceList;
|
||||||
import com.raytheon.uf.viz.core.rsc.capabilities.BlendableCapability;
|
import com.raytheon.uf.viz.core.rsc.capabilities.BlendableCapability;
|
||||||
import com.raytheon.uf.viz.core.rsc.capabilities.TimeMatchBasisCapability;
|
import com.raytheon.uf.viz.d2d.core.time.D2DTimeMatcher;
|
||||||
|
import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Time match basis action, sets the selected resource as the time match basis
|
* Time match basis action, sets the selected resource as the time match basis
|
||||||
|
@ -90,8 +92,10 @@ public class SetTimeMatchBasisAction extends AbstractRightClickAction {
|
||||||
try {
|
try {
|
||||||
AbstractDescriptor descriptor = (AbstractDescriptor) rsc
|
AbstractDescriptor descriptor = (AbstractDescriptor) rsc
|
||||||
.getDescriptor();
|
.getDescriptor();
|
||||||
descriptor.getTimeMatcher().changeTimeMatchBasis(rsc);
|
D2DTimeMatcher tm = (D2DTimeMatcher) descriptor
|
||||||
descriptor.getTimeMatcher().redoTimeMatching(descriptor);
|
.getTimeMatcher();
|
||||||
|
tm.changeTimeMatchBasis(rsc);
|
||||||
|
tm.redoTimeMatching(descriptor);
|
||||||
|
|
||||||
for (IDisplayPane pane : container.getDisplayPanes()) {
|
for (IDisplayPane pane : container.getDisplayPanes()) {
|
||||||
if (pane.getDescriptor() != descriptor) {
|
if (pane.getDescriptor() != descriptor) {
|
||||||
|
@ -115,8 +119,8 @@ public class SetTimeMatchBasisAction extends AbstractRightClickAction {
|
||||||
public boolean isChecked() {
|
public boolean isChecked() {
|
||||||
boolean tmb = false;
|
boolean tmb = false;
|
||||||
AbstractVizResource<?, ?> rsc = getTopMostSelectedResource();
|
AbstractVizResource<?, ?> rsc = getTopMostSelectedResource();
|
||||||
AbstractVizResource<?, ?> basis = rsc.getDescriptor().getTimeMatcher()
|
AbstractVizResource<?, ?> basis = ((D2DTimeMatcher) rsc.getDescriptor()
|
||||||
.getTimeMatchBasis();
|
.getTimeMatcher()).getTimeMatchBasis();
|
||||||
|
|
||||||
if (basis == rsc) {
|
if (basis == rsc) {
|
||||||
tmb = true;
|
tmb = true;
|
||||||
|
@ -142,21 +146,12 @@ public class SetTimeMatchBasisAction extends AbstractRightClickAction {
|
||||||
@Override
|
@Override
|
||||||
public boolean isHidden() {
|
public boolean isHidden() {
|
||||||
AbstractVizResource<?, ?> rsc = getTopMostSelectedResource();
|
AbstractVizResource<?, ?> rsc = getTopMostSelectedResource();
|
||||||
if (rsc.hasCapability(TimeMatchBasisCapability.class) == false) {
|
AbstractTimeMatcher tm = rsc.getDescriptor().getTimeMatcher();
|
||||||
if (rsc.hasCapability(BlendableCapability.class)) {
|
if (tm instanceof D2DTimeMatcher) {
|
||||||
ResourceList list = rsc
|
// If on D2DTimeMatcher, hide only if time agnostic resource
|
||||||
.getCapability(BlendableCapability.class)
|
return rsc.isTimeAgnostic();
|
||||||
.getResourceList();
|
|
||||||
for (ResourcePair rp : list) {
|
|
||||||
if (rp.getResource().hasCapability(
|
|
||||||
TimeMatchBasisCapability.class)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -35,7 +35,6 @@ import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import org.apache.commons.lang.Validate;
|
import org.apache.commons.lang.Validate;
|
||||||
|
|
||||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
|
||||||
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;
|
||||||
|
@ -80,8 +79,7 @@ import com.raytheon.uf.viz.d2d.core.D2DLoadProperties;
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.NONE)
|
@XmlAccessorType(XmlAccessType.NONE)
|
||||||
public class D2DTimeMatcher extends AbstractTimeMatcher implements
|
public class D2DTimeMatcher extends AbstractTimeMatcher {
|
||||||
ISerializableObject {
|
|
||||||
|
|
||||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
.getHandler(D2DTimeMatcher.class);
|
.getHandler(D2DTimeMatcher.class);
|
||||||
|
@ -409,10 +407,12 @@ public class D2DTimeMatcher extends AbstractTimeMatcher implements
|
||||||
TimeMatchingConfiguration config = getConfiguration(timeMatchBasis
|
TimeMatchingConfiguration config = getConfiguration(timeMatchBasis
|
||||||
.getLoadProperties());
|
.getLoadProperties());
|
||||||
DataTime[] times = config.getLastFrameTimes();
|
DataTime[] times = config.getLastFrameTimes();
|
||||||
if (times == null || config.getLastBaseTimes() != null) {
|
if (times == null || config.getLastBaseTimes() != null
|
||||||
|
|| config.getLastFrameCount() != numberOfFrames) {
|
||||||
times = makeEmptyLoadList(numberOfFrames, timeMatchBasis);
|
times = makeEmptyLoadList(numberOfFrames, timeMatchBasis);
|
||||||
config.setLastFrameTimes(times);
|
config.setLastFrameTimes(times);
|
||||||
config.setLastBaseTimes(null);
|
config.setLastBaseTimes(null);
|
||||||
|
config.setLastFrameCount(numberOfFrames);
|
||||||
}
|
}
|
||||||
if (times != null) {
|
if (times != null) {
|
||||||
return times;
|
return times;
|
||||||
|
@ -781,15 +781,12 @@ public class D2DTimeMatcher extends AbstractTimeMatcher implements
|
||||||
return dataTimesToLoad;
|
return dataTimesToLoad;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* (non-Javadoc)
|
* Changes the time match basis for the time matcher to be the specified
|
||||||
|
* resource
|
||||||
*
|
*
|
||||||
* @see
|
* @param resource
|
||||||
* com.raytheon.uf.viz.core.AbstractTimeMatcher#changeTimeMatchBasis(com
|
|
||||||
* .raytheon.uf.viz.core.rsc.AbstractVizResource,
|
|
||||||
* com.raytheon.uf.viz.core.drawables.IDescriptor)
|
|
||||||
*/
|
*/
|
||||||
@Override
|
|
||||||
public void changeTimeMatchBasis(AbstractVizResource<?, ?> resource) {
|
public void changeTimeMatchBasis(AbstractVizResource<?, ?> resource) {
|
||||||
if (timeMatchBasis != resource) {
|
if (timeMatchBasis != resource) {
|
||||||
if (timeMatchBasis != null) {
|
if (timeMatchBasis != null) {
|
||||||
|
@ -814,7 +811,11 @@ public class D2DTimeMatcher extends AbstractTimeMatcher implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
|
* Returns the time match basis for the D2DTimeMatcher
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public AbstractVizResource<?, ?> getTimeMatchBasis() {
|
public AbstractVizResource<?, ?> getTimeMatchBasis() {
|
||||||
return timeMatchBasis;
|
return timeMatchBasis;
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,6 +67,9 @@ public class TimeMatchingConfiguration {
|
||||||
// The result of the last time matching.
|
// The result of the last time matching.
|
||||||
private DataTime[] lastFrameTimes;
|
private DataTime[] lastFrameTimes;
|
||||||
|
|
||||||
|
// The number of frames time matched against
|
||||||
|
private int lastFrameCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default Constructor
|
* Default Constructor
|
||||||
*/
|
*/
|
||||||
|
@ -230,4 +233,12 @@ public class TimeMatchingConfiguration {
|
||||||
this.lastFrameTimes = lastFrameTimes;
|
this.lastFrameTimes = lastFrameTimes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setLastFrameCount(int lastFrameCount) {
|
||||||
|
this.lastFrameCount = lastFrameCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLastFrameCount() {
|
||||||
|
return lastFrameCount;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ import com.raytheon.uf.viz.core.AbstractTimeMatcher;
|
||||||
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;
|
||||||
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
||||||
|
import com.raytheon.uf.viz.d2d.core.time.D2DTimeMatcher;
|
||||||
import com.raytheon.viz.ui.EditorUtil;
|
import com.raytheon.viz.ui.EditorUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -68,11 +69,11 @@ public class LoadModeBasisHandler extends LoadModeHandler {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
AbstractTimeMatcher timeMatcher = descriptor.getTimeMatcher();
|
AbstractTimeMatcher timeMatcher = descriptor.getTimeMatcher();
|
||||||
if (timeMatcher == null) {
|
if (timeMatcher instanceof D2DTimeMatcher == false) {
|
||||||
setBaseEnabled(false);
|
setBaseEnabled(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (timeMatcher.getTimeMatchBasis() != null) {
|
if (((D2DTimeMatcher) timeMatcher).getTimeMatchBasis() != null) {
|
||||||
setBaseEnabled(false);
|
setBaseEnabled(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ import com.raytheon.uf.viz.core.AbstractTimeMatcher;
|
||||||
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;
|
||||||
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
||||||
|
import com.raytheon.uf.viz.d2d.core.time.D2DTimeMatcher;
|
||||||
import com.raytheon.viz.ui.EditorUtil;
|
import com.raytheon.viz.ui.EditorUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -67,11 +68,11 @@ public class LoadModeOverlayHandler extends LoadModeHandler {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
AbstractTimeMatcher timeMatcher = descriptor.getTimeMatcher();
|
AbstractTimeMatcher timeMatcher = descriptor.getTimeMatcher();
|
||||||
if (timeMatcher == null) {
|
if (timeMatcher instanceof D2DTimeMatcher == false) {
|
||||||
setBaseEnabled(false);
|
setBaseEnabled(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (timeMatcher.getTimeMatchBasis() == null) {
|
if (((D2DTimeMatcher) timeMatcher).getTimeMatchBasis() == null) {
|
||||||
setBaseEnabled(false);
|
setBaseEnabled(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -299,12 +299,14 @@ public class HydroDisplayManager {
|
||||||
|
|
||||||
// Get the Grib data
|
// Get the Grib data
|
||||||
Map<String, RequestConstraint> reqMap = new HashMap<String, RequestConstraint>();
|
Map<String, RequestConstraint> reqMap = new HashMap<String, RequestConstraint>();
|
||||||
reqMap.put(GridConstants.PLUGIN_NAME, new RequestConstraint(GridConstants.GRID));
|
reqMap.put(GridConstants.PLUGIN_NAME, new RequestConstraint(
|
||||||
|
GridConstants.GRID));
|
||||||
reqMap.put(GridConstants.PARAMETER_ABBREVIATION,
|
reqMap.put(GridConstants.PARAMETER_ABBREVIATION,
|
||||||
new RequestConstraint(paramAbr));
|
new RequestConstraint(paramAbr));
|
||||||
reqMap.put("dataTime.refTime",
|
reqMap.put("dataTime.refTime",
|
||||||
new RequestConstraint(sdf.format(date)));
|
new RequestConstraint(sdf.format(date)));
|
||||||
reqMap.put(GridConstants.DATASET_ID, new RequestConstraint("FFG-" + rfc));
|
reqMap.put(GridConstants.DATASET_ID, new RequestConstraint("FFG-"
|
||||||
|
+ rfc));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
LayerProperty lp = new LayerProperty();
|
LayerProperty lp = new LayerProperty();
|
||||||
|
@ -465,12 +467,14 @@ public class HydroDisplayManager {
|
||||||
|
|
||||||
// Get the Grib data
|
// Get the Grib data
|
||||||
Map<String, RequestConstraint> reqMap = new HashMap<String, RequestConstraint>();
|
Map<String, RequestConstraint> reqMap = new HashMap<String, RequestConstraint>();
|
||||||
reqMap.put(GridConstants.PLUGIN_NAME, new RequestConstraint(GridConstants.GRID));
|
reqMap.put(GridConstants.PLUGIN_NAME, new RequestConstraint(
|
||||||
|
GridConstants.GRID));
|
||||||
reqMap.put(GridConstants.PARAMETER_ABBREVIATION,
|
reqMap.put(GridConstants.PARAMETER_ABBREVIATION,
|
||||||
new RequestConstraint(paramAbr));
|
new RequestConstraint(paramAbr));
|
||||||
reqMap.put("dataTime.refTime",
|
reqMap.put("dataTime.refTime",
|
||||||
new RequestConstraint(sdf.format(date)));
|
new RequestConstraint(sdf.format(date)));
|
||||||
reqMap.put(GridConstants.DATASET_ID, new RequestConstraint("FFG-" + rfc));
|
reqMap.put(GridConstants.DATASET_ID, new RequestConstraint("FFG-"
|
||||||
|
+ rfc));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
LayerProperty lp = new LayerProperty();
|
LayerProperty lp = new LayerProperty();
|
||||||
|
@ -725,9 +729,8 @@ public class HydroDisplayManager {
|
||||||
loopProps.setFwdFrameTime(frameRate);
|
loopProps.setFwdFrameTime(frameRate);
|
||||||
loopProps.setLooping(true);
|
loopProps.setLooping(true);
|
||||||
|
|
||||||
md.getTimeMatcher().changeTimeMatchBasis(timeLapseRsc);
|
|
||||||
try {
|
try {
|
||||||
md.getTimeMatcher().redoTimeMatching(md);
|
md.redoTimeMatching();
|
||||||
} catch (VizException e) {
|
} catch (VizException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
|
@ -416,7 +416,7 @@ public class MPEDisplayManager {
|
||||||
.getInstance().getCurrentWindow()
|
.getInstance().getCurrentWindow()
|
||||||
.getService(ICommandService.class))
|
.getService(ICommandService.class))
|
||||||
.getCommand("com.raytheon.viz.mpe.ui.actions.toggleGageColor");
|
.getCommand("com.raytheon.viz.mpe.ui.actions.toggleGageColor");
|
||||||
// dataSaved = true;
|
// dataSaved = true;
|
||||||
currentDate = MPEDataManager.getInstance().getLatestDate();
|
currentDate = MPEDataManager.getInstance().getLatestDate();
|
||||||
displayFieldType = DisplayFieldData.mMosaic;
|
displayFieldType = DisplayFieldData.mMosaic;
|
||||||
displayMode = EnumSet.noneOf(DisplayMode.class);
|
displayMode = EnumSet.noneOf(DisplayMode.class);
|
||||||
|
@ -523,7 +523,8 @@ public class MPEDisplayManager {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// if saved, then reset to false since it isn't saved for the next time
|
// if saved, then reset to false since it isn't saved for the next
|
||||||
|
// time
|
||||||
setDataSaved(false);
|
setDataSaved(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -666,7 +667,7 @@ public class MPEDisplayManager {
|
||||||
List<Colorvalue> pColorSet = GetColorValues.get_colorvalues(user_id,
|
List<Colorvalue> pColorSet = GetColorValues.get_colorvalues(user_id,
|
||||||
app_name, displayFieldType.getCv_use(),
|
app_name, displayFieldType.getCv_use(),
|
||||||
accum_interval * 60 * 60, "E", pColorSetGroup);
|
accum_interval * 60 * 60, "E", pColorSetGroup);
|
||||||
// displayFieldType.getCv_duration(), "E", pColorSetGroup);
|
// displayFieldType.getCv_duration(), "E", pColorSetGroup);
|
||||||
|
|
||||||
switch (displayFieldType) {
|
switch (displayFieldType) {
|
||||||
case rMosaic:
|
case rMosaic:
|
||||||
|
@ -758,11 +759,10 @@ public class MPEDisplayManager {
|
||||||
|
|
||||||
descriptor.setNumberOfFrames(getTimeLapseHours());
|
descriptor.setNumberOfFrames(getTimeLapseHours());
|
||||||
MPEDisplayManager.getCurrent().setDisplayedResource(timeLapseRsc);
|
MPEDisplayManager.getCurrent().setDisplayedResource(timeLapseRsc);
|
||||||
descriptor.getTimeMatcher().changeTimeMatchBasis(timeLapseRsc);
|
|
||||||
try {
|
try {
|
||||||
descriptor
|
descriptor
|
||||||
.setFramesInfo(new FramesInfo(timeLapseRsc.getDataTimes()));
|
.setFramesInfo(new FramesInfo(timeLapseRsc.getDataTimes()));
|
||||||
descriptor.getTimeMatcher().redoTimeMatching(descriptor);
|
descriptor.redoTimeMatching();
|
||||||
} catch (VizException e) {
|
} catch (VizException e) {
|
||||||
statusHandler.error("Error while redoing Time Matching ", e);
|
statusHandler.error("Error while redoing Time Matching ", e);
|
||||||
}
|
}
|
||||||
|
@ -813,7 +813,7 @@ public class MPEDisplayManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
displayedResource = null;
|
displayedResource = null;
|
||||||
// dataSaved = true;
|
// dataSaved = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1287,13 +1287,13 @@ public class MPEDisplayManager {
|
||||||
private void save_merged_RFCW(String fileName, String processFlag) {
|
private void save_merged_RFCW(String fileName, String processFlag) {
|
||||||
XmrgFile xmrg = ((XmrgResource) displayedResource).getXmrgFile();
|
XmrgFile xmrg = ((XmrgResource) displayedResource).getXmrgFile();
|
||||||
if (xmrg == null) {
|
if (xmrg == null) {
|
||||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||||
.getShell();
|
.getShell();
|
||||||
MessageBox box = new MessageBox(shell, SWT.ERROR);
|
MessageBox box = new MessageBox(shell, SWT.ERROR);
|
||||||
box.setText("Cannot Save");
|
box.setText("Cannot Save");
|
||||||
box.setMessage("No Data Available, cannot save");
|
box.setMessage("No Data Available, cannot save");
|
||||||
box.open();
|
box.open();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
xmrg.setData(((XmrgResource) displayedResource).getData());
|
xmrg.setData(((XmrgResource) displayedResource).getData());
|
||||||
short[] data = xmrg.getData();
|
short[] data = xmrg.getData();
|
||||||
|
|
|
@ -39,7 +39,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.capabilities.ColorableCapability;
|
import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability;
|
||||||
import com.raytheon.uf.viz.core.rsc.capabilities.ImagingCapability;
|
import com.raytheon.uf.viz.core.rsc.capabilities.ImagingCapability;
|
||||||
import com.raytheon.uf.viz.core.rsc.capabilities.TimeMatchBasisCapability;
|
|
||||||
import com.raytheon.viz.awipstools.capabilities.RangeRingsOverlayCapability;
|
import com.raytheon.viz.awipstools.capabilities.RangeRingsOverlayCapability;
|
||||||
import com.raytheon.viz.radar.RadarHelper;
|
import com.raytheon.viz.radar.RadarHelper;
|
||||||
import com.raytheon.viz.radar.interrogators.IRadarInterrogator;
|
import com.raytheon.viz.radar.interrogators.IRadarInterrogator;
|
||||||
|
@ -80,7 +79,6 @@ public class RadarGSMResource extends AbstractRadarResource<RadarXYDescriptor> {
|
||||||
// remove the uneeded capabilities
|
// remove the uneeded capabilities
|
||||||
getCapabilities().removeCapability(ImagingCapability.class);
|
getCapabilities().removeCapability(ImagingCapability.class);
|
||||||
getCapabilities().removeCapability(RangeRingsOverlayCapability.class);
|
getCapabilities().removeCapability(RangeRingsOverlayCapability.class);
|
||||||
getCapabilities().removeCapability(TimeMatchBasisCapability.class);
|
|
||||||
|
|
||||||
color = getCapability(ColorableCapability.class).getColor();
|
color = getCapability(ColorableCapability.class).getColor();
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,6 @@ import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||||
import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability;
|
import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability;
|
||||||
import com.raytheon.uf.viz.core.rsc.capabilities.ImagingCapability;
|
import com.raytheon.uf.viz.core.rsc.capabilities.ImagingCapability;
|
||||||
import com.raytheon.uf.viz.core.rsc.capabilities.OutlineCapability;
|
import com.raytheon.uf.viz.core.rsc.capabilities.OutlineCapability;
|
||||||
import com.raytheon.uf.viz.core.rsc.capabilities.TimeMatchBasisCapability;
|
|
||||||
import com.raytheon.uf.viz.points.PointsDataManager;
|
import com.raytheon.uf.viz.points.PointsDataManager;
|
||||||
import com.raytheon.uf.viz.xy.map.rsc.IInsetMapResource;
|
import com.raytheon.uf.viz.xy.map.rsc.IInsetMapResource;
|
||||||
import com.raytheon.viz.awipstools.capabilities.RangeRingsOverlayCapability;
|
import com.raytheon.viz.awipstools.capabilities.RangeRingsOverlayCapability;
|
||||||
|
@ -100,7 +99,6 @@ public class RadarGraphResource extends
|
||||||
|
|
||||||
getCapabilities().removeCapability(ImagingCapability.class);
|
getCapabilities().removeCapability(ImagingCapability.class);
|
||||||
getCapabilities().removeCapability(RangeRingsOverlayCapability.class);
|
getCapabilities().removeCapability(RangeRingsOverlayCapability.class);
|
||||||
getCapabilities().removeCapability(TimeMatchBasisCapability.class);
|
|
||||||
|
|
||||||
this.dataTimes = new ArrayList<DataTime>();
|
this.dataTimes = new ArrayList<DataTime>();
|
||||||
this.allDataGraphSets = new HashMap<DataTime, Map<GraphPosition, CellTrendGraph>>();
|
this.allDataGraphSets = new HashMap<DataTime, Map<GraphPosition, CellTrendGraph>>();
|
||||||
|
@ -428,7 +426,8 @@ public class RadarGraphResource extends
|
||||||
private CellTrendDataPacket getNearestCell(String point,
|
private CellTrendDataPacket getNearestCell(String point,
|
||||||
Map<RadarDataKey, RadarDataPoint> symbologyData) {
|
Map<RadarDataKey, RadarDataPoint> symbologyData) {
|
||||||
|
|
||||||
Coordinate pointCoord = PointsDataManager.getInstance().getCoordinate(point);
|
Coordinate pointCoord = PointsDataManager.getInstance().getCoordinate(
|
||||||
|
point);
|
||||||
|
|
||||||
CellTrendDataPacket nearestCell = null;
|
CellTrendDataPacket nearestCell = null;
|
||||||
CellTrendDataPacket currCell = null;
|
CellTrendDataPacket currCell = null;
|
||||||
|
|
|
@ -58,7 +58,6 @@ import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||||
import com.raytheon.uf.viz.core.rsc.capabilities.ColorMapCapability;
|
import com.raytheon.uf.viz.core.rsc.capabilities.ColorMapCapability;
|
||||||
import com.raytheon.uf.viz.core.rsc.capabilities.ImagingCapability;
|
import com.raytheon.uf.viz.core.rsc.capabilities.ImagingCapability;
|
||||||
import com.raytheon.uf.viz.core.rsc.capabilities.MagnificationCapability;
|
import com.raytheon.uf.viz.core.rsc.capabilities.MagnificationCapability;
|
||||||
import com.raytheon.uf.viz.core.rsc.capabilities.TimeMatchBasisCapability;
|
|
||||||
import com.raytheon.viz.awipstools.capabilities.RangeRingsOverlayCapability;
|
import com.raytheon.viz.awipstools.capabilities.RangeRingsOverlayCapability;
|
||||||
import com.raytheon.viz.core.contours.util.VectorGraphicsRenderable;
|
import com.raytheon.viz.core.contours.util.VectorGraphicsRenderable;
|
||||||
import com.raytheon.viz.radar.RadarHelper;
|
import com.raytheon.viz.radar.RadarHelper;
|
||||||
|
@ -114,7 +113,6 @@ public class RadarXYResource extends RadarImageResource<RadarXYDescriptor> {
|
||||||
|
|
||||||
getCapabilities().removeCapability(ImagingCapability.class);
|
getCapabilities().removeCapability(ImagingCapability.class);
|
||||||
getCapabilities().removeCapability(RangeRingsOverlayCapability.class);
|
getCapabilities().removeCapability(RangeRingsOverlayCapability.class);
|
||||||
getCapabilities().removeCapability(TimeMatchBasisCapability.class);
|
|
||||||
|
|
||||||
this.dataTimes = new ArrayList<DataTime>();
|
this.dataTimes = new ArrayList<DataTime>();
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@ import com.raytheon.uf.viz.core.AbstractTimeMatcher;
|
||||||
import com.raytheon.uf.viz.core.IDisplayPane;
|
import com.raytheon.uf.viz.core.IDisplayPane;
|
||||||
import com.raytheon.uf.viz.core.VizApp;
|
import com.raytheon.uf.viz.core.VizApp;
|
||||||
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
||||||
|
import com.raytheon.uf.viz.core.drawables.IDescriptor.FramesInfo;
|
||||||
import com.raytheon.uf.viz.core.drawables.IRenderableDisplay;
|
import com.raytheon.uf.viz.core.drawables.IRenderableDisplay;
|
||||||
import com.raytheon.uf.viz.core.drawables.ResourcePair;
|
import com.raytheon.uf.viz.core.drawables.ResourcePair;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
|
@ -94,9 +95,10 @@ public class MenuLoader extends Job {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the frame count based on what has been listed in the
|
* Update the frame count based on what has been listed in the
|
||||||
* bundle if we don't have a time match basis already
|
* bundle if we don't have times already loaded
|
||||||
*/
|
*/
|
||||||
if (existingDescriptor.getTimeMatcher().getTimeMatchBasis() == null) {
|
FramesInfo info = existingDescriptor.getFramesInfo();
|
||||||
|
if (info.getFrameCount() == 0) {
|
||||||
existingDescriptor.setNumberOfFrames(loadFrom.getDescriptor()
|
existingDescriptor.setNumberOfFrames(loadFrom.getDescriptor()
|
||||||
.getNumberOfFrames());
|
.getNumberOfFrames());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1597,7 +1597,7 @@ public class NsharpResourceHandler {
|
||||||
}*/
|
}*/
|
||||||
//set data time to descriptor
|
//set data time to descriptor
|
||||||
//this is necessary for looping
|
//this is necessary for looping
|
||||||
if (( skewtPaneRsc.getDescriptor().getTimeMatcher() == null || skewtPaneRsc.getDescriptor().getTimeMatcher().getTimeMatchBasis() == null)&& !getTimeMatcher) {
|
if (( skewtPaneRsc.getDescriptor().getFramesInfo().getFrameCount() == 0)&& !getTimeMatcher) {
|
||||||
//DataTime[] dataTimes = new DataTime[dataTimelineList.size()];
|
//DataTime[] dataTimes = new DataTime[dataTimelineList.size()];
|
||||||
//Chin Note: we just have to do this once and set dataTimes size bigger than 1.
|
//Chin Note: we just have to do this once and set dataTimes size bigger than 1.
|
||||||
//Nsharp handles changing frame itself. It just need system to send change frame notice.
|
//Nsharp handles changing frame itself. It just need system to send change frame notice.
|
||||||
|
|
|
@ -1670,7 +1670,7 @@ public class NsharpSkewTResource extends AbstractVizResource<AbstractResourceDat
|
||||||
}
|
}
|
||||||
//set data time to descriptor
|
//set data time to descriptor
|
||||||
//this is necessary for looping
|
//this is necessary for looping
|
||||||
if ((descriptor.getTimeMatcher() == null || descriptor.getTimeMatcher().getTimeMatchBasis() == null)&& !getTimeMatcher) {
|
if ((descriptor.getFramesInfo().getFrameCount() == 0)&& !getTimeMatcher) {
|
||||||
//DataTime[] dataTimes = new DataTime[dataTimelineList.size()];
|
//DataTime[] dataTimes = new DataTime[dataTimelineList.size()];
|
||||||
//Chin Note: we just have to do this once and set dataTimes size bigger than 1.
|
//Chin Note: we just have to do this once and set dataTimes size bigger than 1.
|
||||||
//Nsharp handles changing frame itself. It just need system to send change frame notice.
|
//Nsharp handles changing frame itself. It just need system to send change frame notice.
|
||||||
|
|
|
@ -653,18 +653,6 @@ public class NCTimeMatcher extends AbstractTimeMatcher implements
|
||||||
return timesLoaded;
|
return timesLoaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
// bsteffen changed method signature
|
|
||||||
// public void changeTimeMatchBasis(AbstractVizResource<?, ?> resource,
|
|
||||||
// IDescriptor descriptor) {
|
|
||||||
public void changeTimeMatchBasis(AbstractVizResource<?, ?> resource) {
|
|
||||||
if (resource != null) {
|
|
||||||
this.dominantRscData = (AbstractNatlCntrsRequestableResourceData) resource
|
|
||||||
.getResourceData();
|
|
||||||
dominantResourceName = dominantRscData.getResourceName();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// This is called by raytheon's NcAutoUpdater
|
// This is called by raytheon's NcAutoUpdater
|
||||||
|
|
||||||
// Assume that the frameTimes have been changed. We will need to update the
|
// Assume that the frameTimes have been changed. We will need to update the
|
||||||
|
@ -739,9 +727,4 @@ public class NCTimeMatcher extends AbstractTimeMatcher implements
|
||||||
return frameTimes.toArray(new DataTime[0]);
|
return frameTimes.toArray(new DataTime[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public AbstractVizResource<?, ?> getTimeMatchBasis() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue