/// <summary> /// Method to create an absolute joint movement. /// </summary> /// <param name="name">Name of joint target, must be unique.</param> /// <param name="internalAxisValues">List of internal axis values. The length of the list should be equal to 6.</param> /// <param name="externalAxisValues">List of external axis values. The length of the list should be (for now) equal to 1.</param> /// <param name="speedData"> The SpeedData as a SpeedData </param> /// <param name="zoneData"> The ZoneData as a ZoneData </param> /// <param name="robotTool"> The Robot Tool. This will override the set default tool. </param> public AbsoluteJointMovement(string name, List <double> internalAxisValues, List <double> externalAxisValues, SpeedData speedData, ZoneData zoneData, RobotTool robotTool) { _name = name; _internalAxisValues = CheckInternalAxisValues(internalAxisValues); _externalAxisValues = CheckExternalAxisValues(externalAxisValues); _speedData = speedData; _movementType = MovementType.MoveAbsJ; // The movement type is always an Absolute Joint Movement _zoneData = zoneData; _robotTool = robotTool; }
/// <summary> /// Method to create a absolute joint movement with an empty robot tool (no override). /// </summary> /// <param name="name">Name of joint target, must be unique.</param> /// <param name="internalAxisValues">List of internal axis values. The length of the list should be equal to 6.</param> /// <param name="externalAxisValues">List of external axis values. </param> /// <param name="speedData"> The SpeedData as a SpeedData </param> /// <param name="precision"> Robot movement precision. This value will be casted to the nearest predefined zonedata value. Use -1 for fine. </param> public AbsoluteJointMovement(string name, List <double> internalAxisValues, List <double> externalAxisValues, SpeedData speedData, int precision) { _name = name; _internalAxisValues = CheckInternalAxisValues(internalAxisValues); _externalAxisValues = CheckExternalAxisValues(externalAxisValues); _speedData = speedData; _movementType = MovementType.MoveAbsJ; // The movement type is always an Absolute Joint Movement _zoneData = new ZoneData(precision); _robotTool = new RobotTool(); // Default Robot Tool tool0 _robotTool.Clear(); // Empty Robot Tool }
/// <summary> /// Method to create an absolute joint movement with internal and external axis values. /// </summary> /// <param name="name">Name of joint target, must be unique.</param> /// <param name="internalAxisValues">List of internal axis values. The length of the list should be equal to 6.</param> /// <param name="externalAxisValues">List of external axis values. </param> public AbsoluteJointMovement(string name, List <double> internalAxisValues, List <double> externalAxisValues) { _name = name; _internalAxisValues = CheckInternalAxisValues(internalAxisValues); _externalAxisValues = CheckExternalAxisValues(externalAxisValues); _speedData = new SpeedData(5); // Slowest predefined tcp speed _movementType = MovementType.MoveAbsJ; // The movementType is always an Absolute Joint Movement _zoneData = new ZoneData(0); _robotTool = new RobotTool(); // Default Robot Tool tool0 _robotTool.Clear(); // Empty Robot Tool }
/// <summary> /// Initializes a new instance of the Speed Data class by duplicating an existing Speed Data instance. /// </summary> /// <param name="speeddata"> The Speed Data instance to duplicate. </param> public SpeedData(SpeedData speeddata) { _referenceType = speeddata.ReferenceType; _name = speeddata.Name; _v_tcp = speeddata.V_TCP; _v_ori = speeddata.V_ORI; _v_leax = speeddata.V_LEAX; _v_reax = speeddata.V_REAX; _predefined = speeddata.PreDefinied; _exactPredefinedValue = speeddata.ExactPredefinedValue; }
/// <summary> /// Initializes a new instance of the Movement class. /// This constructor is typically used to cast a Robot Target to a movement. /// </summary> /// <param name="target"> The Target. </param> public Movement(ITarget target) { _movementType = 0; _target = target; _id = -1; _speedData = new SpeedData(5); // Slowest predefined tcp speed _zoneData = new ZoneData(0); _robotTool = new RobotTool(); // Default Robot Tool tool0 _robotTool.Clear(); // Empty Robot Tool _workObject = new WorkObject(); // Default work object wobj0 _digitalOutput = new DigitalOutput(); // InValid / empty DO }
/// <summary> /// Protected constructor needed for deserialization of the object. /// </summary> /// <param name="info"> The SerializationInfo to extract the data from. </param> /// <param name="context"> The context of this deserialization. </param> protected Movement(SerializationInfo info, StreamingContext context) { // int version = (int)info.GetValue("Version", typeof(int)); // <-- use this if the (de)serialization changes _movementType = (MovementType)info.GetValue("Movement Type", typeof(MovementType)); _target = (ITarget)info.GetValue("Target", typeof(ITarget)); _id = (int)info.GetValue("ID", typeof(int)); _speedData = (SpeedData)info.GetValue("Speed Data", typeof(SpeedData)); _zoneData = (ZoneData)info.GetValue("Zone Data", typeof(ZoneData)); _robotTool = (RobotTool)info.GetValue("Robot Tool", typeof(RobotTool)); _workObject = (WorkObject)info.GetValue("Work Object", typeof(WorkObject)); _digitalOutput = (DigitalOutput)info.GetValue("Digital Output", typeof(DigitalOutput)); }
/// <summary> /// Initializes a new instance of the Movement class. /// </summary> /// <param name="movementType"> The Movement Type. </param> /// <param name="target"> The Target. </param> /// <param name="speedData"> The Speed Data. </param> /// <param name="zoneData"> The Zone Data. </param> /// <param name="robotTool"> The Robot Tool. This will override the set default tool. </param> /// <param name="workObject"> The Work Object. </param> /// <param name="digitalOutput"> The Digital Output. When set this will define a MoveLDO or a MoveJDO instruction. </param> public Movement(MovementType movementType, ITarget target, SpeedData speedData, ZoneData zoneData, RobotTool robotTool, WorkObject workObject, DigitalOutput digitalOutput) { _movementType = movementType; _target = target; _id = -1; _speedData = speedData; _zoneData = zoneData; _robotTool = robotTool; _workObject = workObject; _digitalOutput = digitalOutput; CheckCombination(); }
/// <summary> /// Initializes a new instance of the Movement class with a default Work object (wobj0) and an empty Digital Output. /// </summary> /// <param name="movementType"> The Movement Type. </param> /// <param name="target"> The Target. </param> /// <param name="speedData"> The Speed Data. </param> /// <param name="zoneData"> The Zone Data. </param> /// <param name="robotTool"> The Robot Tool. This will override the set default tool. </param> public Movement(MovementType movementType, ITarget target, SpeedData speedData, ZoneData zoneData, RobotTool robotTool) { _movementType = movementType; _target = target; _id = -1; _speedData = speedData; _zoneData = zoneData; _robotTool = robotTool; _workObject = new WorkObject(); // Default work object wobj0 _digitalOutput = new DigitalOutput(); // InValid / empty DO CheckCombination(); }
/// <summary> /// Initializes a new instance of the Movement class with an empty Robot Tool (no override) and a default Work Object (wobj0) /// </summary> /// <param name="movementType"> The Movement Type. </param> /// <param name="target"> The Target. </param> /// <param name="speedData"> The Speed Data.</param> /// <param name="zoneData"> The Zone Data. </param> /// <param name="digitalOutput"> The Digital Output. When set this will define a MoveLDO or a MoveJDO instruction. </param> public Movement(MovementType movementType, ITarget target, SpeedData speedData, ZoneData zoneData, DigitalOutput digitalOutput) { _movementType = movementType; _target = target; _id = -1; _speedData = speedData; _zoneData = zoneData; _robotTool = new RobotTool(); // Default Robot Tool tool0 _robotTool.Clear(); // Empty Robot Tool _workObject = new WorkObject(); // Default work object wobj0 _digitalOutput = digitalOutput; CheckCombination(); }
/// <summary> /// Creates a new absolute joint movement by duplicating an existing absolute joint movement. /// This creates a deep copy of the existing absolute joint movement. /// </summary> /// <param name="jointMovement"> The absolute joint movement that should be duplicated. </param> /// <param name="duplicateMesh"> A boolean that indicates if the meshes should be duplicated. </param> public AbsoluteJointMovement(AbsoluteJointMovement jointMovement, bool duplicateMesh = true) { _name = jointMovement.Name; _internalAxisValues = new List <double>(jointMovement.InternalAxisValues); _externalAxisValues = new List <double>(jointMovement.ExternalAxisValues); _speedData = jointMovement.SpeedData.Duplicate(); _movementType = jointMovement.MovementType; _zoneData = jointMovement.ZoneData.Duplicate(); if (duplicateMesh == true) { _robotTool = jointMovement.RobotTool.Duplicate(); } else { _robotTool = jointMovement.RobotTool.DuplicateWithoutMesh(); } }
/// <summary> /// Initializes a new instance of the Movement class by duplicating an existing Movement instance. /// </summary> /// <param name="movement"> The Movement instance to duplicate. </param> /// <param name="duplicateMesh"> Specifies whether the meshes should be duplicated. </param> public Movement(Movement movement, bool duplicateMesh = true) { _movementType = movement.MovementType; _target = movement.Target.DuplicateTarget(); _id = movement.SyncID; _speedData = movement.SpeedData.Duplicate(); _zoneData = movement.ZoneData.Duplicate(); _digitalOutput = movement.DigitalOutput.Duplicate(); if (duplicateMesh == true) { _robotTool = movement.RobotTool.Duplicate(); _workObject = movement.WorkObject.Duplicate(); } else { _robotTool = movement.RobotTool.DuplicateWithoutMesh(); _workObject = movement.WorkObject.DuplicateWithoutMesh(); } }