Commit 5f8512a7 张东亮

运行ok版本

1 个父辈 3bb51791
正在显示 34 个修改的文件 包含 392 行增加260 行删除
...@@ -103,6 +103,7 @@ namespace BLL ...@@ -103,6 +103,7 @@ namespace BLL
public static bool FindFullShelfTarget(string rfid, out BoxDestInfo dest) public static bool FindFullShelfTarget(string rfid, out BoxDestInfo dest)
{ {
dest = null; dest = null;
A6_Target = "";
try try
{ {
if (rfid.Equals("") || rfid.Equals("00")) if (rfid.Equals("") || rfid.Equals("00"))
......
...@@ -489,7 +489,7 @@ namespace BLL ...@@ -489,7 +489,7 @@ namespace BLL
int idx = Common.nodeInfo.FindIndex(s => s.Name == node.Name); int idx = Common.nodeInfo.FindIndex(s => s.Name == node.Name);
if (idx == -1) if (idx == -1)
{ {
Common.LogInfo("UpdateNode " + node.Name + " 不存在"); Common.log.Error("UpdateNode " + node.Name + " 不存在");
return; return;
} }
...@@ -591,7 +591,7 @@ namespace BLL ...@@ -591,7 +591,7 @@ namespace BLL
if (!_client[idx].IsConn) if (!_client[idx].IsConn)
{ {
Common.LogInfo(ip + " 没有连接"); Common.log.Error(ip + " 没有连接");
return false; return false;
} }
......
...@@ -87,18 +87,25 @@ namespace BLL ...@@ -87,18 +87,25 @@ namespace BLL
{ {
if (!CheckOnline(i)) continue; if (!CheckOnline(i)) continue;
bool change = false; bool change = false;
Common.mir.Get_Task_State(Common.agvInfo[i].CurTaskID, out string stateStr);
Thread.Sleep(50);
//获取AGV状态 //获取AGV状态
rtn = Common.mir.Get_State(Common.agvInfo[i], out eAGVState stateID, out string stateText, out int battery, out string mission_text, out Agv_Info.clsPosition position); rtn = Common.mir.Get_State(Common.agvInfo[i], out eAGVState stateID, out string stateText, out int battery, out string mission_text, out Agv_Info.clsPosition position);
Thread.Sleep(50); Thread.Sleep(50);
Common.mir.Get_Task_State(Common.agvInfo[i], out string stateStr);
Thread.Sleep(50);
if (rtn) change = Common.agvInfo[i].SetState(stateID, stateStr, battery, mission_text, position); if (rtn) change = Common.agvInfo[i].SetState(stateID, stateStr, battery, mission_text, position);
else
continue;
//更新状态stateID.Equals(eAGVState.Executing)
if (change)
{
AgvChanged?.Invoke(i);
}
Common.log.Debug("获取AGV状态"); Common.log.Debug("获取AGV状态");
//获取地点任务状态 //获取地点任务状态
Thread.Sleep(50); //Thread.Sleep(50);
rtn = Common.mir.Get_Register(Common.agvInfo[i], REG_STATUS, out int regValue); //rtn = Common.mir.Get_Register(Common.agvInfo[i], REG_STATUS, out int regValue);
if (rtn) Common.agvInfo[i].GetPlace(regValue); //if (rtn) Common.agvInfo[i].GetPlace(regValue);
Thread.Sleep(50); Thread.Sleep(50);
rtn = Common.mir.Get_IO_Status(Common.agvInfo[i], out bool[] input, out bool[] output); rtn = Common.mir.Get_IO_Status(Common.agvInfo[i], out bool[] input, out bool[] output);
...@@ -123,35 +130,21 @@ namespace BLL ...@@ -123,35 +130,21 @@ namespace BLL
preAGVState = Common.agvInfo[i].StateID; preAGVState = Common.agvInfo[i].StateID;
if (battery <= 10) //if (battery <= 10)
{ //{
isAlarm = true; // isAlarm = true;
msglist.Add(new AlarmMsg(Common.agvInfo[i].Name, "lineAgv." + Common.agvInfo[i].Name + ".battery", "电量 " + battery.ToString() + "%")); // msglist.Add(new AlarmMsg(Common.agvInfo[i].Name, "lineAgv." + Common.agvInfo[i].Name + ".battery", "电量 " + battery.ToString() + "%"));
} //}
if (stateText.Equals("Error") || stateText.Equals("EmergencyStop") || stateText.Equals("Pause")) if (stateText.Equals("Error") || stateText.Equals("EmergencyStop") || stateText.Equals("Pause"))
{ {
isAlarm = true; isAlarm = true;
msglist.Add(new AlarmMsg(Common.agvInfo[i].Name, "lineAgv." + Common.agvInfo[i].Name + ".Error.EmergencyStop", "agv状态:" + stateText + ";" + mission_text)); msglist.Add(new AlarmMsg(Common.agvInfo[i].Name, "lineAgv." + Common.agvInfo[i].Name + ".Error.EmergencyStop", "agv状态:" + stateText + ";" + mission_text));
} }
if (input != null && input.Length == 4)
{
if (!Common.agvInfo[i].IsExistShelf.Equals(input[3]))
{
isAlarm = true;
msglist.Add(new AlarmMsg(Common.agvInfo[i].Name, "lineAgv." + Common.agvInfo[i].Name + ".IsExistShelf", "agv负载:" + "IO信号与负载信号不匹配"));
}
}
//更新状态stateID.Equals(eAGVState.Executing)
if (change)
{
AgvChanged?.Invoke(i);
}
} }
catch(Exception ex) catch (Exception ex)
{ {
Common.log.Error("AgvStateTimer_"+Common.agvInfo[i].Name + ex.Message+ex.StackTrace); Common.log.Error("AgvStateTimer_" + Common.agvInfo[i].Name + ex.Message + ex.StackTrace);
} }
} }
if (isAlarm) if (isAlarm)
...@@ -175,7 +168,7 @@ namespace BLL ...@@ -175,7 +168,7 @@ namespace BLL
if (node.Name.Equals("A5")) if (node.Name.Equals("A5"))
{ {
if (!SettingString.C4_AGV_IPs.Contains(agv_Info.IP)) if (!SettingString.C4_AGV_IPs.Contains(agv_Info.IP))
continue; continue;
job = ((DoubleLineNodeFor4C)node).GetNewJob(agv_Info); job = ((DoubleLineNodeFor4C)node).GetNewJob(agv_Info);
} }
else if (node.Name.Equals("A6")) else if (node.Name.Equals("A6"))
...@@ -229,7 +222,7 @@ namespace BLL ...@@ -229,7 +222,7 @@ namespace BLL
else else
{ {
//if (agv.Battery < Common.chargeStatus.chargeMax) //if (agv.Battery < Common.chargeStatus.chargeMax)
agv.CurJob = new ChargeJob(agv.Place); agv.CurJob = new ChargeJob(agv.Place);
} }
} }
......
...@@ -233,10 +233,11 @@ namespace BLL ...@@ -233,10 +233,11 @@ namespace BLL
{ {
//var key = Common.agvMission.Where(qq => qq.Value == mission_id).Select(qq => qq.Key); //var key = Common.agvMission.Where(qq => qq.Value == mission_id).Select(qq => qq.Key);
//Common.log.Info(string.Format("{0} Add_Mission_Fleet [{1}]", info.Name, key.ToList()[0])); //Common.log.Info(string.Format("{0} Add_Mission_Fleet [{1}]", info.Name, key.ToList()[0]));
Common.LogInfo(string.Format("{0} Add_Mission_Fleet [{1}]", info.Name, mission_id)); var key = Common.agvMission.Where(qq => qq.Value == mission_id).Select(qq => qq.Key);
info.CurTaskName = key.ToList()[0];
Common.LogInfo(string.Format("{0} Add_Mission_Fleet [{1}][{2}]", info.Name, key.ToList()[0], mission_id));
info.CurTaskID = -1; info.CurTaskID = -1;
info.CurTaskGUID = ""; info.CurTaskGUID = "";
info.CurTaskName = "";
info.CurTaskState = SettingString.Wait; info.CurTaskState = SettingString.Wait;
//防止上一个任务已执行但返回失败时,删除任务 //防止上一个任务已执行但返回失败时,删除任务
//if (isRemovePreMission) //if (isRemovePreMission)
...@@ -260,9 +261,6 @@ namespace BLL ...@@ -260,9 +261,6 @@ namespace BLL
{ {
info.CurTaskID = Convert.ToInt32(id); info.CurTaskID = Convert.ToInt32(id);
info.CurTaskGUID = mission_id; info.CurTaskGUID = mission_id;
var key = Common.agvMission.Where(qq => qq.Value == mission_id).Select(qq => qq.Key);
info.CurTaskName = key.ToList()[0];
Common.LogInfo(string.Format("{0} Add_Mission_Fleet [{1}]", info.Name, key.ToList()[0]));
} }
catch catch
{ {
...@@ -436,17 +434,17 @@ namespace BLL ...@@ -436,17 +434,17 @@ namespace BLL
} }
public bool Get_Task_State(Agv_Info info,out string stateStr) public bool Get_Task_State(int CurTaskID, out string stateStr)
{ {
stateStr = "None"; stateStr = SettingString.Wait;
try try
{ {
if (info.CurTaskID == -1) if (CurTaskID == -1)
return true; return true;
string ip = Common.appConfig.AppSettings.Settings["FLEET"].Value; string ip = Common.appConfig.AppSettings.Settings["FLEET"].Value;
//http://10.85.199.3/api/v2.0.0/mission_scheduler //http://10.85.199.3/api/v2.0.0/mission_scheduler
string url = "http://" + ip + "/api/v2.0.0/mission_scheduler/" + info.CurTaskID; string url = "http://" + ip + "/api/v2.0.0/mission_scheduler/" + CurTaskID;
string json = HttpGet(url, info.IP, info.Authorization); string json = HttpGet(url, ip, Common.agvInfo[0].Authorization);
Common.log.Debug("URL: " + url + "\n" + "Return: " + json); Common.log.Debug("URL: " + url + "\n" + "Return: " + json);
if (string.IsNullOrWhiteSpace(json)) return false; if (string.IsNullOrWhiteSpace(json)) return false;
...@@ -458,7 +456,7 @@ namespace BLL ...@@ -458,7 +456,7 @@ namespace BLL
// "state": "Done" // "state": "Done"
string s = dic["id"].ToString(); string s = dic["id"].ToString();
if (s.Equals(info.CurTaskID.ToString())) if (s.Equals(CurTaskID.ToString()))
{ {
stateStr = dic["state"].ToString(); stateStr = dic["state"].ToString();
return true; return true;
......
...@@ -126,16 +126,16 @@ ...@@ -126,16 +126,16 @@
<metadata name="Column4.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="Column4.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="Column14.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="Column21.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="Column21.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="Column18.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="Column20.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="Column18.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="Column23.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="Column23.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
......
...@@ -50,8 +50,6 @@ namespace AGVControl ...@@ -50,8 +50,6 @@ namespace AGVControl
Common.mir = new MiR_API(); Common.mir = new MiR_API();
Common.control = new BLL.Control(); Common.control = new BLL.Control();
//软件开启时检查小车当前的任务状态,并获取各节点的坐标位置
// Common.CheckAGVMissionState();
//获取节点位置 //获取节点位置
Common.GetNodesPosition(); Common.GetNodesPosition();
......
...@@ -20,6 +20,69 @@ namespace AGVControl ...@@ -20,6 +20,69 @@ namespace AGVControl
/// </summary> /// </summary>
public abstract Job Execute(Agv_Info agv); public abstract Job Execute(Agv_Info agv);
public int CurTaskID { get; set; } = -1;
/// <summary>
/// 当前的任务名称(与任务GUID对应)
/// </summary>
public string CurTaskName { get; set; } = "";
/// <summary>
/// 当前任务的执行状态
/// </summary>
public string CurTaskState { get; set; } = "Wait";
/// <summary>
/// 更新任务信息
/// </summary>
/// <param name="curTaskName"></param>
/// <param name="curTaskId"></param>
protected void UpdateJobTaskInfo(string curTaskName, int curTaskId)
{
CurTaskID = curTaskId;
CurTaskName = curTaskName;
//CurTaskState = SettingString.Wait;
CurTaskState = Common.GetTakJobState(CurTaskID);
}
/// <summary>
/// 任务重发
/// </summary>
/// <returns></returns>
public bool ResendTask(Agv_Info agv)
{
bool rtn = false;
if (!CurTaskID.Equals(-1) && Common.mir.Get_Task_State(CurTaskID, out string stateStr))
{
if (stateStr.Equals(SettingString.Aborted))
{
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission[CurTaskName]);
if (rtn)
{
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
return true;
}
}
}
else if (!CurTaskName.Equals("") && !Common.agvMission[CurTaskName].Equals(agv.CurTaskGUID))//Job的当前任务与agv最新任务不一致
{
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission[CurTaskName]);
if (rtn)
{
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
return true;
}
}
else if (CurTaskID.Equals(-1))//任务发送失败,重新发送
{
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission[CurTaskName]);
if (rtn)
{
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
return true;
}
}
return false;
}
} }
} }
...@@ -28,7 +28,7 @@ namespace AGVControl ...@@ -28,7 +28,7 @@ namespace AGVControl
/// <summary> /// <summary>
/// 接收任务时,agv的位置 /// 接收任务时,agv的位置
/// </summary> /// </summary>
private string agvPlace { get; set; } private string agvPlace = "";
private string runInfo = ""; private string runInfo = "";
/// <summary> /// <summary>
...@@ -39,7 +39,6 @@ namespace AGVControl ...@@ -39,7 +39,6 @@ namespace AGVControl
get { return runInfo; } get { return runInfo; }
} }
private JobStep<CHARGE_STEP> ChargeStep = new JobStep<CHARGE_STEP>(CHARGE_STEP.NONE); private JobStep<CHARGE_STEP> ChargeStep = new JobStep<CHARGE_STEP>(CHARGE_STEP.NONE);
/// <summary> /// <summary>
...@@ -52,11 +51,14 @@ namespace AGVControl ...@@ -52,11 +51,14 @@ namespace AGVControl
bool rtn = false; bool rtn = false;
runInfo = ""; runInfo = "";
agv.Msg = runInfo; agv.Msg = runInfo;
//if (!CurTaskID.Equals(-1) && Common.mir.Get_Task_State(CurTaskID, out string st))
// CurTaskState = st;
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.StartsWith(SettingString.Standby_Name_Prefix))//在待机位不操作 if (agv.Place.Equals(SettingString.Standby))//在待机位不操作
{ {
ChargeStep.ToNextStep(CHARGE_STEP.END); ChargeStep.ToNextStep(CHARGE_STEP.END);
runInfo = "在待机位,电量充足[" + agv.Battery + "%],等待任务"; runInfo = "在待机位,电量充足[" + agv.Battery + "%],等待任务";
...@@ -64,13 +66,14 @@ namespace AGVControl ...@@ -64,13 +66,14 @@ namespace AGVControl
ChargeStep.Msg = msg; ChargeStep.Msg = msg;
} }
else if (agvPlace.StartsWith("G")) 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 + "%],从当前位置4C-" + agvPlace + "回到待机位,先到4D门"; runInfo = "电量充足[" + agv.Battery + "%],从当前位置" + agvPlace + "回到待机位,先到4D门";
msg += runInfo; msg += runInfo;
ChargeStep.Msg = msg; ChargeStep.Msg = msg;
Common.DoorMission(agv, SettingString.DoorCToD); Common.DoorMission(agv, SettingString.DoorCToD);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else else
{ {
...@@ -81,11 +84,12 @@ namespace AGVControl ...@@ -81,11 +84,12 @@ namespace AGVControl
//Common.StatusCharge(agv); //Common.StatusCharge(agv);
Common.MoveToNode(agv, SettingString.Standby); Common.MoveToNode(agv, SettingString.Standby);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
} }
else else
{ {
if (agvPlace.StartsWith("G")) 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门";
...@@ -93,6 +97,7 @@ namespace AGVControl ...@@ -93,6 +97,7 @@ namespace AGVControl
ChargeStep.Msg = msg; ChargeStep.Msg = msg;
Common.DoorMission(agv, SettingString.DoorCToD); Common.DoorMission(agv, SettingString.DoorCToD);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else else
{ {
...@@ -104,14 +109,15 @@ namespace AGVControl ...@@ -104,14 +109,15 @@ namespace AGVControl
msg += runInfo; msg += runInfo;
ChargeStep.Msg = msg; ChargeStep.Msg = msg;
Common.MoveToNode(agv, SettingString.Standby); Common.MoveToNode(agv, SettingString.Standby);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else else
{ {
ChargeStep.ToNextStep(CHARGE_STEP.WAIT_REACH_CHARGE_STATION); ChargeStep.ToNextStep(CHARGE_STEP.WAIT_REACH_CHARGE_STATION);
runInfo = "电量[" + agv.Battery + " %]小于最大电量[" + Common.chargeStatus.chargeMax + " %],从当前位置" + agvPlace + "回到充电位"; runInfo = "电量[" + agv.Battery + "%]小于最大电量[" + Common.chargeStatus.chargeMax + "%],从当前位置" + agvPlace + "回到充电位";
msg += runInfo; msg += runInfo;
ChargeStep.Msg = msg; ChargeStep.Msg = msg;
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
} }
} }
...@@ -120,7 +126,7 @@ namespace AGVControl ...@@ -120,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, agv.CurTaskGUID)) if (Common.CheckTaskFinished(agv,SettingString.DoorCToD,CurTaskState))
{ {
if (agv.Battery > Common.chargeStatus.chargeMax) if (agv.Battery > Common.chargeStatus.chargeMax)
{ {
...@@ -129,6 +135,7 @@ namespace AGVControl ...@@ -129,6 +135,7 @@ namespace AGVControl
msg += runInfo; msg += runInfo;
ChargeStep.Msg = msg; ChargeStep.Msg = msg;
Common.MoveToNode(agv, SettingString.Standby); Common.MoveToNode(agv, SettingString.Standby);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else else
{ {
...@@ -140,6 +147,7 @@ namespace AGVControl ...@@ -140,6 +147,7 @@ namespace AGVControl
ChargeStep.Msg = msg; ChargeStep.Msg = msg;
Common.MoveToNode(agv, SettingString.Standby); Common.MoveToNode(agv, SettingString.Standby);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else else
{ {
...@@ -147,6 +155,7 @@ namespace AGVControl ...@@ -147,6 +155,7 @@ namespace AGVControl
runInfo = "电量[" + agv.Battery + "%]小于最大电量[" + Common.chargeStatus.chargeMax + "%],从当前位置" + agvPlace + "回到充电位"; runInfo = "电量[" + agv.Battery + "%]小于最大电量[" + Common.chargeStatus.chargeMax + "%],从当前位置" + agvPlace + "回到充电位";
msg += runInfo; msg += runInfo;
ChargeStep.Msg = msg; ChargeStep.Msg = msg;
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
} }
...@@ -154,7 +163,7 @@ namespace AGVControl ...@@ -154,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, 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,6 +190,7 @@ namespace AGVControl ...@@ -181,6 +190,7 @@ namespace AGVControl
Common.chargeStatus.charge4 = ""; Common.chargeStatus.charge4 = "";
} }
Common.MoveToNode(agv, SettingString.Standby); Common.MoveToNode(agv, SettingString.Standby);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else if (agv.Battery >= Common.chargeStatus.chargeMin) else if (agv.Battery >= Common.chargeStatus.chargeMin)
{ {
...@@ -195,7 +205,7 @@ namespace AGVControl ...@@ -195,7 +205,7 @@ namespace AGVControl
{ {
Common.chargeStatus.charge4 = ""; Common.chargeStatus.charge4 = "";
} }
runInfo = "充电过程检测到任务,电量[" + agv.Battery + "]大于最小电量[" + Common.chargeStatus.chargeMin + "],中断充电执行任务"; runInfo = "充电过程检测到任务,电量[" + agv.Battery + "%]大于最小电量[" + Common.chargeStatus.chargeMin + "%],中断充电执行任务";
msg += runInfo; msg += runInfo;
ChargeStep.Msg = msg; ChargeStep.Msg = msg;
return job; return job;
...@@ -217,7 +227,7 @@ namespace AGVControl ...@@ -217,7 +227,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))
{ {
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)) if (Common.chargeStatus.charge3.Equals(agv.Name))
...@@ -233,7 +243,7 @@ namespace AGVControl ...@@ -233,7 +243,7 @@ namespace AGVControl
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)) if (Common.chargeStatus.charge3.Equals(agv.Name))
...@@ -252,7 +262,7 @@ namespace AGVControl ...@@ -252,7 +262,7 @@ namespace AGVControl
} }
else if (ChargeStep.IsStep(CHARGE_STEP.WAIT_REACH_STANDBY)) else if (ChargeStep.IsStep(CHARGE_STEP.WAIT_REACH_STANDBY))
{ {
if (Common.CheckTaskFinished(agv, SettingString.Standby, agv.CurTaskGUID)) if (Common.CheckTaskFinished(agv, SettingString.Standby, CurTaskState))
{ {
ChargeStep.ToNextStep(CHARGE_STEP.END); ChargeStep.ToNextStep(CHARGE_STEP.END);
runInfo= "充电完成,到达待机位"; runInfo= "充电完成,到达待机位";
...@@ -262,7 +272,7 @@ namespace AGVControl ...@@ -262,7 +272,7 @@ namespace AGVControl
} }
else if (ChargeStep.IsStep(CHARGE_STEP.END)) else if (ChargeStep.IsStep(CHARGE_STEP.END))
{ {
runInfo = "等待任务";
Job job = Common.control.GetJob(agv); Job job = Common.control.GetJob(agv);
if (job != null && !(job is ChargeJob)) if (job != null && !(job is ChargeJob))
{ {
...@@ -282,7 +292,7 @@ namespace AGVControl ...@@ -282,7 +292,7 @@ namespace AGVControl
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)) if (Common.chargeStatus.charge3.Equals(agv.Name))
......
...@@ -52,7 +52,9 @@ namespace AGVControl ...@@ -52,7 +52,9 @@ namespace AGVControl
string msg = agv.Name + " "; string msg = agv.Name + " ";
bool rtn = false; bool rtn = false;
agv.Msg = runInfo; agv.Msg = runInfo;
//if (!CurTaskID.Equals(-1) && Common.mir.Get_Task_State(CurTaskID, out string st))
// CurTaskState = st;
CurTaskState = Common.GetTakJobState(CurTaskID);
if (EmptyAGVBackStep.IsStep(EMPTY_AGV_BACK_STEP.NONE)) if (EmptyAGVBackStep.IsStep(EMPTY_AGV_BACK_STEP.NONE))
{ {
...@@ -69,13 +71,14 @@ namespace AGVControl ...@@ -69,13 +71,14 @@ namespace AGVControl
else else
{ {
if (agvPlace.StartsWith("G")) if (agvPlace.StartsWith(SettingString.C4_Name_Prefix))
{ {
EmptyAGVBackStep.ToNextStep(EMPTY_AGV_BACK_STEP.WAIT_AGV_REACH_4D_DOOR); EmptyAGVBackStep.ToNextStep(EMPTY_AGV_BACK_STEP.WAIT_AGV_REACH_4D_DOOR);
runInfo= "从产线" + agvPlace + "回待机位,先到4D门"; runInfo= "从产线" + agvPlace + "回待机位,先到4D门";
msg += runInfo; msg += runInfo;
EmptyAGVBackStep.Msg = msg; EmptyAGVBackStep.Msg = msg;
Common.DoorMission(agv, SettingString.DoorCToD); Common.DoorMission(agv, SettingString.DoorCToD);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else else
{ {
...@@ -84,6 +87,7 @@ namespace AGVControl ...@@ -84,6 +87,7 @@ namespace AGVControl
msg += runInfo; msg += runInfo;
EmptyAGVBackStep.Msg = msg; EmptyAGVBackStep.Msg = msg;
Common.MoveToNode(agv, SettingString.Standby); Common.MoveToNode(agv, SettingString.Standby);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
} }
//EmptyAGVBackStep.ToNextStep(EMPTY_AGV_BACK_STEP.END); //EmptyAGVBackStep.ToNextStep(EMPTY_AGV_BACK_STEP.END);
...@@ -91,13 +95,14 @@ namespace AGVControl ...@@ -91,13 +95,14 @@ namespace AGVControl
} }
else else
{ {
if (agvPlace.StartsWith("G")) if (agvPlace.StartsWith(SettingString.C4_Name_Prefix))
{ {
EmptyAGVBackStep.ToNextStep(EMPTY_AGV_BACK_STEP.WAIT_AGV_REACH_4D_DOOR); EmptyAGVBackStep.ToNextStep(EMPTY_AGV_BACK_STEP.WAIT_AGV_REACH_4D_DOOR);
runInfo= "从产线" + agvPlace + "回待机位,先到4D门"; runInfo= "从产线" + agvPlace + "回待机位,先到4D门";
msg += runInfo; msg += runInfo;
EmptyAGVBackStep.Msg = msg; EmptyAGVBackStep.Msg = msg;
Common.DoorMission(agv, SettingString.DoorCToD); Common.DoorMission(agv, SettingString.DoorCToD);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else else
{ {
...@@ -106,12 +111,14 @@ namespace AGVControl ...@@ -106,12 +111,14 @@ namespace AGVControl
msg += runInfo; msg += runInfo;
EmptyAGVBackStep.Msg = msg; EmptyAGVBackStep.Msg = msg;
Common.MoveToNode(agv, SettingString.Standby); Common.MoveToNode(agv, SettingString.Standby);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
} }
} }
else if (EmptyAGVBackStep.IsStep(EMPTY_AGV_BACK_STEP.WAIT_REACH_STANDBY)) else if (EmptyAGVBackStep.IsStep(EMPTY_AGV_BACK_STEP.WAIT_REACH_STANDBY))
{ {
if (Common.CheckTaskFinished(agv, SettingString.Standby, agv.CurTaskGUID)) CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.CheckTaskFinished(agv, SettingString.Standby,CurTaskState))
{ {
Job job = Common.control.GetJob(agv); Job job = Common.control.GetJob(agv);
if (job == null && agv.Battery < Common.chargeStatus.chargeMax) if (job == null && agv.Battery < Common.chargeStatus.chargeMax)
...@@ -150,21 +157,22 @@ namespace AGVControl ...@@ -150,21 +157,22 @@ namespace AGVControl
} }
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))
{ {
if (Common.CheckTaskFinished(agv, SettingString.DoorCToD, agv.CurTaskGUID)) CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.CheckTaskFinished(agv, SettingString.DoorCToD, CurTaskState))
{ {
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.D4_DOOR_Name); 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.D4_DOOR_Name); return new ChargeJob(SettingString.DoorCToD);
} }
} }
} }
......
...@@ -40,7 +40,7 @@ namespace AGVControl ...@@ -40,7 +40,7 @@ namespace AGVControl
/// </summary> /// </summary>
private string EmptyShelfTargetPlace { get; set; } private string EmptyShelfTargetPlace { get; set; }
private int tryTimes = 0;
private eShelfType shelfType; private eShelfType shelfType;
private string runInfo = ""; private string runInfo = "";
/// <summary> /// <summary>
...@@ -63,15 +63,19 @@ namespace AGVControl ...@@ -63,15 +63,19 @@ namespace AGVControl
string msg = agv.Name+ " "; string msg = agv.Name+ " ";
bool rtn = false; bool rtn = false;
agv.Msg = runInfo; agv.Msg = runInfo;
//if (!CurTaskID.Equals(-1) && Common.mir.Get_Task_State(CurTaskID, out string st))
// CurTaskState = st;
if (EmptyBackStep.IsStep(EMPTY_SHELF_BACK_STEP.NONE)) if (EmptyBackStep.IsStep(EMPTY_SHELF_BACK_STEP.NONE))
{ {
if (EmptyShelfPlace.StartsWith("G"))//4车间 if (EmptyShelfPlace.StartsWith(SettingString.C4_Name_Prefix))//4C车间
{ {
EmptyBackStep.ToNextStep(EMPTY_SHELF_BACK_STEP.WAIT_AGV_REACH_DOOR); EmptyBackStep.ToNextStep(EMPTY_SHELF_BACK_STEP.WAIT_AGV_REACH_DOOR);
runInfo= "空料架从产线" + EmptyShelfPlace + "前往4D门"; runInfo= "空料架从产线" + EmptyShelfPlace + "前往4D门";
msg += runInfo; msg += runInfo;
EmptyBackStep.Msg = msg; EmptyBackStep.Msg = msg;
Common.DoorMission(agv, SettingString.DoorCToD); Common.DoorMission(agv, SettingString.DoorCToD);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else else
{ {
...@@ -83,7 +87,11 @@ namespace AGVControl ...@@ -83,7 +87,11 @@ namespace AGVControl
msg += runInfo; msg += runInfo;
EmptyBackStep.Msg = msg; EmptyBackStep.Msg = msg;
if (!EmptyShelfTargetPlace.Equals("")) if (!EmptyShelfTargetPlace.Equals(""))
{
Common.MoveToNode(agv, EmptyShelfTargetPlace); Common.MoveToNode(agv, EmptyShelfTargetPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
}
} }
else else
{ {
...@@ -92,12 +100,14 @@ namespace AGVControl ...@@ -92,12 +100,14 @@ namespace AGVControl
msg += runInfo; msg += runInfo;
EmptyBackStep.Msg = msg; EmptyBackStep.Msg = msg;
Common.MoveToNode(agv, SettingString.Standby); Common.MoveToNode(agv, SettingString.Standby);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
} }
} }
else if (EmptyBackStep.IsStep(EMPTY_SHELF_BACK_STEP.WAIT_AGV_REACH_DOOR)) else if (EmptyBackStep.IsStep(EMPTY_SHELF_BACK_STEP.WAIT_AGV_REACH_DOOR))
{ {
if (Common.CheckTaskFinished(agv, SettingString.DoorCToD, agv.CurTaskGUID)) CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.CheckTaskFinished(agv, SettingString.DoorCToD, CurTaskState))
{ {
if (Common.CheckA5A6State(agv, shelfType, out string nodeName)) if (Common.CheckA5A6State(agv, shelfType, out string nodeName))
{ {
...@@ -107,6 +117,7 @@ namespace AGVControl ...@@ -107,6 +117,7 @@ namespace AGVControl
msg += runInfo; msg += runInfo;
EmptyBackStep.Msg = msg; EmptyBackStep.Msg = msg;
Common.MoveToNode(agv, EmptyShelfTargetPlace); Common.MoveToNode(agv, EmptyShelfTargetPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else else
{ {
...@@ -115,11 +126,13 @@ namespace AGVControl ...@@ -115,11 +126,13 @@ namespace AGVControl
msg += runInfo; msg += runInfo;
EmptyBackStep.Msg = msg; EmptyBackStep.Msg = msg;
Common.MoveToNode(agv, SettingString.Standby); Common.MoveToNode(agv, SettingString.Standby);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
} }
} }
else if (EmptyBackStep.IsStep(EMPTY_SHELF_BACK_STEP.WAIT_AGV_REACH_STANDBY)) else if (EmptyBackStep.IsStep(EMPTY_SHELF_BACK_STEP.WAIT_AGV_REACH_STANDBY))
{ {
CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.CheckA5A6State(agv, shelfType, out string nodeName)) if (Common.CheckA5A6State(agv, shelfType, out string nodeName))
{ {
EmptyShelfTargetPlace = nodeName; EmptyShelfTargetPlace = nodeName;
...@@ -128,11 +141,13 @@ namespace AGVControl ...@@ -128,11 +141,13 @@ namespace AGVControl
msg += runInfo; msg += runInfo;
EmptyBackStep.Msg = msg; EmptyBackStep.Msg = msg;
Common.MoveToNode(agv, EmptyShelfTargetPlace); Common.MoveToNode(agv, EmptyShelfTargetPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
} }
else if (EmptyBackStep.IsStep(EMPTY_SHELF_BACK_STEP.WAIT_AGV_REACH_A5A6)) else if (EmptyBackStep.IsStep(EMPTY_SHELF_BACK_STEP.WAIT_AGV_REACH_A5A6))
{ {
if (Common.CheckTaskFinished(agv, EmptyShelfTargetPlace, agv.CurTaskGUID) && EmptyShelfTargetPlace.StartsWith("A")) CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.CheckTaskFinished(agv, EmptyShelfTargetPlace, CurTaskState) && EmptyShelfTargetPlace.StartsWith("A"))
{ {
//msg = "AGV到达 " + EmptyShelfTargetPlace; //msg = "AGV到达 " + EmptyShelfTargetPlace;
//EmptyBackStep.Msg = msg; //EmptyBackStep.Msg = msg;
...@@ -157,21 +172,49 @@ namespace AGVControl ...@@ -157,21 +172,49 @@ namespace AGVControl
msg += runInfo; msg += runInfo;
EmptyBackStep.Msg = msg; EmptyBackStep.Msg = msg;
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Leave"]); rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Leave"]);
agv.TaskSend = rtn ? "Leave" : ""; UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
} }
else if (EmptyBackStep.IsTimeOut(15000, out double timeOutValue)) else if (EmptyBackStep.IsTimeOut(15000, out double timeOutValue))
{ {
EmptyBackStep.ToNextStep(EMPTY_SHELF_BACK_STEP.WAIT_AGV_REACH_A5A6); tryTimes++;
runInfo= "AGV到达 " + EmptyShelfTargetPlace + ",15秒后重新向双层线发送入料架请求[ReadyEnter]"; if (tryTimes < 5)
msg += runInfo; return this;
EmptyBackStep.Msg = msg; // if(EmptyShelfTargetPlace.Equals(SettingString.A6))
// {
tryTimes = 0;
EmptyBackStep.ToNextStep(EMPTY_SHELF_BACK_STEP.WAIT_AGV_REACH_STANDBY);
runInfo = "双层线"+ EmptyShelfTargetPlace + "暂不需要空料架,从[" + EmptyShelfTargetPlace + "]到待机位";
msg += runInfo;
EmptyBackStep.Msg = msg;
Common.MoveToNode(agv, SettingString.Standby);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
// }
//else if(EmptyShelfTargetPlace.Equals(SettingString.A5))
//{
// tryTimes = 0;
// EmptyBackStep.ToNextStep(EMPTY_SHELF_BACK_STEP.WAIT_AGV_REACH_STANDBY);
// runInfo = "双层线A5暂不需要空料架,从[" + EmptyShelfTargetPlace + "]到待机位";
// msg += runInfo;
// EmptyBackStep.Msg = msg;
// Common.MoveToNode(agv, SettingString.Standby);
// UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
//}
//else
//{
// EmptyBackStep.ToNextStep(EMPTY_SHELF_BACK_STEP.WAIT_AGV_REACH_A5A6);
//}
// EmptyBackStep.ToNextStep(EMPTY_SHELF_BACK_STEP.WAIT_AGV_REACH_A5A6);
//runInfo= "AGV到达 " + EmptyShelfTargetPlace + ",15秒后重新向双层线发送入料架请求[ReadyEnter]";
//msg += runInfo;
//EmptyBackStep.Msg = msg;
} }
} }
else if (EmptyBackStep.IsStep(EMPTY_SHELF_BACK_STEP.WAIT__EMPTY_SHELF_IN_DOUBLE_LINE)) else if (EmptyBackStep.IsStep(EMPTY_SHELF_BACK_STEP.WAIT__EMPTY_SHELF_IN_DOUBLE_LINE))
{ {
if (Common.CheckEnterOrLeaveFinished(agv,"Leave",agv.CurTaskGUID)) CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.CheckEnterOrLeaveFinished(agv,"Leave",CurTaskState))
{ {
//EmptyBackStep.ToNextStep(EMPTY_SHELF_BACK_STEP.END); //EmptyBackStep.ToNextStep(EMPTY_SHELF_BACK_STEP.END);
...@@ -189,6 +232,8 @@ namespace AGVControl ...@@ -189,6 +232,8 @@ namespace AGVControl
runInfo= "空料架进入" + EmptyShelfTargetPlace + "完成,暂无任务,回充电位"; runInfo= "空料架进入" + EmptyShelfTargetPlace + "完成,暂无任务,回充电位";
msg += runInfo; msg += runInfo;
EmptyBackStep.Msg = msg; EmptyBackStep.Msg = msg;
agv.RFID = "";
agv.BoxDestInfo = "";
return new ChargeJob(SettingString.DoubleLine_Name_Prefix); return new ChargeJob(SettingString.DoubleLine_Name_Prefix);
} }
...@@ -197,8 +242,8 @@ namespace AGVControl ...@@ -197,8 +242,8 @@ namespace AGVControl
{ {
//链条停止 //链条停止
runInfo= "空料架在[" + EmptyShelfTargetPlace + "]离开小车超时[" + timeOutValue.ToString("f1") + "秒],请检查料架离开小车的情况"; runInfo= "空料架在[" + EmptyShelfTargetPlace + "]离开小车超时[" + timeOutValue.ToString("f1") + "秒],请检查料架离开小车的情况";
msg += runInfo; //msg += runInfo;
EmptyBackStep.Msg = msg; //EmptyBackStep.Msg = msg;
} }
} }
......
...@@ -70,6 +70,8 @@ namespace AGVControl ...@@ -70,6 +70,8 @@ namespace AGVControl
string msg = agv.Name+ " "; string msg = agv.Name+ " ";
bool rtn = false; bool rtn = false;
agv.Msg = runInfo; agv.Msg = runInfo;
//if (!CurTaskID.Equals(-1) && Common.mir.Get_Task_State(CurTaskID, out string st))
// CurTaskState = st;
if (EnterLeaveShelfStep.IsStep(ENTER_LEAVE_SHELF_STEP.NONE)) if (EnterLeaveShelfStep.IsStep(ENTER_LEAVE_SHELF_STEP.NONE))
{ {
if (ActionType.Equals(eEnterLeaveType.Leave)) if (ActionType.Equals(eEnterLeaveType.Leave))
...@@ -83,7 +85,7 @@ namespace AGVControl ...@@ -83,7 +85,7 @@ namespace AGVControl
msg += runInfo; msg += runInfo;
EnterLeaveShelfStep.Msg = msg; EnterLeaveShelfStep.Msg = msg;
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Leave"]); rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Leave"]);
agv.TaskSend = rtn ? "Leave" : ""; UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else if(ActionType.Equals(eEnterLeaveType.Enter)) else if(ActionType.Equals(eEnterLeaveType.Enter))
{ {
...@@ -96,7 +98,7 @@ namespace AGVControl ...@@ -96,7 +98,7 @@ namespace AGVControl
msg += runInfo; msg += runInfo;
EnterLeaveShelfStep.Msg = msg; EnterLeaveShelfStep.Msg = msg;
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Enter"]); rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Enter"]);
agv.TaskSend = rtn ? "Enter" : ""; UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
} }
else if (EnterLeaveShelfStep.IsStep(ENTER_LEAVE_SHELF_STEP.WAIT_LINE_ReadyEnter_RESPONSE)) else if (EnterLeaveShelfStep.IsStep(ENTER_LEAVE_SHELF_STEP.WAIT_LINE_ReadyEnter_RESPONSE))
...@@ -110,7 +112,7 @@ namespace AGVControl ...@@ -110,7 +112,7 @@ namespace AGVControl
msg += runInfo; msg += runInfo;
EnterLeaveShelfStep.Msg = msg; EnterLeaveShelfStep.Msg = msg;
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Leave"]); rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Leave"]);
agv.TaskSend = rtn ? "Leave" : ""; UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else if (EnterLeaveShelfStep.IsTimeOut(15000, out double timeOutValue)) else if (EnterLeaveShelfStep.IsTimeOut(15000, out double timeOutValue))
{ {
...@@ -131,7 +133,7 @@ namespace AGVControl ...@@ -131,7 +133,7 @@ namespace AGVControl
msg += runInfo; msg += runInfo;
EnterLeaveShelfStep.Msg = msg; EnterLeaveShelfStep.Msg = msg;
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Enter"]); rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Enter"]);
agv.TaskSend = rtn ? "Enter" : ""; UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else if (EnterLeaveShelfStep.IsTimeOut(15000, out double timeOutValue)) else if (EnterLeaveShelfStep.IsTimeOut(15000, out double timeOutValue))
{ {
...@@ -143,7 +145,8 @@ namespace AGVControl ...@@ -143,7 +145,8 @@ namespace AGVControl
} }
else if (EnterLeaveShelfStep.IsStep(ENTER_LEAVE_SHELF_STEP.WAIT__SHELF_IN_LINE)) else if (EnterLeaveShelfStep.IsStep(ENTER_LEAVE_SHELF_STEP.WAIT__SHELF_IN_LINE))
{ {
if (Common.CheckEnterOrLeaveFinished(agv, "Leave", agv.CurTaskGUID)) CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.CheckEnterOrLeaveFinished(agv, "Leave", CurTaskState))
{ {
//EnterLeaveShelfStep.ToNextStep(ENTER_LEAVE_SHELF_STEP.END); //EnterLeaveShelfStep.ToNextStep(ENTER_LEAVE_SHELF_STEP.END);
...@@ -158,14 +161,15 @@ namespace AGVControl ...@@ -158,14 +161,15 @@ namespace AGVControl
{ {
//链条停止 //链条停止
runInfo= "料架在[" + LineName + "]离开小车超时[" + timeOutValue.ToString("f1") + "秒],请检查料架离开小车的情况"; runInfo= "料架在[" + LineName + "]离开小车超时[" + timeOutValue.ToString("f1") + "秒],请检查料架离开小车的情况";
msg += runInfo; //msg += runInfo;
EnterLeaveShelfStep.Msg = msg; //EnterLeaveShelfStep.Msg = msg;
} }
} }
else if (EnterLeaveShelfStep.IsStep(ENTER_LEAVE_SHELF_STEP.WAIT__SHELF_OUT_LINE)) else if (EnterLeaveShelfStep.IsStep(ENTER_LEAVE_SHELF_STEP.WAIT__SHELF_OUT_LINE))
{ {
if (Common.CheckEnterOrLeaveFinished(agv, "Enter", agv.CurTaskGUID)) CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.CheckEnterOrLeaveFinished(agv, "Enter", CurTaskState))
{ {
//EnterLeaveShelfStep.ToNextStep(ENTER_LEAVE_SHELF_STEP.END); //EnterLeaveShelfStep.ToNextStep(ENTER_LEAVE_SHELF_STEP.END);
...@@ -179,8 +183,8 @@ namespace AGVControl ...@@ -179,8 +183,8 @@ namespace AGVControl
{ {
//链条停止 //链条停止
runInfo= "料架在[" + LineName + "]进入小车超时[" + timeOutValue.ToString("f1") + "秒],请检查料架进入小车的情况"; runInfo= "料架在[" + LineName + "]进入小车超时[" + timeOutValue.ToString("f1") + "秒],请检查料架进入小车的情况";
msg += runInfo; //msg += runInfo;
EnterLeaveShelfStep.Msg = msg; //EnterLeaveShelfStep.Msg = msg;
} }
} }
......
...@@ -58,27 +58,30 @@ namespace AGVControl ...@@ -58,27 +58,30 @@ namespace AGVControl
bool rtn = false; bool rtn = false;
agv.Msg = runInfo; agv.Msg = runInfo;
int nodeIdx = Common.FindNode(EmptyShelfPlace); int nodeIdx = Common.FindNode(EmptyShelfPlace);
//if (!CurTaskID.Equals(-1) && Common.mir.Get_Task_State(CurTaskID, out string st))
// CurTaskState = st;
if (TakeEmptyStep.IsStep(TAKE_EMPTY_STEP.NONE)) if (TakeEmptyStep.IsStep(TAKE_EMPTY_STEP.NONE))
{ {
if (agvPlae.StartsWith("G") && EmptyShelfPlace.StartsWith("E"))//4C->4D if (agvPlae.StartsWith(SettingString.C4_Name_Prefix) && EmptyShelfPlace.StartsWith(SettingString.D4_Name_Prefix))//4C->4D
{ {
TakeEmptyStep.ToNextStep(TAKE_EMPTY_STEP.WAIT_AGV_REACH_4D_DOOR); TakeEmptyStep.ToNextStep(TAKE_EMPTY_STEP.WAIT_AGV_REACH_4D_DOOR);
runInfo = "去空料架产线" + EmptyShelfPlace + ",先前往4D门[" + agvPlae + "->" + EmptyShelfPlace + "]"; runInfo = "去空料架产线" + EmptyShelfPlace + ",先前往4D门[" + agvPlae + "->" + EmptyShelfPlace + "]";
msg += runInfo; msg += runInfo;
TakeEmptyStep.Msg = msg; TakeEmptyStep.Msg = msg;
Common.DoorMission(agv, SettingString.DoorCToD); Common.DoorMission(agv, SettingString.DoorCToD);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else if ((agvPlae.StartsWith("E") || agvPlae.StartsWith("A") || agvPlae.StartsWith("I") || agvPlae.StartsWith("H")) else if ((agvPlae.StartsWith(SettingString.D4_Name_Prefix) || agvPlae.StartsWith("A") || agvPlae.Equals(SettingString.Standby) || agvPlae.Equals(SettingString.AutoCharge))
&& EmptyShelfPlace.StartsWith("G"))//4D->4C && EmptyShelfPlace.StartsWith(SettingString.C4_Name_Prefix))//4D->4C
{ {
TakeEmptyStep.ToNextStep(TAKE_EMPTY_STEP.WAIT_AGV_REACH_4C_DOOR); TakeEmptyStep.ToNextStep(TAKE_EMPTY_STEP.WAIT_AGV_REACH_4C_DOOR);
runInfo= "去空料架产线" + EmptyShelfPlace + ",先前往4C门[" + agvPlae + "->" + EmptyShelfPlace + "]"; runInfo= "去空料架产线" + EmptyShelfPlace + ",先前往4C门[" + agvPlae + "->" + EmptyShelfPlace + "]";
msg += runInfo; msg += runInfo;
TakeEmptyStep.Msg = msg; TakeEmptyStep.Msg = msg;
Common.DoorMission(agv, SettingString.DoorDToC); Common.DoorMission(agv, SettingString.DoorDToC);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else if(agvPlae.StartsWith("G") && EmptyShelfPlace.StartsWith("G")) else if(agvPlae.StartsWith(SettingString.C4_Name_Prefix) && EmptyShelfPlace.StartsWith(SettingString.C4_Name_Prefix))
{ {
if(Common.Check4CTarget(agv, EmptyShelfPlace))//被占用 if(Common.Check4CTarget(agv, EmptyShelfPlace))//被占用
{ {
...@@ -87,6 +90,7 @@ namespace AGVControl ...@@ -87,6 +90,7 @@ namespace AGVControl
msg += runInfo; msg += runInfo;
TakeEmptyStep.Msg = msg; TakeEmptyStep.Msg = msg;
Common.MoveTo4CStandy(agv); Common.MoveTo4CStandy(agv);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else else
{ {
...@@ -106,7 +110,8 @@ namespace AGVControl ...@@ -106,7 +110,8 @@ namespace AGVControl
} }
else if (TakeEmptyStep.IsStep(TAKE_EMPTY_STEP.WAIT_AGV_REACH_4C_DOOR)) else if (TakeEmptyStep.IsStep(TAKE_EMPTY_STEP.WAIT_AGV_REACH_4C_DOOR))
{ {
if (Common.CheckTaskFinished(agv, SettingString.DoorDToC, agv.CurTaskGUID)) CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.CheckTaskFinished(agv, SettingString.DoorDToC, CurTaskState))
{ {
if (Common.Check4CTarget(agv, EmptyShelfPlace))//被占用 if (Common.Check4CTarget(agv, EmptyShelfPlace))//被占用
{ {
...@@ -115,6 +120,7 @@ namespace AGVControl ...@@ -115,6 +120,7 @@ namespace AGVControl
msg += runInfo; msg += runInfo;
TakeEmptyStep.Msg = msg; TakeEmptyStep.Msg = msg;
Common.MoveTo4CStandy(agv); Common.MoveTo4CStandy(agv);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else else
{ {
...@@ -127,8 +133,8 @@ namespace AGVControl ...@@ -127,8 +133,8 @@ namespace AGVControl
} }
else if (TakeEmptyStep.IsStep(TAKE_EMPTY_STEP.WAIT_REACH_TEMP_PLACE)) else if (TakeEmptyStep.IsStep(TAKE_EMPTY_STEP.WAIT_REACH_TEMP_PLACE))
{ {
CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.CheckTaskFinished(agv, SettingString.C4_STANDBY1, agv.CurTaskGUID)|| Common.CheckTaskFinished(agv, SettingString.C4_STANDBY2, agv.CurTaskGUID)) if (Common.CheckTaskFinished(agv, SettingString.C4_STANDBY1, CurTaskState) || Common.CheckTaskFinished(agv, SettingString.C4_STANDBY2, CurTaskState))
{ {
if (!Common.Check4CTarget(agv, EmptyShelfPlace))//未占用 if (!Common.Check4CTarget(agv, EmptyShelfPlace))//未占用
{ {
...@@ -142,7 +148,8 @@ namespace AGVControl ...@@ -142,7 +148,8 @@ namespace AGVControl
} }
else if (TakeEmptyStep.IsStep(TAKE_EMPTY_STEP.WAIT_AGV_REACH_4D_DOOR)) else if (TakeEmptyStep.IsStep(TAKE_EMPTY_STEP.WAIT_AGV_REACH_4D_DOOR))
{ {
if (Common.CheckTaskFinished(agv, SettingString.DoorCToD, agv.CurTaskGUID)) CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.CheckTaskFinished(agv, SettingString.DoorCToD, CurTaskState))
{ {
TakeEmptyStep.ToNextStep(TAKE_EMPTY_STEP.ASSIGN_AGV_TASK); TakeEmptyStep.ToNextStep(TAKE_EMPTY_STEP.ASSIGN_AGV_TASK);
runInfo = "开始执行回收空料架任务[" + agvPlae + "->" + EmptyShelfPlace + "]"; runInfo = "开始执行回收空料架任务[" + agvPlae + "->" + EmptyShelfPlace + "]";
...@@ -160,6 +167,7 @@ namespace AGVControl ...@@ -160,6 +167,7 @@ namespace AGVControl
msg += runInfo; msg += runInfo;
TakeEmptyStep.Msg = msg; TakeEmptyStep.Msg = msg;
Common.MoveToNode(agv, EmptyShelfPlace); Common.MoveToNode(agv, EmptyShelfPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else else
{ {
...@@ -181,9 +189,10 @@ namespace AGVControl ...@@ -181,9 +189,10 @@ namespace AGVControl
} }
else if (TakeEmptyStep.IsStep(TAKE_EMPTY_STEP.WAIT_REACH_PLACE)) else if (TakeEmptyStep.IsStep(TAKE_EMPTY_STEP.WAIT_REACH_PLACE))
{ {
if (Common.CheckTaskFinished(agv, EmptyShelfPlace, agv.CurTaskGUID)) CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.CheckTaskFinished(agv, EmptyShelfPlace, CurTaskState))
{ {
if (EmptyShelfPlace.Equals("G22")) if (EmptyShelfPlace.Equals(SettingString.C4FeederOut))
{ {
runInfo = "AGV到达 " + EmptyShelfPlace; runInfo = "AGV到达 " + EmptyShelfPlace;
msg += runInfo; msg += runInfo;
...@@ -196,6 +205,15 @@ namespace AGVControl ...@@ -196,6 +205,15 @@ namespace AGVControl
runInfo= "AGV到达 " + EmptyShelfPlace + " 向产线发送出料架请求[ReadyLeave]"; runInfo= "AGV到达 " + EmptyShelfPlace + " 向产线发送出料架请求[ReadyLeave]";
msg += runInfo; msg += runInfo;
TakeEmptyStep.Msg = msg; TakeEmptyStep.Msg = msg;
if (nodeIdx == -1)
{
runInfo = EmptyShelfPlace + " 未开启调用";
msg += runInfo;
TakeEmptyStep.Msg = msg;
return this;
}
ClientNode node = Common.nodeInfo[nodeIdx];
agv.RFID = node.RFID;
Common.server.ReadyLeave(EmptyShelfPlace); Common.server.ReadyLeave(EmptyShelfPlace);
} }
...@@ -208,8 +226,10 @@ namespace AGVControl ...@@ -208,8 +226,10 @@ namespace AGVControl
runInfo= EmptyShelfPlace + " 未开启调用"; runInfo= EmptyShelfPlace + " 未开启调用";
msg += runInfo; msg += runInfo;
TakeEmptyStep.Msg = msg; TakeEmptyStep.Msg = msg;
return this;
} }
ClientNode node = Common.nodeInfo[nodeIdx]; ClientNode node = Common.nodeInfo[nodeIdx];
agv.RFID = node.RFID;
if (node.StateEquals(eNodeStatus.MayLeave)) if (node.StateEquals(eNodeStatus.MayLeave))
{ {
if (!agv.CurTaskName.Equals("Enter")) if (!agv.CurTaskName.Equals("Enter"))
...@@ -218,35 +238,34 @@ namespace AGVControl ...@@ -218,35 +238,34 @@ namespace AGVControl
runInfo = "收到产线出料请求[ReadyLeave]的响应 " + EmptyShelfPlace + "出料架,小车链条运行"; runInfo = "收到产线出料请求[ReadyLeave]的响应 " + EmptyShelfPlace + "出料架,小车链条运行";
msg += runInfo; msg += runInfo;
TakeEmptyStep.Msg = msg; TakeEmptyStep.Msg = msg;
agv.RFID = node.RFID; //agv.RFID = node.RFID;
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Enter"]); rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Enter"]);
agv.TaskSend = rtn ? "Enter" : ""; UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
} }
else if (TakeEmptyStep.IsTimeOut(15000, out double timeOutValue)) else if (TakeEmptyStep.IsTimeOut(15000, out double timeOutValue))
{ {
TakeEmptyStep.ToNextStep(TAKE_EMPTY_STEP.WAIT_REACH_PLACE); TakeEmptyStep.ToNextStep(TAKE_EMPTY_STEP.WAIT_REACH_PLACE);
runInfo = "AGV到达 " + EmptyShelfPlace + ",15秒后重新向产线发送出料架请求[ReadyLeave]"; //runInfo = "AGV到达 " + EmptyShelfPlace + ",15秒后重新向产线发送出料架请求[ReadyLeave]";
msg += runInfo; //msg += runInfo;
TakeEmptyStep.Msg = msg; //TakeEmptyStep.Msg = msg;
} }
} }
else if (TakeEmptyStep.IsStep(TAKE_EMPTY_STEP.WAIT_TAKE_EMPTY_SHELF)) else if (TakeEmptyStep.IsStep(TAKE_EMPTY_STEP.WAIT_TAKE_EMPTY_SHELF))
{ {
if (Common.CheckEnterOrLeaveFinished(agv, "Enter", agv.CurTaskGUID)) CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.CheckEnterOrLeaveFinished(agv, "Enter", CurTaskState))
{ {
ClientNode node = Common.nodeInfo[nodeIdx]; ClientNode node = Common.nodeInfo[nodeIdx];
node.AgvName = ""; node.AgvName = "";
//回收空料架数量减少1 //回收空料架数量减少1
// node.DecreEmptyShelfCnt();
//TakeEmptyStep.ToNextStep(TAKE_EMPTY_STEP.END);
//if (shelfType.Equals(eShelfType.SmallShelf))
Common.DelEmptyShelfTask(EmptyShelfPlace); Common.DelEmptyShelfTask(EmptyShelfPlace);
runInfo= "空料架在[" + EmptyShelfPlace + "]进入小车完成"; runInfo= "空料架在[" + EmptyShelfPlace + "]进入小车完成";
msg += runInfo; msg += runInfo;
TakeEmptyStep.Msg = msg; TakeEmptyStep.Msg = msg;
if (agv.Place.Equals("E22")) //4DfeederOut默认大料架
if (agv.Place.Equals(SettingString.D4FeederOut))
return new EmptyShelfBackJob(EmptyShelfPlace, eShelfType.BigShelf); return new EmptyShelfBackJob(EmptyShelfPlace, eShelfType.BigShelf);
else if (agv.RFID.StartsWith("D")) else if (agv.RFID.StartsWith("D"))
return new EmptyShelfBackJob(EmptyShelfPlace, eShelfType.SmallShelf); return new EmptyShelfBackJob(EmptyShelfPlace, eShelfType.SmallShelf);
...@@ -261,8 +280,8 @@ namespace AGVControl ...@@ -261,8 +280,8 @@ namespace AGVControl
{ {
//链条停止 //链条停止
runInfo = "空料架在[" + EmptyShelfPlace + "]进入小车超时[" + timeOutValue.ToString("f1") + "秒],请检查料架进入小车的情况"; runInfo = "空料架在[" + EmptyShelfPlace + "]进入小车超时[" + timeOutValue.ToString("f1") + "秒],请检查料架进入小车的情况";
msg += runInfo; // msg += runInfo;
TakeEmptyStep.Msg = msg; //TakeEmptyStep.Msg = msg;
} }
} }
......
...@@ -57,6 +57,8 @@ namespace AGVControl ...@@ -57,6 +57,8 @@ namespace AGVControl
string msg = agv.Name + " "; string msg = agv.Name + " ";
bool rtn = false; bool rtn = false;
agv.Msg = runInfo; agv.Msg = runInfo;
//if (!CurTaskID.Equals(-1) && Common.mir.Get_Task_State(CurTaskID, out string st))
// CurTaskState = st;
if (GoFullShelfStationStep.IsStep(GO_FULL_SHELF_STATION_STEP.NONE)) if (GoFullShelfStationStep.IsStep(GO_FULL_SHELF_STATION_STEP.NONE))
{ {
GoFullShelfStationStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT_CHECK_RESULT); GoFullShelfStationStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT_CHECK_RESULT);
...@@ -64,10 +66,12 @@ namespace AGVControl ...@@ -64,10 +66,12 @@ namespace AGVControl
msg += runInfo; msg += runInfo;
GoFullShelfStationStep.Msg = msg; GoFullShelfStationStep.Msg = msg;
Common.CheckLoad(agv); Common.CheckLoad(agv);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else if (GoFullShelfStationStep.IsStep(GO_FULL_SHELF_STATION_STEP.WAIT_CHECK_RESULT)) else if (GoFullShelfStationStep.IsStep(GO_FULL_SHELF_STATION_STEP.WAIT_CHECK_RESULT))
{ {
//Common.log.Debug("WAIT_CHECK_RESULT " + Common.agvMission["CheckShelf"].Equals(agv.CurTaskGUID).ToString() + " " + agv.CurTaskGUID + " " + Common.agvMission["CheckShelf"]); //Common.log.Debug("WAIT_CHECK_RESULT " + Common.agvMission["CheckShelf"].Equals(agv.CurTaskGUID).ToString() + " " + agv.CurTaskGUID + " " + Common.agvMission["CheckShelf"]);
CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.agvMission["CheckShelf"].Equals(agv.CurTaskGUID) && agv.CurTaskState.Equals(SettingString.Done)) if (Common.agvMission["CheckShelf"].Equals(agv.CurTaskGUID) && agv.CurTaskState.Equals(SettingString.Done))
{ {
rtn = Common.mir.Get_IO_Status(agv, out bool[] input, out bool[] output); rtn = Common.mir.Get_IO_Status(agv, out bool[] input, out bool[] output);
...@@ -85,21 +89,23 @@ namespace AGVControl ...@@ -85,21 +89,23 @@ namespace AGVControl
} }
else if (input != null && !input[3]) else if (input != null && !input[3])
{ {
if (agvPlace.StartsWith(SettingString.Charge_Name_Prefix) || agvPlace.StartsWith(SettingString.Standby_Name_Prefix))//待机位/充电位接到任务 if (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;
msg += runInfo; msg += runInfo;
GoFullShelfStationStep.Msg = msg; GoFullShelfStationStep.Msg = msg;
Common.MoveToNode(agv, FullShelfStationPlace); Common.MoveToNode(agv, FullShelfStationPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else if (agvPlace.StartsWith("G"))//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);
runInfo = "在4C车间,向4D门运行,再到双层线入料口"; runInfo = "在4C车间,向4D门运行,再到双层线入料口";
msg += runInfo; msg += runInfo;
GoFullShelfStationStep.Msg = msg; GoFullShelfStationStep.Msg = msg;
Common.DoorMission(agv, SettingString.DoorCToD); Common.DoorMission(agv, SettingString.DoorCToD);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else else
{ {
...@@ -108,6 +114,7 @@ namespace AGVControl ...@@ -108,6 +114,7 @@ namespace AGVControl
msg += runInfo; msg += runInfo;
GoFullShelfStationStep.Msg = msg; GoFullShelfStationStep.Msg = msg;
Common.MoveToNode(agv, FullShelfStationPlace); Common.MoveToNode(agv, FullShelfStationPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
} }
} }
...@@ -123,14 +130,16 @@ namespace AGVControl ...@@ -123,14 +130,16 @@ namespace AGVControl
msg = runInfo; msg = runInfo;
GoFullShelfStationStep.Msg = msg; GoFullShelfStationStep.Msg = msg;
Common.MoveToNode(agv, FullShelfStationPlace); Common.MoveToNode(agv, FullShelfStationPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else if (agvPlace.StartsWith("G"))//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);
runInfo = "在4C车间,向4D门运行,再到双层线入料口"; runInfo = "在4C车间,向4D门运行,再到双层线入料口";
msg += runInfo; msg += runInfo;
GoFullShelfStationStep.Msg = msg; GoFullShelfStationStep.Msg = msg;
Common.DoorMission(agv, SettingString.DoorCToD); Common.DoorMission(agv, SettingString.DoorCToD);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
} }
...@@ -140,19 +149,22 @@ namespace AGVControl ...@@ -140,19 +149,22 @@ namespace AGVControl
} }
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))
{ {
if (Common.CheckTaskFinished(agv, SettingString.DoorCToD, agv.CurTaskGUID)) CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.CheckTaskFinished(agv, SettingString.DoorCToD, CurTaskState))
{ {
GoFullShelfStationStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT_AGV_REACH_A6); GoFullShelfStationStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT_AGV_REACH_A6);
runInfo = "到达4D门,准备运动到双层线入料口" + FullShelfStationPlace; runInfo = "到达4D门,准备运动到双层线入料口" + FullShelfStationPlace;
msg += runInfo; msg += runInfo;
GoFullShelfStationStep.Msg = msg; GoFullShelfStationStep.Msg = msg;
Common.MoveToNode(agv, FullShelfStationPlace); Common.MoveToNode(agv, FullShelfStationPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
} }
else if (GoFullShelfStationStep.IsStep(GO_FULL_SHELF_STATION_STEP.WAIT_AGV_REACH_A6)) else if (GoFullShelfStationStep.IsStep(GO_FULL_SHELF_STATION_STEP.WAIT_AGV_REACH_A6))
{ {
if (Common.CheckTaskFinished(agv, FullShelfStationPlace, agv.CurTaskGUID)) CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.CheckTaskFinished(agv, FullShelfStationPlace, CurTaskState))
{ {
ClientNode node = Common.nodeInfo.Find(s => s.Name.Equals(SettingString.A6) ClientNode node = Common.nodeInfo.Find(s => s.Name.Equals(SettingString.A6)
&& (s.StateEquals(eNodeStatus.NeedLeave) || s.StateEquals(eNodeStatus.NeedEnterLeave)) && !s.RFID.Equals("00")); && (s.StateEquals(eNodeStatus.NeedLeave) || s.StateEquals(eNodeStatus.NeedEnterLeave)) && !s.RFID.Equals("00"));
...@@ -188,6 +200,7 @@ namespace AGVControl ...@@ -188,6 +200,7 @@ namespace AGVControl
msg += runInfo; msg += runInfo;
GoFullShelfStationStep.Msg = msg; GoFullShelfStationStep.Msg = msg;
Common.MoveToNode(agv, SettingString.Standby); Common.MoveToNode(agv, SettingString.Standby);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
} }
} }
...@@ -202,7 +215,8 @@ namespace AGVControl ...@@ -202,7 +215,8 @@ namespace AGVControl
} }
else if (GoFullShelfStationStep.IsStep(GO_FULL_SHELF_STATION_STEP.WAIT_REACH_STANDBY)) else if (GoFullShelfStationStep.IsStep(GO_FULL_SHELF_STATION_STEP.WAIT_REACH_STANDBY))
{ {
if (Common.CheckTaskFinished(agv, SettingString.Standby, agv.CurTaskGUID)) CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.CheckTaskFinished(agv, SettingString.Standby, CurTaskState))
{ {
GoFullShelfStationStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.END); GoFullShelfStationStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.END);
runInfo = "到达待机位"; runInfo = "到达待机位";
...@@ -230,23 +244,24 @@ namespace AGVControl ...@@ -230,23 +244,24 @@ namespace AGVControl
msg += runInfo; msg += runInfo;
GoFullShelfStationStep.Msg = msg; GoFullShelfStationStep.Msg = msg;
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Enter"]); rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Enter"]);
agv.TaskSend = rtn ? "Enter" : ""; UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
} }
else if (GoFullShelfStationStep.IsTimeOut(15000, out double timeOutValue)) else if (GoFullShelfStationStep.IsTimeOut(15000, out double timeOutValue))
{ {
GoFullShelfStationStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT_AGV_REACH_A6); GoFullShelfStationStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT_AGV_REACH_A6);
runInfo = "AGV到达 " + FullShelfStationPlace + ",15秒后重新向双层线发送出料架请求[ReadyLeave]"; //runInfo = "AGV到达 " + FullShelfStationPlace + ",15秒后重新向双层线发送出料架请求[ReadyLeave]";
msg += runInfo; //msg += runInfo;
GoFullShelfStationStep.Msg = msg; //GoFullShelfStationStep.Msg = msg;
} }
} }
else if (GoFullShelfStationStep.IsStep(GO_FULL_SHELF_STATION_STEP.WAIT__FULL_SHELF_IN_AGV)) else if (GoFullShelfStationStep.IsStep(GO_FULL_SHELF_STATION_STEP.WAIT__FULL_SHELF_IN_AGV))
{ {
if (Common.CheckEnterOrLeaveFinished(agv, "Enter", agv.CurTaskGUID)) CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.CheckEnterOrLeaveFinished(agv, "Enter", CurTaskState))
{ {
//GoFullShelfStationStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.END); //GoFullShelfStationStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.END);
...@@ -264,8 +279,8 @@ namespace AGVControl ...@@ -264,8 +279,8 @@ namespace AGVControl
{ {
//链条停止 //链条停止
runInfo= "满料架在[" + FullShelfStationPlace + "]进入小车超时[" + timeOutValue.ToString("f1") + "秒],请检查料架进入小车的情况"; runInfo= "满料架在[" + FullShelfStationPlace + "]进入小车超时[" + timeOutValue.ToString("f1") + "秒],请检查料架进入小车的情况";
msg +=runInfo; //msg +=runInfo;
GoFullShelfStationStep.Msg = msg; //GoFullShelfStationStep.Msg = msg;
} }
} }
......
...@@ -61,31 +61,36 @@ namespace AGVControl ...@@ -61,31 +61,36 @@ namespace AGVControl
bool rtn = false; bool rtn = false;
agv.RFID = RFID; agv.RFID = RFID;
agv.Msg = runInfo; agv.Msg = runInfo;
//if (!CurTaskID.Equals(-1) && Common.mir.Get_Task_State(CurTaskID, out string st))
// CurTaskState = st;
if (SendFullShelfStep.IsStep(SEND_FULL_SHELF_STEP.NONE)) if (SendFullShelfStep.IsStep(SEND_FULL_SHELF_STEP.NONE))
{ {
if(FullShelfPlace.StartsWith("G")) 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 + "]"; 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);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
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 + "]"; 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);
} }
} }
else if (SendFullShelfStep.IsStep(SEND_FULL_SHELF_STEP.WAIT_AGV_REACH_DOOR)) else if (SendFullShelfStep.IsStep(SEND_FULL_SHELF_STEP.WAIT_AGV_REACH_DOOR))
{ {
if (Common.CheckTaskFinished(agv,SettingString.DoorDToC,agv.CurTaskGUID)) CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.CheckTaskFinished(agv,SettingString.DoorDToC,CurTaskState))
{ {
if (Common.Check4CTarget(agv, FullShelfPlace))//被占用 if (Common.Check4CTarget(agv, FullShelfPlace))//被占用
{ {
...@@ -94,38 +99,43 @@ namespace AGVControl ...@@ -94,38 +99,43 @@ namespace AGVControl
msg += runInfo; msg += runInfo;
SendFullShelfStep.Msg = msg; SendFullShelfStep.Msg = msg;
Common.MoveTo4CStandy(agv); Common.MoveTo4CStandy(agv);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
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 + "]"; 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);
} }
} }
} }
else if (SendFullShelfStep.IsStep(SEND_FULL_SHELF_STEP.WAIT_REACH_TEMP_PLACE)) else if (SendFullShelfStep.IsStep(SEND_FULL_SHELF_STEP.WAIT_REACH_TEMP_PLACE))
{ {
if (Common.CheckTaskFinished(agv, SettingString.C4_STANDBY1, agv.CurTaskGUID) || Common.CheckTaskFinished(agv, SettingString.C4_STANDBY2, agv.CurTaskGUID)) CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.CheckTaskFinished(agv, SettingString.C4_STANDBY1, CurTaskState) || Common.CheckTaskFinished(agv, SettingString.C4_STANDBY2, CurTaskState))
{ {
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 + "]"; runInfo = "满料架从临时待机位送往[" + FullShelfPlace + "][RFID=" + RFID + "]";
msg += runInfo; msg += runInfo;
SendFullShelfStep.Msg = msg; SendFullShelfStep.Msg = msg;
Common.DeleteStandyInfo(agv); Common.DeleteStandyInfo(agv);
Common.MoveToNode(agv, FullShelfPlace); Common.MoveToNode(agv, FullShelfPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
} }
} }
else if (SendFullShelfStep.IsStep(SEND_FULL_SHELF_STEP.WAIT_AGV_REACH_LINE)) else if (SendFullShelfStep.IsStep(SEND_FULL_SHELF_STEP.WAIT_AGV_REACH_LINE))
{ {
if (Common.CheckTaskFinished(agv,FullShelfPlace,agv.CurTaskGUID)) CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.CheckTaskFinished(agv,FullShelfPlace, CurTaskState))
{ {
if(FullShelfPlace.Equals("G21")) if(FullShelfPlace.Equals(SettingString.C4FeederIn))
{ {
runInfo= "AGV到达 " + FullShelfPlace + "完成"; runInfo= "AGV到达 " + FullShelfPlace + "完成";
msg += runInfo; msg += runInfo;
...@@ -142,7 +152,7 @@ namespace AGVControl ...@@ -142,7 +152,7 @@ namespace AGVControl
} }
else else
{ {
if (RFID.StartsWith("C") && !agv.Place.Equals("E21")) 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 + "]解绑";
...@@ -167,7 +177,8 @@ namespace AGVControl ...@@ -167,7 +177,8 @@ namespace AGVControl
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 + "]"; runInfo= "大料架在" + FullShelfPlace + "解绑完成 [" + RFID + "] [" + 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);
...@@ -186,7 +197,7 @@ namespace AGVControl ...@@ -186,7 +197,7 @@ namespace AGVControl
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"]);
agv.TaskSend = rtn ? "Leave" : ""; UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
} }
...@@ -200,12 +211,14 @@ namespace AGVControl ...@@ -200,12 +211,14 @@ namespace AGVControl
} }
else if (SendFullShelfStep.IsStep(SEND_FULL_SHELF_STEP.WAIT__SHELF_IN_LINE)) else if (SendFullShelfStep.IsStep(SEND_FULL_SHELF_STEP.WAIT__SHELF_IN_LINE))
{ {
if (Common.CheckEnterOrLeaveFinished(agv, "Leave", agv.CurTaskGUID)) CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.CheckEnterOrLeaveFinished(agv, "Leave", CurTaskState))
{ {
runInfo= "满料架进入" + FullShelfPlace + "完成 [" + RFID + "]"; runInfo= "满料架进入" + FullShelfPlace + "完成 [RFID=" + RFID + "] ["+agv.BoxDestInfo+"]";
msg += runInfo; msg += runInfo;
SendFullShelfStep.Msg = msg; SendFullShelfStep.Msg = msg;
agv.RFID = ""; agv.RFID = "";
agv.BoxDestInfo = "";
AGVManager.UpdateStatus(RFID, FullShelfPlace); AGVManager.UpdateStatus(RFID, FullShelfPlace);
return new EmptyAGVBackJob(FullShelfPlace); return new EmptyAGVBackJob(FullShelfPlace);
} }
...@@ -213,8 +226,8 @@ namespace AGVControl ...@@ -213,8 +226,8 @@ namespace AGVControl
{ {
//链条停止 //链条停止
runInfo= "满料架在[" + FullShelfPlace + "]离开小车超时[" + timeOutValue.ToString("f1") + "秒],请检查料架离开小车的情况"; runInfo= "满料架在[" + FullShelfPlace + "]离开小车超时[" + timeOutValue.ToString("f1") + "秒],请检查料架离开小车的情况";
msg += runInfo; //msg += runInfo;
SendFullShelfStep.Msg = msg; //SendFullShelfStep.Msg = msg;
} }
} }
......
...@@ -11,7 +11,7 @@ namespace AGVControl ...@@ -11,7 +11,7 @@ namespace AGVControl
/// </summary> /// </summary>
public class DoubleLineNodeFor4C : ClientNode public class DoubleLineNodeFor4C : ClientNode
{ {
public DoubleLineNodeFor4C(string name, string ip, string aliceName,string lineName, string pos_name, string pos_guid, bool isUse,int emptyCnt): base(name,ip, aliceName,lineName,pos_name,pos_guid, isUse, emptyCnt) public DoubleLineNodeFor4C(string name, string ip, string aliceName, string lineName, string pos_name, string pos_guid, bool isUse, int emptyCnt) : base(name, ip, aliceName, lineName, pos_name, pos_guid, isUse, emptyCnt)
{ {
} }
...@@ -46,7 +46,7 @@ namespace AGVControl ...@@ -46,7 +46,7 @@ namespace AGVControl
//出工单料的目的地是否有空料架 //出工单料的目的地是否有空料架
if (Common.FindEmptyShelfBeforeSendFullShelf(out string nodeName)) if (Common.FindEmptyShelfBeforeSendFullShelf(out string nodeName))
{ {
if (nodeName.StartsWith("G") && SettingString.C4_AGV_IPs.Contains(currentAgv.IP)) if (nodeName.StartsWith(SettingString.C4_Name_Prefix) && SettingString.C4_AGV_IPs.Contains(currentAgv.IP))
{ {
ClientNode clientNode = Common.nodeInfo.Find(s => s.Name.Equals(nodeName)); ClientNode clientNode = Common.nodeInfo.Find(s => s.Name.Equals(nodeName));
int cnt = 0; int cnt = 0;
...@@ -72,20 +72,8 @@ namespace AGVControl ...@@ -72,20 +72,8 @@ namespace AGVControl
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)
return null; return new GoEmptyShelfLineJob(currentAgv.Place, emptyNodeName);
//foreach (Agv_Info agv in Common.agvInfo)
//{
// if (!SettingString.C4_AGV_IPs.Contains(agv.IP))
// continue;
// if (agv.CurJob is GoEmptyShelfLineJob && ((GoEmptyShelfLineJob)agv.CurJob).EmptyShelfPlace.Equals(emptyNodeName))
// {
// return null;
// }
//}
return new GoEmptyShelfLineJob(currentAgv.Place, emptyNodeName);
} }
} }
...@@ -96,17 +84,7 @@ namespace AGVControl ...@@ -96,17 +84,7 @@ namespace AGVControl
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 GoFullShelfStationJob && !s.IP.Equals(currentAgv.IP)); int i = Common.agvInfo.FindIndex(s => s.CurJob is GoFullShelfStationJob && !s.IP.Equals(currentAgv.IP));
if (i > -1) if (i == -1)
return null;
//foreach (Agv_Info agv in Common.agvInfo)
//{
// if (agv.CurJob is GoFullShelfStationJob)
// {
// return null;
// }
//}
return new GoFullShelfStationJob(currentAgv.Place); return new GoFullShelfStationJob(currentAgv.Place);
} }
} }
......
...@@ -49,7 +49,7 @@ namespace AGVControl ...@@ -49,7 +49,7 @@ namespace AGVControl
//出工单料的目的地是否有空料架 //出工单料的目的地是否有空料架
if (Common.FindEmptyShelfBeforeSendFullShelf(out string nodeName)) if (Common.FindEmptyShelfBeforeSendFullShelf(out string nodeName))
{ {
if (nodeName.StartsWith("E") && !SettingString.C4_AGV_IPs.Contains(currentAgv.IP)) if (nodeName.StartsWith(SettingString.D4_Name_Prefix) && !SettingString.C4_AGV_IPs.Contains(currentAgv.IP))
{ {
ClientNode clientNode = Common.nodeInfo.Find(s => s.Name.Equals(nodeName)); ClientNode clientNode = Common.nodeInfo.Find(s => s.Name.Equals(nodeName));
int cnt = 0; int cnt = 0;
...@@ -76,19 +76,8 @@ namespace AGVControl ...@@ -76,19 +76,8 @@ namespace AGVControl
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)
return null; return new GoEmptyShelfLineJob(currentAgv.Place, emptyNodeName);
//foreach (Agv_Info agv in Common.agvInfo)
//{
// if (SettingString.C4_AGV_IPs.Contains(agv.IP))
// continue;
// if (agv.CurJob is GoEmptyShelfLineJob && ((GoEmptyShelfLineJob)agv.CurJob).EmptyShelfPlace.Equals(emptyNodeName))
// {
// return null;
// }
//}
return new GoEmptyShelfLineJob(currentAgv.Place, emptyNodeName);
} }
} }
...@@ -111,7 +100,7 @@ namespace AGVControl ...@@ -111,7 +100,7 @@ namespace AGVControl
{ {
if (boxDestInfo != null) if (boxDestInfo != null)
{ {
i = Common.agvInfo.FindIndex(s => s.CurJob is SendFullShelfToLineJob && !s.IP.Equals(currentAgv.IP) i = Common.agvInfo.FindIndex(s => s.CurJob is SendFullShelfToLineJob && !s.IP.Equals(currentAgv.IP)
&& ((SendFullShelfToLineJob)s.CurJob).FullShelfPlace.Equals(boxDestInfo.location)); && ((SendFullShelfToLineJob)s.CurJob).FullShelfPlace.Equals(boxDestInfo.location));
if (i > -1) if (i > -1)
return null; return null;
......
产线任务名称,任务名称,任务GUID 产线任务名称,任务名称,任务GUID
下料区(A5),MoveA5,679f2ca1-b520-11ea-b6ad-00012998f5a0 下料区(A5),MoveA5,679f2ca1-b520-11ea-b6ad-00012998f5a0
上料区(A6),MoveA6,7e5e9dc2-b521-11ea-b6ad-00012998f5a0 上料区(A6),MoveA6,7e5e9dc2-b521-11ea-b6ad-00012998f5a0
4D-1线,MoveE1,73bcddb3-b513-11ea-b6ad-00012998f5a0 4D-1线,MoveD1,73bcddb3-b513-11ea-b6ad-00012998f5a0
4D-2线,MoveE2,9bacf16b-b515-11ea-b6ad-00012998f5a0 4D-2线,MoveD2,9bacf16b-b515-11ea-b6ad-00012998f5a0
4D-3线,MoveE3,f84313b5-b515-11ea-b6ad-00012998f5a0 4D-3线,MoveD3,f84313b5-b515-11ea-b6ad-00012998f5a0
4D-4线,MoveE4,5683db0e-b516-11ea-b6ad-00012998f5a0 4D-4线,MoveD4,5683db0e-b516-11ea-b6ad-00012998f5a0
4D-5线,MoveE5,9c04b71b-b516-11ea-b6ad-00012998f5a0 4D-5线,MoveD5,9c04b71b-b516-11ea-b6ad-00012998f5a0
4D-6线,MoveE6,f46be62a-b516-11ea-b6ad-00012998f5a0 4D-6线,MoveD6,f46be62a-b516-11ea-b6ad-00012998f5a0
4D-8线,MoveE8,41dccfcf-b517-11ea-b6ad-00012998f5a0 4D-8线,MoveD8,41dccfcf-b517-11ea-b6ad-00012998f5a0
4D-9线,MoveE9,7fc3ec2f-b517-11ea-b6ad-00012998f5a0 4D-9线,MoveD9,7fc3ec2f-b517-11ea-b6ad-00012998f5a0
4D-10线,MoveE10,e7c0ad9c-b517-11ea-b6ad-00012998f5a0 4D-10线,MoveD10,e7c0ad9c-b517-11ea-b6ad-00012998f5a0
4D-11线,MoveE11,2e23a510-b518-11ea-b6ad-00012998f5a0 4D-11线,MoveD11,2e23a510-b518-11ea-b6ad-00012998f5a0
4D-12线,MoveE12,6efb37bc-b519-11ea-b6ad-00012998f5a0 4D-12线,MoveD12,6efb37bc-b519-11ea-b6ad-00012998f5a0
4D-14线,MoveE14,b03043fd-b519-11ea-b6ad-00012998f5a0 4D-14线,MoveD14,b03043fd-b519-11ea-b6ad-00012998f5a0
4D-15线,MoveE15,f3f9a668-b519-11ea-b6ad-00012998f5a0 4D-15线,MoveD15,f3f9a668-b519-11ea-b6ad-00012998f5a0
4D-16线,MoveE16,5ec0f64a-b51a-11ea-b6ad-00012998f5a0 4D-16线,MoveD16,5ec0f64a-b51a-11ea-b6ad-00012998f5a0
4D-FeedeerIn,MoveE21,37401585-b51b-11ea-b6ad-00012998f5a0 4D-FeedeerIn,MoveD4FeederIn,37401585-b51b-11ea-b6ad-00012998f5a0
4D-FeederOut,MoveE22,a4846723-b51b-11ea-b6ad-00012998f5a0 4D-FeederOut,MoveD4FeederOut,a4846723-b51b-11ea-b6ad-00012998f5a0
4D-4C门,MoveDoorDToC,fd6e26ac-c1bf-11ea-9a66-94c691a7387d 4D-4C门,MoveDoorDToC,fd6e26ac-c1bf-11ea-9a66-94c691a7387d
4C-4D门,MoveDoorCToD,d67f31c8-ca7e-11ea-9a66-94c691a7387d 4C-4D门,MoveDoorCToD,d67f31c8-ca7e-11ea-9a66-94c691a7387d
4C-1线,MoveG1,94a15e2c-cda7-11ea-a3e4-94c691a7387d 4C-1线,MoveC1,94a15e2c-cda7-11ea-a3e4-94c691a7387d
4C-2线,MoveG2,cece230b-cda7-11ea-a3e4-94c691a7387d 4C-2线,MoveC2,cece230b-cda7-11ea-a3e4-94c691a7387d
4C-3线,MoveG3,e393e846-cda7-11ea-a3e4-94c691a7387d 4C-3线,MoveC3,e393e846-cda7-11ea-a3e4-94c691a7387d
4C-4线,MoveG4,0b297e08-cda8-11ea-a3e4-94c691a7387d 4C-4线,MoveC4,0b297e08-cda8-11ea-a3e4-94c691a7387d
4C-5线,MoveG5,1d3512ae-cda8-11ea-a3e4-94c691a7387d 4C-5线,MoveC5,1d3512ae-cda8-11ea-a3e4-94c691a7387d
4C-6线,MoveG6,33c8d629-cda8-11ea-a3e4-94c691a7387d 4C-6线,MoveC6,33c8d629-cda8-11ea-a3e4-94c691a7387d
4C-7线,MoveG7,56c5a660-cda8-11ea-a3e4-94c691a7387d 4C-7线,MoveC7,56c5a660-cda8-11ea-a3e4-94c691a7387d
4C-8线,MoveG8,6873fd7f-cda8-11ea-a3e4-94c691a7387d 4C-8线,MoveC8,6873fd7f-cda8-11ea-a3e4-94c691a7387d
4C-9线,MoveG9,8ba46b72-cda8-11ea-a3e4-94c691a7387d 4C-9线,MoveC9,8ba46b72-cda8-11ea-a3e4-94c691a7387d
4C-10线,MoveG10,c0b75c41-ca7d-11ea-9a66-94c691a7387d 4C-10线,MoveC10,c0b75c41-ca7d-11ea-9a66-94c691a7387d
4C-FeedeerIn,MoveG21,0a657afd-ca9d-11ea-9a66-94c691a7387d 4C-FeedeerIn,MoveC4FeederIn,0a657afd-ca9d-11ea-9a66-94c691a7387d
4C-FeedeerOut,MoveG22,83b9ba6d-cdb2-11ea-a3e4-94c691a7387d 4C-FeedeerOut,MoveC4FeederOut,83b9ba6d-cdb2-11ea-a3e4-94c691a7387d
4C-14线,MoveG14,2baac336-d0d4-11ea-a3e4-94c691a7387d 4C-14线,MoveC14,2baac336-d0d4-11ea-a3e4-94c691a7387d
4C-15线,MoveG15,41cc7a90-d0d4-11ea-a3e4-94c691a7387d 4C-15线,MoveC15,41cc7a90-d0d4-11ea-a3e4-94c691a7387d
4C-AirIn,MoveDoorAirIn,2dc71db5-d0cb-11ea-a3e4-94c691a7387d 4C-AirIn,MoveDoorAirIn,2dc71db5-d0cb-11ea-a3e4-94c691a7387d
4C-AirOut,MoveDoorAirOut,9bc63eaa-d0d3-11ea-a3e4-94c691a7387d 4C-AirOut,MoveDoorAirOut,9bc63eaa-d0d3-11ea-a3e4-94c691a7387d
小车进料,Enter,51233d8c-c044-11ea-9a66-94c691a7387d 小车进料,Enter,51233d8c-c044-11ea-9a66-94c691a7387d
小车出料,Leave,2e433130-c045-11ea-9a66-94c691a7387d 小车出料,Leave,2e433130-c045-11ea-9a66-94c691a7387d
1763充电桩,AutoCharge3,b7371c5f-c045-11ea-9a66-94c691a7387d 3号充电桩,AutoCharge3,b7371c5f-c045-11ea-9a66-94c691a7387d
1764充电桩,AutoCharge4,1296084c-c046-11ea-9a66-94c691a7387d 4号充电桩,AutoCharge4,1296084c-c046-11ea-9a66-94c691a7387d
1767充电桩,AutoCharge5,40c8f44e-c046-11ea-9a66-94c691a7387d 5号充电桩,AutoCharge5,40c8f44e-c046-11ea-9a66-94c691a7387d
1768充电桩,AutoCharge6,56cca0a3-c046-11ea-9a66-94c691a7387d 6号充电桩,AutoCharge6,56cca0a3-c046-11ea-9a66-94c691a7387d
小车初始化,Init,adcb7a04-b525-11ea-b6ad-00012998f5a0 小车初始化,Init,adcb7a04-b525-11ea-b6ad-00012998f5a0
小车进料-需要人员操作,EnterWaitUser,7fe98805-d245-11ea-a3e4-94c691a7387d
小车出料-需要人员操作,LeaveWaitUser,217f8bad-d246-11ea-a3e4-94c691a7387d
待机位,MoveStandby,ae6e4f12-c050-11ea-9a66-94c691a7387d 待机位,MoveStandby,ae6e4f12-c050-11ea-9a66-94c691a7387d
BenQ充电桩,AutoCharge7,8811a589-8793-11ea-87e1-000129922cf6 4C临时停车位1,MoveC4_STANDBY1,d5fc690b-f1a5-11ea-a03e-94c691a7387d
4C临时停车位2,MoveC4_STANDBY2,90f4399f-f1a6-11ea-a03e-94c691a7387d
临时停车位,MoveStandbyTemp,d6c32ad3-d64e-11ea-a3e4-94c691a7387d 临时停车位,MoveStandbyTemp,d6c32ad3-d64e-11ea-a3e4-94c691a7387d
检查料架情况,CheckShelf,f3e46a3e-d734-11ea-a3e4-94c691a7387d 检查料架情况,CheckShelf,f3e46a3e-d734-11ea-a3e4-94c691a7387d
\ No newline at end of file \ No newline at end of file
产线名,节点名,IP,产线别名,位置名称,位置guid 产线名,节点名,IP,产线别名,位置名称,位置guid
A5,A5,10.85.199.20,下料区(A5),PA5,7ed952c3-b520-11ea-b6ad-00012998f5a0 A5,A5,10.85.199.20,下料区(A5),PA5,7ed952c3-b520-11ea-b6ad-00012998f5a0
A6,A6,10.85.199.20,上料区(A6),PA6,929eb1c2-b520-11ea-b6ad-00012998f5a0 A6,A6,10.85.199.20,上料区(A6),PA6,929eb1c2-b520-11ea-b6ad-00012998f5a0
D1,E1,10.85.199.42,4D-1线,DL1,3b823fe4-b368-11ea-a1a5-00012999830e D1,D1,10.85.199.42,4D-1线,DL1,3b823fe4-b368-11ea-a1a5-00012999830e
D2,E2,10.85.199.90,4D-2线,DL2,ede15fcb-b367-11ea-a1a5-00012999830e D2,D2,10.85.199.90,4D-2线,DL2,ede15fcb-b367-11ea-a1a5-00012999830e
D3,E3,10.85.199.91,4D-3线,DL3,43855a9b-b365-11ea-a1a5-00012999830e D3,D3,10.85.199.91,4D-3线,DL3,43855a9b-b365-11ea-a1a5-00012999830e
D4,E4,10.85.199.92,4D-4线,DL4,73c8b98c-b368-11ea-a1a5-00012999830e D4,D4,10.85.199.92,4D-4线,DL4,73c8b98c-b368-11ea-a1a5-00012999830e
D5,E5,10.85.199.93,4D-5线,DL5,5436efd7-b432-11ea-a1a5-00012999830e D5,D5,10.85.199.93,4D-5线,DL5,5436efd7-b432-11ea-a1a5-00012999830e
D6,E6,10.85.199.94,4D-6线,DL6,6b7710c1-b432-11ea-a1a5-00012999830e D6,D6,10.85.199.94,4D-6线,DL6,6b7710c1-b432-11ea-a1a5-00012999830e
D8,E8,10.85.199.95,4D-8线,DL8,8f039d2e-b432-11ea-a1a5-00012999830e D8,D8,10.85.199.95,4D-8线,DL8,8f039d2e-b432-11ea-a1a5-00012999830e
D9,E9,10.85.199.180,4D-9线,DL9,9e0b64ab-b432-11ea-a1a5-00012999830e D9,D9,10.85.199.180,4D-9线,DL9,9e0b64ab-b432-11ea-a1a5-00012999830e
D10,E10,10.85.199.181,4D-10线,DL10,aec7da80-b432-11ea-a1a5-00012999830e D10,D10,10.85.199.181,4D-10线,DL10,aec7da80-b432-11ea-a1a5-00012999830e
D11,E11,10.85.199.182,4D-11线,DL11,c10984c9-b432-11ea-a1a5-00012999830e D11,D11,10.85.199.182,4D-11线,DL11,c10984c9-b432-11ea-a1a5-00012999830e
D12,E12,10.85.199.183,4D-12线,DL12,d6e0b92a-b432-11ea-a1a5-00012999830e D12,D12,10.85.199.183,4D-12线,DL12,d6e0b92a-b432-11ea-a1a5-00012999830e
D14,E14,10.85.199.184,4D-14线,DL14,efb04c55-b432-11ea-a1a5-00012999830e D14,D14,10.85.199.184,4D-14线,DL14,efb04c55-b432-11ea-a1a5-00012999830e
D15,E15,10.85.199.185,4D-15线,DL15,fd6b1f95-b432-11ea-a1a5-00012999830e D15,D15,10.85.199.185,4D-15线,DL15,fd6b1f95-b432-11ea-a1a5-00012999830e
FeederIn,E21,10.85.199.1,4D-FeedeerIn,FI,1e546c3a-8abe-11ea-ab63-000129922ca6 D16,D16,10.85.199.96,4D-16线,line_16,ac6c413e-895e-11ea-9374-000129922ca6
FeederOut,E22,10.85.199.1,4D-FeederOut,FO,431649a4-8abe-11ea-ab63-000129922ca6 FeederIn,FeederIn,10.85.199.1,4D-FeedeerIn,FI,1e546c3a-8abe-11ea-ab63-000129922ca6
C1,G1,10.85.199.50,4C-1线,G1,d402fbc2-cdac-11ea-a3e4-94c691a7387d FeederOut,FeederOut,10.85.199.1,4D-FeederOut,FO,431649a4-8abe-11ea-ab63-000129922ca6
C2,G2,10.85.199.51,4C-2线,G2,ce0d60e9-cdac-11ea-a3e4-94c691a7387d C1,C1,10.85.199.50,4C-1线,G1,d402fbc2-cdac-11ea-a3e4-94c691a7387d
C3,G3,10.85.199.52,4C-3线,G3,c768170a-cdac-11ea-a3e4-94c691a7387d C2,C2,10.85.199.51,4C-2线,G2,ce0d60e9-cdac-11ea-a3e4-94c691a7387d
C4,G4,10.85.199.53,4C-4线,G4,c2de9745-cdac-11ea-a3e4-94c691a7387d C3,C3,10.85.199.52,4C-3线,G3,c768170a-cdac-11ea-a3e4-94c691a7387d
C5,G5,10.85.199.54,4C-5线,G5,be468ef4-cdac-11ea-a3e4-94c691a7387d C4,C4,10.85.199.53,4C-4线,G4,c2de9745-cdac-11ea-a3e4-94c691a7387d
C6,G6,10.85.199.55,4C-6线,G6,b9117881-cdac-11ea-a3e4-94c691a7387d C5,C5,10.85.199.54,4C-5线,G5,be468ef4-cdac-11ea-a3e4-94c691a7387d
C7,G7,10.85.199.56,4C-7线,G7,b3cda9db-cdac-11ea-a3e4-94c691a7387d C6,C6,10.85.199.55,4C-6线,G6,b9117881-cdac-11ea-a3e4-94c691a7387d
C8,G8,10.85.199.57,4C-8线,G8,ae09fc56-cdac-11ea-a3e4-94c691a7387d C7,C7,10.85.199.56,4C-7线,G7,b3cda9db-cdac-11ea-a3e4-94c691a7387d
C9,G9,10.85.199.58,4C-9线,G9,a64bdbbb-cdac-11ea-a3e4-94c691a7387d C8,C8,10.85.199.57,4C-8线,G8,ae09fc56-cdac-11ea-a3e4-94c691a7387d
C10,G10,10.85.199.59,4C-10线,G10,604b1c3c-ca4e-11ea-810b-00012999830e C9,C9,10.85.199.62,4C-9线,G9,a64bdbbb-cdac-11ea-a3e4-94c691a7387d
C14,G14,10.85.199.60,4C-14线,G14,07841fc6-d0d4-11ea-a3e4-94c691a7387d C10,C10,10.85.199.59,4C-10线,G10,604b1c3c-ca4e-11ea-810b-00012999830e
C15,G15,10.85.199.61,4C-15线,G15,0efca2c6-d0d4-11ea-a3e4-94c691a7387d C14,C14,10.85.199.60,4C-14线,G14,07841fc6-d0d4-11ea-a3e4-94c691a7387d
4CFeederIn,G21,10.85.199.1,4C-FeederIn,tyty,cb7f117b-ca88-11ea-9b28-0001299981d4 C15,C15,10.85.199.61,4C-15线,G15,0efca2c6-d0d4-11ea-a3e4-94c691a7387d
4CFeederOut,G22,10.85.199.1,4C-FeederOut,tyty,cb7f117b-ca88-11ea-9b28-0001299981d4 4CFeederIn,4CFeederIn,10.85.199.1,4C-FeederIn,G21,cb7f117b-ca88-11ea-9b28-0001299981d4
D16,E16,10.85.199.96,4D-16线,line_16,ac6c413e-895e-11ea-9374-000129922ca6 4CFeederOut,4CFeederOut,10.85.199.1,4C-FeederOut,G22,0fcf606c-d417-11ea-9b6b-0001299981d4
C11,G11,10.85.199.1,4C-11线,PA33,
C12,G12,10.85.199.1,4C-12线,PA34,
C13,G13,10.85.199.1,4C-13线,PA35,
C16,G16,10.85.199.1,4C-16线,PA38,
...@@ -26,3 +26,5 @@ EmptyShelfCnt=1 ...@@ -26,3 +26,5 @@ EmptyShelfCnt=1
EmptyShelfCnt=1 EmptyShelfCnt=1
[G9] [G9]
IsUse=False IsUse=False
[A6]
IsUse=False
...@@ -54,3 +54,4 @@ D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine ...@@ -54,3 +54,4 @@ D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\bin\Debug\Newtonsoft.Json.dll D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\bin\Debug\Newtonsoft.Json.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\bin\Debug\AsaPL.AgvClient.pdb D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\bin\Debug\AsaPL.AgvClient.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\obj\Debug\AGVControl-ProductionLine.csprojAssemblyReference.cache D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\obj\Debug\AGVControl-ProductionLine.csprojAssemblyReference.cache
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\obj\Debug\AGVControl-ProductionLine.csprojAssemblyReference.cache
...@@ -45,10 +45,10 @@ namespace AgvClientTest ...@@ -45,10 +45,10 @@ namespace AgvClientTest
//client.SetStatus("E14", "", AsaPL.ClientAction.None); //client.SetStatus("E14", "", AsaPL.ClientAction.None);
//client.SetStatus("E15", "", AsaPL.ClientAction.None); //client.SetStatus("E15", "", AsaPL.ClientAction.None);
//client.SetStatus("E16", "", AsaPL.ClientAction.None); //client.SetStatus("E16", "", AsaPL.ClientAction.None);
client.SetStatus("E21", "", AsaPL.ClientAction.None); //client.SetStatus("D4FeederIn", "", AsaPL.ClientAction.None);
client.SetStatus("E22", "", AsaPL.ClientAction.None); //client.SetStatus("D4FeederOut", "", AsaPL.ClientAction.None);
client.SetStatus("G21", "", AsaPL.ClientAction.None); //client.SetStatus("C4FeederIn", "", AsaPL.ClientAction.None);
client.SetStatus("G22", "", AsaPL.ClientAction.None); //client.SetStatus("C4FeederOut", "", AsaPL.ClientAction.None);
client.Connect(); client.Connect();
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!