Commit 3bb51791 张东亮

1

1 个父辈 75c17094
...@@ -236,10 +236,6 @@ namespace BLL ...@@ -236,10 +236,6 @@ namespace BLL
} }
else else
{ {
//if (clientNode.Action == ClientAction.ReadyEnter || clientNode.Action == ClientAction.ReadyLeave)
//{
// continue;
//}
if (clientNode.StateEquals(eNodeStatus.None)) if (clientNode.StateEquals(eNodeStatus.None))
{ {
byte[] buff = new byte[] { 0X00, 0X00 }; byte[] buff = new byte[] { 0X00, 0X00 };
......
...@@ -223,6 +223,15 @@ namespace AGVControl ...@@ -223,6 +223,15 @@ namespace AGVControl
Common.agvInfo[e.RowIndex].IsUse = false; Common.agvInfo[e.RowIndex].IsUse = false;
Common.agvInfo[e.RowIndex].CurJob = null; Common.agvInfo[e.RowIndex].CurJob = null;
Common.agvInfo[e.RowIndex].RFID = ""; Common.agvInfo[e.RowIndex].RFID = "";
//清除4c临时待机位的占用
if (Common.agvInfo[e.RowIndex].Name.Equals(Common.StandbyStation.C4_Station1))
{
Common.StandbyStation.C4_Station1 = "";
}
else if (Common.agvInfo[e.RowIndex].Name.Equals(Common.StandbyStation.C4_Station2))
{
Common.StandbyStation.C4_Station2 = "";
}
Common.LogInfo(string.Format("手动关闭小车自动模式,{0} {1}", Common.agvInfo[e.RowIndex].Name, Common.agvInfo[e.RowIndex].RunInfo())); Common.LogInfo(string.Format("手动关闭小车自动模式,{0} {1}", Common.agvInfo[e.RowIndex].Name, Common.agvInfo[e.RowIndex].RunInfo()));
} }
} }
...@@ -350,7 +359,15 @@ namespace AGVControl ...@@ -350,7 +359,15 @@ namespace AGVControl
if (MessageBox.Show("确定在自动模式下对小车手动分配任务?", Common.agvInfo[idx].Name, MessageBoxButtons.YesNo) == DialogResult.No) if (MessageBox.Show("确定在自动模式下对小车手动分配任务?", Common.agvInfo[idx].Name, MessageBoxButtons.YesNo) == DialogResult.No)
return; return;
} }
//清除4c临时待机位的占用
if (Common.agvInfo[idx].Name.Equals(Common.StandbyStation.C4_Station1))
{
Common.StandbyStation.C4_Station1 = "";
}
else if (Common.agvInfo[idx].Name.Equals(Common.StandbyStation.C4_Station2))
{
Common.StandbyStation.C4_Station2 = "";
}
bool rtn = Common.mir.Add_Mission_Fleet(Common.agvInfo[idx], Common.agvMission[Common.showNameMissionName[LstAgvPlace.Text]]); bool rtn = Common.mir.Add_Mission_Fleet(Common.agvInfo[idx], Common.agvMission[Common.showNameMissionName[LstAgvPlace.Text]]);
if (!rtn) if (!rtn)
return; return;
...@@ -406,6 +423,8 @@ namespace AGVControl ...@@ -406,6 +423,8 @@ namespace AGVControl
lblDestInfo.Text = AGVManager.A6_Target; lblDestInfo.Text = AGVManager.A6_Target;
lblCharge3.Text = "充电桩3:" + Common.chargeStatus.charge3; lblCharge3.Text = "充电桩3:" + Common.chargeStatus.charge3;
lblCharge4.Text = "充电桩4:" + Common.chargeStatus.charge4; lblCharge4.Text = "充电桩4:" + Common.chargeStatus.charge4;
lblStandy1.Text = "4C待机位1:" + Common.StandbyStation.C4_Station1;
lblStandy2.Text = "4C待机位2:" + Common.StandbyStation.C4_Station2;
})); }));
InShhow = false; InShhow = false;
...@@ -712,5 +731,11 @@ namespace AGVControl ...@@ -712,5 +731,11 @@ namespace AGVControl
{ {
ShowEmptyTask(); ShowEmptyTask();
} }
private void btnClearC4StandyInfo_Click(object sender, EventArgs e)
{
Common.StandbyStation.C4_Station1 = "";
Common.StandbyStation.C4_Station2 = "";
}
} }
} }
...@@ -253,7 +253,7 @@ namespace AGVControl ...@@ -253,7 +253,7 @@ namespace AGVControl
if (value == 0) if (value == 0)
{ {
Place = ""; Place = "";
PlaceState = ePlaceState.None; PlaceState = ePlaceState.None;
} }
else if (value > 0 && value < 1000) else if (value > 0 && value < 1000)
{ {
......
...@@ -11,7 +11,6 @@ namespace AGVControl ...@@ -11,7 +11,6 @@ namespace AGVControl
/// </summary> /// </summary>
public bool IsProcess { get; set; } public bool IsProcess { get; set; }
/// <summary> /// <summary>
/// 运行信息 /// 运行信息
/// </summary> /// </summary>
......
...@@ -39,6 +39,7 @@ namespace AGVControl ...@@ -39,6 +39,7 @@ 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>
......
...@@ -78,6 +78,24 @@ namespace AGVControl ...@@ -78,6 +78,24 @@ namespace AGVControl
TakeEmptyStep.Msg = msg; TakeEmptyStep.Msg = msg;
Common.DoorMission(agv, SettingString.DoorDToC); Common.DoorMission(agv, SettingString.DoorDToC);
} }
else if(agvPlae.StartsWith("G") && EmptyShelfPlace.StartsWith("G"))
{
if(Common.Check4CTarget(agv, EmptyShelfPlace))//被占用
{
TakeEmptyStep.ToNextStep(TAKE_EMPTY_STEP.WAIT_REACH_TEMP_PLACE);
runInfo = "目的地" + EmptyShelfPlace + "有小车占用,先到临时待机位";
msg += runInfo;
TakeEmptyStep.Msg = msg;
Common.MoveTo4CStandy(agv);
}
else
{
TakeEmptyStep.ToNextStep(TAKE_EMPTY_STEP.ASSIGN_AGV_TASK);
runInfo = "开始执行回收空料架任务[" + agvPlae + "->" + EmptyShelfPlace + "]";
msg += runInfo;
TakeEmptyStep.Msg = msg;
}
}
else else
{ {
TakeEmptyStep.ToNextStep(TAKE_EMPTY_STEP.ASSIGN_AGV_TASK); TakeEmptyStep.ToNextStep(TAKE_EMPTY_STEP.ASSIGN_AGV_TASK);
...@@ -90,10 +108,36 @@ namespace AGVControl ...@@ -90,10 +108,36 @@ namespace AGVControl
{ {
if (Common.CheckTaskFinished(agv, SettingString.DoorDToC, agv.CurTaskGUID)) if (Common.CheckTaskFinished(agv, SettingString.DoorDToC, agv.CurTaskGUID))
{ {
TakeEmptyStep.ToNextStep(TAKE_EMPTY_STEP.ASSIGN_AGV_TASK); if (Common.Check4CTarget(agv, EmptyShelfPlace))//被占用
runInfo= "开始执行回收空料架任务[" + agvPlae + "->" + EmptyShelfPlace + "]"; {
msg += runInfo; TakeEmptyStep.ToNextStep(TAKE_EMPTY_STEP.WAIT_REACH_TEMP_PLACE);
TakeEmptyStep.Msg = msg; runInfo = "目的地" + EmptyShelfPlace + "有小车占用,先到临时待机位";
msg += runInfo;
TakeEmptyStep.Msg = msg;
Common.MoveTo4CStandy(agv);
}
else
{
TakeEmptyStep.ToNextStep(TAKE_EMPTY_STEP.ASSIGN_AGV_TASK);
runInfo = "开始执行回收空料架任务[" + agvPlae + "->" + EmptyShelfPlace + "]";
msg += runInfo;
TakeEmptyStep.Msg = msg;
}
}
}
else if (TakeEmptyStep.IsStep(TAKE_EMPTY_STEP.WAIT_REACH_TEMP_PLACE))
{
if (Common.CheckTaskFinished(agv, SettingString.C4_STANDBY1, agv.CurTaskGUID)|| Common.CheckTaskFinished(agv, SettingString.C4_STANDBY2, agv.CurTaskGUID))
{
if (!Common.Check4CTarget(agv, EmptyShelfPlace))//未占用
{
TakeEmptyStep.ToNextStep(TAKE_EMPTY_STEP.ASSIGN_AGV_TASK);
runInfo = "开始执行回收空料架任务[" + agvPlae + "->" + EmptyShelfPlace + "]";
msg += runInfo;
TakeEmptyStep.Msg = msg;
Common.DeleteStandyInfo(agv);
}
} }
} }
else if (TakeEmptyStep.IsStep(TAKE_EMPTY_STEP.WAIT_AGV_REACH_4D_DOOR)) else if (TakeEmptyStep.IsStep(TAKE_EMPTY_STEP.WAIT_AGV_REACH_4D_DOOR))
...@@ -261,6 +305,10 @@ namespace AGVControl ...@@ -261,6 +305,10 @@ namespace AGVControl
/// </summary> /// </summary>
WAIT_REACH_PLACE, WAIT_REACH_PLACE,
/// <summary> /// <summary>
/// 等待AGV到达临时停车位
/// </summary>
WAIT_REACH_TEMP_PLACE,
/// <summary>
/// 等待产线回应 /// 等待产线回应
/// </summary> /// </summary>
WAIT_LINE_RESPONSE, WAIT_LINE_RESPONSE,
......
...@@ -87,11 +87,38 @@ namespace AGVControl ...@@ -87,11 +87,38 @@ namespace AGVControl
{ {
if (Common.CheckTaskFinished(agv,SettingString.DoorDToC,agv.CurTaskGUID)) if (Common.CheckTaskFinished(agv,SettingString.DoorDToC,agv.CurTaskGUID))
{ {
SendFullShelfStep.ToNextStep(SEND_FULL_SHELF_STEP.WAIT_AGV_REACH_LINE); if (Common.Check4CTarget(agv, FullShelfPlace))//被占用
runInfo= "满料架从双层线A6送往[" + FullShelfPlace + "][" + RFID + "]"; {
msg += runInfo; SendFullShelfStep.ToNextStep(SEND_FULL_SHELF_STEP.WAIT_REACH_TEMP_PLACE);
SendFullShelfStep.Msg = msg; runInfo = "目的地" + FullShelfPlace + "有小车占用,先到临时待机位";
Common.MoveToNode(agv, FullShelfPlace); msg += runInfo;
SendFullShelfStep.Msg = msg;
Common.MoveTo4CStandy(agv);
}
else
{
SendFullShelfStep.ToNextStep(SEND_FULL_SHELF_STEP.WAIT_AGV_REACH_LINE);
runInfo = "满料架从双层线A6送往[" + FullShelfPlace + "][" + RFID + "]";
msg += runInfo;
SendFullShelfStep.Msg = msg;
Common.MoveToNode(agv, FullShelfPlace);
}
}
}
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))
{
if (!Common.Check4CTarget(agv, FullShelfPlace))//未占用
{
SendFullShelfStep.ToNextStep(SEND_FULL_SHELF_STEP.WAIT_AGV_REACH_LINE);
runInfo = "满料架从临时待机位送往[" + FullShelfPlace + "][" + RFID + "]";
msg += runInfo;
SendFullShelfStep.Msg = msg;
Common.DeleteStandyInfo(agv);
Common.MoveToNode(agv, FullShelfPlace);
}
} }
} }
else if (SendFullShelfStep.IsStep(SEND_FULL_SHELF_STEP.WAIT_AGV_REACH_LINE)) else if (SendFullShelfStep.IsStep(SEND_FULL_SHELF_STEP.WAIT_AGV_REACH_LINE))
...@@ -214,6 +241,10 @@ namespace AGVControl ...@@ -214,6 +241,10 @@ namespace AGVControl
/// </summary> /// </summary>
WAIT_AGV_REACH_DOOR, WAIT_AGV_REACH_DOOR,
/// <summary> /// <summary>
/// 等待agv到达4C临时待机位
/// </summary>
WAIT_REACH_TEMP_PLACE,
/// <summary>
/// 等待小车到达目的地 /// 等待小车到达目的地
/// </summary> /// </summary>
WAIT_AGV_REACH_LINE, WAIT_AGV_REACH_LINE,
......
...@@ -65,50 +65,52 @@ namespace AGVControl ...@@ -65,50 +65,52 @@ namespace AGVControl
} }
} }
//出满料
if (Common.FindFullShelfTask(currentAgv))
{
//回收空料架
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 GoFullShelfStationJob && !s.IP.Equals(currentAgv.IP)); 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 null;
//foreach (Agv_Info agv in Common.agvInfo) //foreach (Agv_Info agv in Common.agvInfo)
//{ //{
// if (!SettingString.C4_AGV_IPs.Contains(agv.IP))
// if (agv.CurJob is GoFullShelfStationJob) // continue;
// if (agv.CurJob is GoEmptyShelfLineJob && ((GoEmptyShelfLineJob)agv.CurJob).EmptyShelfPlace.Equals(emptyNodeName))
// { // {
// return null; // return null;
// } // }
//} //}
return new GoFullShelfStationJob(currentAgv.Place); return new GoEmptyShelfLineJob(currentAgv.Place, emptyNodeName);
} }
} }
//回收空料架 //出满料
if (Common.FindEmptyShelfNode(currentAgv, out string emptyNodeName)) if (Common.FindFullShelfTask(currentAgv))
{ {
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 GoFullShelfStationJob && !s.IP.Equals(currentAgv.IP));
if (i > -1) if (i > -1)
return null; return null;
//foreach (Agv_Info agv in Common.agvInfo) //foreach (Agv_Info agv in Common.agvInfo)
//{ //{
// if (!SettingString.C4_AGV_IPs.Contains(agv.IP))
// continue; // if (agv.CurJob is GoFullShelfStationJob)
// if (agv.CurJob is GoEmptyShelfLineJob && ((GoEmptyShelfLineJob)agv.CurJob).EmptyShelfPlace.Equals(emptyNodeName))
// { // {
// return null; // return null;
// } // }
//} //}
return new GoEmptyShelfLineJob(currentAgv.Place, emptyNodeName); return new GoFullShelfStationJob(currentAgv.Place);
} }
} }
return null; return null;
} }
} }
......
using log4net.Util; using BLL;
using log4net.Util;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
...@@ -41,7 +42,7 @@ namespace AGVControl ...@@ -41,7 +42,7 @@ namespace AGVControl
emptyJobCnt++; emptyJobCnt++;
} }
} }
if ((SettingString.AGVCNT / 2 - emptyJobCnt).Equals(2))//保留两辆小车出满料架 if ((SettingString.AGVCNT / 2 - emptyJobCnt).Equals(1))//保留1辆小车出满料架
{ {
return null; return null;
} }
...@@ -69,20 +70,6 @@ namespace AGVControl ...@@ -69,20 +70,6 @@ namespace AGVControl
} }
} }
//出满料
if (Common.FindFullShelfTask(currentAgv))
{
if (!SettingString.C4_AGV_IPs.Contains(currentAgv.IP))
{
int i = Common.agvInfo.FindIndex(s => s.CurJob is GoFullShelfStationJob && !s.IP.Equals(currentAgv.IP));
if (i > -1)
return null;
return new GoFullShelfStationJob(currentAgv.Place);
}
}
//回收空料架 //回收空料架
if (Common.FindEmptyShelfNode(currentAgv, out string emptyNodeName)) if (Common.FindEmptyShelfNode(currentAgv, out string emptyNodeName))
{ {
...@@ -104,6 +91,38 @@ namespace AGVControl ...@@ -104,6 +91,38 @@ namespace AGVControl
return new GoEmptyShelfLineJob(currentAgv.Place, emptyNodeName); return new GoEmptyShelfLineJob(currentAgv.Place, emptyNodeName);
} }
} }
//出满料
if (Common.FindFullShelfTask(currentAgv))
{
if (!SettingString.C4_AGV_IPs.Contains(currentAgv.IP))
{
int i = Common.agvInfo.FindIndex(s => s.CurJob is GoFullShelfStationJob && !s.IP.Equals(currentAgv.IP));
if (i > -1)
{
return null;
}
ClientNode node = Common.nodeInfo.Find(s => s.Name.Equals(SettingString.A6)
&& (s.StateEquals(eNodeStatus.NeedLeave) || s.StateEquals(eNodeStatus.NeedEnterLeave)) && !s.RFID.Equals("00"));
if (node != null && node.Name.Equals(SettingString.A6))
{
if (AGVManager.FindFullShelfTarget(node.RFID, out AGVManager.BoxDestInfo boxDestInfo))
{
if (boxDestInfo != null)
{
i = Common.agvInfo.FindIndex(s => s.CurJob is SendFullShelfToLineJob && !s.IP.Equals(currentAgv.IP)
&& ((SendFullShelfToLineJob)s.CurJob).FullShelfPlace.Equals(boxDestInfo.location));
if (i > -1)
return null;
}
}
}
return new GoFullShelfStationJob(currentAgv.Place);
}
}
return null; return null;
} }
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!