~ubuntu-branches/ubuntu/karmic/kst/karmic

« back to all changes in this revision

Viewing changes to kst/kst/extensions/js/bind_powerspectrum.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2006-06-30 19:11:30 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060630191130-acumuar75bz4puty
Tags: 1.2.1-1ubuntu1
Merge from debian unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#ifndef BIND_PSD_H
19
19
#define BIND_PSD_H
20
20
 
21
 
#include "kstbinding.h"
 
21
#include "bind_dataobject.h"
22
22
 
23
23
#include <kstpsd.h>
24
24
 
25
25
#include <kjs/interpreter.h>
26
26
#include <kjs/object.h>
27
27
 
28
 
using namespace KJSEmbed;
29
 
 
30
 
class KstBindPowerSpectrum : public KstBinding {
 
28
/* @class PowerSpectrum
 
29
   @inherits DataObject
 
30
   @collection PowerSpectrumCollection
 
31
   @description This class represents a power spectrum (PSD) object in Kst.
 
32
*/
 
33
class KstBindPowerSpectrum : public KstBindDataObject {
31
34
  public:
 
35
    /* @constructor
 
36
       @arg Vector vector The vector to use as input to the power spectrum.
 
37
       @arg number freq The frequency for the power spectrum.
 
38
       @optarg boolean average
 
39
       @optarg number len The base 2 logarithm of the length of the power
 
40
                          spectrum.  Should be an integer &gt;= 4.
 
41
       @optarg boolean apodize If true, sharp discontinuities are removed.
 
42
       @optarg boolean removeMean True if the mean should be removed before
 
43
                                  performing the transform.
 
44
       @description Creates a new power spectrum (PSD) object in Kst.  Units
 
45
                    are <i>V</i> and <i>Hz</i> by default.
 
46
    */
32
47
    KstBindPowerSpectrum(KJS::ExecState *exec, KstPSDPtr d);
33
48
    KstBindPowerSpectrum(KJS::ExecState *exec, KJS::Object *globalObject = 0L);
34
49
    ~KstBindPowerSpectrum();
42
57
 
43
58
    // member functions
44
59
 
45
 
    // properties
46
 
    void setTagName(KJS::ExecState *exec, const KJS::Value& value);
47
 
    KJS::Value tagName(KJS::ExecState *exec) const;
 
60
    /* @property number length
 
61
       @description Contains the base 2 logarithm of the length of the power
 
62
                    spectrum.  Should be an integer &gt;= 4.
 
63
    */
48
64
    void setLength(KJS::ExecState *exec, const KJS::Value& value);
49
65
    KJS::Value length(KJS::ExecState *exec) const;
 
66
    /* @property boolean removeMean
 
67
       @description True if the mean should be removed before performing the
 
68
                    transform.
 
69
    */
50
70
    void setRemoveMean(KJS::ExecState *exec, const KJS::Value& value);
51
71
    KJS::Value removeMean(KJS::ExecState *exec) const;
 
72
    /* @property number average
 
73
    */
52
74
    void setAverage(KJS::ExecState *exec, const KJS::Value& value);
53
75
    KJS::Value average(KJS::ExecState *exec) const;
 
76
    /* @property boolean apodize
 
77
       @description If true, sharp discontinuities are removed.
 
78
    */
54
79
    void setApodize(KJS::ExecState *exec, const KJS::Value& value);
55
80
    KJS::Value apodize(KJS::ExecState *exec) const;
 
81
    /* @property number frequency
 
82
       @description Contains the sampling rate of the power spectrum.
 
83
    */
56
84
    void setFrequency(KJS::ExecState *exec, const KJS::Value& value);
57
85
    KJS::Value frequency(KJS::ExecState *exec) const;
 
86
    /* @property Vector xVector
 
87
       @readonly
 
88
       @description The X-axis vector for the power spectrum.
 
89
    */
58
90
    KJS::Value xVector(KJS::ExecState *exec) const;
 
91
    /* @property Vector yVector
 
92
       @readonly
 
93
       @description The Y-axi vector for the power spectrum.
 
94
    */
59
95
    KJS::Value yVector(KJS::ExecState *exec) const;
 
96
    /* @property string vUnits
 
97
       @description A string containing the units for the vector.
 
98
    */
60
99
    void setVUnits(KJS::ExecState *exec, const KJS::Value& value);
61
100
    KJS::Value vUnits(KJS::ExecState *exec) const;
 
101
    /* @property string rUnits
 
102
       @description A string containing the units for the rate.
 
103
    */
62
104
    void setRUnits(KJS::ExecState *exec, const KJS::Value& value);
63
105
    KJS::Value rUnits(KJS::ExecState *exec) const;
64
106
 
65
107
  protected:
66
108
    KstBindPowerSpectrum(int id);
67
109
    void addBindings(KJS::ExecState *exec, KJS::Object& obj);
68
 
 
69
 
    KstPSDPtr _d;
 
110
    static KstBindDataObject *bindFactory(KJS::ExecState *exec, KstDataObjectPtr obj);
70
111
};
71
112
 
72
113