diff --git a/FryPot_DosingSystem/AGV/WhichCart.cs b/FryPot_DosingSystem/AGV/WhichCart.cs index b3c6a33e..e1c5d6dc 100644 --- a/FryPot_DosingSystem/AGV/WhichCart.cs +++ b/FryPot_DosingSystem/AGV/WhichCart.cs @@ -51,6 +51,14 @@ namespace FryPot_DosingSystem.AGV hs_4,//4号炒锅-运输空碗到-空碗流水线 hs_5,//5号炒锅-运输空碗到-空碗流水线 + tqx_1, + tqx_2, + tqx_3, + + qxt_4, + jtqx, + + qxt_hj, hj,//空碗流水线-回到充电桩或者停车桩 } diff --git a/FryPot_DosingSystem/Control/DosingLogicControl.cs b/FryPot_DosingSystem/Control/DosingLogicControl.cs index be36d8dc..4078b7f4 100644 --- a/FryPot_DosingSystem/Control/DosingLogicControl.cs +++ b/FryPot_DosingSystem/Control/DosingLogicControl.cs @@ -146,6 +146,8 @@ namespace FryPot_DosingSystem.Control string LNinerobotJobId = string.Empty; //从线体3到清洗台路径 string LTenrobotJobId = string.Empty; //从清洗台到线体4路径 + public int CleanNum = 0;//当前清洗台桶数 + #endregion /// /// 调试命令注册 @@ -383,7 +385,7 @@ namespace FryPot_DosingSystem.Control private void FileRegClean() { int days = 5; //清除期限 - string[] filesOne = Directory.GetFiles("AccessFile//DB//炒锅1状态数据"); + string[] filesOne = Directory.GetDirectories("AccessFile//DB//炒锅1状态数据"); if (filesOne.Count() > 0) { foreach (var item in filesOne) @@ -397,7 +399,7 @@ namespace FryPot_DosingSystem.Control } } } - string[] filesTwo = Directory.GetFiles("AccessFile//DB//炒锅2状态数据"); + string[] filesTwo = Directory.GetDirectories("AccessFile//DB//炒锅2状态数据"); if (filesTwo.Count() > 0) { foreach (var item in filesTwo) @@ -411,7 +413,7 @@ namespace FryPot_DosingSystem.Control } } } - string[] filesThree = Directory.GetFiles("AccessFile//DB//炒锅3状态数据"); + string[] filesThree = Directory.GetDirectories("AccessFile//DB//炒锅3状态数据"); if (filesThree.Count() > 0) { foreach (var item in filesThree) @@ -425,7 +427,7 @@ namespace FryPot_DosingSystem.Control } } } - string[] filesFour = Directory.GetFiles("AccessFile//DB//炒锅4状态数据"); + string[] filesFour = Directory.GetDirectories("AccessFile//DB//炒锅4状态数据"); if (filesFour.Count() > 0) { foreach (var item in filesFour) @@ -744,11 +746,11 @@ namespace FryPot_DosingSystem.Control if (objData.robotJobId == LTenrobotJobId && objData.command == "LOAD") { - globalVar.agvArriveCleanLoad = true;//agv到达清洗台下料位置 + globalVar.agvArriveCleanLoad = true;//agv到达清洗台上料位置 } if (objData.robotJobId == LTenrobotJobId && objData.command == "UNLOAD") { - globalVar.agvArriveLineFour = true;//agv到达清洗台下料位置 + globalVar.agvArriveLineFour = true;//agv到达线体4下料位置 } } @@ -846,6 +848,7 @@ namespace FryPot_DosingSystem.Control globalVar.agvArriveLineOneLoadCom = true; AgvViewModel.GetInstance().Set滚筒线上数量(1, (globalVar.LOneMaterialNum - 1).ToString()); AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.OnllYes); + AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.tqx_1); //到清洗处 } //线体2任务上报 @@ -854,7 +857,7 @@ namespace FryPot_DosingSystem.Control globalVar.agvArriveLineTwoLoadCom = true; AgvViewModel.GetInstance().Set滚筒线上数量(2, (globalVar.LTwoMaterialNum - 1).ToString()); AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.OnllYes); - + AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.tqx_2); //到清洗处 } @@ -864,6 +867,7 @@ namespace FryPot_DosingSystem.Control globalVar.agvArriveLineThreeLoadCom = true; AgvViewModel.GetInstance().Set滚筒线上数量(3, (globalVar.LThreeMaterialNum - 1).ToString()); AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.OnllYes); + AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.tqx_3); //到清洗处 } @@ -1941,10 +1945,10 @@ namespace FryPot_DosingSystem.Control } private void LineFourProcessExecute() { - // + //线体123到清洗台 AgvFromLineToCleanPlate(); AgvArriveCleanPlate(); - + //清洗台到线体4 CallAgvToLineFour(); CleanPlateUpLoad(); EmptyRollerToLinFour(); @@ -1955,7 +1959,11 @@ namespace FryPot_DosingSystem.Control if (globalVar.agvArriveCleanLoad) { globalVar.agvArriveCleanLoad = false; + MessageLog.GetInstance.ShowRunLog("AGV到达清洗台空桶上料位置"); MessageLog.GetInstance.ShowRunLog("清洗台空桶装载完成"); + AgvViewModel.GetInstance().SetCleanRollerNum(--CleanNum); + AgvViewModel.GetInstance().Set小车是否承载物品(4,IsBool.OnllYes); + AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.qxt_4); } } @@ -2047,7 +2055,7 @@ namespace FryPot_DosingSystem.Control } } } - + /// /// AGV到达清洗台下料位置 /// @@ -2058,6 +2066,10 @@ namespace FryPot_DosingSystem.Control globalVar.agvArriveCleanUnLoad = false; MessageLog.GetInstance.ShowRunLog("空桶到达清洗位置,准备卸桶"); 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); //plc交互 } } @@ -2893,6 +2905,11 @@ namespace FryPot_DosingSystem.Control //线体四信号交互 MessageLog.GetInstance.ShowRunLog("AGV到达【4】号回收线体,准备卸桶"); 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); } } ///// @@ -3607,8 +3624,8 @@ namespace FryPot_DosingSystem.Control if (errorCode == "SUCCESS") { AgvViewModel.GetInstance().Set停车桩(num, IsBool.No); - AgvViewModel.GetInstance().Set小车是否承载物品(num, IsBool.No); - AgvViewModel.GetInstance().Set小车运动(num, AgvViewModel.GetInstance().GetCommandValue($"qc_{num}")); + AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.No); + AgvViewModel.GetInstance().Set小车运动(4, AgvViewModel.GetInstance().GetCommandValue($"tqx_{num}")); MessageLog.GetInstance.ShowRunLog($"AGV去{num}号滚筒线装桶"); } else if (errorCode == "Analysis Error") @@ -3631,7 +3648,7 @@ namespace FryPot_DosingSystem.Control { AgvViewModel.GetInstance().Set停车桩(num, IsBool.No); AgvViewModel.GetInstance().Set小车是否承载物品(num, IsBool.No); - AgvViewModel.GetInstance().Set小车运动(num, AgvViewModel.GetInstance().GetCommandValue($"qc_{num}")); + AgvViewModel.GetInstance().Set小车运动(num, CartMotionTrajectory.jtqx); MessageLog.GetInstance.ShowRunLog($"AGV去{num}号滚筒线卸桶"); } else if (errorCode == "Analysis Error") diff --git a/FryPot_DosingSystem/FryPot_DosingSystem.csproj b/FryPot_DosingSystem/FryPot_DosingSystem.csproj index b2fd326a..13520670 100644 --- a/FryPot_DosingSystem/FryPot_DosingSystem.csproj +++ b/FryPot_DosingSystem/FryPot_DosingSystem.csproj @@ -12,6 +12,7 @@ + @@ -35,6 +36,7 @@ + diff --git a/FryPot_DosingSystem/View/AgvView.xaml b/FryPot_DosingSystem/View/AgvView.xaml index 5c6b5f23..a095e82c 100644 --- a/FryPot_DosingSystem/View/AgvView.xaml +++ b/FryPot_DosingSystem/View/AgvView.xaml @@ -566,6 +566,7 @@ + - + @@ -1294,12 +1385,13 @@ - + 滚筒炒锅 1 + @@ -1322,13 +1414,17 @@ - + + + + + @@ -1610,9 +1706,66 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 空桶清洗台 + diff --git a/FryPot_DosingSystem/View/AgvView.xaml.cs b/FryPot_DosingSystem/View/AgvView.xaml.cs index 7887fc7b..25342b6a 100644 --- a/FryPot_DosingSystem/View/AgvView.xaml.cs +++ b/FryPot_DosingSystem/View/AgvView.xaml.cs @@ -187,7 +187,9 @@ namespace FryPot_DosingSystem.View } AgvViewModel.GetInstance().Set启动或停止炒锅(id, IsRun.Stop); break; - + case "清洗桶数": + AgvViewModel.GetInstance().SetCleanRollerNum(2); + break; } } } diff --git a/FryPot_DosingSystem/ViewModel/AgvViewModel.cs b/FryPot_DosingSystem/ViewModel/AgvViewModel.cs index fd7cabdf..f928b1a5 100644 --- a/FryPot_DosingSystem/ViewModel/AgvViewModel.cs +++ b/FryPot_DosingSystem/ViewModel/AgvViewModel.cs @@ -19,6 +19,9 @@ namespace FryPot_DosingSystem.ViewModel #region 单例模式 private volatile static AgvViewModel _Instance; public static AgvViewModel GetInstance() => _Instance ?? (_Instance = new AgvViewModel()); + + public int RollerNum { get { return _rollerNum; } set { _rollerNum = value;OnPropertyChanged(); } } + private int _rollerNum; public AgvViewModel() { Init(); @@ -67,6 +70,10 @@ namespace FryPot_DosingSystem.ViewModel new WorkflowModel {id=1,Name="取番茄",isBool= IsBool.Yes}, new WorkflowModel {id=2,Name="取蛋" } }; } + public void SetCleanRollerNum(int num) + { + RollerNum = num; + } /// /// 设置停车桩或充电桩 ///