taoye 2 лет назад
Родитель
Сommit
24e02ae01d
3 измененных файлов: 349 добавлений и 145 удалений
  1. +326
    -144
      FryPot_DosingSystem/Control/DosingLogicControl.cs
  2. +19
    -1
      FryPot_DosingSystem/Control/GlobalVariable.cs
  3. +4
    -0
      FryPot_DosingSystem/ViewModel/AgvViewModel.cs

+ 326
- 144
FryPot_DosingSystem/Control/DosingLogicControl.cs Просмотреть файл

@@ -85,21 +85,22 @@ namespace FryPot_DosingSystem.Control
bool LThreeErrorRecipe;//线体3错误配方标识
#endregion
#region agv临时变量
bool agvArriveUpLoad = false;//agv是否到达线体1上料位置
bool agvArriveLTwoUpLoad = false;//agv是否到达线体2上料位置
bool agvArriveLThreeUpLoad = false;//agv是否到达线体3上料位置
//bool agvArriveUpLoad = false;//agv是否到达线体1上料位置
//bool agvArriveLTwoUpLoad = false;//agv是否到达线体2上料位置
//bool agvArriveLThreeUpLoad = false;//agv是否到达线体3上料位置

bool agvArriveUnLoad = false;//线体1 agv是否到达炒锅送料位置
bool LTwoagvArriveUnLoad = false;//线体2 agv是否到达炒锅送料位置
bool LThreeagvArriveUnLoad = false;//线体3 agv是否到达炒锅送料位置
//bool agvArriveUnLoad = false;//线体1 agv是否到达炒锅送料位置
//bool LTwoagvArriveUnLoad = false;//线体2 agv是否到达炒锅送料位置
//bool LThreeagvArriveUnLoad = false;//线体3 agv是否到达炒锅送料位置

bool agvFryPotEmptyRollerArrive = false;// 线体1的agv是否拿到炒锅空桶
bool LTwoagvFryPotEmptyRollerArrive = false; //线体2的agv是否拿到炒锅空桶
bool LThreeagvFryPotEmptyRollerArrive = false;//线体3的agv是否拿到炒锅空桶
//bool agvFryPotEmptyRollerArrive = false;// 线体1的agv是否拿到炒锅空桶
//bool LTwoagvFryPotEmptyRollerArrive = false; //线体2的agv是否拿到炒锅空桶
//bool LThreeagvFryPotEmptyRollerArrive = false;//线体3的agv是否拿到炒锅空桶

string LOnerobotJobId = String.Empty;//线体1当前上游系统任务号,全局唯一
string LTworobotJobId = String.Empty;//线体2当前上游系统任务号,全局唯一
string LThreerobotJobId = String.Empty;//线体3当前上游系统任务号,全局唯一
string LFourrobotJobId = String.Empty;//线体4当前上游系统任务号,全局唯一

//bool loadInteractive = false;// fasle:不需要上料交互 true:需要上料交互
#endregion
@@ -128,19 +129,19 @@ namespace FryPot_DosingSystem.Control
}), "FryPotEmptyRollerArrive");
ActionManage.GetInstance.Register(new Action(() =>
{
agvArriveUpLoad = true;
globalVar.agvArriveUpLoad = true;
}), "AGVLOneArrive");
ActionManage.GetInstance.Register(new Action(() =>
{
agvArriveUnLoad = true;
globalVar.agvArriveUnLoad = true;
}), "AGVFryPotDownArrive");
ActionManage.GetInstance.Register(new Action(() =>
{
agvArriveUpLoad = true;
globalVar.agvArriveUpLoad = true;
}), "AGVFryPotUpArrive");
ActionManage.GetInstance.Register(new Action(() =>
{
agvFryPotEmptyRollerArrive = true;
globalVar.agvFryPotEmptyRollerArrive = true;

}), "AGVFryPotGetEmptyRoller");
//滚筒线2
@@ -164,19 +165,19 @@ namespace FryPot_DosingSystem.Control
}), "FryPotTwoEmptyRollerArrive");
ActionManage.GetInstance.Register(new Action(() =>
{
agvArriveLTwoUpLoad = true;
globalVar.agvArriveLTwoUpLoad = true;
}), "AGVLTwoArrive");
ActionManage.GetInstance.Register(new Action(() =>
{
LTwoagvArriveUnLoad = true;
globalVar.LTwoagvArriveUnLoad = true;
}), "AGVFryPotTwoDownArrive");
ActionManage.GetInstance.Register(new Action(() =>
{
agvArriveLTwoUpLoad = true;
globalVar.agvArriveLTwoUpLoad = true;
}), "AGVFryPotTwoUpArrive");
ActionManage.GetInstance.Register(new Action(() =>
{
LTwoagvFryPotEmptyRollerArrive = true;
globalVar.LTwoagvFryPotEmptyRollerArrive = true;

}), "AGVFryPotTwoGetEmptyRoller");
//滚筒线3
@@ -198,19 +199,19 @@ namespace FryPot_DosingSystem.Control
}), "FryPotThreeEmptyRollerArrive");
ActionManage.GetInstance.Register(new Action(() =>
{
agvArriveLThreeUpLoad = true;
globalVar.agvArriveLThreeUpLoad = true;
}), "AGVLThreeArrive");
ActionManage.GetInstance.Register(new Action(() =>
{
LThreeagvArriveUnLoad = true;
globalVar.LThreeagvArriveUnLoad = true;
}), "AGVFryPotThreeDownArrive");
ActionManage.GetInstance.Register(new Action(() =>
{
agvArriveLThreeUpLoad = true;
globalVar.agvArriveLThreeUpLoad = true;
}), "AGVFryPotThreeUpArrive");
ActionManage.GetInstance.Register(new Action(() =>
{
LThreeagvFryPotEmptyRollerArrive = true;
globalVar.LThreeagvFryPotEmptyRollerArrive = true;

}), "AGVFryPotThreeGetEmptyRoller");
}
@@ -247,34 +248,34 @@ namespace FryPot_DosingSystem.Control
//线体1请求上下料
if (objData.robotJobId == LOnerobotJobId && objData.command == "LOAD")//同一任务号且处于上料阶段,AGV请求上料
{
agvArriveUpLoad = true;//AGV到达上料位置
globalVar.agvArriveUpLoad = true;//AGV到达上料位置

}
if (objData.robotJobId == LOnerobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段
{
agvArriveUnLoad = true;//AGV到达下料位置
globalVar.agvArriveUnLoad = true;//AGV到达下料位置

}
//线体2请求上下料
if (objData.robotJobId == LTworobotJobId && objData.command == "LOAD")
{
agvArriveLTwoUpLoad = true;//AGV到达上料位置
globalVar.agvArriveLTwoUpLoad = true;//AGV到达上料位置

}
if (objData.robotJobId == LTworobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段
{
LTwoagvArriveUnLoad = true;//AGV到达下料位置
globalVar.LTwoagvArriveUnLoad = true;//AGV到达下料位置

}
//线体3请求上下料
if (objData.robotJobId == LThreerobotJobId && objData.command == "LOAD")
{
agvArriveLThreeUpLoad = true;//AGV到达上料位置
globalVar.agvArriveLThreeUpLoad = true;//AGV到达上料位置

}
if (objData.robotJobId == LThreerobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段
{
LThreeagvArriveUnLoad = true;//AGV到达下料位置
globalVar.LThreeagvArriveUnLoad = true;//AGV到达下料位置

}
}
@@ -315,6 +316,14 @@ namespace FryPot_DosingSystem.Control
{
AgvViewModel.GetInstance().Set滚筒线上数量(1, (globalVar.LOneMaterialNum - 1).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(1, IsBool.Yes);
if (globalVar.LOneFryPotSerial == 1)
{
AgvViewModel.GetInstance().Set小车运动(1, CartMotionTrajectory.yc_1_1);
}
else if (globalVar.LOneFryPotSerial == 4)
{
AgvViewModel.GetInstance().Set小车运动(1, CartMotionTrajectory.yc_1_4);
}

}
//线体2任务上报
@@ -322,12 +331,22 @@ namespace FryPot_DosingSystem.Control
{
AgvViewModel.GetInstance().Set滚筒线上数量(2, (globalVar.LTwoMaterialNum - 1).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(2, IsBool.Yes);
if (globalVar.LTwoFryPotSerial == 2)
{
AgvViewModel.GetInstance().Set小车运动(2, CartMotionTrajectory.yc_2_2);
}
else if (globalVar.LTwoFryPotSerial == 5)
{
AgvViewModel.GetInstance().Set小车运动(2, CartMotionTrajectory.yc_2_5);
}
}
//线体3任务上报
if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LThreerobotJobId && objData.jobData.startPointCode == "")//指定上料点上料完成,这里指线体上料
{
AgvViewModel.GetInstance().Set滚筒线上数量(3, (globalVar.LThreeMaterialNum - 1).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(3, IsBool.Yes);
AgvViewModel.GetInstance().Set小车运动(3, CartMotionTrajectory.yc_3_3);

}
//线体1任务上报
if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LOnerobotJobId && objData.jobData.targetPointCode == "")//指定下料点正在下料,指线体下料
@@ -381,17 +400,37 @@ namespace FryPot_DosingSystem.Control
//线体1任务上报
if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LOnerobotJobId && objData.jobData.startPointCode == "")//指定上料点上料完成,这里指空桶上料
{
agvFryPotEmptyRollerArrive = true;
globalVar.agvFryPotEmptyRollerArrive = true;
AgvViewModel.GetInstance().Set小车是否承载物品(1, IsBool.OnllYes);
if (globalVar.LOneFryPotSerial == 1)
{
AgvViewModel.GetInstance().Set小车运动(1, CartMotionTrajectory.hs_1);
}
else if (globalVar.LOneFryPotSerial == 4)
{
AgvViewModel.GetInstance().Set小车运动(1, CartMotionTrajectory.hs_4);
}
}
//线体2任务上报
if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LTworobotJobId && objData.jobData.startPointCode == "")//指定上料点上料完成,这里指空桶上料
{
LTwoagvFryPotEmptyRollerArrive = true;
globalVar.LTwoagvFryPotEmptyRollerArrive = true;
AgvViewModel.GetInstance().Set小车是否承载物品(2, IsBool.OnllYes);
if (globalVar.LTwoFryPotSerial == 2)
{
AgvViewModel.GetInstance().Set小车运动(2, CartMotionTrajectory.hs_2);
}
else if (globalVar.LTwoFryPotSerial == 5)
{
AgvViewModel.GetInstance().Set小车运动(2, CartMotionTrajectory.hs_5);
}
}
//线体3任务上报
if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LThreerobotJobId && objData.jobData.startPointCode == "")//指定上料点上料完成,这里指空桶上料
{
LThreeagvFryPotEmptyRollerArrive = true;
globalVar.LThreeagvFryPotEmptyRollerArrive = true;
AgvViewModel.GetInstance().Set小车是否承载物品(3, IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车运动(3, CartMotionTrajectory.hs_3);
}
//线体1任务上报
if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LOnerobotJobId && objData.jobData.targetPointCode == "")//指定下料点正在下料,指空桶下料
@@ -438,6 +477,7 @@ namespace FryPot_DosingSystem.Control
//线体1任务上报
if (objData.state == "DONE" && objData.robotJobId == LOnerobotJobId && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指空桶下料
{
globalVar.EmptyRollerUnLoadcCom = true;
AgvViewModel.GetInstance().Set小车运动(1, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车停止(1);
AgvViewModel.GetInstance().Set停车桩(1, IsBool.Yes);
@@ -445,6 +485,7 @@ namespace FryPot_DosingSystem.Control
//线体2任务上报
if (objData.state == "DONE" && objData.robotJobId == LTworobotJobId && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指空桶下料
{
globalVar.LTwoEmptyRollerUnLoadcCom = true;
AgvViewModel.GetInstance().Set小车运动(2, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车停止(2);
AgvViewModel.GetInstance().Set停车桩(2, IsBool.Yes);
@@ -452,6 +493,7 @@ namespace FryPot_DosingSystem.Control
//线体3任务上报
if (objData.state == "DONE" && objData.robotJobId == LThreerobotJobId && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指空桶下料
{
globalVar.LThreeEmptyRollerUnLoadcCom = true;
AgvViewModel.GetInstance().Set小车运动(3, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车停止(3);
AgvViewModel.GetInstance().Set停车桩(3, IsBool.Yes);
@@ -876,6 +918,9 @@ namespace FryPot_DosingSystem.Control
}
if (LThreeRecipeQuene.Count > 0 && LThreeOutputMaterialQuene.Count == 0 && LThreeInputMaterialQuene.Count == 0)//后续添加其它限制条件
{
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_3.goodsName = string.Empty; }));
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_3.workflows = new ObservableCollection<WorkflowModel>(); }));
AgvViewModel.GetInstance().Set启动或停止炒锅(3, IsRun.Stop);
if (globalVar.LThreeCurrentRecipeName != string.Empty)
MessageLog.GetInstance.ShowUserLog($"【3】号滚筒线【{globalVar.LThreeCurrentRecipeName}】 配方制作完成");
if (LThreeRecipeQuene.TryDequeue(out NewRecipeModel result))
@@ -890,6 +935,7 @@ namespace FryPot_DosingSystem.Control
{
if (result.materialCollection[i].MaterialLoc % 100 == i + 1 && result.materialCollection[i].MaterialLoc / 100 == headNum && headNum == 3)
{
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_3.goodsName = result.RecipeName; }));
//将配方中原料加入新的队列
LThreeInputMaterialQuene.Enqueue(new MaterialInfo()
{
@@ -907,6 +953,7 @@ namespace FryPot_DosingSystem.Control
}
}
DeviceOperate.GetInstance.WritePlcData("D1043", (ushort)result.materialCollection.Count);//发送3号滚筒线工序数据
AgvViewModel.GetInstance().Set启动或停止炒锅(globalVar.LThreeFryPotSerial, IsRun.Stop);
}
}

@@ -930,6 +977,18 @@ namespace FryPot_DosingSystem.Control

if (LTwoRecipeQuene.Count > 0 && LTwoOutputMaterialQuene.Count == 0 && LTwoInputMaterialQuene.Count == 0)//后续添加其它限制条件
{
if (globalVar.LTwoFryPotSerial == 2)
{
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_2.goodsName = string.Empty; }));
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_2.workflows = new ObservableCollection<WorkflowModel>(); }));
AgvViewModel.GetInstance().Set启动或停止炒锅(globalVar.LTwoFryPotSerial, IsRun.Stop);
}
if (globalVar.LTwoFryPotSerial == 5)
{
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_5.goodsName = string.Empty; }));
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_5.workflows = new ObservableCollection<WorkflowModel>(); }));
AgvViewModel.GetInstance().Set启动或停止炒锅(globalVar.LTwoFryPotSerial, IsRun.Stop);
}
if (globalVar.LTwoCurrentRecipeName != string.Empty)
MessageLog.GetInstance.ShowUserLog($"【2】号滚筒线【{globalVar.LTwoCurrentRecipeName}】 配方制作完成");
if (LTwoRecipeQuene.TryDequeue(out NewRecipeModel result))
@@ -944,6 +1003,14 @@ namespace FryPot_DosingSystem.Control
{
if (result.materialCollection[i].MaterialLoc % 100 == i + 1 && result.materialCollection[i].MaterialLoc / 100 == headNum && (headNum == 2 || headNum == 5))
{
if (headNum == 1)//炒锅2
{
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_2.goodsName = result.RecipeName; }));
}
else//炒锅5
{
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_5.goodsName = result.RecipeName; }));
}
//将配方中原料加入新的队列
LTwoInputMaterialQuene.Enqueue(new MaterialInfo()
{
@@ -961,6 +1028,7 @@ namespace FryPot_DosingSystem.Control
}
}
DeviceOperate.GetInstance.WritePlcData("D1026", (ushort)result.materialCollection.Count);//发送2号滚筒线工序数据

}
}

@@ -979,10 +1047,23 @@ namespace FryPot_DosingSystem.Control
{
MessageLog.GetInstance.ShowUserLog($"【1】号滚筒线【{globalVar.LOneCurrentRecipeName}】 配方制作完成");
globalVar.LOneCurrentRecipeName = string.Empty;

}
}
if (RecipeQuene.Count > 0 && OutputMaterialQuene.Count == 0 && InputMaterialQuene.Count == 0)//后续添加其它限制条件
{
if (globalVar.LOneFryPotSerial == 1)
{
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_1.goodsName = string.Empty; }));
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_1.workflows = new ObservableCollection<WorkflowModel>(); }));
AgvViewModel.GetInstance().Set启动或停止炒锅(globalVar.LOneFryPotSerial, IsRun.Stop);
}
if (globalVar.LOneFryPotSerial == 4)
{
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_4.goodsName = string.Empty; }));
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_4.workflows = new ObservableCollection<WorkflowModel>(); }));
AgvViewModel.GetInstance().Set启动或停止炒锅(globalVar.LOneFryPotSerial, IsRun.Stop);
}
if (RecipeQuene.TryDequeue(out NewRecipeModel result))
{
ErrorRecipe = false;
@@ -995,6 +1076,14 @@ namespace FryPot_DosingSystem.Control
{
if (result.materialCollection.Count <= 8 && result.materialCollection[i].MaterialLoc % 100 == i + 1 && result.materialCollection[i].MaterialLoc / 100 == headNum && (headNum == 1 || headNum == 4))
{
if (headNum == 1)//炒锅1
{
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_1.goodsName = result.RecipeName; }));
}
else//炒锅4
{
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_4.goodsName = result.RecipeName; }));
}
//将配方中原料加入新的队列
InputMaterialQuene.Enqueue(new MaterialInfo()
{
@@ -1166,19 +1255,20 @@ namespace FryPot_DosingSystem.Control
/// </summary>
public void LOneFryPotInputMaterial()
{
if (OutputMaterialQuene.Count > 0 && agvArriveUnLoad && globalVar.AgvToFryPot && !globalVar.PotOneInputMaterialArrive)
if (OutputMaterialQuene.Count > 0 && globalVar.agvArriveUnLoad && globalVar.AgvToFryPot && !globalVar.PotOneInputMaterialArrive)
{
if (globalVar.LOneFryPotSerial == 1)
{
AgvViewModel.GetInstance().Set小车运动(1, AgvViewModel.GetInstance().GetCommandValue("yc_1_1"));
}
else if (globalVar.LOneFryPotSerial == 4)
{
AgvViewModel.GetInstance().Set小车运动(1, AgvViewModel.GetInstance().GetCommandValue("yc_1-4"));
}
//if (globalVar.LOneFryPotSerial == 1)
//{
// AgvViewModel.GetInstance().Set小车运动(1, CartMotionTrajectory.yc_1_1);
//}
//else if (globalVar.LOneFryPotSerial == 4)
//{
// AgvViewModel.GetInstance().Set小车运动(1, CartMotionTrajectory.yc_1_4);
//}

MessageLog.GetInstance.ShowRunLog($"AGV到达【{globalVar.LOneFryPotSerial}】号炒锅下料位置");
AgvArriveFryPotOneOrFourSingleSetDown();
agvArriveUnLoad = false;
globalVar.agvArriveUnLoad = false;
globalVar.PotOneInputMaterialArrive = true;
}
}
@@ -1190,10 +1280,21 @@ namespace FryPot_DosingSystem.Control
FryPotOneRollerTroubleCheck();
if (FryPotAlarm == 1 || FryPotFourAlarm == 1)//炒锅滚筒无故障
{
if (globalVar.LOneFryPotSerial == 1)
{

Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_1.workflows.Add(new WorkflowModel { id = globalVar.LOneCurrentCookingStep, Name = OutputMaterialQuene.ElementAt(0).materialType.MaterialName, isBool = IsBool.Yes }); }));

}
else
{
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_4.workflows.Add(new WorkflowModel { id = globalVar.LOneCurrentCookingStep, Name = OutputMaterialQuene.ElementAt(0).materialType.MaterialName, isBool = IsBool.Yes }); }));
}
AgvViewModel.GetInstance().Set小车是否承载物品(1, IsBool.No);
//炒锅滚筒进料运行到位处理
FryPotOneOrFourInputMaterialRollerOperate();
AgvFromFryPotOneOrFourToClean();//上游下发搬运任务给AGV
AgvViewModel.GetInstance().Set启动或停止炒锅(globalVar.LOneFryPotSerial, IsRun.Start);
globalVar.InOrOutputLock = true;
globalVar.PotOneOutputRollerArrive = true;
}
@@ -1204,19 +1305,19 @@ namespace FryPot_DosingSystem.Control
/// </summary>
public void LTwoFryPotInputMaterial()
{
if (LTwoOutputMaterialQuene.Count > 0 && LTwoagvArriveUnLoad && globalVar.LTwoAgvToFryPot && !globalVar.LTwoPotInputMaterialArrive)
{
if (globalVar.LTwoFryPotSerial == 2)
{
AgvViewModel.GetInstance().Set小车运动(2, CartMotionTrajectory.yc_2_2);
}
else if (globalVar.LTwoFryPotSerial == 5)
{
AgvViewModel.GetInstance().Set小车运动(2, CartMotionTrajectory.yc_2_5);
}
MessageLog.GetInstance.ShowRunLog("AGV到达【2】号线体指定炒锅下料位置");
if (LTwoOutputMaterialQuene.Count > 0 && globalVar.LTwoagvArriveUnLoad && globalVar.LTwoAgvToFryPot && !globalVar.LTwoPotInputMaterialArrive)
{
//if (globalVar.LTwoFryPotSerial == 2)
//{
// AgvViewModel.GetInstance().Set小车运动(2, CartMotionTrajectory.yc_2_2);
//}
//else if (globalVar.LTwoFryPotSerial == 5)
//{
// AgvViewModel.GetInstance().Set小车运动(2, CartMotionTrajectory.yc_2_5);
//}
MessageLog.GetInstance.ShowRunLog($"AGV到达【{globalVar.LTwoFryPotSerial}】号炒锅下料位置");
AgvArriveFryPotTwoOrFiveSingleSetDown();
LTwoagvArriveUnLoad = false;
globalVar.LTwoagvArriveUnLoad = false;
globalVar.LTwoPotInputMaterialArrive = true;
}
}
@@ -1227,10 +1328,21 @@ namespace FryPot_DosingSystem.Control
FryPotTwoRollerTroubleCheck();
if (FryPotTwoAlarm == 1 || FryPotFiveAlarm == 1)//炒锅滚筒无故障
{
if (globalVar.LTwoFryPotSerial == 2)
{

Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_2.workflows.Add(new WorkflowModel { id = globalVar.LTwoCurrentCookingStep, Name = LTwoOutputMaterialQuene.ElementAt(0).materialType.MaterialName, isBool = IsBool.Yes }); }));

}
else
{
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_5.workflows.Add(new WorkflowModel { id = globalVar.LTwoCurrentCookingStep, Name = LTwoOutputMaterialQuene.ElementAt(0).materialType.MaterialName, isBool = IsBool.Yes }); }));
}
AgvViewModel.GetInstance().Set小车是否承载物品(2, IsBool.No);
//炒锅滚筒进料运行到位处理
FryPotTwoOrFiveInputMaterialRollerOperate();
AgvFromFryPotTwoOrFiveToClean();//上游下发搬运任务给AGV
AgvViewModel.GetInstance().Set启动或停止炒锅(globalVar.LTwoFryPotSerial, IsRun.Start);
globalVar.LTwoInOrOutputLock = true;
globalVar.LTwoPotOutputRollerArrive = true;
}
@@ -1241,12 +1353,12 @@ namespace FryPot_DosingSystem.Control
/// </summary>
public void LThreeFryPotInputMaterial()
{
if (LThreeOutputMaterialQuene.Count > 0 && LThreeagvArriveUnLoad && globalVar.LThreeAgvToFryPot && !globalVar.LThreePotInputMaterialArrive)
if (LThreeOutputMaterialQuene.Count > 0 && globalVar.LThreeagvArriveUnLoad && globalVar.LThreeAgvToFryPot && !globalVar.LThreePotInputMaterialArrive)
{
AgvViewModel.GetInstance().Set小车运动(3, CartMotionTrajectory.yc_3_3);
MessageLog.GetInstance.ShowRunLog("AGV到达【3】号线体指定炒锅下料位置");
// AgvViewModel.GetInstance().Set小车运动(3, CartMotionTrajectory.yc_3_3);
MessageLog.GetInstance.ShowRunLog("AGV到达【3】号炒锅下料位置");
AgvArriveFryPotThreeSingleSetDown();
LThreeagvArriveUnLoad = false;
globalVar.LThreeagvArriveUnLoad = false;
globalVar.LThreePotInputMaterialArrive = true;
}
}
@@ -1258,10 +1370,12 @@ namespace FryPot_DosingSystem.Control
FryPotThreeRollerTroubleCheck();
if (FryPotThreeAlarm == 1)//炒锅滚筒无故障
{
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_3.workflows.Add(new WorkflowModel { id = globalVar.LThreeCurrentCookingStep, Name = LThreeOutputMaterialQuene.ElementAt(0).materialType.MaterialName, isBool = IsBool.Yes }); }));
AgvViewModel.GetInstance().Set小车是否承载物品(3, IsBool.No);
//炒锅滚筒进料运行到位处理
FryPotThreeInputMaterialRollerOperate();
AgvFromFryPotThreeToClean();//上游下发搬运任务给AGV
AgvViewModel.GetInstance().Set启动或停止炒锅(3, IsRun.Start);
globalVar.LThreeInOrOutputLock = true;
globalVar.LThreePotOutputRollerArrive = true;
}
@@ -1308,47 +1422,50 @@ namespace FryPot_DosingSystem.Control
/// </summary>
public void LOneFryPotOutputMaterial()
{
if (OutputMaterialQuene.Count > 0 && globalVar.InOrOutputLock && agvArriveUpLoad && globalVar.PotOneOutputRollerArrive && !globalVar.AgvArrivePot)
if (OutputMaterialQuene.Count > 0 && globalVar.InOrOutputLock && globalVar.agvArriveUpLoad && globalVar.PotOneOutputRollerArrive && !globalVar.AgvArrivePot)
{

MessageLog.GetInstance.ShowRunLog("AGV到达【1】号滚筒线对应炒锅空桶上料位置");
MessageLog.GetInstance.ShowRunLog($"AGV到达【{globalVar.LOneFryPotSerial}】号炒锅空桶上料位置");
AgvArriveFryPotOneOrFourOutEmptyRollerSingleSetDown();//暂时考虑agv送完料后原地等待,不加条件,直接发送到位信号
agvArriveUpLoad = false;
globalVar.agvArriveUpLoad = false;
globalVar.AgvArrivePot = true;
}
}
public void LOneEmptyOperate()
{
if ((globalVar.fryPotOne.EmptyBarrelArrivedSingle == 1 || globalVar.fryPotTwo.EmptyBarrelArrivedSingle == 1) && agvFryPotEmptyRollerArrive && OutputMaterialQuene.Count > 0 && globalVar.AgvArrivePot)
if ((globalVar.fryPotOne.EmptyBarrelArrivedSingle == 1 || globalVar.fryPotFour.EmptyBarrelArrivedSingle == 1) && OutputMaterialQuene.Count > 0 && globalVar.AgvArrivePot)
{

FryPotOneRollerTroubleCheck();
if (FryPotAlarm == 1 || FryPotFourAlarm == 1)//无故障
{
FryPotOneOrFourOutEmpetyRollerOperate();
if (OutputMaterialQuene.TryDequeue(out MaterialInfo materialInfo))//空桶出桶后,出料原料队列移除对应原料
if (globalVar.agvFryPotEmptyRollerArrive)
{
AgvViewModel.GetInstance().Set小车是否承载物品(1, IsBool.OnllYes);
if (globalVar.LOneFryPotSerial == 1)
FryPotOneOrFourOutEmpetyRollerOperate();
if (OutputMaterialQuene.TryDequeue(out MaterialInfo materialInfo))//空桶出桶后,出料原料队列移除对应原料
{
AgvViewModel.GetInstance().Set小车运动(1, AgvViewModel.GetInstance().GetCommandValue("hs_1"));
}
else if (globalVar.LOneFryPotSerial == 4)
{
AgvViewModel.GetInstance().Set小车运动(1, AgvViewModel.GetInstance().GetCommandValue("hs_4"));
//AgvViewModel.GetInstance().Set小车是否承载物品(1, IsBool.OnllYes);
//if (globalVar.LOneFryPotSerial == 1)
//{
// AgvViewModel.GetInstance().Set小车运动(1, CartMotionTrajectory.hs_1);
//}
//else if (globalVar.LOneFryPotSerial == 4)
//{
// AgvViewModel.GetInstance().Set小车运动(1, CartMotionTrajectory.hs_4);
//}
globalVar.agvFryPotEmptyRollerArrive = false;
globalVar.InOrOutputLock = false;
globalVar.LOneMaterialNum--;
MessageLog.GetInstance.ShowRunLog($"AGV在【{globalVar.LOneFryPotSerial}】号炒锅将空桶回收到4号滚筒线");
//AGV拿到空桶,让AGV运桶到指定位置,同时可以让下一个AGV从线体装料运到炒锅
globalVar.AllowAgvToLineLoadRoller = true;
globalVar.LoadRoller = false;
globalVar.AgvToFryPot = false;
globalVar.PotOneInputMaterialArrive = false;
globalVar.PotOneOutputRollerArrive = false;
globalVar.AgvArrivePot = false;

}
agvFryPotEmptyRollerArrive = false;
agvArriveUpLoad = false;
MessageLog.GetInstance.ShowRunLog("AGV在【1】号滚筒线对应炒锅空桶上料完成,将进行空桶回收");
//AGV拿到空桶,让AGV运桶到指定位置,同时可以让下一个AGV从线体装料运到炒锅
globalVar.AllowAgvToLineLoadRoller = true;
globalVar.InOrOutputLock = false;
globalVar.LoadRoller = false;
globalVar.AgvToFryPot = false;
globalVar.PotOneInputMaterialArrive = false;
globalVar.PotOneOutputRollerArrive = false;
globalVar.AgvArrivePot = false;
globalVar.LOneMaterialNum--;
}
}
}
@@ -1360,46 +1477,50 @@ namespace FryPot_DosingSystem.Control
/// </summary>
public void LTwoFryPotOutputMaterial()
{
if (LTwoOutputMaterialQuene.Count > 0 && globalVar.LTwoInOrOutputLock && agvArriveLTwoUpLoad && globalVar.LTwoPotOutputRollerArrive && !globalVar.LTwoAgvArrivePot)
if (LTwoOutputMaterialQuene.Count > 0 && globalVar.LTwoInOrOutputLock && globalVar.agvArriveLTwoUpLoad && globalVar.LTwoPotOutputRollerArrive && !globalVar.LTwoAgvArrivePot)
{

MessageLog.GetInstance.ShowRunLog("AGV到达【2】号滚筒线对应炒锅空桶上料位置");
MessageLog.GetInstance.ShowRunLog($"AGV到达【{globalVar.LTwoFryPotSerial}】号炒锅空桶上料位置");
AgvArriveFryPotTwoOrFiveOutEmptyRollerSingleSetDown();//暂时考虑agv送完料后原地等待,不加条件,直接发送到位信号
agvArriveLTwoUpLoad = false;
globalVar.agvArriveLTwoUpLoad = false;
globalVar.LTwoAgvArrivePot = true;
}
}

public void LTwoEmptyOperate()
{
if ((globalVar.fryPotTwo.EmptyBarrelArrivedSingle == 1 || globalVar.fryPotFive.EmptyBarrelArrivedSingle == 1) && LTwoagvFryPotEmptyRollerArrive && LTwoOutputMaterialQuene.Count > 0 && globalVar.LTwoAgvArrivePot)
if ((globalVar.fryPotTwo.EmptyBarrelArrivedSingle == 1 || globalVar.fryPotFive.EmptyBarrelArrivedSingle == 1) && LTwoOutputMaterialQuene.Count > 0 && globalVar.LTwoAgvArrivePot)
{
FryPotTwoRollerTroubleCheck();
if (FryPotTwoAlarm == 1 || FryPotFiveAlarm == 1)//无故障
{
FryPotTwoOrFiveOutEmpetyRollerOperate();
if (LTwoOutputMaterialQuene.TryDequeue(out MaterialInfo materialInfo))//空桶出桶后,出料原料队列移除对应原料
if (globalVar.LTwoagvFryPotEmptyRollerArrive)
{
AgvViewModel.GetInstance().Set小车是否承载物品(2, IsBool.OnllYes);
if (globalVar.LOneFryPotSerial == 2)
FryPotTwoOrFiveOutEmpetyRollerOperate();
if (LTwoOutputMaterialQuene.TryDequeue(out MaterialInfo materialInfo))//空桶出桶后,出料原料队列移除对应原料
{
AgvViewModel.GetInstance().Set小车运动(2, CartMotionTrajectory.hs_2);
}
else if (globalVar.LOneFryPotSerial == 5)
{
AgvViewModel.GetInstance().Set小车运动(2, CartMotionTrajectory.hs_5);
//AgvViewModel.GetInstance().Set小车是否承载物品(2, IsBool.OnllYes);
//if (globalVar.LTwoFryPotSerial == 2)
//{
// AgvViewModel.GetInstance().Set小车运动(2, CartMotionTrajectory.hs_2);
//}
//else if (globalVar.LTwoFryPotSerial == 5)
//{
// AgvViewModel.GetInstance().Set小车运动(2, CartMotionTrajectory.hs_5);
//}
globalVar.LTwoagvFryPotEmptyRollerArrive = false;
globalVar.LTwoInOrOutputLock = false;
globalVar.LTwoMaterialNum--;
MessageLog.GetInstance.ShowRunLog($"AGV在【{globalVar.LTwoFryPotSerial}】号炒锅将空桶回收到4号滚筒线");
//AGV拿到空桶,让AGV运桶到指定位置,同时可以让下一个AGV从线体装料运到炒锅
globalVar.AllowAgvToLineTwoLoadRoller = true;
globalVar.LTwoLoadRoller = false;
globalVar.LTwoAgvToFryPot = false;
globalVar.LTwoPotInputMaterialArrive = false;
globalVar.LTwoPotOutputRollerArrive = false;
globalVar.LTwoAgvArrivePot = false;

}
LTwoagvFryPotEmptyRollerArrive = false;
agvArriveLTwoUpLoad = false;
MessageLog.GetInstance.ShowRunLog("AGV在【2】号滚筒线对应炒锅空桶上料完成,将进行空桶回收");
//AGV拿到空桶,让AGV运桶到指定位置,同时可以让下一个AGV从线体装料运到炒锅
globalVar.AllowAgvToLineTwoLoadRoller = true;
globalVar.LTwoInOrOutputLock = false;
globalVar.LTwoLoadRoller = false;
globalVar.LTwoAgvToFryPot = false;
globalVar.LTwoPotInputMaterialArrive = false;
globalVar.LTwoPotOutputRollerArrive = false;
globalVar.LTwoAgvArrivePot = false;
}
}
}
@@ -1410,44 +1531,102 @@ namespace FryPot_DosingSystem.Control
/// </summary>
public void LThreeFryPotOutputMaterial()
{
if (LThreeOutputMaterialQuene.Count > 0 && globalVar.LThreeInOrOutputLock && agvArriveLThreeUpLoad && globalVar.LThreePotOutputRollerArrive && !globalVar.LThreeAgvArrivePot)
if (LThreeOutputMaterialQuene.Count > 0 && globalVar.LThreeInOrOutputLock && globalVar.agvArriveLThreeUpLoad && globalVar.LThreePotOutputRollerArrive && !globalVar.LThreeAgvArrivePot)
{

MessageLog.GetInstance.ShowRunLog("AGV到达【3】号滚筒线对应炒锅空桶上料位置");
MessageLog.GetInstance.ShowRunLog($"AGV到达【{globalVar.LThreeFryPotSerial}】号炒锅空桶上料位置");
AgvArriveFryPotThreeOutEmptyRollerSingleSetDown();//暂时考虑agv送完料后原地等待,不加条件,直接发送到位信号
agvArriveLThreeUpLoad = false;
globalVar.agvArriveLThreeUpLoad = false;
globalVar.LThreeAgvArrivePot = true;
}
}

public void LThreeEmptyOperate()
{
if (globalVar.fryPotThree.EmptyBarrelArrivedSingle == 1 && LThreeagvFryPotEmptyRollerArrive && LThreeOutputMaterialQuene.Count > 0 && globalVar.LThreeAgvArrivePot)
if (globalVar.fryPotThree.EmptyBarrelArrivedSingle == 1 && LThreeOutputMaterialQuene.Count > 0 && globalVar.LThreeAgvArrivePot)
{
FryPotThreeRollerTroubleCheck();
if (FryPotThreeAlarm == 1)//无故障
{
FryPotThreeOutEmpetyRollerOperate();
if (LThreeOutputMaterialQuene.TryDequeue(out MaterialInfo materialInfo))//空桶出桶后,出料原料队列移除对应原料
if (globalVar.LThreeagvFryPotEmptyRollerArrive)
{
AgvViewModel.GetInstance().Set小车是否承载物品(3, IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车运动(3, CartMotionTrajectory.hs_3);
LThreeagvFryPotEmptyRollerArrive = false;
agvArriveLThreeUpLoad = false;
MessageLog.GetInstance.ShowRunLog("AGV在【3】号滚筒线对应炒锅空桶上料完成,将进行空桶回收");
//AGV拿到空桶,让AGV运桶到指定位置,同时可以让下一个AGV从线体装料运到炒锅
globalVar.AllowAgvToLineThreeLoadRoller = true;
globalVar.LThreeInOrOutputLock = false;
globalVar.LThreeLoadRoller = false;
globalVar.LThreeAgvToFryPot = false;
globalVar.LThreePotInputMaterialArrive = false;
globalVar.LThreePotOutputRollerArrive = false;
globalVar.LThreeAgvArrivePot = false;
FryPotThreeOutEmpetyRollerOperate();
if (LThreeOutputMaterialQuene.TryDequeue(out MaterialInfo materialInfo))//空桶出桶后,出料原料队列移除对应原料
{
//AgvViewModel.GetInstance().Set小车是否承载物品(3, IsBool.OnllYes);
//AgvViewModel.GetInstance().Set小车运动(3, CartMotionTrajectory.hs_3);
globalVar.LThreeagvFryPotEmptyRollerArrive = false;
globalVar.LThreeInOrOutputLock = false;
globalVar.LThreeMaterialNum--;
MessageLog.GetInstance.ShowRunLog($"AGV在【{globalVar.LThreeFryPotSerial}】号炒锅将空桶回收到4号滚筒线");
//AGV拿到空桶,让AGV运桶到指定位置,同时可以让下一个AGV从线体装料运到炒锅
globalVar.AllowAgvToLineThreeLoadRoller = true;
globalVar.LThreeLoadRoller = false;
globalVar.LThreeAgvToFryPot = false;
globalVar.LThreePotInputMaterialArrive = false;
globalVar.LThreePotOutputRollerArrive = false;
globalVar.LThreeAgvArrivePot = false;

}
}
}
}

}
/// <summary>
/// 1号线体对应空桶清洗
/// </summary>
public void LOneEmptyRollerToClean()
{
if (globalVar.EmptyRollerUnLoadcCom)//agv在4号线体下料完成
{
erp: string id = Guid.NewGuid().ToString("N");//上游唯一ID
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId)
{
goto erp;
}
string info = AGVHelper.GetInstance.AgvLeaveFryPotOne(id);
LOnerobotJobId = id;
FryCarryTaskErrorCodeAnalysis(info, 1);
globalVar.AllowAgvToLineLoadRoller = true;
globalVar.LoadRoller = false;
globalVar.AgvToFryPot = false;
globalVar.PotOneInputMaterialArrive = false;
globalVar.PotOneOutputRollerArrive = false;
globalVar.AgvArrivePot = false;
}
}
/// <summary>
/// 2号线体对应空桶清洗
/// </summary>
public void LTwoEmptyRollerToClean()
{
if (globalVar.LTwoEmptyRollerUnLoadcCom)//agv在4号线体下料完成
{
globalVar.AllowAgvToLineTwoLoadRoller = true;
globalVar.LTwoLoadRoller = false;
globalVar.LTwoAgvToFryPot = false;
globalVar.LTwoPotInputMaterialArrive = false;
globalVar.LTwoPotOutputRollerArrive = false;
globalVar.LTwoAgvArrivePot = false;
}
}
/// <summary>
/// 3号线体对应空桶清洗
/// </summary>
public void LThreeEmptyRollerToClean()
{
if (globalVar.LThreeEmptyRollerUnLoadcCom)//agv在4号线体下料完成
{
globalVar.AllowAgvToLineThreeLoadRoller = true;
globalVar.LThreeLoadRoller = false;
globalVar.LThreeAgvToFryPot = false;
globalVar.LThreePotInputMaterialArrive = false;
globalVar.LThreePotOutputRollerArrive = false;
globalVar.LThreeAgvArrivePot = false;
}
}

/// <summary>
/// 炒锅滚筒进料运行到位处理
/// </summary>
@@ -1606,14 +1785,14 @@ namespace FryPot_DosingSystem.Control
// Thread.Sleep(5); if (globalVar.ExitMainTask)
// return;
//}
MessageLog.GetInstance.ShowRunLog($"炒锅【1】原料:【{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}】空桶到达出桶位置,正在出桶"); break;
MessageLog.GetInstance.ShowRunLog($"炒锅【1】原料:【{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}】空桶上料完成"); break;
case 4:
//while (globalVar.fryPotFour.EmptyBarrelArrivedSingle == 0)
//{
// Thread.Sleep(5); if (globalVar.ExitMainTask)
// return;
//}
MessageLog.GetInstance.ShowRunLog($"炒锅【4】原料:【{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}】空桶到达出桶位置,正在出桶"); break;
MessageLog.GetInstance.ShowRunLog($"炒锅【4】原料:【{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}】空桶上料完成"); break;
}
}
/// <summary>
@@ -1629,14 +1808,14 @@ namespace FryPot_DosingSystem.Control
Thread.Sleep(5); if (globalVar.ExitMainTask)
return;
}
MessageLog.GetInstance.ShowRunLog($"炒锅【2】原料:【{LTwoOutputMaterialQuene.ElementAt(0).materialType.MaterialName}】空桶到达出桶位置,正在出桶"); break;
MessageLog.GetInstance.ShowRunLog($"炒锅【2】原料:【{LTwoOutputMaterialQuene.ElementAt(0).materialType.MaterialName}】空桶上料完成"); break;
case 5:
while (globalVar.fryPotFive.EmptyBarrelArrivedSingle == 0)
{
Thread.Sleep(5); if (globalVar.ExitMainTask)
return;
}
MessageLog.GetInstance.ShowRunLog($"炒锅【5】原料:【{LTwoOutputMaterialQuene.ElementAt(0).materialType.MaterialName}】空桶到达出桶位置,正在出桶"); break;
MessageLog.GetInstance.ShowRunLog($"炒锅【5】原料:【{LTwoOutputMaterialQuene.ElementAt(0).materialType.MaterialName}】空桶上料完成"); break;
}
}
/// <summary>
@@ -1649,7 +1828,7 @@ namespace FryPot_DosingSystem.Control
Thread.Sleep(5); if (globalVar.ExitMainTask)
return;
}
MessageLog.GetInstance.ShowRunLog($"炒锅【3】原料:【{LThreeOutputMaterialQuene.ElementAt(0).materialType.MaterialName}】空桶到达出桶位置,正在出桶");
MessageLog.GetInstance.ShowRunLog($"炒锅【3】原料:【{LThreeOutputMaterialQuene.ElementAt(0).materialType.MaterialName}】空桶上料完成");
}
/// <summary>
/// 发送agv送料就位信号至PLC(线体到炒锅)
@@ -1738,7 +1917,7 @@ namespace FryPot_DosingSystem.Control
{
case 1:
erp: string id = Guid.NewGuid().ToString("N");//上游唯一ID
if (id == LOnerobotJobId)
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId)
{
goto erp;
}
@@ -1792,7 +1971,7 @@ namespace FryPot_DosingSystem.Control
{
case 1:
erp: string id = Guid.NewGuid().ToString("N");//上游唯一ID
if (id == LOnerobotJobId)
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId)
{
goto erp;
}
@@ -1802,7 +1981,7 @@ namespace FryPot_DosingSystem.Control
FryCarryTaskErrorCodeAnalysis(info, 1); break;
case 4:
erp3: string id3 = Guid.NewGuid().ToString("N");//上游唯一ID
if (id3 == LOnerobotJobId)
if (id3 == LOnerobotJobId || id3 == LTworobotJobId || id3 == LThreerobotJobId || id3 == LFourrobotJobId)
{
goto erp3;
}
@@ -1821,7 +2000,7 @@ namespace FryPot_DosingSystem.Control
{
case 2:
erp1: string id1 = Guid.NewGuid().ToString("N");//上游唯一ID
if (id1 == LTworobotJobId)
if (id1 == LOnerobotJobId || id1 == LTworobotJobId || id1 == LThreerobotJobId || id1 == LFourrobotJobId)
{
goto erp1;
}
@@ -1831,7 +2010,7 @@ namespace FryPot_DosingSystem.Control
FryCarryTaskErrorCodeAnalysis(info1, 2); break;
case 5:
erp4: string id4 = Guid.NewGuid().ToString("N");//上游唯一ID
if (id4 == LTworobotJobId)
if (id4 == LOnerobotJobId || id4 == LTworobotJobId || id4 == LThreerobotJobId || id4 == LFourrobotJobId)
{
goto erp4;
}
@@ -1847,7 +2026,7 @@ namespace FryPot_DosingSystem.Control
public void AgvFromFryPotThreeToClean()
{
erp2: string id2 = Guid.NewGuid().ToString("N");//上游唯一ID
if (id2 == LThreerobotJobId)
if (id2 == LOnerobotJobId || id2 == LTworobotJobId || id2 == LThreerobotJobId || id2 == LFourrobotJobId)
{
goto erp2;
}
@@ -1864,7 +2043,7 @@ namespace FryPot_DosingSystem.Control
{
erp: if (AlarmHelper<AlarmInfo>.Alarm.LOneRollerTrouble == 0)
{
if (agvArriveUpLoad && globalVar.LoadRoller && globalVar.rollerLineOne.StationEight == InputMaterialQuene.ElementAt(0).materialType.MaterialLoc && !globalVar.AgvToFryPot)//无故障
if (globalVar.agvArriveUpLoad && globalVar.LoadRoller && globalVar.rollerLineOne.StationEight == InputMaterialQuene.ElementAt(0).materialType.MaterialLoc && !globalVar.AgvToFryPot)//无故障
{

MessageLog.GetInstance.ShowRunLog("AGV到达【1】号滚筒线装桶位置");
@@ -1873,8 +2052,9 @@ namespace FryPot_DosingSystem.Control
{
MessageLog.GetInstance.ShowRunLog($"AGV正在装载{materialInfo.materialType.MaterialLoc}号料桶");
AgvViewModel.GetInstance().Set滚筒线状态(1, IsRun.Start);
globalVar.LOneCurrentCookingStep++;
OutputMaterialQuene.Enqueue(materialInfo);
agvArriveUpLoad = false;
globalVar.agvArriveUpLoad = false;
globalVar.AgvToFryPot = true;
//原料到位,agv到位,agv自行运料到炒锅
}
@@ -1903,7 +2083,7 @@ namespace FryPot_DosingSystem.Control
{
erp: if (AlarmHelper<AlarmInfo>.Alarm.LTwoRollerTrouble == 0)//无故障
{
if (agvArriveLTwoUpLoad && globalVar.LTwoLoadRoller && globalVar.rollerLineTwo.StationEight == LTwoInputMaterialQuene.ElementAt(0).materialType.MaterialLoc && !globalVar.LTwoAgvToFryPot)//无故障
if (globalVar.agvArriveLTwoUpLoad && globalVar.LTwoLoadRoller && globalVar.rollerLineTwo.StationEight == LTwoInputMaterialQuene.ElementAt(0).materialType.MaterialLoc && !globalVar.LTwoAgvToFryPot)//无故障
{
MessageLog.GetInstance.ShowRunLog("AGV到达【2】号滚筒线装桶位置");
AgvArriveLineSingelSetDown(LTwoInputMaterialQuene);
@@ -1911,8 +2091,9 @@ namespace FryPot_DosingSystem.Control
{
MessageLog.GetInstance.ShowRunLog($"AGV正在装载{materialInfo.materialType.MaterialLoc}号料桶");
AgvViewModel.GetInstance().Set滚筒线状态(2, IsRun.Start);
globalVar.LTwoCurrentCookingStep++;
LTwoOutputMaterialQuene.Enqueue(materialInfo);
agvArriveLTwoUpLoad = false;
globalVar.agvArriveLTwoUpLoad = false;
globalVar.LTwoAgvToFryPot = true;
//原料到位,agv到位,agv自行运料到炒锅
}
@@ -1942,7 +2123,7 @@ namespace FryPot_DosingSystem.Control
{
erp: if (AlarmHelper<AlarmInfo>.Alarm.LThreeRollerTrouble == 0)//无故障
{
if (agvArriveLThreeUpLoad && globalVar.LThreeLoadRoller && globalVar.rollerLineThree.StationEight == LThreeInputMaterialQuene.ElementAt(0).materialType.MaterialLoc && !globalVar.LThreeAgvToFryPot)//无故障
if (globalVar.agvArriveLThreeUpLoad && globalVar.LThreeLoadRoller && globalVar.rollerLineThree.StationEight == LThreeInputMaterialQuene.ElementAt(0).materialType.MaterialLoc && !globalVar.LThreeAgvToFryPot)//无故障
{
MessageLog.GetInstance.ShowRunLog("AGV到达【3】号滚筒线装桶位置");
AgvArriveLineSingelSetDown(LThreeInputMaterialQuene);
@@ -1950,8 +2131,9 @@ namespace FryPot_DosingSystem.Control
{
MessageLog.GetInstance.ShowRunLog($"AGV正在装载{materialInfo.materialType.MaterialLoc}号料桶");
AgvViewModel.GetInstance().Set滚筒线状态(3, IsRun.Start);
globalVar.LThreeCurrentCookingStep++;
LThreeOutputMaterialQuene.Enqueue(materialInfo);
agvArriveLThreeUpLoad = false;
globalVar.agvArriveLThreeUpLoad = false;
globalVar.LThreeAgvToFryPot = true;
//原料到位,agv到位,agv自行运料到炒锅
}
@@ -2025,7 +2207,7 @@ namespace FryPot_DosingSystem.Control
if (InputMaterialQuene.Count > 0 && globalVar.AllowAgvToLineLoadRoller && globalVar.rollerLineOne.OutMaterialingSingle == 1 && !globalVar.LoadRoller)
{
e: string id = Guid.NewGuid().ToString("N");
if (id == LOnerobotJobId)
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId)
goto e;

string info = AGVHelper.GetInstance.AgvToLineOneLoadRoller(id);
@@ -2051,7 +2233,7 @@ namespace FryPot_DosingSystem.Control
if (LTwoInputMaterialQuene.Count > 0 && globalVar.AllowAgvToLineTwoLoadRoller && globalVar.rollerLineTwo.OutMaterialingSingle == 1 && !globalVar.LTwoLoadRoller)
{
e: string id = Guid.NewGuid().ToString("N");
if (id == LTworobotJobId)
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId)
goto e;

string info = AGVHelper.GetInstance.AgvToLineTwoLoadRoller(id);
@@ -2069,7 +2251,7 @@ namespace FryPot_DosingSystem.Control
if (LThreeInputMaterialQuene.Count > 0 && globalVar.AllowAgvToLineThreeLoadRoller && globalVar.rollerLineThree.OutMaterialingSingle == 1 && !globalVar.LThreeLoadRoller)
{
e: string id = Guid.NewGuid().ToString("N");
if (id == LThreerobotJobId)
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId)
goto e;

string info = AGVHelper.GetInstance.AgvToLineThreeLoadRoller(id);


+ 19
- 1
FryPot_DosingSystem/Control/GlobalVariable.cs Просмотреть файл

@@ -148,10 +148,28 @@ namespace FryPot_DosingSystem.Control
#region AGV视图显示变量
public int LOneMaterialNum = 0;
public int LOneFryPotSerial = 1;
public int LOneCurrentCookingStep = 0;
public bool agvArriveUpLoad;
public bool agvArriveUnLoad;
public bool agvFryPotEmptyRollerArrive;
public bool EmptyRollerUnLoadcCom { get; set; }//AGV空桶4号线体下料完成

public int LTwoMaterialNum = 0;
public int LTwoFryPotSerial = 2;
public int LThreeMaterialNum = 0;
public int LTwoCurrentCookingStep = 0;
public bool agvArriveLTwoUpLoad;
public bool LTwoagvArriveUnLoad;
public bool LTwoagvFryPotEmptyRollerArrive;
public bool LTwoEmptyRollerUnLoadcCom { get; set; }//AGV空桶4号线体下料完成

public int LThreeMaterialNum = 0;
public int LThreeFryPotSerial = 3;
public int LThreeCurrentCookingStep = 0;
public bool agvArriveLThreeUpLoad;
public bool LThreeagvArriveUnLoad;
public bool LThreeagvFryPotEmptyRollerArrive;
public bool LThreeEmptyRollerUnLoadcCom { get; set; }//AGV空桶4号线体下料完成

public int LFourRollerNum = 0;
#endregion
}


+ 4
- 0
FryPot_DosingSystem/ViewModel/AgvViewModel.cs Просмотреть файл

@@ -639,6 +639,10 @@ namespace FryPot_DosingSystem.ViewModel
{
get
{
if (_wokModel_1 == null)
{
_wokModel_1 = new WokModel();
}
return _wokModel_1;
}
set


Загрузка…
Отмена
Сохранить