/// <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. /// 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> /// 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> /// 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(); } }
/// <summary> /// Initializes a new instance of the Digital Output class by duplicating an existing Digital Output instance. /// </summary> /// <param name="digitalOutput"> The Digital Output instance to duplicate. </param> public DigitalOutput(DigitalOutput digitalOutput) { _name = digitalOutput.Name; _isActive = digitalOutput.IsActive; }