|
@@ -709,7 +709,6 @@ namespace CyberX8_RT.Modules.Transporter
|
|
|
RState ret = _moveToRoutine.Monitor();
|
|
|
if (ret == RState.Failed || ret == RState.Timeout)
|
|
|
{
|
|
|
- _targetCell = "";
|
|
|
_currentRoutine = null;
|
|
|
if (Singleton<RouteManager>.Instance.IsAutoRunning)
|
|
|
{
|
|
@@ -754,6 +753,7 @@ namespace CyberX8_RT.Modules.Transporter
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ _targetCell = "";
|
|
|
if (Singleton<RouteManager>.Instance.IsAutoRunning)
|
|
|
{
|
|
|
AlarmListManager.Instance.CheckModuleAlamAndRemove(Module.ToString(), TransporterState.MovingTo.ToString());
|
|
@@ -822,10 +822,7 @@ namespace CyberX8_RT.Modules.Transporter
|
|
|
{
|
|
|
_currentRoutine = null;
|
|
|
_targetCell = "";
|
|
|
- if (!string.IsNullOrEmpty(_sourceCell))
|
|
|
- {
|
|
|
- _sourceCell = "";
|
|
|
- }
|
|
|
+ _sourceCell = "";
|
|
|
AlarmListManager.Instance.CheckModuleAlamAndRemove(Module.ToString(), TransporterState.Placing.ToString());
|
|
|
}
|
|
|
return result;
|
|
@@ -1041,8 +1038,6 @@ namespace CyberX8_RT.Modules.Transporter
|
|
|
RState ret = _transferRoutine.Monitor();
|
|
|
if (ret == RState.Failed || ret == RState.Timeout)
|
|
|
{
|
|
|
- _targetCell = "";
|
|
|
- _sourceCell = "";
|
|
|
_currentRoutine = null;
|
|
|
if (Singleton<RouteManager>.Instance.IsAutoRunning)
|
|
|
{
|
|
@@ -1085,6 +1080,8 @@ namespace CyberX8_RT.Modules.Transporter
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ _targetCell = "";
|
|
|
+ _sourceCell = "";
|
|
|
if (Singleton<RouteManager>.Instance.IsAutoRunning)
|
|
|
{
|
|
|
AlarmListManager.Instance.CheckModuleAlamAndRemove(Module.ToString(), TransporterState.Transfering.ToString());
|
|
@@ -1200,11 +1197,11 @@ namespace CyberX8_RT.Modules.Transporter
|
|
|
double otherPosition = otherGantryAxis.MotionData.MotorPosition;
|
|
|
if (!string.IsNullOrEmpty(otherEntity.TargetCell))
|
|
|
{
|
|
|
- return CheckOtherModuleCellConflict(otherModule, otherEntity.TargetCell,otherPosition, positive, targetPosition);
|
|
|
+ return CheckOtherModuleCellConflict(otherModule, otherEntity.TargetCell,otherPosition, positive, targetPosition, motorPosition);
|
|
|
}
|
|
|
if(!string.IsNullOrEmpty(otherEntity.SourceCell))
|
|
|
{
|
|
|
- bool conflict= CheckOtherModuleCellConflict(otherModule, otherEntity.SourceCell,otherPosition, positive, targetPosition);
|
|
|
+ bool conflict= CheckOtherModuleCellConflict(otherModule, otherEntity.SourceCell,otherPosition, positive, targetPosition, motorPosition);
|
|
|
if (conflict)
|
|
|
{
|
|
|
//另一个Entity已经到达了目标位置
|
|
@@ -1248,7 +1245,7 @@ namespace CyberX8_RT.Modules.Transporter
|
|
|
/// <param name="motorPosition"></param>
|
|
|
/// <param name="targetPosition"></param>
|
|
|
/// <returns></returns>
|
|
|
- private bool CheckOtherModuleCellConflict(string otherModule, string cell,double otherPosition, bool positive,double targetPosition)
|
|
|
+ private bool CheckOtherModuleCellConflict(string otherModule, string cell,double otherPosition, bool positive,double targetPosition, double motorPosition)
|
|
|
{
|
|
|
int transporterMinimumDistance = SC.GetValue<int>("Transporter.TransporterMinimumDistance");
|
|
|
|
|
@@ -1261,15 +1258,19 @@ namespace CyberX8_RT.Modules.Transporter
|
|
|
{
|
|
|
if (positive)
|
|
|
{
|
|
|
- // if (result.targetPosition - transporterMinimumDistance <= motorPosition)
|
|
|
- // {
|
|
|
- // return true;
|
|
|
- // }
|
|
|
+ // if (result.targetPosition - transporterMinimumDistance <= motorPosition)
|
|
|
+ // {
|
|
|
+ // return true;
|
|
|
+ // }
|
|
|
if (result.targetPosition - transporterMinimumDistance <= targetPosition)
|
|
|
{
|
|
|
return true;
|
|
|
}
|
|
|
- if(otherPosition - transporterMinimumDistance <= targetPosition)
|
|
|
+ if (otherPosition - transporterMinimumDistance <= targetPosition)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if (result.targetPosition - transporterMinimumDistance <= motorPosition)
|
|
|
{
|
|
|
return true;
|
|
|
}
|
|
@@ -1285,7 +1286,11 @@ namespace CyberX8_RT.Modules.Transporter
|
|
|
{
|
|
|
return true;
|
|
|
}
|
|
|
- if(otherPosition + transporterMinimumDistance >= targetPosition)
|
|
|
+ if (otherPosition + transporterMinimumDistance >= targetPosition)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if (result.targetPosition + transporterMinimumDistance >= motorPosition)
|
|
|
{
|
|
|
return true;
|
|
|
}
|
|
@@ -1360,8 +1365,6 @@ namespace CyberX8_RT.Modules.Transporter
|
|
|
RState ret = _pickUpMoveToRoutine.Monitor();
|
|
|
if (ret == RState.Failed || ret == RState.Timeout)
|
|
|
{
|
|
|
- _targetCell = "";
|
|
|
- _sourceCell = "";
|
|
|
_currentRoutine = null;
|
|
|
if (Singleton<RouteManager>.Instance.IsAutoRunning)
|
|
|
{
|
|
@@ -1404,6 +1407,8 @@ namespace CyberX8_RT.Modules.Transporter
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ _sourceCell = "";
|
|
|
+ _targetCell = "";
|
|
|
if (Singleton<RouteManager>.Instance.IsAutoRunning)
|
|
|
{
|
|
|
AlarmListManager.Instance.CheckModuleAlamAndRemove(Module.ToString(), TransporterState.PickUpMoveToing.ToString());
|
|
@@ -1466,7 +1471,6 @@ namespace CyberX8_RT.Modules.Transporter
|
|
|
RState ret = _pickUpValidateRoutine.Monitor();
|
|
|
if (ret == RState.Failed || ret == RState.Timeout)
|
|
|
{
|
|
|
- _sourceCell = "";
|
|
|
_currentRoutine = null;
|
|
|
if (Singleton<RouteManager>.Instance.IsAutoRunning)
|
|
|
{
|
|
@@ -1513,6 +1517,7 @@ namespace CyberX8_RT.Modules.Transporter
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ _sourceCell = "";
|
|
|
if (Singleton<RouteManager>.Instance.IsAutoRunning)
|
|
|
{
|
|
|
AlarmListManager.Instance.CheckModuleAlamAndRemove(Module.ToString(), TransporterState.PickUpValidating.ToString());
|