Class ClientScriptingFunctions

java.lang.Object
com.inductiveautomation.sfc.client.scripting.ClientScriptingFunctions
All Implemented Interfaces:
SfcRpcFunctions

public class ClientScriptingFunctions extends Object implements SfcRpcFunctions
  • Constructor Details

    • ClientScriptingFunctions

      public ClientScriptingFunctions(SfcRpcFunctions rpc)
  • Method Details

    • startChart

      public UUID startChart(String projectName, String username, String chartPath, Map<String,Object> parameters) throws Exception
      Description copied from interface: SfcRpcFunctions
      Start a Chart in Project projectName from the definition at chartPath.
      Specified by:
      startChart in interface SfcRpcFunctions
      Parameters:
      projectName - the name of the project the chart definition resides in.
      chartPath - the path to the chart definition.
      parameters - the parameters passed to the chart scope.
      Returns:
      The UUID of the running chart instance.
      Throws:
      Exception
    • cancelChart

      public void cancelChart(UUID instanceId)
      Description copied from interface: SfcRpcFunctions
      Cancels the chart instance indicated by instanceId.
      Specified by:
      cancelChart in interface SfcRpcFunctions
      Parameters:
      instanceId - the UUID of the chart instance to stop.
    • pauseChart

      public void pauseChart(UUID instanceId)
      Description copied from interface: SfcRpcFunctions
      Pause the chart instance indicated by instanceId.
      Specified by:
      pauseChart in interface SfcRpcFunctions
      Parameters:
      instanceId - the UUID of the chart instance to pause.
    • resumeChart

      public void resumeChart(UUID instanceId)
      Description copied from interface: SfcRpcFunctions
      Resume the chart instance indicated by instanceId.
      Specified by:
      resumeChart in interface SfcRpcFunctions
      Parameters:
      instanceId - the UUID of the chart instance to resume.
    • debugStep

      public void debugStep(UUID instanceId)
      Description copied from interface: SfcRpcFunctions
      Sends a message to the chart instance stopped at a breakpoint to step to the next step.
      Specified by:
      debugStep in interface SfcRpcFunctions
    • debugResume

      public void debugResume(UUID instanceId)
      Description copied from interface: SfcRpcFunctions
      Sends a message to the chart instance stopped at a breakpoint to resume normal operations.
      Specified by:
      debugResume in interface SfcRpcFunctions
    • setVariables

      public void setVariables(UUID instanceId, org.python.core.PyObject variablesMap)
      Description copied from interface: SfcRpcFunctions
      Updates the chart indicated by instanceId by copying all of the variables from the provided variableMap into the chart's scope.
      Specified by:
      setVariables in interface SfcRpcFunctions
      Parameters:
      instanceId - the of the chart instance to update.
      variablesMap - a dictionary containing key-value pairs of serializable things to update in chart scope.
    • setStepVariables

      public void setStepVariables(UUID instanceId, UUID stepId, org.python.core.PyObject variablesMap)
      Description copied from interface: SfcRpcFunctions
      Updates the chart indicated by instanceId by copying all of the variables from the provided variableMap into the charts specified step scope.
      Specified by:
      setStepVariables in interface SfcRpcFunctions
      Parameters:
      instanceId - the of the chart instance to update.
      stepId - the of the running step to update.
      variablesMap - a dictionary containing key-value pairs of serializable things to update in chart scope.
    • getAllRunningCharts

      public List<ChartInfo> getAllRunningCharts()
      Description copied from interface: SfcRpcFunctions
      Returns information about the currently running charts.
      Specified by:
      getAllRunningCharts in interface SfcRpcFunctions
      Returns:
      Chart information about all of the currently running charts.
    • getRunningChartsForId

      public List<ChartInfo> getRunningChartsForId(ResourceId resourceId)
      Description copied from interface: SfcRpcFunctions
      Returns information about the currently running instances of a resource.
      Specified by:
      getRunningChartsForId in interface SfcRpcFunctions
    • getRunningChartsForPath

      public List<ChartInfo> getRunningChartsForPath(String chartPath) throws Exception
      Description copied from interface: SfcRpcFunctions
      Returns information about the currently running instances of a given chart path.
      Specified by:
      getRunningChartsForPath in interface SfcRpcFunctions
      Throws:
      Exception
    • getVariables

      public PyChartScope getVariables(UUID instanceId) throws Exception
      Description copied from interface: SfcRpcFunctions
      Returns the chart scope for the specified instance. Step scopes for active steps are found under the "activeSteps" key.
      Specified by:
      getVariables in interface SfcRpcFunctions
      Throws:
      Exception
    • getChartStatus

      @Nullable public ChartStatus getChartStatus(UUID instanceId, boolean includeModel)
      Description copied from interface: SfcRpcFunctions
      Get the ChartStatus for a chart.
      Specified by:
      getChartStatus in interface SfcRpcFunctions
      Parameters:
      instanceId - the instance id of the chart.
      includeModel - if true, include the ChartUIModel in the ChartStatus.
      Returns:
      the ChartStatus, or null if no chart for instanceId exists.
    • browseRecordings

      public List<RecordingMeta> browseRecordings(Date start, Date end, String chartPathFilter, String instanceUuidFilter)
      Description copied from interface: SfcRpcFunctions
      Returns information about recordings that match the provided filters. If a filter parameter is null it is not used.
      Specified by:
      browseRecordings in interface SfcRpcFunctions
      chartPathFilter - a string that will be used to match the chart path of the recording.
    • loadRecording

      public EventTimeline loadRecording(String file) throws Exception
      Specified by:
      loadRecording in interface SfcRpcFunctions
      Throws:
      Exception
    • redundantCheckpoint

      public void redundantCheckpoint(UUID instanceId) throws Exception
      Description copied from interface: SfcRpcFunctions
      For charts that have the "redundancy sync" setting enabled, this method synchronizes chart and step variables of the specified chart instance across the redundant cluster, allowing the instance to continue where it left off if a redundant failover occurs.
      Specified by:
      redundantCheckpoint in interface SfcRpcFunctions
      Parameters:
      instanceId - the UUID of the chart instance to update.
      Throws:
      Exception - if the redundant peer is not set up or connected, or if the chart does not have redundancy sync enabled.