Browse Source

morkF

样式分支
NXX 2 years ago
parent
commit
fb8f1135c6
3 changed files with 61 additions and 36 deletions
  1. +55
    -34
      BPASmartClient.MorkF/Control_MorkF.cs
  2. +5
    -1
      BPASmartClient.MorkF/View/LocalMenu.xaml.cs
  3. +1
    -1
      BPASmartClient.MorkF/ViewModel/DebugViewModel.cs

+ 55
- 34
BPASmartClient.MorkF/Control_MorkF.cs View File

@@ -142,14 +142,19 @@ namespace BPASmartClient.MorkF
/// <param name="o"></param>
public void OutSeasoning(object o)
{
if (o == null) return;
if (o is List<int> ints && ints.Count == 2)
ThreadManage.GetInstance().Start(new Action(() =>
{
FirePot1_Write(morkF.PassWayValue[ints[0]], (ushort)ints[1]);//写入通道值
Thread.Sleep(400);
FirePot1_Write(morkF.StartPassWay[ints[0]], true);//开启通道
Thread.Sleep(400);
}
if (o == null) return;
if (o is List<int> ints && ints.Count == 2)
{
FirePot1_Write(morkF.PassWayValue[ints[0]], (ushort)ints[1]);//写入通道值
Thread.Sleep(400);
FirePot1_Write(morkF.StartPassWay[ints[0]], true);//开启通道
Thread.Sleep(400);
}
}), "出调料");

}
/// <summary>
/// 出多个调料
@@ -166,6 +171,12 @@ namespace BPASmartClient.MorkF
FirePot1_Write(morkF.StartPassWay[seasoning.Loc], true);
Thread.Sleep(300);
}
foreach (SeasoningList seasoning in seasoningLists)
{
FirePot1_Write(morkF.StartPassWay[seasoning.Loc], false);
Thread.Sleep(300);
}


}

@@ -236,47 +247,55 @@ namespace BPASmartClient.MorkF
//倒菜
public void OutFood()
{
FirePot1_Write("LB3", true);
MessageLog.GetInstance.Show("倒菜启动");
while (!morkF.FryPot1_MaterialIntoPot)
{
FirePot1_Write("LB3", true);
Thread.Sleep(400);
MessageLog.GetInstance.Show("倒菜启动");
while (!morkF.FryPot1_MaterialIntoPot)
{
Thread.Sleep(200);
}
FirePot1_Write("LB3", false);
Thread.Sleep(200);
}
FirePot1_Write("LB3", false);
Thread.Sleep(200);
MessageLog.GetInstance.Show("倒菜完成");
MessageLog.GetInstance.Show("倒菜完成");

}
//搅拌臂去原点位
public void StirArmGoOrigin()
{
FirePot1_Write("LB5", true);
MessageLog.GetInstance.Show("搅拌臂去原点位");
while (!morkF.ArmOnOrigin)
{
FirePot1_Write("LB5", true);
MessageLog.GetInstance.Show("搅拌臂去原点位");
while (!morkF.ArmOnOrigin)
{
Thread.Sleep(200);
}
FirePot1_Write("LB5", false);
Thread.Sleep(200);
}
FirePot1_Write("LB5", false);
Thread.Sleep(200);
MessageLog.GetInstance.Show("搅拌臂到达原点位");
MessageLog.GetInstance.Show("搅拌臂到达原点位");


}

//搅拌臂去炒制位
public void StirArmGoWork()
{
if (!morkF.ArmOnWorking)
{
FirePot1_Write("LB6", true);
MessageLog.GetInstance.Show("搅拌臂去工作位");
while (!morkF.ArmOnWorking)
if (!morkF.ArmOnWorking)
{
FirePot1_Write("LB6", true);
MessageLog.GetInstance.Show("搅拌臂去工作位");
while (!morkF.ArmOnWorking)
{
Thread.Sleep(200);
}

FirePot1_Write("LB6", false);
Thread.Sleep(200);
MessageLog.GetInstance.Show("搅拌臂到达工作位");
}

FirePot1_Write("LB6", false);
Thread.Sleep(200);
MessageLog.GetInstance.Show("搅拌臂到达工作位");
}

}
//HBOT放盒子到位
@@ -394,7 +413,7 @@ namespace BPASmartClient.MorkF
}));
GetStatus("LB74", new Action<bool[]>((bools) =>
{
for (int i = 0; i < 15; i++)
for (int i = 0; i < 14; i++)
{
morkF.PassWay1_Compelete[i] = bools[i];
}
@@ -744,6 +763,8 @@ namespace BPASmartClient.MorkF
}
Plc1Reset();//复位
Thread.Sleep(4000);
StirArmGoOrigin();
MessageLog.GetInstance.Show($"菜品{res.GoodName}完成");

}


+ 5
- 1
BPASmartClient.MorkF/View/LocalMenu.xaml.cs View File

@@ -43,7 +43,11 @@ namespace BPASmartClient.MorkF.View
public LocalMenu()
{
InitializeComponent();
ActionManage.GetInstance.Register(new Action(() => { this.Close(); }), "LocalMenuClose");
ActionManage.GetInstance.CancelRegister ("LocalMenuClose");
ActionManage.GetInstance.Register(new Action(() =>
{
this.Close();
}), "LocalMenuClose");
}

private void Button_Click(object sender, RoutedEventArgs e)


+ 1
- 1
BPASmartClient.MorkF/ViewModel/DebugViewModel.cs View File

@@ -193,7 +193,7 @@ namespace BPASmartClient.MorkF.ViewModel
#endregion

#region 配料仓控制
OutMaterials = new RelayCommand(() => { ActionManage.GetInstance.Send("OutMaterials" ,new List<int> { PassagePosition,Weight } ); });
OutMaterials = new RelayCommand(() => { ActionManage.GetInstance.Send("OutMaterials" ,new List<int> { PassagePosition+1,Weight } ); });
#endregion

#region 炒锅1


Loading…
Cancel
Save