---
description: Test for placing a ToolType inside a MachineTool instance

metadata:
  name: Tooltype placement test

resources:
  opcuaServer:
    type: Cybus::Server::Opcua
    properties:
      hostname: 192.168.178.46
      securityModes: [ 'None', 'SignAndEncrypt' ]
      securityPolicies: [ 'None', 'Basic256Sha256' ]
      nodesetFiles: [ 'di', 'machinery', 'machineTool' ]
      allowAnonymous: true
      port: 4841

  ######################################
  #
  # referencing the "Machines" folder
  # which got provided by the Machinery
  # nodeset file
  #
  ######################################
  machineRoot:
    type: Cybus::Node::OpcuaReference
    properties:
      parent: !ref opcuaServer
      referenceNodeId: 'i=1001'
      namespaceUrl: 'http://opcfoundation.org/UA/Machinery/'

  ######################################
  #
  # instantiating a MachineToolType
  # from the MachineTool type
  #
  ######################################
  testMachineToolType:
    type: Cybus::Node::OpcuaObject
    properties:
      parent: !ref machineRoot
      browseName: MyMachineToolTypeTest
      objectTypeName: MachineToolType
      sourceNamespaceUrl: 'http://opcfoundation.org/UA/MachineTool/'



  ######################################
  #
  # referencing the "Equipment" subfolder
  # of the instantiated toolType
  #
  ######################################
  EquipmentFolder:
    type: Cybus::Node::OpcuaReference
    properties:
      parent: !ref testMachineToolType
      relativeBrowsePath: '/4:Equipment'

  ######################################
  #
  # add a toolList type
  # of the instantiated toolType
  #
  ######################################
  toolList:
    type: Cybus::Node::OpcuaObject
    properties:
      parent: !ref EquipmentFolder
      browseName: Tools
      objectTypeName: ToolListType
      sourceNamespaceUrl: 'http://opcfoundation.org/UA/MachineTool/'

  
  #########################################
  #
  # instantiating a ToolType and placing it
  # into the tools list folder of the instance
  #
  ########################################
  demoToolInstance:
    type: Cybus::Node::OpcuaObject
    properties:
      parent: !ref toolList
      browseName: DemoTool
      objectTypeName: ToolType
      sourceNamespaceUrl: 'http://opcfoundation.org/UA/MachineTool/'
