Skip to content

Latest commit

 

History

History
72 lines (58 loc) · 2 KB

File metadata and controls

72 lines (58 loc) · 2 KB

Manipulate Optix nodes

Warning

This page describes low-level features and should be used with caution as they can potentially lead to unexpected results or even break your project. These features are not officially supported and may be subject to changes in future releases.

Note

Nodes behavior can only be manipulated at runtime.

Stopping an Optix node

Once nodes are stopped, they stop interacting with the system for example an ODBC database node will stop processing queries, a Trend node will stop logging data, an Alarm node will stop monitoring conditions, etc.

This can be useful in some scenarios to disable some components (like the Signing Workflow node) or to temporarily stop some processes (like a Trend node) without deleting them.

/// <summary>
/// Stops an Optix node if it is started
/// </summary>
/// <param name="node">The node to be stopped</param>
private void StopNode(IUANode node)
{
    // Only objects can be started/stopped
    if (node is IUAObject nodeObject && node.Status == NodeStatus.Started)
    {
        // Stop the node
        nodeObject.Stop();
    }
        
}

Starting an Optix node

/// <summary>
/// Starts an Optix node if it is stopped
/// </summary>
/// <param name="node">The node to be started</param>
private void StartNode(IUANode node)
{
    // Only objects can be started/stopped
    if (node is IUAObject nodeObject && node.Status != NodeStatus.Started)
    {
        // Start the node
        nodeObject.Start();
    }
        
}

Restarting an Optix node

This is simply a combination of the previous two methods

/// <summary>
/// Restarts an Optix node if it is started
/// </summary>
/// <param name="node">The node to be restarted</param>
private void RestartNode(IUANode node)
{
    // Only objects can be started/stopped
    if (node is IUAObject nodeObject && node.Status == NodeStatus.Started)
    {
        // Restart the node
        nodeObject.Stop();
        nodeObject.Start();
    }
        
}