|
@@ -481,25 +481,23 @@ namespace PunkHPX8_RT.Devices.AXIS
|
|
|
public bool CheckMotoPositionInPosition(string position,double offset)
|
|
public bool CheckMotoPositionInPosition(string position,double offset)
|
|
|
{
|
|
{
|
|
|
double checkPosition = 0;
|
|
double checkPosition = 0;
|
|
|
|
|
+ bool isInStation = false;
|
|
|
foreach (Station item in _stationAxis.Stations)
|
|
foreach (Station item in _stationAxis.Stations)
|
|
|
{
|
|
{
|
|
|
if (item.Name == position)
|
|
if (item.Name == position)
|
|
|
{
|
|
{
|
|
|
|
|
+ isInStation = true;
|
|
|
checkPosition = double.Parse(item.Position);
|
|
checkPosition = double.Parse(item.Position);
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- checkPosition = checkPosition + offset;
|
|
|
|
|
-
|
|
|
|
|
- if(MotionData.MotorPosition <= checkPosition + _stationAxis.ToleranceDefault &&
|
|
|
|
|
- MotionData.MotorPosition >= checkPosition - _stationAxis.ToleranceDefault)
|
|
|
|
|
- {
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
|
|
+ if (!isInStation)
|
|
|
{
|
|
{
|
|
|
|
|
+ LOG.WriteLog(eEvent.INFO_AXIS, $"{Module}.{Name}", $"position:{position} is not in Station list");
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
+ checkPosition = checkPosition + offset;
|
|
|
|
|
+ return Math.Abs(MotionData.MotorPosition - checkPosition) <= _stationAxis.ToleranceDefault;
|
|
|
}
|
|
}
|
|
|
/// <summary>
|
|
/// <summary>
|
|
|
/// 计算所处当前工位
|
|
/// 计算所处当前工位
|