Differences between SDK and Whisker Commands

Top  Previous  Next

The Whisker SDK Type library contains procedures that map onto the Whisker Command set. There are some slight differences, which are outlined below (syntax examples assume VisualBasic, with an SDK control called 'Whisker'). All Events, Methods, Properties and Constants, along with a description of their use, can be viewed in the Object Browser within Visual Basic.

 

Server Messages will produce Events in the control's container (e.g. Visual Basic Form) .

 

For example, in Visual Basic, if a SDK control (called Whisker) receives an Event: message, for example, it will call the  Whisker_Event() subroutine of the form which contains it.

 

Constants have been added to the type library to represent certain values which are given in the Command set as strings. For example, wsLineOn and wsLineOff represent the two line states (On = 1 and Off = 0). See the sections on LineReadState and LineSetState in the Programmer's reference, for important considerations using these values with VisualBasic.

 

Certain Whisker Commands (ReportName, ReportStatus, Version, ClientNumber, TestNetLatency, TimeStamps, SetMediaDirectory, DisplayEventCoords, and PermitClientMessages) have been implemented as properties. These can be read and, where appropriate, changed like any other object properties. View the SDKControlLib in the Object Browser for more details. Examples:

 

Whisker.Status = "I'm OK"

Whisker.ClientName = "Example Client"

myNumber = Whisker.ClientNumber

strServerVersion = Whisker.ServerVersion

netLatency = Whisker.TestNetLatency

 

Drawing commands are treated slightly differently, so that default pen, brush and text settings can be configured by the user. See the topic Drawing with the SDK for more details.

 

DisplayGetSize is replaced by:

       

       DisplayGetSize(Device As String, Width As Long, Height As Long)

 

If this call succeeds, the variables X and Y (which must be variables of type Long in VisualBasic) will contain the size of the display device named. For example:

       

       Dim X As Long, Y As Long.

       Whisker.DisplayGetSize "Screen", x, y

 

LineSetState and LineReadState can be replaced by the shorthand

 

       Whisker.LineState(LineName As String)

 

For example, a line called "toplight" could be set using

 

       Whisker.LineState(toplight) = wsLineOn

 

Similarly, the current state could be read using

 

       CurrentState = Whisker.LineState(toplight)

 

AudioPlaySound does not have a -loop option in the SDK. Rather, a second command AudioLoopSound is provided.
AudioLoadTone does not have a duration option in the SDK. Rather, a second command AudioLoadToneX is provided.