Commit 3d426a33 张东亮

跨车间判断问题

1 个父辈 286737df
...@@ -53,7 +53,6 @@ ...@@ -53,7 +53,6 @@
this.txtShow = new System.Windows.Forms.TextBox(); this.txtShow = new System.Windows.Forms.TextBox();
this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.textBox1 = new System.Windows.Forms.TextBox();
this.tableLayoutPanel3.SuspendLayout(); this.tableLayoutPanel3.SuspendLayout();
this.tabControl1.SuspendLayout(); this.tabControl1.SuspendLayout();
this.tabPage2.SuspendLayout(); this.tabPage2.SuspendLayout();
...@@ -359,7 +358,6 @@ ...@@ -359,7 +358,6 @@
// //
// tabPage5 // tabPage5
// //
this.tabPage5.Controls.Add(this.textBox1);
this.tabPage5.Controls.Add(this.txtShow); this.tabPage5.Controls.Add(this.txtShow);
this.tabPage5.Location = new System.Drawing.Point(4, 25); this.tabPage5.Location = new System.Drawing.Point(4, 25);
this.tabPage5.Margin = new System.Windows.Forms.Padding(4); this.tabPage5.Margin = new System.Windows.Forms.Padding(4);
...@@ -371,12 +369,12 @@ ...@@ -371,12 +369,12 @@
// //
// txtShow // txtShow
// //
this.txtShow.Dock = System.Windows.Forms.DockStyle.Top; this.txtShow.Dock = System.Windows.Forms.DockStyle.Fill;
this.txtShow.Location = new System.Drawing.Point(0, 0); this.txtShow.Location = new System.Drawing.Point(0, 0);
this.txtShow.Margin = new System.Windows.Forms.Padding(4); this.txtShow.Margin = new System.Windows.Forms.Padding(4);
this.txtShow.Multiline = true; this.txtShow.Multiline = true;
this.txtShow.Name = "txtShow"; this.txtShow.Name = "txtShow";
this.txtShow.Size = new System.Drawing.Size(1696, 199); this.txtShow.Size = new System.Drawing.Size(1696, 356);
this.txtShow.TabIndex = 0; this.txtShow.TabIndex = 0;
// //
// tableLayoutPanel4 // tableLayoutPanel4
...@@ -404,16 +402,6 @@ ...@@ -404,16 +402,6 @@
this.flowLayoutPanel1.Size = new System.Drawing.Size(1698, 506); this.flowLayoutPanel1.Size = new System.Drawing.Size(1698, 506);
this.flowLayoutPanel1.TabIndex = 0; this.flowLayoutPanel1.TabIndex = 0;
// //
// textBox1
//
this.textBox1.Dock = System.Windows.Forms.DockStyle.Top;
this.textBox1.Location = new System.Drawing.Point(0, 199);
this.textBox1.Margin = new System.Windows.Forms.Padding(4);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(1696, 151);
this.textBox1.TabIndex = 1;
//
// FrmMain // FrmMain
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
...@@ -475,7 +463,6 @@ ...@@ -475,7 +463,6 @@
private System.Windows.Forms.TextBox txtShow; private System.Windows.Forms.TextBox txtShow;
private System.Windows.Forms.CheckBox checkBox1; private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox textBox1;
} }
} }
...@@ -157,11 +157,11 @@ namespace AGVControl ...@@ -157,11 +157,11 @@ namespace AGVControl
Invoke(new Action(() => Invoke(new Action(() =>
{ {
txtShow.Text = JsonHelper.SerializeObject(MissionManager.AUOResult);
try try
{ {
txtShow.Text = "AUO占用:"+JsonHelper.SerializeObject(MissionManager.AUOResult) + "\r\n"
textBox1.Text = LiftContext.GetLiftNodeOccupiedInfo(); + "电梯信息:"+LiftContext.GetLiftInfos() + "\r\n"
+"电梯节点占用:"+LiftContext.GetLiftNodeOccupiedInfo();
} }
catch { } catch { }
......
...@@ -34,6 +34,12 @@ namespace DeviceLibrary ...@@ -34,6 +34,12 @@ namespace DeviceLibrary
if (agv.HasEmptyShelfInLift(out string liftname, out lift.LiftStatus lift))//!agv.Scope.Floor.Equals(1) && if (agv.HasEmptyShelfInLift(out string liftname, out lift.LiftStatus lift))//!agv.Scope.Floor.Equals(1) &&
{ {
service.model.MissionInfo missionInfo = manager.MissionManager.GetReceiveMission(agv); service.model.MissionInfo missionInfo = manager.MissionManager.GetReceiveMission(agv);
//检查是否是空台车领用 3D->4C
if (missionInfo == null && agv.Scope.Workshop.Equals(SettingString._4D))
{
missionInfo = MissionManager.Get3DTo4CReceiveMission(agv);
}
if (missionInfo != null) if (missionInfo != null)
{ {
if (!liftname.Equals(missionInfo?.liftName)) if (!liftname.Equals(missionInfo?.liftName))
...@@ -63,7 +69,7 @@ namespace DeviceLibrary ...@@ -63,7 +69,7 @@ namespace DeviceLibrary
} }
} }
LiftContext.SetLiftNodeOccupied(agv, liftname); LiftContext.SetLiftNodeOccupied(agv, liftname);
MissionManager.SetMissionOccupied(missionInfo, agv); MissionManager.SetMissionOccupied(missionInfo, agv);
MissionManager.Log.Info($"执行任务[{agv.Name}][目的地] {JsonHelper.SerializeObject(missionInfo)}"); MissionManager.Log.Info($"执行任务[{agv.Name}][目的地] {JsonHelper.SerializeObject(missionInfo)}");
return new LiftToLinesJob(jobParam); return new LiftToLinesJob(jobParam);
} }
...@@ -102,8 +108,8 @@ namespace DeviceLibrary ...@@ -102,8 +108,8 @@ namespace DeviceLibrary
{ {
if (agv.Scope.Workshop.Equals("1F")) if (agv.Scope.Workshop.Equals("1F"))
{ {
AgvInfo agvInfo = AGVManager.agvInfo.Find(s => s.Auto && !s.IP.Equals(agv.IP)&&s.Scope.Workshop.Equals(agv.Scope.Workshop) AgvInfo agvInfo = AGVManager.agvInfo.Find(s => s.Auto && !s.IP.Equals(agv.IP) && s.Scope.Workshop.Equals(agv.Scope.Workshop)
&& s.CurJob != null && s.Scope.Workshop.Equals("1F") && (s.CurJob is LineToLiftJob || s.CurJob is F1LiftC1ToLiftD2Job && s.CurJob != null && s.Scope.Workshop.Equals("1F") && (s.CurJob is LineToLiftJob || s.CurJob is F1LiftC1ToLiftD2Job
|| s.CurJob is F1LiftD2ToLiftC1Job)); || s.CurJob is F1LiftD2ToLiftC1Job));
if (agvInfo != null) if (agvInfo != null)
return true; return true;
......
...@@ -17,6 +17,15 @@ namespace DeviceLibrary.lift ...@@ -17,6 +17,15 @@ namespace DeviceLibrary.lift
/// </summary> /// </summary>
static Dictionary<string, LiftInfo> lifts = new Dictionary<string, LiftInfo>(); static Dictionary<string, LiftInfo> lifts = new Dictionary<string, LiftInfo>();
public static string GetLiftInfos()
{
try
{
return JsonHelper.SerializeObject(lifts);
}
catch { }
return "";
}
public static void Init() public static void Init()
{ {
string[] names = Common.AppConfigHelper.GetValue(Common.SettingString.Lift_Names).Split(','); string[] names = Common.AppConfigHelper.GetValue(Common.SettingString.Lift_Names).Split(',');
......
...@@ -332,6 +332,33 @@ namespace DeviceLibrary.manager ...@@ -332,6 +332,33 @@ namespace DeviceLibrary.manager
return null; return null;
} }
/// <summary> /// <summary>
/// 获取接收料任务,以准备执行 LiftToLinesJobType
/// </summary>
/// <param name="missionType"></param>
/// <returns></returns>
public static MissionInfo Get3DTo4CReceiveMission(AgvInfo agv)
{
MissionInfo missionInfo = null;
try
{
var missions = GetMissionInfos().FindAll(w => w.state != MissionState.中止
&& w.state != MissionState.取消 && w.state != MissionState.完成);
missionInfo = missions.Find(s => s.destinationWorkshop.Equals(SettingString._4C) &&
s.sourceWorkshop.Equals(SettingString._3D)&&
(s.state >= MissionState.到达电梯 && s.state <= MissionState.电梯到达)
&& agv.Scope.Tasks.Contains(s.projectType.ToString()) && s.projectType.Equals(ProjectType.空台车领用));
if (missionInfo != null && AgvCanGetMission(missionInfo))
{
return missionInfo;
}
}
catch (Exception e)
{
Log.Error("GetReceiveMission", e);
}
return null;
}
/// <summary>
/// 获取料架返回任务,排除钢网项目 /// 获取料架返回任务,排除钢网项目
/// </summary> /// </summary>
/// <param name="agv"></param> /// <param name="agv"></param>
......
...@@ -325,7 +325,8 @@ namespace DeviceLibrary.manager ...@@ -325,7 +325,8 @@ namespace DeviceLibrary.manager
{ {
if (src == null) src = agv.Place; if (src == null) src = agv.Place;
if (dst == null) dst = agv.Place; if (dst == null) dst = agv.Place;
if (!src.Workshop.Equals(dst.Workshop) && linesInAirShower.ContainsKey(dst.Workshop)) if (!src.Workshop.Equals(dst.Workshop) && linesInAirShower.ContainsKey(dst.Workshop)
&& linesInAirShower[dst.Workshop].Contains(dst.Name))
{ {
return true; return true;
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!