|
jAER project on SourceForge | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.AbstractSequentialList<E>
java.util.LinkedList<EventFilter2D>
net.sf.jaer.eventprocessing.FilterChain
public class FilterChain
A chain of EventFilter that serially filters or processes packets of AEPacket2D. An instance of this object can be passed to FilterFrame and is an instance field of e.g. AERetina. Filters know which chain they are part of and can find out what filters come before and afterwards, allowing them to enable or disable them according to their needs, e.g. NearestEventMotionFilter needs SimpleOrientationFilter to be enabled.
FilterChain fires the following PropertyChangeEvents
//build hierarchy FilterChain trackingFilterChain = new FilterChain(chip); EventFilter tracker=new RectangularClusterTracker(chip); EventFilter servoArm = new ServoArm(chip); EventFilter xYFilter = new XYTypeFilter(chip); EventFilter tableFilter=new GoalieTableFilter(chip); trackingFilterChain.add(new BackgroundActivityFilter(chip)); trackingFilterChain.add(tableFilter); trackingFilterChain.add(tracker); trackingFilterChain.add(servoArm); setEnclosedFilterChain(trackingFilterChain); // labels enclosed filters as being enclosed tracker.setEnclosedFilter(xYFilter); // marks xYFilter as enclosed by tracker tracker.setEnclosed(true, this); // tracker is enclosed by this servoArm.setEnclosed(true, this); // same for servoArm xYFilter.setEnclosed(true, tracker); // but xYFilter is enclosed by trackerAnother, simpler, example is as follows, as part of an EventFilter's constructor:
setEnclosedFilterChain(new FilterChain(chip)); // make a new FilterChain for this EventFilter RefractoryFilter rf=new RefractoryFilter(chip); // make a filter to go in the chain rf.setEnclosed(true, this); // set rf to be enclosed and inside this filter getEnclosedFilterChain().add(rf); // add rf to this EventFilter's FilterChain
Nested Class Summary | |
---|---|
static class |
FilterChain.ProcessingMode
Filters can either be processed in the rendering or the data acquisition cycle. |
Field Summary |
---|
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
FilterChain(AEChip chip)
Creates a new instance of FilterChain. |
Method Summary | |
---|---|
boolean |
add(EventFilter2D filter)
Adds a filter to the end of the chain. |
void |
contructPreferredFilters()
Constructs the preferred filters for the FilterChain as stored in user Preferences. |
EventPacket |
filterPacket(EventPacket in)
applies all the filters in the chain to the packet in the order of the enabled filters. |
EventFilter2D |
findFilter(java.lang.Class filterClass)
|
FilterChain.ProcessingMode |
getProcessingMode()
|
java.beans.PropertyChangeSupport |
getSupport()
FilterChain fires the following PropertyChangeEvents processingmode - when the processing mode is changed |
int |
getTimeLimitMs()
|
boolean |
isAnyFilterEnabled()
Iterates over all filters and returns true if any filter is enabled. |
boolean |
isEnclosed()
Is filter enclosed inside another filter? |
boolean |
isFilteringEnabled()
|
boolean |
isMeasurePerformanceEnabled()
|
boolean |
isTimedOut()
Returns status of timeout of event processing time limit during filter processing. |
boolean |
isTimeLimitEnabled()
|
boolean |
remove(EventFilter2D filter)
remove the filter |
void |
reset()
resets all the filters |
void |
setEnclosed(boolean enclosed,
EventFilter enclosingFilter)
Sets flag to show this instance is enclosed. |
void |
setFilteringEnabled(boolean b)
Globally sets whether filters are applied in this FilterChain. |
void |
setMeasurePerformanceEnabled(boolean measurePerformanceEnabled)
|
void |
setProcessingMode(FilterChain.ProcessingMode processingMode)
Sets whether this chain is procesed in the acquisition or rendering thread. |
void |
setTimeLimitEnabled(boolean timeLimitEnabled)
Enables/disables limit on processing time for packets. |
void |
setTimeLimitMs(int timeLimitMs)
Set the time limit in ms for packet processing if time limiting is enabled. |
Methods inherited from class java.util.LinkedList |
---|
add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, toArray, toArray |
Methods inherited from class java.util.AbstractSequentialList |
---|
iterator |
Methods inherited from class java.util.AbstractList |
---|
equals, hashCode, listIterator, removeRange, subList |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, isEmpty, removeAll, retainAll, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, retainAll, subList |
Methods inherited from interface java.util.Deque |
---|
iterator |
Constructor Detail |
---|
public FilterChain(AEChip chip)
chip
- the chip that uses this filter chainMethod Detail |
---|
public void reset()
public EventPacket filterPacket(EventPacket in)
in
- the input packet of events
public EventFilter2D findFilter(java.lang.Class filterClass)
filterClass
- the class to search for
public boolean add(EventFilter2D filter)
add
in interface java.util.Collection<EventFilter2D>
add
in interface java.util.Deque<EventFilter2D>
add
in interface java.util.List<EventFilter2D>
add
in interface java.util.Queue<EventFilter2D>
add
in class java.util.LinkedList<EventFilter2D>
filter
- the filter to add
)
public boolean remove(EventFilter2D filter)
public boolean isTimeLimitEnabled()
public void setTimeLimitEnabled(boolean timeLimitEnabled)
public int getTimeLimitMs()
public void setTimeLimitMs(int timeLimitMs)
public FilterChain.ProcessingMode getProcessingMode()
public void setProcessingMode(FilterChain.ProcessingMode processingMode)
Fires PropertyChangeEvent "processingmode"
processingMode
public boolean isAnyFilterEnabled()
public boolean isMeasurePerformanceEnabled()
public void setMeasurePerformanceEnabled(boolean measurePerformanceEnabled)
public void setFilteringEnabled(boolean b)
b
- true to enable (default) or false to disable all filterspublic boolean isFilteringEnabled()
public void contructPreferredFilters()
public boolean isTimedOut()
public boolean isEnclosed()
public void setEnclosed(boolean enclosed, EventFilter enclosingFilter)
enclosingFilter
- the filter that is enclosing thisenclosed
- true if this filter is enclosedpublic java.beans.PropertyChangeSupport getSupport()
|
jAER project on SourceForge | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |