Selaa lähdekoodia

1. 修改冒菜机的模拟订单功能。2. 煮面机模拟界面碗位置默认修改为11.

煮面机(新)
ZhaoGang 1 vuosi sitten
vanhempi
commit
c1fe4b32fd
3 muutettua tiedostoa jossa 45 lisäystä ja 10 poistoa
  1. +43
    -8
      BPASmartClient.MorkMV1/Control_MorkMV1.cs
  2. +1
    -1
      BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer.cs
  3. +1
    -1
      BPASmartClient.MorkSUpgradedVer/ViewModel/DebugViewModel.cs

+ 43
- 8
BPASmartClient.MorkMV1/Control_MorkMV1.cs Näytä tiedosto

@@ -69,13 +69,18 @@ namespace BPASmartClient.MorkMV1
Random rd = new Random();
TaskManage.GetInstance.StartLong(new Action(() =>
{
string guid = new Guid().ToString();
string guid = Guid.NewGuid().ToString();

//模拟订单的素菜和荤菜计数。[0]为荤菜,[1]为素菜。
int[] materialCount = new int[] { 0, 0 };
int allCount = 0;

if (o[0] is List<int> noodleLocs)
{
if (noodleLocs.Count==0)
//如果是随机素材,则随机添加2到4个素材。
if (noodleLocs.Count == 0)
{
for (int i = 0; i < rd.Next(1,5); i++)
for (int i = 0; i < rd.Next(2, 5); i++)
{
noodleLocs.Add(0);
}
@@ -84,6 +89,7 @@ namespace BPASmartClient.MorkMV1
{
foreach (var loc in noodleLocs)
{
//如果是随机素材,则每个素材的位置随机。
int NoodleLoc = loc == 0 ? rd.Next(1, 6) : loc;

if (NoodleLoc >= 1 && NoodleLoc <= 5)
@@ -99,17 +105,30 @@ namespace BPASmartClient.MorkMV1
Minute = x.Minute,
Second = x.Second
});
allCount++;
materialCount[i]++;
MessageLog.GetInstance.Show($"添加模拟订单:素材位置【{(ushort)NoodleLoc}】");
}
}
}
}
}
int BowlLoc = (int)o[1] == 0 ? rd.Next(10, 12) : (int)o[1];
mORKM.TakeBowlTask.Enqueue(new MOrderLocInfo() { Loc = (ushort)BowlLoc, SuborderId = guid });
MessageLog.GetInstance.Show($"添加模拟订单:碗位置【{BowlLoc}】");


//int BowlLoc = (int)o[1] == 0 ? rd.Next(10, 12) : (int)o[1];
int BowlLoc = (int)o[1] == 0 ? 11 : (int)o[1];
mORKM.TakeBowlTask.Enqueue(new MOrderLocInfo() { Loc = (ushort)BowlLoc, SuborderId = guid });
MessageLog.GetInstance.Show($"添加模拟订单:碗位置【{BowlLoc}】");

if (!mORKM.SuborderCount.ContainsKey(guid))
{
mORKM.SuborderCount.TryAdd(guid, new SuborderInfo()
{
ActualCount = allCount,
AcMeatDishesCount = materialCount[0],
AcVegetableCount = materialCount[1],
});
}
}
Thread.Sleep(60000);
}), "ForOrder");
}
@@ -1028,6 +1047,9 @@ namespace BPASmartClient.MorkMV1
if (@event != null && @event is MorkMV1SimorderModel msm)
{
string guid = Guid.NewGuid().ToString();
//模拟订单的素菜和荤菜计数。[0]为荤菜,[1]为素菜。
int[] materialCount = new int[] { 0, 0 };
int allCount = 0;
for (int i = 0; i <= 1; i++)
{
foreach (var loc in msm.NoodleLoc)
@@ -1045,6 +1067,9 @@ namespace BPASmartClient.MorkMV1
Minute = x.Minute,
Second = x.Second
});
//对菜的数量计数。
materialCount[i]++;
allCount++;
MessageLog.GetInstance.Show($"添加模拟订单:素材位置【{(ushort)loc}】");
}
}
@@ -1058,6 +1083,16 @@ namespace BPASmartClient.MorkMV1
MessageLog.GetInstance.Show($"添加模拟订单:碗位置【{(ushort)msm.BowlLoc}】");
}


if (!mORKM.SuborderCount.ContainsKey(guid))
{
mORKM.SuborderCount.TryAdd(guid, new SuborderInfo()
{
ActualCount = allCount,
AcMeatDishesCount = materialCount[0],
AcVegetableCount = materialCount[1],
});
}
}
});
}


+ 1
- 1
BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer.cs Näytä tiedosto

@@ -46,7 +46,7 @@ namespace BPASmartClient.MorkSUpgradedVer
int NoodleLoc = (int)o[0] == 0 ? rd.Next(1, 6) : (int)o[0];
int BowlLoc = (int)o[1] == 0 ? rd.Next(10, 12) : (int)o[1];

string guid = new Guid().ToString();
string guid = Guid.NewGuid().ToString();

mORKS.RBTakeNoodleTask.Enqueue(new OrderLocInfo() { Loc = (ushort)NoodleLoc, SuborderId = guid });
MessageLog.GetInstance.Show($"添加订单:面条位置【{NoodleLoc}】");


+ 1
- 1
BPASmartClient.MorkSUpgradedVer/ViewModel/DebugViewModel.cs Näytä tiedosto

@@ -62,7 +62,7 @@ namespace BPASmartClient.MorkSUpgradedVer.ViewModel


public int BowlLoc { get { return _mBowlLoc; } set { _mBowlLoc = value; OnPropertyChanged(); } }
private int _mBowlLoc = 10;
private int _mBowlLoc = 11;

public bool IsNoodPositon { get { return _isNoodPositon; } set { _isNoodPositon = value; OnPropertyChanged(); } }
private bool _isNoodPositon = false;


Ladataan…
Peruuta
Tallenna