public class Observation extends MapContext implements PointingBlockSetInterface, SequenceTimelineInterface, java.lang.Comparable<Observation>
| Modifier and Type | Field and Description |
|---|---|
java.util.SortedMap<java.lang.String,java.util.Date> |
eventMap |
static boolean |
LISTEN |
| Constructor and Description |
|---|
Observation(java.util.Date startDate,
java.util.Date endDate)
Creates an Observation with a start time and end time
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBlock(PointingBlockInterface newBlock)
Add a new block to the given segment
|
void |
addEvent(ObservationEvent event,
java.util.Date date)
Add an ebent to the list of events that can be used in this observation.
|
void |
addObservationBlock(ObservationPointingBlock newBlock)
Add a pointiong block tho this Observation
|
void |
addObservationListener(ObservationListener newListener)
Add a listener to the changes of this Observation
|
void |
addObservationSequence(ObservationSequence sequence)
Add a Sequernce to this Observation
|
void |
addSequence(SequenceInterface sequence)
Add a sequence to the timeline
|
PointingBlockInterface |
blockAfter(PointingBlockInterface block) |
PointingBlockInterface |
blockBefore(PointingBlockInterface block)
Get the block before the one given (before the start time the block), or null if there is no block before this one
|
protected void |
commandingChange( |
int |
compareTo(Observation o) |
Observation |
copy() |
protected void |
fireChange( |
PointingBlockSetInterface |
getAllBlocksOfType(java.lang.String blockType)
Get all blocks of a given type
|
PointingBlock |
getBlockAt(java.util.Date time)
Get the block with a start time equal to the given one or the greates value before the given date
|
PointingBlockInterface[] |
getBlocks()
Get all the blocks in this segment
|
PointingBlockSetInterface |
getBlocksAt(java.util.Date startTime,
java.util.Date endTime) |
Por |
getCommanding()
Get the commanding part of this Observation
|
java.util.Date |
getDateForEvent(ObservationEvent event)
Get teh actual date for an event
|
static Observation |
getDefaultObservation()
Static method that allows to create an Observation with start time equals to th ecurrent time and the end time one hour after.
|
ObservationEvent[] |
getDefinedEvents()
Get all the events defined for this observation
|
long |
getDurationMilliSecs()
Get the duration of this observation in milliseconds
|
java.lang.String |
getFileName()
Get the filename desired for the file holding this Observation
|
java.lang.String |
getName()
Get the name of this segment
|
java.util.Date |
getObsEndDate()
Get the end time of this Observation
|
java.util.Date |
getObsStartDate()
Get the start time of this observation
|
SequenceInterface[] |
getOrderedSequences()
Get all sequences in this timeline in execution time order
|
java.lang.String |
getPath()
Set the desired path when saving this Observation
|
PointingBlocksSlice |
getPointing()
Get the pointing part of this Observation
|
SequenceInterface |
getSequenceBefore(java.util.Date date)
Get all sequences before a date
|
SequenceInterface[] |
getSequences()
Get the sequences in this timeline
|
SequenceInterface[] |
getSequencesForDate(java.util.Date date)
Get the sequences with a given execution date
|
void |
metaChange( |
protected void |
pointingChange( |
void |
regenerate(Observation obs) |
void |
regenerate(PointingBlockSetInterface slice) |
void |
removeBlock(PointingBlockInterface block)
Remove a block from the segment.
|
void |
removeBlocks(PointingBlock[] blocks) |
void |
removeEvent(ObservationEvent event)
Remove an event from the list of events that can be used in this observation
|
void |
removeObservationListener(ObservationListener listener)
Remove a listener to the changes in this Observation
|
void |
setBlocks(PointingBlockInterface[] newBlocks)
Remove all currents blocks and substitute by the given ones
|
void |
setCommanding(ObservationPor por)
Set the commanding part of the observation
|
void |
setEventMap(java.util.SortedMap<java.lang.String,java.util.Date> map) |
void |
setFileName(java.lang.String fileName)
Set the file name that will be used when this Observation will be saved to a file
|
void |
setName(java.lang.String newName)
Set or replace the name of this segment
|
void |
setObsEndDate(java.util.Date date)
Set the end time of this Observation
|
void |
setObservationBlocks(ObservationPointingBlock[] newBlocks)
Set the pointing blocks of this Observation
|
void |
setObservationSequences(ObservationSequence[] porSequences)
Set the sequences of this Observation
|
void |
setObservationSlice(Observation slice)
Merge to Observations (on the pointing)
|
void |
setObsStartDate(java.util.Date date)
Set the start time of this Observation
|
void |
setPath(java.lang.String path)
Set the desired path when saving this Observation
|
void |
setPointing(ObservationPointingSlice slice)
Set the pointing part of an Observation
|
void |
setSequences(SequenceInterface[] porSequences)
Remove any sequences to this timeline and add the given sequences
|
void |
setSlice(PointingBlockSetInterface slice) |
void |
shiftEvent(ObservationEvent event,
long delta)
Shift an event defined for this observation a number of milliseconds
|
java.lang.String |
toItl()
Get a string with the commanding part of the observation in ITL format
|
java.lang.String |
toString() |
java.lang.String |
toXml()
Get a XML representation of this timeline
|
java.lang.String |
toXml(int indent)
Get the XML representation of this segment as per FD ICD
|
public static boolean LISTEN
public java.util.SortedMap<java.lang.String,java.util.Date> eventMap
public Observation(java.util.Date startDate,
java.util.Date endDate)
startDate - endDate - public void setEventMap(java.util.SortedMap<java.lang.String,java.util.Date> map)
public void setFileName(java.lang.String fileName)
fileName - public static Observation getDefaultObservation()
public void addObservationListener(ObservationListener newListener)
newListener - public void removeObservationListener(ObservationListener listener)
listener - public void addEvent(ObservationEvent event, java.util.Date date)
event - The event to be addeddate - The date co-related to this eventpublic void removeEvent(ObservationEvent event)
event - protected void fireChange(source)
public void metaChange(source)
protected void commandingChange(source)
protected void pointingChange(source)
public java.lang.String getFileName()
public Observation copy()
public long getDurationMilliSecs()
public void regenerate(Observation obs)
public void setName(java.lang.String newName)
PointingBlockSetInterfacesetName in interface SequenceTimelineInterfacesetName in interface PointingBlockSetInterfacepublic java.lang.String getName()
PointingBlockSetInterfacegetName in interface SequenceTimelineInterfacegetName in interface PointingBlockSetInterfacepublic java.util.Date getObsStartDate()
public java.util.Date getObsEndDate()
public void setObsStartDate(java.util.Date date)
date - public void setObsEndDate(java.util.Date date)
date - public Por getCommanding()
public void setPointing(ObservationPointingSlice slice)
slice - The blocks defining the pointing for the observationpublic void setCommanding(ObservationPor por)
por - The sequences defining the commanding part of the observationpublic PointingBlocksSlice getPointing()
public void addSequence(SequenceInterface sequence)
SequenceTimelineInterfaceaddSequence in interface SequenceTimelineInterfacepublic void addObservationSequence(ObservationSequence sequence)
sequence - public SequenceInterface[] getSequencesForDate(java.util.Date date)
SequenceTimelineInterfacegetSequencesForDate in interface SequenceTimelineInterfacepublic void setSequences(SequenceInterface[] porSequences)
SequenceTimelineInterfacesetSequences in interface SequenceTimelineInterfacepublic void setObservationSequences(ObservationSequence[] porSequences)
porSequences - public SequenceInterface[] getSequences()
SequenceTimelineInterfacegetSequences in interface SequenceTimelineInterfacepublic java.lang.String toXml()
SequenceTimelineInterfacetoXml in interface SequenceTimelineInterfacepublic SequenceInterface[] getOrderedSequences()
SequenceTimelineInterfacegetOrderedSequences in interface SequenceTimelineInterfacepublic SequenceInterface getSequenceBefore(java.util.Date date)
SequenceTimelineInterfacegetSequenceBefore in interface SequenceTimelineInterfacepublic void regenerate(PointingBlockSetInterface slice)
regenerate in interface PointingBlockSetInterfacepublic void removeBlock(PointingBlockInterface block)
PointingBlockSetInterfaceremoveBlock in interface PointingBlockSetInterfaceblock - Block to be removedpublic PointingBlockInterface blockBefore(PointingBlockInterface block)
PointingBlockSetInterfaceblockBefore in interface PointingBlockSetInterfacepublic PointingBlockInterface blockAfter(PointingBlockInterface block)
blockAfter in interface PointingBlockSetInterfacepublic void addBlock(PointingBlockInterface newBlock)
PointingBlockSetInterfaceaddBlock in interface PointingBlockSetInterfacenewBlock - Block to be addedpublic void addObservationBlock(ObservationPointingBlock newBlock)
newBlock - public PointingBlockInterface[] getBlocks()
PointingBlockSetInterfacegetBlocks in interface PointingBlockSetInterfacepublic void setBlocks(PointingBlockInterface[] newBlocks)
PointingBlockSetInterfacesetBlocks in interface PointingBlockSetInterfacenewBlocks - New blocks to replace the current onespublic void setObservationBlocks(ObservationPointingBlock[] newBlocks)
newBlocks - public java.lang.String toXml(int indent)
PointingBlockSetInterfacetoXml in interface PointingBlockSetInterfaceindent - the Number of tabs to be added before each linepublic java.lang.String toItl()
public PointingBlock getBlockAt(java.util.Date time)
PointingBlockSetInterfacegetBlockAt in interface PointingBlockSetInterfacetime - The desired timepublic PointingBlockSetInterface getBlocksAt(java.util.Date startTime, java.util.Date endTime)
getBlocksAt in interface PointingBlockSetInterfacepublic void removeBlocks(PointingBlock[] blocks)
removeBlocks in interface PointingBlockSetInterfacepublic PointingBlockSetInterface getAllBlocksOfType(java.lang.String blockType)
PointingBlockSetInterfacegetAllBlocksOfType in interface PointingBlockSetInterfaceblockType - type of blocks to search forpublic void setSlice(PointingBlockSetInterface slice)
setSlice in interface PointingBlockSetInterfacepublic void setObservationSlice(Observation slice)
slice - public java.util.Date getDateForEvent(ObservationEvent event)
event - public ObservationEvent[] getDefinedEvents()
public void setPath(java.lang.String path)
path - public java.lang.String getPath()
public void shiftEvent(ObservationEvent event, long delta)
event - The event to be shifteddelta - The number of milliseconds to shiftpublic java.lang.String toString()
public int compareTo(Observation o)