Kaynağa Gözat

冲突解决

样式分支
pry 2 yıl önce
ebeveyn
işleme
5d588c8086
8 değiştirilmiş dosya ile 586 ekleme ve 180 silme
  1. +349
    -97
      BPASmartClient.MorkF/Control_MorkF.cs
  2. +41
    -8
      BPASmartClient.MorkF/GVL_MorkF.cs
  3. +71
    -22
      BPASmartClient.MorkF/View/DebugView.xaml
  4. +79
    -17
      BPASmartClient.MorkF/ViewModel/DebugViewModel.cs
  5. +37
    -27
      BPASmartClient.MorkM/View/DebugView.xaml
  6. +5
    -5
      BPASmartClient/DeviceInfo.xml
  7. +1
    -1
      BPASmartClient/MainWindow.xaml
  8. +3
    -3
      BPASmartClient/MainWindow.xaml.cs

+ 349
- 97
BPASmartClient.MorkF/Control_MorkF.cs Dosyayı Görüntüle

@@ -21,7 +21,6 @@ namespace BPASmartClient.MorkF
public StirFryBom stirFryBom = new StirFryBom();//创建获取流程的对象

List<int> resultorder = new List<int>();//调试变量
public static readonly object taskLock = new object();
/// <summary>
/// 入口
/// </summary>
@@ -37,8 +36,26 @@ namespace BPASmartClient.MorkF
{
ActionManage.GetInstance.Register(PLCInite, "InitCommand");
ActionManage.GetInstance.Register(InitialData, "SimultaorOrder");
ActionManage.GetInstance.Register(MaterialOne, "MaterialOne");
ActionManage.GetInstance.Register(MaterialTwo, "MaterialTwo");
ActionManage.GetInstance.Register(MaterialThree, "MaterialThree");
ActionManage.GetInstance.Register(MaterialFour, "MaterialFour");
ActionManage.GetInstance.Register(MaterialFive, "MaterialFive");
ActionManage.GetInstance.Register(ManualOpenExhaust, "OpenExhaust");
ActionManage.GetInstance.Register(CloseExhaust, "CloaseExhaust");
ActionManage.GetInstance.Register(StartQX,"StartQXOne");
ActionManage.GetInstance.Register(StartQX, "StartQXTwo");

ActionManage.GetInstance.Register(ShreddCabbage, "ShreddCabbage");
ActionManage.GetInstance.Register(FryPork, "FryPork");
ActionManage.GetInstance.Register(XingBaoGu, "XingBaoGu");

ActionManage.GetInstance.Register(TakePot, "TakePot");
ActionManage.GetInstance.Register(TakePotReset, "TakePotReset");
ActionManage.GetInstance.Register(TakeMaterial, "TakeMaterial");
ActionManage.GetInstance.Register(ManualOutMeal, "OutMeal");

ActionManage.GetInstance.Register<Action>(AddOil,"AddOil");
ActionManage.GetInstance.Register(TakeOff, "TakeOff");
ActionManage.GetInstance.Register(OneBlock, "OneBlock");
ActionManage.GetInstance.Register(TwoBlock, "TwoBlock");
@@ -49,9 +66,22 @@ namespace BPASmartClient.MorkF
ActionManage.GetInstance.Register(OverThreeBlock, "OverThreeBlock");
ActionManage.GetInstance.Register(OverGoOn, "OverGoOn");
ActionManage.GetInstance.Register(OverGoDown, "OverGoDown");
ActionManage.GetInstance.Register(ShreddCabbage, "ShreddCabbage");
ActionManage.GetInstance.Register(FryPork, "FryPork");
ActionManage.GetInstance.Register(XingBaoGu, "XingBaoGu");
ActionManage.GetInstance.Register(AutoModel, "AutoModel");
ActionManage.GetInstance.Register(ManualModel, "ManualModel");

ActionManage.GetInstance.Register<Action>(AddOil, "SecAddOil");
ActionManage.GetInstance.Register(TakeOff, "SecTakeOff");
ActionManage.GetInstance.Register(OneBlock, "SecOneBlock");
ActionManage.GetInstance.Register(TwoBlock, "SecTwoBlock");
ActionManage.GetInstance.Register(ThreeBlock, "SecThreeBlock");
ActionManage.GetInstance.Register(OverTurnOff, "SecOverTurnOff");
ActionManage.GetInstance.Register(OverOneBlock, "SecOverOneBlock");
ActionManage.GetInstance.Register(OverTwoBlock, "SecOverTwoBlock");
ActionManage.GetInstance.Register(OverThreeBlock, "SecOverThreeBlock");
ActionManage.GetInstance.Register(OverGoOn, "SecOverGoOn");
ActionManage.GetInstance.Register(OverGoDown, "SecOverGoDown");
ActionManage.GetInstance.Register(AutoModel, "SecAutoModel");
ActionManage.GetInstance.Register(ManualModel, "SecManualModel");
}
/// <summary>
/// 手撕包菜流程
@@ -129,65 +159,156 @@ namespace BPASmartClient.MorkF
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T6, PotActions = new List<StirFryPotAction>() { StirFryPotAction.搅拌臂下位, StirFryPotAction.快速旋转 }, During = 55 });
stirFryBom.AddAction(new StirFryAction() { Time = StirFryTime.T11, RobotActions = new List<StirFryRobotAction>() { StirFryRobotAction.灶取锅 } });
}
public void TakePot()
public void StartQX(object obj)
{
if ((int)obj == 1)
WriteData("M1.4", true);
if ((int)obj == 2)
WriteData("M1.7", true);
}
public void ManualOpenExhaust()
{
WriteData("M0.7",true);
}
public void CloseExhaust()
{
WriteData("M0.7",false);
}
public void TakeMaterial()
{
WriteData("M14.1",true);
}
public void ManualOutMeal()
{
WriteData("M14.2",true);
}
public void MaterialOne()
{
WriteData("M13.0",true);
}

WriteData("M14.0", true);
public void MaterialTwo()
{
WriteData("M13.1", true);
}
public void MaterialThree()
{
WriteData("M13.2", true);
}
public void MaterialFour()
{
WriteData("M13.3", true);
}
public void MaterialFive()
{
WriteData("M13.4", true);
}
public void AutoModel(object obj)
{

public void TakePotReset()
WriteData("0.3", true);

}
public void ManualModel()
{
WriteData("0.2", true);
}
public void AddOil(object obj)
{
if ((int)obj == 1)
{
Task.Run(() => { WriteData("M2.7", true); Task.Delay(4000).Wait(); WriteData("M2.7", false); });
}

if ((int)obj == 2)
{
Task.Run(() => { WriteData("M3.1", true); Task.Delay(4000).Wait(); WriteData("M3.1", false); });
}
}
public void TakePot(object obj)
{
WriteData("M14.0", true);
}

public void TakePotReset(object obj)
{
WriteData("M14.0", false);
}
public void TakeOff()
public void TakeOff(object obj)
{
WriteData("M4.0", new bool[] { false, false, false, false, false, false, false, false });//0000 0001
if ((int)obj == 1)
WriteData("M4.0", new bool[] { false, false, false, false, false, false, false, false });//0000 0000
if ((int)obj == 2)
WriteData("M5.0", new bool[] { false, false, false, false, false, false, false, false });//0000 0000
}

public void OneBlock()
public void OneBlock(object obj)
{
//WriteData("M13.1", true);
// WriteData("M4.0", new bool[] { true, false, false, false, false, false, false, false });//0000 0001
//WriteData("M0.7", false);//无订单关闭抽风机
WriteData("M13.0", true);
if ((int)obj == 1)
WriteData("M4.0", new bool[] { true, false, false, false, false, false, false, false });//0000 0001
if ((int)obj == 2)
WriteData("M5.0", new bool[] { true, false, false, false, false, false, false, false });//0000 0001


}
public void TwoBlock()
public void TwoBlock(object obj)
{
//WriteData("M13.1", false);
WriteData("M4.0", new bool[] { false, true, false, false, false, false, false, false });//0000 0001

if ((int)obj == 1)
WriteData("M4.0", new bool[] { false, true, false, false, false, false, false, false });//0000 0010
if ((int)obj == 2)
WriteData("M5.0", new bool[] { false, true, false, false, false, false, false, false });//0000 0010
}
public void ThreeBlock()
public void ThreeBlock(object obj)
{
// WriteData("M4.0", new bool[] { true, true, false, false, false, false, false, false });//0000 0001
WriteData("M4.0", new bool[] { false, true, true, false, false, false, false, false });
if ((int)obj == 1)
WriteData("M4.0", new bool[] { true, true, false, false, false, false, false, false });//0000 0011
if ((int)obj == 2)
WriteData("M5.0", new bool[] { true, true, false, false, false, false, false, false });//0000 0011
}
public void OverTurnOff()
public void OverTurnOff(object obj)
{
WriteData("M7.0", true);
if ((int)obj == 1)
WriteData("M7.0", true);
if ((int)obj == 2)
WriteData("M7.4", true);
}
public void OverOneBlock()
public void OverOneBlock(object obj)
{
WriteData("M7.1", true);
if ((int)obj == 1)
WriteData("M7.1", true);
if ((int)obj == 2)
WriteData("M7.5", true);
}
public void OverTwoBlock()
public void OverTwoBlock(object obj)
{
WriteData("M7.2", true);
if ((int)obj == 1)
WriteData("M7.2", true);
if ((int)obj == 2)
WriteData("M7.6",true);
}
public void OverThreeBlock()
public void OverThreeBlock(object obj)
{
WriteData("M7.3", true);
if ((int)obj == 1)
WriteData("M7.3", true);
if ((int)obj == 2)
WriteData("M7.7",true);
}
public void OverGoOn()
public void OverGoOn(object obj)
{
WriteData("M8.0", true);
if ((int)obj == 1)
WriteData("M8.0", true);
if ((int)obj == 2)
WriteData("M8.4",true);
}

public void OverGoDown()
public void OverGoDown(object obj)
{
WriteData("M8.2", true);
if ((int)obj == 1)
WriteData("M8.2", true);
if ((int)obj == 2)
WriteData("M8.6", true);
}
public void FlowInite()
{
@@ -255,6 +376,7 @@ namespace BPASmartClient.MorkF
GetStatus("M2.0", new Action<bool[]>((bools) =>
{
morkF.KitchenOneStatus = bools[1];
morkF.KitchenSecondStatus = bools[4];
morkF.FallOilComplete = bools[8];
}));
GetStatus("M8.0", new Action<bool[]>((bools) =>
@@ -647,7 +769,7 @@ namespace BPASmartClient.MorkF
if (morkF.MinorOutMealComplete)
{
morkF.TakePlateLock = false;
morkF.PotInPlace = false;
morkF.SecondPotInPlace = false;
morkF.MinorProcessExcuteLock = false;
morkF.MinorOrderMaterialCom = false;
}
@@ -741,20 +863,43 @@ namespace BPASmartClient.MorkF
{
Task.Delay(5).Wait();
}
TakePotToKitchen();
WriteData("M1.5", false);//清洗模组1完成复位
WriteData("M2.0", false);//清洗模组2完成复位
if (!morkF.CleanModule && !morkF.KitchenOneStatus && morkF.CleanComplete)
{
//取1号锅到1号灶台
TakePotToKitchen(1);
morkF.CurrentPutPotLoc = 1;
WriteData("M1.5", false);//清洗模组1完成复位
}
if (!morkF.SecondCleanModule && !morkF.KitchenSecondStatus && morkF.SecondCleanComplete)
{
//取2号锅到2号灶台
TakePotToKitchen(2);
morkF.CurrentPutPotLoc = 2;
WriteData("M2.0", false);//清洗模组2完成复位
}
if (morkF.MainProcessStatus)
DeviceProcessLogShow($"订单【{ morkF.MainCurrentOrderId}】执行取锅到灶台控制");
if (morkF.MinorProessStatus)
DeviceProcessLogShow($"订单【{ morkF.MinorCurrentOrderId}】执行取锅到灶台控制");

while (!morkF.PutPotToKitchenComlete)
if (morkF.CurrentPutPotLoc == 1)
{
Task.Delay(5).Wait();
while (!morkF.PutPotToKitchenComlete)
{
Task.Delay(5).Wait();
}
morkF.PotInPlace = morkF.PutPotToKitchenComlete;//锅到位
WriteData("M14.0", false);//机器人取锅完成复位
}
if (morkF.CurrentPutPotLoc == 2)
{
while (!morkF.PutPotToSecondKitchenComlete)
{
Task.Delay(5).Wait();
}
morkF.SecondPotInPlace = morkF.PutPotToSecondKitchenComlete;
WriteData("M14.4", false);//机器人取锅完成复位
}
morkF.PotInPlace = morkF.PutPotToKitchenComlete;//锅到位
WriteData("M14.0", false);//机器人取锅完成复位


Thread.Sleep(2000);

@@ -783,7 +928,7 @@ namespace BPASmartClient.MorkF
private void TakeBurdenATask()
{
int loc = 0;
while (morkF.RoobotIdle || !morkF.PotInPlace || !morkF.MaterialArriveComplete)//等待机器人空闲以及锅到位
while (morkF.RoobotIdle || (!morkF.PotInPlace && !morkF.SecondPotInPlace) || !morkF.MaterialArriveComplete)//等待机器人空闲以及锅到位
{
Task.Delay(5).Wait();
}
@@ -800,8 +945,17 @@ namespace BPASmartClient.MorkF
{
Task.Delay(5).Wait();
}
morkF.MainOrderMaterialCom = false;
WriteData("M14.1", false);//机器人取料完成复位

if (morkF.MainProcessStatus)
{
morkF.MainOrderMaterialCom = false;
WriteData("M14.1", false);//机器人取料完成复位
}
if (morkF.MinorProessStatus)
{
morkF.MinorOrderMaterialCom = false;
WriteData("M14.5", false);//机器人取料完成复位
}
morkF.TurnTableLock = false;//转台互锁解除


@@ -811,7 +965,7 @@ namespace BPASmartClient.MorkF
/// </summary>
private void TakeBurdenBTask()
{
while (morkF.RoobotIdle || !morkF.PotInPlace || !morkF.MaterialArriveComplete)//等待机器人空闲以及锅到位
while (morkF.RoobotIdle || (!morkF.PotInPlace && !morkF.SecondPotInPlace) || !morkF.MaterialArriveComplete)//等待机器人空闲以及锅到位
{
Task.Delay(5).Wait();
}
@@ -828,7 +982,16 @@ namespace BPASmartClient.MorkF
Task.Delay(5).Wait();
}
morkF.MainOrderMaterialCom = false;
WriteData("M14.1", false);//机器人取料完成复位
if (morkF.MainProcessStatus)
{
morkF.MainOrderMaterialCom = false;
WriteData("M14.1", false);//机器人取料完成复位
}
if (morkF.MinorProessStatus)
{
morkF.MinorOrderMaterialCom = false;
WriteData("M14.5", false);//机器人取料完成复位
}
morkF.TurnTableLock = false;//转台互锁解除
//while (!morkF.FallMaterialComplete)//等待倒料完成
//{
@@ -842,7 +1005,7 @@ namespace BPASmartClient.MorkF
/// <exception cref="NotImplementedException"></exception>
private void TakeBurdenCTask()
{
while (morkF.RoobotIdle || !morkF.PotInPlace || !morkF.MaterialArriveComplete)//等待机器人空闲以及锅到位
while (morkF.RoobotIdle || (!morkF.PotInPlace && !morkF.SecondPotInPlace) || !morkF.MaterialArriveComplete)//等待机器人空闲以及锅到位
{
Task.Delay(5).Wait();
}
@@ -860,7 +1023,16 @@ namespace BPASmartClient.MorkF
Task.Delay(5).Wait();
}
morkF.MainOrderMaterialCom = false;
WriteData("M14.1", false);//机器人取料完成复位
if (morkF.MainProcessStatus)
{
morkF.MainOrderMaterialCom = false;
WriteData("M14.1", false);//机器人取料完成复位
}
if (morkF.MinorProessStatus)
{
morkF.MinorOrderMaterialCom = false;
WriteData("M14.5", false);//机器人取料完成复位
}
morkF.TurnTableLock = false;//转台互锁解除
//while (!morkF.FallMaterialComplete)
//{
@@ -891,9 +1063,9 @@ namespace BPASmartClient.MorkF
RobotOutMeal();
WriteData("M1.2", false);//供盘复位
if (morkF.MainProcessStatus)
DeviceProcessLogShow($"订单【{ morkF.MainCurrentOrderId}】执行取锅到台控制");
DeviceProcessLogShow($"订单【{ morkF.MainCurrentOrderId}】执行取锅到清洗台控制");
if (morkF.MinorProessStatus)
DeviceProcessLogShow($"订单【{ morkF.MinorCurrentOrderId}】执行取锅到台控制");
DeviceProcessLogShow($"订单【{ morkF.MinorCurrentOrderId}】执行取锅到清洗台控制");

}

@@ -902,27 +1074,30 @@ namespace BPASmartClient.MorkF
/// </summary>
private void CleanPotTask()
{
while (!morkF.PlaceRinseTableComplete || morkF.CleanModule)
while (!morkF.PlaceRinseTableComplete || ((morkF.CleanModule && !morkF.MainProcessStatus) && (morkF.SecondCleanModule && !morkF.MinorProessStatus)))
{
Task.Delay(5).Wait();
}
if (morkF.MainProcessStatus)
DeviceProcessLogShow($"订单【{ morkF.MainCurrentOrderId}】执行取锅到灶台控制");
if (morkF.MinorProessStatus)
DeviceProcessLogShow($"订单【{ morkF.MinorCurrentOrderId}】执行取锅到灶台控制");
WriteData("M14.2", false);//机器人出餐完成复位
//OrderChange(morkF.CurrentOrderId, ORDER_STATUS.COMPLETED_COOK);
CleanModuleControl("Start");
if (morkF.MainProcessStatus)//主流程
{

WriteData("M14.2", false);//机器人2号锅出餐完成复位
CleanModuleControl("Start");
DeviceProcessLogShow($"订单【{ morkF.MainCurrentOrderId}】执行清洗操作");
morkF.MainProcessFlag = false;
minorReset.Set();
}
else if (morkF.MinorProessStatus)//辅流程
if (morkF.MinorProessStatus)
{
WriteData("M14.6", false);//机器人2号锅出餐完成复位
CleanModuleControl("Start");
DeviceProcessLogShow($"订单【{ morkF.MinorCurrentOrderId}】执行清洗操作");
morkF.MinorProcessFlag = false;
mainReset.Set();
}
//OrderChange(morkF.CurrentOrderId, ORDER_STATUS.COMPLETED_COOK);


}
/// <summary>
/// 任务复位重启
@@ -957,11 +1132,22 @@ namespace BPASmartClient.MorkF
{
TurnMachineOrientControl("Down");

while (!morkF.TurnMachineDownComplete)//等待翻转机下降完成
if (morkF.MainProcessStatus)
{
Task.Delay(5).Wait();
while (!morkF.TurnMachineDownComplete)//等待翻转机下降完成
{
Task.Delay(5).Wait();
}
WriteData("M8.3", false);//下降完成复位
}
if (morkF.MinorProessStatus)
{
while (!morkF.SecondTurnMachineDownComplete)//等待翻转机下降完成
{
Task.Delay(5).Wait();
}
WriteData("M8.7", false);//下降完成复位
}
WriteData("M8.3", false);//下降完成复位
DeviceProcessLogShow($"翻转机下降完成");
//if (morkF.MaterialCount == 3 && morkF.MainProcessStatus)
//{
@@ -983,11 +1169,22 @@ namespace BPASmartClient.MorkF
Task.Delay(5).Wait();
}
TurnMachineOrientControl("Top");//翻转机上升
while (!morkF.TurnMachineUpComplete)//等待翻转机上升完成以及取料完成
if (morkF.MainProcessStatus)
{
Task.Delay(5).Wait();
while (!morkF.TurnMachineUpComplete)//等待翻转机上升完成以及取料完成
{
Task.Delay(5).Wait();
}
WriteData("M8.1", false);//上升完成复位
}
if (morkF.MinorProessStatus)
{
while (!morkF.SecondTurnMachineUpComplete)//等待翻转机上升完成以及取料完成
{
Task.Delay(5).Wait();
}
WriteData("M8.5", false);//上升完成复位
}
WriteData("M8.1", false);//上升完成复位
if (morkF.MainProcessStatus)//代表主流程执行的操作
{
if (!morkF.MainOrderMaterialCom)
@@ -1019,7 +1216,7 @@ namespace BPASmartClient.MorkF
if (!morkF.MinorOrderMaterialCom)
{
WriteData("M14.3", true);//倒料
while (!morkF.FallMaterialComplete)//等待倒料完成
while (!morkF.SecondFallMaterialComplete)//等待倒料完成
{
Task.Delay(5).Wait();
}
@@ -1073,34 +1270,64 @@ namespace BPASmartClient.MorkF
switch (number)
{
case 0:
WriteData("M4.0", new bool[] { false, false, false, false, false, false, false, false });//0000 0000
if (morkF.MainProcessStatus)
WriteData("M4.0", new bool[] { false, false, false, false, false, false, false, false });//0000 0000
if (morkF.MinorProessStatus)
WriteData("M5.0", new bool[] { false, false, false, false, false, false, false, false });//0000 0000
break;
case 1:
WriteData("M4.0", new bool[] { true, false, false, false, false, false, false, false });//0000 0001
if (morkF.MainProcessStatus)
WriteData("M4.0", new bool[] { true, false, false, false, false, false, false, false });//0000 0001
if (morkF.MinorProessStatus)
WriteData("M5.0", new bool[] { true, false, false, false, false, false, false, false });//0000 0001
break;
case 2:
WriteData("M4.0", new bool[] { false, true, false, false, false, false, false, false });//0000 0010
if (morkF.MainProcessStatus)
WriteData("M4.0", new bool[] { false, true, false, false, false, false, false, false });//0000 0010
if (morkF.MinorProessStatus)
WriteData("M5.0", new bool[] { false, true, false, false, false, false, false, false });//0000 0010
break;
case 3:
WriteData("M4.0", new bool[] { true, true, false, false, false, false, false, false });//0000 0011
if (morkF.MainProcessStatus)
WriteData("M4.0", new bool[] { true, true, false, false, false, false, false, false });//0000 0011
if (morkF.MinorProessStatus)
WriteData("M5.0", new bool[] { true, true, false, false, false, false, false, false });//0000 0011
break;
case 4:
WriteData("M4.0", new bool[] { false, false, true, false, false, false, false, false });//0000 0100
if (morkF.MainProcessStatus)
WriteData("M4.0", new bool[] { false, false, true, false, false, false, false, false });//0000 0100
if (morkF.MinorProessStatus)
WriteData("M5.0", new bool[] { false, false, true, false, false, false, false, false });//0000 0100
break;
case 5:
WriteData("M4.0", new bool[] { true, false, true, false, false, false, false, false });//0000 0101
if (morkF.MainProcessStatus)
WriteData("M4.0", new bool[] { true, false, true, false, false, false, false, false });//0000 0101
if (morkF.MinorProessStatus)
WriteData("M5.0", new bool[] { true, false, true, false, false, false, false, false });//0000 0101
break;
case 6:
WriteData("M4.0", new bool[] { false, true, true, false, false, false, false, false });//0000 0110
if (morkF.MainProcessStatus)
WriteData("M4.0", new bool[] { false, true, true, false, false, false, false, false });//0000 0110
if (morkF.MinorProessStatus)
WriteData("M5.0", new bool[] { false, true, true, false, false, false, false, false });//0000 0110
break;
case 7:
WriteData("M4.0", new bool[] { true, true, true, false, false, false, false, false });//0000 0111
if (morkF.MainProcessStatus)
WriteData("M4.0", new bool[] { true, true, true, false, false, false, false, false });//0000 0111
if (morkF.MinorProessStatus)
WriteData("M5.0", new bool[] { true, true, true, false, false, false, false, false });//0000 0111
break;
case 8:
WriteData("M4.0", new bool[] { false, false, false, true, false, false, false, false });//0000 1000
if (morkF.MainProcessStatus)
WriteData("M4.0", new bool[] { false, false, false, true, false, false, false, false });//0000 1000
if (morkF.MinorProessStatus)
WriteData("M5.0", new bool[] { false, false, false, true, false, false, false, false });//0000 1000
break;
case 9:
WriteData("M4.0", new bool[] { true, false, false, true, false, false, false, false });//0000 1001
if (morkF.MainProcessStatus)
WriteData("M4.0", new bool[] { true, false, false, true, false, false, false, false });//0000 1001
if (morkF.MinorProessStatus)
WriteData("M5.0", new bool[] { true, false, false, true, false, false, false, false });//0000 1001
break;

}
@@ -1146,16 +1373,22 @@ namespace BPASmartClient.MorkF
/// <summary>
/// 取锅到灶台
/// </summary>
public void TakePotToKitchen()
public void TakePotToKitchen(int loc)
{
WriteData("M14.0", true);
if (loc == 1)
WriteData("M14.0", true);
if (loc == 2)
WriteData("M14.4", true);
}
/// <summary>
/// 机器人出餐并将锅放置清洗台位置
/// </summary>
public void RobotOutMeal()
{
WriteData("M14.2", true);
if (morkF.MainProcessStatus)
WriteData("M14.2", true);//1号锅出餐
if (morkF.MinorProessStatus)
WriteData("M14.6", true);//2号锅出餐
}
/// <summary>
/// 注油
@@ -1166,11 +1399,13 @@ namespace BPASmartClient.MorkF
{
Task.Delay(5).Wait();
}

WriteData("M2.7", true);//加油
if (morkF.MainProcessStatus)
WriteData("M2.7", true);//加油
if (morkF.MinorProessStatus)
WriteData("M3.1", true);//加油
WriteData("M0.7", true);//打开抽风机
DeviceProcessLogShow("开始注油");
while (!morkF.FallOilComplete)
while (!morkF.FallOilComplete || !morkF.SecondOilComplete)
{
Task.Delay(5).Wait();
}
@@ -1185,9 +1420,8 @@ namespace BPASmartClient.MorkF
{
switch (orientation)
{
case "Top": WriteData("M8.0", true); break;
// case "Middle": WriteData("", 1); break;
case "Down": WriteData("M8.2", true); break;
case "Top": if (morkF.MainProcessStatus) WriteData("M8.0", true); if (morkF.MinorProessStatus) WriteData("M8.4", true); break;
case "Down": if (morkF.MainProcessStatus) WriteData("M8.2", true); if (morkF.MinorProessStatus) WriteData("M8.6", true); break;
}
DeviceProcessLogShow($"翻转机执行{orientation}操作");
}
@@ -1202,34 +1436,52 @@ namespace BPASmartClient.MorkF
}
switch (gear)
{
case 0: WriteData("M7.0", true); Task.Delay(1000).Wait(); break;//关闭翻炒机
case 1: WriteData("M7.1", true); break;//翻炒机1挡
case 2: WriteData("M7.2", true); break;//翻炒机2挡
case 3: WriteData("M7.3", true); break;//翻炒机3挡
case 0: if (morkF.MainProcessStatus) WriteData("M7.0", true); Task.Delay(1000).Wait(); if (morkF.MinorProessStatus) WriteData("M7.4", true); break;//关闭翻炒机
case 1: if (morkF.MainProcessStatus) WriteData("M7.1", true); if (morkF.MinorProessStatus) WriteData("M7.5", true); break;//翻炒机1挡
case 2: if (morkF.MainProcessStatus) WriteData("M7.2", true); if (morkF.MinorProessStatus) WriteData("M7.6", true); break;//翻炒机2挡
case 3: if (morkF.MainProcessStatus) WriteData("M7.3", true); if (morkF.MinorProessStatus) WriteData("M7.7", true); break;//翻炒机3挡
}
DeviceProcessLogShow($"翻转机档位调至{gear}挡");
}
/// <summary>
/// A,B,C料
/// A,B,C料
/// </summary>
public void TakeBurden(int loc)
{
WriteData("M14.1", true);//机器人取料
if (morkF.MainProcessStatus && morkF.PotInPlace)
WriteData("M14.1", true);//机器人倒料至1号锅
if (morkF.MinorProessStatus && morkF.SecondPotInPlace)
WriteData("M14.5", true);//机器人倒料至2号锅
}
/// <summary>
/// 清洗模组1启停控制
/// </summary>
public void CleanModuleControl(string status)
{
if (status == "Start")
if (morkF.MainProcessStatus)
{
WriteData("M1.4", true);
if (status == "Start")
{
WriteData("M1.4", true);
}
if (status == "Stop")
{
WriteData("M1.4", false);
}
DeviceProcessLogShow($"清洗模组1执行【{status}】操作");
}
if (status == "Stop")
if (morkF.MinorProessStatus)
{
WriteData("M1.4", false);
if (status == "Start")
{
WriteData("M1.7", true);
}
if (status == "Stop")
{
WriteData("M1.7", false);
}
DeviceProcessLogShow($"清洗模组2执行【{status}】操作");
}
DeviceProcessLogShow($"清洗模组执行【{status}】操作");
}

public override void Stop()


+ 41
- 8
BPASmartClient.MorkF/GVL_MorkF.cs Dosyayı Görüntüle

@@ -50,17 +50,30 @@ namespace BPASmartClient.MorkF
/// </summary>
public bool KitchenSecondStatus { get; set; }
/// <summary>
/// 注油完成状态
/// 锅灶1注油完成状态
/// </summary>
public bool FallOilComplete { get; set; }
/// <summary>
/// 翻转机上升完成状态
/// 锅灶2注油完成状态
/// </summary>
public bool SecondOilComplete { get; set; }
/// <summary>
/// 锅灶1翻转机上升完成状态
/// </summary>
public bool TurnMachineUpComplete { get; set; }
/// <summary>
/// 翻转机下降完成状态
/// 锅灶2翻转机上升完成状态
/// </summary>
public bool SecondTurnMachineUpComplete { get; set; }
/// <summary>
/// 锅灶1翻转机下降完成状态
/// </summary>
public bool TurnMachineDownComplete { get; set; }

/// <summary>
/// 锅灶2翻转机下降完成状态
/// </summary>
public bool SecondTurnMachineDownComplete { get; set; }
/// <summary>
/// 料仓旋转到位状态
/// </summary>
@@ -70,18 +83,26 @@ namespace BPASmartClient.MorkF
/// </summary>
public bool RoobotIdle { get; set; }
/// <summary>
/// 放锅至灶台完成状态
/// 放锅至灶台1完成状态
/// </summary>
public bool PutPotToKitchenComlete { get; set; }

/// <summary>
/// 放锅至灶台2完成状态
/// </summary>
public bool PutPotToSecondKitchenComlete { get; set; }
/// <summary>
/// 机器人取料完成状态
/// </summary>
public bool TakeMaterialComplete { get; set; }
/// <summary>
/// 机器人放锅至清洗台完成状态
/// 机器人放锅至清洗台1完成状态
/// </summary>
public bool PlaceRinseTableComplete { get; set; }

/// <summary>
/// 机器人放锅至清洗台2完成状态
/// </summary>
public bool PlaceRinseSecondTableComplete { get; set; }
/// <summary>
/// 订单取配料队列
/// </summary>
@@ -132,10 +153,14 @@ namespace BPASmartClient.MorkF
/// </summary>
public bool TakeAllBurdenComplete { get; set; }
/// <summary>
/// 锅到位 true:到位 false:未到位
/// 锅1到位 true:到位 false:未到位
/// </summary>
public bool PotInPlace { get; set; }
/// <summary>
/// 锅2到位 true:到位 false:未到位
/// </summary>
public bool SecondPotInPlace { get; set; }
/// <summary>
/// true:烹饪完成
/// </summary>
public bool CookingComplete { get; set; }
@@ -144,10 +169,14 @@ namespace BPASmartClient.MorkF
/// </summary>
public bool AddOilComplete { get; set; }
/// <summary>
/// 倒料完成
/// 1号锅倒料完成
/// </summary>
public bool FallMaterialComplete { get; set; }
/// <summary>
/// 2号锅倒料完成
/// </summary>
public bool SecondFallMaterialComplete { get; set; }
/// <summary>
/// 供盘互锁
/// </summary>
public bool TakePlateLock { get; set; }
@@ -241,6 +270,10 @@ namespace BPASmartClient.MorkF
/// 主流程执行状态
/// </summary>
public bool MainProcessStatus { get; set; }
/// <summary>
/// 当前放锅位置 1:1号锅 2: 2号锅
/// </summary>
public int CurrentPutPotLoc { get; set; }
}
}


+ 71
- 22
BPASmartClient.MorkF/View/DebugView.xaml Dosyayı Görüntüle

@@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.MorkF.View"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
d:DesignHeight="600" d:DesignWidth="1300">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
@@ -16,30 +16,79 @@
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="120" ></RowDefinition>
<RowDefinition Height="100"></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<GroupBox Header="设备控制" FontSize="15" Foreground="Aqua" VerticalAlignment="Center" Height="120">
<WrapPanel Orientation="Horizontal" VerticalAlignment="Top" Margin="0,5,0,0">
<Button Content="初始化" Command="{Binding PlcInite}" Margin="10,0,10,0" Cursor="Hand"></Button>
<Button Content="模拟订单" Command="{Binding SimulateOrder}" Margin="10,0,10,0" Cursor="Hand"></Button>
<Button Content="自动模式" Command="{ Binding AutoModel}" Margin="10,0,10,0" Cursor="Hand"></Button>
<Button Content="手动模式" Command="{Binding ManualModel}" Margin="10,0,10,0"></Button>
<Button Content="打开抽风" Command="{Binding OpenExhaust}" Margin="10,0,10,0"></Button>
<Button Content="关闭抽风" Command="{Binding CloaseExhaust}" Margin="10,0,10,0"></Button>
<Button Content="料仓1" Command="{Binding MaterialOne}" Margin="10,0,10,0"></Button>
<Button Content="料仓2" Command="{Binding MaterialTwo}" Margin="10,0,10,0"></Button>
<Button Content="料仓3" Command="{Binding MaterialThree}" Margin="10,0,10,0"></Button>
<Button Content="料仓4" Command="{Binding MaterialFour}" Margin="10,0,10,0"></Button>
<Button Content="料仓5" Command="{Binding MaterialFive}" Margin="10,0,10,0"></Button>
<Button Content="供盘" Command="{Binding OutPlate}" Margin="10,0,10,0"></Button>
<Button Content="清洗模组1启动" Command="{Binding StartQXOne}" Margin="10,0,10,0"></Button>
<Button Content="清洗模组2启动" Command="{Binding StartQXTwo}" Margin="10,10,10,0" Cursor="Hand"></Button>
</WrapPanel>
</GroupBox>
<GroupBox Header="菜品选择" FontSize="15" Foreground="Aqua" Grid.Row="1" Margin="0,0,0,40" VerticalAlignment="Top" Height="100">
<WrapPanel Orientation="Horizontal" Height="52" VerticalAlignment="Center" >
<Button Content="手撕包菜" Command="{Binding ShreddCabbage}" Margin="10,0,10,0"></Button>
<Button Content="盐煎肉" Command="{Binding FryPork}" Margin="10,0,10,0"></Button>
<Button Content="酱烧杏鲍菇" Command="{Binding XingBaoGu}" Margin="10,0,10,0"></Button>
</WrapPanel>
</GroupBox>
<StackPanel Orientation="Vertical" Grid.Row="2">
<GroupBox Header="机器人控制" FontSize="15" Foreground="Aqua" VerticalAlignment="Center" Height="95">
<WrapPanel Orientation="Horizontal" Grid.RowSpan="2" VerticalAlignment="Top" Margin="0,5,0,0" >
<Button Content="取锅" Command="{Binding TakePot}" Margin="10,0,10,0"></Button>
<!--<Button Content="取锅复位" Command="{Binding TakePotReset}" Margin="10,0,10,0"></Button>-->
<Button Content="取料" Command="{Binding TakeMaterial}" Margin="10,0,10,0"></Button>
<Button Content="出餐" Command="{Binding OutMeal}" Margin="10,0,10,0"></Button>
</WrapPanel>
</GroupBox>

<GroupBox Header="炒锅1" FontSize="15" Foreground="Aqua" VerticalAlignment="Center" Height="140">
<WrapPanel VerticalAlignment="Top" Margin="0,5,0,0">
<Button Content="注油" Command="{Binding AddOil}" Margin="10,0,10,0"></Button>
<Button Content="加热关闭" Command="{Binding TempTurnOff}" Margin="10,0,10,0"></Button>
<Button Content="加热1挡" Command="{Binding OneBlock}" Margin="10,0,10,0"></Button>
<Button Content="加热2挡" Command="{Binding TwoBlock}" Margin="10,0,10,0"></Button>
<Button Content="加热3挡" Command="{Binding ThreeBlock}" Margin="10,0,10,0"></Button>
<Button Content="翻炒机关闭" Command="{Binding OverTurnOff}" Margin="10,0,10,0" Cursor="Hand"></Button>
<Button Content="翻炒机上升" Command="{Binding OverGoOn}" Margin="10,0,15,0" Cursor="Hand"></Button>
<Button Content="翻炒机下降" Command="{Binding OverGoDown}" Margin="10,0,10,0"></Button>
<Button Content="翻炒机1挡" Command="{Binding OverOneBlock}" Margin="10,0,10,0"></Button>
<Button Content="翻炒机2挡" Command="{Binding OverTwoBlock}" Margin="10,0,10,0"></Button>
<Button Content="翻炒机3挡" Command="{Binding OverThreeBlock}" Margin="10,0,10,0"></Button>
</WrapPanel>
</GroupBox>
<GroupBox Header="炒锅2" FontSize="15" Foreground="Aqua" VerticalAlignment="Center" Height="140">
<WrapPanel VerticalAlignment="Top" Margin="0,5,0,0">
<Button Content="注油" Command="{Binding SecAddOil}" Margin="10,0,10,0"></Button>
<Button Content="加热关闭" Command="{Binding SecTempTurnOff}" Margin="10,0,10,0"></Button>
<Button Content="加热1挡" Command="{Binding SecOneBlock}" Margin="10,0,10,0"></Button>
<Button Content="加热2挡" Command="{Binding SecTwoBlock}" Margin="10,0,10,0"></Button>
<Button Content="加热3挡" Command="{Binding SecThreeBlock}" Margin="10,0,10,0"></Button>
<Button Content="翻炒机关闭" Command="{Binding SecOverTurnOff}" Margin="10,0,10,0" Cursor="Hand"></Button>
<Button Content="翻炒机上升" Command="{Binding SecOverGoOn}" Margin="10,0,15,0" Cursor="Hand"></Button>
<Button Content="翻炒机下降" Command="{Binding SecOverGoDown}" Margin="10,0,10,0"></Button>
<Button Content="翻炒机1挡" Command="{Binding SecOverOneBlock}" Margin="10,0,10,0"></Button>
<Button Content="翻炒机2挡" Command="{Binding SecOverTwoBlock}" Margin="10,0,10,0"></Button>
<Button Content="翻炒机3挡" Command="{Binding SecOverThreeBlock}" Margin="10,0,10,0"></Button>

</WrapPanel>
</GroupBox>

<StackPanel Orientation="Horizontal" Grid.Row="0">
<Button Content="初始化" Command="{Binding PlcInite}" Margin="10,0,10,0" Cursor="Hand"></Button>
<Button Content="模拟订单" Command="{Binding SimulateOrder}" Margin="10,0,10,0"></Button>
<Button Content="手撕包菜" Command="{Binding ShreddCabbage}" Margin="10,0,10,0"></Button>
<Button Content="盐煎肉" Command="{Binding FryPork}" Margin="10,0,10,0"></Button>
<Button Content="酱烧杏鲍菇" Command="{Binding XingBaoGu}" Margin="10,0,10,0"></Button>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="1">
<Button Content="取锅" Command="{Binding TakePot}" Margin="10,0,10,0"></Button>
<Button Content="取锅复位" Command="{Binding TakePotReset}" Margin="10,0,10,0"></Button>
<Button Content="加热关闭" Command="{Binding TempTurnOff}" Margin="10,0,10,0"></Button>
<Button Content="加热1挡" Command="{Binding OneBlock}" Margin="10,0,10,0"></Button>
<Button Content="加热2挡" Command="{Binding TwoBlock}" Margin="10,0,10,0"></Button>
<Button Content="加热3挡" Command="{Binding ThreeBlock}" Margin="10,0,10,0"></Button>
<Button Content="翻炒机关闭" Command="{Binding OverTurnOff}" Margin="10,0,10,0"></Button>
<Button Content="翻炒机上升" Command="{Binding OverGoOn}" Margin="10,0,10,0"></Button>
<Button Content="翻炒机下降" Command="{Binding OverGoDown}" Margin="10,0,10,0"></Button>
<Button Content="翻炒机1挡" Command="{Binding OverOneBlock}" Margin="10,0,10,0"></Button>
<Button Content="翻炒机2挡" Command="{Binding OverTwoBlock}" Margin="10,0,10,0"></Button>
<Button Content="翻炒机3挡" Command="{Binding OverThreeBlock}" Margin="10,0,10,0"></Button>
</StackPanel>

</Grid>
</UserControl>

+ 79
- 17
BPASmartClient.MorkF/ViewModel/DebugViewModel.cs Dosyayı Görüntüle

@@ -14,42 +14,104 @@ namespace BPASmartClient.MorkF.ViewModel

public RelayCommand PlcInite { get; set; }
public RelayCommand SimulateOrder { get; set; }
public RelayCommand MaterialOne { get; set; }
public RelayCommand MaterialTwo { get; set; }
public RelayCommand MaterialThree { get; set; }
public RelayCommand MaterialFour { get; set; }
public RelayCommand MaterialFive { get; set; }
public RelayCommand OpenExhaust { get;set; }
public RelayCommand CloaseExhaust { get; set; }
public RelayCommand StartQXOne { get; set; }
public RelayCommand StartQXTwo { get; set; }


public RelayCommand ShreddCabbage { get; set; }
public RelayCommand FryPork { get; set; }
public RelayCommand XingBaoGu { get; set; }

public RelayCommand TakePot { get; set; }
public RelayCommand TakePotReset { get; set; }
public RelayCommand TakeMaterial { get; set; }
public RelayCommand OutMeal { get; set; }

public RelayCommand AddOil { get; set; }
public RelayCommand TempTurnOff { get; set; }
public RelayCommand OneBlock { get; set; }
public RelayCommand TwoBlock { get; set; }
public RelayCommand ThreeBlock { get; set; }

public RelayCommand OverTurnOff { get; set; }
public RelayCommand OverOneBlock { get; set; }
public RelayCommand OverTwoBlock { get; set; }
public RelayCommand OverThreeBlock { get; set; }
public RelayCommand OverGoOn { get; set; }
public RelayCommand OverGoDown { get; set; }
public RelayCommand ShreddCabbage { get; set; }
public RelayCommand FryPork { get; set; }
public RelayCommand XingBaoGu { get; set; }
public RelayCommand AutoModel { get; set; }
public RelayCommand ManualModel { get; set; }

public RelayCommand SecAddOil { get; set; }
public RelayCommand SecTempTurnOff { get; set; }
public RelayCommand SecOneBlock { get; set; }
public RelayCommand SecTwoBlock { get; set; }
public RelayCommand SecThreeBlock { get; set; }
public RelayCommand SecOverTurnOff { get; set; }
public RelayCommand SecOverOneBlock { get; set; }
public RelayCommand SecOverTwoBlock { get; set; }
public RelayCommand SecOverThreeBlock { get; set; }
public RelayCommand SecOverGoOn { get; set; }
public RelayCommand SecOverGoDown { get; set; }
public RelayCommand SecAutoModel { get; set; }
public RelayCommand SecManualModel { get; set; }
public DebugViewModel()
{
PlcInite = new RelayCommand(() => { ActionManage.GetInstance.Send("InitCommand"); });
SimulateOrder = new RelayCommand(() => { ActionManage.GetInstance.Send("SimultaorOrder"); });
TakePot = new RelayCommand(() => { ActionManage.GetInstance.Send("TakePot"); });
TakePotReset = new RelayCommand(() => { ActionManage.GetInstance.Send("TakePotReset"); });
TempTurnOff = new RelayCommand(() => { ActionManage.GetInstance.Send("TakeOff"); });
OneBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("OneBlock"); });
TwoBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("TwoBlock"); });
ThreeBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("ThreeBlock"); });
OverTurnOff = new RelayCommand(() => { ActionManage.GetInstance.Send("OverTurnOff"); });
OverOneBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("OverOneBlock"); });
OverTwoBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("OverTwoBlock"); });
OverThreeBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("OverThreeBlock"); });
OverGoOn = new RelayCommand(() => { ActionManage.GetInstance.Send("OverGoOn"); });
OverGoDown = new RelayCommand(() => { ActionManage.GetInstance.Send("OverGoDown"); });
MaterialOne= new RelayCommand(() => { ActionManage.GetInstance.Send("MaterialOne"); });
MaterialTwo = new RelayCommand(() => { ActionManage.GetInstance.Send("MaterialTwo"); });
MaterialThree = new RelayCommand(() => { ActionManage.GetInstance.Send("MaterialThree"); });
MaterialFour = new RelayCommand(() => { ActionManage.GetInstance.Send("MaterialFour"); });
MaterialFive = new RelayCommand(() => { ActionManage.GetInstance.Send("MaterialFive"); });
OpenExhaust = new RelayCommand(() => { ActionManage.GetInstance.Send("OpenExhaust"); });
CloaseExhaust = new RelayCommand(() => { ActionManage.GetInstance.Send("CloseExhaust"); });
StartQXOne=new RelayCommand(() => { ActionManage.GetInstance.Send("StartQXOne",1); });
StartQXTwo = new RelayCommand(() => { ActionManage.GetInstance.Send("StartQXTwo",2); });

ShreddCabbage = new RelayCommand(() => { ActionManage.GetInstance.Send("ShreddCabbage"); });
FryPork = new RelayCommand(() => { ActionManage.GetInstance.Send("FryPork"); });
XingBaoGu = new RelayCommand(() => { ActionManage.GetInstance.Send("XingBaoGu"); });
}

TakePot = new RelayCommand(() => { ActionManage.GetInstance.Send("TakePot"); });
TakePotReset = new RelayCommand(() => { ActionManage.GetInstance.Send("TakePotReset"); });
TakeMaterial= new RelayCommand(() => { ActionManage.GetInstance.Send("TakeMaterial"); });
OutMeal = new RelayCommand(() => { ActionManage.GetInstance.Send("OutMeal"); });

AddOil = new RelayCommand(() => { ActionManage.GetInstance.Send("AddOil", 1); });
TempTurnOff = new RelayCommand(() => { ActionManage.GetInstance.Send("TakeOff", 1); });
OneBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("OneBlock",1); });
TwoBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("TwoBlock",1); });
ThreeBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("ThreeBlock",1); });
OverTurnOff = new RelayCommand(() => { ActionManage.GetInstance.Send("OverTurnOff",1); });
OverOneBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("OverOneBlock",1); });
OverTwoBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("OverTwoBlock",1); });
OverThreeBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("OverThreeBlock",1); });
OverGoOn = new RelayCommand(() => { ActionManage.GetInstance.Send("OverGoOn",1); });
OverGoDown = new RelayCommand(() => { ActionManage.GetInstance.Send("OverGoDown",1); });
AutoModel = new RelayCommand(()=>{ActionManage.GetInstance.Send("AutoModel",1); });
ManualModel = new RelayCommand(() => { ActionManage.GetInstance.Send("ManualModel",1); });

SecAddOil = new RelayCommand(() => { ActionManage.GetInstance.Send("AddOil", 2); });
SecTempTurnOff = new RelayCommand(() => { ActionManage.GetInstance.Send("TakeOff", 2); });
SecOneBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("OneBlock", 2); });
SecTwoBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("TwoBlock", 2); });
SecThreeBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("ThreeBlock", 2); });
SecOverTurnOff = new RelayCommand(() => { ActionManage.GetInstance.Send("OverTurnOff", 2); });
SecOverOneBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("OverOneBlock", 2); });
SecOverTwoBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("OverTwoBlock", 2); });
SecOverThreeBlock = new RelayCommand(() => { ActionManage.GetInstance.Send("OverThreeBlock", 2); });
SecOverGoOn = new RelayCommand(() => { ActionManage.GetInstance.Send("OverGoOn", 2); });
SecOverGoDown = new RelayCommand(() => { ActionManage.GetInstance.Send("OverGoDown", 2); });
SecAutoModel = new RelayCommand(() => { ActionManage.GetInstance.Send("AutoModel", 2); });
SecManualModel = new RelayCommand(() => { ActionManage.GetInstance.Send("ManualModel", 2); });
}
}
}

+ 37
- 27
BPASmartClient.MorkM/View/DebugView.xaml Dosyayı Görüntüle

@@ -51,6 +51,10 @@
<TextBox
Grid.Column="1"
Margin="10,0"
Foreground="#9934F7f7"
Background="Transparent"
BorderBrush="#00c2f4"
CaretBrush="Aqua"
IsEnabled="{Binding IsEnable}"
Text="{Binding Loc}" />

@@ -89,64 +93,70 @@
</ScrollViewer>

<UniformGrid Grid.Row="1" Columns="2">
<Button
Margin="10,10,10,0"
Command="{Binding AddSimDataCommand}"
Content="新增模拟数据"
/>
<Button
Margin="10,10,10,0"
Grid.Column="1"
Command="{Binding SimOrderCommand}"
Content="模拟订单" Cursor="Hand"
/>
<Button
Margin="10,10,10,0"
Command="{Binding AddSimDataCommand}"
Content="新增模拟数据"
/>
</UniformGrid>
</StackPanel>
</Grid>

<Grid Grid.Column="1" Margin="20,0,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="40" />
<RowDefinition Height="40" />
<RowDefinition Height="40" />
<RowDefinition Height="80" />
<RowDefinition Height="80" />
<RowDefinition Height="80" />
<RowDefinition />
</Grid.RowDefinitions>

<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical" >

<!--#region 控制按钮-->
<Button
Margin="10,10,10,0"
Margin="0,10,10,0"
Command="{Binding InitCommand}"
Content="初始化" Cursor="Hand"
Width="200"
VerticalAlignment="Center"
HorizontalAlignment="Left"
Content="设备初始化" Cursor="Hand"
Grid.Row="0"
/>

<Button
Margin="10,10,10,0"
<CheckBox
Margin="0,10,0,0"
Grid.Row="1"
Height="20"
VerticalAlignment="Center"
HorizontalAlignment="Left"
Background="#FF2AB2E7"
Content="启用本地模拟程序"
FontSize="14"
Foreground="#00c2f4"
IsChecked="{Binding EnableLocalSimOrder}"
/>
<!--<Button
Margin="10,5,10,0"
Command="{Binding InitCommand}"
Content="停止"
/>
/>-->

<Button
<!--<Button
x:Name="button_loop"
Margin="10,10,10,0"
Command="{Binding LoopSimOrderCommand}"
Content="{Binding LoopOrderButtonContent}"
/>
/>-->
<!--#endregion-->

</StackPanel>

<CheckBox
Grid.Row="2"
Height="20"
VerticalAlignment="Center"
Background="#FF2AB2E7"
Content="启用本地模拟程序"
FontSize="14"
Foreground="#00c2f4"
IsChecked="{Binding EnableLocalSimOrder}"
/>

</Grid>

</Grid>


+ 5
- 5
BPASmartClient/DeviceInfo.xml Dosyayı Görüntüle

@@ -73,19 +73,19 @@
</Peripherals>
</Device>-->

<!--<Device Name="Morks" Module="BPASmartClient.MorkS.Control_Morks" DeviceId="100">
<Device Name="Morks" Module="BPASmartClient.MorkS.Control_Morks" DeviceId="100">
<Peripherals>
<Peripheral Module="BPASmartClient.PLC.PLCMachine">
<Parameters>
<IpAddress>127.0.0.1</IpAddress>
<Port>502</Port>
<PLCReadAddress>M,M230.0,24;M,M0.3,3;M,M100.0,16;M,M235.0,1;M,M102.0,7;M,M103.0,6;VW,VW372,1</PLCReadAddress>
--><!--<PLCReadAddress>M,M230.0,24</PLCReadAddress>--><!--
<PLCReadAddress>M,M230.0,24</PLCReadAddress>
</Parameters>
</Peripheral>
</Peripherals>
</Device>-->-->-->
<Device Name="MorkM" Module="BPASmartClient.MorkM.Control_MorkM" DeviceId="100">
</Device>-->-->
<!--<Device Name="MorkM" Module="BPASmartClient.MorkM.Control_MorkM" DeviceId="100">
<Peripherals>
<Peripheral Module="BPASmartClient.PLC.PLCMachine">
<Parameters>
@@ -96,6 +96,6 @@
</Parameters>
</Peripheral>
</Peripherals>
</Device>-->-->
</Device>-->-->-->

</BPADevices>

+ 1
- 1
BPASmartClient/MainWindow.xaml Dosyayı Görüntüle

@@ -85,7 +85,7 @@
<MenuItem
Click="Debug_Click"
FontSize="12"
Header="调试界面"
Header="调试"
Tag="DebugView" />




+ 3
- 3
BPASmartClient/MainWindow.xaml.cs Dosyayı Görüntüle

@@ -233,9 +233,9 @@ namespace BPASmartClient
{
if (sender is MenuItem)
{
// Type type = Assembly.Load("BPASmartClient.MorkT").GetType("BPASmartClient.MorkT.View.DebugView");
// Type type = Assembly.Load("BPASmartClient.MorkF").GetType("BPASmartClient.MorkF.View.DebugView");
Type type = Assembly.Load("BPASmartClient.MorkM").GetType("BPASmartClient.MorkM.View.DebugView");
// Type type = Assembly.Load("BPASmartClient.MorkT").GetType("BPASmartClient.MorkT.View.DebugView");
Type type = Assembly.Load("BPASmartClient.MorkF").GetType("BPASmartClient.MorkF.View.DebugView");
//Type type = Assembly.Load("BPASmartClient.MorkM").GetType("BPASmartClient.MorkM.View.DebugView");
ConstructorInfo cti = type.GetConstructor(System.Type.EmptyTypes);
contentRegion.Content = (FrameworkElement)cti.Invoke(null);
Title.Text = (sender as MenuItem).Header?.ToString() + "界面";


Yükleniyor…
İptal
Kaydet