Class: WebPDA

WebPDA

WebPDA

new WebPDA(url, username, password)

Create a new WebPDA object, which establish a new connection to the server.

Parameters:
Name Type Description
url

url of the webpda server.

username

user name

password

password for the user

Source:
Returns:

a new WebPDA object.

Classes

PV

Methods

addOnServerMessageCallback(callback)

Add a callback that will be notified when there is a notification message from server.

Parameters:
Name Type Description
callback WebPDA~OnServerMessageCallback

the callback

Source:

addWebSocketOnCloseCallback(callback)

Add a callback to WebSocket onClose event.

Parameters:
Name Type Description
callback WebPDA~WebSocketEventCallback

the callback function on WebSocket close event.

Source:

addWebSocketOnErrorCallback(callback)

Add a callback to WebSocket onError event.

Parameters:
Name Type Description
callback WebPDA~WebSocketEventCallback

the callback function on WebSocket error event.

Source:

addWebSocketOnOpenCallback(callback)

Add a callback to WebSocket onOpen event.

Parameters:
Name Type Description
callback WebPDA~WebSocketEventCallback

the callback function on WebSocket open event.

Source:

close()

Close Websocket.

Source:

createPV(name, minUpdatePeriodInMs, bufferAllValues)

Create a control system PV.

Parameters:
Name Type Description
name string

name of the PV.

minUpdatePeriodInMs number

the minimum update period in millisecond.

bufferAllValues boolean

if all values should be buffered during the update period.

Source:
Returns:

the pv.

getAllPVs() → {Array.<WebPDA~PV>}

Get all PVs on this client.

Source:
Returns:

All PVs in an array.

Type
Array.<WebPDA~PV>

getPV(id) → {WebPDA~PV}

Get the PV from its id.

Parameters:
Name Type Description
id number

id of the PV.

Source:
Returns:

the PV.

Type
WebPDA~PV

internalCreatePV(parameterObj, comapareFunc)

Create PV internally. This function should only be called by subclass. Client should not call this function.

Parameters:
Name Type Description
parameterObj object

the object that contains parameters to create the PV, which can be used to identify this internal PV.

comapareFunc function

the function to compare if two internal PVs are identical to avoid creating an extra channel to server.

Source:

login(username, password)

Send login command to server.

Parameters:
Name Type Description
username string
password string
Source:

logout()

Send logout command to server.

Source:

removeWebSocketOnOpenCallback(callback)

Remove a WebSocket onOpen callback.

Parameters:
Name Type Description
callback WebPDA~WebSocketEventCallback

the callback function on WebSocket open event.

Source:

sendText(text)

Send text to server using WebSocket. This function is for internal use only.

Parameters:
Name Type Description
text string
Source:

setPVValue(pv, value)

Set PV Value.

Parameters:
Name Type Description
pv WebPDA~PV

the PV

value object

the value to be set. It must be a value type that the PV can accept, for example, a number for numeric PV.

Source:

setPVValueById(id, value)

Set PV's value by the PV's id.

Parameters:
Name Type Description
id number

id of the PV

value object

to be written. Type of the value should be acceptable by the PV.

Source:

setServerBufferSize(size)

Set server side buffer size. The server side buffer is used to temporarily buffer the data to be sent to client when there is temporary disconnection, so the client won't lose any data for temporary disconnection. The connection will be closed by server when the buffer is full. The default buffer size is 100K. The max allowed size is 1M.

Parameters:
Name Type Description
size number

buffer size in byte.If the buffer size is larger than 1M, it will be coerced to 1M.

Source:

Type Definitions

OnServerMessageCallback(message)

A callback function that will be notified when there is a message from server.

Parameters:
Name Type Description
message object

the message object which is usually an error or info message in following format: {"msg":"Info","title":"the title","details":"The details"}

Source:

WebSocketEventCallback(event)

A callback function on WebSocket open/close/error event.

Parameters:
Name Type Description
event WebSocket.Event

the WebSocket event.

Source: