瀏覽代碼

morkf_增加机械臂控制

样式分支
yahaha 2 年之前
父節點
當前提交
f9b1e15c3b
共有 5 個文件被更改,包括 304 次插入192 次删除
  1. +10
    -0
      BPASmartClient.Helper/ThreadManage.cs
  2. +25
    -1
      BPASmartClient.Modbus/ModbusTcp.cs
  3. +248
    -157
      BPASmartClient.MorkF/Control_MorkF.cs
  4. +19
    -33
      BPASmartClient.MorkF/View/DebugView.xaml
  5. +2
    -1
      BPASmartClient.MorkF/ViewModel/DebugViewModel.cs

+ 10
- 0
BPASmartClient.Helper/ThreadManage.cs 查看文件

@@ -190,6 +190,16 @@ namespace BPASmartClient.Helper
return false;
}

/// <summary>
/// 根据key获取取消状态,为start()开启的task在外部停止使用。
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public bool IsCanncel(string key)
{
if(CancellationTokenSources.ContainsKey(guid + key)) return CancellationTokenSources[guid + key].IsCancellationRequested;
return false;
}
}

}

+ 25
- 1
BPASmartClient.Modbus/ModbusTcp.cs 查看文件

@@ -144,7 +144,7 @@ namespace BPASmartClient.Modbus
}
}

else if (address.ToUpper().Contains("VW") && address.Length >= 3)
else if ((address.ToUpper().Contains("VW") || address.ToUpper().Contains("VD")) && address.Length >= 3)
{
var res = address.Substring(2);
if (res != null && int.TryParse(res, out int tempAddress))
@@ -246,6 +246,17 @@ namespace BPASmartClient.Modbus
commandType = CommandType.Coils;
return master.ReadCoils(slaveAddress, startAddress, len);
}
else if (address.ToUpper().Contains("VD"))
{
commandType = CommandType.HoldingRegisters;
var var1 = master.ReadHoldingRegisters(slaveAddress, startAddress, len);
var var2 = master.ReadHoldingRegisters(slaveAddress, (ushort)(startAddress + 1), len);
int dest = 0;
dest |= (var2[0] & 0x0000ffff);
dest = (dest << 16) | (var1[0] & 0x0000ffff);
return dest;

}
else if (address.ToUpper().Contains("VW") || address.ToUpper().Contains("LW") || address.ToUpper().Contains("D"))
{
commandType = CommandType.HoldingRegisters;
@@ -333,6 +344,19 @@ namespace BPASmartClient.Modbus
else if (value is bool[] boolsValue)
master.WriteMultipleCoils(slaveAddress, startAddress, boolsValue);
}
else if (address.ToUpper().Contains("VD"))
{
commandType = CommandType.HoldingRegisters;
if (value is int intValue)
{

var val1 = (UInt16)intValue;
var val2 = Convert.ToUInt16(intValue >> 16 & 0x0000ffff);
master.WriteSingleRegister(slaveAddress, startAddress, val1);
master.WriteSingleRegister(slaveAddress, (ushort)(startAddress + 1), val2);
}

}
else if (address.ToUpper().Contains("VW") || address.ToUpper().Contains("LW") || address.ToUpper().Contains("D"))
{
commandType = CommandType.HoldingRegisters;


+ 248
- 157
BPASmartClient.MorkF/Control_MorkF.cs 查看文件

@@ -51,6 +51,13 @@ namespace BPASmartClient.MorkF
/// </summary>
private ConcurrentQueue<OrderLocInfo> StirFryGoodsQuenes = new ConcurrentQueue<OrderLocInfo>();

private const String striConst = "炒锅{0}炒制{1}线程";

/// <summary>
/// 当前炒制菜品
/// </summary>
private OrderLocInfo nowStirFryGood = null;

List<int> resultorder = new List<int>();//调试变量

/// <summary>
@@ -58,7 +65,13 @@ namespace BPASmartClient.MorkF
/// </summary>
public override void DoMain()
{
for(int i = 0;i< count;i++)

WriteControl("VD836", 0);
WriteControl("VD840", 0);
Thread.Sleep(400);
WriteControl("M0.0", true);

for (int i = 0;i< count;i++)
{
morkFs.Add(i, new GVL_MorkF());
DataParse(i);//数据解析
@@ -67,6 +80,8 @@ namespace BPASmartClient.MorkF
CommandRegist();//调试
ServerInit();
DeviceProcessLogShow("MORKF 设备初始化完成");

ReadData();
}
#region 调试代码
public void CommandRegist()
@@ -75,6 +90,7 @@ namespace BPASmartClient.MorkF
ActionManage.GetInstance.Register(PLCInite, "InitCommand");
ActionManage.GetInstance.Register(StartOrder, "StartOrder");
ActionManage.GetInstance.Register(StartLocalOrder, "StartLocalOrder");
ActionManage.GetInstance.Register(StopLocalOrder, "StopLocalOrder");
#endregion

#region 菜品库
@@ -317,7 +333,7 @@ namespace BPASmartClient.MorkF
}
foreach (SeasoningList seasoning in seasoningLists)
{
FirePot1_Write(morkF.StartPassWay[seasoning.Loc], false);
FirePot1_Write(morkFs[num].StartPassWay[seasoning.Loc], false, num);
Thread.Sleep(300);
}

@@ -585,6 +601,14 @@ namespace BPASmartClient.MorkF
MessageLog.GetInstance.Show($"添加本地模拟的订单{Json<LocalPotStep>.Data.LocalstirFryGoods.GoodsKey}");
}
}

private void StopLocalOrder()
{
//判断当前是否有炒制菜品
if (nowStirFryGood == null) return;

ThreadManage.GetInstance().StopTask(String.Format(striConst, fryIndex.ToString(), nowStirFryGood.GoodName), new Action(() => { Plc1Reset(fryIndex); }));
}
#endregion

public override void ResetProgram()
@@ -606,41 +630,46 @@ namespace BPASmartClient.MorkF

for (int i = 0; i < morkFs.Count; i++)
{
GetStatus("LB50", new Action<bool[]>((bools) =>
GetStatus("LB50", new Action<object>((objects) =>
{
if (!morkFs.ContainsKey(i))
{
return;
}
if(objects is bool[] bools)
{
morkFs[i].FryPot1_InitialComplete = bools[0];
morkFs[i].FryPot1_HOBTPut = bools[1];
morkFs[i].FryPot1_HOBTGet = bools[2];
morkFs[i].FryPot1_MaterialIntoPot = bools[3];
morkFs[i].OutFoodCompelete = bools[4];
morkFs[i].CanOutFood = bools[5];
morkFs[i].GetFoodCompelete = bools[6];
morkFs[i].CanOutPotWashingWater = bools[7];
morkFs[i].ArmOnOrigin = bools[8];
morkFs[i].ArmOnWorking = bools[9];
morkFs[i].PotOnOrigin = bools[10];
}

morkFs[i].FryPot1_InitialComplete = bools[0];
morkFs[i].FryPot1_HOBTPut = bools[1];
morkFs[i].FryPot1_HOBTGet = bools[2];
morkFs[i].FryPot1_MaterialIntoPot = bools[3];
morkFs[i].OutFoodCompelete = bools[4];
morkFs[i].CanOutFood = bools[5];
morkFs[i].GetFoodCompelete = bools[6];
morkFs[i].CanOutPotWashingWater = bools[7];
morkFs[i].ArmOnOrigin = bools[8];
morkFs[i].ArmOnWorking = bools[9];
morkFs[i].PotOnOrigin = bools[10];
}), i);
}
for (int j = 0; j < morkFs.Count; j++)
{
GetStatus("LB74", new Action<bool[]>((bools) =>
GetStatus("LB74", new Action<object>((objects) =>
{
if (!morkFs.ContainsKey(j))
{
return;
}

for (int i = 0; i < 14; i++)
if (objects is bool[] bools)
{
morkFs[j].PassWay1_Compelete[i] = bools[i];
for (int i = 0; i < 14; i++)
{
morkFs[j].PassWay1_Compelete[i] = bools[i];
}
}


}), j);
}
for (int i = 0; i < morkFs.Count; i++)
@@ -650,14 +679,70 @@ namespace BPASmartClient.MorkF
return;
}

GetStatus("LB90", new Action<bool[]>((bools) =>
GetStatus("LB90", new Action<object>((objects) =>
{
morkFs[i].AutoMode = bools[0];
if (objects is bool[] bools)
{
morkFs[i].AutoMode = bools[0];
}

}), i);
}


for (int j = 0; j < morkFs.Count; j++)
{
GetStatus("VD808", new Action<object>((objects) =>
{
if (!morkFs.ContainsKey(j))
{
return;
}

if (objects is object[] bools)
{
for (int i = 0; i < 1; i++)
{
var a = bools[i];
}
}


}), j);
GetStatus("VD814", new Action<object>((objects) =>
{
if (!morkFs.ContainsKey(j))
{
return;
}

if (objects is object[] bools)
{
for (int i = 0; i < 1; i++)
{
var a = bools[i];
}
}


}), j);
GetStatus("VD816", new Action<object>((objects) =>
{
if (!morkFs.ContainsKey(j))
{
return;
}

if (objects is object[] bools)
{
for (int i = 0; i < 1; i++)
{
var a = bools[i];
}
}

}), j);
}

}
private void ServerInit()
@@ -905,161 +990,167 @@ namespace BPASmartClient.MorkF
//待炒小炒队列出队列
if (StirFryGoodsQuenes.TryDequeue(out var res))
{
try
{

//设置当前炒制菜品
nowStirFryGood = res;
//炒锅工作状态置为正在工作中
morkFs[i].FryWorking = true;
//空闲炒锅入队列
morkFs[i].StirFryGoodsQuenes.Enqueue(res);
MessageLog.GetInstance.Show($"菜品{res.GoodName}开始炒制");
MessageLog.GetInstance.Show($"炒锅{i}开始炒制菜品{res.GoodName}");

//开启线程进行炒制
ThreadManage.GetInstance().Start(new Action(() =>
{
foreach (var potActions in res.StirPotActions)
try
{
switch (potActions.Actions)
foreach (var potActions in res.StirPotActions)
{
case nameof(StirFryPotActionEnum.加热开启):
StartFire(i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.设置加热挡位1):
SetFire(new List<int> { 1 }, i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.设置加热挡位2):
SetFire(new List<int> { 2 }, i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.设置加热挡位3):
SetFire(new List<int> { 3 }, i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.设置加热挡位4):
SetFire(new List<int> { 4 }, i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.设置加热挡位5):
SetFire(new List<int> { 5 }, i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.设置加热挡位6):
SetFire(new List<int> { 6 }, i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.设置加热挡位7):
SetFire(new List<int> { 7 }, i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.设置加热挡位8):
SetFire(new List<int> { 8 }, i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.设置加热挡位9):
SetFire(new List<int> { 9 }, i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.设置加热挡位10):
SetFire(new List<int> { 10 }, i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.停止加热):
StopFire(i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.加调料):
OutSeasonings(potActions.SeasoningLists, i);
MessageLog.GetInstance.Show(potActions.Actions);
if (ThreadManage.GetInstance().IsCanncel(String.Format(striConst, i.ToString(), nowStirFryGood.GoodName)))
{
break;
case nameof(StirFryPotActionEnum.取原料):
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.开启搅拌):
StartStir(i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.设置搅拌挡位1):
SetStir(new List<int> { 1 }, i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.设置搅拌挡位2):
SetStir(new List<int> { 2 }, i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.设置搅拌挡位3):
SetStir(new List<int> { 3 }, i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.关闭搅拌):
StopStir(i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.出餐启动):
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.道菜启动):
OutFood(i);
break;
case nameof(StirFryPotActionEnum.炒制菜品):
Thread.Sleep(potActions.During * 1000);
break;
case nameof(StirFryPotActionEnum.搅拌臂原点位):
StirArmGoOrigin(i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.搅拌臂炒制位):
StirArmGoWork(i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.洗锅):
MessageLog.GetInstance.Show(potActions.Actions);
break;
default:
break;

}

switch (potActions.Actions)
{
case nameof(StirFryPotActionEnum.加热开启):
StartFire(i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.设置加热挡位1):
SetFire(new List<int> { 1 }, i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.设置加热挡位2):
SetFire(new List<int> { 2 }, i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.设置加热挡位3):
SetFire(new List<int> { 3 }, i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.设置加热挡位4):
SetFire(new List<int> { 4 }, i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.设置加热挡位5):
SetFire(new List<int> { 5 }, i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.设置加热挡位6):
SetFire(new List<int> { 6 }, i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.设置加热挡位7):
SetFire(new List<int> { 7 }, i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.设置加热挡位8):
SetFire(new List<int> { 8 }, i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.设置加热挡位9):
SetFire(new List<int> { 9 }, i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.设置加热挡位10):
SetFire(new List<int> { 10 }, i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.停止加热):
StopFire(i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.加调料):
OutSeasonings(potActions.SeasoningLists, i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.取原料):
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.开启搅拌):
StartStir(i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.设置搅拌挡位1):
SetStir(new List<int> { 1 }, i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.设置搅拌挡位2):
SetStir(new List<int> { 2 }, i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.设置搅拌挡位3):
SetStir(new List<int> { 3 }, i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.关闭搅拌):
StopStir(i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.出餐启动):
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.道菜启动):
OutFood(i);
break;
case nameof(StirFryPotActionEnum.炒制菜品):
Thread.Sleep(potActions.During * 1000);
break;
case nameof(StirFryPotActionEnum.搅拌臂原点位):
StirArmGoOrigin(i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.搅拌臂炒制位):
StirArmGoWork(i);
MessageLog.GetInstance.Show(potActions.Actions);
break;
case nameof(StirFryPotActionEnum.洗锅):
MessageLog.GetInstance.Show(potActions.Actions);
break;
default:
break;

}
}
}


Plc1Reset(i);//复位
Thread.Sleep(3000);
//回原点位
StirArmGoOrigin(i);
Plc1Reset(i);//复位
Thread.Sleep(3000);
//回原点位
StirArmGoOrigin(i);

for (int i = 0; i < sleepCount && !morkFs[i].ArmOnOrigin; i++)
{
Thread.Sleep(sleepTime);
if (i >= sleepCount - 1)
for (int i = 0; i < sleepCount && !morkFs[i].ArmOnOrigin; i++)
{
MessageLog.GetInstance.Show($"炒锅{i}炒制过程完成后,搅拌臂去原点位超时");
Thread.Sleep(sleepTime);
if (i >= sleepCount - 1)
{
MessageLog.GetInstance.Show($"炒锅{i}炒制过程完成后,搅拌臂去原点位超时");
}
}
}

//while (!morkFs[i].ArmOnOrigin)
//{
// Thread.Sleep(100);
//}
//出餐
//OutMeal(i);
MessageLog.GetInstance.Show($"菜品{res.GoodName}完成");

//while (!morkFs[i].ArmOnOrigin)
//{
// Thread.Sleep(100);
//}
//出餐
//OutMeal(i);
MessageLog.GetInstance.Show($"菜品{res.GoodName}完成");

}), $"炒锅{i}炒制线程");
}
catch(Exception ex)
{
ThreadManage.GetInstance().StopTask($"炒锅{i}炒制线程");
MessageLog.GetInstance.Show($"菜品{res.GoodName}出错,错误信息:" + ex.Message);
}
finally
{

//炒完后出队列
morkFs[i].StirFryGoodsQuenes.TryDequeue(out var orderQueue);
morkFs[i].FryWorking = false;
}
}
catch (Exception ex)
{
ThreadManage.GetInstance().StopTask($"炒锅{i}{res.GoodName}炒制线程");
MessageLog.GetInstance.Show($"炒锅{i}炒制菜品{res.GoodName}出错,错误信息:" + ex.Message);
}
finally
{
nowStirFryGood = null;
//炒完后出队列
morkFs[i].StirFryGoodsQuenes.TryDequeue(out var orderQueue);
morkFs[i].FryWorking = false;
}
}), String.Format(striConst, i.ToString(), nowStirFryGood.GoodName)/*$"炒锅{i}炒制{res.GoodName}线程"*/);
}
}
break;
@@ -1167,13 +1258,13 @@ namespace BPASmartClient.MorkF
/// <param name="key"></param>
/// <param name="action"></param>
/// <param name="num">炒锅编号</param>
private void GetStatus(string key, Action<bool[]> action,int num)
private void GetStatus(string key, Action<object> action,int num)
{
if(dicPort2peripheralStatus.ContainsKey(num))
{
if (dicPort2peripheralStatus[num].ContainsKey(key))
{
action((bool[])dicPort2peripheralStatus[num][key]);//获取PLC指定地址的状态值
action((object)dicPort2peripheralStatus[num][key]);//获取PLC指定地址的状态值
}
}
}


+ 19
- 33
BPASmartClient.MorkF/View/DebugView.xaml 查看文件

@@ -20,17 +20,16 @@
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="162" ></RowDefinition>
<RowDefinition Height="81" ></RowDefinition>
<RowDefinition Height="81" ></RowDefinition>
<RowDefinition Height="285"></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<GroupBox Header="设备控制" FontSize="15" Foreground="Aqua" VerticalAlignment="Center" >
<Grid Height="120">
<Grid Height="50">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="2*"/>


<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<WrapPanel Orientation="Horizontal">
<TextBlock Text="炒锅选择:" Margin="10,0"/>
@@ -39,41 +38,28 @@
<Button Content="设定" Margin="0,0,30,0" Command="{Binding SetFry}"/>
<Button Content="炒锅初始化" Command="{Binding PlcInite}" Cursor="Hand" Margin="10,0"/>
<Button Content="炒锅复位" Command="{Binding Plc1Reset}" Cursor="Hand" Margin="10,0"/>
</WrapPanel>
</Grid>

</GroupBox>
<GroupBox Grid.Row="1" Header="自动炒菜" FontSize="15" Foreground="Aqua" VerticalAlignment="Center" >
<Grid Height="50">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<WrapPanel Grid.Row="1" Orientation="Horizontal">

<TextBlock Text="菜单编号:" Margin="10,0"/>
<TextBox Text="{Binding FoodMenuID}" Width="100"/>
<Button Content="下单" Margin="10,0" Command="{Binding StartOrder}" Cursor="Hand"/>
<Button Content="本地模拟流程配置" Click="Button_Click"/>
<Button Content="本地模拟流程下单" Margin="10,0" Command="{Binding StartLocalOrder}"/>
</WrapPanel>
<WrapPanel Grid.Row="1" Orientation="Horizontal" Margin="0,0,0,-37" RenderTransformOrigin="0.503,0.715">
<Button x:Name="checkValue" Content="炒锅1模拟" Command="{Binding Pot1SimOrder}" Margin="10,0"/>
<TextBlock Text="模拟参数--" Margin="5,0"/>
<TextBlock Text="油加热时间:" Margin="5,0"/>
<TextBox Text="{Binding OilTime}" Width="60" Margin="5,0"/>
<TextBlock Text="秒" Margin="5,0"/>
<TextBlock Text="油加热挡位" Margin="5,0"/>
<TextBox Text="{Binding OilFirGear}" Width="60" Margin="5,0"/>
<TextBlock Text="油搅拌挡位" Margin="5,0"/>
<TextBox Text="{Binding OilStrGear}" Width="60" Margin="5,0,20,0"/>
<TextBlock Text="菜品1加热时间:" Margin="5,0"/>
<TextBox Text="{Binding Food1Time}" Width="60" Margin="5,0"/>
<TextBlock Text="秒" Margin="20,0,80,0"/>
<TextBlock Text="菜品1加热挡位" Margin="5,0"/>
<TextBox Text="{Binding Food1FirGear}" Width="60" Margin="5,20"/>
<TextBlock Text="菜品1搅拌挡位" Margin="5,20"/>
<TextBox Text="{Binding Food1StrGear}" Width="60" Margin="5,0,20,0"/>
<TextBlock Text="菜品2加热时间:" Margin="5,0"/>
<TextBox Text="{Binding Food2Time}" Width="60" Margin="5,0"/>
<TextBlock Text="秒" Margin="20,0,80,0"/>
<TextBlock Text="菜品2加热挡位" Margin="5,0"/>
<TextBox Text="{Binding Food2FirGear}" Width="60" Margin="5,20"/>
<TextBlock Text="菜品2搅拌挡位" Margin="5,20"/>
<TextBox Text="{Binding Food2StrGear}" Width="60" Margin="5,0,20,0"/>
<Button Content="本地模拟流程下单" Margin="10,0" Command="{Binding StartLocalOrder}" Cursor="Hand"/>
<Button Content="停止炒菜" Margin="10,0" Command="{Binding StopLocalOrder}" Cursor="Hand"/>
</WrapPanel>
</Grid>

</GroupBox>
<GroupBox Header="菜品选择" FontSize="15" Foreground="Aqua" Grid.Row="1" VerticalAlignment="Center" Height="190" >
<GroupBox Header="菜品选择" FontSize="15" Foreground="Aqua" Grid.Row="2" VerticalAlignment="Center" Height="190" >
<Grid >
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
@@ -118,7 +104,7 @@
</Grid>

</GroupBox>
<StackPanel Orientation="Vertical" Grid.Row="2">
<StackPanel Orientation="Vertical" Grid.Row="3">
<GroupBox Header="配料仓控制" FontSize="15" Foreground="Aqua" VerticalAlignment="Center" Height="65">
<WrapPanel Orientation="Horizontal" Grid.RowSpan="2" VerticalAlignment="Top" Margin="0,5,0,0" >
<TextBlock Text="通道号" Margin="5,0"/>


+ 2
- 1
BPASmartClient.MorkF/ViewModel/DebugViewModel.cs 查看文件

@@ -34,7 +34,7 @@ namespace BPASmartClient.MorkF.ViewModel
public RelayCommand Plc1Reset { get; set; }
public RelayCommand StartOrder { get; set; }
public RelayCommand StartLocalOrder { get; set; }
public RelayCommand StopLocalOrder { get; set; }


#endregion
@@ -177,6 +177,7 @@ namespace BPASmartClient.MorkF.ViewModel
Plc1Reset = new RelayCommand(() => { ActionManage.GetInstance.Send("Plc1Reset"); });
StartOrder = new RelayCommand(() => { ActionManage.GetInstance.Send("StartOrder", FoodMenuID); });
StartLocalOrder = new RelayCommand(() => { ActionManage.GetInstance.Send("StartLocalOrder"); });
StopLocalOrder = new RelayCommand(() => { ActionManage.GetInstance.Send("StopLocalOrder"); });
#endregion

#region 菜品控制


Loading…
取消
儲存