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: b648c5828e [formerly fa693a9bb802af2491c70c14aa7ab33485fb4915]
Former-commit-id: ed77d56a84
This commit is contained in:
Max Schenkelberg 2012-11-28 13:55:41 -06:00
parent b0ef0284e1
commit b24440cc37
25 changed files with 229 additions and 193 deletions

View file

@ -21,6 +21,10 @@ package com.raytheon.uf.viz.core;
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.viz.core.drawables.AbstractRenderableDisplay;
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;
/**
* TODO Add Description
* Abstract time matching object, by default does nothing
*
* <pre>
*
@ -44,8 +48,8 @@ import com.raytheon.uf.viz.core.rsc.LoadProperties;
* @author chammack
* @version 1.0
*/
public abstract class AbstractTimeMatcher {
@XmlAccessorType(XmlAccessType.NONE)
public abstract class AbstractTimeMatcher implements ISerializableObject {
/**
* 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,
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
*

View file

@ -179,28 +179,17 @@ public abstract class AbstractDescriptor extends ResourceGroup implements
@Override
public void notifyRemove(ResourcePair rp) throws VizException {
AbstractTimeMatcher tm = getTimeMatcher();
AbstractVizResource<?, ?> basis = null;
if (tm != null) {
basis = tm.getTimeMatchBasis();
}
postRemoveListener(rp.getResource());
AbstractVizResource<?, ?> newBasis = null;
if (tm != null) {
newBasis = tm.getTimeMatchBasis();
}
if (basis != newBasis) {
TimeMatchingJob.scheduleTimeMatch(AbstractDescriptor.this);
if (renderableDisplay != null
&& renderableDisplay.getContainer() != null) {
IDisplayPaneContainer container = renderableDisplay.getContainer();
IDisplayPaneContainer container = renderableDisplay
.getContainer();
for (IDisplayPane pane : container.getDisplayPanes()) {
if (pane.getDescriptor() != AbstractDescriptor.this) {
TimeMatchingJob.scheduleTimeMatch(pane.getDescriptor());
}
TimeMatchingJob.scheduleTimeMatch(pane
.getDescriptor());
}
}
}
@ -208,7 +197,6 @@ public abstract class AbstractDescriptor extends ResourceGroup implements
});
}
protected void postAddListener(ResourcePair rp) {
if (rp.getResource() != null && getTimeMatcher() != null) {
// We need to run time matching immediately beacuse order
@ -361,14 +349,6 @@ public abstract class AbstractDescriptor extends ResourceGroup implements
@Override
public void setNumberOfFrames(int 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
@ -381,15 +361,6 @@ public abstract class AbstractDescriptor extends ResourceGroup implements
restoredTime = frames[frameIndex];
}
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 false;
@ -405,15 +376,6 @@ public abstract class AbstractDescriptor extends ResourceGroup implements
restoredTime = frames[frameIndex];
}
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;
}
limitedNumberOfFrames = Integer.MAX_VALUE;
@ -497,6 +459,18 @@ public abstract class AbstractDescriptor extends ResourceGroup implements
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
public DataTime getTimeForResource(AbstractVizResource<?, ?> rsc) {
FramesInfo currInfo = getFramesInfo();

View file

@ -19,6 +19,9 @@
**/
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.viz.core.IDisplayPane;
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
public void changeFrame(FrameChangeOperation operation, FrameChangeMode mode) {
// Grab the current frame information

View file

@ -143,15 +143,23 @@ public interface IDescriptor extends IResourceGroup {
public DataTime getTimeForResource(AbstractVizResource<?, ?> rsc,
int idx) {
DataTime[] dt = timeMap.get(rsc);
if (dt == null
|| dt.length <= idx
return getFrame(dt, idx);
}
public DataTime getCurrentFrame() {
return getFrame(frameTimes, frameIndex);
}
private DataTime getFrame(DataTime[] frames, int idx) {
if (frames == null
|| frames.length <= idx
|| idx < 0
|| (frameTimes != null && frameTimes.length > idx
&& frameTimes[idx] != null && !frameTimes[idx]
.isVisible())) {
return null;
}
return dt[idx];
return frames[idx];
}
}
@ -377,6 +385,13 @@ public interface IDescriptor extends IResourceGroup {
*/
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
*

View file

@ -19,6 +19,9 @@
**/
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;
/**
@ -87,6 +90,20 @@ public interface IFrameCoordinator {
*/
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
*

View file

@ -74,32 +74,41 @@ public class StatsJob extends Job {
runningThread = Thread.currentThread();
run = true;
while (run) {
System.out.println();
NetworkTraffic total = stats.getTotalTrafficStats();
long sentInLastMinute = total.getBytesSent() - lastSent;
long receivedInLastMinute = total.getBytesReceived() - lastReceived;
long requestCountInLastMinute = total.getRequestCount()
- lastRequestCount;
System.out.println("Last minute sent " + requestCountInLastMinute
boolean printed = false;
if (sentInLastMinute != 0.0 || receivedInLastMinute != 0.0
|| requestCountInLastMinute != 0.0) {
printed = true;
System.out.println();
System.out.println("Last minute sent "
+ requestCountInLastMinute
+ " messages for a total of "
+ NetworkStatistics.toString(sentInLastMinute)
+ " sent and "
+ NetworkStatistics.toString(receivedInLastMinute)
+ " received");
}
lastSent = total.getBytesSent();
lastReceived = total.getBytesReceived();
lastRequestCount = total.getRequestCount();
if (printed) {
System.out.println("Total sent " + total.getRequestCount()
+ " messages for a total of "
+ NetworkStatistics.toString(lastSent) + " sent and "
+ NetworkStatistics.toString(lastReceived) + " received");
+ NetworkStatistics.toString(lastReceived)
+ " received");
NetworkTraffic[] mapped = stats.getMappedTrafficStats();
for (NetworkTraffic nt : mapped) {
System.out.println(nt);
}
System.out.println();
}
try {
Thread.sleep(60 * 1000);

View file

@ -626,7 +626,8 @@ public class LocalizationManager implements IPropertyChangeListener {
// Clean up any stale files that don't exist anymore
for (File check : toCheck) {
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();
// Make sure python object files don't get removed when
// .py file is still available

View file

@ -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.capabilities.AbstractCapability;
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
@ -330,10 +329,6 @@ public abstract class AbstractVizResource<T extends AbstractResourceData, D exte
initInternal(target);
status = ResourceStatus.INITIALIZED;
if (isTimeAgnostic() == false) {
getCapabilities().addCapability(TimeMatchBasisCapability.class);
}
for (IInitListener listener : initListeners) {
listener.inited(this);
}

View file

@ -20,8 +20,7 @@
package com.raytheon.uf.viz.core.rsc.capabilities;
/**
* Capability for resources to show they can be the time match basis. This
* capability will be removed from the actual time match basis resource
* Under no circumstances use this class
*
* <pre>
*
@ -35,7 +34,7 @@ package com.raytheon.uf.viz.core.rsc.capabilities;
* @author mschenke
* @version 1.0
*/
@Deprecated
public class TimeMatchBasisCapability extends AbstractCapability {
/*

View file

@ -120,24 +120,29 @@ public class TimeMatchingJob extends Job {
try {
long t0 = System.currentTimeMillis();
request.getTimeMatcher().redoTimeMatching(request);
System.out.println("time matching took: "
+ (System.currentTimeMillis() - t0));
long time = (System.currentTimeMillis() - t0);
if (time > 0) {
System.out.println("time matching took: " + time + "ms");
}
if (!this.keepAround) {
map.remove(request);
} else {
this.keepAround = false;
}
if (request.getRenderableDisplay() != null) {
request.getRenderableDisplay().refresh();
if (request.getRenderableDisplay().getContainer() instanceof IEditorPart) {
VizApp.runAsync(new Runnable() {
@Override
public void run() {
VizGlobalsManager.getCurrentInstance().updateUI(
request.getRenderableDisplay().getContainer(),
request.getRenderableDisplay()
.getContainer(),
request.getRenderableDisplay());
}
});
}
}
} catch (Throwable e) {
statusHandler.handle(Priority.CRITICAL,
"Error redoing time matching", e);

View file

@ -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.MagnificationCapability;
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.ui.actions.DummyAction;
import com.raytheon.viz.ui.cmenu.SetTimeMatchBasisAction;
/**
* Legend decorator for d2d. Responsible for drawing and handling mouse input
@ -361,9 +361,12 @@ public class D2DLegendResource extends
AbstractDescriptor desc = (AbstractDescriptor) descriptor;
if (!fromResourceGroup
&& resource == desc.getTimeMatcher().getTimeMatchBasis()) {
&& desc.getTimeMatcher() instanceof D2DTimeMatcher) {
if (resource == ((D2DTimeMatcher) desc.getTimeMatcher())
.getTimeMatchBasis()) {
name = "* " + name;
}
}
if (this.mode == LegendMode.SHORT_PRODUCT && !fromResourceGroup
&& name.length() > 20) {
@ -387,8 +390,12 @@ public class D2DLegendResource extends
ResourceList list = ((IResourceGroup) rscGroup.getResourceData())
.getResourceList();
boolean tmb = false;
AbstractVizResource<?, ?> basis = ((AbstractDescriptor) descriptor)
.getTimeMatcher().getTimeMatchBasis();
AbstractVizResource<?, ?> basis = null;
AbstractDescriptor desc = (AbstractDescriptor) descriptor;
if (desc.getTimeMatcher() instanceof D2DTimeMatcher) {
basis = ((D2DTimeMatcher) desc.getTimeMatcher())
.getTimeMatchBasis();
}
DataTime timeToUse = null;
if (rscGroup.hasCapability(GroupNamingCapability.class) == false
|| groupName == null) {

View file

@ -17,13 +17,14 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.ui.cmenu;
package com.raytheon.uf.viz.d2d.core.legend;
import org.eclipse.jface.action.IAction;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
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.drawables.AbstractDescriptor;
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.ResourceList;
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
@ -90,8 +92,10 @@ public class SetTimeMatchBasisAction extends AbstractRightClickAction {
try {
AbstractDescriptor descriptor = (AbstractDescriptor) rsc
.getDescriptor();
descriptor.getTimeMatcher().changeTimeMatchBasis(rsc);
descriptor.getTimeMatcher().redoTimeMatching(descriptor);
D2DTimeMatcher tm = (D2DTimeMatcher) descriptor
.getTimeMatcher();
tm.changeTimeMatchBasis(rsc);
tm.redoTimeMatching(descriptor);
for (IDisplayPane pane : container.getDisplayPanes()) {
if (pane.getDescriptor() != descriptor) {
@ -115,8 +119,8 @@ public class SetTimeMatchBasisAction extends AbstractRightClickAction {
public boolean isChecked() {
boolean tmb = false;
AbstractVizResource<?, ?> rsc = getTopMostSelectedResource();
AbstractVizResource<?, ?> basis = rsc.getDescriptor().getTimeMatcher()
.getTimeMatchBasis();
AbstractVizResource<?, ?> basis = ((D2DTimeMatcher) rsc.getDescriptor()
.getTimeMatcher()).getTimeMatchBasis();
if (basis == rsc) {
tmb = true;
@ -142,21 +146,12 @@ public class SetTimeMatchBasisAction extends AbstractRightClickAction {
@Override
public boolean isHidden() {
AbstractVizResource<?, ?> rsc = getTopMostSelectedResource();
if (rsc.hasCapability(TimeMatchBasisCapability.class) == false) {
if (rsc.hasCapability(BlendableCapability.class)) {
ResourceList list = rsc
.getCapability(BlendableCapability.class)
.getResourceList();
for (ResourcePair rp : list) {
if (rp.getResource().hasCapability(
TimeMatchBasisCapability.class)) {
return false;
}
}
AbstractTimeMatcher tm = rsc.getDescriptor().getTimeMatcher();
if (tm instanceof D2DTimeMatcher) {
// If on D2DTimeMatcher, hide only if time agnostic resource
return rsc.isTimeAgnostic();
}
return true;
}
return false;
}
}

View file

@ -35,7 +35,6 @@ import javax.xml.bind.annotation.XmlAttribute;
import org.apache.commons.lang.Validate;
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.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
@ -80,8 +79,7 @@ import com.raytheon.uf.viz.d2d.core.D2DLoadProperties;
* @version 1.0
*/
@XmlAccessorType(XmlAccessType.NONE)
public class D2DTimeMatcher extends AbstractTimeMatcher implements
ISerializableObject {
public class D2DTimeMatcher extends AbstractTimeMatcher {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(D2DTimeMatcher.class);
@ -409,10 +407,12 @@ public class D2DTimeMatcher extends AbstractTimeMatcher implements
TimeMatchingConfiguration config = getConfiguration(timeMatchBasis
.getLoadProperties());
DataTime[] times = config.getLastFrameTimes();
if (times == null || config.getLastBaseTimes() != null) {
if (times == null || config.getLastBaseTimes() != null
|| config.getLastFrameCount() != numberOfFrames) {
times = makeEmptyLoadList(numberOfFrames, timeMatchBasis);
config.setLastFrameTimes(times);
config.setLastBaseTimes(null);
config.setLastFrameCount(numberOfFrames);
}
if (times != null) {
return times;
@ -781,15 +781,12 @@ public class D2DTimeMatcher extends AbstractTimeMatcher implements
return dataTimesToLoad;
}
/*
* (non-Javadoc)
/**
* Changes the time match basis for the time matcher to be the specified
* resource
*
* @see
* com.raytheon.uf.viz.core.AbstractTimeMatcher#changeTimeMatchBasis(com
* .raytheon.uf.viz.core.rsc.AbstractVizResource,
* com.raytheon.uf.viz.core.drawables.IDescriptor)
* @param resource
*/
@Override
public void changeTimeMatchBasis(AbstractVizResource<?, ?> resource) {
if (timeMatchBasis != resource) {
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() {
return timeMatchBasis;
}

View file

@ -67,6 +67,9 @@ public class TimeMatchingConfiguration {
// The result of the last time matching.
private DataTime[] lastFrameTimes;
// The number of frames time matched against
private int lastFrameCount;
/**
* Default Constructor
*/
@ -230,4 +233,12 @@ public class TimeMatchingConfiguration {
this.lastFrameTimes = lastFrameTimes;
}
public void setLastFrameCount(int lastFrameCount) {
this.lastFrameCount = lastFrameCount;
}
public int getLastFrameCount() {
return lastFrameCount;
}
}

View file

@ -23,6 +23,7 @@ import com.raytheon.uf.viz.core.AbstractTimeMatcher;
import com.raytheon.uf.viz.core.IDisplayPane;
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.d2d.core.time.D2DTimeMatcher;
import com.raytheon.viz.ui.EditorUtil;
/**
@ -68,11 +69,11 @@ public class LoadModeBasisHandler extends LoadModeHandler {
return;
}
AbstractTimeMatcher timeMatcher = descriptor.getTimeMatcher();
if (timeMatcher == null) {
if (timeMatcher instanceof D2DTimeMatcher == false) {
setBaseEnabled(false);
return;
}
if (timeMatcher.getTimeMatchBasis() != null) {
if (((D2DTimeMatcher) timeMatcher).getTimeMatchBasis() != null) {
setBaseEnabled(false);
return;
}

View file

@ -23,6 +23,7 @@ import com.raytheon.uf.viz.core.AbstractTimeMatcher;
import com.raytheon.uf.viz.core.IDisplayPane;
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.d2d.core.time.D2DTimeMatcher;
import com.raytheon.viz.ui.EditorUtil;
/**
@ -67,11 +68,11 @@ public class LoadModeOverlayHandler extends LoadModeHandler {
return;
}
AbstractTimeMatcher timeMatcher = descriptor.getTimeMatcher();
if (timeMatcher == null) {
if (timeMatcher instanceof D2DTimeMatcher == false) {
setBaseEnabled(false);
return;
}
if (timeMatcher.getTimeMatchBasis() == null) {
if (((D2DTimeMatcher) timeMatcher).getTimeMatchBasis() == null) {
setBaseEnabled(false);
return;
}

View file

@ -299,12 +299,14 @@ public class HydroDisplayManager {
// Get the Grib data
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,
new RequestConstraint(paramAbr));
reqMap.put("dataTime.refTime",
new RequestConstraint(sdf.format(date)));
reqMap.put(GridConstants.DATASET_ID, new RequestConstraint("FFG-" + rfc));
reqMap.put(GridConstants.DATASET_ID, new RequestConstraint("FFG-"
+ rfc));
try {
LayerProperty lp = new LayerProperty();
@ -465,12 +467,14 @@ public class HydroDisplayManager {
// Get the Grib data
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,
new RequestConstraint(paramAbr));
reqMap.put("dataTime.refTime",
new RequestConstraint(sdf.format(date)));
reqMap.put(GridConstants.DATASET_ID, new RequestConstraint("FFG-" + rfc));
reqMap.put(GridConstants.DATASET_ID, new RequestConstraint("FFG-"
+ rfc));
try {
LayerProperty lp = new LayerProperty();
@ -725,9 +729,8 @@ public class HydroDisplayManager {
loopProps.setFwdFrameTime(frameRate);
loopProps.setLooping(true);
md.getTimeMatcher().changeTimeMatchBasis(timeLapseRsc);
try {
md.getTimeMatcher().redoTimeMatching(md);
md.redoTimeMatching();
} catch (VizException e) {
e.printStackTrace();
}

View file

@ -523,7 +523,8 @@ public class MPEDisplayManager {
return;
}
} 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);
}
@ -758,11 +759,10 @@ public class MPEDisplayManager {
descriptor.setNumberOfFrames(getTimeLapseHours());
MPEDisplayManager.getCurrent().setDisplayedResource(timeLapseRsc);
descriptor.getTimeMatcher().changeTimeMatchBasis(timeLapseRsc);
try {
descriptor
.setFramesInfo(new FramesInfo(timeLapseRsc.getDataTimes()));
descriptor.getTimeMatcher().redoTimeMatching(descriptor);
descriptor.redoTimeMatching();
} catch (VizException e) {
statusHandler.error("Error while redoing Time Matching ", e);
}

View file

@ -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.capabilities.ColorableCapability;
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.radar.RadarHelper;
import com.raytheon.viz.radar.interrogators.IRadarInterrogator;
@ -80,7 +79,6 @@ public class RadarGSMResource extends AbstractRadarResource<RadarXYDescriptor> {
// remove the uneeded capabilities
getCapabilities().removeCapability(ImagingCapability.class);
getCapabilities().removeCapability(RangeRingsOverlayCapability.class);
getCapabilities().removeCapability(TimeMatchBasisCapability.class);
color = getCapability(ColorableCapability.class).getColor();
}

View file

@ -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.ImagingCapability;
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.xy.map.rsc.IInsetMapResource;
import com.raytheon.viz.awipstools.capabilities.RangeRingsOverlayCapability;
@ -100,7 +99,6 @@ public class RadarGraphResource extends
getCapabilities().removeCapability(ImagingCapability.class);
getCapabilities().removeCapability(RangeRingsOverlayCapability.class);
getCapabilities().removeCapability(TimeMatchBasisCapability.class);
this.dataTimes = new ArrayList<DataTime>();
this.allDataGraphSets = new HashMap<DataTime, Map<GraphPosition, CellTrendGraph>>();
@ -428,7 +426,8 @@ public class RadarGraphResource extends
private CellTrendDataPacket getNearestCell(String point,
Map<RadarDataKey, RadarDataPoint> symbologyData) {
Coordinate pointCoord = PointsDataManager.getInstance().getCoordinate(point);
Coordinate pointCoord = PointsDataManager.getInstance().getCoordinate(
point);
CellTrendDataPacket nearestCell = null;
CellTrendDataPacket currCell = null;

View file

@ -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.ImagingCapability;
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.core.contours.util.VectorGraphicsRenderable;
import com.raytheon.viz.radar.RadarHelper;
@ -114,7 +113,6 @@ public class RadarXYResource extends RadarImageResource<RadarXYDescriptor> {
getCapabilities().removeCapability(ImagingCapability.class);
getCapabilities().removeCapability(RangeRingsOverlayCapability.class);
getCapabilities().removeCapability(TimeMatchBasisCapability.class);
this.dataTimes = new ArrayList<DataTime>();
}

View file

@ -36,6 +36,7 @@ import com.raytheon.uf.viz.core.AbstractTimeMatcher;
import com.raytheon.uf.viz.core.IDisplayPane;
import com.raytheon.uf.viz.core.VizApp;
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.ResourcePair;
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
* 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()
.getNumberOfFrames());
}

View file

@ -1597,7 +1597,7 @@ public class NsharpResourceHandler {
}*/
//set data time to descriptor
//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()];
//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.

View file

@ -1670,7 +1670,7 @@ public class NsharpSkewTResource extends AbstractVizResource<AbstractResourceDat
}
//set data time to descriptor
//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()];
//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.

View file

@ -653,18 +653,6 @@ public class NCTimeMatcher extends AbstractTimeMatcher implements
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
// 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]);
}
@Override
public AbstractVizResource<?, ?> getTimeMatchBasis() {
return null;
}
}