Commit c72e57c9 张东亮

针对发充电任务成功但小车反馈失败造成两辆车占用同一个充电桩问题修复

1 个父辈 a7562871
正在显示 50 个修改的文件 包含 235 行增加133 行删除
此文件类型无法预览
......@@ -64,6 +64,8 @@
<!--去4C的三辆车IP地址-->
<add key="C4_AGV_IPs" value="10.85.199.71,10.85.199.72,10.85.199.73" />
<add key="ChargeThreshold" value="20,90" />
<!--忽略亮灯料架的线体名,多个线体使用逗号隔开-->
<add key="IgnoreLightLines" value="D14" />
<add key="IP_4D_Light" value="10.85.196.40:8088" />
<add key="IP_4C_Light" value="10.85.197.40:8088" />
</appSettings>
......
......@@ -70,7 +70,7 @@ namespace AGVControl
public const string IP_4D_Light = "IP_4D_Light";
public const string IP_4C_Light = "IP_4C_Light";
public const string IgnoreLightLines = "IgnoreLightLines";
public const string Lines_In_Air_Door = "C8,C9,C14,C15";
}
......@@ -113,6 +113,7 @@ namespace AGVControl
static log4net.ILog runLog = log4net.LogManager.GetLogger("RunLog");
static Dictionary<string, RunInfo> runInfoMap = new Dictionary<string, RunInfo>();
static List<string> IgnoreLightLines = ConfigAppSettings.GetValue(SettingString.IgnoreLightLines).Split(',').ToList();
public static void RunLogInfo(RunInfo info)
{
if (runInfoMap == null)
......@@ -582,14 +583,14 @@ namespace AGVControl
{
nodeName = FullShelfDestInfo.location;
Common.GetLineNameByNodeName(nodeName, out string line);
Common.log.Debug("A6出满料架的产线有空料架,优先处理 " + FullShelfDestInfo.ShowInfo(line));
Common.log.Info("A6出满料架的产线有空料架,优先处理 " + FullShelfDestInfo.ShowInfo(line));
return true;
}
else if (FullShelfDestInfo.location.StartsWith(SettingString.D4_Name_Prefix) && !C4_AGV_IPs.Contains(agv.IP))
{
nodeName = FullShelfDestInfo.location;
Common.GetLineNameByNodeName(nodeName, out string line);
Common.log.Debug("A6出满料架的产线有空料架,优先处理 " + FullShelfDestInfo.ShowInfo(line));
Common.log.Info("A6出满料架的产线有空料架,优先处理 " + FullShelfDestInfo.ShowInfo(line));
return true;
}
......@@ -620,13 +621,13 @@ namespace AGVControl
if (loc.StartsWith(SettingString.C4_Name_Prefix) && C4_AGV_IPs.Contains(agv.IP))
{
nodeName = loc;
Common.log.Debug("双层线正在出的工单目标产线有空料架,优先处4C-" + loc);
Common.log.Info("双层线正在出的工单目标产线有空料架,优先处4C-" + loc);
return true;
}
else if (loc.StartsWith(SettingString.D4_Name_Prefix) && !C4_AGV_IPs.Contains(agv.IP))
{
nodeName = loc;
Common.log.Debug("双层线正在出的工单目标产线有空料架,优先处理4D-" + loc);
Common.log.Info("双层线正在出的工单目标产线有空料架,优先处理4D-" + loc);
return true;
}
}
......@@ -653,7 +654,7 @@ namespace AGVControl
return false;
}
nodeName = nearNodeName;
Common.log.Debug(agv.Name + " 双层线需要小料架,准备去4C-" + nearNodeName);
Common.log.Info(agv.Name + " 双层线需要小料架,准备去4C-" + nearNodeName);
return true;
}
......@@ -669,7 +670,7 @@ namespace AGVControl
return false;
}
nodeName = nearNodeName;
Common.log.Debug(agv.Name + " 双层线需要小料架,准备去4D-" + nearNodeName);
Common.log.Info(agv.Name + " 双层线需要小料架,准备去4D-" + nearNodeName);
return true;
}
......@@ -691,18 +692,18 @@ namespace AGVControl
if (idx1 == -1)
{
nodeName = nodeInfo[idx].Name;
Common.log.Debug(agv.Name + " 双层线左侧需要小料架,准备去4C-" + nodeName);
Common.log.Info(agv.Name + " 双层线左侧需要小料架,准备去4C-" + nodeName);
return true;
}
}
string nearNodeName = CalculateNearNode(agv, SettingString.C4_Name_Prefix);
if (!nearNodeName.Equals(""))
{
nodeName = nearNodeName;
Common.log.Debug(agv.Name + " 双层线需要小料架,准备去4C-" + nearNodeName);
return true;
}
//string nearNodeName = CalculateNearNode(agv, SettingString.C4_Name_Prefix);
//if (!nearNodeName.Equals(""))
//{
// nodeName = nearNodeName;
// Common.log.Debug(agv.Name + " 双层线需要小料架,准备去4C-" + nearNodeName);
// return true;
//}
}
//4D车间寻找
......@@ -712,17 +713,17 @@ namespace AGVControl
if (idx > -1)
{
nodeName = nodeInfo[idx].Name;
Common.log.Debug(agv.Name + " 双层线左侧需要小料架,准备去4D-" + nodeName);
Common.log.Info(agv.Name + " 双层线左侧需要小料架,准备去4D-" + nodeName);
return true;
}
string nearNodeName = CalculateNearNode(agv, SettingString.D4_Name_Prefix);
if (!nearNodeName.Equals(""))
{
nodeName = nearNodeName;
Common.log.Debug(agv.Name + " 双层线需要小料架,准备去4D-" + nearNodeName);
return true;
}
//string nearNodeName = CalculateNearNode(agv, SettingString.D4_Name_Prefix);
//if (!nearNodeName.Equals(""))
//{
// nodeName = nearNodeName;
// Common.log.Debug(agv.Name + " 双层线需要小料架,准备去4D-" + nearNodeName);
// return true;
//}
}
}
......@@ -738,7 +739,7 @@ namespace AGVControl
if (idx1 == -1)
{
nodeName = nodeInfo[idx].Name;
Common.log.Debug(agv.Name + " 双层线左侧需要大料架,准备去4C-" + nodeName);
Common.log.Info(agv.Name + " 双层线左侧需要大料架,准备去4C-" + nodeName);
return true;
}
......@@ -752,7 +753,7 @@ namespace AGVControl
if (idx > -1)
{
nodeName = nodeInfo[idx].Name;
Common.log.Debug(agv.Name + " 双层线左侧需要小料架,准备去4D-" + nodeName);
Common.log.Info(agv.Name + " 双层线左侧需要小料架,准备去4D-" + nodeName);
return true;
}
}
......@@ -770,7 +771,7 @@ namespace AGVControl
if (idx1 == -1)
{
nodeName = nodeInfo[idx].Name;
Common.log.Debug(agv.Name + " 双层线右侧需要料架,准备去4C-" + nodeName);
Common.log.Info(agv.Name + " 双层线右侧需要料架,准备去4C-" + nodeName);
return true;
}
}
......@@ -789,7 +790,7 @@ namespace AGVControl
if (idx > -1)
{
nodeName = nodeInfo[idx].Name;
Common.log.Debug(agv.Name + " 双层线右侧需要料架,准备去4D-" + nodeName);
Common.log.Info(agv.Name + " 双层线右侧需要料架,准备去4D-" + nodeName);
return true;
}
//string nearNodeName = CalculateNearNode(agv, SettingString.D4_Name_Prefix);
......@@ -890,6 +891,12 @@ namespace AGVControl
public static bool CheckStationState(ClientNode clientNode, out string rfid)
{
rfid = "";
if(IgnoreLightLines.Contains(clientNode.Name)&&Common.missionManager.GetUnlockCnt(clientNode.Name)>0)
{
rfid = Common.missionManager.GetUnlockRfids(clientNode.Name)[0];
warnMsg = "";
return true;
}
if (!Common.missionManager.GetUnlockRfids(clientNode.Name).Contains(clientNode.RFID))
{
if (clientNode.Name.Equals(SettingString.C4FeederOut) || clientNode.Name.Equals(SettingString.D4FeederOut))
......@@ -917,7 +924,11 @@ namespace AGVControl
/// <returns>true:表示正常</returns>
public static bool UpdateStationState(ClientNode clientNode)
{
if(IgnoreLightLines.Contains(clientNode.Name))
{
clientNode.WarnMsg = "";
return true;
}
if (Common.missionManager.GetUnlockCnt(clientNode.Name) > 0 && !Common.missionManager.GetUnlockRfids(clientNode.Name).Contains(clientNode.RFID))
{
if (clientNode.Name.Equals(SettingString.C4FeederOut) || clientNode.Name.Equals(SettingString.D4FeederOut))
......@@ -1064,7 +1075,7 @@ namespace AGVControl
{
log = string.Format("{0} AutoCharge3 失败", agv.Name);
//防止上一个任务已执行但返回失败时,删除任务
//Common.mir.Del_Mission(agv);
Common.mir.Del_Mission(agv);
Common.LogInfo(log);
}
return rtn;
......@@ -1087,7 +1098,7 @@ namespace AGVControl
{
log = string.Format("{0} AutoCharge6 失败", agv.Name);
//防止上一个任务已执行但返回失败时,删除任务
//Common.mir.Del_Mission(agv);
Common.mir.Del_Mission(agv);
Common.LogInfo(log);
}
return rtn;
......@@ -1204,7 +1215,6 @@ namespace AGVControl
/// <returns>false:未被占用</returns>
public static bool Check4CTarget(Agv_Info agv, string nodeName)
{
List<Agv_Info> agvs = agvInfo.FindAll(s => !s.IP.Equals(agv.IP) && (s.CurJob is GoEmptyShelfLineJob || s.CurJob is SendFullShelfToLineJob)
); //&& !s.Name.Equals(StandbyStation.C4_Station1) && !s.Name.Equals(StandbyStation.C4_Station2)
if (agvs.Count.Equals(0))
......@@ -1233,9 +1243,30 @@ namespace AGVControl
}
}
}
ClientNode clientNode = nodeInfo.Find(s => s.Name.Equals(nodeName));
if (clientNode == null)
return false;
if (clientNode.IsOccupied())
return true;
return false;
}
public static void ClearNodeBuff(string agvname)
{
foreach (var item in nodeInfo)
{
item.ClearOccupied(agvname);
}
}
public static void SetNodeOccupied(string nodename,string agvname)
{
ClearNodeBuff(agvname);
ClientNode clientNode = nodeInfo.Find(s => s.Name.Equals(nodename));
if(clientNode!=null)
{
clientNode.SetOccupy(agvname);
}
}
/// <summary>
/// 移动到4C待机位
/// </summary>
......@@ -1288,6 +1319,7 @@ namespace AGVControl
/// AGV编号
/// </summary>
public string AGVNum { get; set; } = "";
public string DeviceName { get; set; } = "";
/// <summary>
/// 任务名称
/// </summary>
......@@ -1365,6 +1397,7 @@ namespace AGVControl
}
}
private string agvname = "";
public string DeviceName { get; set; } = "";
/// <summary>
/// 开始时间
/// </summary>
......@@ -1528,10 +1561,6 @@ namespace AGVControl
/// </summary>
public string charge7 = "";
/// <summary>
/// 充电等待时间(s)
/// </summary>
public int chargeWait = 0;
/// <summary>
/// 充电最大电量,小于该值等待指定时间去充电
/// </summary>
public int chargeMax;
......@@ -1563,7 +1592,6 @@ namespace AGVControl
public ChargeStatus()
{
_autoCharge = Convert.ToBoolean(Common.appConfig.AppSettings.Settings["AutoCharge"].Value);
chargeWait = Convert.ToInt32(Common.appConfig.AppSettings.Settings["ChargeWait"].Value);
string s = Common.appConfig.AppSettings.Settings["ChargeThreshold"].Value;
string[] arr = s.Split(',');
......
......@@ -46,14 +46,6 @@
this.tabPage1 = new System.Windows.Forms.TabPage();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.DgvNode = new System.Windows.Forms.DataGridView();
this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column22 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column16 = new System.Windows.Forms.DataGridViewButtonColumn();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel();
this.groupBox5 = new System.Windows.Forms.GroupBox();
......@@ -108,6 +100,15 @@
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column22 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Agv = new System.Windows.Forms.DataGridViewButtonColumn();
this.Column16 = new System.Windows.Forms.DataGridViewButtonColumn();
((System.ComponentModel.ISupportInitialize)(this.DgvAgv)).BeginInit();
this.tableLayoutPanel3.SuspendLayout();
this.tabControl1.SuspendLayout();
......@@ -334,6 +335,7 @@
this.Column10,
this.Column9,
this.Column5,
this.Agv,
this.Column16});
this.DgvNode.Location = new System.Drawing.Point(3, 3);
this.DgvNode.MultiSelect = false;
......@@ -347,76 +349,6 @@
this.DgvNode.TabIndex = 1;
this.DgvNode.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.DgvNode_CellClick);
//
// Column6
//
this.Column6.FillWeight = 107.563F;
this.Column6.HeaderText = "地点";
this.Column6.MinimumWidth = 6;
this.Column6.Name = "Column6";
this.Column6.ReadOnly = true;
this.Column6.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column12
//
this.Column12.FillWeight = 107.563F;
this.Column12.HeaderText = "IP";
this.Column12.MinimumWidth = 6;
this.Column12.Name = "Column12";
this.Column12.ReadOnly = true;
this.Column12.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column22
//
this.Column22.FillWeight = 107.563F;
this.Column22.HeaderText = "解绑数";
this.Column22.MinimumWidth = 6;
this.Column22.Name = "Column22";
this.Column22.ReadOnly = true;
this.Column22.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column7
//
this.Column7.FillWeight = 107.563F;
this.Column7.HeaderText = "动作";
this.Column7.MinimumWidth = 6;
this.Column7.Name = "Column7";
this.Column7.ReadOnly = true;
this.Column7.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column10
//
this.Column10.FillWeight = 47.05883F;
this.Column10.HeaderText = "等级";
this.Column10.MinimumWidth = 6;
this.Column10.Name = "Column10";
this.Column10.ReadOnly = true;
//
// Column9
//
this.Column9.FillWeight = 107.563F;
this.Column9.HeaderText = "RFID";
this.Column9.MinimumWidth = 6;
this.Column9.Name = "Column9";
this.Column9.ReadOnly = true;
this.Column9.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column5
//
this.Column5.FillWeight = 107.563F;
this.Column5.HeaderText = "连接";
this.Column5.MinimumWidth = 6;
this.Column5.Name = "Column5";
this.Column5.ReadOnly = true;
this.Column5.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column16
//
this.Column16.FillWeight = 107.563F;
this.Column16.HeaderText = "调用";
this.Column16.MinimumWidth = 6;
this.Column16.Name = "Column16";
this.Column16.ReadOnly = true;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.tableLayoutPanel5);
......@@ -1080,6 +1012,84 @@
this.label1.TabIndex = 0;
this.label1.Text = "label1";
//
// Column6
//
this.Column6.FillWeight = 107.563F;
this.Column6.HeaderText = "地点";
this.Column6.MinimumWidth = 6;
this.Column6.Name = "Column6";
this.Column6.ReadOnly = true;
this.Column6.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column12
//
this.Column12.FillWeight = 107.563F;
this.Column12.HeaderText = "IP";
this.Column12.MinimumWidth = 6;
this.Column12.Name = "Column12";
this.Column12.ReadOnly = true;
this.Column12.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column22
//
this.Column22.FillWeight = 107.563F;
this.Column22.HeaderText = "解绑数";
this.Column22.MinimumWidth = 6;
this.Column22.Name = "Column22";
this.Column22.ReadOnly = true;
this.Column22.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column7
//
this.Column7.FillWeight = 107.563F;
this.Column7.HeaderText = "动作";
this.Column7.MinimumWidth = 6;
this.Column7.Name = "Column7";
this.Column7.ReadOnly = true;
this.Column7.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column10
//
this.Column10.FillWeight = 47.05883F;
this.Column10.HeaderText = "等级";
this.Column10.MinimumWidth = 6;
this.Column10.Name = "Column10";
this.Column10.ReadOnly = true;
//
// Column9
//
this.Column9.FillWeight = 107.563F;
this.Column9.HeaderText = "RFID";
this.Column9.MinimumWidth = 6;
this.Column9.Name = "Column9";
this.Column9.ReadOnly = true;
this.Column9.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column5
//
this.Column5.FillWeight = 107.563F;
this.Column5.HeaderText = "连接";
this.Column5.MinimumWidth = 6;
this.Column5.Name = "Column5";
this.Column5.ReadOnly = true;
this.Column5.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Agv
//
this.Agv.HeaderText = "Agv";
this.Agv.Name = "Agv";
this.Agv.ReadOnly = true;
this.Agv.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.Agv.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
//
// Column16
//
this.Column16.FillWeight = 107.563F;
this.Column16.HeaderText = "调用";
this.Column16.MinimumWidth = 6;
this.Column16.Name = "Column16";
this.Column16.ReadOnly = true;
//
// FrmMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
......@@ -1148,14 +1158,6 @@
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4;
private System.Windows.Forms.Label lblWO;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.DataGridViewTextBoxColumn Column6;
private System.Windows.Forms.DataGridViewTextBoxColumn Column12;
private System.Windows.Forms.DataGridViewTextBoxColumn Column22;
private System.Windows.Forms.DataGridViewTextBoxColumn Column7;
private System.Windows.Forms.DataGridViewTextBoxColumn Column10;
private System.Windows.Forms.DataGridViewTextBoxColumn Column9;
private System.Windows.Forms.DataGridViewTextBoxColumn Column5;
private System.Windows.Forms.DataGridViewButtonColumn Column16;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel6;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label5;
......@@ -1207,6 +1209,15 @@
private System.Windows.Forms.Button btnClearStationRFID;
private System.Windows.Forms.Button agvRemoveRfid;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.DataGridViewTextBoxColumn Column6;
private System.Windows.Forms.DataGridViewTextBoxColumn Column12;
private System.Windows.Forms.DataGridViewTextBoxColumn Column22;
private System.Windows.Forms.DataGridViewTextBoxColumn Column7;
private System.Windows.Forms.DataGridViewTextBoxColumn Column10;
private System.Windows.Forms.DataGridViewTextBoxColumn Column9;
private System.Windows.Forms.DataGridViewTextBoxColumn Column5;
private System.Windows.Forms.DataGridViewButtonColumn Agv;
private System.Windows.Forms.DataGridViewButtonColumn Column16;
}
}
......@@ -310,7 +310,7 @@ namespace AGVControl
{
if (e.RowIndex == -1) return;
if (e.ColumnIndex == 7) //调用
if (e.ColumnIndex == 8) //调用
{
Common.nodeInfo[e.RowIndex].IsUse = !Common.nodeInfo[e.RowIndex].IsUse;
DgvNode.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = Common.nodeInfo[e.RowIndex].IsUse.ToString();
......@@ -318,13 +318,12 @@ namespace AGVControl
Common.appConfig.Save();
DgvNode.Rows[e.RowIndex].SetValues(Common.nodeInfo[e.RowIndex].ToRow());
}
else if (e.ColumnIndex == 8) //清除缓存
else if (e.ColumnIndex == 7) //清除缓存
{
//清除节点缓存
Common.LogInfo(string.Format("手动清除缓存,{0}", Common.nodeInfo[e.RowIndex].Name));
DgvNode.Rows[e.RowIndex].Cells[5].Value = "";
Common.nodeInfo[e.RowIndex].RFID = "";
DgvNode.Rows[e.RowIndex].Cells[4].Value = "";
Common.LogInfo(string.Format("手动清除缓存,{0},{1}", Common.nodeInfo[e.RowIndex].Name, Common.nodeInfo[e.RowIndex].OccupiedAgv));
Common.nodeInfo[e.RowIndex].ResetOccupied();
DgvNode.Rows[e.RowIndex].Cells[7].Value = "";
DgvNode.Rows[e.RowIndex].SetValues(Common.nodeInfo[e.RowIndex].ToRow());
}
}
......
......@@ -171,6 +171,9 @@
<metadata name="Column5.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Agv.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column16.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
......
......@@ -22,7 +22,7 @@ namespace AGVControl
//不为空,且与上一个消息不一样才打印
if (!value.Equals(msg))
{
// Common.LogInfo(value);
Common.LogInfo("RunMsg:"+value);
}
}
msg = value;
......
......@@ -239,6 +239,7 @@ namespace AGVControl
CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.CheckTaskFinished(agv, SettingString.DoorCToD, CurTaskState))
{
Common.ClearNodeBuff(agv.Name);
curJobStep.RecordRunLog(agv, JobName, runInfo, SettingString.DoorCToD);
if (Common.FindEmptyShelfNode(agv, out string nodeName, true))
{
......
......@@ -130,6 +130,7 @@ namespace AGVControl
CurTaskState = Common.GetTakJobState(CurTaskID);
if (Common.CheckTaskFinished(agv, SettingString.DoorCToD, CurTaskState))
{
Common.ClearNodeBuff(agv.Name);
curJobStep.RecordRunLog(agv, JobName, runInfo, SettingString.DoorCToD);
if (Common.CheckA5A6State(agv, shelfType, out string nodeName))
{
......
......@@ -314,6 +314,7 @@ namespace AGVControl
runInfo = "AGV 添加任务:移动到" + EmptyShelfPlace + "[RFID=" + RFID + "]";
msg += runInfo;
curJobStep.Msg = msg;
Common.SetNodeOccupied(EmptyShelfPlace, agv.Name);
Common.MoveToNode(agv, EmptyShelfPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
}
......
......@@ -82,6 +82,7 @@ namespace AGVControl
runInfo = "从双层线A6送往[" + FullShelfPlace + "][RFID=" + RFID + "]";
msg += runInfo;
curJobStep.Msg = msg;
Common.SetNodeOccupied(FullShelfPlace, agv.Name);
Common.MoveToNode(agv, FullShelfPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
}
......@@ -119,6 +120,7 @@ namespace AGVControl
runInfo = "从双层线A6送往[" + FullShelfPlace + "][RFID=" + RFID + "]";
msg += runInfo;
curJobStep.Msg = msg;
Common.SetNodeOccupied(FullShelfPlace, agv.Name);
Common.MoveToNode(agv, FullShelfPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
}
......@@ -136,6 +138,7 @@ namespace AGVControl
runInfo = "送往[" + FullShelfPlace + "][RFID=" + RFID + "]";
msg += runInfo;
curJobStep.Msg = msg;
Common.SetNodeOccupied(FullShelfPlace, agv.Name);
Common.MoveToNode(agv, FullShelfPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
}
......@@ -165,6 +168,7 @@ namespace AGVControl
msg += runInfo;
curJobStep.Msg = msg;
Common.DeleteStandyInfo(agv);
Common.SetNodeOccupied(FullShelfPlace, agv.Name);
Common.MoveToNode(agv, FullShelfPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
}
......
......@@ -30,7 +30,10 @@ namespace AGVControl
return rfid;
}
}
/// <summary>
/// 占用该节点的Agv
/// </summary>
public string OccupiedAgv { get; private set; } = "";
/// <summary>
/// 线体名(佳世达)
/// </summary>
......@@ -109,7 +112,7 @@ namespace AGVControl
public string[] ToRow()
{
//节点,IP,动作,RFID,AGV名称,在线,调用,清除AGV
string[] s = new string[8];
string[] s = new string[9];
s[0] = AliceName;
s[1] = IP;
// if (Online)
......@@ -121,8 +124,8 @@ namespace AGVControl
// s[5] = AgvName;
// }
s[6] = Online ? "在线" : "离线";
s[7] = IsUse ? "是" : "否";
// s[8] = "清除";
s[8] = IsUse ? "是" : "否";
s[7] = OccupiedAgv;
return s;
}
......@@ -140,5 +143,35 @@ namespace AGVControl
{
return null;
}
public void SetOccupy(string agvname)
{
OccupiedAgv = agvname;
Common.LogInfo($"{agvname} 占用节点 {Name}");
}
/// <summary>
/// 是否被占用
/// </summary>
/// <returns></returns>
public bool IsOccupied()
{
if (string.IsNullOrEmpty(OccupiedAgv))
return false;
return true;
}
public void ClearOccupied(string agvname)
{
if (!string.IsNullOrEmpty(OccupiedAgv))
if (OccupiedAgv.Equals(agvname))
{
OccupiedAgv = "";
Common.LogInfo($"{agvname} 释放节点 {Name}");
}
}
public void ResetOccupied()
{
OccupiedAgv = "";
Common.LogInfo($"重置节点{Name} 占用");
}
}
}
<!--忽略亮灯料架的线体名,多个线体使用逗号隔开-->
<add key="IgnoreLightLines" value="D14" />
\ No newline at end of file
......@@ -64,6 +64,8 @@
<!--去4C的三辆车IP地址-->
<add key="C4_AGV_IPs" value="10.85.199.71,10.85.199.72,10.85.199.73" />
<add key="ChargeThreshold" value="20,90" />
<!--忽略亮灯料架的线体名,多个线体使用逗号隔开-->
<add key="IgnoreLightLines" value="D14" />
<add key="IP_4D_Light" value="10.85.196.40:8088" />
<add key="IP_4C_Light" value="10.85.197.40:8088" />
</appSettings>
......
......@@ -22,3 +22,7 @@ EmptyShelfCnt=1
EmptyShelfCnt=1
[D13]
EmptyShelfCnt=3
[C15]
IsUse=False
[A5]
IsUse=False
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<appSettings>
<add key="ProName" value="4F-AGV-LINE-针对发充电任务成功小车但反馈失败造成两辆车占用同一个充电桩问题修复" />
</appSettings>
</configuration>
\ No newline at end of file
......@@ -71,3 +71,5 @@ E:\Neotel\Projects\Gitee\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLi
E:\Neotel\Projects\Gitee\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\obj\Debug\AGVControl-ProductionLine.csproj.CopyComplete
E:\Neotel\Projects\Gitee\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\obj\Debug\AGVControl-ProductionLine.exe
E:\Neotel\Projects\Gitee\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\obj\Debug\AGVControl-ProductionLine.pdb
E:\Neotel\Projects\Gitee\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\obj\Debug\AGVControl-ProductionLine.csproj.AssemblyReference.cache
E:\Neotel\Projects\Gitee\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\obj\Debug\AGVControl-ProductionLine.csproj.SuggestedBindingRedirects.cache
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!