@@ -141,10 +141,15 @@ namespace FryPot_DosingSystem.Control
string LFourrobotJobId = string.Empty;//线体4当前上游系统任务号,全局唯一 从炒锅1、4到线体4路径
string LFourrobotJobId = string.Empty;//线体4当前上游系统任务号,全局唯一 从炒锅1、4到线体4路径
string LFiverobotJobId = string.Empty; //从炒锅2、5到线体4路径
string LFiverobotJobId = string.Empty; //从炒锅2、5到线体4路径
string LSixrobotJobId = string.Empty; //从炒锅3到线体4路径
string LSixrobotJobId = string.Empty; //从炒锅3到线体4路径
string LSevenrobotJobId = string.Empty; //从线体1到清洗台路径
string LEightrobotJobId = string.Empty; //从线体2到清洗台路径
string LNinerobotJobId = string.Empty; //从线体3到清洗台路径
string LTenrobotJobId = string.Empty; //从清洗台到线体4路径
List<string> LSevenrobotJobId =new List<string>(); //从线体1到清洗台路径
List<string> LEightrobotJobId = new List<string>();//从线体2到清洗台路径
List<string> LNinerobotJobId = new List<string>(); //从线体3到清洗台路径
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动画小车编号
public int CleanNum = 0;//当前清洗台桶数
public int CleanNum = 0;//当前清洗台桶数
@@ -178,7 +183,9 @@ namespace FryPot_DosingSystem.Control
}), "CleanPlateCallAgv");
}), "CleanPlateCallAgv");
ActionManage.GetInstance.Register(new Action(() =>
ActionManage.GetInstance.Register(new Action(() =>
{
{
globalVar.agvArriveCleanUnLoad = true;//清洗台空桶下料就位
globalVar.rollerLineOne.agvArriveCleanUnLoad = true;//清洗台空桶下料就位
globalVar.rollerLineTwo.agvArriveCleanUnLoad = true;
globalVar.rollerLineThree.agvArriveCleanUnLoad = true;
}), "AgvArriveCleanPlateLoc");
}), "AgvArriveCleanPlateLoc");
ActionManage.GetInstance.Register(new Action(() =>
ActionManage.GetInstance.Register(new Action(() =>
@@ -189,7 +196,9 @@ namespace FryPot_DosingSystem.Control
ActionManage.GetInstance.Register(new Action(() =>
ActionManage.GetInstance.Register(new Action(() =>
{
{
globalVar.agvArriveLineFour = true;
globalVar.agvArriveLineFour = true;
globalVar.rollerLineOne.agvArriveLineFour = true;
globalVar.rollerLineTwo.agvArriveLineFour = true;
globalVar.rollerLineThree.agvArriveLineFour = true;
}), "AgvArriveLineFourLoc");
}), "AgvArriveLineFourLoc");
ActionManage.GetInstance.Register(new Action(() =>
ActionManage.GetInstance.Register(new Action(() =>
@@ -226,7 +235,10 @@ namespace FryPot_DosingSystem.Control
ActionManage.GetInstance.Register(() =>
ActionManage.GetInstance.Register(() =>
{
{
MessageLog.GetInstance.ShowRunLog("4号线卸桶完成");
MessageLog.GetInstance.ShowRunLog("清洗台空桶在【4】号线卸桶完成");
MessageLog.GetInstance.ShowRunLog("【1】号线炒锅空桶在【4】号线卸桶完成");
MessageLog.GetInstance.ShowRunLog("【2】号线炒锅空桶在【4】号线卸桶完成");
MessageLog.GetInstance.ShowRunLog("【3】号线炒锅空桶在【4】号线卸桶完成");
}, "AgvArriveLineFourLocCom");
}, "AgvArriveLineFourLocCom");
ActionManage.GetInstance.Register(() =>
ActionManage.GetInstance.Register(() =>
@@ -235,10 +247,10 @@ namespace FryPot_DosingSystem.Control
}, "AgvArriveCleanPlateLocLoadCom");
}, "AgvArriveCleanPlateLocLoadCom");
ActionManage.GetInstance.Register(() =>
ActionManage.GetInstance.Register(() =>
{
{
globalVar.rollerLineOne.RecipeCompleteSingle = 1;
globalVar.rollerLineOne.RecipeCompleteSingle = 1;
}, "LineOneRecipeComSignal");
}, "LineOneRecipeComSignal");
ActionManage.GetInstance.Register(() =>
ActionManage.GetInstance.Register(() =>
{
{
@@ -428,7 +440,7 @@ namespace FryPot_DosingSystem.Control
DateTime timeNow = DateTime.Now;
DateTime timeNow = DateTime.Now;
if (TimeDiff(timeNow, createTime) != 0 && TimeDiff(timeNow, createTime) > days)
if (TimeDiff(timeNow, createTime) != 0 && TimeDiff(timeNow, createTime) > days)
{
{
Directory.Delete(item);
Directory.Delete(item, true );
}
}
}
}
}
}
@@ -442,7 +454,7 @@ namespace FryPot_DosingSystem.Control
DateTime timeNow = DateTime.Now;
DateTime timeNow = DateTime.Now;
if (TimeDiff(timeNow, createTime) != 0 && TimeDiff(timeNow, createTime) > days)
if (TimeDiff(timeNow, createTime) != 0 && TimeDiff(timeNow, createTime) > days)
{
{
Directory.Delete(item);
Directory.Delete(item, true );
}
}
}
}
}
}
@@ -456,7 +468,7 @@ namespace FryPot_DosingSystem.Control
DateTime timeNow = DateTime.Now;
DateTime timeNow = DateTime.Now;
if (TimeDiff(timeNow, createTime) != 0 && TimeDiff(timeNow, createTime) > days)
if (TimeDiff(timeNow, createTime) != 0 && TimeDiff(timeNow, createTime) > days)
{
{
Directory.Delete(item);
Directory.Delete(item, true );
}
}
}
}
}
}
@@ -470,7 +482,7 @@ namespace FryPot_DosingSystem.Control
DateTime timeNow = DateTime.Now;
DateTime timeNow = DateTime.Now;
if (TimeDiff(timeNow, createTime) != 0 && TimeDiff(timeNow, createTime) > days)
if (TimeDiff(timeNow, createTime) != 0 && TimeDiff(timeNow, createTime) > days)
{
{
Directory.Delete(item);
Directory.Delete(item, true );
}
}
}
}
}
}
@@ -484,7 +496,7 @@ namespace FryPot_DosingSystem.Control
DateTime timeNow = DateTime.Now;
DateTime timeNow = DateTime.Now;
if (TimeDiff(timeNow, createTime) != 0 && TimeDiff(timeNow, createTime) > days)
if (TimeDiff(timeNow, createTime) != 0 && TimeDiff(timeNow, createTime) > days)
{
{
Directory.Delete(item);
Directory.Delete(item, true );
}
}
}
}
}
}
@@ -713,12 +725,16 @@ namespace FryPot_DosingSystem.Control
if (objData.robotJobId == LFourrobotJobId && objData.command == "LOAD")//同一任务号且处于上料阶段,AGV请求上料
if (objData.robotJobId == LFourrobotJobId && objData.command == "LOAD")//同一任务号且处于上料阶段,AGV请求上料
{
{
globalVar.agvArriveUpLoad = true;//AGV到达上料位置
globalVar.agvArriveUpLoad = true;//AGV到达上料位置
}
}
if (objData.robotJobId == LFourrobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段
if (objData.robotJobId == LFourrobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段
{
{
globalVar.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);
}
}
if (objData.robotJobId == LFiverobotJobId && objData.command == "LOAD")
if (objData.robotJobId == LFiverobotJobId && objData.command == "LOAD")
@@ -728,8 +744,12 @@ namespace FryPot_DosingSystem.Control
}
}
if (objData.robotJobId == LFiverobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段
if (objData.robotJobId == LFiverobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段
{
{
globalVar.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")
@@ -739,50 +759,75 @@ namespace FryPot_DosingSystem.Control
}
}
if (objData.robotJobId == LSixrobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段
if (objData.robotJobId == LSixrobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段
{
{
globalVar.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 线体到清洗台
if (objData.robotJobId == LSevenrobotJobId && objData.command == "LOAD")//同一任务号且处于上料阶段,AGV请求上料
if (LSevenrobotJobId.FirstOrDefault(p=>p==objData.robotJobId)!=null && objData.command == "LOAD")//同一任务号且处于上料阶段,AGV请求上料
{
{
globalVar.agvArriveLineOneLoadEmptyRoller = true;//AGV到达上料位置
globalVar.agvArriveLineOneLoadEmptyRoller = true;//AGV到达上料位置
}
}
if (objData.robotJobId == LSevenrobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段
if (LSevenrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.command == "UNLOAD")//同一任务号且处于下料阶段
{
{
globalVar.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 (objData.robotJobId == LEightrobotJobId && objData.command == "LOAD")
if ( LEightrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.command == "LOAD")
{
{
globalVar.agvArriveLineTwoLoadEmptyRoller = true;//AGV到达上料位置
globalVar.agvArriveLineTwoLoadEmptyRoller = true;//AGV到达上料位置
}
}
if (objData.robotJobId == LEightrobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段
if ( LEightrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.command == "UNLOAD")//同一任务号且处于下料阶段
{
{
globalVar.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);
}
}
if (objData.robotJobId == LSixrobotJobId && objData.command == "LOAD")
if (LNinerobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.command == "LOAD")
{
{
globalVar.agvArriveLineThreeLoadEmptyRoller = true;//AGV到达上料位置
globalVar.agvArriveLineThreeLoadEmptyRoller = true;//AGV到达上料位置
}
}
if (objData.robotJobId == LSixrobotJobId && objData.command == "UNLOAD")//同一任务号且处于下料阶段
if (LNinerobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.command == "UNLOAD")//同一任务号且处于下料阶段
{
{
globalVar.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
if (objData.robotJobId == LTenrobotJobId && objData.command == "LOAD")
if (LTenrobotJobId.FirstOrDefault(p=>p==objData.robotJobId)!=null && objData.command == "LOAD")
{
{
globalVar.agvArriveCleanLoad = true;//agv到达清洗台上料位置
globalVar.agvArriveCleanLoad = true;//agv到达清洗台上料位置
}
}
if (objData.robotJobId == LTenrobotJobId && objData.command == "UNLOAD")
if (LTenrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.command == "UNLOAD")
{
{
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);
}
}
}
}
@@ -835,7 +880,7 @@ namespace FryPot_DosingSystem.Control
//线体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;
AgvViewModel.GetInstance().Set滚筒线上数量(1, (globalVar.LOneMaterialNum - 1).ToString());
AgvViewModel.GetInstance().Set滚筒线上数量(1, (globalVar.LOneMaterialNum - 1).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(1, IsBool.Yes);
AgvViewModel.GetInstance().Set小车是否承载物品(1, IsBool.Yes);
if (globalVar.LOneFryPotSerial == 1)
if (globalVar.LOneFryPotSerial == 1)
@@ -851,7 +896,7 @@ namespace FryPot_DosingSystem.Control
//线体2任务上报
//线体2任务上报
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;
AgvViewModel.GetInstance().Set滚筒线上数量(2, (globalVar.LTwoMaterialNum - 1).ToString());
AgvViewModel.GetInstance().Set滚筒线上数量(2, (globalVar.LTwoMaterialNum - 1).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(2, IsBool.Yes);
AgvViewModel.GetInstance().Set小车是否承载物品(2, IsBool.Yes);
if (globalVar.LTwoFryPotSerial == 2)
if (globalVar.LTwoFryPotSerial == 2)
@@ -867,7 +912,7 @@ namespace FryPot_DosingSystem.Control
//线体3任务上报
//线体3任务上报
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;
AgvViewModel.GetInstance().Set滚筒线上数量(3, (globalVar.LThreeMaterialNum - 1).ToString());
AgvViewModel.GetInstance().Set滚筒线上数量(3, (globalVar.LThreeMaterialNum - 1).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(3, IsBool.Yes);
AgvViewModel.GetInstance().Set小车是否承载物品(3, IsBool.Yes);
AgvViewModel.GetInstance().Set小车运动(3, CartMotionTrajectory.yc_3_3);
AgvViewModel.GetInstance().Set小车运动(3, CartMotionTrajectory.yc_3_3);
@@ -875,29 +920,29 @@ namespace FryPot_DosingSystem.Control
}
}
//线体1任务上报
//线体1任务上报
if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LSevenrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体1空桶上料
if (objData.state == "ROLLER_LOAD_FINISH" && LSevenrobotJobId.FirstOrDefault(p=>p==objData.robotJobId)!=null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体1空桶上料
{
{
globalVar.agvArriveLineOneLoadCom = true;
globalVar.agvArriveLineOneLoadCom = true;
AgvViewModel.GetInstance().Set滚筒线上数量(1, ( globalVar.LOneMaterialNum - 1) .ToString());
AgvViewModel.GetInstance().Set滚筒线上数量(1, globalVar.LOneMaterialNum.ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.tqx_1);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.tqx_1);
//到清洗处
//到清洗处
}
}
//线体2任务上报
//线体2任务上报
if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LEightrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体2空桶上料
if (objData.state == "ROLLER_LOAD_FINISH" && LEightrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体2空桶上料
{
{
globalVar.agvArriveLineTwoLoadCom = true;
globalVar.agvArriveLineTwoLoadCom = true;
AgvViewModel.GetInstance().Set滚筒线上数量(2, ( globalVar.LTwoMaterialNum - 1) .ToString());
AgvViewModel.GetInstance().Set滚筒线上数量(2, globalVar.LTwoMaterialNum.ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.tqx_2);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.tqx_2);
//到清洗处
//到清洗处
}
}
//线体3任务上报
//线体3任务上报
if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LThreerobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体3空桶上料
if (objData.state == "ROLLER_LOAD_FINISH" && LNinerobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体3空桶上料
{
{
globalVar.agvArriveLineThreeLoadCom = true;
globalVar.agvArriveLineThreeLoadCom = true;
AgvViewModel.GetInstance().Set滚筒线上数量(3, ( globalVar.LThreeMaterialNum - 1) .ToString());
AgvViewModel.GetInstance().Set滚筒线上数量(3, globalVar.LThreeMaterialNum.ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.tqx_3);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.tqx_3);
//到清洗处
//到清洗处
@@ -937,17 +982,17 @@ namespace FryPot_DosingSystem.Control
#region 空桶上下料任务信息回报
#region 空桶上下料任务信息回报
//线体1任务上报
//线体1任务上报
if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LOne robotJobId && objData.jobData.startPointCode == "")// AGV正在上料,指炒锅空桶上料
if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LFour robotJobId && objData.jobData.startPointCode == "")// AGV正在上料,指炒锅空桶上料
{
{
//日志
//日志
}
}
//线体2任务上报
//线体2任务上报
if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LTwo robotJobId && objData.jobData.startPointCode == "")// AGV正在上料,指炒锅空桶上料
if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LFive robotJobId && objData.jobData.startPointCode == "")// AGV正在上料,指炒锅空桶上料
{
{
//日志
//日志
}
}
//线体3任务上报
//线体3任务上报
if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LThree robotJobId && objData.jobData.startPointCode == "")// AGV正在上料,指炒锅空桶上料
if (objData.state == "ROLLER_LOAD_DOING" && objData.robotJobId == LSix robotJobId && objData.jobData.startPointCode == "")// AGV正在上料,指炒锅空桶上料
{
{
//日志
//日志
}
}
@@ -1034,6 +1079,7 @@ namespace FryPot_DosingSystem.Control
//线体1任务上报
//线体1任务上报
if (objData.state == "DONE" && objData.robotJobId == LFourrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指炒锅空桶下料
if (objData.state == "DONE" && objData.robotJobId == LFourrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指炒锅空桶下料
{
{
MessageLog.GetInstance.ShowRunLog("1号线炒锅空桶在4号线卸桶完成");
// globalVar.EmptyRollerUnLoadcCom = true;
// globalVar.EmptyRollerUnLoadcCom = true;
AgvViewModel.GetInstance().Set小车运动(1, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车运动(1, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车停止(1);
AgvViewModel.GetInstance().Set小车停止(1);
@@ -1043,6 +1089,7 @@ namespace FryPot_DosingSystem.Control
//线体2任务上报
//线体2任务上报
if (objData.state == "DONE" && objData.robotJobId == LFiverobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指炒锅空桶下料
if (objData.state == "DONE" && objData.robotJobId == LFiverobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指炒锅空桶下料
{
{
MessageLog.GetInstance.ShowRunLog("2号线炒锅空桶在4号线卸桶完成");
// globalVar.EmptyRollerUnLoadcCom = true;
// globalVar.EmptyRollerUnLoadcCom = true;
AgvViewModel.GetInstance().Set小车运动(2, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车运动(2, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车停止(2);
AgvViewModel.GetInstance().Set小车停止(2);
@@ -1051,41 +1098,45 @@ namespace FryPot_DosingSystem.Control
//线体3任务上报
//线体3任务上报
if (objData.state == "DONE" && objData.robotJobId == LSixrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指炒锅空桶下料
if (objData.state == "DONE" && objData.robotJobId == LSixrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指炒锅空桶下料
{
{
MessageLog.GetInstance.ShowRunLog("3号线炒锅空桶在4号线卸桶完成");
// globalVar.EmptyRollerUnLoadcCom = true;
// globalVar.EmptyRollerUnLoadcCom = true;
AgvViewModel.GetInstance().Set小车运动(3, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车运动(3, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车停止(3);
AgvViewModel.GetInstance().Set小车停止(3);
AgvViewModel.GetInstance().Set停车桩(3, IsBool.Yes);
AgvViewModel.GetInstance().Set停车桩(3, IsBool.Yes);
}
}
if (objData.state == "DONE" && objData.robotJobId == LSevenrobotJobId && 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);
MessageLog.GetInstance.ShowRunLog("清洗台卸桶完成");
MessageLog.GetInstance.ShowRunLog("清洗台卸桶完成");
AgvViewModel.GetInstance().Set小车运动(4, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车运动(4, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车停止(4);
AgvViewModel.GetInstance().Set小车停止(4);
AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes);
AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes);
}
}
if (objData.state == "DONE" && objData.robotJobId == LEightrobotJobId && 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);
MessageLog.GetInstance.ShowRunLog("清洗台卸桶完成");
MessageLog.GetInstance.ShowRunLog("清洗台卸桶完成");
AgvViewModel.GetInstance().Set小车运动(4, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车运动(4, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车停止(4);
AgvViewModel.GetInstance().Set小车停止(4);
AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes);
AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes);
}
}
if (objData.state == "DONE" && objData.robotJobId == LNinerobotJobId && 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);
MessageLog.GetInstance.ShowRunLog("清洗台卸桶完成");
MessageLog.GetInstance.ShowRunLog("清洗台卸桶完成");
AgvViewModel.GetInstance().Set小车运动(4, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车运动(4, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车停止(4);
AgvViewModel.GetInstance().Set小车停止(4);
AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes);
AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes);
}
}
if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LTenrobotJobId && 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, IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.hs_4);//去四号空桶线
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.hs_4);//去四号空桶线
}
}
if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LTenrobotJobId && 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);
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.No);
@@ -1099,8 +1150,9 @@ namespace FryPot_DosingSystem.Control
}
}
}
}
if (objData.state == "DONE" && objData.robotJobId == LTenrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指清戏台空桶到线体4下料
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】号线空桶回桶完成");
MessageLog.GetInstance.ShowRunLog("【4】号线空桶回桶完成");
AgvViewModel.GetInstance().Set小车运动(4, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车运动(4, AgvViewModel.GetInstance().GetCommandValue("hj"));
AgvViewModel.GetInstance().Set小车停止(4);
AgvViewModel.GetInstance().Set小车停止(4);
@@ -1272,7 +1324,9 @@ namespace FryPot_DosingSystem.Control
globalVar.agvArriveLineFour = false;
globalVar.agvArriveLineFour = false;
globalVar.agvArriveCleanLoad = false;
globalVar.agvArriveCleanLoad = false;
globalVar.agvArriveCleanUnLoad = false;
globalVar.rollerLineOne.agvArriveCleanUnLoad = false;
globalVar.rollerLineTwo.agvArriveCleanUnLoad = false;
globalVar.rollerLineThree.agvArriveCleanUnLoad = false;
globalVar.agvArriveLineOneLoadEmptyRoller = false;
globalVar.agvArriveLineOneLoadEmptyRoller = false;
globalVar.agvArriveLineTwoLoadEmptyRoller = false;
globalVar.agvArriveLineTwoLoadEmptyRoller = false;
globalVar.agvArriveLineThreeLoadEmptyRoller = false;
globalVar.agvArriveLineThreeLoadEmptyRoller = false;
@@ -1431,14 +1485,20 @@ 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++;
//是否手动复位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++;
//是否手动复位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++;
//是否手动复位PLC
}
}
//炒锅状态数据
//炒锅状态数据
if (globalVar.fryPotOne.OilConfirm == 1)
if (globalVar.fryPotOne.OilConfirm == 1)
@@ -1539,10 +1599,10 @@ namespace FryPot_DosingSystem.Control
if (globalVar.LOneFryPotSerial == 1 && fryOneRecipe != string.Empty)
if (globalVar.LOneFryPotSerial == 1 && fryOneRecipe != string.Empty)
{
{
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅1状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh :mm").Replace(':', '.') + fryOneRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅1状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("HH :mm").Replace(':', '.') + fryOneRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
{
{
writeStream.Position = writeStream.Length;
writeStream.Position = writeStream.Length;
PotOneStatus p1 = new PotOneStatus { Temperature = FryPotMonitorManage.GetInstance.fryOne.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryOne.HotPower, Speed = FryPotMonitorManage.GetInstance.fryOne.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryOne.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryOne.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryOne.TotalProduct, RecipeName = fryOneRecipe, Time = DateTime.Now.ToShortDateString() };
PotOneStatus p1 = new PotOneStatus { Temperature = FryPotMonitorManage.GetInstance.fryOne.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryOne.HotPower, Speed = FryPotMonitorManage.GetInstance.fryOne.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryOne.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryOne.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryOne.TotalProduct, RecipeName = fryOneRecipe,Time = DateTime.Now.ToShortDateString() };
BinaryFormatter bf = new BinaryFormatter();
BinaryFormatter bf = new BinaryFormatter();
bf.Serialize(writeStream, p1);
bf.Serialize(writeStream, p1);
@@ -1555,7 +1615,7 @@ namespace FryPot_DosingSystem.Control
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅1状态数据\\" + DateTime.Now.ToShortDateString());
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅1状态数据\\" + DateTime.Now.ToShortDateString());
if (globalVar.LOneFryPotSerial == 1 && fryOneRecipe != string.Empty)
if (globalVar.LOneFryPotSerial == 1 && fryOneRecipe != string.Empty)
{
{
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅1状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh :mm").Replace(':', '.') + fryOneRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅1状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("HH :mm").Replace(':', '.') + fryOneRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
{
{
writeStream.Position = writeStream.Length;
writeStream.Position = writeStream.Length;
PotOneStatus p1 = new PotOneStatus { Temperature = FryPotMonitorManage.GetInstance.fryOne.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryOne.HotPower, Speed = FryPotMonitorManage.GetInstance.fryOne.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryOne.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryOne.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryOne.TotalProduct, RecipeName = fryOneRecipe, Time = DateTime.Now.ToShortDateString() };
PotOneStatus p1 = new PotOneStatus { Temperature = FryPotMonitorManage.GetInstance.fryOne.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryOne.HotPower, Speed = FryPotMonitorManage.GetInstance.fryOne.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryOne.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryOne.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryOne.TotalProduct, RecipeName = fryOneRecipe, Time = DateTime.Now.ToShortDateString() };
@@ -1575,9 +1635,9 @@ namespace FryPot_DosingSystem.Control
if (globalVar.LTwoFryPotSerial == 2 && fryTwoRecipe != string.Empty)
if (globalVar.LTwoFryPotSerial == 2 && fryTwoRecipe != string.Empty)
{
{
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅2状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh :mm").Replace(':', '.') + fryTwoRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅2状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("HH :mm").Replace(':', '.') + fryTwoRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
{
{
writeStream.Position = writeStream.Length;
PotTwoStatus p1 = new PotTwoStatus { Temperature = FryPotMonitorManage.GetInstance.fryTwo.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryTwo.HotPower, Speed = FryPotMonitorManage.GetInstance.fryTwo.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryTwo.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryTwo.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryTwo.TotalProduct, RecipeName = fryTwoRecipe, Time = DateTime.Now.ToShortDateString() };
PotTwoStatus p1 = new PotTwoStatus { Temperature = FryPotMonitorManage.GetInstance.fryTwo.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryTwo.HotPower, Speed = FryPotMonitorManage.GetInstance.fryTwo.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryTwo.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryTwo.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryTwo.TotalProduct, RecipeName = fryTwoRecipe, Time = DateTime.Now.ToShortDateString() };
BinaryFormatter bf = new BinaryFormatter();
BinaryFormatter bf = new BinaryFormatter();
bf.Serialize(writeStream, p1);
bf.Serialize(writeStream, p1);
@@ -1591,9 +1651,9 @@ namespace FryPot_DosingSystem.Control
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅2状态数据\\" + DateTime.Now.ToShortDateString());
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅2状态数据\\" + DateTime.Now.ToShortDateString());
if (globalVar.LTwoFryPotSerial == 2 && fryTwoRecipe != string.Empty)
if (globalVar.LTwoFryPotSerial == 2 && fryTwoRecipe != string.Empty)
{
{
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅2状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh :mm").Replace(':', '.') + fryTwoRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅2状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("HH :mm").Replace(':', '.') + fryTwoRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
{
{
writeStream.Position = writeStream.Length;
PotTwoStatus p1 = new PotTwoStatus { Temperature = FryPotMonitorManage.GetInstance.fryTwo.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryTwo.HotPower, Speed = FryPotMonitorManage.GetInstance.fryTwo.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryTwo.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryTwo.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryTwo.TotalProduct, RecipeName = fryTwoRecipe, Time = DateTime.Now.ToShortDateString() };
PotTwoStatus p1 = new PotTwoStatus { Temperature = FryPotMonitorManage.GetInstance.fryTwo.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryTwo.HotPower, Speed = FryPotMonitorManage.GetInstance.fryTwo.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryTwo.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryTwo.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryTwo.TotalProduct, RecipeName = fryTwoRecipe, Time = DateTime.Now.ToShortDateString() };
BinaryFormatter bf = new BinaryFormatter();
BinaryFormatter bf = new BinaryFormatter();
bf.Serialize(writeStream, p1);
bf.Serialize(writeStream, p1);
@@ -1611,9 +1671,9 @@ namespace FryPot_DosingSystem.Control
if (globalVar.LThreeFryPotSerial == 3 && fryThreeRecipe != string.Empty)
if (globalVar.LThreeFryPotSerial == 3 && fryThreeRecipe != string.Empty)
{
{
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅3状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh :mm").Replace(':', '.') + fryThreeRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅3状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("HH :mm").Replace(':', '.') + fryThreeRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
{
{
writeStream.Position = writeStream.Length;
PotThreeStatus p1 = new PotThreeStatus { Temperature = FryPotMonitorManage.GetInstance.fryThree.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryThree.HotPower, Speed = FryPotMonitorManage.GetInstance.fryThree.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryThree.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryThree.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryThree.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryThree.TotalProduct, RecipeName = fryThreeRecipe, Time = DateTime.Now.ToShortDateString() };
PotThreeStatus p1 = new PotThreeStatus { Temperature = FryPotMonitorManage.GetInstance.fryThree.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryThree.HotPower, Speed = FryPotMonitorManage.GetInstance.fryThree.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryThree.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryThree.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryThree.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryThree.TotalProduct, RecipeName = fryThreeRecipe, Time = DateTime.Now.ToShortDateString() };
BinaryFormatter bf = new BinaryFormatter();
BinaryFormatter bf = new BinaryFormatter();
bf.Serialize(writeStream, p1);
bf.Serialize(writeStream, p1);
@@ -1627,9 +1687,9 @@ namespace FryPot_DosingSystem.Control
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅3状态数据\\" + DateTime.Now.ToShortDateString());
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅3状态数据\\" + DateTime.Now.ToShortDateString());
if (globalVar.LThreeFryPotSerial == 3 && fryThreeRecipe != string.Empty)
if (globalVar.LThreeFryPotSerial == 3 && fryThreeRecipe != string.Empty)
{
{
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅3状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh :mm").Replace(':', '.') + fryThreeRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅3状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("HH :mm").Replace(':', '.') + fryThreeRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
{
{
writeStream.Position = writeStream.Length;
PotThreeStatus p1 = new PotThreeStatus { Temperature = FryPotMonitorManage.GetInstance.fryThree.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryThree.HotPower, Speed = FryPotMonitorManage.GetInstance.fryThree.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryThree.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryThree.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryThree.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryThree.TotalProduct, RecipeName = fryThreeRecipe, Time = DateTime.Now.ToShortDateString() };
PotThreeStatus p1 = new PotThreeStatus { Temperature = FryPotMonitorManage.GetInstance.fryThree.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryThree.HotPower, Speed = FryPotMonitorManage.GetInstance.fryThree.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryThree.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryThree.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryThree.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryThree.TotalProduct, RecipeName = fryThreeRecipe, Time = DateTime.Now.ToShortDateString() };
BinaryFormatter bf = new BinaryFormatter();
BinaryFormatter bf = new BinaryFormatter();
bf.Serialize(writeStream, p1);
bf.Serialize(writeStream, p1);
@@ -1647,7 +1707,7 @@ namespace FryPot_DosingSystem.Control
if (globalVar.LOneFryPotSerial == 4 && fryFourRecipe != string.Empty)
if (globalVar.LOneFryPotSerial == 4 && fryFourRecipe != string.Empty)
{
{
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅4状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh :mm").Replace(':', '.') + fryFourRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅4状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("HH :mm").Replace(':', '.') + fryFourRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
{
{
writeStream.Position = writeStream.Length;
writeStream.Position = writeStream.Length;
PotFourStatus p1 = new PotFourStatus { Temperature = FryPotMonitorManage.GetInstance.fryFour.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFour.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFour.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFour.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFour.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFour.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFour.TotalProduct, RecipeName = fryFourRecipe, Time = DateTime.Now.ToShortDateString() };
PotFourStatus p1 = new PotFourStatus { Temperature = FryPotMonitorManage.GetInstance.fryFour.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFour.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFour.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFour.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFour.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFour.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFour.TotalProduct, RecipeName = fryFourRecipe, Time = DateTime.Now.ToShortDateString() };
@@ -1663,7 +1723,7 @@ namespace FryPot_DosingSystem.Control
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅4状态数据\\" + DateTime.Now.ToShortDateString());
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅4状态数据\\" + DateTime.Now.ToShortDateString());
if (globalVar.LOneFryPotSerial == 4 && fryFourRecipe != string.Empty)
if (globalVar.LOneFryPotSerial == 4 && fryFourRecipe != string.Empty)
{
{
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅4状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh :mm").Replace(':', '.') + fryFourRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅4状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("HH :mm").Replace(':', '.') + fryFourRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
{
{
writeStream.Position = writeStream.Length;
writeStream.Position = writeStream.Length;
PotFourStatus p1 = new PotFourStatus { Temperature = FryPotMonitorManage.GetInstance.fryFour.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFour.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFour.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFour.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFour.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFour.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFour.TotalProduct, RecipeName = fryFourRecipe, Time = DateTime.Now.ToShortDateString() };
PotFourStatus p1 = new PotFourStatus { Temperature = FryPotMonitorManage.GetInstance.fryFour.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFour.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFour.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFour.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFour.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFour.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFour.TotalProduct, RecipeName = fryFourRecipe, Time = DateTime.Now.ToShortDateString() };
@@ -1683,7 +1743,7 @@ namespace FryPot_DosingSystem.Control
if (globalVar.LTwoFryPotSerial == 5 && fryFiveRecipe != string.Empty)
if (globalVar.LTwoFryPotSerial == 5 && fryFiveRecipe != string.Empty)
{
{
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅5状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh :mm").Replace(':', '.') + fryFiveRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅5状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("HH :mm").Replace(':', '.') + fryFiveRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
{
{
writeStream.Position = writeStream.Length;
writeStream.Position = writeStream.Length;
PotFiveStatus p1 = new PotFiveStatus { Temperature = FryPotMonitorManage.GetInstance.fryFive.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFive.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFive.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFive.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFive.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFive.TotalProduct, RecipeName = fryFiveRecipe, Time = DateTime.Now.ToShortDateString() };
PotFiveStatus p1 = new PotFiveStatus { Temperature = FryPotMonitorManage.GetInstance.fryFive.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFive.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFive.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFive.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFive.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFive.TotalProduct, RecipeName = fryFiveRecipe, Time = DateTime.Now.ToShortDateString() };
@@ -1699,7 +1759,7 @@ namespace FryPot_DosingSystem.Control
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅5状态数据\\" + DateTime.Now.ToShortDateString());
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅5状态数据\\" + DateTime.Now.ToShortDateString());
if (globalVar.LTwoFryPotSerial == 5 && fryFiveRecipe != string.Empty)
if (globalVar.LTwoFryPotSerial == 5 && fryFiveRecipe != string.Empty)
{
{
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅5状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh :mm").Replace(':', '.') + fryFiveRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅5状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("HH :mm").Replace(':', '.') + fryFiveRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write))
{
{
writeStream.Position = writeStream.Length;
writeStream.Position = writeStream.Length;
PotFiveStatus p1 = new PotFiveStatus { Temperature = FryPotMonitorManage.GetInstance.fryFive.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFive.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFive.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFive.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFive.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFive.TotalProduct, RecipeName = fryFiveRecipe, Time = DateTime.Now.ToShortDateString() };
PotFiveStatus p1 = new PotFiveStatus { Temperature = FryPotMonitorManage.GetInstance.fryFive.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFive.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFive.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFive.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFive.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFive.TotalProduct, RecipeName = fryFiveRecipe, Time = DateTime.Now.ToShortDateString() };
@@ -1989,11 +2049,13 @@ namespace FryPot_DosingSystem.Control
{
{
//线体123到清洗台
//线体123到清洗台
AgvFromLineToCleanPlate();
AgvFromLineToCleanPlate();
AgvArriveCleanPlate();
//清洗台到线体4
AgvArriveCleanPlateFromLine();
//空桶到线体4
CallAgvToLineFour();
CallAgvToLineFour();
CleanPlateUpLoad();
CleanPlateUpLoad();
EmptyRollerToLinFour();
//清洗台或线体123空桶到线体4
EmptyRollerToLinFourFromClean();
}
}
private void CleanPlateUpLoad()
private void CleanPlateUpLoad()
@@ -2026,11 +2088,11 @@ namespace FryPot_DosingSystem.Control
//下发AGV去空桶线洗桶任务
//下发AGV去空桶线洗桶任务
e: string id = Guid.NewGuid().ToString("N");
e: string id = Guid.NewGuid().ToString("N");
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || id == LSevenrobotJobId || id == LEightrobotJobId || id == LNinerobotJobId || id == LTenrobotJobId )
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id)!=null || LEightrobotJobId.FirstOrDefault(p => p == id) != null || LNinerobotJobId.FirstOrDefault(p => p == id) != null || LTenrobotJobId.FirstOrDefault(p => p == id) != null )
goto e;
goto e;
string info = AGVHelper.GetInstance.AgvLeaveLOneToClean(id);//1号线到洗桶处
string info = AGVHelper.GetInstance.AgvLeaveLOneToClean(id);//1号线到洗桶处
LFourrobotJobId = id ;
LSevenrobotJobId.Add(id) ;
Thread.Sleep(500);
Thread.Sleep(500);
LineToCleanCarryTaskErrorCodeAnalysis(info, 1);
LineToCleanCarryTaskErrorCodeAnalysis(info, 1);
globalVar.rollerLineOne.IsEpmtyBefore = true;
globalVar.rollerLineOne.IsEpmtyBefore = true;
@@ -2053,11 +2115,11 @@ namespace FryPot_DosingSystem.Control
{
{
//下发AGV去空桶线洗桶任务
//下发AGV去空桶线洗桶任务
e: string id = Guid.NewGuid().ToString("N");
e: string id = Guid.NewGuid().ToString("N");
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || id == LSevenrobotJobId || id == LEightrobotJobId || id == LNinerobotJobId || id == LTenrobotJobId )
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id) != null || LEightrobotJobId.FirstOrDefault(p => p == id) != null || LNinerobotJobId.FirstOrDefault(p => p == id) != null || LTenrobotJobId.FirstOrDefault(p => p == id) != null )
goto e;
goto e;
string info = AGVHelper.GetInstance.AgvLeaveLTwoToClean(id);//2号线到洗桶处
string info = AGVHelper.GetInstance.AgvLeaveLTwoToClean(id);//2号线到洗桶处
LFiverobotJobId = id ;
LEightrobotJobId.Add(id) ;
Thread.Sleep(500);
Thread.Sleep(500);
LineToCleanCarryTaskErrorCodeAnalysis(info, 2);
LineToCleanCarryTaskErrorCodeAnalysis(info, 2);
globalVar.rollerLineTwo.IsEpmtyBefore = true;
globalVar.rollerLineTwo.IsEpmtyBefore = true;
@@ -2080,11 +2142,11 @@ namespace FryPot_DosingSystem.Control
{
{
//下发AGV去空桶线洗桶任务
//下发AGV去空桶线洗桶任务
e: string id = Guid.NewGuid().ToString("N");
e: string id = Guid.NewGuid().ToString("N");
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || id == LSevenrobotJobId || id == LEightrobotJobId || id == LNinerobotJobId || id == LTenrobotJobId )
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id) != null || LEightrobotJobId.FirstOrDefault(p => p == id) != null || LNinerobotJobId.FirstOrDefault(p => p == id) != null || LTenrobotJobId.FirstOrDefault(p => p == id) != null )
goto e;
goto e;
string info = AGVHelper.GetInstance.AgvLeaveLThreeToClean(id);//3号线到洗桶处
string info = AGVHelper.GetInstance.AgvLeaveLThreeToClean(id);//3号线到洗桶处
LSixrobotJobId = id ;
LNinerobotJobId.Add(id) ;
Thread.Sleep(500);
Thread.Sleep(500);
LineToCleanCarryTaskErrorCodeAnalysis(info, 3);
LineToCleanCarryTaskErrorCodeAnalysis(info, 3);
globalVar.rollerLineThree.IsEpmtyBefore = true;
globalVar.rollerLineThree.IsEpmtyBefore = true;
@@ -2100,24 +2162,39 @@ namespace FryPot_DosingSystem.Control
}
}
/// <summary>
/// <summary>
/// AGV到达清洗台下料位置
/// AGV从线体123 到达清洗台下料位置
/// </summary>
/// </summary>
private void AgvArriveCleanPlate()
private void AgvArriveCleanPlateFromLine ()
{
{
if (globalVar.agvArriveCleanUnLoad)
if (globalVar.rollerLineOne. agvArriveCleanUnLoad)
{
{
globalVar.agvArriveCleanUnLoad = false;
MessageLog.GetInstance.ShowRunLog("空桶到达清洗位置,准备卸桶");
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.No);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.qxt_hj);
AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes);
AgvViewModel.GetInstance().SetCleanRollerNum(++CleanNum);
globalVar.rollerLineOne.agvArriveCleanUnLoad = false;
MessageLog.GetInstance.ShowRunLog("空桶从线体1到达清洗位置,准备卸桶");
//plc交互
//plc交互
WritePlcData("D1065", 1);//AGV空桶洗桶就位信号下发PLC
WritePlcData("D1065", 1);//AGV空桶洗桶就位信号下发PLC
// MessageLog.GetInstance.ShowRunLog("卸桶完成");
// MessageLog.GetInstance.ShowRunLog("卸桶完成");
}
}
}
if (globalVar.rollerLineTwo.agvArriveCleanUnLoad)
{
globalVar.rollerLineTwo.agvArriveCleanUnLoad = false;
MessageLog.GetInstance.ShowRunLog("空桶从线体2到达清洗位置,准备卸桶");
//plc交互
WritePlcData("D1065", 1);//AGV空桶洗桶就位信号下发PLC
// MessageLog.GetInstance.ShowRunLog("卸桶完成");
}
if (globalVar.rollerLineThree.agvArriveCleanUnLoad)
{
globalVar.rollerLineThree.agvArriveCleanUnLoad = false;
MessageLog.GetInstance.ShowRunLog("空桶从线体3到达清洗位置,准备卸桶");
//plc交互
WritePlcData("D1065", 1);//AGV空桶洗桶就位信号下发PLC
// MessageLog.GetInstance.ShowRunLog("卸桶完成");
}
}
/// <summary>
/// <summary>
/// 呼叫Agv从清洗台运洗好的空桶到四号线体
/// 呼叫Agv从清洗台运洗好的空桶到四号线体
/// </summary>
/// </summary>
@@ -2128,11 +2205,11 @@ namespace FryPot_DosingSystem.Control
//是否需要手动给PLC置位??
//是否需要手动给PLC置位??
globalVar.CleanComplete = 0;
globalVar.CleanComplete = 0;
e: string id = Guid.NewGuid().ToString("N");
e: string id = Guid.NewGuid().ToString("N");
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || id == LSevenrobotJobId || id == LEightrobotJobId || id == LNinerobotJobId || id == LTenrobotJobId )
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id) != null || LEightrobotJobId.FirstOrDefault(p => p == id) != null || LNinerobotJobId.FirstOrDefault(p => p == id) != null || LTenrobotJobId.FirstOrDefault(p => p == id) != null )
goto e;
goto e;
string info = AGVHelper.GetInstance.AgvFromCleanToLineFourUnLoadRoller(id);
string info = AGVHelper.GetInstance.AgvFromCleanToLineFourUnLoadRoller(id);
LTenrobotJobId = id ;
LTenrobotJobId.Add(id) ;
Thread.Sleep(500);
Thread.Sleep(500);
MessageLog.GetInstance.ShowRunLog("清洗台呼叫AGV取桶");
MessageLog.GetInstance.ShowRunLog("清洗台呼叫AGV取桶");
CleanToLineCarryTaskErrorCodeAnalysis(info, 4);
CleanToLineCarryTaskErrorCodeAnalysis(info, 4);
@@ -2144,7 +2221,7 @@ namespace FryPot_DosingSystem.Control
/// <exception cref="NotImplementedException"></exception>
/// <exception cref="NotImplementedException"></exception>
private void LThreeRecipeDataToPlc()
private void LThreeRecipeDataToPlc()
{
{
if (LThreeOutputMaterialQuene.Count == 0 && LThreeInputMaterialQuene.Count == 0 && !LThreeErrorRecipe&&globalVar.rollerLineThree.RecipeCompleteSingle==1)
if (LThreeOutputMaterialQuene.Count == 0 && LThreeInputMaterialQuene.Count == 0 && !LThreeErrorRecipe && globalVar.rollerLineThree.RecipeCompleteSingle == 1)
{
{
globalVar.rollerLineThree.RecipeComMidSingle = 1;
globalVar.rollerLineThree.RecipeComMidSingle = 1;
if (globalVar.LThreeCurrentRecipeName != string.Empty)
if (globalVar.LThreeCurrentRecipeName != string.Empty)
@@ -2165,7 +2242,7 @@ namespace FryPot_DosingSystem.Control
Task.Run(() => { Thread.Sleep(1500); fryThreeRecipe = string.Empty; });
Task.Run(() => { Thread.Sleep(1500); fryThreeRecipe = string.Empty; });
}
}
}
}
if (LThreeRecipeQuene.Count > 0 && LThreeOutputMaterialQuene.Count == 0 && LThreeInputMaterialQuene.Count == 0&&globalVar.rollerLineThree.RecipeComMidSingle==1)//后续添加其它限制条件
if (LThreeRecipeQuene.Count > 0 && LThreeOutputMaterialQuene.Count == 0 && LThreeInputMaterialQuene.Count == 0 && globalVar.rollerLineThree.RecipeComMidSingle == 1)//后续添加其它限制条件
{
{
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_3.goodsName = string.Empty; }));
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>(); }));
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_3.workflows = new ObservableCollection<WorkflowModel>(); }));
@@ -2206,7 +2283,7 @@ namespace FryPot_DosingSystem.Control
}
}
}
}
DeviceOperate.GetInstance.WritePlcData("D1043", (ushort)result.materialCollection.Count);//发送3号滚筒线工序数据
DeviceOperate.GetInstance.WritePlcData("D1043", (ushort)result.materialCollection.Count);//发送3号滚筒线工序数据
globalVar.rollerLineThree.RecipeComMidSingle = 0;
globalVar.rollerLineThree.RecipeComMidSingle = 0;
}
}
}
}
@@ -2219,7 +2296,7 @@ namespace FryPot_DosingSystem.Control
/// <exception cref="NotImplementedException"></exception>
/// <exception cref="NotImplementedException"></exception>
private void LTwoRecipeDataToPlc()
private void LTwoRecipeDataToPlc()
{
{
if (LTwoOutputMaterialQuene.Count == 0 && LTwoInputMaterialQuene.Count == 0 && !LTwoErrorRecipe&&globalVar.rollerLineTwo.RecipeCompleteSingle == 1)
if (LTwoOutputMaterialQuene.Count == 0 && LTwoInputMaterialQuene.Count == 0 && !LTwoErrorRecipe && globalVar.rollerLineTwo.RecipeCompleteSingle == 1)
{
{
globalVar.rollerLineTwo.RecipeComMidSingle = 1;
globalVar.rollerLineTwo.RecipeComMidSingle = 1;
if (globalVar.LTwoCurrentRecipeName != string.Empty)
if (globalVar.LTwoCurrentRecipeName != string.Empty)
@@ -2252,7 +2329,7 @@ namespace FryPot_DosingSystem.Control
}
}
}
}
if (LTwoRecipeQuene.Count > 0 && LTwoOutputMaterialQuene.Count == 0 && LTwoInputMaterialQuene.Count == 0 && globalVar.rollerLineTwo.RecipeComMidSingle== 1)//后续添加其它限制条件
if (LTwoRecipeQuene.Count > 0 && LTwoOutputMaterialQuene.Count == 0 && LTwoInputMaterialQuene.Count == 0 && globalVar.rollerLineTwo.RecipeComMidSingle == 1)//后续添加其它限制条件
{
{
if (globalVar.LTwoFryPotSerial == 2)
if (globalVar.LTwoFryPotSerial == 2)
{
{
@@ -2281,7 +2358,7 @@ namespace FryPot_DosingSystem.Control
{
{
if (result.materialCollection[i].MaterialLoc % 100 == i + 1 && result.materialCollection[i].MaterialLoc / 100 == headNum && (headNum == 2 || headNum == 5))
if (result.materialCollection[i].MaterialLoc % 100 == i + 1 && result.materialCollection[i].MaterialLoc / 100 == headNum && (headNum == 2 || headNum == 5))
{
{
if (headNum == 1 )//炒锅2
if (headNum == 2 )//炒锅2
{
{
fryTwoRecipe = result.RecipeName;//炒锅状态开始记录
fryTwoRecipe = result.RecipeName;//炒锅状态开始记录
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_2.goodsName = result.RecipeName; }));
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_2.goodsName = result.RecipeName; }));
@@ -2322,7 +2399,7 @@ namespace FryPot_DosingSystem.Control
/// </summary>
/// </summary>
private void LOneRecipeDataToPlc()
private void LOneRecipeDataToPlc()
{
{
if (OutputMaterialQuene.Count == 0 && InputMaterialQuene.Count == 0 && !ErrorRecipe&&globalVar.rollerLineOne.RecipeCompleteSingle==1)
if (OutputMaterialQuene.Count == 0 && InputMaterialQuene.Count == 0 && !ErrorRecipe && globalVar.rollerLineOne.RecipeCompleteSingle == 1)
{
{
globalVar.rollerLineOne.RecipeComMidSingle = 1;
globalVar.rollerLineOne.RecipeComMidSingle = 1;
if (globalVar.LOneCurrentRecipeName != string.Empty)
if (globalVar.LOneCurrentRecipeName != string.Empty)
@@ -2354,7 +2431,7 @@ namespace FryPot_DosingSystem.Control
Task.Run(() => { Thread.Sleep(1500); fryOneRecipe = string.Empty; fryFourRecipe = string.Empty; });
Task.Run(() => { Thread.Sleep(1500); fryOneRecipe = string.Empty; fryFourRecipe = string.Empty; });
}
}
}
}
if (RecipeQuene.Count > 0 && OutputMaterialQuene.Count == 0 && InputMaterialQuene.Count == 0&&globalVar.rollerLineOne.RecipeComMidSingle==1)//后续添加其它限制条件
if (RecipeQuene.Count > 0 && OutputMaterialQuene.Count == 0 && InputMaterialQuene.Count == 0 && globalVar.rollerLineOne.RecipeComMidSingle == 1)//后续添加其它限制条件
{
{
if (globalVar.LOneFryPotSerial == 1)
if (globalVar.LOneFryPotSerial == 1)
{
{
@@ -2947,25 +3024,48 @@ namespace FryPot_DosingSystem.Control
}
}
}
}
/// <summary>
/// <summary>
/// 4号线体下料
/// 4号线体下料
/// </summary>
/// </summary>
public void EmptyRollerToLinFour()
public void EmptyRollerToLinFourFromClean ()
{
{
if (globalVar.agvArriveLineFour)//agv到达线体4下料位置
if (globalVar.agvArriveLineFour)//agv到达线体4下料位置
{
{
globalVar.agvArriveLineFour = false;
globalVar.agvArriveLineFour = false;
//线体四信号交互
//线体四信号交互
WritePlcData("D1067", 1);//AGV空桶回桶就位信号下发PLC
WritePlcData("D1067", 1);//AGV空桶回桶就位信号下发PLC
MessageLog.GetInstance.ShowRunLog("AGV到达【4】号回收线体,准备卸桶");
MessageLog.GetInstance.ShowRunLog("AGV从清洗台到达【4】号回收线体,准备卸桶");
// MessageLog.GetInstance.ShowRunLog("卸桶完成");
}
if (globalVar.rollerLineOne.agvArriveLineFour)//agv到达线体4下料位置
{
globalVar.rollerLineOne.agvArriveLineFour = false;
//线体四信号交互
WritePlcData("D1067", 1);//AGV空桶回桶就位信号下发PLC
MessageLog.GetInstance.ShowRunLog("AGV从1号线体对应炒锅到达【4】号回收线体,准备卸桶");
// MessageLog.GetInstance.ShowRunLog("卸桶完成");
}
if (globalVar.rollerLineTwo.agvArriveLineFour)//agv到达线体4下料位置
{
globalVar.rollerLineTwo.agvArriveLineFour = false;
//线体四信号交互
WritePlcData("D1067", 1);//AGV空桶回桶就位信号下发PLC
MessageLog.GetInstance.ShowRunLog("AGV从2号线体对应炒锅到达【4】号回收线体,准备卸桶");
// MessageLog.GetInstance.ShowRunLog("卸桶完成");
}
if (globalVar.rollerLineThree.agvArriveLineFour)//agv到达线体4下料位置
{
globalVar.rollerLineThree.agvArriveLineFour = false;
//线体四信号交互
WritePlcData("D1067", 1);//AGV空桶回桶就位信号下发PLC
MessageLog.GetInstance.ShowRunLog("AGV从3号炒锅到达【4】号回收线体,准备卸桶");
// MessageLog.GetInstance.ShowRunLog("卸桶完成");
// MessageLog.GetInstance.ShowRunLog("卸桶完成");
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);
}
}
}
}
///// <summary>
///// <summary>
///// 2号线体对应空桶清洗
///// 2号线体对应空桶清洗
///// </summary>
///// </summary>
@@ -3341,7 +3441,7 @@ namespace FryPot_DosingSystem.Control
{
{
case 1:
case 1:
erp: string id = Guid.NewGuid().ToString("N");//上游唯一ID
erp: string id = Guid.NewGuid().ToString("N");//上游唯一ID
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || id == LSevenrobotJobId || id == LEightrobotJobId || id == LNinerobotJobId || id == LTenrobotJobId )
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p=>p==id)!=null || LEightrobotJobId.FirstOrDefault(p => p == id) != null || LNinerobotJobId.FirstOrDefault(p => p == id) != null || LTenrobotJobId.FirstOrDefault(p => p == id) != null )
{
{
goto erp;
goto erp;
}
}
@@ -3351,7 +3451,7 @@ namespace FryPot_DosingSystem.Control
FryCarryTaskErrorCodeAnalysis(info, 1); break;
FryCarryTaskErrorCodeAnalysis(info, 1); break;
case 4:
case 4:
erp3: string id3 = Guid.NewGuid().ToString("N");//上游唯一ID
erp3: string id3 = Guid.NewGuid().ToString("N");//上游唯一ID
if (id3 == LOnerobotJobId || id3 == LTworobotJobId || id3 == LThreerobotJobId || id3 == LFourrobotJobId || id3 == LFiverobotJobId || id3 == LSixrobotJobId || id3 == LSevenrobotJobId || id3 == LEightrobotJobId || id3 == LNinerobotJobId || id3 == LTenrobotJobId )
if (id3 == LOnerobotJobId || id3 == LTworobotJobId || id3 == LThreerobotJobId || id3 == LFourrobotJobId || id3 == LFiverobotJobId || id3 == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id3) != null || LEightrobotJobId.FirstOrDefault(p => p == id3) != null || LNinerobotJobId.FirstOrDefault(p => p == id3) != null || LTenrobotJobId.FirstOrDefault(p => p == id3) != null )
{
{
goto erp3;
goto erp3;
}
}
@@ -3370,7 +3470,7 @@ namespace FryPot_DosingSystem.Control
{
{
case 2:
case 2:
erp1: string id1 = Guid.NewGuid().ToString("N");//上游唯一ID
erp1: string id1 = Guid.NewGuid().ToString("N");//上游唯一ID
if (id1 == LOnerobotJobId || id1 == LTworobotJobId || id1 == LThreerobotJobId || id1 == LFourrobotJobId || id1 == LFiverobotJobId || id1 == LSixrobotJobId || id1 == LSevenrobotJobId || id1 == LEightrobotJobId || id1 == LNinerobotJobId || id1 == LTenrobotJobId )
if (id1 == LOnerobotJobId || id1 == LTworobotJobId || id1 == LThreerobotJobId || id1 == LFourrobotJobId || id1 == LFiverobotJobId || id1 == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id1) != null || LEightrobotJobId.FirstOrDefault(p => p == id1) != null || LNinerobotJobId.FirstOrDefault(p => p == id1) != null || LTenrobotJobId.FirstOrDefault(p => p == id1) != null )
{
{
goto erp1;
goto erp1;
}
}
@@ -3380,7 +3480,7 @@ namespace FryPot_DosingSystem.Control
FryCarryTaskErrorCodeAnalysis(info1, 2); break;
FryCarryTaskErrorCodeAnalysis(info1, 2); break;
case 5:
case 5:
erp4: string id4 = Guid.NewGuid().ToString("N");//上游唯一ID
erp4: string id4 = Guid.NewGuid().ToString("N");//上游唯一ID
if (id4 == LOnerobotJobId || id4 == LTworobotJobId || id4 == LThreerobotJobId || id4 == LFourrobotJobId || id4 == LFiverobotJobId || id4 == LSixrobotJobId || id4 == LSevenrobotJobId || id4 == LEightrobotJobId || id4 == LNinerobotJobId || id4 == LTenrobotJobId )
if (id4 == LOnerobotJobId || id4 == LTworobotJobId || id4 == LThreerobotJobId || id4 == LFourrobotJobId || id4 == LFiverobotJobId || id4 == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id4) != null || LEightrobotJobId.FirstOrDefault(p => p == id4) != null || LNinerobotJobId.FirstOrDefault(p => p == id4) != null || LTenrobotJobId.FirstOrDefault(p => p == id4) != null )
{
{
goto erp4;
goto erp4;
}
}
@@ -3396,7 +3496,7 @@ namespace FryPot_DosingSystem.Control
public void AgvFromFryPotThreeToClean()
public void AgvFromFryPotThreeToClean()
{
{
erp2: string id2 = Guid.NewGuid().ToString("N");//上游唯一ID
erp2: string id2 = Guid.NewGuid().ToString("N");//上游唯一ID
if (id2 == LOnerobotJobId || id2 == LTworobotJobId || id2 == LThreerobotJobId || id2 == LFourrobotJobId || id2 == LFiverobotJobId || id2 == LSixrobotJobId || id2 == LSevenrobotJobId || id2 == LEightrobotJobId || id2 == LNinerobotJobId || id2 == LTenrobotJobId )
if (id2 == LOnerobotJobId || id2 == LTworobotJobId || id2 == LThreerobotJobId || id2 == LFourrobotJobId || id2 == LFiverobotJobId || id2 == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id2) != null || LEightrobotJobId.FirstOrDefault(p => p == id2) != null || LNinerobotJobId.FirstOrDefault(p => p == id2) != null || LTenrobotJobId.FirstOrDefault(p => p == id2) != null )
{
{
goto erp2;
goto erp2;
}
}
@@ -3466,7 +3566,7 @@ namespace FryPot_DosingSystem.Control
globalVar.rollerLineOne.EmptyRollerNums.RemoveAt(0);
globalVar.rollerLineOne.EmptyRollerNums.RemoveAt(0);
globalVar.agvArriveLineOneLoadCom = false;
globalVar.agvArriveLineOneLoadCom = false;
globalVar.rollerLineOne.IsEpmtyBefore = false;
globalVar.rollerLineOne.IsEpmtyBefore = false;
MessageLog.GetInstance.ShowRunLog($"AGV在【1】号线体完成{emptyRollerNum}号空料桶装载");
MessageLog.GetInstance.ShowRunLog($"AGV在【1】号线体完成【 {emptyRollerNum}】 号空料桶装载");
}
}
}
}
else//有故障
else//有故障
@@ -3745,7 +3845,7 @@ namespace FryPot_DosingSystem.Control
{
{
globalVar.rollerLineOne.CanRun = false;
globalVar.rollerLineOne.CanRun = false;
e: string id = Guid.NewGuid().ToString("N");
e: string id = Guid.NewGuid().ToString("N");
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || id == LSevenrobotJobId || id == LEightrobotJobId || id == LNinerobotJobId || id == LTenrobotJobId )
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id) != null || LEightrobotJobId.FirstOrDefault(p => p == id) != null || LNinerobotJobId.FirstOrDefault(p => p == id) != null || LTenrobotJobId.FirstOrDefault(p => p == id) != null )
goto e;
goto e;
string info = AGVHelper.GetInstance.AgvToLineOneLoadRoller(id);
string info = AGVHelper.GetInstance.AgvToLineOneLoadRoller(id);
@@ -3803,7 +3903,7 @@ namespace FryPot_DosingSystem.Control
{
{
globalVar.rollerLineTwo.CanRun = false;
globalVar.rollerLineTwo.CanRun = false;
e: string id = Guid.NewGuid().ToString("N");
e: string id = Guid.NewGuid().ToString("N");
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || id == LSevenrobotJobId || id == LEightrobotJobId || id == LNinerobotJobId || id == LTenrobotJobId )
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id) != null || LEightrobotJobId.FirstOrDefault(p => p == id) != null || LNinerobotJobId.FirstOrDefault(p => p == id) != null || LTenrobotJobId.FirstOrDefault(p => p == id) != null )
goto e;
goto e;
string info = AGVHelper.GetInstance.AgvToLineTwoLoadRoller(id);
string info = AGVHelper.GetInstance.AgvToLineTwoLoadRoller(id);
@@ -3854,7 +3954,7 @@ namespace FryPot_DosingSystem.Control
{
{
globalVar.rollerLineThree.CanRun = false;
globalVar.rollerLineThree.CanRun = false;
e: string id = Guid.NewGuid().ToString("N");
e: string id = Guid.NewGuid().ToString("N");
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || id == LSevenrobotJobId || id == LEightrobotJobId || id == LNinerobotJobId || id == LTenrobotJobId )
if (id == LOnerobotJobId || id == LTworobotJobId || id == LThreerobotJobId || id == LFourrobotJobId || id == LFiverobotJobId || id == LSixrobotJobId || LSevenrobotJobId.FirstOrDefault(p => p == id) != null || LEightrobotJobId.FirstOrDefault(p => p == id) != null || LNinerobotJobId.FirstOrDefault(p => p == id) != null || LTenrobotJobId.FirstOrDefault(p => p == id) != null )
goto e;
goto e;
string info = AGVHelper.GetInstance.AgvToLineThreeLoadRoller(id);
string info = AGVHelper.GetInstance.AgvToLineThreeLoadRoller(id);