new Cloud(runtime)
Cloud IO Device responsible for sending and receiving messages from cloud provider (mananging the cloud server connection) and interacting with cloud variables in the current project.
Parameters:
Name | Type | Description |
---|---|---|
runtime |
Runtime | The runtime context for this cloud io device. |
Members
(nullable) provider :CloudProvider
Reference to the cloud data provider, responsible for mananging the web socket connection to the cloud data server.
Type:
(non-null) runtime :Runtime
Reference to the runtime that owns this cloud io device.
Type:
(nullable) stage :Target
Reference to the stage target which owns the cloud variables in the project.
Type:
Methods
clear()
Request the cloud data provider to close the web socket connection and clear this io device of references to the cloud data provider and the stage.
postData(data)
Handle incoming data to this io device.
Parameters:
Name | Type | Description |
---|---|---|
data |
CloudIOData | The CloudIOData object to process |
requestDeleteVariable(name)
Request the cloud data provider to delete the variable with the given name Does nothing if this io device does not have a provider set.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The name of the variable to delete |
requestRenameVariable(oldName, newName)
Request the cloud data provider to rename the variable with the given name to the given new name. Does nothing if this io device does not have a provider set.
Parameters:
Name | Type | Description |
---|---|---|
oldName |
string | The name of the variable to rename |
newName |
string | number | The new name for the variable |
requestUpdateVariable(name, value)
Request the cloud data provider to update the given variable with the given value. Does nothing if this io device does not have a provider set.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The name of the variable to update |
value |
string | number | The value to update the variable with |
setProvider(provider)
Set a reference to the cloud data provider.
Parameters:
Name | Type | Description |
---|---|---|
provider |
CloudProvider | The cloud data provider |
setStage(stage)
Set a reference to the stage target which owns the cloud variables in the project.
Parameters:
Name | Type | Description |
---|---|---|
stage |
Target | The stage target |
updateCloudVariable(varUpdate)
Update a cloud variable in the runtime based on the message received from the cloud provider.
Parameters:
Name | Type | Description |
---|---|---|
varUpdate |
VarData | A VarData object describing a cloud variable update received from the cloud data provider. |