Index: branches/extragear/kde3/graphics/doc/kst/script-chapter.docbook =================================================================== --- branches/extragear/kde3/graphics/doc/kst/script-chapter.docbook (revision 794893) +++ branches/extragear/kde3/graphics/doc/kst/script-chapter.docbook (revision 794894) @@ -1,7801 +1,7801 @@ Working with KstScript KstScript Classes: Arrow Axis AxisLabel AxisTickLabel BinnedMap BorderedViewObject Box Collection ColorSequence CrossPowerSpectrum Curve CurveCollection DataMatrix DataObject DataObjectCollection DataSource DataSourceCollection DataVector Debug DebugLog DebugLogEntry Document Ellipse ELOG Equation EquationCollection Extension ExtensionCollection File Group Histogram HistogramCollection Image Kst Label Legend Line Matrix MatrixCollection Object ObjectCollection Picture Plot PlotCollection PlotLabel Plugin PluginCollection PluginIO PluginIOCollection PluginManager PluginModule PluginModuleCollection Point PowerSpectrum PowerSpectrumCollection Scalar ScalarCollection Size Spectrogram SpectrogramCollection String StringCollection TimeInterpretation Vector VectorCollection VectorView ViewObject ViewObjectCollection Window WindowCollection Class: Arrow A customizable arrow graphic. Inherits: Line Collection class: ViewObjectCollection Constructors: Arrow ( parent ) Arrow ( window ) Properties: fromArrow toArrow fromArrowScaling toArrowScaling <para/> <sect3 id="constructor_Arrow_1"> <title>Arrow ( <link linkend="class_ViewObject">ViewObject</link> parent ) ViewObject parent - The parent to place the new arrow in. May also be a string containing the name of an existing ViewObject. Creates a new arrow and places it in the ViewObject parent. Arrow ( <link linkend="class_Window">Window</link> window ) Window window - The window to place the new arrow in. May also be a string containing the name of an existing Window. Creates a new arrow and places it in the Window window. boolean fromArrow True if the arrow has an arrow at the start point. boolean toArrow True if the arrow has an arrow at the end point. number fromArrowScaling Scale size of the arrow at the start point. number toArrowScaling Scale size of the arrow at the end point. Class: Axis A class representing a plot axis. Methods: scaleAuto ( ) scaleAutoSpikeInsensitive ( ) scaleExpression ( minExp, maxExp ) scaleRange ( min, max ) Properties: log suppressed oppositeSuppressed offsetMode reversed majorGridLines minorGridLines transformation innerTicks outerTicks label type majorGridColor minorGridColor minorTickCount majorTickDensity scaleMode interpretation title tickLabel <para/> <sect3 id="method_Axis_1"> <title>void scaleAuto ( ) Sets the scale mode to Auto. void scaleAutoSpikeInsensitive ( ) Sets the scale mode to Auto Spike Insensitive. void scaleExpression ( string minExp, string maxExp ) string minExp - The expression for the minimum of the scale. string maxExp - The expression for the maximum of the scale. Sets the scale mode to Expression. void scaleRange ( number min, number max ) number min - The value for the minimum of the scale. number max - The value for the maximum of the scale. Sets the scale mode to Fixed and sets the range. boolean log True if the axis is in logarithm mode. boolean suppressed True if this axis is suppressed. boolean oppositeSuppressed True if the opposite axis is suppressed. (Right X or top Y) boolean offsetMode True if this axis is in base + offset mode. boolean reversed True if this axis is reversed. boolean majorGridLines True if this axis shows major grid lines. boolean minorGridLines True if this axis shows minor grid lines. string transformation The transformation expression for this axis. boolean innerTicks True if tick marks are displayed inside the plot. boolean outerTicks True if tick marks are displayed outside the plot. string label The label for this axis. string type [Read-Only] The type of axis - X or Y presently. string majorGridColor The color for the major grid lines. string minorGridColor The color for the minor grid lines. number minorTickCount The number of minor ticks between two major ticks. The special value -1 forces Kst to determine this automatically. number majorTickDensity The density of major tick markers along this axis. Value must be one of: 0 - Coarse 1 - Default 2 - Fine 3 - Very Fine number scaleMode [Read-Only] The type of scaling done on the axis. Value is one of: 0 - Auto 1 - All Curves (By Midpoint) 2 - Fixed 3 - Auto Up (Only Scales Upward) 4 - Auto (Spike Insensitive) 5 - Auto (obsolete, same as 0) 6 - Expression Based <link linkend="class_TimeInterpretation">TimeInterpretation</link> interpretation [Read-Only] The method with which the axis is interpreted and times are displayed. <link linkend="class_AxisLabel">AxisLabel</link> title The label for this axis. <link linkend="class_AxisTickLabel">AxisTickLabel</link> tickLabel The tick label for this axis. Class: AxisLabel A class representing a plot axis label. Properties: text font fontSize type <para/> <sect3 id="property_AxisLabel_1"> <title>string text Contains the text contents of the label. This may include scalar references of the form [scalar_name] and some basic LaTeX. string font Used to set or get the current font used for the label. number fontSize Contains the size of the font used to draw the label. string type [Read-Only] The type of axis - X or Y presently. Class: AxisTickLabel A class representing a plot axis tick label. Properties: font fontSize rotation type <para/> <sect3 id="property_AxisTickLabel_1"> <title>string font Used to set or get the current font used for the label. number fontSize Contains the size of the font used to draw the label. number rotation Contains the rotation angle of the label. Rotation is clockwise from normal and is stored in degrees. string type [Read-Only] The type of axis - X or Y presently. Class: BinnedMap This class represents a binned map object in Kst. Inherits: DataObject Methods: validate ( ) Properties: x y z binnedMap hitsMap xFrom xTo yFrom yTo nX nY autobin valid <para/> <sect3 id="method_BinnedMap_1"> <title>void validate ( ) Validates the plugin. <link linkend="class_Vector">Vector</link> x Contains the x vector. <link linkend="class_Vector">Vector</link> y Contains the y vector. <link linkend="class_Vector">Vector</link> z Contains the z vector. string binnedMap Contains the name of binned map matrix. string hitsMap Contains the name of the hits map matrix. <link linkend="class_Scalar">Scalar</link> xFrom Contains the from value of the x vector. <link linkend="class_Scalar">Scalar</link> xTo Contains the to value of the x vector. <link linkend="class_Scalar">Scalar</link> yFrom Contains the from value of the y vector. <link linkend="class_Scalar">Scalar</link> yTo Contains the to value of the y vector. <link linkend="class_Scalar">Scalar</link> nX Contains the number of x bins. <link linkend="class_Scalar">Scalar</link> nY Contains the number of y bins. <link linkend="class_Scalar">Scalar</link> autobin Contains the autobin setting. Zero for no auto-binning and non-zero for auto-binning. boolean valid [Read-Only] Returns true if all the inputs and outputs of the binned map have been set. Class: BorderedViewObject Represents some objects in a Kst window. This is an abstract object and may not be instantiated directly. It has several properties not in regular ViewObjects including margins, padding, and a border. Inherits: ViewObject Collection class: ViewObjectCollection Properties: padding margin borderWidth borderColor <para/> <sect3 id="property_BorderedViewObject_1"> <title>number padding The number of pixels between the border and the contents. number margin The number of pixels between the edge of the object and the border. number borderWidth The width in pixels of the border. string borderColor The border color for this object. Class: Box A customizable box graphic. Inherits: ViewObject Collection class: ViewObjectCollection Constructors: Box ( parent ) Box ( window ) Properties: xRound yRound cornerStyle borderWidth borderColor <para/> <sect3 id="constructor_Box_1"> <title>Box ( <link linkend="class_ViewObject">ViewObject</link> parent ) ViewObject parent - The parent to place the new box in. May also be a string containing the name of an existing ViewObject. Creates a new box and places it in the ViewObject parent. Box ( <link linkend="class_Window">Window</link> window ) Window window - The window to place the new box in. May also be a string containing the name of an existing Window. Creates a new box and places it in the Window window. number xRound The roundness of the corners in the X dimension. Must be an integer between 0 and 99. number yRound The roundness of the corners in the Y dimension. Must be an integer between 0 and 99. number cornerStyle The style to draw the corners of the box. 0 - Miter (default) 1 - Bevel 2 - Round number borderWidth The width in pixels of the border. string borderColor The border color for this object. Class: Collection This is the generic collection class used by Kst to store lists of objects. It behaves mostly like an array in JavaScript. At this time indices are read-only. In addition, if a collection is read-only, mutator methods will throw exceptions. Iteration looks something like this: Methods: append ( newObj ) prepend ( newObj ) remove ( n ) remove ( obj ) clear ( ) Properties: length readOnly <para/> <sect3 id="method_Collection_1"> <title>void append ( <link linkend="class_Object">Object</link> newObj ) Object newObj - The new object to append to the collection. Appends a new object to the end of the collection. void prepend ( <link linkend="class_Object">Object</link> newObj ) Object newObj - The new object to prepend to the collection. Prepends a new object to the start of the collection. void remove ( number n ) number n - The index of the entry to remove. Removes an entry from the collection. void remove ( <link linkend="class_Object">Object</link> obj ) Object obj - The object to remove. Removes an object from the collection. void clear ( ) Clears the collection, removing all entries. number length [Read-Only] The number of items in the collection. Items are ordered 0..(length - 1) so it is easy to iterate. boolean readOnly [Read-Only] True if this is a read-only collection. Class: ColorSequence Provides access to the Kst color sequence used for coloring curves. Constructors: ColorSequence ( ) Methods: next ( [previous] ) tooClose ( firstColor, secondColor ) <para/> <sect3 id="constructor_ColorSequence_1"> <title>ColorSequence ( ) Default constructor. Creates a new color sequence object. string next ( [string previous] ) string previous - The previous color in the color sequence you are following. Not necessary. [OPTIONAL] Returns the next color in the color sequence. boolean tooClose ( string firstColor, string secondColor ) string firstColor - The first of two colors to compare. string secondColor - The second of two colors to compare. Returns true if colors are too close. Class: CrossPowerSpectrum This class represents a cross power spectrum object in Kst. Inherits: DataObject Methods: validate ( ) Properties: v1 v2 length sample real imaginary frequency valid <para/> <sect3 id="method_CrossPowerSpectrum_1"> <title>void validate ( ) Validates the plugin. <link linkend="class_Vector">Vector</link> v1 Contains the first vector. <link linkend="class_Vector">Vector</link> v2 Contains the second vector. <link linkend="class_Scalar">Scalar</link> length Contains the base 2 logarithm of the length of the cross power spectrum. Should be an integer >= 2. <link linkend="class_Scalar">Scalar</link> sample Contains the sample rate. string real Contains the name of the output vector holding the real part of the cross power spectrum. string imaginary Contains the name of the output vector holding the imaginary part of the cross power spectrum. string frequency Contains the name of the output vector holding the frequencies of the cross power spectrum. boolean valid [Read-Only] Returns true if all the inputs and outputs of the cross power spectrum have been set. Class: Curve Represents a curve formed from an X and a Y vector. Inherits: DataObject Collection class: CurveCollection Constructors: Curve ( x, y [, xError [, yError [, xMinusError [, yMinusError]]]] ) Curve ( hs ) Methods: point ( index ) xErrorPoint ( index ) yErrorPoint ( index ) xMinusErrorPoint ( index ) yMinusErrorPoint ( index ) Properties: color xVector yVector xErrorVector yErrorVector xMinusErrorVector xMinusErrorVector samplesPerFrame ignoreAutoScale hasPoints hasLines hasBars lineWidth pointStyle lineStyle barStyle pointDensity topLabel xLabel yLabel <para/> <sect3 id="constructor_Curve_1"> <title>Curve ( <link linkend="class_Vector">Vector</link> x, <link linkend="class_Vector">Vector</link> y [, <link linkend="class_Vector">Vector</link> xError [, <link linkend="class_Vector">Vector</link> yError [, <link linkend="class_Vector">Vector</link> xMinusError [, <link linkend="class_Vector">Vector</link> yMinusError]]]] ) Vector x - The X vector for the curve. Can be specified as a string containing the tag name of an existing vector, or as a vector object. Vector y - The Y vector for the curve. Can be specified as a string containing the tag name of an existing vector, or as a vector object. Vector xError - The X error bar vector for the curve. Can be specified as a string containing the tag name of an existing vector, or as a vector object. [OPTIONAL]Vector yError - The Y error bar vector for the curve. Can be specified as a string containing the tag name of an existing vector, or as a vector object. [OPTIONAL]Vector xMinusError - The X minus error bar vector for the curve. Can be specified as a string containing the tag name of an existing vector, or as a vector object. [OPTIONAL]Vector yMinusError - The Y minus error bar vector for the curve. Can be specified as a string containing the tag name of an existing vector, or as a vector object. [OPTIONAL] Main constructor for Curve class. Constructing a new curve automatically adds it to the data collection of Kst. Curve ( <link linkend="class_Histogram">Histogram</link> hs ) Histogram hs - Creates a curve from a histogram. Constructor for Curve class. Allows a curve to be simply created from a Histogram class. <link linkend="class_Point">Point</link> point ( number index ) number index - The index of the point to retrieve the coordinates for. Starts at 0. Retrieve the coordinates for a given point in the curve. Returns an invalid point if that index does not exist. <link linkend="class_Point">Point</link> xErrorPoint ( number index ) number index - The index of the point to retrieve the coordinates for. Starts at 0. Retrieve the coordinates for a given point in the X error bars. Returns an invalid point if that index does not exist. <link linkend="class_Point">Point</link> yErrorPoint ( number index ) number index - The index of the point to retrieve the coordinates for. Starts at 0. Retrieve the coordinates for a given point in the Y error bars. Returns an invalid point if that index does not exist. <link linkend="class_Point">Point</link> xMinusErrorPoint ( number index ) number index - The index of the point to retrieve the coordinates for. Starts at 0. Retrieve the coordinates for a given point in the X minus error bars. Returns an invalid point if that index does not exist. <link linkend="class_Point">Point</link> yMinusErrorPoint ( number index ) number index - The index of the point to retrieve the coordinates for. Starts at 0. Retrieve the coordinates for a given point in the Y minus error bars. Returns an invalid point if that index does not exist. string color The color of the curve. Stored in the form "#RRGGBB" as hex values. This property can also be set with English strings such as "blue". <link linkend="class_Vector">Vector</link> xVector The X axis vector for the curve. <link linkend="class_Vector">Vector</link> yVector The Y axis vector for the curve. <link linkend="class_Vector">Vector</link> xErrorVector The X axis error vector for the curve. <link linkend="class_Vector">Vector</link> yErrorVector The Y axis error vector for the curve. <link linkend="class_Vector">Vector</link> xMinusErrorVector The X axis negative error vector for the curve. <link linkend="class_Vector">Vector</link> xMinusErrorVector The X axis negative error vector for the curve. number samplesPerFrame [Read-Only] The number of samples per frame for the curve. boolean ignoreAutoScale If true, this curve ignores auto scale. boolean hasPoints If true, points are plotted for this curve. boolean hasLines If true, lines are drawn for this curve. boolean hasBars If true, bars are drawn for this curve. number lineWidth Sets the line width for this curve when lines are drawn. number pointStyle Sets the point style for this curve when points are drawn. 0 - Cross 1 - Hollow box 2 - Hollow circle 3 - Filled circle 4 - Inverted hollow triangle 5 - Hollow triangle 6 - Filled box 7 - Plus 8 - Asterisk 9 - Inverted filled triangle 10 - Filled triangle 11 - Hollow diamond 12 - Filled diamond 13 - Point number lineStyle Sets the line style for this curve when lines are drawn. 0 - Soild 1 - Dash 2 - Dot 3 - Dash Dot 4 - Dash Dot Dot number barStyle Sets the bar style for this curve when bars are drawn. 0 - Lines 1 - Solid number pointDensity Sets the point density for this curve when points are plotted. 0 - Draw all points 1 - High density 2 - Medium density 3 - Low density string topLabel [Read-Only] The top label suggestion for this curve. string xLabel [Read-Only] The X-axis label suggestion for this curve. string yLabel [Read-Only] The Y-axis label suggestion for this curve. Class: CurveCollection An array of curves. Inherits: Collection <para/> </sect2> </sect1> <sect1 id="class_DataMatrix"> <title>Class: DataMatrix A matrix object loaded from a data source. Inherits: Matrix Constructors: DataMatrix ( source, field [, xStart, yStart, xN, yN [, skip [, ave]]] ) Methods: reload ( ) changeFile ( source ) change ( xStart, yStart, xCount, yCount [, skip [, ave]] ) Properties: valid skip boxcar xReadToEnd yReadToEnd xCountFromEnd yCountFromEnd skipLength field dataSource <para/> <sect3 id="constructor_DataMatrix_1"> <title>DataMatrix ( <link linkend="class_DataSource">DataSource</link> source, string field [, number xStart, number yStart, number xN, number yN [, number skip [, boolean ave]]] ) DataSource source - The DataSource to load data from. This may be a string containing the url of the DataSource to load. If so, it will attempt to reuse an existing DataSource instance, or fall back to a new DataSource object. It may also be specified as a DataSource object. string field - The field to load from the source. number xStart - The x frame to start reading from. [OPTIONAL]number yStart - The y frame to start reading from. number xN - The number of x frames to read. number yN - The number of y frames to read. number skip - The number of samples to skip by. [OPTIONAL]boolean ave - Set to true to do boxcar filtering. [OPTIONAL] void reload ( ) void changeFile ( <link linkend="class_DataSource">DataSource</link> source ) DataSource source - The DataSource to switch to. Switches this DataMatrix to a different DataSource. void change ( number xStart, number yStart, number xCount, number yCount [, number skip [, boolean ave]] ) number xStart - The x starting frame. number yStart - The y starting frame. number xCount - The number of x frames to read. number yCount - The number of y frames to read. number skip - The number of frames to skip by. [OPTIONAL]boolean ave - True to boxcar filter. [OPTIONAL] Changes the sequence of data that is read in by this matrix. boolean valid [Read-Only] True if the data matrix is valid. boolean skip [Read-Only] True if the matrix should skip by skipLength samples while reading from the data source. boolean boxcar [Read-Only] True if the matrix should be boxcar filtered. boolean xReadToEnd [Read-Only] If true, the matrix is read to the end of the source in the x dimension. boolean yReadToEnd [Read-Only] If true, the matrix is read to the end of the source in the y dimension. boolean xCountFromEnd [Read-Only] If true, the matrix reads only a maximum number of samples from the end of the source in the x dimension. boolean yCountFromEnd [Read-Only] If true, the matrix reads only a maximum number of samples from the end of the source in the y dimension. number skipLength [Read-Only] The number of samples to skip by. string field [Read-Only] The field being read from the data source to create this matrix. <link linkend="class_DataSource">DataSource</link> dataSource [Read-Only] The data source object used by this DataMatrix. Class: DataObject The abstract base class for all Kst data objects. Inherits: Object Collection class: DataObjectCollection Methods: convertTo ( type ) Properties: type <para/> <sect3 id="method_DataObject_1"> <title><link linkend="class_DataObject">DataObject</link> convertTo ( string type ) string type - The type to attempt to convert this object to. Attempts to convert this DataObject to a different type. The object must be derived from this type at some level. Null is returned if it is not possible to convert to the requested type. string type [Read-Only] The type of data object this is. Class: DataObjectCollection An array of DataObjects. Inherits: Collection <para/> </sect2> </sect1> <sect1 id="class_DataSource"> <title>Class: DataSource An object that represents a data file that is understood by Kst. Inherits: Object Collection class: DataSourceCollection Constructors: DataSource ( url [, type] ) Methods: isValidField ( ) fieldList ( ) reset ( ) matrixList ( ) samplesPerFrame ( field ) frameCount ( [field] ) setConfiguration ( setting, setting ) configuration ( setting ) Properties: valid empty completeFieldList fileName fileType source metaData <para/> <sect3 id="constructor_DataSource_1"> <title>DataSource ( string url [, string type] ) string url - The filename or URL to load. string type - The name of the data source plugin to use. [OPTIONAL] Creates a new DataSource object. If the url cannot be opened and read, isValid will be false. boolean isValidField ( ) Returns if the field is valid or not. StringArray fieldList ( ) Generates a list of the fields available from this source. void reset ( ) Resets the data source. StringArray matrixList ( ) Generates a list of the matrices available from this source. number samplesPerFrame ( string field ) string field - A field name to get the number of samples per frame for. This is the same for every field in some sources, but different in others. The number of samples per frame for this field or source. number frameCount ( [string field] ) string field - An optional field name to get the number of frames for. This is the same for every field in some sources, but different in others. [OPTIONAL] Gets the number of frames for the source, or the given field if it is specified. boolean setConfiguration ( string setting, string setting ) string setting - Gives the setting name to set the value of. string setting - Gives the value of the setting. Sets a configuration setting of the data source. string configuration ( string setting ) string setting - Gives the setting name to retrive the value of. Gets a configuration setting of the data source. boolean valid [Read-Only] True if the data source is valid. boolean empty [Read-Only] True if the data source is empty. boolean completeFieldList [Read-Only] True if the field list is complete. string fileName [Read-Only] Name of the file. string fileType [Read-Only] The type (format) of the file, such as ASCII. string source [Read-Only] The name of the data source. StringArray metaData [Read-Only] Any metadata associated with the data source. This is an associative array of form metaData["key"] = "value". Class: DataSourceCollection An array of DataSources. Inherits: Collection <para/> </sect2> </sect1> <sect1 id="class_DataVector"> <title>Class: DataVector A vector object loaded from a data source. Inherits: Vector Constructors: DataVector ( source, field [, start [, n [, skip [, ave]]]] ) Methods: reload ( ) changeFile ( source ) changeFrames ( start, count [, skip [, ave]] ) Properties: valid skip boxcar readToEnd countFromEnd skipLength startFrame startFrameRequested frames framesRequested samplesPerFrame field dataSource <para/> <sect3 id="constructor_DataVector_1"> <title>DataVector ( <link linkend="class_DataSource">DataSource</link> source, string field [, number start [, number n [, number skip [, boolean ave]]]] ) DataSource source - The DataSource to load data from. This may be a string containing the url of the DataSource to load. If so, it will attempt to reuse an existing DataSource instance, or fall back to a new DataSource object. It may also be specified as a DataSource object. string field - The field to load from the source. number start - The frame to start reading from. [OPTIONAL]number n - The number of frames to read. [OPTIONAL]number skip - The number of samples to skip by. [OPTIONAL]boolean ave - Set to true to do boxcar filtering. [OPTIONAL] void reload ( ) void changeFile ( <link linkend="class_DataSource">DataSource</link> source ) DataSource source - The DataSource to switch to. Switches this DataVector to a different DataSource. void changeFrames ( number start, number count [, number skip [, boolean ave]] ) number start - The starting frame. number count - The number of frames to read. number skip - The number of frames to skip by. [OPTIONAL]boolean ave - True to boxcar filter. [OPTIONAL] Changes the sequence of data that is read in by this vector. boolean valid [Read-Only] True if the data vector is valid. boolean skip [Read-Only] True if the vector should skip by skipLength samples while reading from the data source. boolean boxcar [Read-Only] True if the vector should be boxcar filtered. boolean readToEnd [Read-Only] If true, the vector is read to the end of the source. boolean countFromEnd [Read-Only] If true, the vector reads only a maximum number of samples from the end of the source. number skipLength [Read-Only] The number of samples to skip by. number startFrame [Read-Only] The starting frame number. number startFrameRequested [Read-Only] The requested starting frame number. May not be the actual startFrame. number frames [Read-Only] The number of frames read from the source. number framesRequested [Read-Only] The number of frames requested to be read from the source. May not be the actual frames. number samplesPerFrame [Read-Only] The number of samples per frame for the associated data source. string field [Read-Only] The field being read from the data source to create this vector. <link linkend="class_DataSource">DataSource</link> dataSource [Read-Only] The data source object used by this DataVector. Class: Debug A reference to the debug and logging subsystem of Kst. Methods: warning ( message ) error ( message ) notice ( message ) debug ( message ) clear ( ) clearNewError ( ) Properties: log newError version revision <para/> <sect3 id="method_Debug_1"> <title>void warning ( string message ) string message - Logs a warning message to the Kst log. void error ( string message ) string message - Logs an error message to the Kst log. void notice ( string message ) string message - Logs a notice to the Kst log. void debug ( string message ) string message - Logs a debug message to the Kst log. void clear ( ) Clears the Kst log. void clearNewError ( ) Clears the new error flag. <link linkend="class_DebugLog">DebugLog</link> log [Read-Only] Provides access to the Kst log contents. boolean newError [Read-Only] Return the value of the new error flag. string version [Read-Only] Return the version of Kst. string revision [Read-Only] Return the revision of Kst. Class: DebugLog A reference to the Kst debug log. This object is an array of the entries in the debug log. It cannot be modified. The length of the array is the number of entries, and each entry is a DebugLogEntry object. Constructors: DebugLog ( ) Properties: length text lengthNotices textNotices lengthWarnings textWarnings lengthErrors textErrors lengthDebugs textDebugs <para/> <sect3 id="constructor_DebugLog_1"> <title>DebugLog ( ) Create a new DebugLog object which is a reference to the Kst debug log. number length [Read-Only] The number of entries in the log. string text [Read-Only] The text contents of the log as a single large string with carriage returns between entries. number lengthNotices [Read-Only] The number of notices in the log. string textNotices [Read-Only] The text contents of the log notices as a single large string with carriage returns between entries. number lengthWarnings [Read-Only] The number of warnings in the log. string textWarnings [Read-Only] The text contents of the log warnings as a single large string with carriage returns between entries. number lengthErrors [Read-Only] The number of errors in the log. string textErrors [Read-Only] The text contents of the log errors as a single large string with carriage returns between entries. number lengthDebugs [Read-Only] The number of debug messages in the log. string textDebugs [Read-Only] The text contents of the log debug messages as a single large string with carriage returns between entries. Class: DebugLogEntry An entry in the Kst debug log. Properties: text date level <para/> <sect3 id="property_DebugLogEntry_1"> <title>string text [Read-Only] Contains the text of this entry. date date [Read-Only] Contains the timestamp of this entry. string level [Read-Only] Contains the log level for this entry. N - Notice D - Debug W - Warning E - Error A single space ' ' indicates an unknown entry type. Class: Document A pointer to a Kst document. Typically accessed via the global Kst object via Kst.document. Methods: save ( [filename] ) newDocument ( ) load ( filename ) Properties: text name modified <para/> <sect3 id="method_Document_1"> <title>void save ( [string filename] ) string filename - An optional filename to save to. If not provided, it will be saved to the current filename or the user will be prompted. [OPTIONAL] Saves the current Kst session to disk. void newDocument ( ) Clears the current Kst session and starts a new one. boolean load ( string filename ) string filename - The filename for a Kst file to load. Loads a new Kst file into Kst. string text [Read-Only] The XML text of the current session in Kst-file form. string name The filename for the current Kst session. boolean modified True if the document has been modified but not saved. Class: Ellipse A customizable ellipse graphic. Inherits: ViewObject Collection class: ViewObjectCollection Constructors: Ellipse ( parent ) Ellipse ( window ) Properties: borderWidth borderColor <para/> <sect3 id="constructor_Ellipse_1"> <title>Ellipse ( <link linkend="class_ViewObject">ViewObject</link> parent ) ViewObject parent - The parent to place the new ellipse in. May also be a string containing the name of an existing ViewObject. Creates a new ellipse and places it in the ViewObject parent. Ellipse ( <link linkend="class_Window">Window</link> window ) Window window - The window to place the new ellipse in. May also be a string containing the name of an existing Window. Creates a new ellipse and places it in the Window window. number borderWidth The width of the border of the ellipse. string borderColor The color of the border of the ellipse. Class: ELOG An object that represents the interface to an ELOG server. Constructors: ELOG ( ) Methods: submit ( ) addAttachment ( attachment ) clearAttachments ( ) addAttribute ( attribute, attributeValue ) removeAttribute ( attribute ) clearAttributes ( ) Properties: hostname port logbook username password writePassword text encodedHTML suppressEmailNotification includeCapture captureWidth captureHeight includeConfiguration includeDebugInfo <para/> <sect3 id="constructor_ELOG_1"> <title>ELOG ( ) Interface to an ELOG server. void submit ( ) Submits the ELOG entry. void addAttachment ( string attachment ) string attachment - The name of the attachment. Adds an attachment to the ELOG entry. void clearAttachments ( ) Clears the list of attachments in the ELOG entry. void addAttribute ( string attribute, string attributeValue ) string attribute - The name of the attribute to be added to the ELOG entry. string attributeValue - The value of the attribute to be added to the ELOG entry. Adds an attribute to the ELOG entry. void removeAttribute ( string attribute ) string attribute - The name of the attribute to be removed from the ELOG entry. Removes an attribute from the ELOG entry. void clearAttributes ( ) Clears the list of attributes in the ELOG entry. string hostname The hostname of the ELOG server. number port The port number of the ELOG server. string logbook A weblog made available by the ELOG server. string username Username. string password Password. string writePassword The write password. string text Text. boolean encodedHTML The message is HTML encoded. boolean suppressEmailNotification If true email notification is suppressed. boolean includeCapture If true an image capture of the Kst session is included in the ELOG entry. number captureWidth The width of the image capture to be included in the ELOG entry. number captureHeight The height of the image capture to be included in the ELOG entry. boolean includeConfiguration If true a capture of the Kst session is included in the ELOG entry. boolean includeDebugInfo If true a capture of the Kst debug information is included in the ELOG entry. Class: Equation This object represents an equation object in Kst. It is interpreted using Kst's internal equation interpreter, and not the JavaScript interpreter. It should be considerably faster than the JavaScript interpreter. Inherits: DataObject Collection class: EquationCollection Constructors: Equation ( equation, xVector [, interpolate] ) Equation ( equation, x0, x1, n ) Properties: equation valid xVector yVector <para/> <sect3 id="constructor_Equation_1"> <title>Equation ( string equation, <link linkend="class_Vector">Vector</link> xVector [, boolean interpolate] ) string equation - The text of the equation to interpret. Vector xVector - The X axis (input) vector to use. The symbolic variable x; represents the value at the current index in this vector. A text string representing the name of an existing vector may also be used here. boolean interpolate - If true, the equation interpreter will interoplate to the highest resolution vector. This is the default behavior. [OPTIONAL] The default constructor to create an equation object. Equation ( string equation, number x0, number x1, number n ) string equation - The text of the equation to interpret. number x0 - The first value of the generated X (input) vector. number x1 - The last value of the generate X (input) vector. number n - The number of values in the generated input vector. A utility constructor which generates an X vector implicitly. string equation The text of the equation. See the Kst documentation for more information on what the internal equation interpreter supports. boolean valid [Read-Only] True if the equation object is valid. If false, any values obtained from the yVector should be considered meaningless. <link linkend="class_Vector">Vector</link> xVector [Read-Only] The X vector (input vector) for the equation. <link linkend="class_Vector">Vector</link> yVector [Read-Only] The Y vector (output vector) for the equation. Class: EquationCollection An array of Equations. Inherits: Collection <para/> </sect2> </sect1> <sect1 id="class_Extension"> <title>Class: Extension A class representing an extension in Kst. Collection class: ExtensionCollection Methods: load ( ) unload ( ) Properties: name loaded <para/> <sect3 id="method_Extension_1"> <title>boolean load ( ) Loads this extension into Kst. void unload ( ) Unloads this extension if it is loaded. string name [Read-Only] The name of this extension. boolean loaded [Read-Only] True if this extension is presently loaded. Class: ExtensionCollection An array of Kst Extension objects. Inherits: Collection <para/> </sect2> </sect1> <sect1 id="class_File"> <title>Class: File An object that represents a file. Constructors: File ( name ) Methods: open ( ) close ( ) readLine ( [length] ) Properties: name size exists <para/> <sect3 id="constructor_File_1"> <title>File ( string name ) string name - Name of the file to be opened. Constructs a file with the given name. void open ( ) Opens the file. void close ( ) Closes the file. string readLine ( [number length] ) number length - Maximum length of string to return [OPTIONAL] Reads a line from the file. string name The name of the file. <link linkend="class_Size">Size</link> size The size of the file. boolean exists True if the underlying file exists. Class: Group A customizable group object. Inherits: ViewObject Collection class: ViewObjectCollection Constructors: Group ( parent ) Group ( window ) Methods: append ( newObj ) prepend ( newObj ) ungroup ( ) <para/> <sect3 id="constructor_Group_1"> <title>Group ( <link linkend="class_ViewObject">ViewObject</link> parent ) ViewObject parent - The parent to place the new arrow in. May also be a string containing the name of an existing ViewObject. Creates a new arrow and places it in the ViewObject parent. Group ( <link linkend="class_Window">Window</link> window ) Window window - The window to place the new arrow in. May also be a string containing the name of an existing Window. Creates a new arrow and places it in the Window window. void append ( <link linkend="class_Object">Object</link> newObj ) Object newObj - The new object to append to the collection. Appends a new object to the end of the collection. void prepend ( <link linkend="class_Object">Object</link> newObj ) Object newObj - The new object to prepend to the collection. Prepends a new object to the start of the collection. void ungroup ( ) Removes all objects from the collection. Class: Histogram A class representing a histogram object in Kst. Inherits: DataObject Collection class: HistogramCollection Constructors: Histogram ( vector [, xMin [, xMax [, bins]]] ) Methods: setVector ( vector ) setRange ( from, to ) Properties: realTimeAutoBin normalization bins xMin xMax xVector yVector <para/> <sect3 id="constructor_Histogram_1"> <title>Histogram ( <link linkend="class_Vector">Vector</link> vector [, number xMin [, number xMax [, number bins]]] ) Vector vector - The input vector for the histogram. May also be specified by the tagName for an existing vector. number xMin - The minimum X value. Default is -10. [OPTIONAL]number xMax - The maximum X value. Default is 10. [OPTIONAL]number bins - The number of bins to use. Default is 60. [OPTIONAL] Creates a new histogram with the defined properties. void setVector ( <link linkend="class_Vector">Vector</link> vector ) Vector vector - The vector for the histogram to operate on. Sets the input vector for the histogram. void setRange ( number from, number to ) number from - The starting X value. number to - The ending X value. Sets the X range for the histogram. boolean realTimeAutoBin If true, the histogram automatically bins in real-time. number normalization Set the y-axis normalization. 0 - Number in bin 1 - Percent in bin 2 - Fraction in bin 3 - Peak bin = 1.0 number bins The number of bins for the histogram. number xMin [Read-Only] The minimum X value for the histogram. number xMax [Read-Only] The maximum X value for the histogram. <link linkend="class_Vector">Vector</link> xVector [Read-Only] The X-axis vector generated by the histogram. <link linkend="class_Vector">Vector</link> yVector [Read-Only] The Y-axis vector generated by the histogram. Class: HistogramCollection An array of Histograms. Inherits: Collection <para/> </sect2> </sect1> <sect1 id="class_Image"> <title>Class: Image An image object created from a matrix. Inherits: DataObject Constructors: Image ( matrix ) Methods: minMaxThreshold ( ) smartThreshold ( ) Properties: matrix map palette lowerThreshold upperThreshold autoThreshold numContours contourWeight color <para/> <sect3 id="constructor_Image_1"> <title>Image ( <link linkend="class_Matrix">Matrix</link> matrix ) Matrix matrix - The matrix for the image. Can be specified as a string containing the tag name of an existing matrix, or as a matrix object. Main constructor for Image class. Constructing a new image automatically adds it to the data collection of Kst. void minMaxThreshold ( ) Set the thresholding to the current minimum and maximum of the associated matrix. void smartThreshold ( ) Set the thresholding to automatically calculated smart values based on the current values of the the associated matrix. <link linkend="class_Matrix">Matrix</link> matrix The matrix associated with the image. number map The map type of the image. 0 - Color map 1 - Contour map 2 - Color map and contour map string palette The name of the palette associated with the image color map. number lowerThreshold The lower threshold associated with the map. number upperThreshold The upper threshold associated with the map. boolean autoThreshold If true, automatic thresholding is enabled. number numContours The number of contour levels if the contour map is enabled. number contourWeight The weight of the lines used to draw the contour map, if the contour map is enabled. A value of -1 can be used for a variable contour weight. string color The color of the contours. Stored in the form "#RRGGBB" as hex values. This property can also be set with English strings such as "blue". Class: Kst The global Kst object. Accessed as Kst, this cannot be reinstantiated. Methods: loadScript ( fileName ) resetInterpreter ( ) purge ( ) Properties: dataSources scalars strings vectors matrices windows objects colors extensions document pluginManager gui <para/> <sect3 id="method_Kst_1"> <title>boolean loadScript ( string fileName ) string fileName - The file to load the script from. Loads a script file from disk and runs it. void resetInterpreter ( ) Resets the KstScript interpreter. All variables will be lost. void purge ( ) Purges unused objects in Kst. The has the same behavior as the purge button in the data manager. <link linkend="class_DataSourceCollection">DataSourceCollection</link> dataSources [Read-Only] The list of all loaded data sources. <link linkend="class_ScalarCollection">ScalarCollection</link> scalars [Read-Only] The list of all scalars in Kst. <link linkend="class_StringCollection">StringCollection</link> strings [Read-Only] The list of all strings in Kst. <link linkend="class_VectorCollection">VectorCollection</link> vectors [Read-Only] The list of all vectors in Kst. <link linkend="class_MatrixCollection">MatrixCollection</link> matrices [Read-Only] The list of all matrices in Kst. <link linkend="class_WindowCollection">WindowCollection</link> windows [Read-Only] The list of all Kst windows in this process. <link linkend="class_DataObjectCollection">DataObjectCollection</link> objects [Read-Only] The list of all data objects in Kst. <link linkend="class_ColorSequence">ColorSequence</link> colors [Read-Only] A reference to the Kst color sequence in its current state. <link linkend="class_ExtensionCollection">ExtensionCollection</link> extensions [Read-Only] The list of all extensions Kst can find installed on the system. <link linkend="class_Document">Document</link> document [Read-Only] An object that provides access to the current Kst document along with various utility functions. <link linkend="class_PluginManager">PluginManager</link> pluginManager [Read-Only] A reference to the plugin management subsystem of Kst. QWidget gui [Read-Only] A reference to the Kst GUI. This is implemented using KJSEmbed. The GUI is dynamic and may change between releases or even while Kst is running. Class: Label A text label. Inherits: BorderedViewObject Collection class: ViewObjectCollection Constructors: Label ( parent ) Label ( window ) Methods: adjustSizeForText ( ) Properties: text font fontSize justification rotation dataPrecision interpreted scalarReplacement autoResize [Obsolete] <para/> <sect3 id="constructor_Label_1"> <title>Label ( <link linkend="class_ViewObject">ViewObject</link> parent ) ViewObject parent - The parent to place the new label in. May also be a string containing the name of an existing ViewObject. Creates a new label and places it in the ViewObject parent. Label ( <link linkend="class_Window">Window</link> window ) Window window - The window to place the new label in. May also be a string containing the name of an existing Window. Creates a new label and places it in the Window window. void adjustSizeForText ( ) Adjusts the size of the label to fit the text. string text Contains the text contents of the label. This may include carriage returns (\n), scalar references of the form [scalar_name], and some basic LaTeX. string font Used to set or get the current font used for the label. number fontSize Contains the size of the font used to draw the label. number justification The justification for the label. This is a bit field with two segments, one for horizontal and one for vertical justification. The values are as follows: 0 - Justify None 1 - Justify Left / Top 2 - Justify Right / Bottom 3 - Justify Center Set the low order 8 bits to one of these values to control horizontal justification. Set the next 8 bits to one of these to control vertical justification. Example: number rotation Contains the rotation angle of the label. Rotation is clockwise from normal and is stored in degrees. number dataPrecision Contains the number of digits of precision to display data values in the label. Restricted to a value between 0 and 16 inclusive. boolean interpreted Determines if the contents of the label should be interpreted in order to substitute LaTeX-like constructs. Default is true. boolean scalarReplacement Determines if the contents of the label should be interpreted in order to substitute variable reference constructs. Default is true. boolean autoResize [Obsolete] Automatically resizes the label to fit the text exactly. May trigger a slight move of the label. It will not automatically resize if the user resizes it manually via the size property or layout mode. Class: Legend A plot legend. Inherits: BorderedViewObject Collection class: ViewObjectCollection Constructors: Legend ( parent ) Legend ( window ) Methods: addCurve ( curve ) removeCurve ( curve ) Properties: font fontSize textColor vertical curves title <para/> <sect3 id="constructor_Legend_1"> <title>Legend ( <link linkend="class_ViewObject">ViewObject</link> parent ) ViewObject parent - The parent to place the new legend in. May also be a string containing the name of an existing ViewObject. Creates a new legend and places it in the ViewObject parent. Legend ( <link linkend="class_Window">Window</link> window ) Window window - The window to place the new legend in. May also be a string containing the name of an existing Window. Creates a new legend and places it in the Window window. void addCurve ( string curve ) string curve - The curve to be added. This can be either the name of the curve or a reference to the curve. Adds the curve to the legend. Throws: GeneralError - Throws this exception if the curve could not be found. void removeCurve ( string curve ) string curve - The curve to be removed. This can be either the name of the curve or a reference to the curve. Removes the curve from the legend. Throws: GeneralError - Throws this exception if the curve could not be found. string font Used to set or get the current font used for the legend. number fontSize Contains the size of the font used to draw the legend. string textColor Contains the color of the text used to draw the legend. boolean vertical True if the legend entries are stacked vertically. <link linkend="class_CurveCollection">CurveCollection</link> curves [Read-Only] The list of curves shown in the legend. string title The title of the legend. Class: Line A customizable line graphic. Inherits: ViewObject Collection class: ViewObjectCollection Constructors: Line ( parent ) Line ( window ) Properties: from to width capStyle lineStyle <para/> <sect3 id="constructor_Line_1"> <title>Line ( <link linkend="class_ViewObject">ViewObject</link> parent ) ViewObject parent - The parent to place the new line in. May also be a string containing the name of an existing ViewObject. Creates a new line and places it in the ViewObject parent. Line ( <link linkend="class_Window">Window</link> window ) Window window - The window to place the new line in. May also be a string containing the name of an existing Window. Creates a new line and places it in the Window window. <link linkend="class_Point">Point</link> from The starting point of the line. <link linkend="class_Point">Point</link> to The ending point of the line. number width The width of the line. number capStyle The cap style for the line. 0 - Flat - may not cover the line ends (default) 1 - Box - may extend past line ends 2 - Rounded number lineStyle The style for the line. 0 - Solid line(default) 1 - Dashed line 2 - Dotted line 3 - Dash - dot line 4 - Dash - dot - dot line Class: Matrix Represents a matrix of any type in Kst. Some matrices are editable, while others are not. Inherits: Object Collection class: MatrixCollection Constructors: Matrix ( ) Methods: resize ( columns, rows ) zero ( ) value ( row, column ) setValue ( row, column, value ) update ( ) Properties: editable min max mean numNew rows columns <para/> <sect3 id="constructor_Matrix_1"> <title>Matrix ( ) Default constructor creates an empty matrix. void resize ( number columns, number rows ) number columns - The new number of columns in the matrix. Should be >= 1. number rows - The new number of rows in the matrix. Should be >= 1. Resizes the matrix. Throws: GeneralError - Throws this exception if the matrix is not editable. void zero ( ) Sets all values in the matrix to zero. Throws: GeneralError - Throws this exception if the matrix is not editable. number value ( number row, number column ) number row - The row index of the matrix position to be set. number column - The column index of the matrix position to be set. Gets the value of a matrix at the given row and column indices. Throws: GeneralError - Throws this exception if the indices are out of range. void setValue ( number row, number column, number value ) number row - The row index of the matrix position to be set. number column - The column index of the matrix position to be set. number value - The value to set the specified matrix position to. Sets the value of a matrix at the given row and column indices. Throws: GeneralError - Throws this exception if the matrix is not editable or the indices are out of range. void update ( ) Updates the statistical values associated with a matrix. Throws: GeneralError - Throws this exception if the matrix is not editable. number editable [Read-Only] True if the matrix is editable by the user. This should be checked before attempting to modify a matrix in any way. number min [Read-Only] The value of the smallest sample in the matrix. number max [Read-Only] The value of the largest sample in the matrix. number mean [Read-Only] The mean value of all samples in the matrix. number numNew [Read-Only] The mean value of all samples in the matrix. number rows [Read-Only] The number of rows in the matrix. number columns [Read-Only] The number of coluns in the matrix. Class: MatrixCollection An array of Matrices. Inherits: Collection <para/> </sect2> </sect1> <sect1 id="class_Object"> <title>Class: Object Represents any object in Kst. This is an abstract object and may not be instantiated directly. Collection class: ObjectCollection Properties: tagName <para/> <sect3 id="property_Object_1"> <title>string tagName A unique identifier for this data object. Class: ObjectCollection An array of Objects. This could contain any objects that inherit from Object, but they are only immediately accessible in their pure base class form. Inherits: Collection <para/> </sect2> </sect1> <sect1 id="class_Picture"> <title>Class: Picture A customizable picture object. Inherits: BorderedViewObject Collection class: ViewObjectCollection Constructors: Picture ( parent ) Picture ( window [, url] ) Methods: load ( url ) Properties: image url refreshTimer <para/> <sect3 id="constructor_Picture_1"> <title>Picture ( <link linkend="class_ViewObject">ViewObject</link> parent ) ViewObject parent - The parent to place the new picture in. May also be a string containing the name of an existing ViewObject. Creates a new picture and places it in the ViewObject parent. Picture ( <link linkend="class_Window">Window</link> window [, string url] ) Window window - The window to place the new picture in. May also be a string containing the name of an existing Window. string url - The URL of a file to load the picture from. [OPTIONAL] Creates a new picture and places it in the Window window. boolean load ( string url ) string url - The URL to retrieve the image from. Load an image from a give url. Returns true on success. <link linkend="class_Image">Image</link> image The raw image that is being displayed. You can take a copy of this, manipulate it, then set it back to change the image. string url [Read-Only] The URL of the image if it was loaded from a file and has not been modified. number refreshTimer A timer to automatically refresh the picture. Value of 0 means the timer is disabled. Units are in seconds. Class: Plot This class represents a plot in Kst. Inherits: BorderedViewObject Collection class: PlotCollection Constructors: Plot ( window ) Methods: createLegend ( ) Properties: curves legend topLabel xAxis yAxis title tied <para/> <sect3 id="constructor_Plot_1"> <title>Plot ( <link linkend="class_Window">Window</link> window ) Window window - The window to place the new plot in. May also be a string containing the name of an existing Window. Creates a new plot and places it in the Window window. <link linkend="class_Legend">Legend</link> createLegend ( ) Creates a Legend for this plot. If a legend already exists then that one is returned. <link linkend="class_CurveCollection">CurveCollection</link> curves [Read-Only] A list of all the Curves used by the plot. <link linkend="class_Legend">Legend</link> legend [Read-Only] The Legend for this plot. May be null. string topLabel The top label for this plot. <link linkend="class_Axis">Axis</link> xAxis [Read-Only] The X-axis for this plot. <link linkend="class_Axis">Axis</link> yAxis [Read-Only] The Y-axis for this plot. <link linkend="class_PlotLabel">PlotLabel</link> title [Read-Only] The title for this plot. boolean tied True if the plot zoom state is tied. Class: PlotCollection An array of Plots. Inherits: Collection <para/> </sect2> </sect1> <sect1 id="class_PlotLabel"> <title>Class: PlotLabel A class representing a plot label. Properties: text font fontSize justification <para/> <sect3 id="property_PlotLabel_1"> <title>string text Contains the text contents of the label. This may include carriage returns (\n), scalar references of the form [scalar_name], and some basic LaTeX. string font Used to set or get the current font used for the label. number fontSize Contains the size of the font used to draw the label. number justification The horizontal justification for the label. This is a bit field. The values are as follows: 0 - Justify None 1 - Justify Left / Top 2 - Justify Right / Bottom 3 - Justify Center Class: Plugin This class represents a data plugin in Kst. It can be instantiated to create a new instance of a plugin in the Kst data collection. Inherits: DataObject Collection class: PluginCollection Constructors: Plugin ( [module] ) Methods: setInput ( index, input ) validate ( ) Properties: inputs outputs module lastError valid <para/> <sect3 id="constructor_Plugin_1"> <title>Plugin ( [<link linkend="class_PluginModule">PluginModule</link> module] ) PluginModule module - The plugin module to use for this plugin. [OPTIONAL] Main constructor for the Plugini class. New plugins are typically invalid until various properties have been set. void setInput ( number index, <link linkend="class_Object">Object</link> input ) number index - or name of the input argument to be set. Object input - argument. Sets the input argument at the specified index or name. void validate ( ) Validates the plugin. <link linkend="class_ObjectCollection">ObjectCollection</link> inputs The list of inputs to the plugin. <link linkend="class_ObjectCollection">ObjectCollection</link> outputs The list of outputs to the plugin. <link linkend="class_PluginModule">PluginModule</link> module The library or module that is used for data processing by this plugin object. string lastError [Read-Only] A string containing details of the last error that occurred while running the plugin. boolean valid [Read-Only] True if this plugin object is valid. If false, there is probably an invalid setting somewhere that needs to be corrected before it can be used. Some errors include invalid inputs or outputs, or an invalid or missing PluginModule. Class: PluginCollection An array of Plugins. Inherits: Collection <para/> </sect2> </sect1> <sect1 id="class_PluginIO"> <title>Class: PluginIO An object representing an input or output for a given plugin module. Collection class: PluginIOCollection Properties: name type subType typeObject description defaultValue <para/> <sect3 id="property_PluginIO_1"> <title>string name [Read-Only] The name of the input or output. string type [Read-Only] The data type of the input or output. string subType [Read-Only] The sub-type of the input or output, if needed. For instance, a table may have a subtype of float. string typeObject [Read-Only] The object type of the input or output. The result will be one of: Vector Scalar String Unknown - error condition string description [Read-Only] A description of the meaning of the input or output. string defaultValue [Read-Only] The default value for this input or output, if specified by the plugin. Class: PluginIOCollection An array of Plugin inputs or outputs. Inherits: Collection <para/> </sect2> </sect1> <sect1 id="class_PluginManager"> <title>Class: PluginManager A reference to Kst's plugin manager subsystem. Constructors: PluginManager ( ) Properties: modules <para/> <sect3 id="constructor_PluginManager_1"> <title>PluginManager ( ) Creates a new PluginManager referring to the Kst plugin manager. <link linkend="class_PluginModuleCollection">PluginModuleCollection</link> modules [Read-Only] A list of all PluginModules available. Class: PluginModule Represents a plugin module in Kst. This is not an instance of a plugin, but a reference to the actual plugin itself. It is typically used to instantiate a plugin object. Collection class: PluginModuleCollection Properties: usesLocalData isFit isFilter name readableName author description version inputs outputs <para/> <sect3 id="property_PluginModule_1"> <title>boolean usesLocalData [Read-Only] If true, the plugin makes use of persistant local storage. boolean isFit [Read-Only] If true, this plugin is a fit for a curve. boolean isFilter [Read-Only] If true, this plugin is a filter for a vector. string name [Read-Only] Represents the short name of the plugin. string readableName [Read-Only] Contains a long name for the plugin suitable for display in a user interface. string author [Read-Only] Contains the name of the author of the plugin. string description [Read-Only] Contains a text description of what the plugin is and/or does. string version [Read-Only] Contains the version number or string of the plugin. <link linkend="class_PluginIOCollection">PluginIOCollection</link> inputs [Read-Only] A list of all the inputs for the plugin. <link linkend="class_PluginIOCollection">PluginIOCollection</link> outputs [Read-Only] A list of all the outputs of the plugin. Class: PluginModuleCollection An array of PluginModules. Inherits: Collection <para/> </sect2> </sect1> <sect1 id="class_Point"> <title>Class: Point Represents a cartesian co-ordinate of the form (x,y). Constructors: Point ( ) Point ( x, y ) Properties: x y <para/> <sect3 id="constructor_Point_1"> <title>Point ( ) Creates a new point object with value (0.0, 0.0). Point ( number x, number y ) number x - The X value. number y - The Y value. Creates a new point object with value (x, y). number x The value of the x co-ordinate. number y The value of the y co-ordinate. Class: PowerSpectrum This class represents a power spectrum (PSD) object in Kst. Inherits: DataObject Collection class: PowerSpectrumCollection Constructors: PowerSpectrum ( vector, freq [, average [, len [, apodize [, removeMean]]]] ) Properties: length removeMean average apodize frequency xVector yVector vUnits rUnits <para/> <sect3 id="constructor_PowerSpectrum_1"> <title>PowerSpectrum ( <link linkend="class_Vector">Vector</link> vector, number freq [, boolean average [, number len [, boolean apodize [, boolean removeMean]]]] ) Vector vector - The vector to use as input to the power spectrum. number freq - The frequency for the power spectrum. boolean average - [OPTIONAL]number len - The base 2 logarithm of the length of the power spectrum. Should be an integer >= 4. [OPTIONAL]boolean apodize - If true, sharp discontinuities are removed. [OPTIONAL]boolean removeMean - True if the mean should be removed before performing the transform. [OPTIONAL] Creates a new power spectrum (PSD) object in Kst. Units are V and Hz by default. number length Contains the base 2 logarithm of the length to be used for interleaved averaging. Should be an integer >= 4. boolean removeMean True if the mean should be removed before performing the transform. boolean average True if the power spectrum should be calculated using an interleaved average. boolean apodize If true, sharp discontinuities are removed. number frequency Contains the sampling rate of the power spectrum. <link linkend="class_Vector">Vector</link> xVector [Read-Only] The X-axis vector for the power spectrum. <link linkend="class_Vector">Vector</link> yVector [Read-Only] The Y-axi vector for the power spectrum. string vUnits A string containing the units for the vector. string rUnits A string containing the units for the rate. Class: PowerSpectrumCollection An array of PowerSpectrums. Inherits: Collection <para/> </sect2> </sect1> <sect1 id="class_Scalar"> <title>Class: Scalar Represents a scalar value (a number) in Kst. Inherits: Object Collection class: ScalarCollection Constructors: Scalar ( ) Scalar ( value ) Properties: value <para/> <sect3 id="constructor_Scalar_1"> <title>Scalar ( ) Default constructor. Creates a new scalar with value 0.0. Scalar ( number value ) number value - Creates a new scalar with the specified value. number value Used to access or modify the value of a scalar. Class: ScalarCollection An array of Scalars. Inherits: Collection <para/> </sect2> </sect1> <sect1 id="class_Size"> <title>Class: Size Represents a two-dimensional size of the form (w, h). Constructors: Size ( ) Size ( w, h ) Properties: w h <para/> <sect3 id="constructor_Size_1"> <title>Size ( ) Creates a new size object with value (0.0, 0.0). Size ( number w, number h ) number w - The width. number h - The height. Creates a new size object with value (w, h). number w The width. number h The height. Class: Spectrogram This class represents a spectrogram (CSD) object in Kst. Inherits: DataObject Collection class: SpectrogramCollection Constructors: Spectrogram ( vector, freq [, average [, len [, apodize [, removeMean]]]] ) Properties: length removeMean average apodize frequency matrix vUnits rUnits windowSize <para/> <sect3 id="constructor_Spectrogram_1"> <title>Spectrogram ( <link linkend="class_Vector">Vector</link> vector, number freq [, boolean average [, number len [, boolean apodize [, boolean removeMean]]]] ) Vector vector - The vector to use as input to the spectrogram. number freq - The frequency for the spectrogram. boolean average - [OPTIONAL]number len - The base 2 logarithm of the length of the power spectrum. Should be an integer >= 4. [OPTIONAL]boolean apodize - If true, sharp discontinuities are removed. [OPTIONAL]boolean removeMean - True if the mean should be removed before performing the transform. [OPTIONAL] Creates a new power spectrum (PSD) object in Kst. Units are V and Hz by default. number length Contains the base 2 logarithm of the length of the spectrogram. Should be an integer >= 4. boolean removeMean True if the mean should be removed before performing the transform. number average boolean apodize If true, sharp discontinuities are removed. number frequency Contains the sampling rate of the spectrogram. <link linkend="class_Matrix">Matrix</link> matrix [Read-Only] The matrix for the spectrogram. string vUnits A string containing the units for the vector. string rUnits A string containing the units for the rate. number windowSize The window size of the spectrogram. Class: SpectrogramCollection An array of Spectrograms. Inherits: Collection <para/> </sect2> </sect1> <sect1 id="class_String"> <title>Class: String Represents a string in Kst. Note that this is not analagous to a string in JavaScript, and may not be directly interchanged as such. A Kst String is an object internal to Kst and is subject to update scheduling, sharing, and other policies of the Kst core. However the contents of a String may be manipulated with JavaScript string manipulation functions. Inherits: Object Collection class: StringCollection Constructors: String ( ) Properties: value <para/> <sect3 id="constructor_String_1"> <title>String ( ) Default constructor - creates an empty String. string value The value of the String. Class: StringCollection An array of Kst Strings. Inherits: Collection <para/> </sect2> </sect1> <sect1 id="class_TimeInterpretation"> <title>Class: TimeInterpretation A class representing a time interpretation. It is used to convert values from one set of units to display in another. Properties: active axisType input output <para/> <sect3 id="property_TimeInterpretation_1"> <title>boolean active True if the axis is being interpreted. string axisType [Read-Only] The type of axis this interpretation applies to. number input The format of the input to the interpretation. Must be one of: 0 - Standard C Time 1 - TAI 2 - JD 3 - MJD 4 - RJD 5 - JY number output The format to convert the interpretation to. Must be one of: 0 - DD/MM/YY HH:MM:SS 1 - YY/MM/DD HH:MM:SS 2 - JD 3 - MJD 4 - RJD 5 - JY 6 - Localized Short Date 7 - Localized Long Date Class: Vector Represents a vector of any type in Kst. Some vectors are editable, while others are not. This class behaves just as a JavaScript array, but has additional properties and methods. Inherits: Object Collection class: VectorCollection Constructors: Vector ( ) Vector ( array ) Methods: resize ( size ) interpolate ( i, n ) zero ( ) update ( ) Properties: length min max mean numNew numShifted editable numNaN array <para/> <sect3 id="constructor_Vector_1"> <title>Vector ( ) Default constructor creates an empty, editable vector. - Vector ( <link linkend="class_Array">Array</link> array ) - Array array - + Vector ( Array array ) + Array array - The array to be copied. Creates a vector that is a copy of array. void resize ( number size ) number size - The new size of the vector. Should be >= 2. Resizes the vector. Throws: GeneralError - Throws this exception if the vector is not editable. number interpolate ( number i, number n ) number i - The sample number to obtain the interpolated value of. number n - The number of samples to interpolate to. Interpolates the vector to n samples and returns the interpolated value of sample i. void zero ( ) Sets all values in the vector to zero. Throws: GeneralError - Throws this exception if the vector is not editable. void update ( ) Updates the statistical values associated with a vector. Throws: GeneralError - Throws this exception if the vector is not editable. number length [Read-Only] The number of samples in the vector. number min [Read-Only] The value of the smallest sample in the vector. number max [Read-Only] The value of the largest sample in the vector. number mean [Read-Only] The mean value of all samples in the vector. number numNew [Read-Only] number numShifted [Read-Only] number editable [Read-Only] True if the vector is editable by the user. This should be checked before attempting to modify a vector in any way. number numNaN [Read-Only] The number of NaN values in the vector. - <link linkend="class_Array">Array</link> array [Read-Only] + Array array [Read-Only] The vector as an Array. Class: VectorCollection An array of Vectors. Inherits: Collection <para/> </sect2> </sect1> <sect1 id="class_VectorView"> <title>Class: VectorView Represents a vectorView. Inherits: DataObject Constructors: VectorView ( x, y ) Properties: x y flag xMin xMax yMin yMax useXMin useXMax useYMin useYMax interpolation <para/> <sect3 id="constructor_VectorView_1"> <title>VectorView ( <link linkend="class_Vector">Vector</link> x, <link linkend="class_Vector">Vector</link> y ) Vector x - The x-vector. Vector y - The y-vector. Creates a new vector view with the given x-vector and y-vector. <link linkend="class_Vector">Vector</link> x the x-vector. <link linkend="class_Vector">Vector</link> y the y-vector. <link linkend="class_Vector">Vector</link> flag the flag-vector. Those points corresponding to non-zero values of the flag vector are removed from the output vectors. <link linkend="class_Scalar">Scalar</link> xMin the value for the minimum x-value for the view range. <link linkend="class_Scalar">Scalar</link> xMax the value for the maximum x-value for the view range. <link linkend="class_Scalar">Scalar</link> yMin the value for the minimum y-value for the view range. <link linkend="class_Scalar">Scalar</link> yMax the value for the maximum y-value for the view range. boolean useXMin If true, the minimum x-value is respected. boolean useXMax If true, the maximum x-value is respected. boolean useYMin If true, the minimum y-value is respected. boolean useYMax If true, the maximum y-value is respected. number interpolation the value for the maximum y-value for the view range. Must be one of: 0 - interpolate to the x-vector 1 - interpolate to the y-vector 2 - interpolate to the high resolution vector 3 - interpolate to the low resolution vector Class: ViewObject Represents any object in a Kst window. This is an abstract object and may not be instantiated directly. Inherits: Object Collection class: ViewObjectCollection Methods: resize ( size ) move ( pos ) findChild ( pos ) convertTo ( type ) raiseToTop ( ) lowerToBottom ( ) raise ( ) lower ( ) remove ( ) Properties: position size transparent onGrid columns color backgroundColor maximized minimumSize type children <para/> <sect3 id="method_ViewObject_1"> <title><link linkend="class_ViewObject">ViewObject</link> resize ( <link linkend="class_Size">Size</link> size ) Size size - The new size for the object. Resizes the object to the given size, if possible. <link linkend="class_ViewObject">ViewObject</link> move ( <link linkend="class_Point">Point</link> pos ) Point pos - The position to move the object to. Moves the object to a new position, if possible. <link linkend="class_ViewObject">ViewObject</link> findChild ( <link linkend="class_Point">Point</link> pos ) Point pos - The relative position to search. Finds the topmost child of this view object at the given point. Returns null if there is no child there. <link linkend="class_ViewObject">ViewObject</link> convertTo ( string type ) string type - The type to attempt to convert this object to. Attempts to convert this ViewObject to a different type. The object must be derived from this type at some level. Null is returned if it is not possible to convert to the requested type. void raiseToTop ( ) Raises the object to the top of the z-order. void lowerToBottom ( ) Lowers the object to the bottom of the z-order. void raise ( ) Raises the object one place in the z-order. void lower ( ) Lowers the object one place in the z-order. void remove ( ) Deletes the object. <link linkend="class_Point">Point</link> position The location of the object relative to its parent. <link linkend="class_Size">Size</link> size The size of the object in pixels. boolean transparent True if this object is transparent. Not all objects support transparency. boolean onGrid True if the children of this object are on a grid. number columns The number of columns the children are organized into. If this value is modified, onGrid is set to true. string color The foreground color for this object. string backgroundColor The background color for this object. boolean maximized If true, this object is maximized relative to its parent. This is a temporary state whereby the plot uses all the space available in the parent but can be restored to normal size again. <link linkend="class_Size">Size</link> minimumSize [Read-Only] The minimum size of the view object. string type [Read-Only] A string containing the type of this view object. <link linkend="class_ViewObjectCollection">ViewObjectCollection</link> children [Read-Only] The list of all children of this view object in z-order from the furthest back to the closest to the top. This is a reference to a collection which may be modified, but cannot be set. Class: ViewObjectCollection An array of ViewObjects. Inherits: Collection <para/> </sect2> </sect1> <sect1 id="class_Window"> <title>Class: Window An object that represents a reference to a Kst window or tab. Collection class: WindowCollection Constructors: Window ( [name] ) Methods: repaint ( ) close ( ) Properties: windowName plots view columns <para/> <sect3 id="constructor_Window_1"> <title>Window ( [string name] ) string name - A name for the new window. [OPTIONAL] Creates a new window and object to refer to it. void repaint ( ) Repaints the window. void close ( ) Closes the window. string windowName The name of the window this object refers to. <link linkend="class_PlotCollection">PlotCollection</link> plots The list of plots contained in this window, flattened. <link linkend="class_ViewObject">ViewObject</link> view The view object for this window. number columns The number of columns the children are organized into. If this value is modified, onGrid is set to true. Class: WindowCollection An array of Kst Windows. Inherits: Collection <para/> </sect2> </sect1> </appendix> Index: branches/extragear/kde3/graphics/doc/kst/extensions-chapter.docbook =================================================================== --- branches/extragear/kde3/graphics/doc/kst/extensions-chapter.docbook (revision 794893) +++ branches/extragear/kde3/graphics/doc/kst/extensions-chapter.docbook (revision 794894) @@ -1,575 +1,575 @@ <chapter id="extensions"> <title>Kst Extensions &kst; extensions are a powerful way to add functionality to &kst;. They can, for example, add elements to the &kst; user interface. They are usually designed to accomplish specific tasks which aren't of general use to the &kst; community. To load or unload extensions in &kst;, select SettingsExtensions.... A dialog will be presented which allows you to load or unload installed plugins. Extensions Dialog The ELOG Extension The ELOG extension allows event monitors to create logbook entries on a server running the Electronic Logbook (ELOG) application. The created logbook entries can be used, for example, to remotely monitor &kst; events or to produce periodic data reports. For information on configuring and maintaining an ELOG server, please see the official ELOG Homepage. To enable the ELOG extension in &kst;, select SettingsExtensions... and ensure that ELOG Extension is checked. Server and Logging Settings Server and logging settings should be configured before an entry is added to a logbook. To configure logging settings, select Settings ELOG... or click the Configure... button in the ELOG Entry dialog accessed from either FileAdd ELOG Entry... or the Event Monitor dialog if ELOG functionality is enabled for an event monitor object. The following dialog should be displayed: Event Monitor Server Settings Event Monitor Server Settings Descriptions of the settings in this dialog follow. Configuration, Save, and Load The Configuration drop down list contains a list of saved ELOG server configurations. To load a set of configuration settings, select an item from the list and click the Load button. To save the current configuration settings in this dialog into a slot, select the desired slot and click the Save button. Saving settings into a slot overwrites any existing settings in that slot. IP address and Port number Enter the IP address of the machine running the ELOG server application. The port number that the ELOG server listens on is configurable through the server, but by default it is 8080, so if you are unsure, enter 8080 as the port number. Logbook Each ELOG server can contain one or more logbooks, so the name of the logbook to write entries to must be specified. Ensure that the spelling of the logbook name is correct. User name, User password, and Write password Depending on the how the ELOG server application is configured, these settings may or may not be necessary. If they are, enter the correct login credentials in the appropriate textboxes. Capture size Use this list box to select the size, in pixels, of the &kst; screen capture to attach (if specified). Submit as HTML text If this checkbox is selected, HTML tags may be used in the logbook entry. Suppress e-mail notification If the logbook is configured to send e-mail notifications of new entries, selecting this checkbox will disable the notifications. Note that this option is not related to &kst;'s own e-mail notification setting for event monitors. Apply Click the Apply button to apply the entered settings. Update Click Update to update the ELOG Event Entry dialog. Close Click Close to exit the dialog. Add an ELOG Entry To add an entry to the logbook, choose FileAdd ELOG Entry... This brings a dialog allowing the user to provide information for attributes as well as entering the contents for the log message. The types of attributes depend on the logbook you specified. The screenshot below shows one example of possible required attributes. Adding an Entry Adding Entry Logged Information Use the three checkboxes at the bottom to select the type of information to be logged. Include Kst capture specifies that a screen capture of the currently active window should be included in the entry. Include Kst configuration file specifies that *.kst save file should be attached to the entry. Include Kst debugging information is checked, a copy of the debug log will be attached to the entry as well. Configuration... Clicking Configuration... brings the ELOG Configuration dialog. See the Server and Logging Settings section for details. Submit Click Submit to submit the log entry. Cancel Click Cancel to close the dialog without posting the log entry. When the ELOG functionality is enabled for an Event Monitor object, clicking the Configure... button in the New Event Monitor dialog will bring the ELOG Event Entry dialog. In this dialog, the user can enter information for logbook attributes; again, the types of attributes depend on the logbook configured in the ELOG configuration dialog. Event Monitor Logging Settings Event Monitor Logging Settings Logged Information See explanation above. Configuration... See explanation above. Test This button is used to test the ELOG configuration. If the user-specified logbook is configured correctly, clicking Test will post a test message:Test of Event ELOG Entry in the logbook. Close Click Close to close the dialog. ELOG Browser To view existing logbooks through Kst, choose FileLaunch ELOG Browser.... Launch ELOG Browser ELOG Browser To quickly view the ELOG browser and add an entry to a logbook, just click the ELOG Browser in the toolbar to launch the ELOG browser and Entry Icon to add an ELOG entry. Using the ELOG Class in KstScript Alternatively, you can use the ELOG class provided in KstScript to enter and submit messages in a logbook and change the server and logging settings. See details in the ELOG class documentation. Adding an ELOG entry through KstScript elog = new ELOG(); //construct a new ELOG object elog.port = 8080; //specify the port elog.hostname = "localhost"; //specify the hostname; elog.logbook = "demo"; // specify the logbook; elog.text = "message contents"; //enter the message; elog.addAttribute("Author", "Kst"); elog.addAttribute("Type", "Routine"); elog.submit(); KstScript KstScript is a JavaScript binding for &kst;. It aims to offer full control over all aspects of &kst;. To enable KstScript, select SettingsExtensions... and ensure that JavaScript Extension is checked. Running a KstScript There are three ways to to run a KstScript. from the command line when starting &kst;: kst -E js:"loadScript('myscript.js')" using kstcmd. kstcmd is a JavaScript interpreter which connects to your &kst; session. It can be run from an external terminal, or from within &kst; itself by selecting ToolsShow JavaScript Console. kstcmd Attached to Kst session kst-17704 kst> loadScript('myscript.js') from the menu once &kst; is loaded: FileLoadJavaScript Note that with the first two methods, any KstScript command, or collection of KstScript commands can be substituted for the loadscript command. KstScript Examples KstScript gives &kst; a powerful programming interface. Chiefly, it can be used to construct smart macro functions for common tasks. We will first look at a basic example illustrating how to control &kst; through KstScript, and then we will look at an example of a macro function. A simple KstScript Here we have the hello world of KstScripts: plot a curve of random numbers. // simple.js: A simple KstScript demo. // Generates a new plot with a curve of random numbers. // grab the window var w = Kst.windows[0]; // add a plot to the window var p = new Plot(w); // create new (editable) vectors. // these could also be loaded from files. var xv = new Vector(); var yv = new Vector(); xv.tagName = "time"; yv.tagName = "signal"; // make their length 100. xv.resize(100); yv.resize(100); // fill in their values. for (var i = 0; i < 100; i++) { xv[i] = i; //index yv[i] = Math.random(); //uniformly distributed between 0 and 1. } // create a curve from x and y var c = new Curve(xv,yv); c.tagName = "signalvstime"; // put the curve in our new plot p.curves.append(c); // label the x-axis of our plot p.xAxis.label = "Time (s)" This script can be run using any of the methods from . Here is a screenshot of &kst; after entering the commands using the embedded console method. Simple Output In the &kst; UI, objects are not labelled by the variable names which we use in our KstScript, but are are referred to by their Tag Name (or "Unique Name"). If you do not manually set the tagName attribute of new objects, then when you look things up in the data manager you will find cryptic names like anonymous vector 1, or, . This is the reason why we received several undefined messages in the screenshot above. If you ever plan to use the UI to work with objects you have created with a KstScript, you will want to set their tagName property. You can also use tag names within KstScript itself. For example, after setting the tagName of our new curve we could have called p.curves.append("signalvstime"); Writing, Including, and Calling Functions -As with any JavaScript environment, you can write and call functions with KstScript. Additionally, KstScript posseses a means for a KstScript to load functions from disk. Consider the following example: +As with any JavaScript environment, you can write and call functions with KstScript. Additionally, KstScript possesses a means for a KstScript to load functions from disk. Consider the following example: // subroutines.js function takeSpectraOfTimePlots() { //takes all of the plots in the first window which have an x-axis of "Time (s)" // and generates power spectra for their curves, which it dumps into a single new // plot. var w = Kst.windows[0]; var p = new Plot(w); p.xAxis.label = "Frequency (Hz)" for (var ip = 0; ip < w.plots.length; ip++ ) { cp = w.plots[ip]; //current plot if (cp.xAxis.label == "Time (s)") { for (ic = 0; ip < cp.curves.length; ic++) { plotSpectrum(p,cp.curves[ic].yVector) } } } } function plotSpectrum(p,v) { //creates a power spectrum for the vector v and displays it in plot p. Assumes //the vector is data sampled at 1Hz. ps = new PowerSpectrum(v, 1); ps.tagName = v.tagName + "-PS"; c = new Curve(ps.xVector,ps.yVector); c.tagName = ps.tagName + "-C"; p.curves.append(c); } This example contains two functions: takeSpectraOfTimePlots() and plotSpectrum(p,v). takeSpectraOfTimePlots() is a macro function which will generate spectra for all of the plots in the first window which have "Time (s)" as their x-axis. In this example, we can see the power of KstScript for such tasks. The following script loads these routines from the subroutines.js. It uses the simple.js of the previous section to generate a noise plot with a time axis, and then calls takeSpectraOfTimePlots() to find its spectrum. Notice that subroutines.js is loaded using loadScript(), the same call that we used from the command line in . // callsubs.js // demonstrate calling subroutines loadScript('subroutines.js'); loadScript('simple.js'); takeSpectraOfTimePlots(); A screenshot of &kst; after executing these commands is shown below. CallSubs Output More KstScript Documentation Complete documentation on the KstScript classes is given in Appendix D.