Commit 353c7efd 张东亮

1

1 个父辈 a569a195
...@@ -201,11 +201,17 @@ namespace AGVControl ...@@ -201,11 +201,17 @@ namespace AGVControl
} }
else else
{ {
tarIdx = Common.agvInfo.FindIndex(s=> !s.IP.Equals(agv.IP) && s.CurJob !=null && s.CurJob is EmptyShelfBackJob
&& ((((EmptyShelfBackJob)s.CurJob).EmptyShelfTargetPlace)!=null ) && ((EmptyShelfBackJob)s.CurJob).EmptyShelfTargetPlace.Equals(SettingString.A5));
if(tarIdx==-1)
{
nodeName = SettingString.A5; nodeName = SettingString.A5;
Common.log.Debug(string.Format("{0} {1}需要小料架", agv.Name, SettingString.A5)); Common.log.Debug(string.Format("{0} {1}需要小料架", agv.Name, SettingString.A5));
return true; return true;
} }
}
tarIdx = Common.nodeInfo.FindIndex(s => s.Name == SettingString.A6 && tarIdx = Common.nodeInfo.FindIndex(s => s.Name == SettingString.A6 &&
(s.StateEquals(eNodeStatus.NeedEnter) || s.StateEquals(eNodeStatus.NeedEnterLeave)) && s.IsUse); (s.StateEquals(eNodeStatus.NeedEnter) || s.StateEquals(eNodeStatus.NeedEnterLeave)) && s.IsUse);
...@@ -223,9 +229,15 @@ namespace AGVControl ...@@ -223,9 +229,15 @@ namespace AGVControl
} }
else else
{ {
tarIdx = Common.agvInfo.FindIndex(s => !s.IP.Equals(agv.IP) && s.CurJob != null && s.CurJob is EmptyShelfBackJob
&& ((((EmptyShelfBackJob)s.CurJob).EmptyShelfTargetPlace) != null) && ((EmptyShelfBackJob)s.CurJob).EmptyShelfTargetPlace.Equals(SettingString.A6));
if(tarIdx==-1)
{
nodeName = SettingString.A6; nodeName = SettingString.A6;
Common.log.Debug(string.Format("{0} {1}需要小料架", agv.Name, SettingString.A6)); Common.log.Debug(string.Format("{0} {1}需要小料架", agv.Name, SettingString.A6));
return true; return true;
}
//rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission[SettingString.Move + SettingString.A6]); //rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission[SettingString.Move + SettingString.A6]);
//if (rtn) //if (rtn)
//{ //{
...@@ -250,11 +262,17 @@ namespace AGVControl ...@@ -250,11 +262,17 @@ namespace AGVControl
} }
else else
{ {
tarIdx = Common.agvInfo.FindIndex(s => !s.IP.Equals(agv.IP) && s.CurJob != null && s.CurJob is EmptyShelfBackJob
&& ((((EmptyShelfBackJob)s.CurJob).EmptyShelfTargetPlace) != null) && ((EmptyShelfBackJob)s.CurJob).EmptyShelfTargetPlace.Equals(SettingString.A5));
if(tarIdx==-1)
{
nodeName = SettingString.A5; nodeName = SettingString.A5;
Common.log.Debug(string.Format("{0} {1}需要大料架", agv.Name, SettingString.A5)); Common.log.Debug(string.Format("{0} {1}需要大料架", agv.Name, SettingString.A5));
return true; return true;
} }
}
tarIdx = Common.nodeInfo.FindIndex(s => s.Name == SettingString.A6 && tarIdx = Common.nodeInfo.FindIndex(s => s.Name == SettingString.A6 &&
(s.StateEquals(eNodeStatus.NeedEnter) || s.StateEquals(eNodeStatus.NeedEnterLeave)) && s.IsUse); (s.StateEquals(eNodeStatus.NeedEnter) || s.StateEquals(eNodeStatus.NeedEnterLeave)) && s.IsUse);
...@@ -272,9 +290,15 @@ namespace AGVControl ...@@ -272,9 +290,15 @@ namespace AGVControl
} }
else else
{ {
tarIdx = Common.agvInfo.FindIndex(s => !s.IP.Equals(agv.IP) && s.CurJob != null && s.CurJob is EmptyShelfBackJob
&& ((((EmptyShelfBackJob)s.CurJob).EmptyShelfTargetPlace) != null) && ((EmptyShelfBackJob)s.CurJob).EmptyShelfTargetPlace.Equals(SettingString.A6));
if(tarIdx==-1)
{
nodeName = SettingString.A6; nodeName = SettingString.A6;
Common.log.Debug(string.Format("{0} {1}需要大料架", agv.Name, SettingString.A6)); Common.log.Debug(string.Format("{0} {1}需要大料架", agv.Name, SettingString.A6));
return true; return true;
}
//rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission[SettingString.Move + SettingString.A6]); //rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission[SettingString.Move + SettingString.A6]);
//if (rtn) //if (rtn)
//{ //{
...@@ -868,101 +892,6 @@ namespace AGVControl ...@@ -868,101 +892,6 @@ namespace AGVControl
string log; string log;
agv.Place = ""; agv.Place = "";
#region 随机充电位置
//if (Common.chargeStatus.charge3 == "")
//{
// rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["AutoCharge3"]);
// if (rtn)
// {
// agv.TaskSend = "AutoCharge3";
// Common.chargeStatus.charge3 = agv.Name;
// Common.chargeStatus.chargeInterval = DateTime.Now.Ticks;
// log = string.Format("{0} AutoCharge3", agv.Name);
// Common.LogInfo(log);
// Common.mir.State_Ready(agv);
// }
// else
// {
// agv.TaskSend = "";
// log = string.Format("{0} AutoCharge3 失败", agv.Name);
// //防止上一个任务已执行但返回失败时,删除任务
// //Common.mir.Del_Mission(agv);
// Common.LogInfo(log);
// }
// return rtn;
//}
//else if (Common.chargeStatus.charge4 == "")
//{
// rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["AutoCharge4"]);
// if (rtn)
// {
// agv.TaskSend = "AutoCharge4";
// Common.chargeStatus.charge4 = agv.Name;
// Common.chargeStatus.chargeInterval = DateTime.Now.Ticks;
// log = string.Format("{0} AutoCharge4", agv.Name);
// Common.LogInfo(log);
// Common.mir.State_Ready(agv);
// }
// else
// {
// agv.TaskSend = "";
// log = string.Format("{0} AutoCharge4 失败", agv.Name);
// //防止上一个任务已执行但返回失败时,删除任务
// //Common.mir.Del_Mission(agv);
// Common.LogInfo(log);
// }
// return rtn;
//}
//else if (Common.chargeStatus.charge5 == "")
//{
// rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["AutoCharge5"]);
// if (rtn)
// {
// agv.TaskSend = "AutoCharge5";
// Common.chargeStatus.charge5 = agv.Name;
// Common.chargeStatus.chargeInterval = DateTime.Now.Ticks;
// log = string.Format("{0} AutoCharge5", agv.Name);
// Common.LogInfo(log);
// Common.mir.State_Ready(agv);
// }
// else
// {
// agv.TaskSend = "";
// log = string.Format("{0} AutoCharge5 失败", agv.Name);
// //防止上一个任务已执行但返回失败时,删除任务
// //Common.mir.Del_Mission(agv);
// Common.LogInfo(log);
// }
// return rtn;
//}
//else if (Common.chargeStatus.charge6 == "")
//{
// rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["AutoCharge6"]);
// if (rtn)
// {
// agv.TaskSend = "AutoCharge6";
// Common.chargeStatus.charge4 = agv.Name;
// Common.chargeStatus.chargeInterval = DateTime.Now.Ticks;
// log = string.Format("{0} AutoCharge6", agv.Name);
// Common.LogInfo(log);
// Common.mir.State_Ready(agv);
// }
// else
// {
// agv.TaskSend = "";
// log = string.Format("{0} AutoCharge6 失败", agv.Name);
// //防止上一个任务已执行但返回失败时,删除任务
// //Common.mir.Del_Mission(agv);
// Common.LogInfo(log);
// }
// return rtn;
//}
//else
//{
// return false;
//}
#endregion
#region 指定充电位置 #region 指定充电位置
if (agv.IP == "10.85.199.72")//1764 if (agv.IP == "10.85.199.72")//1764
{ {
...@@ -1010,6 +939,7 @@ namespace AGVControl ...@@ -1010,6 +939,7 @@ namespace AGVControl
} }
return rtn; return rtn;
} }
//随机充电
if (Common.chargeStatus.charge3 == "")//1763 agv.IP == "10.85.199.71" if (Common.chargeStatus.charge3 == "")//1763 agv.IP == "10.85.199.71"
{ {
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["AutoCharge3"], isRemovePreMission); rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["AutoCharge3"], isRemovePreMission);
...@@ -1501,7 +1431,17 @@ namespace AGVControl ...@@ -1501,7 +1431,17 @@ namespace AGVControl
chargeInterval = 0; chargeInterval = 0;
} }
public void ClearRandomChargeInfo(Agv_Info agv)
{
if (Common.chargeStatus.charge3.Equals(agv.Name))
{
Common.chargeStatus.charge3 = "";
}
if (Common.chargeStatus.charge6.Equals(agv.Name))
{
Common.chargeStatus.charge6 = "";
}
}
} }
/// <summary> /// <summary>
......
...@@ -210,16 +210,9 @@ namespace AGVControl ...@@ -210,16 +210,9 @@ namespace AGVControl
{ {
if (Common.agvInfo[e.RowIndex].IsUse.Equals(true)) if (Common.agvInfo[e.RowIndex].IsUse.Equals(true))
{ {
if (Common.chargeStatus.charge3.Equals(Common.agvInfo[e.RowIndex].Name)) Common.chargeStatus.ClearRandomChargeInfo(Common.agvInfo[e.RowIndex]);
{
Common.chargeStatus.charge3 = "";
}
if (Common.chargeStatus.charge6.Equals(Common.agvInfo[e.RowIndex].Name))
{
Common.chargeStatus.charge6 = "";
}
Common.agvInfo[e.RowIndex].IsUse = false; Common.agvInfo[e.RowIndex].IsUse = false;
//Common.agvInfo[e.RowIndex].CurJob = null; Common.agvInfo[e.RowIndex].CurJob = null;
//Common.agvInfo[e.RowIndex].RFID = ""; //Common.agvInfo[e.RowIndex].RFID = "";
// } // }
} }
...@@ -236,7 +229,7 @@ namespace AGVControl ...@@ -236,7 +229,7 @@ namespace AGVControl
Common.StandbyStation.C4_Station2 = ""; Common.StandbyStation.C4_Station2 = "";
} }
Common.LogInfo(string.Format("手动开启小车自动模式,并清除上一次的自动模式的运行信息{0} {1}", Common.agvInfo[e.RowIndex].Name, Common.agvInfo[e.RowIndex].RunInfo())); Common.LogInfo(string.Format("手动开启小车自动模式,并清除上一次的自动模式的运行信息{0} {1}", Common.agvInfo[e.RowIndex].Name, Common.agvInfo[e.RowIndex].RunInfo()));
Common.agvInfo[e.RowIndex].CurJob = null; //Common.agvInfo[e.RowIndex].CurJob = null;
Common.agvInfo[e.RowIndex].RFID = ""; Common.agvInfo[e.RowIndex].RFID = "";
// Common.agvInfo[e.RowIndex].Place = ""; // Common.agvInfo[e.RowIndex].Place = "";
Common.agvInfo[e.RowIndex].IsUse = true; Common.agvInfo[e.RowIndex].IsUse = true;
......
...@@ -126,7 +126,7 @@ namespace AGVControl ...@@ -126,7 +126,7 @@ namespace AGVControl
else if (ChargeStep.IsStep(CHARGE_STEP.WAIT_AGV_REACH_4D_DOOR)) else if (ChargeStep.IsStep(CHARGE_STEP.WAIT_AGV_REACH_4D_DOOR))
{ {
if (Common.CheckTaskFinished(agv,SettingString.DoorCToD,CurTaskState)) if (Common.CheckTaskFinished(agv, SettingString.DoorCToD, CurTaskState))
{ {
if (agv.Battery > Common.chargeStatus.chargeMax) if (agv.Battery > Common.chargeStatus.chargeMax)
{ {
...@@ -163,7 +163,7 @@ namespace AGVControl ...@@ -163,7 +163,7 @@ namespace AGVControl
} }
else if (ChargeStep.IsStep(CHARGE_STEP.WAIT_REACH_CHARGE_STATION)) else if (ChargeStep.IsStep(CHARGE_STEP.WAIT_REACH_CHARGE_STATION))
{ {
if (Common.CheckTaskFinished(agv,CurTaskName)) if (Common.CheckTaskFinished(agv, CurTaskName))
{ {
ChargeStep.ToNextStep(CHARGE_STEP.WAIT_REACH_CHARGE_OK); ChargeStep.ToNextStep(CHARGE_STEP.WAIT_REACH_CHARGE_OK);
runInfo = "充电任务分配完成,去充电且等待任务"; runInfo = "充电任务分配完成,去充电且等待任务";
...@@ -181,14 +181,7 @@ namespace AGVControl ...@@ -181,14 +181,7 @@ namespace AGVControl
runInfo = "电量充足,回待机位"; runInfo = "电量充足,回待机位";
msg += runInfo; msg += runInfo;
ChargeStep.Msg = msg; ChargeStep.Msg = msg;
if (Common.chargeStatus.charge3.Equals(agv.Name)) Common.chargeStatus.ClearRandomChargeInfo(agv);
{
Common.chargeStatus.charge3 = "";
}
if (Common.chargeStatus.charge6.Equals(agv.Name))
{
Common.chargeStatus.charge6 = "";
}
Common.MoveToNode(agv, SettingString.Standby); Common.MoveToNode(agv, SettingString.Standby);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID); UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
...@@ -197,14 +190,7 @@ namespace AGVControl ...@@ -197,14 +190,7 @@ namespace AGVControl
Job job = Common.control.GetJob(agv); Job job = Common.control.GetJob(agv);
if (job != null && !(job is ChargeJob)) if (job != null && !(job is ChargeJob))
{ {
if (Common.chargeStatus.charge3.Equals(agv.Name)) Common.chargeStatus.ClearRandomChargeInfo(agv);
{
Common.chargeStatus.charge3 = "";
}
if (Common.chargeStatus.charge6.Equals(agv.Name))
{
Common.chargeStatus.charge6 = "";
}
runInfo = "充电过程检测到任务,电量[" + agv.Battery + "%]大于最小电量[" + Common.chargeStatus.chargeMin + "%],中断充电执行任务"; runInfo = "充电过程检测到任务,电量[" + agv.Battery + "%]大于最小电量[" + Common.chargeStatus.chargeMin + "%],中断充电执行任务";
msg += runInfo; msg += runInfo;
ChargeStep.Msg = msg; ChargeStep.Msg = msg;
...@@ -230,14 +216,7 @@ namespace AGVControl ...@@ -230,14 +216,7 @@ namespace AGVControl
runInfo = "充电过程检测到任务,电量[" + agv.Battery + "%]大于最小电量[" + Common.chargeStatus.chargeMin + "%],中断充电执行任务"; runInfo = "充电过程检测到任务,电量[" + agv.Battery + "%]大于最小电量[" + Common.chargeStatus.chargeMin + "%],中断充电执行任务";
msg += runInfo; msg += runInfo;
ChargeStep.Msg = msg; ChargeStep.Msg = msg;
if (Common.chargeStatus.charge3.Equals(agv.Name)) Common.chargeStatus.ClearRandomChargeInfo(agv);
{
Common.chargeStatus.charge3 = "";
}
if (Common.chargeStatus.charge6.Equals(agv.Name))
{
Common.chargeStatus.charge6 = "";
}
return job; return job;
} }
else if (job == null && agv.Battery < Common.chargeStatus.chargeMax / 2) else if (job == null && agv.Battery < Common.chargeStatus.chargeMax / 2)
...@@ -246,14 +225,7 @@ namespace AGVControl ...@@ -246,14 +225,7 @@ namespace AGVControl
runInfo = "在待机位暂无任务,且当前电量小于" + Common.chargeStatus.chargeMax / 2 + "%,去充电位"; runInfo = "在待机位暂无任务,且当前电量小于" + Common.chargeStatus.chargeMax / 2 + "%,去充电位";
msg += runInfo; msg += runInfo;
ChargeStep.Msg = msg; ChargeStep.Msg = msg;
if (Common.chargeStatus.charge3.Equals(agv.Name)) Common.chargeStatus.ClearRandomChargeInfo(agv);
{
Common.chargeStatus.charge3 = "";
}
if (Common.chargeStatus.charge6.Equals(agv.Name))
{
Common.chargeStatus.charge6 = "";
}
} }
} }
} }
...@@ -265,7 +237,7 @@ namespace AGVControl ...@@ -265,7 +237,7 @@ namespace AGVControl
if (Common.CheckTaskFinished(agv, SettingString.Standby, CurTaskState)) if (Common.CheckTaskFinished(agv, SettingString.Standby, CurTaskState))
{ {
ChargeStep.ToNextStep(CHARGE_STEP.END); ChargeStep.ToNextStep(CHARGE_STEP.END);
runInfo= "充电完成,到达待机位"; runInfo = "充电完成,到达待机位";
msg += runInfo; msg += runInfo;
ChargeStep.Msg = msg; ChargeStep.Msg = msg;
} }
...@@ -276,33 +248,19 @@ namespace AGVControl ...@@ -276,33 +248,19 @@ namespace AGVControl
Job job = Common.control.GetJob(agv); Job job = Common.control.GetJob(agv);
if (job != null && !(job is ChargeJob)) if (job != null && !(job is ChargeJob))
{ {
runInfo= "在待机位检测到任务,执行任务"; runInfo = "在待机位检测到任务,执行任务";
msg += runInfo; msg += runInfo;
ChargeStep.Msg = msg; ChargeStep.Msg = msg;
if (Common.chargeStatus.charge3.Equals(agv.Name)) Common.chargeStatus.ClearRandomChargeInfo(agv);
{
Common.chargeStatus.charge3 = "";
}
if (Common.chargeStatus.charge6.Equals(agv.Name))
{
Common.chargeStatus.charge6 = "";
}
return job; return job;
} }
else if (job == null && agv.Battery < Common.chargeStatus.chargeMax / 2) else if (job == null && agv.Battery < Common.chargeStatus.chargeMax / 2)
{ {
ChargeStep.ToNextStep(CHARGE_STEP.NONE); ChargeStep.ToNextStep(CHARGE_STEP.NONE);
runInfo= "在待机位暂无任务,且当前电量小于" + Common.chargeStatus.chargeMax / 2 + "%,去充电位"; runInfo = "在待机位暂无任务,且当前电量小于" + Common.chargeStatus.chargeMax / 2 + "%,去充电位";
msg += runInfo; msg += runInfo;
ChargeStep.Msg = msg; ChargeStep.Msg = msg;
if (Common.chargeStatus.charge3.Equals(agv.Name)) Common.chargeStatus.ClearRandomChargeInfo(agv);
{
Common.chargeStatus.charge3 = "";
}
if (Common.chargeStatus.charge6.Equals(agv.Name))
{
Common.chargeStatus.charge6 = "";
}
} }
} }
return this; return this;
......
...@@ -155,6 +155,17 @@ namespace AGVControl ...@@ -155,6 +155,17 @@ namespace AGVControl
} }
} }
//else if (EmptyAGVBackStep.IsStep(EMPTY_AGV_BACK_STEP.WAIT_AGV_REACH_4D_DOOR))
//{
// CurTaskState = Common.GetTakJobState(CurTaskID);
// if (Common.CheckTaskFinished(agv, SettingString.DoorCToD, CurTaskState))
// {
// EmptyAGVBackStep.ToNextStep(EMPTY_AGV_BACK_STEP.WAIT_REACH_STANDBY);
// runInfo = "从产线" + agvPlace + "回待机位";
// msg += runInfo;
// EmptyAGVBackStep.Msg = msg;
// }
//}
else if (EmptyAGVBackStep.IsStep(EMPTY_AGV_BACK_STEP.WAIT_AGV_REACH_4D_DOOR)) else if (EmptyAGVBackStep.IsStep(EMPTY_AGV_BACK_STEP.WAIT_AGV_REACH_4D_DOOR))
{ {
CurTaskState = Common.GetTakJobState(CurTaskID); CurTaskState = Common.GetTakJobState(CurTaskID);
...@@ -162,14 +173,14 @@ namespace AGVControl ...@@ -162,14 +173,14 @@ namespace AGVControl
{ {
if (Common.FindFullShelfTask(agv)) if (Common.FindFullShelfTask(agv))
{ {
runInfo= "从产线" + agvPlace + "到达4D门,检测到A6出满料,去A6"; runInfo = "从产线" + agvPlace + "到达4D门,检测到A6出满料,去A6";
msg += runInfo; msg += runInfo;
EmptyAGVBackStep.Msg = msg; EmptyAGVBackStep.Msg = msg;
return new GoFullShelfStationJob(SettingString.DoorCToD); return new GoFullShelfStationJob(SettingString.DoorCToD);
} }
else else
{ {
runInfo= "从产线" + agvPlace + "到达4D门,暂无任务,去充电位"; runInfo = "从产线" + agvPlace + "到达4D门,暂无任务,去充电位";
msg += runInfo; msg += runInfo;
EmptyAGVBackStep.Msg = msg; EmptyAGVBackStep.Msg = msg;
return new ChargeJob(SettingString.DoorCToD); return new ChargeJob(SettingString.DoorCToD);
...@@ -195,6 +206,10 @@ namespace AGVControl ...@@ -195,6 +206,10 @@ namespace AGVControl
/// </summary> /// </summary>
WAIT_AGV_REACH_4D_DOOR, WAIT_AGV_REACH_4D_DOOR,
/// <summary> /// <summary>
/// 等待恒邑反馈
/// </summary>
WAIT_HY_RESPONSE,
/// <summary>
/// 等待AGV到达待机位 /// 等待AGV到达待机位
/// </summary> /// </summary>
WAIT_REACH_STANDBY, WAIT_REACH_STANDBY,
......
...@@ -38,7 +38,7 @@ namespace AGVControl ...@@ -38,7 +38,7 @@ namespace AGVControl
/// <summary> /// <summary>
/// 空料架目的地 /// 空料架目的地
/// </summary> /// </summary>
private string EmptyShelfTargetPlace { get; set; } public string EmptyShelfTargetPlace { get; set; } = "";
private int tryTimes = 0; private int tryTimes = 0;
private eShelfType shelfType; private eShelfType shelfType;
......
...@@ -21,7 +21,7 @@ namespace AGVControl ...@@ -21,7 +21,7 @@ namespace AGVControl
/// <param name="palce">产线名</param> /// <param name="palce">产线名</param>
/// <param name="rfid">料架RFID</param> /// <param name="rfid">料架RFID</param>
/// <param name="isIgNoreBigShelf">是否忽略大料架</param> /// <param name="isIgNoreBigShelf">是否忽略大料架</param>
public SendFullShelfToLineJob(AGVManager.BoxDestInfo boxDestInfo,bool isIgNoreBigShelf=false) public SendFullShelfToLineJob(AGVManager.BoxDestInfo boxDestInfo, bool isIgNoreBigShelf = false)
{ {
FullShelfPlace = boxDestInfo.location; FullShelfPlace = boxDestInfo.location;
RFID = boxDestInfo.id; RFID = boxDestInfo.id;
...@@ -57,7 +57,7 @@ namespace AGVControl ...@@ -57,7 +57,7 @@ namespace AGVControl
public override Job Execute(Agv_Info agv) public override Job Execute(Agv_Info agv)
{ {
string msg = agv.Name+" "; string msg = agv.Name + " ";
bool rtn = false; bool rtn = false;
agv.RFID = RFID; agv.RFID = RFID;
agv.Msg = runInfo; agv.Msg = runInfo;
...@@ -66,7 +66,7 @@ namespace AGVControl ...@@ -66,7 +66,7 @@ namespace AGVControl
if (SendFullShelfStep.IsStep(SEND_FULL_SHELF_STEP.NONE)) if (SendFullShelfStep.IsStep(SEND_FULL_SHELF_STEP.NONE))
{ {
if(FullShelfPlace.StartsWith(SettingString.C4_Name_Prefix)) if (FullShelfPlace.StartsWith(SettingString.C4_Name_Prefix))
{ {
SendFullShelfStep.ToNextStep(SEND_FULL_SHELF_STEP.WAIT_AGV_REACH_DOOR); SendFullShelfStep.ToNextStep(SEND_FULL_SHELF_STEP.WAIT_AGV_REACH_DOOR);
runInfo = "满料架前往4C门,从双层线A6送往[" + FullShelfPlace + "][RFID=" + RFID + "]"; runInfo = "满料架前往4C门,从双层线A6送往[" + FullShelfPlace + "][RFID=" + RFID + "]";
...@@ -78,7 +78,7 @@ namespace AGVControl ...@@ -78,7 +78,7 @@ namespace AGVControl
else else
{ {
SendFullShelfStep.ToNextStep(SEND_FULL_SHELF_STEP.WAIT_AGV_REACH_LINE); SendFullShelfStep.ToNextStep(SEND_FULL_SHELF_STEP.WAIT_AGV_REACH_LINE);
runInfo= "满料架从双层线A6送往[" + FullShelfPlace + "][RFID=" + RFID + "]"; runInfo = "满料架从双层线A6送往[" + FullShelfPlace + "][RFID=" + RFID + "]";
msg += runInfo; msg += runInfo;
SendFullShelfStep.Msg = msg; SendFullShelfStep.Msg = msg;
Common.MoveToNode(agv, FullShelfPlace); Common.MoveToNode(agv, FullShelfPlace);
...@@ -90,7 +90,7 @@ namespace AGVControl ...@@ -90,7 +90,7 @@ namespace AGVControl
else if (SendFullShelfStep.IsStep(SEND_FULL_SHELF_STEP.WAIT_AGV_REACH_DOOR)) else if (SendFullShelfStep.IsStep(SEND_FULL_SHELF_STEP.WAIT_AGV_REACH_DOOR))
{ {
CurTaskState = Common.GetTakJobState(CurTaskID); CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.CheckTaskFinished(agv,SettingString.DoorDToC,CurTaskState)) if (Common.CheckTaskFinished(agv, SettingString.DoorDToC, CurTaskState))
{ {
if (Common.Check4CTarget(agv, FullShelfPlace))//被占用 if (Common.Check4CTarget(agv, FullShelfPlace))//被占用
{ {
...@@ -133,11 +133,11 @@ namespace AGVControl ...@@ -133,11 +133,11 @@ namespace AGVControl
else if (SendFullShelfStep.IsStep(SEND_FULL_SHELF_STEP.WAIT_AGV_REACH_LINE)) else if (SendFullShelfStep.IsStep(SEND_FULL_SHELF_STEP.WAIT_AGV_REACH_LINE))
{ {
CurTaskState = Common.GetTakJobState(CurTaskID); CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.CheckTaskFinished(agv,FullShelfPlace, CurTaskState)) if (Common.CheckTaskFinished(agv, FullShelfPlace, CurTaskState))
{ {
if(FullShelfPlace.Equals(SettingString.C4FeederIn)) if (FullShelfPlace.Equals(SettingString.C4FeederIn))
{ {
runInfo= "AGV到达 " + FullShelfPlace + "完成"; runInfo = "AGV到达 " + FullShelfPlace + "完成";
msg += runInfo; msg += runInfo;
SendFullShelfStep.Msg = msg; SendFullShelfStep.Msg = msg;
return new EnterLeaveShelfJob(FullShelfPlace, eEnterLeaveType.Leave); return new EnterLeaveShelfJob(FullShelfPlace, eEnterLeaveType.Leave);
...@@ -155,14 +155,14 @@ namespace AGVControl ...@@ -155,14 +155,14 @@ namespace AGVControl
if (RFID.StartsWith("C") && !agv.Place.Equals(SettingString.D4FeederIn)) if (RFID.StartsWith("C") && !agv.Place.Equals(SettingString.D4FeederIn))
{ {
SendFullShelfStep.ToNextStep(SEND_FULL_SHELF_STEP.WAIT_BIG_SHELF_UNLOCK); SendFullShelfStep.ToNextStep(SEND_FULL_SHELF_STEP.WAIT_BIG_SHELF_UNLOCK);
runInfo= "AGV到达 " + FullShelfPlace + ",并等待大料架[" + RFID + "]解绑"; runInfo = "AGV到达 " + FullShelfPlace + ",并等待大料架[" + RFID + "]解绑";
msg += runInfo; msg += runInfo;
SendFullShelfStep.Msg = msg; SendFullShelfStep.Msg = msg;
} }
else else
{ {
SendFullShelfStep.ToNextStep(SEND_FULL_SHELF_STEP.WAIT_LINE_RESPONSE); SendFullShelfStep.ToNextStep(SEND_FULL_SHELF_STEP.WAIT_LINE_RESPONSE);
runInfo= "AGV到达 " + FullShelfPlace + ",并发送入料架请求[ReadyEnter]"; runInfo = "AGV到达 " + FullShelfPlace + ",并发送入料架请求[ReadyEnter]";
msg += runInfo; msg += runInfo;
SendFullShelfStep.Msg = msg; SendFullShelfStep.Msg = msg;
Common.server.ReadyEnter(FullShelfPlace); Common.server.ReadyEnter(FullShelfPlace);
...@@ -175,25 +175,27 @@ namespace AGVControl ...@@ -175,25 +175,27 @@ namespace AGVControl
{ {
Common.mir.Get_IO_Status(agv, out bool[] input, out bool[] output); Common.mir.Get_IO_Status(agv, out bool[] input, out bool[] output);
System.Threading.Thread.Sleep(50); System.Threading.Thread.Sleep(50);
if (AGVManager.GetRackBy(RFID, out string lineName) || (input!=null && input[0])) if (AGVManager.GetRackBy(RFID, out string lineName) || (input != null && input[0]))
{ {
runInfo= "大料架在" + FullShelfPlace + "解绑完成 [" + RFID + "] [" + agv.BoxDestInfo + "]"; runInfo = "大料架在" + FullShelfPlace + "解绑完成 [" + RFID + "] [" + agv.BoxDestInfo + "]";
agv.BoxDestInfo = ""; agv.BoxDestInfo = "";
msg += runInfo; msg += runInfo;
SendFullShelfStep.Msg = msg; SendFullShelfStep.Msg = msg;
return new EmptyShelfBackJob(FullShelfPlace,eShelfType.BigShelf); return new EmptyShelfBackJob(FullShelfPlace, eShelfType.BigShelf);
} }
} }
else if (SendFullShelfStep.IsStep(SEND_FULL_SHELF_STEP.WAIT_LINE_RESPONSE)) else if (SendFullShelfStep.IsStep(SEND_FULL_SHELF_STEP.WAIT_LINE_RESPONSE))
{ {
int id = Common.FindNode(FullShelfPlace); int id = Common.FindNode(FullShelfPlace);
ClientNode node = Common.nodeInfo[id]; ClientNode node = Common.nodeInfo[id];
Common.mir.Get_IO_Status(agv, out bool[] input, out bool[] output);
System.Threading.Thread.Sleep(50);
if (node.StateEquals(eNodeStatus.MayEnter)) if (node.StateEquals(eNodeStatus.MayEnter))
{ {
if(!agv.CurTaskName.Equals("Leave")) if (!agv.CurTaskName.Equals("Leave"))
{ {
SendFullShelfStep.ToNextStep(SEND_FULL_SHELF_STEP.WAIT__SHELF_IN_LINE); SendFullShelfStep.ToNextStep(SEND_FULL_SHELF_STEP.WAIT__SHELF_IN_LINE);
runInfo= "收到产线入料架请求[ReadyEnter]的响应 " + FullShelfPlace + "入料架,小车链条运行"; runInfo = "收到产线入料架请求[ReadyEnter]的响应 " + FullShelfPlace + "入料架,小车链条运行";
msg += runInfo; msg += runInfo;
SendFullShelfStep.Msg = msg; SendFullShelfStep.Msg = msg;
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Leave"]); rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Leave"]);
...@@ -201,10 +203,20 @@ namespace AGVControl ...@@ -201,10 +203,20 @@ namespace AGVControl
} }
} }
else if (input != null && !input[3] && input[0])
{
runInfo = "手动操作:满料架进入" + FullShelfPlace + "完成 [RFID=" + RFID + "] [" + agv.BoxDestInfo + "]";
msg += runInfo;
SendFullShelfStep.Msg = msg;
agv.RFID = "";
agv.BoxDestInfo = "";
AGVManager.UpdateStatus(RFID, FullShelfPlace);
return new EmptyAGVBackJob(FullShelfPlace);
}
else if (SendFullShelfStep.IsTimeOut(15000, out double timeOutValue)) else if (SendFullShelfStep.IsTimeOut(15000, out double timeOutValue))
{ {
SendFullShelfStep.ToNextStep(SEND_FULL_SHELF_STEP.WAIT_AGV_REACH_LINE); SendFullShelfStep.ToNextStep(SEND_FULL_SHELF_STEP.WAIT_AGV_REACH_LINE);
runInfo= "AGV到达 " + FullShelfPlace + ",15秒后重新向产线发送入料架请求[ReadyEnter]"; runInfo = "AGV到达 " + FullShelfPlace + ",15秒后重新向产线发送入料架请求[ReadyEnter]";
msg += runInfo; msg += runInfo;
SendFullShelfStep.Msg = msg; SendFullShelfStep.Msg = msg;
} }
...@@ -214,7 +226,7 @@ namespace AGVControl ...@@ -214,7 +226,7 @@ namespace AGVControl
CurTaskState = Common.GetTakJobState(CurTaskID); CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.CheckEnterOrLeaveFinished(agv, "Leave", CurTaskState)) if (Common.CheckEnterOrLeaveFinished(agv, "Leave", CurTaskState))
{ {
runInfo= "满料架进入" + FullShelfPlace + "完成 [RFID=" + RFID + "] ["+agv.BoxDestInfo+"]"; runInfo = "满料架进入" + FullShelfPlace + "完成 [RFID=" + RFID + "] [" + agv.BoxDestInfo + "]";
msg += runInfo; msg += runInfo;
SendFullShelfStep.Msg = msg; SendFullShelfStep.Msg = msg;
agv.RFID = ""; agv.RFID = "";
...@@ -225,7 +237,7 @@ namespace AGVControl ...@@ -225,7 +237,7 @@ namespace AGVControl
else if (SendFullShelfStep.IsTimeOut(60000, out double timeOutValue)) else if (SendFullShelfStep.IsTimeOut(60000, out double timeOutValue))
{ {
//链条停止 //链条停止
runInfo= "满料架在[" + FullShelfPlace + "]离开小车超时[" + timeOutValue.ToString("f1") + "秒],请检查料架离开小车的情况"; runInfo = "满料架在[" + FullShelfPlace + "]离开小车超时[" + timeOutValue.ToString("f1") + "秒],请检查料架离开小车的情况";
//msg += runInfo; //msg += runInfo;
//SendFullShelfStep.Msg = msg; //SendFullShelfStep.Msg = msg;
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!