Add a date type to Kepler; being able to pass date tokens between a variety of actors would be nice. My original motivation was to feed them to plot and other display actors.
Here a response from Christopher Brooks Sep 24,2007 on the original dateType/plotting topic:
You could use the ptolemy.data.ObjectToken to encapsulate a Date.
See ptolemy.actor.lib.security.KeyToken for an example of a Token.
In the type hierarchy, the Date type would be convertable to String,
but probably nothing would be convertable to Date.
Adding date support to Ptplot would appear to be easy, but doing a
complete job would be very difficult.
The easy part is that one can easily specify ticks that consist of
a label and value. Thus, you could specify "January 1, 1970 00:00:00"
as 0 and then specify times in seconds since then.
for an example that uses ticks.
The hard part is: given a set of arbitrary Java Dates, label the axes
nicely, where nicely is defined as:
- text does not overlap.
- text displays meaningful values.
For example, if we are just looking at 15 seconds, do we
care about the day, month and year.
The code that labels the axes has lots of art in it. That code was
written a very long time ago - before many of the layout managers were
There is also this entire question of the provenance of data. Perhaps
we would like to be able to attach metadata, such as the date, to
data points. The tricky part here would be to not make the Token
classes too large. Also, I'm not sure what you would do with the
If you have data streams that have irregular time stamps, then you
might want to look at timed domains such Discrete Event. It is
possible to use SDF and have each iteration represent a tick of the
clock, but if you have data streams that have times associated with
them, then SDF is probably not what you want.
#1 Updated by Christopher Brooks almost 12 years ago
See also https://chess.eecs.berkeley.edu/bugzilla/show_bug.cgi?id=141
"Plotter should be better about displaying times"