Issue #2156 added orphan checking to time match basis on time match and set to null if not on any descriptor
Amend: Accepted ticket Change-Id: I27df5b96cc411bb3b48850e3c6fb1ee862dbd760 Former-commit-id:bb53119678
[formerly7f94b93c84
] [formerlybb53119678
[formerly7f94b93c84
] [formerly29943f945c
[formerly 782a1b71f83ee3d0db7b7df82eecabe7f7fecd4f]]] Former-commit-id:29943f945c
Former-commit-id:ecf47b4586
[formerlya2210eebf9
] Former-commit-id:49d8014f85
This commit is contained in:
parent
2a28bb772b
commit
d515b0500e
1 changed files with 34 additions and 4 deletions
|
@ -104,7 +104,6 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
|
||||||
/** The number of frames time matched against */
|
/** The number of frames time matched against */
|
||||||
private int lastFrameCount;
|
private int lastFrameCount;
|
||||||
|
|
||||||
|
|
||||||
public DataTime[] getLastBaseTimes() {
|
public DataTime[] getLastBaseTimes() {
|
||||||
return lastBaseTimes;
|
return lastBaseTimes;
|
||||||
}
|
}
|
||||||
|
@ -195,6 +194,32 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if a resource is contained in the {@link IResourceGroup}
|
||||||
|
* recursively checking for {@link IResourceGroup}s in the group's list
|
||||||
|
*
|
||||||
|
* @param group
|
||||||
|
* @param resource
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private boolean contained(IResourceGroup group,
|
||||||
|
AbstractVizResource<?, ?> resource) {
|
||||||
|
ResourceList list = group.getResourceList();
|
||||||
|
if (list.containsRsc(resource)) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
for (ResourcePair rp : list) {
|
||||||
|
if (rp.getResourceData() instanceof IResourceGroup) {
|
||||||
|
if (contained((IResourceGroup) rp.getResourceData(),
|
||||||
|
resource)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
|
@ -205,8 +230,13 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
if (timeMatchBasis != null) {
|
if (timeMatchBasis != null) {
|
||||||
IDescriptor tmDescriptor = timeMatchBasis.getDescriptor();
|
IDescriptor tmDescriptor = timeMatchBasis.getDescriptor();
|
||||||
if (tmDescriptor != null && tmDescriptor != descriptor) {
|
if (tmDescriptor != null) {
|
||||||
redoTimeMatching(timeMatchBasis.getDescriptor());
|
if (tmDescriptor != descriptor) {
|
||||||
|
redoTimeMatching(tmDescriptor);
|
||||||
|
} else if (contained(tmDescriptor, timeMatchBasis) == false) {
|
||||||
|
// Checks to ensure the timeMatchBasis is not "orphaned"
|
||||||
|
timeMatchBasis = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FramesInfo currInfo = descriptor.getFramesInfo();
|
FramesInfo currInfo = descriptor.getFramesInfo();
|
||||||
|
@ -499,7 +529,7 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
|
||||||
DataTime[] times = makeEmptyLoadList(numberOfFrames, rsc);
|
DataTime[] times = makeEmptyLoadList(numberOfFrames, rsc);
|
||||||
if (times != null) {
|
if (times != null) {
|
||||||
TimeCache cache = getTimeCache(rsc);
|
TimeCache cache = getTimeCache(rsc);
|
||||||
synchronized(cache){
|
synchronized (cache) {
|
||||||
cache.setTimes(null, times, numberOfFrames);
|
cache.setTimes(null, times, numberOfFrames);
|
||||||
}
|
}
|
||||||
return times;
|
return times;
|
||||||
|
|
Loading…
Add table
Reference in a new issue