[Kst] kdeextragear-2/kst/kst/datasources/planck

Marc-Antoine Miville-Deschenes mamd at ias.u-psud.fr
Wed Jan 19 08:03:48 CET 2005


Hello

Very good that you're working on that. I spent part of my day
yesterday to try to understand a problem I had with samplefortime.cpp.
In some cases (especially in real time)TIMESEC or TIMES_OF_SAMPLES 
don't have the
same length as the group in which they are. This is probably due to the
fact that the objects are written one at a time and the group size is 
the size
of the largest object of the group. Then if you ask for the last TIME 
of the group
you can get 0 (which is what PIOLIB returns when you ask for a sample
that has not been written yet).... So in samplefortime.cpp I had to make
sure that I was not getting this 0. You may want to deal with that too 
in the methods
you're creating.

Marc-Antoine

On 19-Jan-05, at 5:37 AM, George Staikos wrote:

> CVS commit by staikos:
>
> stubs for time conversion
>
>
>   M +22 -0     planck.cpp   1.31
>   M +11 -0     planck.h   1.12
>
>
> --- kdeextragear-2/kst/kst/datasources/planck/planck.cpp  #1.30:1.31
> @@ -229,4 +229,26 @@ bool PlanckSource::isEmpty() const {
>
>
> +bool PlanckSource::supportsTimeConversions() const {
> +  return true;
> +}
> +
> +
> +int PlanckSource::sampleForTime(const QDateTime& time, bool *ok) {
> +}
> +
> +
> +int PlanckSource::sampleForTime(int milliseconds, bool *ok) {
> +}
> +
> +
> +QDateTime PlanckSource::timeForSample(int sample, bool *ok) {
> +}
> +
> +
> +int PlanckSource::relativeTimeForSample(int sample, bool *ok) {
> +}
> +
> +
> +
>  extern "C" {
>  KstDataSource *create_planck(KConfig *cfg, const QString& filename, 
> const QString& type) {
>
> --- kdeextragear-2/kst/kst/datasources/planck/planck.h  #1.11:1.12
> @@ -48,4 +48,15 @@ class PlanckSource : public KstDataSourc
>      virtual bool isEmpty() const;
>
> +    virtual bool supportsTimeConversions() const;
> +
> +    virtual int sampleForTime(const QDateTime& time, bool *ok = 0L);
> +
> +    virtual int sampleForTime(int milliseconds, bool *ok = 0L);
> +
> +    virtual QDateTime timeForSample(int sample, bool *ok = 0L);
> +
> +    // in (ms)
> +    virtual int relativeTimeForSample(int sample, bool *ok = 0L);
> +
>    private:
>      KstSharedPtr<Planck::Object> _planckObject;
>
>
> _______________________________________________
> Kst mailing list
> Kst at kde.org
> https://mail.kde.org/mailman/listinfo/kst
>
Marc-Antoine Miville-Deschenes
Institut d'Astrophysique Spatiale
tel.: (33 1) 69 85 85 77
www.cita.utoronto.ca/~mamd/



More information about the Kst mailing list