Browse Source

180更新

样式分支
taoye 2 years ago
parent
commit
aaeb530ee2
1 changed files with 179 additions and 199 deletions
  1. +179
    -199
      FryPot_DosingSystem/Control/DosingLogicControl.cs

+ 179
- 199
FryPot_DosingSystem/Control/DosingLogicControl.cs View File

@@ -146,10 +146,8 @@ namespace FryPot_DosingSystem.Control
List<string> LNinerobotJobId = new List<string>(); //从线体3到清洗台路径 List<string> LNinerobotJobId = new List<string>(); //从线体3到清洗台路径
List<string> LTenrobotJobId = new List<string>(); //从清洗台到线体4路径 List<string> LTenrobotJobId = new List<string>(); //从清洗台到线体4路径


Dictionary<string, int> agvCodeOne = new Dictionary<string, int>();//1号agv小车的编号对AGV动画小车编号
Dictionary<string, int> agvCodeTwo = new Dictionary<string, int>();//2号agv小车的编号对AGV动画小车编号
Dictionary<string, int> agvCodeThree =new Dictionary<string, int>();//3号agv小车的编号对AGV动画小车编号
Dictionary<string, int> agvCodeFour = new Dictionary<string, int>();//4号agv小车的编号对AGV动画小车编号
Dictionary<string, int> agvCode = new Dictionary<string, int>() { { "1",1 }, { "2",2 }, { "3",3 }, { "4",4 } };//agv小车的编号对AGV动画小车编号


public int CleanNum = 0;//当前清洗台桶数 public int CleanNum = 0;//当前清洗台桶数


@@ -686,7 +684,7 @@ namespace FryPot_DosingSystem.Control
Upstreamrequest objData = JsonConvert.DeserializeObject<Upstreamrequest>(obj.ToString()); Upstreamrequest objData = JsonConvert.DeserializeObject<Upstreamrequest>(obj.ToString());
if (objData != null) if (objData != null)
{ {
#region 线体到炒锅
#region 线体到炒锅请求上下料
//线体1请求上下料 //线体1请求上下料
if (objData.robotJobId == LOnerobotJobId && objData.command == "LOAD")//同一任务号且处于上料阶段,AGV请求上料 if (objData.robotJobId == LOnerobotJobId && objData.command == "LOAD")//同一任务号且处于上料阶段,AGV请求上料
{ {
@@ -730,11 +728,8 @@ namespace FryPot_DosingSystem.Control
if (objData.robotJobId == LFourrobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段 if (objData.robotJobId == LFourrobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段
{ {
globalVar.rollerLineOne.agvArriveLineFour = true;//AGV到达下料位置 globalVar.rollerLineOne.agvArriveLineFour = true;//AGV到达下料位置
AgvViewModel.GetInstance().Set滚筒线状态(4, IsRun.Start);
AgvViewModel.GetInstance().Set滚筒线上数量(4, (++globalVar.LFourRollerNum).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(1, IsBool.No);
AgvViewModel.GetInstance().Set小车运动(1, CartMotionTrajectory.hj);
AgvViewModel.GetInstance().Set停车桩(1, IsBool.Yes);
// AgvViewModel.GetInstance().Set滚筒线状态(4, IsRun.Start);
} }


if (objData.robotJobId == LFiverobotJobId && objData.command == "LOAD") if (objData.robotJobId == LFiverobotJobId && objData.command == "LOAD")
@@ -745,11 +740,8 @@ namespace FryPot_DosingSystem.Control
if (objData.robotJobId == LFiverobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段 if (objData.robotJobId == LFiverobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段
{ {
globalVar.rollerLineTwo.agvArriveLineFour = true;//AGV到达下料位置 globalVar.rollerLineTwo.agvArriveLineFour = true;//AGV到达下料位置
AgvViewModel.GetInstance().Set滚筒线状态(4, IsRun.Start);
AgvViewModel.GetInstance().Set滚筒线上数量(4, (++globalVar.LFourRollerNum).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(2, IsBool.No);
AgvViewModel.GetInstance().Set小车运动(2, CartMotionTrajectory.hj);
AgvViewModel.GetInstance().Set停车桩(2, IsBool.Yes);
} }


if (objData.robotJobId == LSixrobotJobId && objData.command == "LOAD") if (objData.robotJobId == LSixrobotJobId && objData.command == "LOAD")
@@ -760,14 +752,11 @@ namespace FryPot_DosingSystem.Control
if (objData.robotJobId == LSixrobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段 if (objData.robotJobId == LSixrobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段
{ {
globalVar.rollerLineThree.agvArriveLineFour = true;//AGV到达下料位置 globalVar.rollerLineThree.agvArriveLineFour = true;//AGV到达下料位置
AgvViewModel.GetInstance().Set滚筒线状态(4, IsRun.Start);
AgvViewModel.GetInstance().Set滚筒线上数量(4, (++globalVar.LFourRollerNum).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(3, IsBool.No);
AgvViewModel.GetInstance().Set小车运动(3, CartMotionTrajectory.hj);
AgvViewModel.GetInstance().Set停车桩(3, IsBool.Yes);
} }
#endregion #endregion
#region 线体到清洗台
#region 线体123到清洗台请求上下料
if (LSevenrobotJobId.FirstOrDefault(p=>p==objData.robotJobId)!=null && objData.command == "LOAD")//同一任务号且处于上料阶段,AGV请求上料 if (LSevenrobotJobId.FirstOrDefault(p=>p==objData.robotJobId)!=null && objData.command == "LOAD")//同一任务号且处于上料阶段,AGV请求上料
{ {
globalVar.agvArriveLineOneLoadEmptyRoller = true;//AGV到达上料位置 globalVar.agvArriveLineOneLoadEmptyRoller = true;//AGV到达上料位置
@@ -777,10 +766,7 @@ namespace FryPot_DosingSystem.Control
{ {
globalVar.rollerLineOne.agvArriveCleanUnLoad = true;//AGV到达下料位置 globalVar.rollerLineOne.agvArriveCleanUnLoad = true;//AGV到达下料位置
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.No);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.qxt_hj);
AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes);
AgvViewModel.GetInstance().SetCleanRollerNum(++CleanNum);
} }


if ( LEightrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.command == "LOAD") if ( LEightrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.command == "LOAD")
@@ -792,10 +778,7 @@ namespace FryPot_DosingSystem.Control
{ {
globalVar.rollerLineTwo.agvArriveCleanUnLoad = true;//AGV到达下料位置 globalVar.rollerLineTwo.agvArriveCleanUnLoad = true;//AGV到达下料位置
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.No);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.qxt_hj);
AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes);
AgvViewModel.GetInstance().SetCleanRollerNum(++CleanNum);


} }


@@ -808,13 +791,10 @@ namespace FryPot_DosingSystem.Control
{ {
globalVar.rollerLineThree.agvArriveCleanUnLoad = true;//AGV到达下料位置 globalVar.rollerLineThree.agvArriveCleanUnLoad = true;//AGV到达下料位置
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.No);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.qxt_hj);
AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes);
AgvViewModel.GetInstance().SetCleanRollerNum(++CleanNum);
} }
#endregion #endregion
#region 清洗台到线体4请求上下料
if (LTenrobotJobId.FirstOrDefault(p=>p==objData.robotJobId)!=null && objData.command == "LOAD") if (LTenrobotJobId.FirstOrDefault(p=>p==objData.robotJobId)!=null && objData.command == "LOAD")
{ {
globalVar.agvArriveCleanLoad = true;//agv到达清洗台上料位置 globalVar.agvArriveCleanLoad = true;//agv到达清洗台上料位置
@@ -823,12 +803,10 @@ namespace FryPot_DosingSystem.Control
{ {
globalVar.agvArriveLineFour = true;//agv到达线体4下料位置 globalVar.agvArriveLineFour = true;//agv到达线体4下料位置
AgvViewModel.GetInstance().Set滚筒线状态(4, IsRun.Start);
AgvViewModel.GetInstance().Set滚筒线上数量(4, (++globalVar.LFourRollerNum).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.No);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.hj);
AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes);
} }
#endregion
} }


} }
@@ -861,35 +839,20 @@ namespace FryPot_DosingSystem.Control
{ {
//日志 //日志
} }
//---------------------空桶从线体去清洗-------------------------------//
//线体1任务上报
if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LOnerobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")// AGV正在上料,指线体空桶上料
{
// globalVar.rollerLineOne.IsEpmtyBefore = false;
}
//线体2任务上报
if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LTworobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")// AGV正在上料,指线体空桶上料
{
// globalVar.rollerLineTwo.IsEpmtyBefore = false;
}
//线体3任务上报
if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LThreerobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")// AGV正在上料,指线体空桶上料
{
// globalVar.rollerLineThree.IsEpmtyBefore = false;
}
//线体1任务上报 //线体1任务上报
if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LOnerobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体上料 if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LOnerobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体上料
{ {
globalVar.agvLineOneLoadCom = true; globalVar.agvLineOneLoadCom = true;
AgvViewModel.GetInstance().Set滚筒线上数量(1, (globalVar.LOneMaterialNum - 1).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(1, IsBool.Yes);
AgvViewModel.GetInstance().Set滚筒线上数量(1, (--globalVar.LOneMaterialNum).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.Yes);
if (globalVar.LOneFryPotSerial == 1) if (globalVar.LOneFryPotSerial == 1)
{ {
AgvViewModel.GetInstance().Set小车运动(1, CartMotionTrajectory.yc_1_1);
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.yc_1_1);
} }
else if (globalVar.LOneFryPotSerial == 4) else if (globalVar.LOneFryPotSerial == 4)
{ {
AgvViewModel.GetInstance().Set小车运动(1, CartMotionTrajectory.yc_1_4);
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.yc_1_4);
} }
} }


@@ -897,15 +860,15 @@ namespace FryPot_DosingSystem.Control
if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LTworobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体上料 if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LTworobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体上料
{ {
globalVar.agvLineTwoLoadCom = true; globalVar.agvLineTwoLoadCom = true;
AgvViewModel.GetInstance().Set滚筒线上数量(2, (globalVar.LTwoMaterialNum - 1).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(2, IsBool.Yes);
AgvViewModel.GetInstance().Set滚筒线上数量(2, (--globalVar.LTwoMaterialNum).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.Yes);
if (globalVar.LTwoFryPotSerial == 2) if (globalVar.LTwoFryPotSerial == 2)
{ {
AgvViewModel.GetInstance().Set小车运动(2, CartMotionTrajectory.yc_2_2);
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.yc_2_2);
} }
else if (globalVar.LTwoFryPotSerial == 5) else if (globalVar.LTwoFryPotSerial == 5)
{ {
AgvViewModel.GetInstance().Set小车运动(2, CartMotionTrajectory.yc_2_5);
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.yc_2_5);
} }


} }
@@ -913,74 +876,59 @@ namespace FryPot_DosingSystem.Control
if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LThreerobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体上料 if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LThreerobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体上料
{ {
globalVar.agvLineThreeLoadCom = true; globalVar.agvLineThreeLoadCom = true;
AgvViewModel.GetInstance().Set滚筒线上数量(3, (globalVar.LThreeMaterialNum - 1).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(3, IsBool.Yes);
AgvViewModel.GetInstance().Set小车运动(3, CartMotionTrajectory.yc_3_3);
AgvViewModel.GetInstance().Set滚筒线上数量(3, (--globalVar.LThreeMaterialNum).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.Yes);
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.yc_3_3);


} }

//线体1任务上报 //线体1任务上报
if (objData.state == "ROLLER_LOAD_FINISH" && LSevenrobotJobId.FirstOrDefault(p=>p==objData.robotJobId)!=null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体1空桶上
if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LOnerobotJobId && objData.jobData.targetPointCode == "" && objData.jobData.targetPointCode == "")//指定下料点正在下料,指线体到炒锅下
{ {
globalVar.agvArriveLineOneLoadCom = true;
AgvViewModel.GetInstance().Set滚筒线上数量(1, globalVar.LOneMaterialNum.ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.tqx_1);
//到清洗处

} }
//线体2任务上报 //线体2任务上报
if (objData.state == "ROLLER_LOAD_FINISH" && LEightrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体2空桶上
if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LTworobotJobId && objData.jobData.targetPointCode == "" && objData.jobData.targetPointCode == "")//指定下料点正在下料,指线体到炒锅下料
{ {
globalVar.agvArriveLineTwoLoadCom = true;
AgvViewModel.GetInstance().Set滚筒线上数量(2, globalVar.LTwoMaterialNum.ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.tqx_2);
//到清洗处


} }
//线体3任务上报 //线体3任务上报
if (objData.state == "ROLLER_LOAD_FINISH" && LNinerobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体3空桶上
if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LThreerobotJobId && objData.jobData.targetPointCode == "" && objData.jobData.targetPointCode == "")//指定下料点正在下料,指线体到炒锅下料
{ {
globalVar.agvArriveLineThreeLoadCom = true;
AgvViewModel.GetInstance().Set滚筒线上数量(3, globalVar.LThreeMaterialNum.ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.tqx_3);
//到清洗处


} }
//线体1任务上报 //线体1任务上报
if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LOnerobotJobId && objData.jobData.targetPointCode == "")//指定下料点正在下料,指线体下料
if (objData.state == "DONE" && objData.robotJobId == LOnerobotJobId && objData.jobData.targetPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指线体到炒锅下料
{ {

AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.No);
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode],CartMotionTrajectory.hj);
AgvViewModel.GetInstance().Set小车停止(agvCode[objData.jobData.agvCode]);
AgvViewModel.GetInstance().Set停车桩(agvCode[objData.jobData.agvCode], IsBool.Yes);
} }
//线体2任务上报 //线体2任务上报
if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LTworobotJobId && objData.jobData.targetPointCode == "")//指定下料点正在下料,指线体下料
if (objData.state == "DONE" && objData.robotJobId == LTworobotJobId && objData.jobData.targetPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指线体到炒锅下料
{ {

AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.No);
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.hj);
AgvViewModel.GetInstance().Set小车停止(agvCode[objData.jobData.agvCode]);
AgvViewModel.GetInstance().Set停车桩(agvCode[objData.jobData.agvCode], IsBool.Yes);
} }
//线体3任务上报 //线体3任务上报
if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LThreerobotJobId && objData.jobData.targetPointCode == "")//指定下料点正在下料,指线体下料
if (objData.state == "DONE" && objData.robotJobId == LThreerobotJobId && objData.jobData.targetPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指线体到炒锅下料
{ {

AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.No);
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.hj);
AgvViewModel.GetInstance().Set小车停止(agvCode[objData.jobData.agvCode]);
AgvViewModel.GetInstance().Set停车桩(agvCode[objData.jobData.agvCode], IsBool.Yes);
} }
//线体1任务上报
if (objData.state == "DONE" && objData.robotJobId == LOnerobotJobId && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指线体下料
{
#endregion


}
//线体2任务上报
if (objData.state == "DONE" && objData.robotJobId == LTworobotJobId && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指线体下料
{


}
//线体3任务上报
if (objData.state == "DONE" && objData.robotJobId == LThreerobotJobId && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指线体下料
{


}
#endregion


#region 空桶上下料任务信息回报

#region 炒锅空桶上下料任务信息回报
//线体1任务上报 //线体1任务上报
if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LFourrobotJobId && objData.jobData.startPointCode == "")// AGV正在上料,指炒锅空桶上料 if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LFourrobotJobId && objData.jobData.startPointCode == "")// AGV正在上料,指炒锅空桶上料
{ {
@@ -1001,36 +949,36 @@ namespace FryPot_DosingSystem.Control
if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LFourrobotJobId && objData.jobData.startPointCode == "")//指定上料点上料完成,这里指炒锅空桶上料 if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LFourrobotJobId && objData.jobData.startPointCode == "")//指定上料点上料完成,这里指炒锅空桶上料
{ {
globalVar.agvFryPotEmptyRollerArrive = true; globalVar.agvFryPotEmptyRollerArrive = true;
AgvViewModel.GetInstance().Set小车是否承载物品(1, IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.OnllYes);
if (globalVar.LOneFryPotSerial == 1) if (globalVar.LOneFryPotSerial == 1)
{ {
AgvViewModel.GetInstance().Set小车运动(1, CartMotionTrajectory.hs_1);
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.hs_1);
} }
else if (globalVar.LOneFryPotSerial == 4) else if (globalVar.LOneFryPotSerial == 4)
{ {
AgvViewModel.GetInstance().Set小车运动(1, CartMotionTrajectory.hs_4);
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.hs_4);
} }
} }
//线体2任务上报 //线体2任务上报
if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LFiverobotJobId && objData.jobData.startPointCode == "")//指定上料点上料完成,这里指炒锅空桶上料 if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LFiverobotJobId && objData.jobData.startPointCode == "")//指定上料点上料完成,这里指炒锅空桶上料
{ {
globalVar.LTwoagvFryPotEmptyRollerArrive = true; globalVar.LTwoagvFryPotEmptyRollerArrive = true;
AgvViewModel.GetInstance().Set小车是否承载物品(2, IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.OnllYes);
if (globalVar.LTwoFryPotSerial == 2) if (globalVar.LTwoFryPotSerial == 2)
{ {
AgvViewModel.GetInstance().Set小车运动(2, CartMotionTrajectory.hs_2);
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.hs_2);
} }
else if (globalVar.LTwoFryPotSerial == 5) else if (globalVar.LTwoFryPotSerial == 5)
{ {
AgvViewModel.GetInstance().Set小车运动(2, CartMotionTrajectory.hs_5);
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.hs_5);
} }
} }
//线体3任务上报 //线体3任务上报
if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LSixrobotJobId && objData.jobData.startPointCode == "")//指定上料点上料完成,这里指炒锅空桶上料 if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LSixrobotJobId && objData.jobData.startPointCode == "")//指定上料点上料完成,这里指炒锅空桶上料
{ {
globalVar.LThreeagvFryPotEmptyRollerArrive = true; globalVar.LThreeagvFryPotEmptyRollerArrive = true;
AgvViewModel.GetInstance().Set小车是否承载物品(3, IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车运动(3, CartMotionTrajectory.hs_3);
AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.hs_3);
} }




@@ -1038,131 +986,173 @@ namespace FryPot_DosingSystem.Control
if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LFourrobotJobId && objData.jobData.targetPointCode == "")//指定下料点正在下料,指炒锅空桶下料 if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LFourrobotJobId && objData.jobData.targetPointCode == "")//指定下料点正在下料,指炒锅空桶下料
{ {
AgvViewModel.GetInstance().Set滚筒线状态(4, IsRun.Start); AgvViewModel.GetInstance().Set滚筒线状态(4, IsRun.Start);
AgvViewModel.GetInstance().Set小车是否承载物品(1, IsBool.No);
AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.No);
}
//线体2任务上报
if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LFiverobotJobId && objData.jobData.targetPointCode == "")//指定下料点正在下料,指炒锅空桶下料
{
AgvViewModel.GetInstance().Set滚筒线状态(4, IsRun.Start);
AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.No);
}
//线体3任务上报
if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LSixrobotJobId && objData.jobData.targetPointCode == "")//指定下料点正在下料,指炒锅空桶下料
{
AgvViewModel.GetInstance().Set滚筒线状态(4, IsRun.Start);
AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.No);
}
//线体1任务上报
if (objData.state == "DONE" && objData.robotJobId == LFourrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指炒锅空桶下料
{
MessageLog.GetInstance.ShowRunLog("1号线炒锅空桶在4号线卸桶完成");
if (globalVar.LFourRollerNum >= 8) if (globalVar.LFourRollerNum >= 8)
{ {
AgvViewModel.GetInstance().Set滚筒线上数量(4, "8"); AgvViewModel.GetInstance().Set滚筒线上数量(4, "8");
} }
else else
{ {
AgvViewModel.GetInstance().Set滚筒线上数量(4, (globalVar.LFourRollerNum + 1).ToString());
AgvViewModel.GetInstance().Set滚筒线上数量(4, (++globalVar.LFourRollerNum).ToString());
} }
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车停止(agvCode[objData.jobData.agvCode]);
AgvViewModel.GetInstance().Set停车桩(agvCode[objData.jobData.agvCode], IsBool.Yes);

} }
//线体2任务上报 //线体2任务上报
if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LFiverobotJobId && objData.jobData.targetPointCode == "")//指定下料点正在下料,指炒锅空桶下料
if (objData.state == "DONE" && objData.robotJobId == LFiverobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指炒锅空桶下料
{ {
AgvViewModel.GetInstance().Set滚筒线状态(4, IsRun.Start);
AgvViewModel.GetInstance().Set小车是否承载物品(2, IsBool.No);
MessageLog.GetInstance.ShowRunLog("2号线炒锅空桶在4号线卸桶完成");
if (globalVar.LFourRollerNum >= 8) if (globalVar.LFourRollerNum >= 8)
{ {
AgvViewModel.GetInstance().Set滚筒线上数量(4, "8"); AgvViewModel.GetInstance().Set滚筒线上数量(4, "8");
} }
else else
{ {
AgvViewModel.GetInstance().Set滚筒线上数量(4, (globalVar.LFourRollerNum + 1).ToString());
AgvViewModel.GetInstance().Set滚筒线上数量(4, (++globalVar.LFourRollerNum).ToString());
} }
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车停止(agvCode[objData.jobData.agvCode]);
AgvViewModel.GetInstance().Set停车桩(agvCode[objData.jobData.agvCode], IsBool.Yes);
} }
//线体3任务上报 //线体3任务上报
if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LSixrobotJobId && objData.jobData.targetPointCode == "")//指定下料点正在下料,指炒锅空桶下料
if (objData.state == "DONE" && objData.robotJobId == LSixrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指炒锅空桶下料
{ {
AgvViewModel.GetInstance().Set滚筒线状态(4, IsRun.Start);
AgvViewModel.GetInstance().Set小车是否承载物品(3, IsBool.No);
MessageLog.GetInstance.ShowRunLog("3号线炒锅空桶在4号线卸桶完成");
if (globalVar.LFourRollerNum >= 8) if (globalVar.LFourRollerNum >= 8)
{ {
AgvViewModel.GetInstance().Set滚筒线上数量(4, "8"); AgvViewModel.GetInstance().Set滚筒线上数量(4, "8");
} }
else else
{ {
AgvViewModel.GetInstance().Set滚筒线上数量(4, (globalVar.LFourRollerNum + 1).ToString());
AgvViewModel.GetInstance().Set滚筒线上数量(4, (++globalVar.LFourRollerNum).ToString());
} }
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车停止(agvCode[objData.jobData.agvCode]);
AgvViewModel.GetInstance().Set停车桩(agvCode[objData.jobData.agvCode], IsBool.Yes);
} }
#endregion
#region 线体123空桶到清戏台
//线体1任务上报 //线体1任务上报
if (objData.state == "DONE" && objData.robotJobId == LFourrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指炒锅空桶下料
if (objData.state == "ROLLER_LOAD_FINISH" && LSevenrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体1空桶上
{ {
MessageLog.GetInstance.ShowRunLog("1号线炒锅空桶在4号线卸桶完成");
// globalVar.EmptyRollerUnLoadcCom = true;
AgvViewModel.GetInstance().Set小车运动(1, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车停止(1);
AgvViewModel.GetInstance().Set停车桩(1, IsBool.Yes);

globalVar.agvArriveLineOneLoadCom = true;
AgvViewModel.GetInstance().Set滚筒线上数量(1, (--globalVar.LOneMaterialNum).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.tqx_1);
//到清洗处
} }
//线体2任务上报 //线体2任务上报
if (objData.state == "DONE" && objData.robotJobId == LFiverobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指炒锅空桶下
if (objData.state == "ROLLER_LOAD_FINISH" && LEightrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体2空桶上
{ {
MessageLog.GetInstance.ShowRunLog("2号线炒锅空桶在4号线卸桶完成");
// globalVar.EmptyRollerUnLoadcCom = true;
AgvViewModel.GetInstance().Set小车运动(2, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车停止(2);
AgvViewModel.GetInstance().Set停车桩(2, IsBool.Yes);
globalVar.agvArriveLineTwoLoadCom = true;
AgvViewModel.GetInstance().Set滚筒线上数量(2, (--globalVar.LTwoMaterialNum).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.tqx_2);
//到清洗处

} }
//线体3任务上报 //线体3任务上报
if (objData.state == "DONE" && objData.robotJobId == LSixrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指炒锅空桶下
if (objData.state == "ROLLER_LOAD_FINISH" && LNinerobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体3空桶上
{ {
MessageLog.GetInstance.ShowRunLog("3号线炒锅空桶在4号线卸桶完成");
// globalVar.EmptyRollerUnLoadcCom = true;
AgvViewModel.GetInstance().Set小车运动(3, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车停止(3);
AgvViewModel.GetInstance().Set停车桩(3, IsBool.Yes);
globalVar.agvArriveLineThreeLoadCom = true;
AgvViewModel.GetInstance().Set滚筒线上数量(3, (--globalVar.LThreeMaterialNum).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.tqx_3);
//到清洗处

} }



if (objData.state == "DONE" && LSevenrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指从线体1到清戏台空桶下料 if (objData.state == "DONE" && LSevenrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指从线体1到清戏台空桶下料
{ {
LSevenrobotJobId.Remove(objData.robotJobId); LSevenrobotJobId.Remove(objData.robotJobId);
MessageLog.GetInstance.ShowRunLog("清洗台卸桶完成");
AgvViewModel.GetInstance().Set小车运动(4, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车停止(4);
AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes);
MessageLog.GetInstance.ShowRunLog("线体【1】空桶在清洗台卸桶完成");
AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.No);
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.qxt_hj);
AgvViewModel.GetInstance().Set停车桩(agvCode[objData.jobData.agvCode], IsBool.Yes);
AgvViewModel.GetInstance().SetCleanRollerNum(++CleanNum);
} }
if (objData.state == "DONE" && LEightrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指从线体2到清戏台空桶下料 if (objData.state == "DONE" && LEightrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指从线体2到清戏台空桶下料
{ {
LEightrobotJobId.Remove(objData.robotJobId); LEightrobotJobId.Remove(objData.robotJobId);
MessageLog.GetInstance.ShowRunLog("清洗台卸桶完成");
AgvViewModel.GetInstance().Set小车运动(4, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车停止(4);
AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes);
MessageLog.GetInstance.ShowRunLog("线体【2】空桶在清洗台卸桶完成");
AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.No);
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.qxt_hj);
AgvViewModel.GetInstance().Set停车桩(agvCode[objData.jobData.agvCode], IsBool.Yes);
AgvViewModel.GetInstance().SetCleanRollerNum(++CleanNum);
} }
if (objData.state == "DONE" && LNinerobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指从线体3到清戏台空桶下料 if (objData.state == "DONE" && LNinerobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指从线体3到清戏台空桶下料
{ {
LNinerobotJobId.Remove(objData.robotJobId); LNinerobotJobId.Remove(objData.robotJobId);
MessageLog.GetInstance.ShowRunLog("清洗台卸桶完成");
AgvViewModel.GetInstance().Set小车运动(4, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车停止(4);
AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes);
MessageLog.GetInstance.ShowRunLog("线体【3】空桶在清洗台卸桶完成");
AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.No);
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.qxt_hj);
AgvViewModel.GetInstance().Set停车桩(agvCode[objData.jobData.agvCode], IsBool.Yes);
AgvViewModel.GetInstance().SetCleanRollerNum(++CleanNum);
} }
#endregion
#region 清洗台到线体4
if (objData.state == "ROLLER_LOAD_FINISH" && LTenrobotJobId.FirstOrDefault(p=>p==objData.robotJobId)!=null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料位置上料完成,指清戏台空桶到上料 if (objData.state == "ROLLER_LOAD_FINISH" && LTenrobotJobId.FirstOrDefault(p=>p==objData.robotJobId)!=null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料位置上料完成,指清戏台空桶到上料
{ {
MessageLog.GetInstance.ShowRunLog("清洗台空桶装载完成"); MessageLog.GetInstance.ShowRunLog("清洗台空桶装载完成");
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.hs_4);//去四号空桶线

AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.hs_4);//去四号空桶线
AgvViewModel.GetInstance().SetCleanRollerNum(--CleanNum);
} }
if (objData.state == "ROLLER_UNLOAD_DOING" && LTenrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.targetPointCode == "")//指定下料点正在下料,指清洗台空桶到线体4下料 if (objData.state == "ROLLER_UNLOAD_DOING" && LTenrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.targetPointCode == "")//指定下料点正在下料,指清洗台空桶到线体4下料
{ {
AgvViewModel.GetInstance().Set滚筒线状态(4, IsRun.Start); AgvViewModel.GetInstance().Set滚筒线状态(4, IsRun.Start);
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.No);
}

if (objData.state == "DONE"&& LTenrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指清戏台空桶到线体4下料
{
LTenrobotJobId.Remove(objData.robotJobId);
MessageLog.GetInstance.ShowRunLog("【4】号线空桶回桶完成");
if (globalVar.LFourRollerNum >= 8) if (globalVar.LFourRollerNum >= 8)
{ {
AgvViewModel.GetInstance().Set滚筒线上数量(4, "8"); AgvViewModel.GetInstance().Set滚筒线上数量(4, "8");
} }
else else
{ {
AgvViewModel.GetInstance().Set滚筒线上数量(4, (globalVar.LFourRollerNum + 1).ToString());
AgvViewModel.GetInstance().Set滚筒线上数量(4, (++globalVar.LFourRollerNum).ToString());
} }
}

if (objData.state == "DONE"&& LTenrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指清戏台空桶到线体4下料
{
LTenrobotJobId.Remove(objData.robotJobId);
MessageLog.GetInstance.ShowRunLog("【4】号线空桶回桶完成");
AgvViewModel.GetInstance().Set小车运动(4, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车停止(4);
AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes);
AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.No);
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车停止(agvCode[objData.jobData.agvCode]);
AgvViewModel.GetInstance().Set停车桩(agvCode[objData.jobData.agvCode], IsBool.Yes);


} }

#endregion #endregion





} }


} }
@@ -1485,19 +1475,19 @@ namespace FryPot_DosingSystem.Control
if (globalVar.rollerLineOne.EmptyRollerConfirmSingle == 1 && globalVar.rollerLineOne.EmptyRollerNum != 0) if (globalVar.rollerLineOne.EmptyRollerConfirmSingle == 1 && globalVar.rollerLineOne.EmptyRollerNum != 0)
{ {
globalVar.rollerLineOne.EmptyRollerNums.Add(globalVar.rollerLineOne.EmptyRollerNum); globalVar.rollerLineOne.EmptyRollerNums.Add(globalVar.rollerLineOne.EmptyRollerNum);
globalVar.LOneMaterialNum++;
++globalVar.LOneMaterialNum;
//是否手动复位PLC //是否手动复位PLC
} }
if (globalVar.rollerLineTwo.EmptyRollerConfirmSingle == 1 && globalVar.rollerLineTwo.EmptyRollerNum != 0) if (globalVar.rollerLineTwo.EmptyRollerConfirmSingle == 1 && globalVar.rollerLineTwo.EmptyRollerNum != 0)
{ {
globalVar.rollerLineTwo.EmptyRollerNums.Add(globalVar.rollerLineTwo.EmptyRollerNum); globalVar.rollerLineTwo.EmptyRollerNums.Add(globalVar.rollerLineTwo.EmptyRollerNum);
globalVar.LTwoMaterialNum++;
++globalVar.LTwoMaterialNum;
//是否手动复位PLC //是否手动复位PLC
} }
if (globalVar.rollerLineThree.EmptyRollerConfirmSingle == 1 && globalVar.rollerLineThree.EmptyRollerNum != 0) if (globalVar.rollerLineThree.EmptyRollerConfirmSingle == 1 && globalVar.rollerLineThree.EmptyRollerNum != 0)
{ {
globalVar.rollerLineThree.EmptyRollerNums.Add(globalVar.rollerLineThree.EmptyRollerNum); globalVar.rollerLineThree.EmptyRollerNums.Add(globalVar.rollerLineThree.EmptyRollerNum);
globalVar.LThreeMaterialNum++;
++globalVar.LThreeMaterialNum;
//是否手动复位PLC //是否手动复位PLC
} }
//炒锅状态数据 //炒锅状态数据
@@ -2066,9 +2056,7 @@ namespace FryPot_DosingSystem.Control
WritePlcData("D1066", 1);//AGV空桶出桶就位信号下发PlC WritePlcData("D1066", 1);//AGV空桶出桶就位信号下发PlC
MessageLog.GetInstance.ShowRunLog("AGV到达清洗台空桶上料位置"); MessageLog.GetInstance.ShowRunLog("AGV到达清洗台空桶上料位置");
// MessageLog.GetInstance.ShowRunLog("清洗台空桶装载完成"); // MessageLog.GetInstance.ShowRunLog("清洗台空桶装载完成");
AgvViewModel.GetInstance().SetCleanRollerNum(--CleanNum);
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.qxt_4);
} }
} }


@@ -2724,7 +2712,7 @@ namespace FryPot_DosingSystem.Control
{ {
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 }); })); 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(); FryPotOneOrFourInputMaterialRollerOperate();
AgvFromFryPotOneOrFourToClean();//上游下发搬运任务给AGV AgvFromFryPotOneOrFourToClean();//上游下发搬运任务给AGV
@@ -2784,7 +2772,7 @@ namespace FryPot_DosingSystem.Control


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 }); })); 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(); FryPotTwoOrFiveInputMaterialRollerOperate();
AgvFromFryPotTwoOrFiveToClean();//上游下发搬运任务给AGV AgvFromFryPotTwoOrFiveToClean();//上游下发搬运任务给AGV
@@ -2820,7 +2808,7 @@ namespace FryPot_DosingSystem.Control
{ {


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 }); })); 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(); FryPotThreeInputMaterialRollerOperate();
AgvFromFryPotThreeToClean();//上游下发搬运任务给AGV AgvFromFryPotThreeToClean();//上游下发搬运任务给AGV
@@ -2906,7 +2894,6 @@ namespace FryPot_DosingSystem.Control
//} //}
globalVar.agvFryPotEmptyRollerArrive = false; globalVar.agvFryPotEmptyRollerArrive = false;
globalVar.InOrOutputLock = false; globalVar.InOrOutputLock = false;
globalVar.LOneMaterialNum--;
MessageLog.GetInstance.ShowRunLog($"AGV在【{globalVar.LOneFryPotSerial}】号炒锅将空桶回收到4号滚筒线"); MessageLog.GetInstance.ShowRunLog($"AGV在【{globalVar.LOneFryPotSerial}】号炒锅将空桶回收到4号滚筒线");
//AGV拿到空桶,让AGV运桶到指定位置,同时可以让下一个AGV从线体装料运到炒锅 //AGV拿到空桶,让AGV运桶到指定位置,同时可以让下一个AGV从线体装料运到炒锅
globalVar.AllowAgvToLineLoadRoller = true; globalVar.AllowAgvToLineLoadRoller = true;
@@ -2962,7 +2949,7 @@ namespace FryPot_DosingSystem.Control
//} //}
globalVar.LTwoagvFryPotEmptyRollerArrive = false; globalVar.LTwoagvFryPotEmptyRollerArrive = false;
globalVar.LTwoInOrOutputLock = false; globalVar.LTwoInOrOutputLock = false;
globalVar.LTwoMaterialNum--;
MessageLog.GetInstance.ShowRunLog($"AGV在【{globalVar.LTwoFryPotSerial}】号炒锅将空桶回收到4号滚筒线"); MessageLog.GetInstance.ShowRunLog($"AGV在【{globalVar.LTwoFryPotSerial}】号炒锅将空桶回收到4号滚筒线");
//AGV拿到空桶,让AGV运桶到指定位置,同时可以让下一个AGV从线体装料运到炒锅 //AGV拿到空桶,让AGV运桶到指定位置,同时可以让下一个AGV从线体装料运到炒锅
globalVar.AllowAgvToLineTwoLoadRoller = true; globalVar.AllowAgvToLineTwoLoadRoller = true;
@@ -3008,7 +2995,7 @@ namespace FryPot_DosingSystem.Control
//AgvViewModel.GetInstance().Set小车运动(3, CartMotionTrajectory.hs_3); //AgvViewModel.GetInstance().Set小车运动(3, CartMotionTrajectory.hs_3);
globalVar.LThreeagvFryPotEmptyRollerArrive = false; globalVar.LThreeagvFryPotEmptyRollerArrive = false;
globalVar.LThreeInOrOutputLock = false; globalVar.LThreeInOrOutputLock = false;
globalVar.LThreeMaterialNum--;
MessageLog.GetInstance.ShowRunLog($"AGV在【{globalVar.LThreeFryPotSerial}】号炒锅将空桶回收到4号滚筒线"); MessageLog.GetInstance.ShowRunLog($"AGV在【{globalVar.LThreeFryPotSerial}】号炒锅将空桶回收到4号滚筒线");
//AGV拿到空桶,让AGV运桶到指定位置,同时可以让下一个AGV从线体装料运到炒锅 //AGV拿到空桶,让AGV运桶到指定位置,同时可以让下一个AGV从线体装料运到炒锅
globalVar.AllowAgvToLineThreeLoadRoller = true; globalVar.AllowAgvToLineThreeLoadRoller = true;
@@ -3521,7 +3508,7 @@ namespace FryPot_DosingSystem.Control
if (InputMaterialQuene.TryDequeue(out MaterialInfo materialInfo)) if (InputMaterialQuene.TryDequeue(out MaterialInfo materialInfo))
{ {
MessageLog.GetInstance.ShowRunLog($"AGV正在装载{materialInfo.materialType.MaterialLoc}号料桶"); MessageLog.GetInstance.ShowRunLog($"AGV正在装载{materialInfo.materialType.MaterialLoc}号料桶");
AgvViewModel.GetInstance().Set滚筒线状态(1, IsRun.Start);
globalVar.LOneCurrentCookingStep++; globalVar.LOneCurrentCookingStep++;
OutputMaterialQuene.Enqueue(materialInfo); OutputMaterialQuene.Enqueue(materialInfo);
globalVar.agvArriveUpLoad = false; globalVar.agvArriveUpLoad = false;
@@ -3556,8 +3543,8 @@ namespace FryPot_DosingSystem.Control
MessageLog.GetInstance.ShowRunLog("AGV到达【1】号滚筒线装桶位置"); MessageLog.GetInstance.ShowRunLog("AGV到达【1】号滚筒线装桶位置");
DeviceOperate.GetInstance.WritePlcData("D1052", 1);//agv到达线体1上料位置信号下发plc DeviceOperate.GetInstance.WritePlcData("D1052", 1);//agv到达线体1上料位置信号下发plc
MessageLog.GetInstance.ShowRunLog($"AGV正在装载【{emptyRollerNum}】号空料桶"); MessageLog.GetInstance.ShowRunLog($"AGV正在装载【{emptyRollerNum}】号空料桶");
AgvViewModel.GetInstance().Set滚筒线状态(1, IsRun.Start);
globalVar.LOneMaterialNum--;
globalVar.agvArriveLineOneLoadEmptyRoller = false; globalVar.agvArriveLineOneLoadEmptyRoller = false;
//原料到位,agv到位,agv自行运料到清洗处 //原料到位,agv到位,agv自行运料到清洗处
} }
@@ -3598,7 +3585,7 @@ namespace FryPot_DosingSystem.Control
if (LTwoInputMaterialQuene.TryDequeue(out MaterialInfo materialInfo)) if (LTwoInputMaterialQuene.TryDequeue(out MaterialInfo materialInfo))
{ {
MessageLog.GetInstance.ShowRunLog($"AGV正在装载{materialInfo.materialType.MaterialLoc}号料桶"); MessageLog.GetInstance.ShowRunLog($"AGV正在装载{materialInfo.materialType.MaterialLoc}号料桶");
AgvViewModel.GetInstance().Set滚筒线状态(2, IsRun.Start);
globalVar.LTwoCurrentCookingStep++; globalVar.LTwoCurrentCookingStep++;
LTwoOutputMaterialQuene.Enqueue(materialInfo); LTwoOutputMaterialQuene.Enqueue(materialInfo);
globalVar.agvArriveLTwoUpLoad = false; globalVar.agvArriveLTwoUpLoad = false;
@@ -3635,8 +3622,8 @@ namespace FryPot_DosingSystem.Control
MessageLog.GetInstance.ShowRunLog("AGV到达【2】号滚筒线装桶位置"); MessageLog.GetInstance.ShowRunLog("AGV到达【2】号滚筒线装桶位置");
DeviceOperate.GetInstance.WritePlcData("D1053", 1);//agv到达线体2上料位置信号下发plc DeviceOperate.GetInstance.WritePlcData("D1053", 1);//agv到达线体2上料位置信号下发plc
MessageLog.GetInstance.ShowRunLog($"AGV正在装载【{emptyRollerNum}】号空料桶"); MessageLog.GetInstance.ShowRunLog($"AGV正在装载【{emptyRollerNum}】号空料桶");
AgvViewModel.GetInstance().Set滚筒线状态(2, IsRun.Start);
globalVar.LTwoMaterialNum--;
globalVar.agvArriveLineTwoLoadEmptyRoller = false; globalVar.agvArriveLineTwoLoadEmptyRoller = false;


//原料到位,agv到位,agv自行运料到清洗处 //原料到位,agv到位,agv自行运料到清洗处
@@ -3678,7 +3665,7 @@ namespace FryPot_DosingSystem.Control
if (LThreeInputMaterialQuene.TryDequeue(out MaterialInfo materialInfo)) if (LThreeInputMaterialQuene.TryDequeue(out MaterialInfo materialInfo))
{ {
MessageLog.GetInstance.ShowRunLog($"AGV正在装载{materialInfo.materialType.MaterialLoc}号料桶"); MessageLog.GetInstance.ShowRunLog($"AGV正在装载{materialInfo.materialType.MaterialLoc}号料桶");
AgvViewModel.GetInstance().Set滚筒线状态(3, IsRun.Start);
globalVar.LThreeCurrentCookingStep++; globalVar.LThreeCurrentCookingStep++;
LThreeOutputMaterialQuene.Enqueue(materialInfo); LThreeOutputMaterialQuene.Enqueue(materialInfo);
globalVar.agvArriveLThreeUpLoad = false; globalVar.agvArriveLThreeUpLoad = false;
@@ -3715,8 +3702,8 @@ namespace FryPot_DosingSystem.Control
MessageLog.GetInstance.ShowRunLog("AGV到达【3】号滚筒线装桶位置"); MessageLog.GetInstance.ShowRunLog("AGV到达【3】号滚筒线装桶位置");
DeviceOperate.GetInstance.WritePlcData("D1054", 1);//agv到达线体3上料位置信号下发plc DeviceOperate.GetInstance.WritePlcData("D1054", 1);//agv到达线体3上料位置信号下发plc
MessageLog.GetInstance.ShowRunLog($"AGV正在装载【{emptyRollerNum}】号空料桶"); MessageLog.GetInstance.ShowRunLog($"AGV正在装载【{emptyRollerNum}】号空料桶");
AgvViewModel.GetInstance().Set滚筒线状态(3, IsRun.Start);
globalVar.LThreeMaterialNum--;
globalVar.agvArriveLineThreeLoadEmptyRoller = false; globalVar.agvArriveLineThreeLoadEmptyRoller = false;
// globalVar.rollerLineThree.IsEpmtyBefore = false; // globalVar.rollerLineThree.IsEpmtyBefore = false;


@@ -3753,9 +3740,6 @@ namespace FryPot_DosingSystem.Control
{ {
if (errorCode == "SUCCESS") if (errorCode == "SUCCESS")
{ {
AgvViewModel.GetInstance().Set停车桩(num, IsBool.No);
AgvViewModel.GetInstance().Set小车是否承载物品(num, IsBool.No);
AgvViewModel.GetInstance().Set小车运动(num, AgvViewModel.GetInstance().GetCommandValue($"qc_{num}"));
MessageLog.GetInstance.ShowRunLog($"AGV去{num}号滚筒线装桶"); MessageLog.GetInstance.ShowRunLog($"AGV去{num}号滚筒线装桶");
globalVar.AllowAgvToLineLoadRoller = false; globalVar.AllowAgvToLineLoadRoller = false;
} }
@@ -3777,9 +3761,7 @@ namespace FryPot_DosingSystem.Control
{ {
if (errorCode == "SUCCESS") if (errorCode == "SUCCESS")
{ {
AgvViewModel.GetInstance().Set停车桩(num, IsBool.No);
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.No);
AgvViewModel.GetInstance().Set小车运动(4, AgvViewModel.GetInstance().GetCommandValue($"tqx_{num}"));
MessageLog.GetInstance.ShowRunLog($"AGV去{num}号滚筒线装桶"); MessageLog.GetInstance.ShowRunLog($"AGV去{num}号滚筒线装桶");
} }
else if (errorCode == "Analysis Error") else if (errorCode == "Analysis Error")
@@ -3800,9 +3782,7 @@ namespace FryPot_DosingSystem.Control
{ {
if (errorCode == "SUCCESS") if (errorCode == "SUCCESS")
{ {
AgvViewModel.GetInstance().Set停车桩(num, IsBool.No);
AgvViewModel.GetInstance().Set小车是否承载物品(num, IsBool.No);
AgvViewModel.GetInstance().Set小车运动(num, CartMotionTrajectory.jtqx);
MessageLog.GetInstance.ShowRunLog($"AGV去{num}号滚筒线卸桶"); MessageLog.GetInstance.ShowRunLog($"AGV去{num}号滚筒线卸桶");
} }
else if (errorCode == "Analysis Error") else if (errorCode == "Analysis Error")


Loading…
Cancel
Save