Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ XR Connected Worker Template

Step 7: Define each procedure

  • Last UpdatedJan 20, 2025
  • 2 minute read

Defining procedures involves editing the apm_data_sampleAsset.xml script file and defining the sampleAsset.procedures data structure. The data structure will define the information that populates the UI to allow the user to select procedure.

This exercise involves filling out these two sections of data structure:

<!-- BallBearing Procedure Mapping -->

<struct name="ProcedureBallBearing">

. . .

</struct>

<!-- Piston Procedure Mapping -->

<struct name="ProcedurePistons">

. . .

</struct>

Define a procedure

  1. Provide internal struct name defined in <struct name="name"> structure.

  2. Set procedure’s title and specify these values:

    • numberOfSteps — Relates to length of animation clip. Example: 11 steps * 60 frames per step = 660 length clip.

    • setUpCallback — This is the Start procedure callback defined in Set up Start Coroutines for each procedure.

    • exitCallback — This is the Exit procedure callback defined in Set up Exit Coroutines for each procedure.

    • nextStepCallback — This defines a standard callback (apm_crt_simpleAnimationClipEnginePlayStep) for the simple animation step engine provided by the APM module where the entire animation is provided by one AnimationClip. Keep this value unless you want to override the default step, next step animation approach.

    • prevStepCallback — This defines a standard callback (apm_crt_simpleAnimationClipEnginePlayStep) for the simple animation step engine provided by the APM module where the entire animation is provided by one AnimationClip. Keep this value unless you want to override the default step, next step animation approach.

    • useAutomaticStepText — Set to false for setting up your own step text approach; otherwise setting this to true will leverage the lang.xml Localization to look up Step Titles and Descriptions using naming convention.

Code example

This is a code example of procedure mapping.

<define name="sampleAsset.procedures" type="config" >

<!-- Dropdown definition -->

<item name="numberOfDropdowns" value="1" />

<struct name="dropdownList_0">

<item name="entries" value="BallBearing,Pistons" />

</struct>

<!-- Procedure Mapping -->

<struct name="procedureMapping" >

<item name="numberOfMappings" value="2" />

<item name="rule_0" value="BallBearing" />

<item name="procedure_0" value="ProcedureBallBearing" />

<item name="rule_1" value="Pistons" />

<item name="procedure_1" value="ProcedurePistons" />

</struct>

<!-- BallBearing Procedure Datastructure -->

<struct name="ProcedureBallBearing">

<item name="title" value="ProcedureBallBearing" />

<item name="numberOfSteps" value="11" />

<item name="setUpCallback" value="launch_proc_BallBearing" />

<item name="nextStepCallback" value="apm_crt_simpleAnimationClipEnginePlayStep" />

<item name="prevStepCallback" value="apm_crt_simpleAnimationClipEnginePlayStep" />

<item name="exitCallback" value="exit_proc_BallBearing" />

<item name="useAutomaticStepText" value="true" />

</struct>

<!-- Piston Procedure Datastructure -->

<struct name="ProcedurePistons">

<item name="title" value="ProcedurePistons" />

<item name="numberOfSteps" value="15" />

<item name="setUpCallback" value="launch_proc_Pistons" />

<item name="nextStepCallback" value="apm_crt_simpleAnimationClipEnginePlayStep" />

<item name="prevStepCallback" value="apm_crt_simpleAnimationClipEnginePlayStep" />

<item name="exitCallback" value="exit_proc_Pistons" />

<item name="useAutomaticStepText" value="true" />

</struct>

</define>

At the bottom of the apm_data_sampleAsset.xml file, in the section "START / EXIT PROCEDURES SETTINGS", add the variable related to the procedures. Adding this code avoids any error messages due to the APM module expecting these per-procedure dictionaries.

<Var name="sampleAsset-ProcedureBallBearing" type="dstring" value=""/>

<Var name="sampleAsset-ProcedurePistons" type="dstring" value=""/>

TitleResults for “How to create a CRG?”Also Available in