/**
 * Copyright (c) 2021, 2026 Contributors to the Eclipse Foundation
 *
 * This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License 2.0
 * which is available at https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 */
Machine Tutorial // <1>

PeripheralType Clamp { // <2>
  Actions {
    clamp
    unclamp
  }
}

PeripheralType Motor { // <3>
  Actions {
    apply_brake
  }
  SetPoints {
    X [m]
    Y
  }
  Axes {
    X [mm] moves X
    Y [mm] moves Y
  }
  Conversion "X=X/1000;Y=Y/1000" // <4>
}

Resource Robot1 { // <5>
  C: Clamp
  M: Motor {
    AxisPositions { // <6>
      X (Left, Right)
      Y (Above)
    }
    SymbolicPositions { // <7>
      Above_Left (X.Left, Y.Above)
      Above_Right (X.Right, Y.Above)
      Below_Left (X.Left)
      Below_Right (X.Right)
    }
    Profiles (normal, slow) // <8>
    Paths { // <9>
      Above_Right --> Below_Right [Y] profile slow
      Below_Right --> Above_Right profiles normal, slow // <10>
      Above_Left [X] <-> Above_Right profile slow
      FullMesh {
        profile normal
        Above_Left
        Above_Right
        Below_Left [Y]
      }
    }
  }
}

Resource Robot2 {
  C: Clamp
  M: Motor {
    AxisPositions {
      X (Left, Right)
      Y (Above, Below)
    }
    SymbolicPositions {
      Above_Left (X.Left, Y.Above)
      Above_Right (X.Right, Y.Above)
      Center
      Center_Below_Left
      Below_Left (X.Left, Y.Below)
      Below_Right (X.Right, Y.Below)
    }
    Profiles (normal, slow)
    Paths {
      FullMesh {
        profiles normal, slow
        Above_Left
        Above_Right
        Center
        Center_Below_Left
        Below_Left
        Below_Right
      }
    }
  }
}