taoye 2 лет назад
Родитель
Сommit
07a357d1bc
9 измененных файлов: 282 добавлений и 72 удалений
  1. +4
    -2
      BPASmartClient.CustomResource/Pages/Model/MessageLog.cs
  2. +2
    -2
      BPASmartClient.CustomResource/Pages/View/AlarmView.xaml
  3. +4
    -3
      BPASmartClient.CustomResource/Pages/View/RunLogView.xaml
  4. +2
    -2
      BPASmartClient.CustomResource/Pages/View/UserLogView.xaml
  5. +196
    -50
      FryPot_DosingSystem/Control/DosingLogicControl.cs
  6. +17
    -6
      FryPot_DosingSystem/Control/GlobalVariable.cs
  7. +15
    -3
      FryPot_DosingSystem/View/DebugView.xaml
  8. +3
    -2
      FryPot_DosingSystem/View/RecipeSendDownView.xaml
  9. +39
    -2
      FryPot_DosingSystem/ViewModel/DebugViewModel.cs

+ 4
- 2
BPASmartClient.CustomResource/Pages/Model/MessageLog.cs Просмотреть файл

@@ -7,6 +7,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows;
using BPASmartClient.Model;
using System.Windows.Media;

namespace BPASmartClient.CustomResource.Pages.Model
{
@@ -72,8 +73,9 @@ namespace BPASmartClient.CustomResource.Pages.Model
RunLog?.Invoke(info);
}
}
int AlarmID;
public void ShowAlarmLog(string info, string AlarmNumber="_", AlarmLevel level= AlarmLevel.一般报警)
public void ShowAlarmLog(string info, string AlarmNumber = "_", AlarmLevel level = AlarmLevel.一般报警)
{
lock (alarmlock)
{
@@ -85,7 +87,7 @@ namespace BPASmartClient.CustomResource.Pages.Model
Time = DateTime.Now.ToString("HH:mm:ss"),
Info = info,
Value = AlarmNumber,
Grade = (level)+""
Grade = (level) + ""
};
Sqlite<Alarm>.GetInstance.Base.Add(alarmLog);
Application.Current.Dispatcher.Invoke(new Action(() => { alarmLogs.Insert(0, alarmLog); }));


+ 2
- 2
BPASmartClient.CustomResource/Pages/View/AlarmView.xaml Просмотреть файл

@@ -25,7 +25,7 @@
<convert:AlarmTypeTextConvert x:Key="alarmTypeTextConvert" />-->
<SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" />
<SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
<SolidColorBrush x:Key="TitleFontColor" Color="#ddd" />
<SolidColorBrush x:Key="TitleFontColor" Color="White" />
<SolidColorBrush x:Key="CursorColor" Color="Aqua" />
<SolidColorBrush x:Key="TitleBorderColor" Color="#FF2AB2E7" />

@@ -157,7 +157,7 @@
</StackPanel>

<!--#region 表格标题栏设置-->
<Grid Grid.Row="1" Background="#dd2AB2E7">
<Grid Grid.Row="1" Background="#FF19B7EC">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.3*" />
<ColumnDefinition Width="0.7*" />


+ 4
- 3
BPASmartClient.CustomResource/Pages/View/RunLogView.xaml Просмотреть файл

@@ -25,7 +25,7 @@
<convert:AlarmTypeTextConvert x:Key="alarmTypeTextConvert" />-->
<SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" />
<SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
<SolidColorBrush x:Key="TitleFontColor" Color="#ddd" />
<SolidColorBrush x:Key="TitleFontColor" Color="White" />
<SolidColorBrush x:Key="CursorColor" Color="Aqua" />
<SolidColorBrush x:Key="TitleBorderColor" Color="#FF2AB2E7" />

@@ -158,7 +158,7 @@
</StackPanel>

<!--#region 表格标题栏设置-->
<Grid Grid.Row="1" Background="#dd2AB2E7">
<Grid Grid.Row="1" Background="#FF19B7EC">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.7*" />
<ColumnDefinition Width="0.7*" />
@@ -261,7 +261,8 @@
<TextBlock
Grid.Column="2"
Style="{StaticResource DataTextBlockStyle}"
Text="{Binding RunLogInfo}" />
Text="{Binding RunLogInfo}"
/>

<!--<Grid Grid.Column="3">
<TextBlock


+ 2
- 2
BPASmartClient.CustomResource/Pages/View/UserLogView.xaml Просмотреть файл

@@ -26,7 +26,7 @@
<convert:AlarmTypeTextConvert x:Key="alarmTypeTextConvert" />-->
<SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" />
<SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
<SolidColorBrush x:Key="TitleFontColor" Color="#ddd" />
<SolidColorBrush x:Key="TitleFontColor" Color="White" />
<SolidColorBrush x:Key="CursorColor" Color="Aqua" />
<SolidColorBrush x:Key="TitleBorderColor" Color="#FF2AB2E7" />

@@ -240,7 +240,7 @@
</StackPanel>

<!--#region 表格标题栏设置-->
<Grid Grid.Row="1" Background="#dd2AB2E7">
<Grid Grid.Row="1" Background="#FF19B7EC">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.3*" />
<ColumnDefinition Width="0.3*" />


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

@@ -189,15 +189,21 @@ namespace FryPot_DosingSystem.Control
globalVar.agvArriveLineFour = true;

}), "AgvArriveLineFourLoc");

ActionManage.GetInstance.Register(new Action(() =>
{
EmptyRollerCleanTaskRestart();

}), "EmptyRollerCleanTaskRestart");

#endregion
//接口调试
ActionManage.GetInstance.Register(new Action(() =>
{
string id = Guid.NewGuid().ToString();
string errorCode=AGVHelper._Instance.AgvToLineOneLoadRoller(id);
string errorCode = AGVHelper._Instance.AgvToLineOneLoadRoller(id);
if (errorCode == "SUCCESS")
{
{
MessageLog.GetInstance.ShowRunLog($"AGV任务下发成功");
}
else if (errorCode == "Analysis Error")
@@ -209,6 +215,31 @@ namespace FryPot_DosingSystem.Control
MessageLog.GetInstance.ShowRunLog($"提示:AGV任务下发失败,错误码:{errorCode}");
}
}), "AgvDebug");
ActionManage.GetInstance.Register(new Action(() =>
{
globalVar.agvArriveLineOneLoadCom = true;
}), "AgvLineOneLoadEmptyCom");
ActionManage.GetInstance.Register(new Action(() =>
{
globalVar.agvArriveLineTwoLoadCom = true;
}), "AgvLineTwoLoadEmptyCom");
ActionManage.GetInstance.Register(new Action(() =>
{
globalVar.agvArriveLineThreeLoadCom = true;
}), "AgvLineThreeLoadEmptyCom");

ActionManage.GetInstance.Register(new Action(() =>
{
globalVar.rollerLineOne.CanRun = true;
}), "AGVLineOneLoadCom");
ActionManage.GetInstance.Register(new Action(() =>
{
globalVar.rollerLineTwo.CanRun = true;
}), "AGVLineTwoLoadCom");
ActionManage.GetInstance.Register(new Action(() =>
{
globalVar.rollerLineThree.CanRun = true;
}), "AGVLineThreeLoadCom");

ActionManage.GetInstance.Register(new Action(() =>
{
@@ -812,6 +843,7 @@ namespace FryPot_DosingSystem.Control
//线体1任务上报
if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LSevenrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体1空桶上料
{
globalVar.agvArriveLineOneLoadCom = true;
AgvViewModel.GetInstance().Set滚筒线上数量(1, (globalVar.LOneMaterialNum - 1).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.OnllYes);
//到清洗处
@@ -819,6 +851,7 @@ namespace FryPot_DosingSystem.Control
//线体2任务上报
if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LEightrobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体2空桶上料
{
globalVar.agvArriveLineTwoLoadCom = true;
AgvViewModel.GetInstance().Set滚筒线上数量(2, (globalVar.LTwoMaterialNum - 1).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.OnllYes);

@@ -828,6 +861,7 @@ namespace FryPot_DosingSystem.Control
//线体3任务上报
if (objData.state == "ROLLER_LOAD_FINISH" && objData.robotJobId == LThreerobotJobId && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料点上料完成,这里指线体3空桶上料
{
globalVar.agvArriveLineThreeLoadCom = true;
AgvViewModel.GetInstance().Set滚筒线上数量(3, (globalVar.LThreeMaterialNum - 1).ToString());
AgvViewModel.GetInstance().Set小车是否承载物品(4, IsBool.OnllYes);
//到清洗处
@@ -918,7 +952,7 @@ namespace FryPot_DosingSystem.Control
AgvViewModel.GetInstance().Set小车运动(3, CartMotionTrajectory.hs_3);
}

//线体1任务上报
if (objData.state == "ROLLER_UNLOAD_DOING" && objData.robotJobId == LFourrobotJobId && objData.jobData.targetPointCode == "")//指定下料点正在下料,指炒锅空桶下料
{
@@ -1053,9 +1087,9 @@ namespace FryPot_DosingSystem.Control

ThreadManage.GetInstance().StopTask("MainViewReadPlcData", new Action(() =>
{
//ActionManage.GetInstance.CancelRegister("RecipeSetDown");
//ActionManage.GetInstance.Register(new Action<object>(RecipeDataParse), "RecipeSetDown");
// ActionManage.GetInstance.Send("ClearRecipes");
//ActionManage.GetInstance.CancelRegister("RecipeSetDown");
//ActionManage.GetInstance.Register(new Action<object>(RecipeDataParse), "RecipeSetDown");
// ActionManage.GetInstance.Send("ClearRecipes");
ThreadManage.GetInstance().StopTask("滚筒线1任务线程", new Action(() =>
{
ThreadManage.GetInstance().StopTask("滚筒线2任务线程", new Action(() =>
@@ -1105,7 +1139,8 @@ namespace FryPot_DosingSystem.Control
globalVar.agvArriveUpLoad = false;
globalVar.agvArriveUnLoad = false;
globalVar.agvFryPotEmptyRollerArrive = false;
globalVar.EmptyRollerUnLoadcCom = false;
globalVar.agvLineOneLoadCom = false;

ThreadManage.GetInstance().StartLong(new Action(() => { LineOneProcessExecute(); Thread.Sleep(10); }), "滚筒线1任务线程");
MessageLog.GetInstance.ShowUserLog("滚筒线【1】任务重启成功");
}));
@@ -1136,7 +1171,8 @@ namespace FryPot_DosingSystem.Control
globalVar.agvArriveLTwoUpLoad = false;
globalVar.LTwoagvArriveUnLoad = false;
globalVar.LTwoagvFryPotEmptyRollerArrive = false;
globalVar.LTwoEmptyRollerUnLoadcCom = false;
globalVar.agvLineTwoLoadCom = false;

ThreadManage.GetInstance().StartLong(new Action(() => { LineTwoProcessExecute(); Thread.Sleep(10); }), "滚筒线2任务线程");
MessageLog.GetInstance.ShowUserLog("滚筒线【2】任务重启成功");
}));
@@ -1165,11 +1201,41 @@ namespace FryPot_DosingSystem.Control
globalVar.agvArriveLThreeUpLoad = false;
globalVar.LThreeagvArriveUnLoad = false;
globalVar.LThreeagvFryPotEmptyRollerArrive = false;
globalVar.LThreeEmptyRollerUnLoadcCom = false;
globalVar.agvLineThreeLoadCom = false;
ThreadManage.GetInstance().StartLong(new Action(() => { LineThreeProcessExecute(); Thread.Sleep(10); }), "滚筒线3任务线程");
MessageLog.GetInstance.ShowUserLog("滚筒线【3】任务重启成功");
}));
}

public void EmptyRollerCleanTaskRestart()
{
ThreadManage.GetInstance().StopTask("空桶清洗任务线程", new Action(() =>
{
globalVar.rollerLineOne.EmptyRollerNums.Clear();
globalVar.rollerLineOne.IsEpmtyBefore = false;
// globalVar.rollerLineOne.CanRun = true;

globalVar.rollerLineTwo.EmptyRollerNums.Clear();
globalVar.rollerLineTwo.IsEpmtyBefore = false;
//globalVar.rollerLineTwo.CanRun = true;

globalVar.rollerLineThree.EmptyRollerNums.Clear();
globalVar.rollerLineThree.IsEpmtyBefore = false;
//globalVar.rollerLineThree.CanRun = true;

globalVar.agvArriveLineFour = false;
globalVar.agvArriveCleanLoad = false;
globalVar.agvArriveCleanUnLoad = false;
globalVar.agvArriveLineOneLoadEmptyRoller = false;
globalVar.agvArriveLineTwoLoadEmptyRoller = false;
globalVar.agvArriveLineThreeLoadEmptyRoller = false;
globalVar.agvArriveLineOneLoadCom = false;
globalVar.agvArriveLineTwoLoadCom = false;
globalVar.agvArriveLineThreeLoadCom = false;
ThreadManage.GetInstance().StartLong(new Action(() => { LineFourProcessExecute(); Thread.Sleep(10); }), "空桶清洗任务线程");
MessageLog.GetInstance.ShowUserLog("空桶清洗任务重启成功");
}));
}
/// <summary>
/// 实时获取plc数据
/// </summary>
@@ -1215,9 +1281,9 @@ namespace FryPot_DosingSystem.Control
globalVar.rollerLineOne.OutMaterialingSingle = data[3];
globalVar.rollerLineTwo.OutMaterialingSingle = data[4];
globalVar.rollerLineThree.OutMaterialingSingle = data[5];
//globalVar.rollerLineOne.OutMaterialingTroubleSingle = data[6];
//globalVar.rollerLineTwo.OutMaterialingTroubleSingle = data[7];
//globalVar.rollerLineThree.OutMaterialingTroubleSingle = data[8];
//globalVar.rollerLineOne.OutMaterialingTroubleSingle = data[6];
//globalVar.rollerLineTwo.OutMaterialingTroubleSingle = data[7];
//globalVar.rollerLineThree.OutMaterialingTroubleSingle = data[8];
AlarmHelper<AlarmInfo>.Alarm.LOneRollerTrouble = data[6];
AlarmHelper<AlarmInfo>.Alarm.LTwoRollerTrouble = data[7];
AlarmHelper<AlarmInfo>.Alarm.LThreeRollerTrouble = data[8];
@@ -1257,11 +1323,11 @@ namespace FryPot_DosingSystem.Control
}));
GetAddressData("D2070", new Action<ushort[]>((data) =>
{
//globalVar.fryPotOne.RollerTroubleSingle = data[0];
//globalVar.fryPotTwo.RollerTroubleSingle = data[1];
//globalVar.fryPotThree.RollerTroubleSingle = data[2];
//globalVar.fryPotFour.RollerTroubleSingle = data[3];
//globalVar.fryPotFive.RollerTroubleSingle = data[4];
//globalVar.fryPotOne.RollerTroubleSingle = data[0];
//globalVar.fryPotTwo.RollerTroubleSingle = data[1];
//globalVar.fryPotThree.RollerTroubleSingle = data[2];
//globalVar.fryPotFour.RollerTroubleSingle = data[3];
//globalVar.fryPotFive.RollerTroubleSingle = data[4];
AlarmHelper<AlarmInfo>.Alarm.FryPotOneRollerTrouble = data[0];
AlarmHelper<AlarmInfo>.Alarm.FryPotTwoRollerTrouble = data[1];
AlarmHelper<AlarmInfo>.Alarm.FryPotThreeRollerTrouble = data[2];
@@ -1284,32 +1350,32 @@ namespace FryPot_DosingSystem.Control

globalVar.CleadBarrelExitSingle = data[0];
}));
//炒锅1状态数据
//炒锅1状态数据
GetFryOneData("D2001", new Action<ushort[]>(data =>
{

}));
//炒锅2状态数据
//炒锅2状态数据
GetFryTwoData("D2001", new Action<ushort[]>(data =>
{

}));
//炒锅3状态数据
//炒锅3状态数据
GetFryThreeData("D2001", new Action<ushort[]>(data =>
{

}));
//炒锅4状态数据
//炒锅4状态数据
GetFryFourData("D2001", new Action<ushort[]>(data =>
{

}));
//炒锅5状态数据
//炒锅5状态数据
GetFryFiveData("D2001", new Action<ushort[]>(data =>
{

}));
//线体上放空桶
//线体上放空桶
if (globalVar.rollerLineOne.EmptyRollerConfirmSingle == 1 && globalVar.rollerLineOne.EmptyRollerNum != 0)
{
globalVar.rollerLineOne.EmptyRollerNums.Add(globalVar.rollerLineOne.EmptyRollerNum);
@@ -1322,7 +1388,7 @@ namespace FryPot_DosingSystem.Control
{
globalVar.rollerLineThree.EmptyRollerNums.Add(globalVar.rollerLineThree.EmptyRollerNum);
}
//炒锅状态数据
//炒锅状态数据
if (globalVar.fryPotOne.OilConfirm == 1)
{
FryPotMonitorManage.GetInstance.fryOne.OilCapacity = globalVar.fryPotOne.OilCapacity;
@@ -1348,7 +1414,7 @@ namespace FryPot_DosingSystem.Control
FryPotMonitorManage.GetInstance.fryFive.OilCapacity = globalVar.fryPotFive.OilCapacity;
FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy += globalVar.fryPotFive.OilCapacity;
}
//炒锅状态实时显示
//炒锅状态实时显示
FryPotStatusDisplay();
RollerLineStatusDisplay();
Thread.Sleep(10);
@@ -1807,7 +1873,7 @@ namespace FryPot_DosingSystem.Control
ThreadManage.GetInstance().StartLong(new Action(() => { LineOneProcessExecute(); Thread.Sleep(10); }), "滚筒线1任务线程");
ThreadManage.GetInstance().StartLong(new Action(() => { LineTwoProcessExecute(); Thread.Sleep(10); }), "滚筒线2任务线程");
ThreadManage.GetInstance().StartLong(new Action(() => { LineThreeProcessExecute(); Thread.Sleep(10); }), "滚筒线3任务线程");
ThreadManage.GetInstance().StartLong(new Action(() => { LineFourProcessExecute(); Thread.Sleep(10); }), "清洗任务线程");
ThreadManage.GetInstance().StartLong(new Action(() => { LineFourProcessExecute(); Thread.Sleep(10); }), "空桶清洗任务线程");

}

@@ -1869,11 +1935,13 @@ namespace FryPot_DosingSystem.Control
}
private void LineFourProcessExecute()
{
//
AgvFromLineToCleanPlate();
AgvArriveCleanPlate();

CallAgvToLineFour();
CleanPlateUpLoad();
EmptyRollerToLinFour();
CallAgvToLineFour();
AgvArriveCleanPlate();
}

private void CleanPlateUpLoad()
@@ -1893,11 +1961,12 @@ namespace FryPot_DosingSystem.Control
if (AlarmHelper<AlarmInfo>.Alarm.LOneRollerTrouble == 0)//输送线无故障
{
//线体1到清洗台
if (!globalVar.rollerLineOne.IsEpmtyBefore)
if (!globalVar.rollerLineOne.IsEpmtyBefore && globalVar.rollerLineOne.CanRun)
{
var res = InputMaterialQuene.FirstOrDefault(p => p.materialType.MaterialLoc == globalVar.rollerLineOne.StationEight);
if (res == null && globalVar.rollerLineOne.StationEight != 0 && globalVar.rollerLineOne.EmptyRollerNums.Count > 0 && globalVar.rollerLineOne.StationEight == globalVar.rollerLineOne.EmptyRollerNums.ElementAt(0))//工位8上面有桶且不是配方上的原料桶且工位8的桶号和plc上报的桶号一致,即空桶
if ((globalVar.rollerLineOne.StationEight != 0 && globalVar.rollerLineOne.EmptyRollerNums.Count > 0 && globalVar.rollerLineOne.StationEight == globalVar.rollerLineOne.EmptyRollerNums.ElementAt(0) && InputMaterialQuene.Count > 0 && globalVar.rollerLineOne.StationEight != InputMaterialQuene.ElementAt(0).materialType.MaterialLoc) || (res == null && globalVar.rollerLineOne.StationEight != 0 && globalVar.rollerLineOne.EmptyRollerNums.Count > 0 && globalVar.rollerLineOne.StationEight == globalVar.rollerLineOne.EmptyRollerNums.ElementAt(0)))//工位8上面有桶且不是配方上的原料桶且工位8的桶号和plc上报的桶号一致,即空桶
{

//下发AGV去空桶线洗桶任务
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)
@@ -1908,6 +1977,7 @@ namespace FryPot_DosingSystem.Control
Thread.Sleep(500);
LineToCleanCarryTaskErrorCodeAnalysis(info, 1);
globalVar.rollerLineOne.IsEpmtyBefore = true;
//globalVar.rollerLineOne.CanRun = false;
AgvFromLineOneToClean(globalVar.rollerLineOne.EmptyRollerNums.ElementAt(0));//AGV从线体1到清洗处
}
}
@@ -1919,10 +1989,10 @@ namespace FryPot_DosingSystem.Control
// 线体2到清洗台
if (AlarmHelper<AlarmInfo>.Alarm.LTwoRollerTrouble == 0)//输送线无故障
{
if (!globalVar.rollerLineTwo.IsEpmtyBefore)
if (!globalVar.rollerLineTwo.IsEpmtyBefore && globalVar.rollerLineTwo.CanRun)
{
var res = LTwoInputMaterialQuene.FirstOrDefault(p => p.materialType.MaterialLoc == globalVar.rollerLineTwo.StationEight);
if (res == null && globalVar.rollerLineTwo.StationEight != 0 && globalVar.rollerLineTwo.EmptyRollerNums.Count > 0 && globalVar.rollerLineTwo.StationEight == globalVar.rollerLineTwo.EmptyRollerNums.ElementAt(0))//工位8上面有桶且不是配方上的原料桶,即空桶
if ((globalVar.rollerLineTwo.StationEight != 0 && globalVar.rollerLineTwo.EmptyRollerNums.Count > 0 && globalVar.rollerLineTwo.StationEight == globalVar.rollerLineTwo.EmptyRollerNums.ElementAt(0) && LTwoInputMaterialQuene.Count > 0 && globalVar.rollerLineTwo.StationEight != LTwoInputMaterialQuene.ElementAt(0).materialType.MaterialLoc) || (res == null && globalVar.rollerLineTwo.StationEight != 0 && globalVar.rollerLineTwo.EmptyRollerNums.Count > 0 && globalVar.rollerLineTwo.StationEight == globalVar.rollerLineTwo.EmptyRollerNums.ElementAt(0)))//工位8上面有桶且不是配方上的原料桶,即空桶
{
//下发AGV去空桶线洗桶任务
e: string id = Guid.NewGuid().ToString("N");
@@ -1934,6 +2004,7 @@ namespace FryPot_DosingSystem.Control
Thread.Sleep(500);
LineToCleanCarryTaskErrorCodeAnalysis(info, 2);
globalVar.rollerLineTwo.IsEpmtyBefore = true;
// globalVar.rollerLineTwo.CanRun = false;
AgvFromLineTwoToClean(globalVar.rollerLineTwo.EmptyRollerNums.ElementAt(0));//AGV从线体2到清洗处
}
}
@@ -1945,10 +2016,10 @@ namespace FryPot_DosingSystem.Control
//线体3到清洗台
if (AlarmHelper<AlarmInfo>.Alarm.LThreeRollerTrouble == 0)//输送线无故障
{
if (!globalVar.rollerLineThree.IsEpmtyBefore)
if (!globalVar.rollerLineThree.IsEpmtyBefore && globalVar.rollerLineThree.CanRun)
{
var res = LThreeInputMaterialQuene.FirstOrDefault(p => p.materialType.MaterialLoc == globalVar.rollerLineThree.StationEight);
if (res == null && globalVar.rollerLineThree.StationEight != 0 && globalVar.rollerLineThree.EmptyRollerNums.Count > 0 && globalVar.rollerLineThree.StationEight == globalVar.rollerLineThree.EmptyRollerNums.ElementAt(0))//工位8上面有桶且不是配方上的原料桶,即空桶
if ((globalVar.rollerLineThree.StationEight != 0 && globalVar.rollerLineThree.EmptyRollerNums.Count > 0 && globalVar.rollerLineThree.StationEight == globalVar.rollerLineThree.EmptyRollerNums.ElementAt(0) && LThreeInputMaterialQuene.Count > 0 && globalVar.rollerLineThree.StationEight != LThreeInputMaterialQuene.ElementAt(0).materialType.MaterialLoc) || (res == null && globalVar.rollerLineThree.StationEight != 0 && globalVar.rollerLineThree.EmptyRollerNums.Count > 0 && globalVar.rollerLineThree.StationEight == globalVar.rollerLineThree.EmptyRollerNums.ElementAt(0)))//工位8上面有桶且不是配方上的原料桶,即空桶
{
//下发AGV去空桶线洗桶任务
e: string id = Guid.NewGuid().ToString("N");
@@ -1960,6 +2031,7 @@ namespace FryPot_DosingSystem.Control
Thread.Sleep(500);
LineToCleanCarryTaskErrorCodeAnalysis(info, 3);
globalVar.rollerLineThree.IsEpmtyBefore = true;
//globalVar.rollerLineThree.CanRun = false;
AgvFromLineThreeToClean(globalVar.rollerLineThree.EmptyRollerNums.ElementAt(0));//AGV从线体3到清洗处
}
}
@@ -1993,7 +2065,7 @@ namespace FryPot_DosingSystem.Control
{
//是否需要手动给PLC置位??
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)
goto e;

@@ -2063,6 +2135,7 @@ namespace FryPot_DosingSystem.Control
}
else
{
MessageLog.GetInstance.ShowRunLog($"【3】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作");
MessageLog.GetInstance.ShowUserLog($"【3】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作");
LThreeInputMaterialQuene.Clear();
LThreeErrorRecipe = true;
@@ -2164,6 +2237,7 @@ namespace FryPot_DosingSystem.Control
}
else
{
MessageLog.GetInstance.ShowRunLog($"【2】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作");
MessageLog.GetInstance.ShowUserLog($"【2】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作");
LTwoInputMaterialQuene.Clear();
LTwoErrorRecipe = true;
@@ -2262,6 +2336,7 @@ namespace FryPot_DosingSystem.Control
}
else
{
MessageLog.GetInstance.ShowRunLog($"【1】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作");
MessageLog.GetInstance.ShowUserLog($"【1】号滚筒线配方桶号配置错误,取消【{result.RecipeName}】配方制作");
InputMaterialQuene.Clear();
ErrorRecipe = true;
@@ -2363,8 +2438,23 @@ namespace FryPot_DosingSystem.Control
{
AgvToLineOneLoadRoller();
AgvFromLineOneToFryPot();//AGV到1号线体装桶
AgvLineOneLoadRollerCom();
}
}
/// <summary>
/// 判断agv在1号线体是否上料完成,作为线体空桶能否开始运输的条件
/// </summary>
/// <exception cref="NotImplementedException"></exception>
private void AgvLineOneLoadRollerCom()
{
if (globalVar.agvLineOneLoadCom)
{
globalVar.rollerLineOne.CanRun = true;
globalVar.agvLineOneLoadCom = false;
MessageLog.GetInstance.ShowRunLog("AGV在【1】号滚筒线装桶完成");
}
}

/// <summary>
/// AGV到配方线体2装桶以及出料到炒锅
/// </summary>
@@ -2372,13 +2462,25 @@ namespace FryPot_DosingSystem.Control
{
if (LTwoInputMaterialQuene.Count > 0)
{

AgvToLineTwoLoadRoller();
AgvFromLineTwoToFryPot();//AGV到2号线体装桶
AgvLineTwoLoadRollerCom();


}
}
/// <summary>
/// 判断agv在1号线体是否上料完成,作为线体空桶能否开始运输的条件
/// </summary>
private void AgvLineTwoLoadRollerCom()
{
if (globalVar.agvLineTwoLoadCom)
{
globalVar.rollerLineTwo.CanRun = true;
globalVar.agvLineTwoLoadCom = false;
MessageLog.GetInstance.ShowRunLog("AGV在【2】号滚筒线装桶完成");
}
}

/// <summary>
/// AGV到配方线体3装桶以及出料到炒锅
/// </summary>
@@ -2389,8 +2491,19 @@ namespace FryPot_DosingSystem.Control

AgvToLineThreeLoadRoller();
AgvFromLineThreeToFryPot();//AGV到2号线体装桶


AgvLineThreeLoadRollerCom();
}
}
/// <summary>
/// 判断agv在1号线体是否上料完成,作为线体空桶能否开始运输的条件
/// </summary>
private void AgvLineThreeLoadRollerCom()
{
if (globalVar.agvLineThreeLoadCom)
{
globalVar.rollerLineThree.CanRun = true;
globalVar.agvLineThreeLoadCom = false;
MessageLog.GetInstance.ShowRunLog("AGV在【3】号滚筒线装桶完成");
}
}
/// <summary>
@@ -2772,7 +2885,7 @@ namespace FryPot_DosingSystem.Control
{
globalVar.agvArriveLineFour = false;
//线体四信号交互
MessageLog.GetInstance.ShowRunLog("空桶到达空桶回收线体,准备卸桶");
MessageLog.GetInstance.ShowRunLog("AGV到达【4】号回收线体,准备卸桶");
MessageLog.GetInstance.ShowRunLog("卸桶完成");
}
}
@@ -3265,14 +3378,19 @@ namespace FryPot_DosingSystem.Control
{
MessageLog.GetInstance.ShowRunLog("AGV到达【1】号滚筒线装桶位置");
DeviceOperate.GetInstance.WritePlcData("D1052", 1);//agv到达线体1上料位置信号下发plc
MessageLog.GetInstance.ShowRunLog($"AGV正在装载{emptyRollerNum}号空料桶");
MessageLog.GetInstance.ShowRunLog($"AGV正在装载{emptyRollerNum}号空料桶");
AgvViewModel.GetInstance().Set滚筒线状态(1, IsRun.Start);
globalVar.LOneMaterialNum--;
globalVar.agvArriveLineOneLoadEmptyRoller = false;
globalVar.rollerLineOne.IsEpmtyBefore = false;
globalVar.rollerLineOne.EmptyRollerNums.RemoveAt(0);
//原料到位,agv到位,agv自行运料到清洗处
}
if (globalVar.agvArriveLineOneLoadCom)//上料完成
{
globalVar.rollerLineOne.EmptyRollerNums.RemoveAt(0);
globalVar.agvArriveLineOneLoadCom = false;
globalVar.rollerLineOne.IsEpmtyBefore = false;
MessageLog.GetInstance.ShowRunLog($"AGV在【1】号线体完成{emptyRollerNum}号空料桶装载");
}
}
else//有故障
{
@@ -3339,14 +3457,20 @@ namespace FryPot_DosingSystem.Control
{
MessageLog.GetInstance.ShowRunLog("AGV到达【2】号滚筒线装桶位置");
DeviceOperate.GetInstance.WritePlcData("D1053", 1);//agv到达线体2上料位置信号下发plc
MessageLog.GetInstance.ShowRunLog($"AGV正在装载{emptyRollerNum}号空料桶");
MessageLog.GetInstance.ShowRunLog($"AGV正在装载{emptyRollerNum}号空料桶");
AgvViewModel.GetInstance().Set滚筒线状态(2, IsRun.Start);
globalVar.LTwoMaterialNum--;
globalVar.agvArriveLineTwoLoadEmptyRoller = false;
globalVar.rollerLineTwo.IsEpmtyBefore = false;
globalVar.rollerLineTwo.EmptyRollerNums.RemoveAt(0);

//原料到位,agv到位,agv自行运料到清洗处
}
if (globalVar.agvArriveLineTwoLoadCom)//上料完成
{
globalVar.rollerLineTwo.EmptyRollerNums.RemoveAt(0);
globalVar.agvArriveLineTwoLoadCom = false;
globalVar.rollerLineTwo.IsEpmtyBefore = false;
MessageLog.GetInstance.ShowRunLog($"AGV在【2】号线体完成【{emptyRollerNum}】号空料桶装载");
}
}
else//有故障
{
@@ -3413,14 +3537,21 @@ namespace FryPot_DosingSystem.Control
{
MessageLog.GetInstance.ShowRunLog("AGV到达【3】号滚筒线装桶位置");
DeviceOperate.GetInstance.WritePlcData("D1054", 1);//agv到达线体3上料位置信号下发plc
MessageLog.GetInstance.ShowRunLog($"AGV正在装载{emptyRollerNum}号空料桶");
MessageLog.GetInstance.ShowRunLog($"AGV正在装载{emptyRollerNum}号空料桶");
AgvViewModel.GetInstance().Set滚筒线状态(3, IsRun.Start);
globalVar.LThreeMaterialNum--;
globalVar.agvArriveLineThreeLoadEmptyRoller = false;
globalVar.rollerLineThree.IsEpmtyBefore = false;
globalVar.rollerLineThree.EmptyRollerNums.RemoveAt(0);
// globalVar.rollerLineThree.IsEpmtyBefore = false;
//原料到位,agv到位,agv自行运料到清洗处
}
if (globalVar.agvArriveLineThreeLoadCom)//上料完成
{
globalVar.rollerLineThree.EmptyRollerNums.RemoveAt(0);
globalVar.agvArriveLineThreeLoadCom = false;
globalVar.rollerLineThree.IsEpmtyBefore = false;
MessageLog.GetInstance.ShowRunLog($"AGV在【3】号线体完成【{emptyRollerNum}】号空料桶装载");
}
}
else//有故障
{
@@ -3535,6 +3666,7 @@ namespace FryPot_DosingSystem.Control
{
if (globalVar.rollerLineOne.StationEight == InputMaterialQuene.ElementAt(0).materialType.MaterialLoc && !globalVar.rollerLineOne.IsEpmtyBefore)//工位8上面是配方料桶
{
globalVar.rollerLineOne.CanRun = false;
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)
goto e;
@@ -3545,6 +3677,10 @@ namespace FryPot_DosingSystem.Control
LineCarryTaskErrorCodeAnalysis(info, 1);
globalVar.LoadRoller = true;
}
//else if (globalVar.rollerLineOne.StationEight != InputMaterialQuene.ElementAt(0).materialType.MaterialLoc)
//{
// globalVar.rollerLineOne.CanRun = true;
//}
//else // 工位8上面不是配方料桶或没有桶时
//{
// if (!globalVar.rollerLineOne.IsEpmtyBefore)
@@ -3588,6 +3724,7 @@ namespace FryPot_DosingSystem.Control
{
if (globalVar.rollerLineTwo.StationEight == LTwoInputMaterialQuene.ElementAt(0).materialType.MaterialLoc && !globalVar.rollerLineTwo.IsEpmtyBefore)//工位8上面是配方料桶
{
globalVar.rollerLineTwo.CanRun = false;
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)
goto e;
@@ -3598,6 +3735,10 @@ namespace FryPot_DosingSystem.Control
LineCarryTaskErrorCodeAnalysis(info, 2);
globalVar.LTwoLoadRoller = true;
}
//else if (globalVar.rollerLineTwo.StationEight != LTwoInputMaterialQuene.ElementAt(0).materialType.MaterialLoc)
//{
// globalVar.rollerLineTwo.CanRun = true;
//}
}
//else// 工位8上面不是配方料桶或没有桶时
//{
@@ -3634,6 +3775,7 @@ namespace FryPot_DosingSystem.Control
{
if (globalVar.rollerLineThree.StationEight == LThreeInputMaterialQuene.ElementAt(0).materialType.MaterialLoc && !globalVar.rollerLineThree.IsEpmtyBefore)//工位8上面是配方料桶
{
globalVar.rollerLineThree.CanRun = false;
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)
goto e;
@@ -3644,6 +3786,10 @@ namespace FryPot_DosingSystem.Control
LineCarryTaskErrorCodeAnalysis(info, 3);
globalVar.LThreeLoadRoller = true;
}
//else if (globalVar.rollerLineThree.StationEight != LThreeInputMaterialQuene.ElementAt(0).materialType.MaterialLoc)
//{
// globalVar.rollerLineThree.CanRun = true;
//}
//else // 工位8上面不是配方料桶或没有桶时
//{
// if (!globalVar.rollerLineThree.IsEpmtyBefore)


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

@@ -165,6 +165,7 @@ namespace FryPot_DosingSystem.Control
public bool agvArriveUnLoad { get; set; }
public bool agvFryPotEmptyRollerArrive { get; set; }
public bool EmptyRollerUnLoadcCom { get; set; }//AGV空桶4号线体下料完成
public bool agvLineOneLoadCom { get; set; }//线体1上料完成

public int LTwoMaterialNum { get; set; } = 0;
public int LTwoFryPotSerial { get; set; } = 2;
@@ -172,7 +173,7 @@ namespace FryPot_DosingSystem.Control
public bool agvArriveLTwoUpLoad { get; set; }
public bool LTwoagvArriveUnLoad { get; set; }
public bool LTwoagvFryPotEmptyRollerArrive { get; set; }
public bool LTwoEmptyRollerUnLoadcCom { get; set; }//AGV空桶4号线体下料完成
public bool agvLineTwoLoadCom { get; set; }//线体2上料完成

public int LThreeMaterialNum { get; set; } = 0;
public int LThreeFryPotSerial { get; set; } = 3;
@@ -180,11 +181,11 @@ namespace FryPot_DosingSystem.Control
public bool agvArriveLThreeUpLoad { get; set; }
public bool LThreeagvArriveUnLoad { get; set; }
public bool LThreeagvFryPotEmptyRollerArrive { get; set; }
public bool LThreeEmptyRollerUnLoadcCom { get; set; }//AGV空桶4号线体下料完成
public bool agvLineThreeLoadCom { get; set; }//线体1上料完成

public int LFourRollerNum { get; set; } = 0;//4号线体空桶数量
//新增
public bool agvArriveLineFour { get; set; }//agv到达线体4下料位置从清台或炒锅
//新增空桶清洗系列变量
public bool agvArriveLineFour { get; set; }//agv到达线体4下料位置从清台或炒锅
public bool agvArriveCleanUnLoad { get; set; }//agv到达清洗台下料位置
public bool agvArriveCleanLoad { get; set; }//agv到达清洗台上料位置

@@ -192,6 +193,11 @@ namespace FryPot_DosingSystem.Control
public bool agvArriveLineTwoLoadEmptyRoller { get; set; }//agv到达线体2空桶上料位置

public bool agvArriveLineThreeLoadEmptyRoller { get; set; }//agv到达线体3空桶上料位置

public bool agvArriveLineOneLoadCom { get; set; } //agv线体1空桶上料完成
public bool agvArriveLineTwoLoadCom { get; set; } //agv线体2空桶上料完成
public bool agvArriveLineThreeLoadCom { get; set; }//agv线体3空桶上料完成
//空桶清洗流程锁
#endregion
}
/// <summary>
@@ -255,7 +261,9 @@ namespace FryPot_DosingSystem.Control
/// <summary>
/// 上一个桶是否是空桶
/// </summary>
public bool IsEpmtyBefore { get; set; }
public bool IsEpmtyBefore { get; set; } //空桶上料结束后,配方料桶AGV才能去1号线装桶

public bool CanRun { get; set; } = true; //配方料桶上料结束后,线体空桶AGV才能1号线装桶
/// <summary>
/// 线体1上所有空桶的编号集合
/// </summary>
@@ -324,10 +332,11 @@ namespace FryPot_DosingSystem.Control
/// </summary>
public bool IsEpmtyBefore { get; set; }

public bool CanRun { get; set; } = true; //配方料桶上料结束后,线体空桶AGV才能1号线装桶
/// <summary>
/// 线体2上所有空桶的编号集合
/// </summary>
public List<ushort> EmptyRollerNums { get; set; }=new List<ushort>();
public List<ushort> EmptyRollerNums { get; set; }=new List<ushort>() { 208};
}
/// <summary>
/// 滚筒线3相关变量
@@ -392,6 +401,8 @@ namespace FryPot_DosingSystem.Control
/// </summary>
public bool IsEpmtyBefore { get; set; }

public bool CanRun { get; set; } = true;//配方料桶上料结束后,线体空桶AGV才能1号线装桶

/// <summary>
/// 线体3上所有空桶的编号集合
/// </summary>


+ 15
- 3
FryPot_DosingSystem/View/DebugView.xaml Просмотреть файл

@@ -39,10 +39,12 @@
<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 FryPotEmptyRollerArrive}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="800" Y1="0" Y2="0"/>
<Button Content="线体1任务重置" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineOneTaskExit}"></Button>
<Button Content="AGV接口调试" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvDebug}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="800" Y1="0" Y2="0"/>
<WrapPanel Orientation="Horizontal">
<Button Content="空桶清洗任务重置" Width="140" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding EmptyRollerCleanTaskRestart}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="800" Y1="0" Y2="0"/>
<WrapPanel Orientation="Horizontal">
<Button Content="清洗台呼叫AGV" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding CleanPlateCallAgv}"/>
</WrapPanel>
</WrapPanel>
@@ -53,13 +55,15 @@
<WrapPanel Orientation="Horizontal">
<Button Content="AGV线体1上料就位" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLOneArrive}"/>
<Button Content="AGV炒锅下料就位" Style="{StaticResource buttonStyle}" RenderTransformOrigin="0.5,0.5" Width="114" Command="{Binding AGVFryPotDownArrive}">
<Button Content="AGV线体1上料完成" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLineOneLoadCom}"/>
<Button Content="AGV炒锅下料就位" Style="{StaticResource buttonStyle}" RenderTransformOrigin="0.5,0.5" Width="114" Command="{Binding AGVFryPotDownArrive}">
</Button>
<Button Content="AGV炒锅空桶上料就位" Style="{StaticResource buttonStyle}" Width="139" Command="{Binding AGVFryPotUpArrive}"/>
<Button Content="AGV拿到空桶信号" Style="{StaticResource buttonStyle}" Width="114" Command="{Binding AGVFryPotGetEmptyRoller}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="800" Y1="0" Y2="0"/>
<WrapPanel Orientation="Horizontal">
<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空桶清洗下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLoc}"/>
<Button Content="AGV线体4空桶下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLoc}"/>
<Button Content="AGV空桶清洗上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoad}"/>
@@ -77,6 +81,7 @@
<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 FryPotTwoEmptyRollerArrive}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="800" Y1="0" Y2="0"/>
<Button Content="线体2任务重置" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineTwoTaskExit}"></Button>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="800" Y1="0" Y2="0"/>
<WrapPanel Orientation="Horizontal">
@@ -87,6 +92,7 @@
<GroupBox Grid.Column="2" Header="AGV信号" Foreground="Aqua">
<WrapPanel Orientation="Horizontal">
<Button Content="AGV线体2上料就位" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLTwoArrive}"/>
<Button Content="AGV线体2上料完成" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLineTwoLoadCom}"/>
<Button Content="AGV炒锅下料就位" Style="{StaticResource buttonStyle}" RenderTransformOrigin="0.5,0.5" Width="114" Command="{Binding AGVFryPotTwoDownArrive}">
</Button>
<Button Content="AGV炒锅空桶上料就位" Style="{StaticResource buttonStyle}" Width="139" Command="{Binding AGVFryPotTwoUpArrive}"/>
@@ -94,8 +100,10 @@
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="800" Y1="0" Y2="0"/>
<WrapPanel Orientation="Horizontal">
<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空桶清洗下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLoc}"/>
<Button Content="AGV线体4空桶下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLoc}"/>
<Button Content="AGV空桶清洗上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoad}"/>
</WrapPanel>
</WrapPanel>
</GroupBox>
@@ -108,6 +116,7 @@
<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 FryPotThreeEmptyRollerArrive}"/>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="800" Y1="0" Y2="0"/>
<Button Content="线体3任务重置" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding LineThreeTaskExit}"></Button>
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="800" Y1="0" Y2="0"/>
<WrapPanel Orientation="Horizontal">
@@ -118,6 +127,7 @@
<GroupBox Grid.Column="2" Header="AGV信号" Foreground="Aqua">
<WrapPanel Orientation="Horizontal">
<Button Content="AGV线体3上料就位" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLThreeArrive}"/>
<Button Content="AGV线体3上料完成" Style="{StaticResource buttonStyle}" Width="120" Command="{Binding AGVLineThreeLoadCom}"/>
<Button Content="AGV炒锅下料就位" Style="{StaticResource buttonStyle}" RenderTransformOrigin="0.5,0.5" Width="114" Command="{Binding AGVFryPotThreeDownArrive}">
</Button>
<Button Content="AGV炒锅空桶上料就位" Style="{StaticResource buttonStyle}" Width="139" Command="{Binding AGVFryPotThreeUpArrive}"/>
@@ -125,8 +135,10 @@
<Line Stroke="Aqua" StrokeThickness="2" X1="0" X2="800" Y1="0" Y2="0"/>
<WrapPanel Orientation="Horizontal">
<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空桶清洗下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLoc}"/>
<Button Content="AGV线体4空桶下料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveLineFourLoc}"/>
<Button Content="AGV空桶清洗上料就位" Width="145" Style="{StaticResource buttonStyle}" VerticalAlignment="Top" Command="{Binding AgvArriveCleanPlateLocLoad}"/>
</WrapPanel>
</WrapPanel>
</GroupBox>


+ 3
- 2
FryPot_DosingSystem/View/RecipeSendDownView.xaml Просмотреть файл

@@ -116,7 +116,8 @@
</Grid.ColumnDefinitions>
<Line StrokeThickness="3" Grid.Column="0" HorizontalAlignment="Left" Stroke="LawnGreen" X1="0" Y1="5" X2="0" Y2="110"></Line>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<Button Margin="0,0,0,5" Height="27" Command="{Binding DataContext.RecipeSetDownCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}" CommandParameter="{Binding RecipeId}" Cursor="Hand" >
<TextBlock FontSize="16" Text="{Binding RecipeSetInfo}" VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock>
<Button Margin="0,5,0,0" Height="27" Command="{Binding DataContext.RecipeSetDownCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}" CommandParameter="{Binding RecipeId}" Cursor="Hand" >
<Button.Template>
<ControlTemplate TargetType="{x:Type Button}">
<StackPanel Orientation="Horizontal" >
@@ -133,7 +134,7 @@
</Button.Template>
</Button>
<TextBlock FontSize="16" Text="{Binding RecipeSetInfo}" VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock>
</StackPanel>
</Grid>


+ 39
- 2
FryPot_DosingSystem/ViewModel/DebugViewModel.cs Просмотреть файл

@@ -28,6 +28,7 @@ namespace FryPot_DosingSystem.ViewModel
public RelayCommand AGVFryPotDownArrive { get; set; }
public RelayCommand AGVFryPotUpArrive { get; set; }
public RelayCommand AGVFryPotGetEmptyRoller { get; set; }
public RelayCommand AGVLineOneLoadCom { get; set; }//线体1上料完成

//滚筒线2绑定命令
public RelayCommand RollerLineTwoRunning { get; set; }
@@ -41,6 +42,7 @@ namespace FryPot_DosingSystem.ViewModel
public RelayCommand AGVFryPotTwoDownArrive { get; set; }
public RelayCommand AGVFryPotTwoUpArrive { get; set; }
public RelayCommand AGVFryPotTwoGetEmptyRoller { get; set; }
public RelayCommand AGVLineTwoLoadCom { get; set; }//线体2上料完成
//滚筒线3绑定命令
public RelayCommand RollerLineThreeRunning { get; set; }
//public RelayCommand EightWorkLoc { get; set; }
@@ -52,27 +54,62 @@ namespace FryPot_DosingSystem.ViewModel
public RelayCommand AGVFryPotThreeDownArrive { get; set; }
public RelayCommand AGVFryPotThreeUpArrive { get; set; }
public RelayCommand AGVFryPotThreeGetEmptyRoller { get; set; }
public RelayCommand AGVLineThreeLoadCom { get; set; }//线体3上料完成

//AGV接口联调
public RelayCommand AgvDebug { get; set; }

//线体123空桶清洗以及回收
public RelayCommand AgvArriveLineOneEmptyRollerLoc { get; set; }

public RelayCommand AgvLineOneLoadEmptyCom { get; set; }
public RelayCommand AgvArriveLineTwoEmptyRollerLoc { get; set; }
public RelayCommand AgvLineTwoLoadEmptyCom { get; set; }
public RelayCommand AgvArriveLineThreeEmptyRollerLoc { get; set; }
public RelayCommand AgvLineThreeLoadEmptyCom { get; set; }
public RelayCommand CleanPlateCallAgv { get; set; }
public RelayCommand AgvArriveCleanPlateLoc { get; set; }//下料
public RelayCommand AgvArriveLineFourLoc { get; set; }

public RelayCommand AgvArriveCleanPlateLocLoad { get; set; }//上料

public RelayCommand EmptyRollerCleanTaskRestart { get; set; }
public DebugViewModel()
{
AgvDebug = new RelayCommand(new Action(() =>
{
ActionManage.GetInstance.Send("AgvDebug");
}));

EmptyRollerCleanTaskRestart = new RelayCommand(() =>
{

ActionManage.GetInstance.Send("EmptyRollerCleanTaskRestart");
});
AgvLineOneLoadEmptyCom = new RelayCommand(() => {
ActionManage.GetInstance.Send("AgvLineOneLoadEmptyCom");
});
AgvLineTwoLoadEmptyCom = new RelayCommand(() => {
ActionManage.GetInstance.Send("AgvLineTwoLoadEmptyCom");
});
AgvLineThreeLoadEmptyCom = new RelayCommand(() => {
ActionManage.GetInstance.Send("AgvLineThreeLoadEmptyCom");
});
AGVLineOneLoadCom = new RelayCommand(() =>
{
ActionManage.GetInstance.Send("AGVLineOneLoadCom");
});
AGVLineTwoLoadCom = new RelayCommand(() =>
{
ActionManage.GetInstance.Send("AGVLineTwoLoadCom");

});
AGVLineThreeLoadCom = new RelayCommand(() =>
{
ActionManage.GetInstance.Send("AGVLineThreeLoadCom");

});
AgvArriveLineOneEmptyRollerLoc = new RelayCommand(new Action(() =>
{
ActionManage.GetInstance.Send("AgvArriveLineOneEmptyRollerLoc");


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