/// <summary> Move the current stage by a relative distance. </summary> /// <param name="addresses"> The addresses of the stages to be moved. </param> /// <param name="step"> The relative step distance. </param> /// <returns> True if the stage was moved succesfully. </returns> /// <seealso cref="Home(List<char>, ELLBaseDevice.DeviceDirection)"/> /// <seealso cref="MoveAbsolute(List<char>, decimal)"/> /// <seealso cref="MoveRelative(List<char>, decimal)"/> /// <seealso cref="JogForward(List<char>)"/> /// <seealso cref="JogBackward(List<char>)"/> public bool MoveRelative(List <char> addresses, decimal step) { if (IsDeviceBusy()) { return(false); } if (!addresses.Any()) { return(MoveRelative(step)); } SetToGroupAddress(addresses); UpdateOutput(string.Format("Move device by {0}...", DeviceInfo.FormatPosition(step, true, true))); int pulses = DeviceInfo.UnitToPulse(step); if (pulses == 0) { return(true); } ELLDevicePort.SendStringI32(Address, "mr", pulses); if (!WaitForPositions(addresses)) { return(false); } return(true); }
/// <summary> Sets the current device jogstep size. </summary> /// <param name="jogstepSize"> The size of the jogstep. </param> /// <returns> True if the jog step were set succesfully. </returns> public bool SetJogstepSize(decimal jogstepSize) { UpdateOutput(string.Format("Set Jog Step to {0}...", DeviceInfo.FormatPosition(jogstepSize))); int pulses = DeviceInfo.UnitToPulse(jogstepSize); ELLDevicePort.SendStringI32(Address, "sj", pulses); if (!WaitForJogstepSize("gs", false)) { return(false); } _jogstepSize = jogstepSize; return(true); }
/// <summary> Sets the home offset for the current stage. </summary> /// <param name="offset"> The stage offset. </param> /// <returns> True if the Offset were set. </returns> /// <seealso cref="HomeOffset"/> /// <seealso cref="GetHomeOffset()"/> public bool SetHomeOffset(decimal offset) { UpdateOutput(string.Format("Set Home Offset to {0}...", DeviceInfo.FormatPosition(offset, true, true))); int pulses = DeviceInfo.UnitToPulse(offset); ELLDevicePort.SendStringI32(Address, "so", pulses); if (!WaitForHomeOffset("gs", false)) { return(false); } _homeOffset = offset; return(true); }
public bool MoveRelative(PolarizerPaddlePositions displacements) { try { int encodedPosition = GetEncodedPosition(displacements, true); UpdateOutput(string.Format("Move paddles by {0},{1},{2}...", displacements.Paddle1, displacements.Paddle2, displacements.Paddle3)); ELLDevicePort.SendStringI32(Address, "mr", encodedPosition); return(WaitForPositions()); } catch (OverflowException) { UpdateOutput(string.Format("Parameter out of range {0},{1},{2}...", displacements.Paddle1, displacements.Paddle2, displacements.Paddle3)); } return(false); }
public bool MoveAbsolute(PolarizerPaddlePositions positions) { try { int encodedPosition = GetEncodedPosition(positions, false); UpdateOutput(string.Format("Move paddles to {0},{1},{2}...", positions.Paddle1, positions.Paddle2, positions.Paddle3)); ELLDevicePort.SendStringI32(Address, "ma", encodedPosition); return(WaitForPositions()); } catch (OverflowException) { UpdateOutput(string.Format("Parameter out of range {0},{1},{2}...", positions.Paddle1, positions.Paddle2, positions.Paddle3)); } return(false); }
/// <summary> Move the current stage to an absolute position. </summary> /// <param name="position"> The required position. </param> /// <returns> True if the stage was moved succesfully. </returns> /// <seealso cref="Position"/> /// <seealso cref="GetPosition()"/> /// <seealso cref="MoveRelative(decimal)"/> /// <seealso cref="MoveAbsolute(List<char>, decimal)"/> /// <seealso cref="MoveRelative(List<char>, decimal)"/> public bool MoveAbsolute(decimal position) { if (IsDeviceBusy()) { return(false); } UpdateOutput(string.Format("Move device to {0}...", DeviceInfo.FormatPosition(position, true, true))); int pulses = DeviceInfo.UnitToPulse(position); ELLDevicePort.SendStringI32(Address, "ma", pulses); if (!WaitForPosition()) { return(false); } return(true); }
/// <summary> Move the given stages to an absolute position. </summary> /// <param name="addresses"> The addresses of the devices to be moved. </param> /// <param name="position"> The required position. </param> /// <returns> True if the stages were moved succesfully. </returns> /// <seealso cref="Home(List<char>, ELLBaseDevice.DeviceDirection)"/> /// <seealso cref="MoveAbsolute(List<char>, decimal)"/> /// <seealso cref="MoveRelative(List<char>, decimal)"/> /// <seealso cref="JogForward(List<char>)"/> /// <seealso cref="JogBackward(List<char>)"/> public bool MoveAbsolute(List <char> addresses, decimal position) { if (IsDeviceBusy()) { return(false); } if (!addresses.Any()) { return(MoveAbsolute(position)); } SetToGroupAddress(addresses); UpdateOutput(string.Format("Move device to {0}...", DeviceInfo.FormatPosition(position, true, true))); int pulses = DeviceInfo.UnitToPulse(position); ELLDevicePort.SendStringI32(Address, "ma", pulses); if (!WaitForPositions(addresses)) { return(false); } return(true); }