pry 2 years ago
parent
commit
8365f13b79
9 changed files with 165 additions and 48 deletions
  1. +11
    -8
      BPASmartClient.CustomResource/Pages/Model/AlarmInfo.cs
  2. +1
    -1
      FryPot_DosingSystem/App.xaml.cs
  3. +84
    -21
      FryPot_DosingSystem/Control/DosingLogicControl.cs
  4. +17
    -4
      FryPot_DosingSystem/Control/GlobalVariable.cs
  5. +12
    -3
      FryPot_DosingSystem/View/DebugView.xaml
  6. +1
    -1
      FryPot_DosingSystem/View/MainWindow.xaml.cs
  7. +31
    -5
      FryPot_DosingSystem/ViewModel/DebugViewModel.cs
  8. +5
    -1
      FryPot_DosingSystem/ViewModel/FlowProcessSetViewModel.cs
  9. +3
    -4
      TestDemo/Form1.cs

+ 11
- 8
BPASmartClient.CustomResource/Pages/Model/AlarmInfo.cs View File

@@ -12,45 +12,48 @@ namespace BPASmartClient.CustomResource.Pages.Model
{ {


} }
/// <summary> /// <summary>
/// 1 号滚筒线故障 /// 1 号滚筒线故障
/// </summary> /// </summary>
[Alarm("【1】号滚筒线运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)]
[Alarm("【1】号滚筒线运行故障", AlarmTriggerType.Rising, AlarmLevel.严重报警)]
public ushort LOneRollerTrouble { get; set; } public ushort LOneRollerTrouble { get; set; }
/// <summary> /// <summary>
/// 2 号滚筒线故障 /// 2 号滚筒线故障
/// </summary> /// </summary>
[Alarm("【2】号滚筒线运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)]
[Alarm("【2】号滚筒线运行故障", AlarmTriggerType.Rising, AlarmLevel.严重报警)]
public ushort LTwoRollerTrouble { get; set; } public ushort LTwoRollerTrouble { get; set; }
/// <summary> /// <summary>
/// 3 号滚筒线故障 /// 3 号滚筒线故障
/// </summary> /// </summary>
[Alarm("【3】号滚筒线运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)]
[Alarm("【3】号滚筒线运行故障", AlarmTriggerType.Rising, AlarmLevel.严重报警)]
public ushort LThreeRollerTrouble { get; set; } public ushort LThreeRollerTrouble { get; set; }
/// <summary> /// <summary>
/// 1 号炒锅滚筒运行故障 /// 1 号炒锅滚筒运行故障
/// </summary> /// </summary>
[Alarm("【1】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)]
[Alarm("【1】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.严重报警)]
public ushort FryPotOneRollerTrouble { get; set; } public ushort FryPotOneRollerTrouble { get; set; }
/// <summary> /// <summary>
/// 2 号炒锅滚筒运行故障 /// 2 号炒锅滚筒运行故障
/// </summary> /// </summary>
[Alarm("【2】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)]
[Alarm("【2】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.严重报警)]
public ushort FryPotTwoRollerTrouble { get; set; } public ushort FryPotTwoRollerTrouble { get; set; }
/// <summary> /// <summary>
/// 3 号炒锅滚筒运行故障 /// 3 号炒锅滚筒运行故障
/// </summary> /// </summary>
[Alarm("【3】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)]
[Alarm("【3】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.严重报警)]
public ushort FryPotThreeRollerTrouble { get; set; } public ushort FryPotThreeRollerTrouble { get; set; }
/// <summary> /// <summary>
/// 4 号炒锅滚筒运行故障 /// 4 号炒锅滚筒运行故障
/// </summary> /// </summary>
[Alarm("【4】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)]
[Alarm("【4】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.严重报警)]
public ushort FryPotFourRollerTrouble { get; set; } public ushort FryPotFourRollerTrouble { get; set; }
/// <summary> /// <summary>
/// 5 号炒锅滚筒运行故障 /// 5 号炒锅滚筒运行故障
/// </summary> /// </summary>
[Alarm("【5】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.一般报警)]
[Alarm("【5】号炒锅滚筒运行故障", AlarmTriggerType.Rising, AlarmLevel.严重报警)]
public ushort FryPotFiveRollerTrouble { get; set; } public ushort FryPotFiveRollerTrouble { get; set; }

} }
} }

+ 1
- 1
FryPot_DosingSystem/App.xaml.cs View File

@@ -39,7 +39,7 @@ namespace FryPot_DosingSystem
mv.Show(); mv.Show();
DeviceOperate deviceOperate = DeviceOperate.GetInstance;//开启实时PLC数据读取 DeviceOperate deviceOperate = DeviceOperate.GetInstance;//开启实时PLC数据读取
DosingLogicControl logigControl = DosingLogicControl.GetInstance;//开启逻辑控制任务程序 DosingLogicControl logigControl = DosingLogicControl.GetInstance;//开启逻辑控制任务程序
HubHelper.GetInstance.Connect("192.168.1.14", 8089);
HubHelper.GetInstance.Connect("192.168.1.40", 8089);
AlarmHelper<AlarmInfo>.Init(); AlarmHelper<AlarmInfo>.Init();
} }
else else


+ 84
- 21
FryPot_DosingSystem/Control/DosingLogicControl.cs View File

@@ -217,6 +217,39 @@ namespace FryPot_DosingSystem.Control
MessageLog.GetInstance.ShowRunLog($"提示:AGV任务下发失败,错误码:{errorCode}"); MessageLog.GetInstance.ShowRunLog($"提示:AGV任务下发失败,错误码:{errorCode}");
} }
}), "AgvDebug"); }), "AgvDebug");

ActionManage.GetInstance.Register(() =>
{
MessageLog.GetInstance.ShowRunLog("清洗台卸桶完成");

}, "AgvArriveCleanPlateLocCom");

ActionManage.GetInstance.Register(() =>
{
MessageLog.GetInstance.ShowRunLog("4号线卸桶完成");

}, "AgvArriveLineFourLocCom");
ActionManage.GetInstance.Register(() =>
{
MessageLog.GetInstance.ShowRunLog("清洗台空桶装载完成");

}, "AgvArriveCleanPlateLocLoadCom");

ActionManage.GetInstance.Register(() =>
{
globalVar.rollerLineOne.RecipeCompleteSingle = 1;
}, "LineOneRecipeComSignal");
ActionManage.GetInstance.Register(() =>
{
globalVar.rollerLineTwo.RecipeCompleteSingle = 1;

}, "LineTwoRecipeComSignal");
ActionManage.GetInstance.Register(() =>
{
globalVar.rollerLineThree.RecipeCompleteSingle = 1;

}, "LineThreeRecipeComSignal");
ActionManage.GetInstance.Register(new Action(() => ActionManage.GetInstance.Register(new Action(() =>
{ {
globalVar.agvArriveLineOneLoadCom = true; globalVar.agvArriveLineOneLoadCom = true;
@@ -641,7 +674,6 @@ 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请求上料
@@ -1027,24 +1059,28 @@ namespace FryPot_DosingSystem.Control


if (objData.state == "DONE" && objData.robotJobId == LSevenrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指从线体1到清戏台空桶下料 if (objData.state == "DONE" && objData.robotJobId == LSevenrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指从线体1到清戏台空桶下料
{ {
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" && objData.robotJobId == LEightrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指从线体2到清戏台空桶下料
{ {
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" && objData.robotJobId == LNinerobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指从线体3到清戏台空桶下料
{ {
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" && objData.robotJobId == LTenrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料位置上料完成,指清戏台空桶到上料
{ {
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);//去四号空桶线


@@ -1065,6 +1101,7 @@ namespace FryPot_DosingSystem.Control


if (objData.state == "DONE" && objData.robotJobId == LTenrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指清戏台空桶到线体4下料 if (objData.state == "DONE" && objData.robotJobId == LTenrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定下料位置下料完成,指清戏台空桶到线体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);
AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes); AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes);
@@ -1355,6 +1392,11 @@ namespace FryPot_DosingSystem.Control


globalVar.CleadBarrelEnterSingle = data[0]; globalVar.CleadBarrelEnterSingle = data[0];
})); }));
GetAddressData("2076", new Action<ushort[]>(data =>
{
globalVar.CleanComplete = data[0];//洗桶出桶agv呼叫信号

}));
GetAddressData("D2077", new Action<ushort[]>(data => GetAddressData("D2077", new Action<ushort[]>(data =>
{ {


@@ -1959,10 +2001,11 @@ namespace FryPot_DosingSystem.Control
if (globalVar.agvArriveCleanLoad) if (globalVar.agvArriveCleanLoad)
{ {
globalVar.agvArriveCleanLoad = false; globalVar.agvArriveCleanLoad = false;
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().SetCleanRollerNum(--CleanNum);
AgvViewModel.GetInstance().Set小车是否承载物品(4,IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.OnllYes);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.qxt_4); AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.qxt_4);
} }
} }
@@ -2055,7 +2098,7 @@ namespace FryPot_DosingSystem.Control
} }
} }
} }
/// <summary> /// <summary>
/// AGV到达清洗台下料位置 /// AGV到达清洗台下料位置
/// </summary> /// </summary>
@@ -2065,12 +2108,13 @@ namespace FryPot_DosingSystem.Control
{ {
globalVar.agvArriveCleanUnLoad = false; globalVar.agvArriveCleanUnLoad = false;
MessageLog.GetInstance.ShowRunLog("空桶到达清洗位置,准备卸桶"); MessageLog.GetInstance.ShowRunLog("空桶到达清洗位置,准备卸桶");
MessageLog.GetInstance.ShowRunLog("卸桶完成");
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.No); AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.No);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.qxt_hj); AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.qxt_hj);
AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes); AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes);
AgvViewModel.GetInstance().SetCleanRollerNum(++CleanNum); AgvViewModel.GetInstance().SetCleanRollerNum(++CleanNum);
//plc交互 //plc交互
WritePlcData("D1065", 1);//AGV空桶洗桶就位信号下发PLC
// MessageLog.GetInstance.ShowRunLog("卸桶完成");
} }
} }


@@ -2100,8 +2144,9 @@ 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)
if (LThreeOutputMaterialQuene.Count == 0 && LThreeInputMaterialQuene.Count == 0 && !LThreeErrorRecipe&&globalVar.rollerLineThree.RecipeCompleteSingle==1)
{ {
globalVar.rollerLineThree.RecipeComMidSingle = 1;
if (globalVar.LThreeCurrentRecipeName != string.Empty) if (globalVar.LThreeCurrentRecipeName != string.Empty)
{ {
MessageLog.GetInstance.ShowUserLog($"【3】号滚筒线【{globalVar.LThreeCurrentRecipeName}】 配方制作完成"); MessageLog.GetInstance.ShowUserLog($"【3】号滚筒线【{globalVar.LThreeCurrentRecipeName}】 配方制作完成");
@@ -2120,7 +2165,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)//后续添加其它限制条件
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>(); }));
@@ -2161,7 +2206,7 @@ namespace FryPot_DosingSystem.Control
} }
} }
DeviceOperate.GetInstance.WritePlcData("D1043", (ushort)result.materialCollection.Count);//发送3号滚筒线工序数据 DeviceOperate.GetInstance.WritePlcData("D1043", (ushort)result.materialCollection.Count);//发送3号滚筒线工序数据
//AgvViewModel.GetInstance().Set启动或停止炒锅(globalVar.LThreeFryPotSerial, IsRun.Stop);
globalVar.rollerLineThree.RecipeComMidSingle = 0;
} }
} }


@@ -2174,8 +2219,9 @@ 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)
if (LTwoOutputMaterialQuene.Count == 0 && LTwoInputMaterialQuene.Count == 0 && !LTwoErrorRecipe&&globalVar.rollerLineTwo.RecipeCompleteSingle == 1)
{ {
globalVar.rollerLineTwo.RecipeComMidSingle = 1;
if (globalVar.LTwoCurrentRecipeName != string.Empty) if (globalVar.LTwoCurrentRecipeName != string.Empty)
{ {
MessageLog.GetInstance.ShowUserLog($"【2】号滚筒线【{globalVar.LTwoCurrentRecipeName}】 配方制作完成"); MessageLog.GetInstance.ShowUserLog($"【2】号滚筒线【{globalVar.LTwoCurrentRecipeName}】 配方制作完成");
@@ -2206,7 +2252,7 @@ namespace FryPot_DosingSystem.Control
} }
} }


if (LTwoRecipeQuene.Count > 0 && LTwoOutputMaterialQuene.Count == 0 && LTwoInputMaterialQuene.Count == 0)//后续添加其它限制条件
if (LTwoRecipeQuene.Count > 0 && LTwoOutputMaterialQuene.Count == 0 && LTwoInputMaterialQuene.Count == 0 && globalVar.rollerLineTwo.RecipeComMidSingle== 1)//后续添加其它限制条件
{ {
if (globalVar.LTwoFryPotSerial == 2) if (globalVar.LTwoFryPotSerial == 2)
{ {
@@ -2263,7 +2309,7 @@ namespace FryPot_DosingSystem.Control
} }
} }
DeviceOperate.GetInstance.WritePlcData("D1026", (ushort)result.materialCollection.Count);//发送2号滚筒线工序数据 DeviceOperate.GetInstance.WritePlcData("D1026", (ushort)result.materialCollection.Count);//发送2号滚筒线工序数据
globalVar.rollerLineTwo.RecipeComMidSingle = 0;
} }
} }


@@ -2276,8 +2322,9 @@ namespace FryPot_DosingSystem.Control
/// </summary> /// </summary>
private void LOneRecipeDataToPlc() private void LOneRecipeDataToPlc()
{ {
if (OutputMaterialQuene.Count == 0 && InputMaterialQuene.Count == 0 && !ErrorRecipe)
if (OutputMaterialQuene.Count == 0 && InputMaterialQuene.Count == 0 && !ErrorRecipe&&globalVar.rollerLineOne.RecipeCompleteSingle==1)
{ {
globalVar.rollerLineOne.RecipeComMidSingle = 1;
if (globalVar.LOneCurrentRecipeName != string.Empty) if (globalVar.LOneCurrentRecipeName != string.Empty)
{ {
MessageLog.GetInstance.ShowUserLog($"【1】号滚筒线【{globalVar.LOneCurrentRecipeName}】 配方制作完成"); MessageLog.GetInstance.ShowUserLog($"【1】号滚筒线【{globalVar.LOneCurrentRecipeName}】 配方制作完成");
@@ -2307,7 +2354,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)//后续添加其它限制条件
if (RecipeQuene.Count > 0 && OutputMaterialQuene.Count == 0 && InputMaterialQuene.Count == 0&&globalVar.rollerLineOne.RecipeComMidSingle==1)//后续添加其它限制条件
{ {
if (globalVar.LOneFryPotSerial == 1) if (globalVar.LOneFryPotSerial == 1)
{ {
@@ -2362,7 +2409,7 @@ namespace FryPot_DosingSystem.Control
} }
} }
DeviceOperate.GetInstance.WritePlcData("D1009", (ushort)result.materialCollection.Count);//发送1号滚筒线工序数据 DeviceOperate.GetInstance.WritePlcData("D1009", (ushort)result.materialCollection.Count);//发送1号滚筒线工序数据
globalVar.rollerLineOne.RecipeComMidSingle = 0;//配方完成的中转信号置0
} }
} }


@@ -2569,11 +2616,13 @@ namespace FryPot_DosingSystem.Control
AgvArriveFryPotOneOrFourSingleSetDown(); AgvArriveFryPotOneOrFourSingleSetDown();
globalVar.agvArriveUnLoad = false; globalVar.agvArriveUnLoad = false;
globalVar.PotOneInputMaterialArrive = true; globalVar.PotOneInputMaterialArrive = true;
FryPotOneRollerTroubleCheck();
} }
} }


public void LOneFallMaterial() public void LOneFallMaterial()
{ {

if (!globalVar.InOrOutputLock && (globalVar.fryPotOne.InputMaterialArrivedSingle == 1 || globalVar.fryPotFour.InputMaterialArrivedSingle == 1) && globalVar.PotOneInputMaterialArrive && OutputMaterialQuene.Count > 0 && !globalVar.PotOneOutputRollerArrive) if (!globalVar.InOrOutputLock && (globalVar.fryPotOne.InputMaterialArrivedSingle == 1 || globalVar.fryPotFour.InputMaterialArrivedSingle == 1) && globalVar.PotOneInputMaterialArrive && OutputMaterialQuene.Count > 0 && !globalVar.PotOneOutputRollerArrive)
{ {
//if (globalVar.LOneFryPotSerial == 1) //if (globalVar.LOneFryPotSerial == 1)
@@ -2586,7 +2635,7 @@ namespace FryPot_DosingSystem.Control
// Sqlite<PotFourStatus>.GetInstance.Base.Add(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, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 // Sqlite<PotFourStatus>.GetInstance.Base.Add(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, Time = DateTime.Now.ToShortDateString() });//向表中新增数据
// Sqlite<PotFourStatus>.GetInstance.Save();//保存数据 // Sqlite<PotFourStatus>.GetInstance.Save();//保存数据
//} //}
FryPotOneRollerTroubleCheck();
//FryPotOneRollerTroubleCheck();
if (FryPotAlarm == 1 || FryPotFourAlarm == 1)//炒锅滚筒无故障 if (FryPotAlarm == 1 || FryPotFourAlarm == 1)//炒锅滚筒无故障
{ {
if (globalVar.LOneFryPotSerial == 1) if (globalVar.LOneFryPotSerial == 1)
@@ -2607,6 +2656,7 @@ namespace FryPot_DosingSystem.Control
globalVar.PotOneOutputRollerArrive = true; globalVar.PotOneOutputRollerArrive = true;
} }
} }

} }
/// <summary> /// <summary>
/// 线体2的AGV从炒锅送料位置到倒料过程处理 /// 线体2的AGV从炒锅送料位置到倒料过程处理
@@ -2751,14 +2801,16 @@ namespace FryPot_DosingSystem.Control
AgvArriveFryPotOneOrFourOutEmptyRollerSingleSetDown();//暂时考虑agv送完料后原地等待,不加条件,直接发送到位信号 AgvArriveFryPotOneOrFourOutEmptyRollerSingleSetDown();//暂时考虑agv送完料后原地等待,不加条件,直接发送到位信号
globalVar.agvArriveUpLoad = false; globalVar.agvArriveUpLoad = false;
globalVar.AgvArrivePot = true; globalVar.AgvArrivePot = true;
FryPotOneRollerTroubleCheck();
} }
} }
public void LOneEmptyOperate() public void LOneEmptyOperate()
{ {

if ((globalVar.fryPotOne.EmptyBarrelArrivedSingle == 1 || globalVar.fryPotFour.EmptyBarrelArrivedSingle == 1) && OutputMaterialQuene.Count > 0 && globalVar.AgvArrivePot) if ((globalVar.fryPotOne.EmptyBarrelArrivedSingle == 1 || globalVar.fryPotFour.EmptyBarrelArrivedSingle == 1) && OutputMaterialQuene.Count > 0 && globalVar.AgvArrivePot)
{ {


FryPotOneRollerTroubleCheck();
// FryPotOneRollerTroubleCheck();
if (FryPotAlarm == 1 || FryPotFourAlarm == 1)//无故障 if (FryPotAlarm == 1 || FryPotFourAlarm == 1)//无故障
{ {
if (globalVar.agvFryPotEmptyRollerArrive) if (globalVar.agvFryPotEmptyRollerArrive)
@@ -2792,6 +2844,7 @@ namespace FryPot_DosingSystem.Control
} }
} }



} }


/// <summary> /// <summary>
@@ -2903,12 +2956,13 @@ namespace FryPot_DosingSystem.Control
{ {
globalVar.agvArriveLineFour = false; globalVar.agvArriveLineFour = false;
//线体四信号交互 //线体四信号交互
WritePlcData("D1067", 1);//AGV空桶回桶就位信号下发PLC
MessageLog.GetInstance.ShowRunLog("AGV到达【4】号回收线体,准备卸桶"); MessageLog.GetInstance.ShowRunLog("AGV到达【4】号回收线体,准备卸桶");
MessageLog.GetInstance.ShowRunLog("卸桶完成");
AgvViewModel.GetInstance().Set滚筒线状态(4,IsRun.Start);
// MessageLog.GetInstance.ShowRunLog("卸桶完成");
AgvViewModel.GetInstance().Set滚筒线状态(4, IsRun.Start);
AgvViewModel.GetInstance().Set滚筒线上数量(4, (++globalVar.LFourRollerNum).ToString()); AgvViewModel.GetInstance().Set滚筒线上数量(4, (++globalVar.LFourRollerNum).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(4,IsBool.No);
AgvViewModel.GetInstance().Set小车运动(4,CartMotionTrajectory.hj);
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.No);
AgvViewModel.GetInstance().Set小车运动(4, CartMotionTrajectory.hj);
AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes); AgvViewModel.GetInstance().Set停车桩(4, IsBool.Yes);
} }
} }
@@ -4086,7 +4140,16 @@ namespace FryPot_DosingSystem.Control
switch (OutputMaterialQuene.ElementAt(0).materialType.MaterialLoc / 100) switch (OutputMaterialQuene.ElementAt(0).materialType.MaterialLoc / 100)
{ {
case 1: case 1:
if (AlarmHelper<AlarmInfo>.Alarm.FryPotOneRollerTrouble == 1) { FryPotAlarm = -1; MessageLog.GetInstance.ShowRunLog("警告:炒锅【1】输送滚筒发生故障"); } else { FryPotAlarm = 1; return; } while (AlarmHelper<AlarmInfo>.Alarm.FryPotOneRollerTrouble == 1)
if (AlarmHelper<AlarmInfo>.Alarm.FryPotOneRollerTrouble == 1)
{
FryPotAlarm = -1; MessageLog.GetInstance.ShowRunLog("警告:炒锅【1】输送滚筒发生故障");
}
else
{
FryPotAlarm = 1; return;

}
while (AlarmHelper<AlarmInfo>.Alarm.FryPotOneRollerTrouble == 1)
{ {
Thread.Sleep(5); if (globalVar.ExitLineOneTask) Thread.Sleep(5); if (globalVar.ExitLineOneTask)
return; return;


+ 17
- 4
FryPot_DosingSystem/Control/GlobalVariable.cs View File

@@ -58,7 +58,7 @@ namespace FryPot_DosingSystem.Control
/// </summary> /// </summary>
public ushort PlcInite { get; set; } public ushort PlcInite { get; set; }
/// <summary> /// <summary>
/// 清洗台清洗完成信号
/// 清洗台清洗完成信号/洗桶出桶AGV呼叫信号
/// </summary> /// </summary>
public ushort CleanComplete { get; set; } public ushort CleanComplete { get; set; }
#region 上位机内部逻辑条件 #region 上位机内部逻辑条件
@@ -250,6 +250,10 @@ namespace FryPot_DosingSystem.Control
/// </summary> /// </summary>
public ushort RecipeCompleteSingle { get; set; } public ushort RecipeCompleteSingle { get; set; }
/// <summary> /// <summary>
/// 当前配方完成的中转信号
/// </summary>
public ushort RecipeComMidSingle { get; set; } = 1;
/// <summary>
/// 线体1上空桶确认信号 /// 线体1上空桶确认信号
/// </summary> /// </summary>
public ushort EmptyRollerConfirmSingle { get; set; } public ushort EmptyRollerConfirmSingle { get; set; }
@@ -318,7 +322,10 @@ namespace FryPot_DosingSystem.Control
/// 当前线体配方完成信号 /// 当前线体配方完成信号
/// </summary> /// </summary>
public ushort RecipeCompleteSingle { get; set; } public ushort RecipeCompleteSingle { get; set; }

/// <summary>
/// 当前配方完成的中转信号
/// </summary>
public ushort RecipeComMidSingle { get; set; } = 1;
/// <summary> /// <summary>
/// 线体1上空桶确认信号 /// 线体1上空桶确认信号
/// </summary> /// </summary>
@@ -387,7 +394,10 @@ namespace FryPot_DosingSystem.Control
/// 当前线体配方完成信号 /// 当前线体配方完成信号
/// </summary> /// </summary>
public ushort RecipeCompleteSingle { get; set; } public ushort RecipeCompleteSingle { get; set; }

/// <summary>
/// 当前配方完成的中转信号
/// </summary>
public ushort RecipeComMidSingle { get; set; } = 1;
/// <summary> /// <summary>
/// 线体1上空桶确认信号 /// 线体1上空桶确认信号
/// </summary> /// </summary>
@@ -457,8 +467,11 @@ namespace FryPot_DosingSystem.Control
/// 当前线体配方完成信号 /// 当前线体配方完成信号
/// </summary> /// </summary>
public ushort RecipeCompleteSingle { get; set; } public ushort RecipeCompleteSingle { get; set; }
/// <summary>
/// 当前配方完成的中转信号
/// </summary>
public ushort RecipeComMidSingle { get; set; } = 1;


} }
/// <summary> /// <summary>
/// 炒锅1相关变量 /// 炒锅1相关变量


+ 12
- 3
FryPot_DosingSystem/View/DebugView.xaml View File

@@ -39,6 +39,7 @@
<ComboBox SelectionChanged="ComboBox_SelectionChanged" ItemsSource="{Binding LineOneRollerCode}" Background="Transparent" Width="100" Height="34" Margin="3,3"/> <ComboBox SelectionChanged="ComboBox_SelectionChanged" ItemsSource="{Binding LineOneRollerCode}" Background="Transparent" Width="100" Height="34" Margin="3,3"/>
<Button Content="炒锅进料就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotInputArrive}"/> <Button Content="炒锅进料就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotInputArrive}"/>
<Button Content="炒锅空桶就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotEmptyRollerArrive}"/> <Button Content="炒锅空桶就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotEmptyRollerArrive}"/>
<Button Content="配方完成信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineOneRecipeComSignal}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/> <Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>
<Button Content="线体1任务重置" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineOneTaskExit}"></Button> <Button Content="线体1任务重置" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineOneTaskExit}"></Button>
<Button Content="AGV接口调试" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvDebug}"/> <Button Content="AGV接口调试" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvDebug}"/>
@@ -65,9 +66,11 @@
<Button Content="AGV线体1空桶上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineOneEmptyRollerLoc}"/> <Button Content="AGV线体1空桶上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineOneEmptyRollerLoc}"/>
<Button Content="AGV线体1空桶上料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvLineOneLoadEmptyCom}"/> <Button Content="AGV线体1空桶上料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvLineOneLoadEmptyCom}"/>
<Button Content="AGV空桶清洗下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLoc}"/> <Button Content="AGV空桶清洗下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLoc}"/>
<Button Content="AGV空桶清洗下料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocCom}"/>
<Button Content="AGV空桶清洗上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoad}"/> <Button Content="AGV空桶清洗上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoad}"/>
<Button Content="AGV空桶清洗上料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoadCom}"/>
<Button Content="AGV线体4空桶下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLoc}"/> <Button Content="AGV线体4空桶下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLoc}"/>
<Button Content="AGV线体4空桶下料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLocCom}"/>
</WrapPanel> </WrapPanel>
</WrapPanel> </WrapPanel>
@@ -82,6 +85,7 @@
<ComboBox SelectionChanged="ComboBox_SelectionChanged_1" ItemsSource="{Binding LineTwoRollerCode}" Background="Transparent" Width="100" Height="34" Margin="3,3"/> <ComboBox SelectionChanged="ComboBox_SelectionChanged_1" ItemsSource="{Binding LineTwoRollerCode}" Background="Transparent" Width="100" Height="34" Margin="3,3"/>
<Button Content="炒锅进料就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotTwoInputArrive}"/> <Button Content="炒锅进料就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotTwoInputArrive}"/>
<Button Content="炒锅空桶就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotTwoEmptyRollerArrive}"/> <Button Content="炒锅空桶就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotTwoEmptyRollerArrive}"/>
<Button Content="配方完成信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineTwoRecipeComSignal}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/> <Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>
<Button Content="线体2任务重置" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineTwoTaskExit}"></Button> <Button Content="线体2任务重置" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineTwoTaskExit}"></Button>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/> <Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>
@@ -103,9 +107,11 @@
<Button Content="AGV线体2空桶上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineTwoEmptyRollerLoc}"/> <Button Content="AGV线体2空桶上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineTwoEmptyRollerLoc}"/>
<Button Content="AGV线体2空桶上完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvLineTwoLoadEmptyCom}"/> <Button Content="AGV线体2空桶上完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvLineTwoLoadEmptyCom}"/>
<Button Content="AGV空桶清洗下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLoc}"/> <Button Content="AGV空桶清洗下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLoc}"/>
<Button Content="AGV空桶清洗下料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocCom}"/>
<Button Content="AGV空桶清洗上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoad}"/> <Button Content="AGV空桶清洗上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoad}"/>
<Button Content="AGV空桶清洗上料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoadCom}"/>
<Button Content="AGV线体4空桶下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLoc}"/> <Button Content="AGV线体4空桶下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLoc}"/>
<Button Content="AGV线体4空桶下料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLocCom}"/>
</WrapPanel> </WrapPanel>
</WrapPanel> </WrapPanel>
</GroupBox> </GroupBox>
@@ -118,6 +124,7 @@
<ComboBox SelectionChanged="ComboBox_SelectionChanged_2" ItemsSource="{Binding LineThreeRollerCode}" Background="Transparent" Width="100" Height="34" Margin="3,3"/> <ComboBox SelectionChanged="ComboBox_SelectionChanged_2" ItemsSource="{Binding LineThreeRollerCode}" Background="Transparent" Width="100" Height="34" Margin="3,3"/>
<Button Content="炒锅进料就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotThreeInputArrive}"/> <Button Content="炒锅进料就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotThreeInputArrive}"/>
<Button Content="炒锅空桶就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotThreeEmptyRollerArrive}"/> <Button Content="炒锅空桶就位" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding FryPotThreeEmptyRollerArrive}"/>
<Button Content="配方完成信号" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineThreeRecipeComSignal}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/> <Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>
<Button Content="线体3任务重置" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineThreeTaskExit}"></Button> <Button Content="线体3任务重置" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineThreeTaskExit}"></Button>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/> <Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="860" Y1="0" Y2="0"/>
@@ -139,9 +146,11 @@
<Button Content="AGV线体3空桶上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineThreeEmptyRollerLoc}"/> <Button Content="AGV线体3空桶上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineThreeEmptyRollerLoc}"/>
<Button Content="AGV线体3空桶上料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvLineThreeLoadEmptyCom}"/> <Button Content="AGV线体3空桶上料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvLineThreeLoadEmptyCom}"/>
<Button Content="AGV空桶清洗下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLoc}"/> <Button Content="AGV空桶清洗下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLoc}"/>
<Button Content="AGV空桶清洗下料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocCom}"/>
<Button Content="AGV空桶清洗上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoad}"/> <Button Content="AGV空桶清洗上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoad}"/>
<Button Content="AGV空桶清洗上料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoadCom}"/>
<Button Content="AGV线体4空桶下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLoc}"/> <Button Content="AGV线体4空桶下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLoc}"/>
<Button Content="AGV线体4空桶下料完成" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLocCom}"/>
</WrapPanel> </WrapPanel>
</WrapPanel> </WrapPanel>
</GroupBox> </GroupBox>


+ 1
- 1
FryPot_DosingSystem/View/MainWindow.xaml.cs View File

@@ -40,7 +40,7 @@ namespace FryPot_DosingSystem.View
var res = JsonConvert.DeserializeObject<Upstreamrequest>(o.ToString()); var res = JsonConvert.DeserializeObject<Upstreamrequest>(o.ToString());
}); });


HubHelper.GetInstance.Connect("192.168.1.56", 8089);
HubHelper.GetInstance.Connect("192.168.1.40", 8089);
} }


protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)


+ 31
- 5
FryPot_DosingSystem/ViewModel/DebugViewModel.cs View File

@@ -22,7 +22,7 @@ namespace FryPot_DosingSystem.ViewModel
public RelayCommand FryPotInputArrive { get; set; } public RelayCommand FryPotInputArrive { get; set; }
public RelayCommand FryPotEmptyRollerArrive { get; set; } public RelayCommand FryPotEmptyRollerArrive { get; set; }
public RelayCommand LineOneTaskExit { get; set; } public RelayCommand LineOneTaskExit { get; set; }
public RelayCommand LineOneRecipeComSignal { get; set; }


public RelayCommand AGVLOneArrive { get; set; } public RelayCommand AGVLOneArrive { get; set; }
public RelayCommand AGVFryPotDownArrive { get; set; } public RelayCommand AGVFryPotDownArrive { get; set; }
@@ -36,7 +36,7 @@ namespace FryPot_DosingSystem.ViewModel
public RelayCommand FryPotTwoInputArrive { get; set; } public RelayCommand FryPotTwoInputArrive { get; set; }
public RelayCommand FryPotTwoEmptyRollerArrive { get; set; } public RelayCommand FryPotTwoEmptyRollerArrive { get; set; }
public RelayCommand LineTwoTaskExit { get; set; } public RelayCommand LineTwoTaskExit { get; set; }
public RelayCommand LineTwoRecipeComSignal { get; set; }


public RelayCommand AGVLTwoArrive { get; set; } public RelayCommand AGVLTwoArrive { get; set; }
public RelayCommand AGVFryPotTwoDownArrive { get; set; } public RelayCommand AGVFryPotTwoDownArrive { get; set; }
@@ -49,6 +49,7 @@ namespace FryPot_DosingSystem.ViewModel
public RelayCommand FryPotThreeInputArrive { get; set; } public RelayCommand FryPotThreeInputArrive { get; set; }
public RelayCommand FryPotThreeEmptyRollerArrive { get; set; } public RelayCommand FryPotThreeEmptyRollerArrive { get; set; }
public RelayCommand LineThreeTaskExit { get; set; } public RelayCommand LineThreeTaskExit { get; set; }
public RelayCommand LineThreeRecipeComSignal { get; set; }


public RelayCommand AGVLThreeArrive { get; set; } public RelayCommand AGVLThreeArrive { get; set; }
public RelayCommand AGVFryPotThreeDownArrive { get; set; } public RelayCommand AGVFryPotThreeDownArrive { get; set; }
@@ -69,10 +70,11 @@ namespace FryPot_DosingSystem.ViewModel
public RelayCommand AgvLineThreeLoadEmptyCom { get; set; } public RelayCommand AgvLineThreeLoadEmptyCom { get; set; }
public RelayCommand CleanPlateCallAgv { get; set; } public RelayCommand CleanPlateCallAgv { get; set; }
public RelayCommand AgvArriveCleanPlateLoc { get; set; }//下料 public RelayCommand AgvArriveCleanPlateLoc { get; set; }//下料
public RelayCommand AgvArriveLineFourLoc { get; set; }

public RelayCommand AgvArriveCleanPlateLocCom { get; set; }//下料完成
public RelayCommand AgvArriveLineFourLoc { get; set; }//下料
public RelayCommand AgvArriveLineFourLocCom { get; set; }//4号线空桶下料完成
public RelayCommand AgvArriveCleanPlateLocLoad { get; set; }//上料 public RelayCommand AgvArriveCleanPlateLocLoad { get; set; }//上料
public RelayCommand AgvArriveCleanPlateLocLoadCom { get; set; }//上料完成
public RelayCommand EmptyRollerCleanTaskRestart { get; set; } public RelayCommand EmptyRollerCleanTaskRestart { get; set; }
public DebugViewModel() public DebugViewModel()
{ {
@@ -80,7 +82,31 @@ namespace FryPot_DosingSystem.ViewModel
{ {
ActionManage.GetInstance.Send("AgvDebug"); ActionManage.GetInstance.Send("AgvDebug");
})); }));
AgvArriveCleanPlateLocCom = new RelayCommand(() =>
{
ActionManage.GetInstance.Send("AgvArriveCleanPlateLocCom");


});
AgvArriveLineFourLocCom = new RelayCommand(() =>
{
ActionManage.GetInstance.Send("AgvArriveLineFourLocCom");
});
AgvArriveCleanPlateLocLoadCom = new RelayCommand(() =>
{
ActionManage.GetInstance.Send("AgvArriveCleanPlateLocLoadCom");
});
LineOneRecipeComSignal = new RelayCommand(() =>
{
ActionManage.GetInstance.Send("LineOneRecipeComSignal");
});
LineTwoRecipeComSignal = new RelayCommand(() =>
{
ActionManage.GetInstance.Send("LineTwoRecipeComSignal");
});
LineThreeRecipeComSignal = new RelayCommand(() =>
{
ActionManage.GetInstance.Send("LineThreeRecipeComSignal");
});
EmptyRollerCleanTaskRestart = new RelayCommand(() => EmptyRollerCleanTaskRestart = new RelayCommand(() =>
{ {




+ 5
- 1
FryPot_DosingSystem/ViewModel/FlowProcessSetViewModel.cs View File

@@ -27,7 +27,7 @@ namespace FryPot_DosingSystem.ViewModel
{ {
currnetRecipeName = recipeName.ToString(); currnetRecipeName = recipeName.ToString();
var res = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p => p.FlowProcess.RecipeName == recipeName.ToString()); var res = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p => p.FlowProcess.RecipeName == recipeName.ToString());
if (res != null && res is NewRecipeModel recipe) //编辑已有工艺
if (res != null && res is NewRecipeModel recipe&&res.FlowProcess.fpModels.Count==res.materialCollection.Count+1) //编辑已有工艺
{ {
//flowProcessModels = recipe.FlowProcess.fpModels; //flowProcessModels = recipe.FlowProcess.fpModels;
foreach (var item in recipe.FlowProcess.fpModels) foreach (var item in recipe.FlowProcess.fpModels)
@@ -40,6 +40,10 @@ namespace FryPot_DosingSystem.ViewModel
var name = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p=>p.RecipeName==recipeName.ToString()); var name = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p=>p.RecipeName==recipeName.ToString());
if (name != null) if (name != null)
{ {
if (name.FlowProcess.fpModels.Count > 0)
{
name.FlowProcess.fpModels.Clear();
}
name.FlowProcess.RecipeName = recipeName.ToString(); name.FlowProcess.RecipeName = recipeName.ToString();
flowProcessModels.Add(new FlowProcessModel { Id = Id + 1, FryMaterialNum = "油" }); flowProcessModels.Add(new FlowProcessModel { Id = Id + 1, FryMaterialNum = "油" });
Id++; Id++;


+ 3
- 4
TestDemo/Form1.cs View File

@@ -11,24 +11,23 @@ namespace TestDemo
public Form1() public Form1()
{ {
InitializeComponent(); InitializeComponent();
HubHelper.GetInstance.Connect("192.168.1.14", 8089);
} }


private void button1_Click(object sender, EventArgs e) private void button1_Click(object sender, EventArgs e)
{ {
AGVToUpSystem aGVToUpSystem = new AGVToUpSystem(); AGVToUpSystem aGVToUpSystem = new AGVToUpSystem();
string value = JsonConvert.SerializeObject(aGVToUpSystem); string value = JsonConvert.SerializeObject(aGVToUpSystem);
string url = $"http://192.168.1.14:8089/apicallback/quicktron/robotjob/report?sign={value}";
string url = $"http://192.168.1.40:8089/apicallback/quicktron/robotjob/report?sign={value}";
var res = APIHelper.GetInstance.HttpRequest(url, "", aGVToUpSystem, RequestType.POST); var res = APIHelper.GetInstance.HttpRequest(url, "", aGVToUpSystem, RequestType.POST);
} }


private void button2_Click(object sender, EventArgs e) private void button2_Click(object sender, EventArgs e)
{ {

Upstreamrequest aGVToUpSystem = new Upstreamrequest(); Upstreamrequest aGVToUpSystem = new Upstreamrequest();
string value = JsonConvert.SerializeObject(aGVToUpSystem); string value = JsonConvert.SerializeObject(aGVToUpSystem);
string url = $"http://192.168.1.14:8089/apicallback/quicktron/robotjob/upstreamrequest?sign={value}";
string url = $"http://192.168.1.40:8089/apicallback/quicktron/robotjob/upstreamrequest?sign={value}";
var res = APIHelper.GetInstance.HttpRequest(url, "", aGVToUpSystem, RequestType.POST); var res = APIHelper.GetInstance.HttpRequest(url, "", aGVToUpSystem, RequestType.POST);

} }
} }
} }

Loading…
Cancel
Save