Introduction to the oscillogram analyser scripts.

Ability of the oscillogram automatic analysis is based on the integration of Oscilloscope program (hereinafter referred to as Program) objects with the operation system script core. Program allows using a general set of JScript (Java Script) and VBScript (Visual Basic Script) functions and objects, and adds a set of own ones. Program's objects, integrated in the script core, allow accessing and analyzing of the oscillogram data, displaying results of this analysis in the text or graphical view, marking and commenting oscillogram specific points. The script files are text or HTML files, which contain instructions for data processing and result visualization.

The current Program version supports two types of analysis. The first one is used for the analysis of the whole or selected part of the oscillogram, with receiving of all types of results and oscillogram marking. This type is based on the analyzer script files. The second one is the functional extension of the Program interface, which extends Program abilities for a specific signal processing while oscillogram file viewing. This type is based on the analyzer panel files. Analyser panels are integrated into the Program interface and have own control items, placed on a separate panel at the bottom of the screen. This document contains description of Program's script objects and its functions. The root object of the Program script core is the Host object.


Host object.

The Host object is a root object of the program analysis core. It contains set of member contstants and functions, which can be used from customer script for an oscillogram signals analysis purpose.
All set of the Host object functions is divided on common Host object functions, Host object functions are used for script and HTML analyser files, Host object functions are used for HTML analyser files, and Host object functions are used for analyser panel files. See description of analizer files types.

Host object constants
DataType | Current oscillogram file data type.
Channels | Number of channels in current oscillogram file.
Frequency | Sampling frequency for current oscillogram file.
NumberOfSamples | Total number of samples in current oscillogram file.
SelBegin | Selected area begin position.
SelEnd | Selected area end position.
CurPath | Current script file path
CurFileName | Current oscillogram file name
Version | Current current software version

Common Host object functions

GetChannelName ( iChannel )

Function returns channel name.

HasChannelInversion ( iChannel )

Function returns channel inversion condition.

GetFullScale ( iChannel )

Function returns maximal signal amplitude for channel.

GetChannelParam ( iChannel, strParamName )

Function returns required channel parameter.

SetChannelParam ( iChannel, strParamName, vParam )

Function sets channel parameter.

ValueAt ( iChannel, iPos )

Function returns signal value for channel at given position.

AveValueAt ( iChannel, iPos, nPoints )

Function returns averaged signal value for channel at given position.

SynchBy ( iChannel, iFront, Level, iFromPos, cSamples )

Function searches for position, where signal meets given condition.

FindFront ( iChannel, iFront, Level, iFromPos, cSamples, dT, dV )

Extension of SynchBy function.

FindPeak ( iChannel, iFromPos, cSamples, MinDelta, AveDepth, Mid )

Function searching for signal peak position.

FindBitCondition (iCondMask, iFromPos, cSamples )

Function searches for position, where logic analizer signals meet given condition mask.

ReportOut ( strText )

Function prints text in report window.

ShowProgress ( strText, nTotalSteps )

Function shows progress bar.

HideProgress ( )

Function hides progress bar.

SetProgress ( iPos )

Function sets progress bar position.

SetStatusText ( strText )

Function sets progress bar status text.

SetMarker ( iPos, strComment )

Function sets bookmark at given position.

SetVMarker ( iChannel, dMinValue, dMaxValue, strComment )

Function sets lever (area) marker for given channel.

GetCurLanguage ( )

Function returns current language ID used for program interface.

CreateStream ( iChannel, InOut )

Function creates Stream object.

CreateLibObj ( strLibName, iVer, strObjName )

Function creates external library object.

GetExtraResult ( )

Function returns additional result for previous function (sw. version 4.x).

SetRelativePos ( iRelType, vPos )

Function sets relative data processing position (sw. version 4.x).

GetRegValue ( strSectionName, strValueName, vDefValue )

Function reads registry value.

SetRegValue ( strSectionName, strValueName, vValue )

Function writes registry value.

GetFileVD ( )

Function returns file variables object.

GetVarTypes ( )

Function returns types names enumerator object.

GetTypeData ( strTypeName )

Function returns type data access object.

AdaptFrml ( strFormula )

Function adapts formula with current file..

ExeScript ( strScriptFile, [Params])

Function executes script file..

Host object functions are used for script and HTML analyser files

CreateConfigure ( strName )

Function creates Configuration object.

CreateGraphicView ( strName )

Function creates Graphic view object.

CreateGraphicViewEx ( strName, iType )

Function is extension of CreateGraphicView function, and creates Graphic view object.

CreateGraphic ( strName, strYname, vColour )

Function creates Graphic object.

CreateColoredGraphic ( strName, strYname, vColour )

Function creates colored Graphic object.

ShowReport ( )

Function activates text report window.

CreateHTMLReport ( strNameSource )

Function creates HTML report window.

Host object functions are used for HTML analyser files

CanContinue ( )

Function checks whether data processing can be continued.

ClearResults ( )

Function clears all results of previous analyse.

Quit ( )

Function stops HTML based analyser files execution.

ShowInfo ( )

Function shows help file for current scrit.

Host object functions are used for analyser panel files

SetEvent ( strName, Function )

Function sets script handler-function for specified event.

GetScreenPos ( )

Function returns current screen position in terms of samples.

SetScreenPos ( iPos )

Function scrolls screen to the specified position in terms of samples.

GetScreenWidth ( )

Function returns oscillogram screen width.

GetCurZoom ( )

Function returns current zoom value.

SetCurZoom ( iZoom )

Function sets current zoom value.

GetScaleDots ( )

Function returns number of dots in screen measurement scale cell.

RedrawScreen ( bUseTransform )

Function forces an oscillogram screen redrawing.

UpdatePannel ( )

Function forces panel window updating.

GetTMarkerPos ( iMarkIndex )

Function returns measurement marker position.

SetTMarkerPos ( iMarkIndex, iPos )

Function sets measurement marker position.


Host object constants.

DataType

Constant describe data type of current oscillogram file. Current program version support following types:
"ANA" | - for analogue data type, program returns real values of signal voltage;
"DIG" | - for logic analyser data type, program returns only two signal levels 0.0 - for low level or 1.0 - for high level.

Example.
 if (Host.DataType = = "ANA"){
   Host.ReportOut("File contains analogue type of data");
 }
 else{
   Host.ReportOut("File contains logic type of data");
 }

Channels

Constant keeps number of channels (signals) in current oscillogram file.

Frequency

Constant keeps sampling frequency for current oscillogram file. The 1/Frequency value gives time interval between two samples in the current oscillogram file

NumberOfSamples

Constant keeps total number of samples for current oscillogram file. Oscilloscope software version 4.x can works with files that contain more then 2T samples (2147483648 samples). In such cases constant value will equal to 2T samples.

SelBegin, SelEnd

Constants keeps begin and end positions of the oscillogram selection area in tearm of sample position. When both values are equal then any selection does not exist.

CurPath

Constant keeps path for curent script file. This value can be used for additional files loading. See example of this constant using.

CurFileName

Constant keeps current oscillogram file name.

Version

Constant keeps current software version.


Common Host object functions.

GetChannelName( iChannel )

Function returns channel name for channel which number is defined by iChannel - parameter.

HasChannelInversion( iChannel )

Function returns TRUE if channel, which number is defined by iChannel - parameter, has signal inversion.

GetFullScale( iChannel )

Function returns maximal signal amplitude for channel is defined by iChannel - parameter.
For instance, when input signal range for current channel is ± 15 volts, then function returns 15.0.

GetChannelParam( iChannel, strParamName )

Function returns parameter or option is defined by strParamName for channel - iChannel.
Current software version support next types of strParamName value:
"Visible" | - channel visibility option;
"Inversion" | - channel inversion option;
"Average" | - channel average for "TRUE" or peak-to-peak for "FALSE" channel view option;
"VDiv" | - channel vertical division by scale step value;
"Offs" | - channel vertical offset value in dots from screen top;
"VOffs" | - channel voltage offset compensation value;
"Color" | - color for is used for channel signal drawing.

Example.
// Function get channel 1 vertical screen offset ( screen top = 0 )
 var iVPos = Host.GetChannelParam( 1, "Offs" );

// Function get channel 1 vertical scale step value
 var dVDiv = Host.GetChannelParam( 1, "VDiv" );

SetChannelParam( iChannel, strParamName, vParam )

function sets new value - vParam, of the parameter or option is defined by strParamName for channel - iChannel. Function use same types of strParamName value as function GetChannelParam. As distinct from GetChannelParam, SetChannelParam function sets vertical offset value "Offs" from channel base position. Therefore this value corresponds to the channel dot offset displayed in the channel control pannel.

Example.
// Function set channel 1 vertical scale step value to 0.5 V/div.
 Host.SetChannelParam( 1, "VDiv", 0.5 );
// Function reset channel 1 dot offset.
 Host.SetChannelParam( 1, "Offs", 0 );

ValueAt( iChannel, iPos )

Function returns signal voltage level for channel - iChannel, at sample position - iPos. Function operates with 0.0 and 1.0 values for logic analyser data.

AveValueAt( iChannel, iPos, nPoints )

Function returns averaged by nPoints - samples, signal voltage level for channel - iChannel, at sample position - iPos. Function uses iPos - nPoints/2 to iPos + nPoints range of samples for signal level averaging.

SynchBy( iChannel, iFront, Level, iFromPos, cSamples )

Function searches for position, where signal on channel - iChannel meets given condition defined by iFront and Level values. Searching starts from iFromPos - sample position, and continues for cSamples - amount of samples. When cSamples is negative value, searching performs in reverse direction. The iFront - value defines type of required signal front. Following values can be used to define front type for iFront parameter:
0 | - for any fronts;
1 | - for raise front;
-1 | - for fall front;
The Level value defines voltage level, which signal crosses in direction defined by front type iFront. It is possible to use iChannel = 0 for logic analyser data type. This case, function will use any available channels for searching of described signal condition. Use GetExtraResult function to get channel number, where specified condition has been found. If cSamples parameter equals to 0, function will search until the end of available data.
Function return -1 if defined condition does not fond. Or sample position, where signal meets given condition.

Example.
// Function searches for raise front of signal on channel 1 with crossing
// 1.0 V level, from sample position iPos, until data end (cSamples = 0).
 iNextPos = Host.SynchBy( 1, 1, 1.0, iPos, 0);

 if (iNextPos >= 0)
 {// Front position has been found
// Sets bookmark at front position
   Host.SetMarker(iNextPos, "Front position");

  if (iPos >= 0)
  {// Previous position exist
   iPeriod = iNextPos - iPos;// Calculate signal period

// Prints period value in report window
   Host.ReportOut("Curent period is:" + iPeriod/Host.Frequency + "s");
  }
  iPos = iNextPos;
 }
 else
  break;// Front position does not found

FindFront( iChannel, iFront, Level, iFromPos, cSamples, dT, dV )

Function is extension of SynchBy function. In addition this function has dT and dV parameters, which are used for search selectivity. The dT value defines number of samples are used for signal values averaging. The dV value defines threshold of signal level increasing for searched point. Both values shold be positive numbers are not equal to zero. Increasing of dT value can be useful for noise filtering of low frequency signals. Increasing of dV value can be useful for seaching of high frequency signal fronts. Both of these parameters are used in combination for better search function selectivity.

FindPeak( iChannel, iFromPos, cSamples, MinDelta, AveDepth, Mid )

Function searches for signal peak position on channel - iChannel. Searching starts from iFromPos - sample position, and continues for cSamples - amount of samples. The MinDelta - value defines peak value threshold, and its sign determine peak type. Function searches for signal maximum if MinDelta value is positive, or its minimum, when MinDelta value is negative. The AveDepth value defines number of samples (1…512) are used for data averaging during peak searching. Increasing of this parameter helps to filter out noisy signals. When parameter Mid = 0, function returns position PeakPos that corresponds to PeakLev signal value. When Mid = 1, function returns position MidPos is placed in the middle between two points which are crossing of signal curve and level FromLev line, see picture. The FromLev is signal level for iFromPos samples position.
When required peak does not found, function returns -1. Use GetExtraResult ( ) function to get PeakLev value.

Example.
// Function searches for maximal peak value (2.0 > 0) on channel 1,
// from position iPos, until data end (cSamples = 0).
// Peak value should be at least 2.0 Volts more then current at iPos.
// Function uses 5 samples for averaging, and position should be
// chosen in the middle (Mid = 1).
 iPeakPos = Host.FindPeak(1, iPos, 0, 2.0, 5, 1);

 if (iPeakPos >= 0)
 {// Peak has been found
// Get maximum value has been found by FindPeak - function
  dMaxVal = Host.GetExtraResult();
 }
 else
  break;// Peak does not found

FindBitCondition(iCondMask, iFromPos, cSamples )

Function searches for logical analyser sygnals condition is defined by iCondMask value. Searching starts from iFromPos - sample position, and continues for cSamples - amount of samples. The iCondMask value is combined from 4 bits condition types for each channels. In other words bits: 0..3 - defines condition type for first channel, 4..7 - for second and so on. Followin condition types are available:
0 | - does not matter;
1 | - raise front;
2 | - fall front;
3 | - low level;
4 | - high level;
5 | - any fronts (any signal changes).
It is possible to use any combination of fronts and levels for iCondMask value. For example 0x31 - iCondMask value means that function will searching for sample position where first channel changes its level to high, and second channel has low signal level. Function return -1 if defined condition mask does not fond. Use GetExtraResult ( ) function to get channel number where front has been found by function call in case, when iCondMask contains more then one front types for different channels.

Example.
// Function searches for logic signals condition where
// channel 1 (0x01) or channel 2 (0x10) has raise front.
// Function starts from iPos sample position,
// until data end (cSamples = 0).

 iNextPos = Host.FindBitCondition(0x11, iPos, 0);

 if (iNextPos >= 0)
 {// Condition has been found
  if(GetExtraResult() == 1){
// Front has been found on channel 1
  }
  else{
// Front has been found on channel 2
  }

  iPos = iNextPos;
 }
 else
  break;// Condition does not found

ReportOut( strText )

Function prints text specified by strText - parameter, into report window. Report window available only for analyser scripts files. It is possible to use this function in analyser panel scripts for trace messages printing. The trace messages can be inspected in the trace window of the ScriptEdit program.

ShowProgress( strText, nTotalSteps )

Function shows progress bar in the program status bar. Parameter - strText is current process text description, and nTotalSteps is progress total value.

HideProgress( )

Function hides progress bar has been shown by ShowProgress() function.

SetProgress( iPos )

Function changes progress bar position to iPos value. See ShowProgress function description.

SetStatusText( strText )

Function changes progress bar description message to strText value.

SetMarker( iPos, strComment )

Function sets bookmark at sample position - iPos, with comment is specified by strComment parameter. When bookmark at position iPos exist, function changes its comment to strComment value.

SetVMarker( iChannel, dMinValue, dMaxValue, strComment )

Function sets level (range) marker for channel iChannel. The level marker is specified by dMinValue in terms of voltage, dMaxValue this case equals to dMinValue. The range marker is defined by the range of two voltage values: dMinValue and dMaxValue. The strComment value defines level (range) marker comment.

GetCurLanguage( )

Function returns current language ID used for program interface. This is standard laguage ID used for the language identification. For example:
ID = 0x409 | - correspond to USA English;
ID = 0x419 | - is used for Russian.

Next Example demonstrates how to use this function to add multi-language interface to script file. Example.
var Message1;
var Message2;
var Message3;

 try {
// Format messages file name, for current program language
// and script file location, in format "Messages_xxx.lng"
  var LangFile = Host.CurPath + "Messages_"
       + Host.GetCurLanguage().toString(16) + ".lng";

// Creates file system object
  var fs = new ActiveXObject("Scripting.FileSystemObject");

// Open messages text file for current language
  var tf = fs.OpenTextFile(LangFile, 1, false);
// Reads first text file line for Message1
  Message1 = tf.ReadLine();
// Reads second text file line for Message2
  Message2 = tf.ReadLine();
// Reads third text file line for Message3
  Message3 = tf.ReadLine();
// Close messages text file
  tf.Close();
 }

 catch(e){
// An any errors occurs during file open operation
// Set default values for all messages
  Message1 = "This is message 1";
  Message1 = "This is message 2";
  Message1 = "This is message 3";
 }

CreateStream( iChannel, InOut )

Function creates data Stream object for channel - iChannel. The InOut - value defines stream direction. When InOut value equals to 0 - function creates input stream, or output when InOut value equals to 1. When iChannel = 0 and InOut = 0, function creates transforming stream.

CreateLibObj( strLibName, iVer, strObjName )

Function creates external library object of the library module is specified by strLibName, for library version - iVer and library object name - strObjName.

Example.
// Function creates object "AveFilter", contained in
// "AFilters" library module with version 100 (1.00).
 var DFilterObj = Host.CreateLibObj("AFilters", 100, "AveFilter");

 if (DFilterObj != null) {
// Call Initialize method of "AveFilter" object
  DFilterObj.Initialize(10, 1);

 }
 else
  Host.ReportOut("Unable to create filter object");

GetExtraResult( )

Function returns extra result value for function executed previously.

Example.
// Search for peak
 iPeakPos = Host.FindPeak(1, iPos, 0, 2.0, 5, 1);

 if (iPeakPos >= 0)
 {// Peak has been found
// Get maximum value has been found by FindPeak function
  dMaxVal = Host.GetExtraResult();
 }
 else
  break;// Peak does not found

SetRelativePos( iRelType, vPos )

Function offsets relative data processing position by vPos value. The iRelType value helps to define BasePos that will be used as base for new position. Result position calculates as BasePos + vPos. Current program version supports following values for iRelType:
0 | - begins of the file;
1 | - current position;
2 | - current screen position;
3 | - selection begin position.
Function is supported with program version 4.X, and helps to process oscillogram files that has more then 2 GSamples of data size. Function returns current value of relative data processing position. Type of this value is not supported inside script, and can be used only to restore previous value of relative data processing position. See example below.

Example.
// Function sets relative data processing position to current
// screen position (2) -10 samples, and save previous value to vCurPos
 var vCurPos = Host.SetRelativePos( 2, -10 );

// Calculate average value for channel - 1,
// form 0 - position for cScreenWidth samples plus 10*2.
 dScreenAverage = Host.AveValueAt(1, 0, cScreenWidth+10*2);

// Restore previous relative data processing position
 Host.SetRelativePos( 0, vCurPos );

GetRegValue( strSectionName, strValueName, vDefValue )

Function reads value - strValueName from system registry location:
PROGRAM_ROOT_SECTION \ strSectionName.
The vDefValue is returned when requested registry record does not found.

SetRegValue( strSectionName, strValueName, vValue )

Function saves value - strValueName to system registry location:
PROGRAM_ROOT_SECTION \ strSectionName.

GetFileVD( )

Function returns file variables object.

GetVarTypes( )

Function returns types names enumeratior object.

GetTypeData( strTypeName )

Function returns type data access object for requested by parameter strTypeName type name.

AdaptFrml( strSrcFormula )

Function returns adapted formula string from source formula defined by strSrcFormula parameter. During adaptation "%V:C%" - string definitions can be replaced with real values. The V - value defines variable name to be read to get required constant, C - value is default constant which will used instead if V variable can not be found. Following software version can read variables from the file variables table. Use "FV_" prefix to define such variables. For example "%FV_AMult:1.1%*(x+0.25)" source formula during adaptation try to read "AMult"-named value from the file variables table, if such variable does not exist 1.1 constant value will used instead.

ExeScript( strScriptFile, [Params])

Function executes external script file defined by strScriptFile parameter. When function executes from HTML based script this context mast be supplied as optional [Params] - parameter. The script is executed can access and define global JavaScript variables to communicate with general script part. If script execution fails, function returns false or true otherwise.


Host object functions are used for script and HTML analyser files.

CreateConfigure( strName )

Function creates Configuration object with name - strName. This type of object is used for analyser script configuration purpose, see configuration object decription.

CreateGraphicView( strName )

Function creates Graphic view object for rectangular coordinates system, with name strName.

CreateGraphicViewEx( strName, iType )

Function is extension of CreateGraphicView function, and creates Graphic view object with name strName and type iType.
Current program version support following values for iType parameter:
0 | - rectangular coordinates system;
1 | - polar coordinates system.

CreateGraphic( strName, strYname, vColor )

Function creates Graphic object with name strName, unit name strYname and default graphic color value vColor. Object contains set of graphic dots, and should be added to any Graphic view objects to be displayed.
Value of strYname parameter is used as value name or unit, while displaing values for given graphic. If strYname value is prefixed with '\n'- symbol it displayed at the end of graphic values as unit. When strYname value is prefixed with '@'- symbol it also displayed as unit, but in this case unit value prefixed with 'u'-[micro],'m'-[milli],'k'-[kilo] and 'M'-[mega] in depends of current value. If value of strYname parameter is empty, values for given graphic are not displayed. This opportunity coud be used to display lines and curves, which show limits or axes for given combination of graphics in single graphic view. If strYname parameter is ' ' (space), only values for given graphic are displayed. See example of Graphic object using.

CreateColoredGraphic( strName, strYname, vColor )

Function creates colored Graphic object with name strName, unit name strYname and default graphic color value vColor. Object contains set of graphic dots each of them can have own color. Object should be added to any Graphic view objects to be displayed. See description of CreateGraphic function for detaled description of strYname parameter.

ShowReport( )

Function activates text report window.

CreateHTMLReport( strNameSource )

Function creates HTML report window and loads its source from strNameSource parameter, or loads it from external file which is defined by the strNameSource parameter. Function return true when HTML report creation succeeded, or false other case. See description of HTML report extension


Host object functions are used for HTML analyser files.

CanContinue( )

Function checks whether data processing can be continued. It is strongly recommended to use this function in long data processing circles.

Example.
 do{
 // Main data processing body

 }while( Host.CanContinue() );

ClearResults( )

Function clears all results of the previous analyse. This function could be used, when analise restarting requited.

Quit( )

Function stops HTML based analyser files execution. Use this function to stop script and hide analyser dialog window.

ShowInfo( )

Function showns analyser script help file ("Help.html").


Host object functions are used for analyser panel files.

SetEvent( strName, Function )

Function sets script handler-function - Function for specified by name - strName event. Current program version support following events (event names).
"FileLoaded" | - new file has been loaded;
"Information" | - analizer panel button - "?" has been pressed;
"Markermoved" | - position of measurement marker has been changed;
"BeforeDraw" | - event is called when screen background shold be drawn;
"AfterDraw" | - event is called when screen content has been drawn;
"Transform" | - new portion of screen data should be processed;
"ScrollScreen" | - current screen position has been changed;
"ChanParamChanged" | - any parameter of channel has been changed by user.

Example.
// Initialization
 Host.SetEvent("FileLoaded", OnFileLoaded);

// Script handler-function for "FileLoaded" event
function OnFileLoaded(){
// Get parameters of new file

}

GetScreenPos( )

Function returns sample position for first (leftmost) screen sample. This function can be used to get sample position for begining of the current screen.

SetScreenPos( iPos )

Function sets screen position to specified by iPos parameter sample position.

GetScreenWidth( )

Function returns dots width of the current oscillogram screen. Use GetCurZoom function to get total number of samples for current screen width, see example below.

Example.
// Get number of samples is required for current screen
 var cScreenSamples = Host.GetScreenWidth()*Host.GetCurZoom();

GetCurZoom( )

Function returns current zoom value. This value is number of samples used for displaying of the single screen dot. Thus if screen dots width equals to 640 and zoom value is 10, total number of samples are required for signals displaying is 640*10 = 6400.

SetCurZoom( iZoom )

Function sets current zoom to iZoom parameter value. Function accepts zoom value from zoom values table, which equal or more then given iZoom value.

GetScaleDots( )

Function returns number of dots in screen measurement scale cell.

RedrawScreen( bUseTransform )

Function causes an oscillogram screen to be redrawn. The bUseTransform parameter value defines whether screen data transformation operation is required. Use bUseTransform = 0 when only screen redrawing operation is required, without screen data transformation operation. The script handler-functions "BeforeDraw" and "AfterDraw" will be called to involve script in screen drawing. When bUseTransform = 1, script handler-function for "Transform" event will be called before screen redrawing.

Example.
// Initialization
 Host.SetEvent("BeforeDraw", OnDrawBefore);
//....
//....
// Any changes are applied and screen should be redrawn
 Host.RedrawScreen(0);

// Script handler-function for "BeforeDraw" event
function OnDrawBefore( DrawObj ){
// Draw background screen items to show signal specific things.

}

UpdatePannel( )

Function updates panel content. Use this function to apply any changes in panel content.

GetTMarkerPos( iMarkIndex )

Function returns measurement marker sample position. The iMarkIndex parameter specifying measurement marker index. Indexes for measurement markers 'A' and 'B' are: 0 and 1 accordingly. Index values 2...17 are used for extra measurement markers '0'...'9' and 'C'...'H' accordingly. Function returns -1 if requested marker is hidden.

SetTMarkerPos( iMarkIndex, iPos )

Function sets measurement marker sample position to iPos value. The iMarkIndex parameter specifying measurement marker index. Indexes for measurement markers 'A' and 'B' are: 0 and 1 accordingly. Index values 2...17 are used for extra measurement markers '0'...'9' and 'C'...'H' accordingly. Positive iPos value for measurement markers sets absolute marker position (marker become fixed). Negative iPos value for measurement markers 'A' and 'B' sets marker position relatively to screen begins (marker become not fixed). Negative iPos value for rest of markers (2...17) hide it.


Analyser panel Host object events.

"FileLoaded" event

Event is invoked each time, when new file has been opened.

"Information" event

Event is invoked each time, when user press panel '?' button. When handler-function for this event does not specified, "Help.html" file will be loaded instead.

"Markermoved" event

Event is invoked each time, when user move any measurement marker. Index of this marker is supplied as argument for event handler-function.

Example
// Initialization
 Host.SetEvent("Markermoved", OnMarkermoved);

// Script handler-function for "Markermoved" event
function OnMarkermoved( iIndex )
{
// Get new measurement marker position
 var iMarkerPos = Host.GetTMarkerPos( iIndex );
}

"BeforeDraw" event

Event is invoked to redraw screen background. The Draw object is supplied as argument for event handler-function.

Example
// Initialization
 Host.SetEvent("BeforeDraw", OnBeforeDraw);

// Script handler-function for "BeforeDraw" event
function OnBeforeDraw( DrawObj )
{// Draw panel items for screen background
 var rScale = DrawObj.rScale; // Get scale area rectangle

 DrawObj.SetPen(0x00FFFF);// Set Pen color to 0x00FFFF

 // Draw rectangular area around scale rectangle
 DrawObj.DrawRect( rScale.left, rScale.top, rScale.right, rScale.bottom );
}

"AfterDraw" event

Event is invoked when screen content has been drawn. The Draw object is supplied as argument for event handler-function.

Example
// Initialization
 Host.SetEvent("AfterDraw", OnAfterDraw);

// Script handler-function for "AfterDraw" event
function OnAfterDraw( DrawObj )
{// Draw panel items for screen foreground
 var rScale = DrawObj.rScale; // Get scale area rectangle
 var iVMiddle = (rScale.top + rScale.bottom)/2;

 DrawObj.SetPen(0x00FFFF);// Set Pen color to 0x00FFFF

 // Draw line in the center of scale rectangle
 DrawObj.DrawLine( rScale.left, iVMiddle, rScale.right, iVMiddle);
}

"Transform" event

Event is invoked when new portion of screen data should be processed. Number of samples that should be processed by "Transform" event handler-function supplied as argument. Any Stream objects created inside "Transform" event handler-function are screen samples buffer streams.

Example
// Initialization
 Host.SetEvent("Transform", OnTransform);
 dAmp = 1.25;// Set initial value for amplifier

// Script handler-function for "Transform" event
function OnTransform( cTSamples )
{
// Create screen samples buffer input stream for channel 1
 var InStreamObj = Host.CreateStream(1, 0);

// Create screen samples buffer output stream for channel 1
 var OutStreamObj = Host.CreateStream(1, 1);

// Implementing of amplification operation for each sample
// in the screen samples buffer
 for (; cTSamples>0; cTSamples--)
  OutStreamObj( InStreamObj*dAmp );
}

"ScrollScreen" event

Event is invoked each time, when current screen position has been changed.

"ChanParamChanged" event

Event is invoked each time, when user change any channel parameters. Channel number is supplied as argument for event handler-function.

"Stop" event

Event is invoked, when user stops script execution.


Configuration object.

The Configuration object is used for analyser script set up purpose. Configuration object dialog lets user to set up analyser process key parameters. The CreateConfigure Host function should be used to create this object type. The AddItem member function of the Configuration object should be used firstly to fill configuration parameters. When Configuration object has been supplied with parameters, configuration dialog can be shown by Configure member function of this object. New values for all Configuration object parameters can be received by the GetValue member function of this object. Configuration name is defined as parameter of the CreateConfigure function used as registry section name. This registry section is used by the Configuration object to get previous and store new values of the Configuration object parameters.

Example.
// Create Configuration object with name "Example"
 var ConfigObj = Host.CreateConfigure( "Example" );

// Add simple numerical parameter with default value equals to 0
 ConfigObj.AddItem("Param 1", 0);
// Add simple string parameter with default value "Some"
 ConfigObj.AddItem("Param 2", "Some");
// Add choice parameters set with default value "One"
 ConfigObj.AddItem("Param 3", "One\nTwo\nThree");

 if ( ConfigObj.Configure() ) {
// Current configuration has been accepted by user
  var Param1;
  var Param2;
  var Param3;

// Get value for "Param 1" parameter
  Param1 = ConfigObj.GetValue("Param 1");
// Get value for "Param 2" parameter
  Param2 = ConfigObj.GetValue("Param 2");
// Get index value for "Param 3" parameter
  Param3 = ConfigObj.GetValue("Param 3");

  Host.ReportOut("Param 1  value is: " +  Param1 + "\n");
  Host.ReportOut("Param 2  value is: " +  Param2 + "\n");
  Host.ReportOut("Param 3  value is: " +  Param3 + "\n");
 }

Next picture shows the view of the configuration dialog for previous example.

As it shown on a figure, user enter 10 for "Param 1", "Hello" for "Param 2" and "Two" value is chosen for "Param 3". Current configuration values will be accepted when user press "Ok" button of this dialog. As it was described above, Configuration object reads previous values for all parameters from registry. If user press "Defaults" button of the configutation dialog, default values are specified by AddItem function will be used instead. When "Cancel" or close buttons are used, Configure function returns FALSE.
Results are printed by script example, in the report view window according to the configuration dialog shown on the picture above:
Param 1 value is: 10
Param 2 value is: Hello
Param 3 value is: 1

Configuration object functions
AddItem ( strName, DefValue ) | Function adds new parameter to the Configuration object.
AddItemEx ( strDispName, strValName, DefValue ) | Function adds new parameter to the Configuration object.
Configure ( ) | Function shows configuration dialog.
GetValue ( strName ) | Function reads configuration value by name.


Configuration object functions.

AddItem( strName, DefValue )

Function adds new parameter with name strName and default value DefValue to the Configuration object. Parameter DefValue can be defined as string with items are separated by '\n' (0x10) symbol. For example: "One\nTwo\nThree". Such type of configuration parameter will be presented as list for select control. This case user can select single item from selection control list. See example.

AddItemEx( strDispName, strValName, DefValue )

Function adds new parameter with displaying name strDispName and default value DefValue to the Configuration object. Parameter strValName is used as variable name to read/store variable value in the file variables table. Parameter DefValue can be defined as string with items are separated by '\n' (0x10) symbol. For example: "One\nTwo\nThree". Such type of configuration parameter will be presented as list for select control. This case user can select single item from selection control list.

Configure( )

Function shows configuration dialog for given Configuration object. This dialog lets user change configuration parameters values.
Function return TRUE, when user accept configuration with "OK" button.

GetValue( strName )

Function reads new value of configuration parameter with the name strName.


Stream object.

Data streams are served for simplifying and speed improvements of data array processing tasks are built on the script using. Streams are used for analogue data, and can not be used for logic data processing. Since Stream object is created by function CreateStream it is related to specified channel in the oscillogram data array. Streams are classified by direction on input – supplying input data, and output - accumulating data has been processed. Current software version supports two types of input and two types of output streams.
First type is created when CreateStream function used outside "Transform" handler-function context (body). Input stream of this type lets to access oscillogram data for specified channel. Output stream of this type store data into secondary screen buffer for specified channel.
Second type is created when CreateStream function used inside "Transform" handler-function context (body). Input and output streams of this type reads and stores data from or to screen samples buffer. This type of streams can be used for screen samples buffer "transformation" operation, in other words for screen samples buffer data recalculation.

The screen samples buffer contains samples array required for current screen representation. Size of this samples array at least equals to oscillogram screen width multiplied by current zoom value. This samples array is not displayed directly. The channel subtraction operation is performed before, if any channels have active subtraction option. When zoom value different from 1:1, average or peak to peak values for each screen point are calculated before data will be displayed. Therefore screen samples buffer data is involved in channel subtraction and average or peak to peak values calculation.
The secondary screen buffer contains samples array, which displayed directly to screen, without channel subtraction and average or peak to peak values calculation. Size of this buffer equals to current screen width, since each screen dot represents single sample of the secondary screen buffer.

Both output stream types: first - which store data to secondary screen buffer and second - related with screen samples buffer can be used for data "transformation" operation.

Fillowing picture shows streams, buffers and transform function relation.

Where:
1 - first type of input stream;
2 - second type of input and output streams;
3 - first type of output stream.

Using of Stream objects in expressions.

Each time, when input Stream object variable is used in expression, one sample reads from it and stream position incrementing. See example bellow.

// Create input stream for channel 1
 var InStreamObj = Host.CreateStream(1, 0);
 var i;
// Reads 10 samples from InStreamObj object
 for( i=0; i<10; i++ )
  Host.ReportOut( "Value at pos: " + i + "is: " + InStreamObj + "V");
Each time, when output Stream object variable is used in expression with function call style, one sample stores to it and stream position incrementing. See example bellow.
// Create output stream for channel 1
 var OutStreamObj = Host.CreateStream(1, 1);
 var i;
// Writes 10 samples from InStreamObj object
 for( i=0; i<10; i++ )
  OutStreamObj( 0.5*i );
Next example shows possibilities to copy input stream data into output one. Size of data portion to be copied takes as minimal value from output stream empty space and input stream available data.
// Create output and output streams for channel 1
 var InStreamObj = Host.CreateStream(1, 0);
 var OutStreamObj = Host.CreateStream(1, 1);

 InStreamObj.SetPos( iPos + 10 );
 OutStreamObj.SetPos( iPos );

// Shift data by 10 samples
 OutStreamObj( InStreamObj );
Following example similar to previous. In addition, this operation supplied with number of samples that should be copied to destination stream object.
// Copy 200 samples of InStreamObj into OutStreamObj
 OutStreamObj( InStreamObj, 200 );
Next examples explain stream stretch operation.
// Copy 200 samples of InStreamObj into 150 samples of OutStreamObj
 OutStreamObj( InStreamObj, 200, 150 );

// Copy 200 samples of InStreamObj into 300 samples of OutStreamObj
 OutStreamObj( InStreamObj, 200, 300 );
Similarly it is possible to use script data array as input data source. Following example explains this.
// Creates data array
 var aData = Array(-1, 2.5, 3.51, -12.15, 0.16 );

// Copying elements of aData array into 30 elements
// of output stream OutStr with interpolation.
 OutStreamObj(aData, aData.length, 30);

Basic Stream object functions
Reset ( ) | Function sets stream position to 0.
GetPos ( ) | Function returns current stream position.
SetPos ( iPos ) | Function sets current stream position.
Offset ( iOffs ) | Function shifts current stream position.

Input Stream object functions

GetAverage ( ñSamples )

Function calculates average value.

FindFront ( iFront, Level, dT, dV, cSamples )

Function searches for stream position, where signal meets given condition.

FindPeak ( iMinDelta, iAveDepth, iMid, cSamples )

Function searching for signal peak position.

GetMinMax ( bMax, iAveDepth, cSamples )

Function return min/max values for specified interval.

Output Stream object functions

Fill (Level, cSamples, Type )

Function fills output stream.


Basic Stream object functions

Common Stream object functions.

Reset( )

Function sets current stream position to 0.

GetPos( )

Function returns current stream position.

SetPos( iPos )

Function sets current stream position to iPos value.

Offset( iOffs )

Function shifts current stream position by iOffs value.


Input Stream object functions.

GetAverage( ñSamples )

Function calculates average value from current stream position for ñSamples amount of samples. Current stream position is advanced by ñSamples value.

FindFront( iFront, Level, dT, dV, cSamples )

Function similar to FindFront Host function. Function searches for stream position, where signal meets given condition defined by iFront and Level values. Searching starts from current stream position. The iFront - value defines type of required signal front. Following values can be used to define front type iFront:
0 | - for any fronts;
1 | - for raise front;
-1 | - for fall front;
The dT, dV and cSamples parameters are optional, and used for search selectivity. The dT value defines number of samples are used for signal values averaging. The dV value defines threshold of signal level increasing for searched point. Both values shold be positive numbers are not equal to zero. Increasing of dT value can be useful for noise filtering of low frequency signals. Increasing of dV value can be useful for seaching of high frequency signal fronts. Both of these parameters are used in combination for better search function selectivity.
Function returns 1 or -1 for front type has been found, and curent stream position points to searched signal condition. When specified condition does not fond, function returns 0, and curent stream position leave unchanged.
Default values for optional parameters: dT = 1, dV = 1.

Example.
// Create input stream for channel 1
 var InStreamObj = Host.CreateStream(1, 0);
 var iPos = -1;
 var iPeriod;

// Function searches for raise front of the signal
// with crossing 1.0 V level.
 while( InStreamObj.FindFront( 1, 1.0 ) ){
// Front position has been found
  var iNextPos = InStreamObj.GetPos();

  if (iPos >= 0) {
// Previous position exist
   iPeriod = iNextPos - iPos;// Calculate signal period

// Prints period value in report window
   Host.ReportOut("Curent period is:"
                      + iPeriod/Host.Frequency + "s");

// Sets bookmark at front position
   Host.SetMarker(iPos, "Front position");
   }
  iPos = iNextPos;
 }

FindPeak( iMinDelta, iAveDepth, iMid, cSamples )

Function similar to FindPeak Host function. Function searches for stream's signal peak position. Searching starts from current stream position, and continues for cSamples - amount of samples. The MinDelta - value defines threshold of the peak value, and its sign determine peak type. Function searches for signal maximum if MinDelta value is positive, or its minimum, when MinDelta value is negative.
The iAveDepth, iMid and cSamples parameters are optional. The AveDepth value defines number of samples (1…512) are used for data averaging during peak searching. Increasing of this parameter helps to filter out noisy signals. When parameter Mid = 0, result stream position is PeakPos that corresponds to PeakLev signal value. When Mid = 1, result stream position is MidPos placed in the middle between two points which are crossing of signal curve and level FromLev line, see picture. The FromLev is signal level for current stream position iFromPos.
Function return PeakLev value when peak has been found. Curent stream position this case equals to PeakPos or MidPos in depends of Mid parameter value. When searched peak does not found, function returns null, and curent stream position leave unchanged.
Default values for optional parameters: iAveDepth = 1, iMid = 0, cSamples = rest of the stream.

Example.
// Function searches for maximal peak value in stream InStreamObj.
// Peak value should be at least 2.0 V more then current stream position.
 if( (vPeak = InStreamObj.FindPeak(2.0)) != null ) {
// Peak has been found

// Prints peak parameters in report window
  Host.ReportOut("Curent peak position is:"
   + InStreamObj.GetPos() + "peak value is:" + vPeak + "V" );
 }
 else
  break;// Peak does not found

GetMinMax( bMax, iAveDepth, cSamples )

Function searches minimal, maximal values from current stream position for ñSamples amount of samples. Parameter iAveDepth defines number of points for search pre-averaging. Function returns minimal value if bMax=false or maximal when bMax=true. Use GetExtraResult function to get second result.


Output Stream object functions.

Fill( Level, cSamples, iType )

Function fills output stream with Level value, filling begins from current stream position, and continues for cSamples interval. Filling type is defined by iType parameter. When iType = 0 function stores cSamples – values of Level. When Type = 1 function interpolates values linearly from current stream position value to the Level value at the end of cSamples interval.
Parameters Samples and Type are optional. Their default values are: Samples = to the end of stream, iType = 0.


Transforming stream object.

Transforming stream object is input stream object with possibility of data transformation. This functionality is based on the using of filter object that embedded with transforming stream. This filter object performs stream's data transformation. It is possible to use embedded in software filters or external customer filter objects contained in the external objects library. Use CreateStream function with iChannel=0 and InOut=0 to create transforming stream object. Function SetFilter helps to define data source filter object, and filter object parameters.

Following example demonstrates how to create and prepare transform stream for wave to spectrum transformation via embedded in software FFT filter.
// Create transformation stream
 var strFFTransf = Host.CreateStream(0,0);

// Set application embedded "FFT"-filter object, defines channel-1 as data source, use 12-order FFT, output as amplitude values (log=false), pre-average data by 10 points.
 if (strFFTransf != null && strFFTransf.SetFilter("FFT", 1, 12, false, 10))
 { // Stream is ready to use
  var ObjFilterCtrl = strFFTransf.GetFilterCtrl();// Get control interface for filter object functions.

  ObjFilterCtrl.SetFramePos(0);// Set input data frame position
  strFFTransf.SetPos(10);// Set stream output data position (spectral line 10)
  Host.ReportOut("Spectral line 10 amplitude is:"+ strFFTransf + " volts" );
 }
 else
  Host.ReportOut("Unable to create FFT transformation stream");

Tranforming stream object functions
SetFilter( FltObj, DSrc, ...) | Function sets and initialize filter object and data source.
SetSource ( DSrc ) | Function helps to change data source.
GetFilterCtrl ( ) | Function returns filter object control.


Transforming stream object functions.

SetFilter( FltObj, DSrc, ...)

Function sets filter object defined by FltObj parameter for data source DSrc transformation on current stream. Parameters follow by DSrc are filter specific and depended from chosen filter. Parameter FltObj can be defined as application embedded filter name, or filter object from an external objects library. The DSrc parameter can be channel number or other transformation stream object, which will be used as data source. See description of the application embedded filters.

SetSource( DSrc )

Function helps to redefine transforming stream data source with new value DSrc. Same as identical parameter for function SetFilter value of this parameter can be channel number or other transformation stream object, which will be used as data source.

GetFilterCtrl()

Function returns filter object control interface for filter configuration functions call. Not all filters has such set of the functions. See description of the application embedded filters.


Application embedded filters

Analyser panel Host object events.

"Adder" filter

This filter can be used for calculation of sum/difference of two data sources defined by parameters list. List of parameters for SetFilter function is "Adder", DSrc1, DSrc2, DMult2, DMult1, where:
DSrc1 | - data source 1;
DSrc2 | - data source 2;
DMult1 | - data multiplier for source 1 ([+/-] 0.25 ... 4.0);
DMult1 | - data multiplier for source 2 ([+/-] 0.25 ... 4.0).

"FFT" filter

This filter transforms source wave data into spectrum. List of parameters for SetFilter function is "FFT", DSrc, NFFT, LogAmp, AvePts, where:
DSrc | - filter data source;
NFFT | - order of the FFT filter (9...14 or 256...8192 spectral lines);
LogAmp | - type of the output data false-voltage/true-logarithmic amplitude values;
AvePts | - number of pre-averaging of the input data (1...200).
FFT filter object control functions
SetFramePos( iPos ) | Function sets position of the input data frame equals to iPos value.
OffsetFrame( iOffs ) | Function shifts position of the input data frame by iOffs value.
SetZoom( iZoom ) | Function sets new value for pre-averaging equals to iZoom.


Graphic view object.

The Graphic view object controls a graphic view window of the script report. Such viewers helps to display graphical results of analysis. The CreateGraphicView or CreateGraphicViewEx Host functions can be used to create this object type. Graphical data for Graphic view object is supplied by Graphic objects. The AddGraphic or AddGraphicEx functions adds Graphic objects to the Graphic view object. The AddArea function can be used to add area defined by Graphic object to the Graphic view object. Content of Graphic view object can be updated with a help of Update member function. This function should be used to update data for all Graphic objects are displayed by current Graphic view object. By default, Graphic view object find optimal vertical and horizontal scale values ranges to view all added Graphic objects. There is possibility to change view range for horizontal graphic view scale by the help of SetLimits member function. Same functionality can be applied to change vertical scale range. But in difference with horizontal scale, vertical defines for each Graphic object separately, with the help of SetLimits member function of the Graphic object.

Example.
// Creates Graphic view object with a name "Example"
 var GraphViewObj = CreateGraphicView( "Example" );

// Creates Graphic object  - GraphObj1 with
// name: "Graphic1",  unit: "Unit1" and color: 0x00B000
 var GraphObj1 = CreateGraphic( "Graphic1",  "Unit1",  0x00B000 );

// Creates colored Graphic object  - GraphObj2 with
// name: "Graphic2",  unit: "Unit2" and color: 0x00B000
 var GraphObj2 = CreateColoredGraphic( "Graphic2",  "Unit2",  0x0000B0 );

// Creates Graphic object Area1GraphObj with
// name: "Area1",  unit: "" and color: 0x000000
 var Area1GraphObj = CreateGraphic( "Area1",  "",  0x000000 );

// Creates Graphic object Area2GraphObj with
// name: "Area2",  unit: "" and color: 0x000000
 var Area2GraphObj = CreateGraphic( "Area2",  "",  0x000000 );

// Fills GraphObj1 with points
 var i;
 for (i=0; i < 10; i++)
  GraphObj1.AddPoint( i, 0.5*i );

 for (; i <= 20; i++)
  GraphObj1.AddPoint( i, 10-0.5*i );

// Fills GraphObj2 with colored points
 GraphObj2.AddColorPoint ( 0, 0.0, 0xB00000 );
 GraphObj2.AddColorPoint ( 5, 2.0, 0x008000 );
 GraphObj2.AddColorPoint ( 15, 2.0, 0x0000B0 );
 GraphObj2.AddColorPoint ( 20, 0.0, 0x000000 );

// Fills Area1GraphObj with points
  Area1GraphObj.AddPoint( 5, 0.0 );
  Area1GraphObj.AddPoint( 5, 5.0 );
  Area1GraphObj.AddPoint( 15, 5.0 );
  Area1GraphObj.AddPoint( 15, 0.0 );

// Fills Area2GraphObj with points
  Area2GraphObj.AddPoint( 0, 0.0 );
  Area2GraphObj.AddPoint( 10, 2.5 );
  Area2GraphObj.AddPoint( 20, 0.0 );

// Adds GraphObj1 to the GraphViewObj as dot with lines type (2)
// and defines new color for GraphObj1 displaying: 0x000080
 GraphViewObj.AddGraphicEx( GraphObj1, 2, 0x000080 );

// Adds GraphObj2 to the GraphViewObj
 GraphViewObj.AddGraphic ( GraphObj2 );

// Adds Area1GraphObj to the GraphViewObj as area
// filled with 0xFFD0D0 - color
 GraphViewObj.AddArea( Area1GraphObj, 0xFFD0D0 );

// Adds Area2GraphObj to the GraphViewObj as area
// filled with 0xFFD0D0 - color
 GraphViewObj.AddArea( Area2GraphObj, 0xD0FFD0 );

// Sets default (0) vertical scale step and color for GraphObj1
 GraphObj1.SetScale( 0, 0x00B000 );

// Set horizontal scale step and color for GraphViewObj
 GraphViewObj.SetScale( 1.0, 0xB0B0B0 );

// Set vertical scale range for GraphObj2
 GraphObj2.SetLimits( 0, 5.0 );

// Set vertical scale range forArea2GraphObj
 Area2GraphObj.SetLimits( 0, 5.0 );

// Update graphic view data
 GraphViewObj.Update();

// Set GraphViewObj description
 GraphViewObj.SetDescription("Graphic view object example");

// Add GraphViewObj Notation
 GraphViewObj.AddNotation( "This is notation example",  "Some.html" );

 ReportOut("Ok")

// Activate GraphViewObj window
 GraphViewObj.Show();

Next picture shows view of graphic view window for given script example.

Graphic view object member variables
MainAxisName Variable keeps name of horizontal scale unit for current Graphic view object.

Graphic view object functions

AddArea ( objGraphic, vColor )

Function adds Graphic object which defines colored area to current Graphic view object.

AddGraphic ( objGraphic )

Function adds new Graphic object to current Graphic view object.

AddGraphicEx ( objGraphic, DrawType, vColor )

Function adds new Graphic object to current Graphic view object with additional parameters.

AddNotation ( strText, strDescFile )

Function adds notation text for current Graphic view object.

AddComment ( strCommentText, iType, vGraphic, PtX, PtY, strCmd )

Function adds comment text for some graphic in current Graphic view object.

CreateHelper ( strFileName, strTitle, dWidthFactor )

Function sets Helper view object for given Graphic view object.

GetItemIndex ([vGraphic])

Function returns index for given object.

SetEvent ( strName, evFunc )

Function sets event function for given Graphic view object.

SetBkColor ( vColor )

Function sets background color for current Graphic view object.

SetDescription ( strText )

Function adds description for current Graphic view object.

SetGraphic ( vGraphic, iDrawType, vColor, vFlags )

Function changes parameters for given Graphic object

SetGraphic ( vGraphic, strValType, vValue )

Function changes parameter for given Graphic object

SetMarker ( iMark, dXVal )

Function sets measurement marker for given Graphic view object.

SetLimits ( vMin, vMax )

Function sets horizontal scale rage for current Graphic view object.

SetScale ( vStep, vColor )

Function sets horizontal scale step and color for current Graphic view object.

Show ( )

Function activate window of current Graphic view object.

Update ( )

Function updates all data for current Graphic view object.

ZoomToValues ( vMinX, vMaxX, vMinY, vMaxY, vGraphic )

Function recalculates vertical and horizontal zoom values by specified parameters.


Graphic view object functions.

AddArea( objGraphic, vColor )

Function adds Graphic object specified by objGraphic parameter which defines colored by vColor parameter area.

AddGraphic( objGraphic )

Function adds new Graphic object specified by objGraphic parameter to the current Graphic view object.

AddGraphicEx( objGraphic, iDrawType, vColor )

Function is extension of the AddGraphic function. Function adds new Graphic object specified by objGraphic parameter, with draw type iDrawType, and color vColor. Following types of iDrawType parameter can be used:
0 | - lines;
1 | - only dots;
2 | - dots and lines;
3 | - thin line;
14 | - graphic area is colored by vColor paremeter.

AddNotation( strText, strDescFile )

Function adds notation text - strText for current Graphic view object. The strDescFile parameter describes HTML file, which will be loaded if user press notation "Details" button. Notation text will be displayed in rectangular area at the top of graphic view window see picture.

AddComment( strCommentText, iType, vGraphic, PtX, PtY, strCmd )

Function adds comment text - strCommentText for graphic(s) defined by vGraphic parameter. This value can be whether Graphic object or name of the graphics group. The iType value defines comment type, following type values are defined:
0 | - information;
1 | - warning;
2 | - critical.
The PtX and PtY parameters define values for the graphic point that described by current comment. Parameter strCmd defines command string, which will be executed when user activate current comment item. Command string contains directives separated by space or comma symbols. Following command directives are supported by current program version:
AP=angle | - displays arrow pointer at point PtX, PtY which direction defined by angle parameter in degrees, when angle=0 arrow direction from right to left and rotates anticlockwise;
CP=radius | - displays circle area with specified radius [8-20] around point PtX, PtY;
HL | - highlighting graphic(s) specified by vGraphic parameter;
ZT=Xmin;Xmax;Ymin;Ymax | - zooming graphics view to the area specified by Xmin, Xmax, Ymin, Ymax values for graphic(s) defined by vGraphic parameter (see ZoomToValues function description);
AD=X1;Y1;X2;Y2;X3;Y3;... | - defines area which position and size defined by set of values X1, Y1, X2, Y2, X3, Y3, and etc, maximum 20 dots;
AC=RRGGBB | - defines color value that used for area filling.

Example.
// Creates Graphic view object with a name "Example"
 var GraphViewObj = CreateGraphicView( "Example" );
// Creates Graphic object
 var GraphObj1 = CreateGraphic( "Graphic1",  "Unit1",  0x00B000 );

//...............................................................

// Add comment, iType=0,  vGraphic=GraphObj1, PtX=100.0, PtY=50.0.
// Command defines: graphic highlight (HL),
// arrow poiter is rotated by 45 degrees (AP=45),
// ZoomToView command wich set current view to
// left=75.0, right=125.0, top=75.0, bottom=25.0 (ZT=...)
 GraphViewObj.AddComment("This is comment example", 0, GraphObj1, 100.0, 50.0, "HL, AP=45, ZT=75.0;125.0;25.0;75.0");

CreateHelper( strFileName, strTitle, dWidthFactor )

Function creates Helper view object from file is defined by parameter strFileName. Screen area for the given graphic view is splitted horizontally by the the help of the value defined by the dWidthFactor parameter. Helper view area is titled by strTitle parameter value. Function returns Helper control object to control Helper view object, or null if the function fails. Current software version support the Macromedia flash files - "*.swf", as the source file type for the strFileName parameter. The dWidthFactor defines following screen splitting modes by the type of its value:
0.0 < dWidthFactor < 1.0 - this value type define width/height ration for the helper view window;
dWidthFactor < 0 - this value type define percentage width for the helper view window in relation to whole graphic view screen width;
1 < dWidthFactor - this value type define width in pixels for the helper view window.

GetItemIndex([vGraphic])

Function returns index of the Graphic object defined by vGraphic parameter, that has been added previously by the help of AddGraphic or AddGraphicEx functions. If optional parameter vGraphic does not defined, function returns index of the current graphic view in the report tab control order.

SetEvent( strName, evFunc )

Function sets function defined by evFunc parameter, as event handler function for event type defined by strName parameter. Current software version support following graphic view events:
"Activate" | - event handler for current graphic view activation/deactivation events, function receive boolean parameter as the current view status;
"MClick" | - event handler for mouse click event, function receive Graphic relation object as single parameter;
"MMarker" | - event handler for measurement marker move event, function receive X values for both markers, that are pointed by them in current graphic view.

The "MClick" event handler function can returns string result prefixed with following prefixes to perform additional functions:
"INF:PopupText" | - to display popup message-box with PopupText", at current mouse position, use SetPopupPos function of the Graphic relation object to change this position;
"POS:iPos" | - to jump to the oscillogram position is defined by iPos value;
"ZSEL:iSelBeg, iSelEnd" | - to select part of the oscillogram by iSelBeg, iSelEnd values and perform zoom to view function.

SetMarker( iMark, dXVal )

Function sets measurement marker index - iMark into position dXVal. Parameter iMark can has value 0/1 for the markers 'A'/'B' accordingly. Parameter dXVal defines corresponded X value for the graphic position which marker has to point on.

SetBkColor( vColor )

Function sets Graphic view object background color to vColor value.

SetDescription( strText )

Function adds description text - strText for current Graphic view object. Description text will be displayed at the top of graphic view window see picture.

SetGraphic( vGraphic, iDrawType, vColor, vFlags )

Function changes display parameters: iDrawType, vColor and vFlags for Graphic object(s), specified by vGraphic parameter. if vGraphic parameter is Graphic object, function change the display parameters for it. When vGraphic parameter is Graphic object name, function changes display parameters for all graphics with given name within current Graphic view object. See description of AddGraphicEx function for valid values of iDrawType parameter. Parameter vFlags is bit fields combination value. Next values are defined in the current software version:
bit 0 | - if this bit is 1, graphic(s) defined by vGraphic is initially hidden;
bit 1 | - if this bit is 1, graphic(s) defined by vGraphic is displayed with inverted Y-axis.

SetGraphic( vGraphic, strValType, vValue )

Function changes parameter name: strValType, with new value: vValue for Graphic object(s), specified by vGraphic parameter. if vGraphic parameter is Graphic object, function change strValType parameter for it. When vGraphic parameter is Graphic object name, function change strValType parameter for all graphics with given name within current Graphic view object. Valid values for strValType parameter and corresponded type of the vValue to set:
"Type" | - vValue is iDrawType value see AddGraphicEx function description;
"Color" | - vValue is vColor value see AddGraphicEx function description;
"Flags" | - vValue is vFlags value see SetGraphic( vGraphic, iDrawType, vColor, vFlags ) function description.

SetLimits( vMin, vMax )

Function sets horizontal scale range to vMin and vMax values. By default, Graphic view object find optimal range for horizontal scale values to view all embedded Graphic objects. Instead of this, current function defines leftmost and rightmost values for Graphic view horizontal scale as vMin and vMax accordingly.

SetScale( vStep, vColor )

Function sets horizontal scale step and color for current Graphic view object to vStep and vColor values accordingly. When vStep value equals to 0, program will calculate horizontal scale step automatically.

Show( )

Function activates current Graphic view object window.

Update( )

Function updates all data for current Graphic view object. Use this function to display all changes has been made with Graphic object(s).

ZoomToValues( vMinX, vMaxX, vMinY, vMaxY, vGraphic )

Function recalculates vertical and horizontal zoom values by specified parameters: vMinX, vMaxX, vMinY, vMaxY and vGraphic. The vMinX and vMaxX values will be used to calculate horizontal zoom value. And vMinY and vMaxY values in combination with vGraphic parameter help to calculate vertical zoom value. if vGraphic parameter is Graphic object, function takes its values range for vertical zoom calculation. When vGraphic parameter is graphic object name, function uses values range for all graphics with given name within current Graphic view object. Resulting view will have vMinX and vMaxX values as leftmost and rightmost, and vMinY and vMaxY values as bottommost and topmost accordingly.


Graphic object.

The Graphic object contains graphic dots array. This array can be displayed by the help of Graphic view object. Each graphic dot is defined by X and Y real number values for argument and function values accordingly. There are two types of the Graphic objects: simple and colored. Use CreateGraphic Host function to create simple Graphic objects, or CreateColoredGraphic Host function to create colored Graphic objects. Both types of graphics support AddPoint function to add new point. When this function is used for colored graphic type, default color of current graphic will be accepted for new dot. Colored type of Graphic object supports AddColorPoint function. This function lets to define different colors for graphic dots. Graphic dots are displayed in the order of filling. The OrderPoints funtion can be used to change order accordingly to the X value increasing. Range of the Y (function) values can be set by SetLimits funtion of the Graphic object. It is recommended to use SetLimits funtion, with identical values, for each graphics, which has same unit type of Y values, and displayed by the same Graphic view object. Thus single vertical scale will be used for such Graphic objects in this Graphic view object. Vertical scale step and color for Graphic object can be set by SetScale member function.
See example of Graphic object using.

Graphic object functions
AddPoint ( X, Y ) | Function adds new point to current Graphic object.
AddColorPoint ( X, Y, vColor ) | Function adds new point with specified color to current Graphic object.
GetValueFor ( X ) | Function returns Y value that corresponds to given X value of the Graphic object.
GetXAt ( iPos ) | Function returns X value for given position of the Graphic object.
GetYAt ( iPos ) | Function returns Y value for given position of the Graphic object.
OrderPoints ( ) | Function sets points order for current Graphic object.
SetLimits ( vMin, vMax ) | Function sets vertical scale range for current Graphic object.
SetScale ( vStep, vColor ) | Function sets horizontal scale step and color for current Graphic object.
Reset ( ) | Function deletes all points of current Graphic object.


Graphic object functions.

AddPoint( X, Y )

Function adds new point with X and Y values to current Graphic object.

AddColorPoint( X, Y, vColor )

Function adds new point with X and Y values and color - vColor to current Graphic object.

GetValueFor( dX )

Function returns linearly interpolated Y - value for the given X value defined by dX parameter. Or null, if X value out of graphic range.

GetXAt( iPos )

Function returns X - value in graphic object points array at index defined by iPos parameter. if given iPos index out of range function returns null.

GetXAt( iPos )

Function returns Y - value in graphic object points array at index defined by iPos parameter. if given iPos index out of range function returns null.

OrderPoints( )

Function sets new order for all points of current Graphic object in the order of X value increasing.

SetLimits( vMin, vMax )

Function sets vertical scale range for current Graphic object. The vMin and vMax values are accepted as minimal and maximal vertical scale values accordingly.

SetScale( vStep, vColor )

Function sets vertical scale step and color to vStep and vColor values accordingly.

Reset( )

Function deletes all points of current Graphic object.


Draw object.

Draw object is supplied with a set of functions, which lets drawing on program screen context. Two constants of the Rectangle object: rScreen and rScale are used to define coordinates of screen and scale accordingly.
See "BeforeDraw" and "AfterDraw" samples of using Draw object.

Draw object constants
rScreen | Constant of the Rectangle object type, which defines coordinates of the program viewer screen area.
rScale | Constant of the Rectangle object type, which defines coordinates of the screen scale area.
WhiteBkGround | Constant is TRUE, when program's wite background option is on, or FALSE otherwise.

Draw object functions

DrawLine ( X1, Y1, X2, Y2 )

Function draws line.

DrawRect ( X1, Y1, X2, Y2 )

Function draws pentangular frame.

DrawText ( X, Y, P, strText )

Function draws text.

FillRect ( X1, Y1, X2, Y2 )

Function fills pentangular area.

PolyLine ( ArDots )

Function draws a set of line segments.

PolyFill ( ArDots )

Function draws a set of line segments, and fill inside area.

SetPen ( vColor )

Function defines pen color for lines drawing.

SetBrush ( vColor )

Function defines brush color for fill function.

SetTextColor ( vColor )

Function defines text color.

SetFont ( strName, iSize, iWeight, bItalic )

Function creates font for text drawing function.


Draw object functions.

DrawLine( X1, Y1, X2, Y2 )

Function draws a line defined by two points. First has X1, Y1 coordinates, and second: X2, Y2 accordingly. The line is drawn with the pen, which parameters can be defined by SetPen function.

DrawRect( X1, Y1, X2, Y2 )

Function draws a rectangular frame, where X1, Y1 coordinates define top-left, and X2, Y2 - bottom-right corners of this frame accordingly. The frame is drawn with the pen, which parameters can be defined by SetPen function.

DrawText( X, Y, P, strText )

Function draws a text defined by strText, relatively point is defined by X, Y coordinates. Parameter P defines position of X, Y point relatively to the text bounding rectangle, see picture. Text drawing font can be defined by SetFont function, and SetTextColor function defines text color.

FillRect( X1, Y1, X2, Y2 )

Function fills a rectangular area, where X1, Y1 coordinates define top-left, and X2, Y2 - bottom-right corners of this area accordingly. The area is filled with the brush, which color can be defined by SetBrush function.

PolyLine( ArDots )

Function draws a series of line segments by connecting the points in the specified array of points are defined by ArDots Array object. The lines are drawn with the pen, which parameters can be defined by SetPen function.

Example.
function OnDraw( DrawObj )
{
 DrawObj.SetPen(0x00FFFF);// Set Pen color to 0x00FFFF
 // Fill dots array (x0, y0, x1, y1, ...)
 var Points = Array(10,20, 20,10, 20,30, 10,20);
 DrawObj.PolyLine( Points );
}

PolyFill( ArDots )

Function draws a series of line segments by connecting the points in the specified array of points are defined by ArDots Array object. The lines are drawn with the pen, which parameters can be defined by SetPen function. Inside area is filled with the brush, which color can be defined by SetBrush function.

Example.
function OnDraw( DrawObj )
{
 DrawObj.SetPen(0x00FFFF);// Set Pen color to 0x00FFFF
 DrawObj.SetBrush(0x00FF00);// Set Brush color to 0x00FF00
 // Fill dots array (x0, y0, x1, y1, ...)
 var Points = Array(10,20, 20,10, 20,30, 10,20);
 DrawObj.PolyFill( Points );
}

SetPen( vColor )

Function sets a pen color to vColor value. The pen is used for lines drawing functions.

SetBrush( vColor )

Function sets a brush color to vColor value. The brush is used for area filing.

SetTextColor( vColor )

Function sets a text color to vColor value. This color is used for text drawing function DrawText.

SetFont( strName, iSize, iWeight, bItalic )

Function creates a font with the typeface name of the font specified by strName parameter. Empty ("") value of this parameter defines default font name. The font size is specified by iSize parameter in logical units. The iWeight parameter specifies weight of the font in the range 0 through 10. For example, 4 is normal and 7 is bold. If this value is zero, a default weight is used. The bItalic parameter specifies an italic font if set to TRUE.


Rectangle object.

The Rectangle object is used for rectangular area description. Object has following member items which are:
left | - leftmost area coordinate;
top | - toptmost area coordinate;
right | - rightmost area coordinate;
bottom | - bottommost area coordinate.

The Rectangle object member functions.
Width ( ) | Function returns current rectangular area width.
Height ( ) | Function returns current rectangular area height.


File variables object.

The file variables object helps to read and store variables values are kept in the oscillogram file. Following example demonstrates how such variables can be stored and read to/from oscillogram file.

Example.
// Get file variables object
 var FileVd =  Host.GetFileVD();
// Save integer variable with name:"SomeInt" and value:0x123
 FileVd.SetVariable( "SomeInt", 0x123 );
// Save string variable with name:"SomeStr" and value:"abc"
 FileVd.SetVariable( "SomeStr", "abc" );
// Save float variable with name:"SomeFlt" and value:1.1
 FileVd.SetVariable( "SomeFlt", 1.1 );

// Read all variables from file
 if( FileVd.FindFirst(""))
 {
  var strVarName;

  ReportOut("> List of variables >>>\n");
// Get name of the next variable, if such exist ( strVarName.length > 0 )
  while ((strVarName = FileVd.FindNext()).length > 0)
  {
// Display variable name and value
   ReportOut( strVarName+"="+FileVd.GetVariable(strVarName, "")+"\n" );
  }
 }
 else
  ReportOut("File has no variables");
file variables object functions
GetVariable ( strVarName, DefValue ) | Function reads variable value from the file variables data.
SetVariable ( strVarName, Value ) | Function store variable value to the file variables data.
Delete ( strVarName ) | Function deletes variable from the file variables data.
FindFirst ( strFilter ) | Function initiate searching of variables in the file variables data.
FindNext ( ) | Function returns next searching variable name in the file variables data.


File variables object functions.

GetVariable( strVarName, DefValue )

Function reads value of the variable named strVarName, from file variables data. If such variable does not found DefValue will be returned instead. Type of DefValue defines type of variable will be returned by this function call (string or number).

SetVariable( strVarName, Value )

Function store Value of the variable named strVarName to the file variables data.

Delete( strVarName )

Function deletes variable named strVarName from the file variables data.

FindFirst( strFilter )

Function initiate searching of all variables from the file variables data, which corresponds to the value of strFilter. When value of strFilter="" all variables will be returned one by one each call of the FindNext function. If for example strFilter="Some", all variable which contains "Some" part in their name will be returned.

FindNext( )

Function returns next variable name in the file variables data, which corresponds to the searching sequence is defined by the previous call of the FindFirst function.


Type data access object

Types names enumerator object.

The types names enumerator object helps to get all registred in application types names one by one. This can be done by using Next member function. The Reset member function of this object can be used to restart enumeration process from beginning.
Use GetVarTypes member function of the Host object to receive this object.

Example.
  var strTypeName;
  // Get Types names enumerator object
  var TypeEnum =  Host.GetVarTypes( );

  while((strTypeName = TypeEnum.Next()).length != 0)
  {// Next type exist. Get type data access object for current type name
   var TypeData =  Host.GetTypeData( strTypeName );

   if (TypeData != null)// Display type name and "Formula" value for current type
    ReportOut("Type name:" + strTypeName + " formula: " + TypeData.GetValue("Formula", "") + "\n");
  }

Next()

Function returns name of the next type. When all types have been returned, function returns empty string to signaling the end.

Reset()

Function reset enumeration position, so the new enumeration can be started from begining.

Type data access object.

The type data access object helps to access to the data of the chosen type. The GetValue member function of this object helps to access required value for current type.
Use GetTypeData member function of the Host object to receive this object.

GetValue( strVarName, DefValue )

Function reads value named strVarName, from current type. If such value does not exist DefValue will be returned instead. Type of the DefValue defines type of variable will be returned by this function call (string or number).


Report object

HTML Report functional extends.

HTML Report has functional extension witch helps user with report items navigation. This extension can be achieved by using Report object from embedded script.

Report object constant
CurPath Path to currently executed script file.

Report object functions

ActivateItem ( iItem, iSubItem )

Function activates described report item.

ShowOscPosition ( iPos )

Function shows described oscillogram position.

ShellOpen ( strFileName )

Function opens file in the specified for its extension software.

SetCmdFunction ( strCmdName, CmdFunction )

Function sets HTML embedded function for specified command.


Report object functions.

ActivateItem( iItem, iSubItem )

Function activates report item defined by iItem parameter, iSubItem parameter defines element of report item that should be shown. The iItem parameter is index of required item of the report tab control. Where 0 - is text report item, 1 - HTML report item, 2... - graphic view items. The iSubItem parameter is defined only for graphic view items which has comments see AddComment function of Graphic view object, for the rest items this parameter should be 0. Values of iSubItem parameter from 1 to N defines comments indexes that should be activated by this function.

ShowOscPosition( iPos )

Function shows oscillogram position defined by iPos parameter. When current position is pointed by bookmark marker, this marker also activated.

ShellOpen( strFileName )

Function opens file strFileName in the software is registered to open files with current file extension.

SetCmdFunction( strCmdName, CmdFunction )

Function sets HTML embedded function is defined by parameter CmdFunction for command specified by parameter strCmdName. Current software version support following values of the strCmdName parameter:
"Save" | - save HTML report function, function receives file name parameter as argument;
"ItemActivate" | - activate HTML report item defined by "si" tag, function receives sub item index-1 as argument;


Graphic Relation Object.

This object is passed as parameter for "MClick" event handler function. Object helps to perform some functionality by the using of the following member functions.

GetValX()

Function returns X value that corresponds to the graphic position pointed by mouse cursor.

GetValFor( vGraphic )

Function returns Y value for the graphic defined by vGraphic parameter, or null if any errors occurs. The vGraphic value can be Graphic object or index of the Graphic object in the current graphic view. Use GetItemIndex( GraphicObject ) function to determinate this graphic object index. If vGraphic - object/index points to the simple graphic, function ignore mouse vertical position, and return exact or nearest Y value. When vGraphic is area, function recalculate mouse vertical position to the corresponded Y value for it.

SetPopupPos( vGraphic, [dY, [dX]])

Function can be used to define position for the popup message-box. The vGraphic parameter defines object/index of the graphic which will used for calculation of the vertical popup position. The dY, dX are optional. If these parameters do not defined software use current horizontal mouse position and corresponded vGraphic vertical position as popup position. Parameter dY can define vertical popup position in relation to the graphic vGraphic scale. Parameter dX can redefine horizontal popup position.


HelperCtrlObject

Helper control object.

The Helper control object helps to control helper object with a set of the following functions.

Call( strFuncName, [Params...])

Function calls helper object function defined by strFuncName parameter, with the list of the optional arguments [Params...].

WaitForReady( msTimeout )

Function is used for synchronization with helper object. Function waits for ready event set by helper object for millisecond time out value defined by msTimeout parameter. Function returns true when event has been set or false if time out value has elapsed.

Remove()

Function hides helper object.


Text report functional extends.

Text report has functional extension witch lets to define some tags that can change text attributes or performe some functions. This tags is enclosed with '<' '>' simbols. Description of these tags follow below.

<ta=TXT_COL, BCK_COL>

This tag defines text atributes TXT_COL - for text color, and BCK_COL - for background. Both parameters is defined as hexadecimal values see color format. Parameter BCK_COL is optional. When any text follows by text atribute tag, than its parametes describe font and background colors for this text enclosed within this tag. Other case, text atributes are used from current position until the end of line.

<sp=OSC_POS CTRL_TEXT>

This tag defines oscillogram position OSC_POS in the term of samples. Text CTRL_TEXT that follows by OSC_POS parameter, defines description displayed in the report window.

<si=ITEM, SUBITEM CTRL_TEXT>

This tag defines report item ITEM, and SUBITEM that should be activated by this control tag. Text CTRL_TEXT that follows by tag parameter(s), defines description displayed in the report window.

<zs=OSC_POS_BEGIN, OSC_POS_END CTRL_TEXT>

This tag helps to zoom oscillogram part has been defined by OSC_POS_BEGIN and OSC_POS_END samples positions. Text CTRL_TEXT that follows by tag parameter(s), defines description displayed in the report window.

<es={SCRIPT_TO_EXECUTE}[INFO_TXT\tPOPUP_TXT] CTRL_TEXT>

This tag helps to define script SCRIPT_TO_EXECUTE which runs when user click on current item. Parameters - [INFO_TXT \t POPUP_TXT] are optional and define text INFO_TXT that will be displayed in the app-info bar (left-bottom side of the screen) and popup tool-tip text POPUP_TXT. See example bellow.

Example
 var ViewObjDesc;// Description object which keeps current highlight-item parameters

 // Install background screen draw function, which will be used for user defined highlight functionality.
 Host.SetEvent("BeforeDraw", DrawBefore);

// Out 'es'- tag item in the report window with 'MyShowFunc' - script function call, and followed description enclosed by [...].
 Host.ReportOut("\n<es={MyShowFunc('Some text', 60, 20, 20, 100, 100);}[Press to show on oscillogram\tShow] Show this to me>");

// Screen background draw function
function DrawBefore( ObjDraw )
{
  if (ViewObjDesc != null) {// Does any highlight-object is defined
   ObjDraw.SetBrush(0x004000);
   ObjDraw.FillRect( ViewObjDesc.x, ViewObjDesc.y, ViewObjDesc.x1, ViewObjDesc.y1 );
  }
}

// Function that defines new ViewObjDesc object.
function MyShowFunc( strComment, pos, x, y, x1, y1 )
{
  ViewObjDesc = new Object;
  ViewObjDesc.x = x;
  ViewObjDesc.y = y;
  ViewObjDesc.x1 = x1;
  ViewObjDesc.y1 = y1;
  ViewObjDesc.sCmnt = strComment;
  Host.SetScreenPos(pos);
}


External libraries.

External libraries is extension of the program DSP functionality. This type of libraries can be used for fast processing of program`s data streams, and based on DLLs with "*.aol" file extension. It is usual windows DLL module, which exports special type of script objects. Single library can contains set of such script objects. The CreateLibObj Host object function can be used to create single object contained in specified library module. Function supplied with parameter of library version, which checks version compatibility during object creation.


Notes.

iChannel

This parameter type defines channel number, which data will be used for current operation. Valid range for this parameter type: from 1 to Host.Channels.

vColor

Parameter type defines color in hex format: 0xRRGGBB, where:
RR - is value from 00 to FF (255) for red component of color value;
GG - is value from 00 to FF (255) for green component of color value;
BB - is value from 00 to FF (255) for blue component of color value.

Optional parameters

It is possible to refuse some or all optional parameters in the function arguments list. Next example explain an optional parameters using rule, for function Func( P1, P2, 01, 02, 03 ), where 01, 02, 03 - parameters are optional.
Func( P1, P2, P3 ) | - None of the optional parameters are used.
Func( P1, P2, P3, 01 ) | - Only first optional parameter is used.
Func( P1, P2, P3, 01, O2 ) | - First two optional parameters are used.
Func( P1, P2, P3, 01, O2, O3 ) | - All optional parameters are used.

Coordinates

Program use coordinate system, where zeoro X value is leftmost screen point, and its value increasing in the right direction. And zeoro Y value is topmost screen point, and its value increasing in the bottom direction.