Commit 85238ee5 张东亮

添加风淋门

1 个父辈 54be25c3
...@@ -49,23 +49,29 @@ namespace AGVControl ...@@ -49,23 +49,29 @@ namespace AGVControl
{ {
string msg = agv.Name + " "; string msg = agv.Name + " ";
bool rtn = false; bool rtn = false;
runInfo = ""; agv.Msg = "充电任务:"+runInfo;
agv.Msg = runInfo; //runInfo = "充电任务:";
//if (!CurTaskID.Equals(-1) && Common.mir.Get_Task_State(CurTaskID, out string st))
// CurTaskState = st;
CurTaskState = Common.GetTakJobState(CurTaskID); CurTaskState = Common.GetTakJobState(CurTaskID);
if (ChargeStep.IsStep(CHARGE_STEP.NONE)) if (ChargeStep.IsStep(CHARGE_STEP.NONE))
{ {
if (agv.Battery > Common.chargeStatus.chargeMax) if (agv.Battery > Common.chargeStatus.chargeMax)
{ {
if (agv.Place.Equals(SettingString.Standby))//在待机位不操作 if (agvPlace.Equals(SettingString.Standby) || agvPlace.Equals(""))//在待机位不操作
{ {
ChargeStep.ToNextStep(CHARGE_STEP.END); ChargeStep.ToNextStep(CHARGE_STEP.END);
runInfo = "在待机位,电量充足[" + agv.Battery + "%],等待任务"; runInfo = "在待机位,电量充足[" + agv.Battery + "%],等待任务";
msg += runInfo; msg += runInfo;
ChargeStep.Msg = msg; ChargeStep.Msg = msg;
} }
else if (agvPlace.StartsWith(SettingString.C4_Name_Prefix) && Common.CheckIsInAirDoor(agvPlace))
{
ChargeStep.ToNextStep(CHARGE_STEP.WAIT_AGV_REACH_AIR_DOOR);
runInfo = "电量充足[" + agv.Battery + "%],从当前位置" + agvPlace + "回到待机位,先过4C风淋门";
msg += runInfo;
ChargeStep.Msg = msg;
Common.DoorMission(agv, SettingString.DoorAirOut);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
}
else if (agvPlace.StartsWith(SettingString.C4_Name_Prefix)) else if (agvPlace.StartsWith(SettingString.C4_Name_Prefix))
{ {
ChargeStep.ToNextStep(CHARGE_STEP.WAIT_AGV_REACH_4D_DOOR); ChargeStep.ToNextStep(CHARGE_STEP.WAIT_AGV_REACH_4D_DOOR);
...@@ -89,7 +95,17 @@ namespace AGVControl ...@@ -89,7 +95,17 @@ namespace AGVControl
} }
else else
{ {
if (agvPlace.StartsWith(SettingString.C4_Name_Prefix)) if (agvPlace.StartsWith(SettingString.C4_Name_Prefix) && Common.CheckIsInAirDoor(agvPlace))
{
ChargeStep.ToNextStep(CHARGE_STEP.WAIT_AGV_REACH_AIR_DOOR);
runInfo = "电量[" + agv.Battery + "%]小于最大电量[" + Common.chargeStatus.chargeMax + "%],从当前位置" + agvPlace + "回到充电位,先过4C风淋门";
msg += runInfo;
ChargeStep.Msg = msg;
Common.DoorMission(agv, SettingString.DoorAirOut);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
}
else if (agvPlace.StartsWith(SettingString.C4_Name_Prefix))
{ {
ChargeStep.ToNextStep(CHARGE_STEP.WAIT_AGV_REACH_4D_DOOR); ChargeStep.ToNextStep(CHARGE_STEP.WAIT_AGV_REACH_4D_DOOR);
runInfo = "电量[" + agv.Battery + "%]小于最大电量[" + Common.chargeStatus.chargeMax + "%],从当前位置" + agvPlace + "回到充电位,先到4D门"; runInfo = "电量[" + agv.Battery + "%]小于最大电量[" + Common.chargeStatus.chargeMax + "%],从当前位置" + agvPlace + "回到充电位,先到4D门";
...@@ -123,7 +139,18 @@ namespace AGVControl ...@@ -123,7 +139,18 @@ namespace AGVControl
} }
} }
else if (ChargeStep.IsStep(CHARGE_STEP.WAIT_AGV_REACH_AIR_DOOR))
{
if (Common.CheckTaskFinished(agv, SettingString.DoorAirOut, CurTaskState))
{
ChargeStep.ToNextStep(CHARGE_STEP.WAIT_AGV_REACH_4D_DOOR);
runInfo = "电量充足[" + agv.Battery + "%],从当前位置" + agvPlace + "回到待机位,先到4D门";
msg += runInfo;
ChargeStep.Msg = msg;
Common.DoorMission(agv, SettingString.DoorCToD);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
}
}
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))
...@@ -166,7 +193,7 @@ namespace AGVControl ...@@ -166,7 +193,7 @@ namespace AGVControl
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 = "充电任务分配完成,去充电等待任务";
msg += runInfo; msg += runInfo;
ChargeStep.Msg = msg; ChargeStep.Msg = msg;
} }
...@@ -213,20 +240,12 @@ namespace AGVControl ...@@ -213,20 +240,12 @@ 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 = "充电过程检测到任务,电量[" + agv.Battery + "%]大于最小电量[" + Common.chargeStatus.chargeMin + "%],中断充电执行任务"; runInfo = "充电过程检测到任务,电量[" + agv.Battery + "%]大于最小电量[" + Common.chargeStatus.chargeMin + "%],中断充电执行任务";
msg += runInfo; msg += runInfo;
ChargeStep.Msg = msg; ChargeStep.Msg = msg;
Common.chargeStatus.ClearRandomChargeInfo(agv); Common.chargeStatus.ClearRandomChargeInfo(agv);
return job; return job;
} }
//else if (job == null && agv.Battery < Common.chargeStatus.chargeMax / 2)
//{
// ChargeStep.ToNextStep(CHARGE_STEP.NONE);
// runInfo = "在待机位暂无任务,且当前电量小于" + Common.chargeStatus.chargeMax / 2 + "%,去充电位";
// msg += runInfo;
// ChargeStep.Msg = msg;
// Common.chargeStatus.ClearRandomChargeInfo(agv);
//}
} }
} }
...@@ -291,7 +310,10 @@ namespace AGVControl ...@@ -291,7 +310,10 @@ namespace AGVControl
/// ///
/// </summary> /// </summary>
NONE, NONE,
/// <summary>
/// 等待到达风淋门
/// </summary>
WAIT_AGV_REACH_AIR_DOOR,
/// <summary> /// <summary>
/// 等待到达4D门 /// 等待到达4D门
/// </summary> /// </summary>
......
...@@ -56,7 +56,8 @@ namespace AGVControl ...@@ -56,7 +56,8 @@ namespace AGVControl
{ {
string msg = agv.Name + " "; string msg = agv.Name + " ";
bool rtn = false; bool rtn = false;
agv.Msg = runInfo; agv.Msg = "去云仓接满料任务:"+runInfo;
//runInfo = "去云仓接满料任务:";
//if (!CurTaskID.Equals(-1) && Common.mir.Get_Task_State(CurTaskID, out string st)) //if (!CurTaskID.Equals(-1) && Common.mir.Get_Task_State(CurTaskID, out string st))
// CurTaskState = st; // CurTaskState = st;
if (GoFullShelfStationStep.IsStep(GO_FULL_SHELF_STATION_STEP.NONE)) if (GoFullShelfStationStep.IsStep(GO_FULL_SHELF_STATION_STEP.NONE))
...@@ -89,7 +90,7 @@ namespace AGVControl ...@@ -89,7 +90,7 @@ namespace AGVControl
} }
else if (input != null && !input[3]) else if (input != null && !input[3])
{ {
if (agvPlace.Equals(SettingString.Standby) || agvPlace.StartsWith(SettingString.AutoCharge))//待机位/充电位接到任务 if (agvPlace.Equals("") || agvPlace.Equals(SettingString.Standby) || agvPlace.StartsWith(SettingString.AutoCharge))//待机位/充电位接到任务
{ {
GoFullShelfStationStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT_AGV_REACH_A6); GoFullShelfStationStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT_AGV_REACH_A6);
runInfo = "无负载,准备运动到入料口" + FullShelfStationPlace; runInfo = "无负载,准备运动到入料口" + FullShelfStationPlace;
...@@ -98,6 +99,15 @@ namespace AGVControl ...@@ -98,6 +99,15 @@ namespace AGVControl
Common.MoveToNode(agv, FullShelfStationPlace); Common.MoveToNode(agv, FullShelfStationPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID); UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else if (Common.CheckIsInAirDoor(agvPlace))
{
GoFullShelfStationStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT_AGV_REACH_AIR_DOOR);
runInfo = "在4C风淋门内,先过风淋门";
msg += runInfo;
GoFullShelfStationStep.Msg = msg;
Common.DoorMission(agv, SettingString.DoorAirOut);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
}
else if (agvPlace.StartsWith(SettingString.C4_Name_Prefix))//4C车间 else if (agvPlace.StartsWith(SettingString.C4_Name_Prefix))//4C车间
{ {
GoFullShelfStationStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT_AGV_REACH_DOOR); GoFullShelfStationStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT_AGV_REACH_DOOR);
...@@ -132,6 +142,15 @@ namespace AGVControl ...@@ -132,6 +142,15 @@ namespace AGVControl
Common.MoveToNode(agv, FullShelfStationPlace); Common.MoveToNode(agv, FullShelfStationPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID); UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else if(Common.CheckIsInAirDoor(agvPlace))
{
GoFullShelfStationStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT_AGV_REACH_AIR_DOOR);
runInfo = "在4C风淋门内,先过风淋门";
msg += runInfo;
GoFullShelfStationStep.Msg = msg;
Common.DoorMission(agv, SettingString.DoorAirOut);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
}
else if (agvPlace.StartsWith(SettingString.C4_Name_Prefix))//4C车间 else if (agvPlace.StartsWith(SettingString.C4_Name_Prefix))//4C车间
{ {
GoFullShelfStationStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT_AGV_REACH_DOOR); GoFullShelfStationStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT_AGV_REACH_DOOR);
...@@ -147,6 +166,20 @@ namespace AGVControl ...@@ -147,6 +166,20 @@ namespace AGVControl
} }
} }
else if (GoFullShelfStationStep.IsStep(GO_FULL_SHELF_STATION_STEP.WAIT_AGV_REACH_AIR_DOOR))
{
CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.CheckTaskFinished(agv, SettingString.DoorAirOut, CurTaskState))
{
GoFullShelfStationStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT_AGV_REACH_DOOR);
runInfo = "过风淋门,向4D门运行,再到双层线入料口" + FullShelfStationPlace;
msg += runInfo;
GoFullShelfStationStep.Msg = msg;
Common.MoveToNode(agv, SettingString.DoorCToD);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
}
}
else if (GoFullShelfStationStep.IsStep(GO_FULL_SHELF_STATION_STEP.WAIT_AGV_REACH_DOOR)) else if (GoFullShelfStationStep.IsStep(GO_FULL_SHELF_STATION_STEP.WAIT_AGV_REACH_DOOR))
{ {
CurTaskState = Common.GetTakJobState(CurTaskID); CurTaskState = Common.GetTakJobState(CurTaskID);
...@@ -278,7 +311,7 @@ namespace AGVControl ...@@ -278,7 +311,7 @@ namespace AGVControl
else if (GoFullShelfStationStep.IsTimeOut(60000, out double timeOutValue)) else if (GoFullShelfStationStep.IsTimeOut(60000, out double timeOutValue))
{ {
//链条停止 //链条停止
runInfo= "满料架在[" + FullShelfStationPlace + "]进入小车超时[" + timeOutValue.ToString("f1") + "秒],请检查料架进入小车的情况"; runInfo = "满料架在[" + FullShelfStationPlace + "]进入小车超时[" + timeOutValue.ToString("f1") + "秒],请检查料架进入小车的情况";
//msg +=runInfo; //msg +=runInfo;
//GoFullShelfStationStep.Msg = msg; //GoFullShelfStationStep.Msg = msg;
} }
...@@ -303,6 +336,10 @@ namespace AGVControl ...@@ -303,6 +336,10 @@ namespace AGVControl
/// </summary> /// </summary>
WAIT_CHECK_RESULT, WAIT_CHECK_RESULT,
/// <summary> /// <summary>
/// 等待到达4C风淋门
/// </summary>
WAIT_AGV_REACH_AIR_DOOR,
/// <summary>
/// 等待AGV到达门 /// 等待AGV到达门
/// </summary> /// </summary>
WAIT_AGV_REACH_DOOR, WAIT_AGV_REACH_DOOR,
......
...@@ -60,7 +60,8 @@ namespace AGVControl ...@@ -60,7 +60,8 @@ namespace AGVControl
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;
//runInfo = "送满料任务:";
//if (!CurTaskID.Equals(-1) && Common.mir.Get_Task_State(CurTaskID, out string st)) //if (!CurTaskID.Equals(-1) && Common.mir.Get_Task_State(CurTaskID, out string st))
// CurTaskState = st; // CurTaskState = st;
if (SendFullShelfStep.IsStep(SEND_FULL_SHELF_STEP.NONE)) if (SendFullShelfStep.IsStep(SEND_FULL_SHELF_STEP.NONE))
...@@ -69,7 +70,7 @@ namespace AGVControl ...@@ -69,7 +70,7 @@ namespace AGVControl
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 + "]";
msg += runInfo; msg += runInfo;
SendFullShelfStep.Msg = msg; SendFullShelfStep.Msg = msg;
Common.DoorMission(agv, SettingString.DoorDToC); Common.DoorMission(agv, SettingString.DoorDToC);
...@@ -78,7 +79,7 @@ namespace AGVControl ...@@ -78,7 +79,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);
...@@ -86,7 +87,6 @@ namespace AGVControl ...@@ -86,7 +87,6 @@ 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);
...@@ -103,16 +103,41 @@ namespace AGVControl ...@@ -103,16 +103,41 @@ namespace AGVControl
} }
else else
{ {
if(Common.CheckIsInAirDoor(FullShelfPlace))
{
SendFullShelfStep.ToNextStep(SEND_FULL_SHELF_STEP.WAIT_AGV_REACH_AIR_DOOR);
runInfo = "到达4C门,过风淋门[" + FullShelfPlace + "][RFID=" + RFID + "]";
msg += runInfo;
SendFullShelfStep.Msg = msg;
Common.DoorMission(agv, SettingString.DoorAirIn);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
}
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);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID); UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
}
} }
} }
else if (SendFullShelfStep.IsStep(SEND_FULL_SHELF_STEP.WAIT_AGV_REACH_AIR_DOOR))
{
CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.CheckTaskFinished(agv, SettingString.DoorAirIn, CurTaskState))
{
SendFullShelfStep.ToNextStep(SEND_FULL_SHELF_STEP.WAIT_AGV_REACH_LINE);
runInfo = "送往[" + FullShelfPlace + "][RFID=" + RFID + "]";
msg += runInfo;
SendFullShelfStep.Msg = msg;
Common.MoveToNode(agv, FullShelfPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
}
}
else if (SendFullShelfStep.IsStep(SEND_FULL_SHELF_STEP.WAIT_REACH_TEMP_PLACE)) else if (SendFullShelfStep.IsStep(SEND_FULL_SHELF_STEP.WAIT_REACH_TEMP_PLACE))
{ {
CurTaskState = Common.GetTakJobState(CurTaskID); CurTaskState = Common.GetTakJobState(CurTaskID);
...@@ -121,7 +146,7 @@ namespace AGVControl ...@@ -121,7 +146,7 @@ namespace AGVControl
if (!Common.Check4CTarget(agv, FullShelfPlace))//未占用 if (!Common.Check4CTarget(agv, FullShelfPlace))//未占用
{ {
SendFullShelfStep.ToNextStep(SEND_FULL_SHELF_STEP.WAIT_AGV_REACH_LINE); SendFullShelfStep.ToNextStep(SEND_FULL_SHELF_STEP.WAIT_AGV_REACH_LINE);
runInfo = "满料架从临时待机位送往[" + FullShelfPlace + "][RFID=" + RFID + "]"; runInfo = "从临时待机位送往[" + FullShelfPlace + "][RFID=" + RFID + "]";
msg += runInfo; msg += runInfo;
SendFullShelfStep.Msg = msg; SendFullShelfStep.Msg = msg;
Common.DeleteStandyInfo(agv); Common.DeleteStandyInfo(agv);
...@@ -226,7 +251,7 @@ namespace AGVControl ...@@ -226,7 +251,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 = "";
...@@ -237,7 +262,7 @@ namespace AGVControl ...@@ -237,7 +262,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;
} }
...@@ -270,6 +295,10 @@ namespace AGVControl ...@@ -270,6 +295,10 @@ namespace AGVControl
/// </summary> /// </summary>
WAIT_REACH_TEMP_PLACE, WAIT_REACH_TEMP_PLACE,
/// <summary> /// <summary>
/// 等待到达4C风淋门
/// </summary>
WAIT_AGV_REACH_AIR_DOOR,
/// <summary>
/// 等待小车到达目的地 /// 等待小车到达目的地
/// </summary> /// </summary>
WAIT_AGV_REACH_LINE, WAIT_AGV_REACH_LINE,
......
...@@ -35,14 +35,14 @@ namespace AGVControl ...@@ -35,14 +35,14 @@ namespace AGVControl
{ {
if (!SettingString.C4_AGV_IPs.Contains(agv.IP)) if (!SettingString.C4_AGV_IPs.Contains(agv.IP))
continue; continue;
if (agv.CurJob is GoEmptyShelfLineJob)//|| agv.CurJob is EmptyShelfBackJob if (agv.CurJob is GoEmptyShelfLineJob|| (agv.CurJob is EmptyShelfBackJob))
{ {
emptyJobCnt++; emptyJobCnt++;
} }
} }
//出工单料的目的地是否有空料架 //出工单料的目的地是否有空料架
if (Common.FindEmptyShelfBeforeSendFullShelf(out string nodeName,out rfid)) if (Common.FindEmptyShelfBeforeSendFullShelf(out string nodeName))
{ {
if (nodeName.StartsWith(SettingString.C4_Name_Prefix) && SettingString.C4_AGV_IPs.Contains(currentAgv.IP)) if (nodeName.StartsWith(SettingString.C4_Name_Prefix) && SettingString.C4_AGV_IPs.Contains(currentAgv.IP))
{ {
...@@ -58,28 +58,23 @@ namespace AGVControl ...@@ -58,28 +58,23 @@ namespace AGVControl
} }
if (cnt < clientNode.EmptyShelfCnt) if (cnt < clientNode.EmptyShelfCnt)
{ {
if ((SettingString.AGVCNT / 2 - emptyJobCnt).Equals(2))//保留1辆小车出满料架 if (Common.CheckStationState(clientNode, out rfid) && CanEmptyTask(emptyJobCnt))
{ return new GoEmptyShelfLineJob(currentAgv.Place, nodeName, rfid);
return null;
}
return new GoEmptyShelfLineJob(currentAgv.Place, nodeName,rfid);
} }
} }
} }
//回收空料架 //回收空料架
if (Common.FindEmptyShelfNode(currentAgv, out string emptyNodeName,out rfid)) if (Common.FindEmptyShelfNode(currentAgv, out string emptyNodeName))
{ {
if (SettingString.C4_AGV_IPs.Contains(currentAgv.IP)) if (SettingString.C4_AGV_IPs.Contains(currentAgv.IP))
{ {
int i = Common.agvInfo.FindIndex(s => s.CurJob is GoEmptyShelfLineJob && ((GoEmptyShelfLineJob)s.CurJob).EmptyShelfPlace.Equals(emptyNodeName)); int i = Common.agvInfo.FindIndex(s => s.CurJob is GoEmptyShelfLineJob && ((GoEmptyShelfLineJob)s.CurJob).EmptyShelfPlace.Equals(emptyNodeName));
if (i == -1) if (i == -1)
{ {
if ((SettingString.AGVCNT / 2 - emptyJobCnt).Equals(2))//保留1辆小车出满料架 ClientNode clientNode = Common.nodeInfo.Find(s => s.Name.Equals(emptyNodeName));
{ if (Common.CheckStationState(clientNode, out rfid) && CanEmptyTask(emptyJobCnt))
return null;
}
return new GoEmptyShelfLineJob(currentAgv.Place, emptyNodeName, rfid); return new GoEmptyShelfLineJob(currentAgv.Place, emptyNodeName, rfid);
} }
} }
...@@ -99,5 +94,18 @@ namespace AGVControl ...@@ -99,5 +94,18 @@ namespace AGVControl
return null; return null;
} }
/// <summary>
/// 控制出空架小车数量
/// </summary>
/// <param name="emptytASKAGV"></param>
/// <returns></returns>
private bool CanEmptyTask(int emptytASKAGV)
{
if ((SettingString.AGVCNT / 2 - emptytASKAGV).Equals(2))//保留1辆小车出满料架
{
return false;
}
return true;
}
} }
} }
...@@ -38,13 +38,13 @@ namespace AGVControl ...@@ -38,13 +38,13 @@ namespace AGVControl
{ {
if (SettingString.C4_AGV_IPs.Contains(agv.IP)) if (SettingString.C4_AGV_IPs.Contains(agv.IP))
continue; continue;
if (agv.CurJob is GoEmptyShelfLineJob)//|| agv.CurJob is EmptyShelfBackJob if (agv.CurJob is GoEmptyShelfLineJob || agv.CurJob is EmptyShelfBackJob)//
{ {
emptyJobCnt++; emptyJobCnt++;
} }
} }
//出工单料的目的地是否有空料架 //出工单料的目的地是否有空料架
if (Common.FindEmptyShelfBeforeSendFullShelf(out string nodeName,out rfid)) if (Common.FindEmptyShelfBeforeSendFullShelf(out string nodeName))
{ {
if (nodeName.StartsWith(SettingString.D4_Name_Prefix) && !SettingString.C4_AGV_IPs.Contains(currentAgv.IP)) if (nodeName.StartsWith(SettingString.D4_Name_Prefix) && !SettingString.C4_AGV_IPs.Contains(currentAgv.IP))
{ {
...@@ -62,27 +62,23 @@ namespace AGVControl ...@@ -62,27 +62,23 @@ namespace AGVControl
} }
if (cnt < clientNode.EmptyShelfCnt) if (cnt < clientNode.EmptyShelfCnt)
{ {
if ((SettingString.AGVCNT / 2 - emptyJobCnt).Equals(1))//保留1辆小车出满料架
{ if (Common.CheckStationState(clientNode, out rfid) && CanEmptyTask(emptyJobCnt))
return null; return new GoEmptyShelfLineJob(currentAgv.Place, nodeName, rfid);
}
return new GoEmptyShelfLineJob(currentAgv.Place, nodeName,rfid);
} }
} }
} }
//回收空料架 //回收空料架
if (Common.FindEmptyShelfNode(currentAgv, out string emptyNodeName,out rfid)) if (Common.FindEmptyShelfNode(currentAgv, out string emptyNodeName))
{ {
if (!SettingString.C4_AGV_IPs.Contains(currentAgv.IP)) if (!SettingString.C4_AGV_IPs.Contains(currentAgv.IP))
{ {
int i = Common.agvInfo.FindIndex(s => s.CurJob is GoEmptyShelfLineJob && ((GoEmptyShelfLineJob)s.CurJob).EmptyShelfPlace.Equals(emptyNodeName)); int i = Common.agvInfo.FindIndex(s => s.CurJob is GoEmptyShelfLineJob && ((GoEmptyShelfLineJob)s.CurJob).EmptyShelfPlace.Equals(emptyNodeName));
if (i == -1) if (i == -1)
{ {
if ((SettingString.AGVCNT / 2 - emptyJobCnt).Equals(1))//保留1辆小车出满料架 ClientNode clientNode = Common.nodeInfo.Find(s => s.Name.Equals(emptyNodeName));
{ if (Common.CheckStationState(clientNode, out rfid) && CanEmptyTask(emptyJobCnt))
return null;
}
return new GoEmptyShelfLineJob(currentAgv.Place, emptyNodeName, rfid); return new GoEmptyShelfLineJob(currentAgv.Place, emptyNodeName, rfid);
} }
} }
...@@ -121,5 +117,18 @@ namespace AGVControl ...@@ -121,5 +117,18 @@ namespace AGVControl
return null; return null;
} }
/// <summary>
/// 控制出空架小车数量
/// </summary>
/// <param name="emptytASKAGV"></param>
/// <returns></returns>
private bool CanEmptyTask(int emptytASKAGV)
{
if ((SettingString.AGVCNT / 2 - emptytASKAGV).Equals(1))//保留1辆小车出满料架
{
return false;
}
return true;
}
} }
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!