lyw 5 месяцев назад
Родитель
Сommit
91440c354a
6 измененных файлов: 79 добавлений и 40 удалений
  1. +1
    -1
      BPASmartClient.Device/BaseDevice.cs
  2. +1
    -0
      BPASmartClient.Model/OrderData.cs
  3. +1
    -0
      BPASmartClient.Model/OrderLocInfo.cs
  4. +73
    -36
      BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer.cs
  5. +1
    -1
      BPASmartClient.ViewModel/FoodMenuViewModel.cs
  6. +2
    -2
      BPASmartClient/Control/FoodMenuView.xaml

+ 1
- 1
BPASmartClient.Device/BaseDevice.cs Просмотреть файл

@@ -379,7 +379,7 @@ namespace BPASmartClient.Device
{
TaskManage.GetInstance.StopTask($"GvlStatusMonitor:{DeviceId}", new Action(() =>
{
ActionManage.GetInstance.Send("ClearOrders");
//ActionManage.GetInstance.Send("ClearOrders");
ResetProgram();
ResetStatus();
InitTask();


+ 1
- 0
BPASmartClient.Model/OrderData.cs Просмотреть файл

@@ -59,6 +59,7 @@ namespace BPASmartClient.Model

public FoodMenuModel FoodMenuModel { get { return _mFoodMenuModel; } set { _mFoodMenuModel = value; OnPropertyChanged(); } }
private FoodMenuModel _mFoodMenuModel = new FoodMenuModel();

}




+ 1
- 0
BPASmartClient.Model/OrderLocInfo.cs Просмотреть файл

@@ -19,6 +19,7 @@ namespace BPASmartClient.Model
public int RecipeId { get; set; }

public List<int> Recipes { get; set; }
public bool IsLocal { get; set; } = true;

}
}

+ 73
- 36
BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer.cs Просмотреть файл

@@ -234,7 +234,7 @@ namespace BPASmartClient.MorkSUpgradedVer
{
if (mORKS.doOrderEvents!=null&&mORKS.doOrderEvents.Count>0&&!string.IsNullOrEmpty(subid))
{
var res = mORKS.doOrderEvents.FirstOrDefault(p => p.MorkOrder.SuborderId == subid);
var res = mORKS.doOrderEvents.Find(p => p.MorkOrder.SuborderId == subid);
string goodName = string.Empty;
string SortNum = string.Empty;
if (res != null)
@@ -499,6 +499,9 @@ namespace BPASmartClient.MorkSUpgradedVer
if (obj is bool[] bools && bools.Length > 0 && bools.Length <= 1)
{
mORKS.FixedFlag = bools[0];
if (!mORKS.FixedFlag&& NoodOrderCtrl.GetInstance.stateInfo== "补料中")
NoodOrderCtrl.GetInstance.StateShow("设备正常运行");
}
}));

@@ -647,6 +650,7 @@ namespace BPASmartClient.MorkSUpgradedVer
Loc = ushort.Parse(res.BatchingLoc),
SuborderId = order.MorkOrder.SuborderId,
SortNum = order.MorkOrder.SortNum,
IsLocal = false,
BatchingId = res.BatchingId
});
}
@@ -666,6 +670,7 @@ namespace BPASmartClient.MorkSUpgradedVer
Loc = ushort.Parse(res.BatchingLoc),
SuborderId = order.MorkOrder.SuborderId,
SortNum = order.MorkOrder.SortNum,
IsLocal = false,
RecipeNumber = (index >= 1 && index <= 10) ? (ushort)index : (ushort)0
});
}
@@ -785,14 +790,15 @@ namespace BPASmartClient.MorkSUpgradedVer
if (mORKS.AllowRun && mORKS.TakeBowlTask.Count > 0 && !mORKS.DropBowlMechanismStatus && !mORKS.TakeBowlInterlock)
{
ushort BowLoc = 0;
if (mORKS.TakeBowlTask.TryDequeue(out OrderLocInfo orderLocInfo))
var re = FoodMenuViewModel.orderStatusLists.FirstOrDefault(o => o.OrderPush.SuborderId == mORKS.TakeBowlTask.ElementAt(0).SuborderId);
if (re != null)
{
var re = FoodMenuViewModel.orderStatusLists.FirstOrDefault(o => o.OrderPush.SuborderId == orderLocInfo.SuborderId);
if (re != null)
if (mORKS.TakeBowlTask.TryDequeue(out OrderLocInfo orderLocInfo))
{
BowLoc = (ushort)re.FoodMenuModel.BowLoc;
BowlControl(orderLocInfo);
}

}
//var res = orderMaterialDelivery?.BatchingInfo?.Where(p => p.BatchingId == mORKS.TakeBowlTask.ElementAt(0).BatchingId).ToList();
//if (res == null || res?.Count == 0)
@@ -845,6 +851,7 @@ namespace BPASmartClient.MorkSUpgradedVer
/// <summary>转台控制</summary>
private void TurntableControl()
{
Global.EnableLocalSimOrder=true;
if (Global.EnableLocalSimOrder)
{
//不做轮询,直接取面,本地订单使用
@@ -852,16 +859,30 @@ namespace BPASmartClient.MorkSUpgradedVer
{
if (!mORKS.TurntableLowPosition)
{
if (mORKS.RBTakeNoodleTask.ElementAt(0).Loc !=0)
if (mORKS.RBTakeNoodleTask.ElementAt(0).IsLocal)
{
if (!mORKS.TurntableLocLists.Contains(mORKS.RBTakeNoodleTask.ElementAt(0).Loc))
if (mORKS.RBTakeNoodleTask.ElementAt(0).Loc != 0)
{
TurntableStart(mORKS.RBTakeNoodleTask.ElementAt(0).Loc);
if (!mORKS.TurntableLocLists.Contains(mORKS.RBTakeNoodleTask.ElementAt(0).Loc))
{
TurntableStart(mORKS.RBTakeNoodleTask.ElementAt(0).Loc);
}
else
{
DeviceProcessLogShow("未找到可用的物料信息");
mORKS.TurntableLocLists.Clear();
}
}
else
{
DeviceProcessLogShow("未找到可用的物料信息");
mORKS.TurntableLocLists.Clear();
if (mORKS.CurrentFeedbackLoc == 5)
{
TurntableStart((ushort)1);
}
else
{
TurntableStart((ushort)(mORKS.CurrentFeedbackLoc + 1));
}
}
}
else
@@ -870,20 +891,34 @@ namespace BPASmartClient.MorkSUpgradedVer
{
TurntableStart((ushort)1);
}
TurntableStart((ushort)(mORKS.CurrentFeedbackLoc + 1));
else
{
TurntableStart((ushort)(mORKS.CurrentFeedbackLoc + 1));
}
}

}
else
{
if (mORKS.RBTakeNoodleTask.ElementAt(0).Loc == 0)
if (mORKS.RBTakeNoodleTask.ElementAt(0).IsLocal)
{
if (mORKS.RBTakeNoodleTask.ElementAt(0).Loc == 0)
{
mORKS.RBTakeNoodleTask.ElementAt(0).Loc = mORKS.CurrentFeedbackLoc;
}
TurntableStart(mORKS.RBTakeNoodleTask.ElementAt(0).Loc);
mORKS.AllowTakeNoodle = true;
DeviceProcessLogShow($"控制机器人去转台【{mORKS.RBTakeNoodleTask.ElementAt(0).Loc}】号位置取面");
}
else
{
mORKS.RBTakeNoodleTask.ElementAt(0).Loc = mORKS.CurrentFeedbackLoc;
TurntableStart(mORKS.RBTakeNoodleTask.ElementAt(0).Loc);
mORKS.AllowTakeNoodle = true;
DeviceProcessLogShow($"控制机器人去转台【{mORKS.RBTakeNoodleTask.ElementAt(0).Loc}】号位置取面");
}
TurntableStart(mORKS.RBTakeNoodleTask.ElementAt(0).Loc);
mORKS.AllowTakeNoodle = true;
DeviceProcessLogShow($"控制机器人去转台【{mORKS.RBTakeNoodleTask.ElementAt(0).Loc}】号位置取面");
}
//if (mORKS.TurntableLowPosition)
//{
@@ -952,6 +987,7 @@ namespace BPASmartClient.MorkSUpgradedVer
}
if (RTrig.GetInstance("mORKS.FixedFlag").Start(mORKS.FixedFlag))
{
NoodOrderCtrl.GetInstance.StateShow("补料中");
mORKS.AllowTakeNoodle = false;
mORKS.TakeNoodleInterlock = false;
}
@@ -989,11 +1025,13 @@ namespace BPASmartClient.MorkSUpgradedVer
{
//if (!Json<MorksPar>.Data.parSets.ElementAt(loc).IsShield)//检查该煮面篮是否被屏蔽
//{
if (mORKS.RBTakeNoodleTask.TryDequeue(out OrderLocInfo orderLocInfo))
var res = FoodMenuViewModel.orderStatusLists.FirstOrDefault(o => o.OrderPush.SuborderId == mORKS.RBTakeNoodleTask.ElementAt(0).SuborderId);

if (res != null)
{
var res = FoodMenuViewModel.orderStatusLists.FirstOrDefault(o => o.OrderPush.SuborderId == orderLocInfo.SuborderId);
if (res != null)
if (mORKS.RBTakeNoodleTask.TryDequeue(out OrderLocInfo orderLocInfo))
{

//写入煮面时间
//List<ushort> values = new List<ushort>();
//values.Add(Json<MorksPar>.Data.parSets.ElementAt(loc).Minute);
@@ -1001,27 +1039,26 @@ namespace BPASmartClient.MorkSUpgradedVer
//WriteData($"VW{324 + (loc * 4)}", values.ToArray());
if (mORKS.CurrentFeedbackLoc >= 1 && mORKS.CurrentFeedbackLoc <= 5)
{
var x = Json<MorksPar>.Data.DishLibraryParSets.FirstOrDefault(p => p.TextBlockContext == mORKS.CurrentFeedbackLoc.ToString());
if (x != null)
//var x = Json<MorksPar>.Data.DishLibraryParSets.FirstOrDefault(p => p.TextBlockContext == mORKS.CurrentFeedbackLoc.ToString());
//if (x != null)
//{
List<ushort> values = new List<ushort>();
if (Json<NoodOrder>.Data.localOrder.ContainsKey(res.OrderPush.GoodsName))
{
var re = FoodMenuViewModel.orderStatusLists.FirstOrDefault(o => o.OrderPush.SuborderId == orderLocInfo.SuborderId);
List<ushort> values = new List<ushort>();
if (Json<NoodOrder>.Data.localOrder.ContainsKey(re.OrderPush.GoodsName))
{
values.Add((ushort)Json<NoodOrder>.Data.localOrder[re.OrderPush.GoodsName].FryTimeMin);
values.Add((ushort)Json<NoodOrder>.Data.localOrder[re.OrderPush.GoodsName].FryTimeS);
}
else
{
values.Add(2);
values.Add(0);
}
/*
values.Add(re);
values.Add(x.Second);*/
WriteData($"VW{324 + (loc * 4)}", values.ToArray());
DeviceProcessLogShow($"转盘位置[{mORKS.CurrentFeedbackLoc}]:写入煮面时间{x.Minute}分{x.Second}秒。");
values.Add((ushort)Json<NoodOrder>.Data.localOrder[res.OrderPush.GoodsName].FryTimeMin);
values.Add((ushort)Json<NoodOrder>.Data.localOrder[res.OrderPush.GoodsName].FryTimeS);
}
else
{
values.Add(2);
values.Add(0);
}
/*
values.Add(re);
values.Add(x.Second);*/
WriteData($"VW{324 + (loc * 4)}", values.ToArray());
//DeviceProcessLogShow($"转盘位置[{mORKS.CurrentFeedbackLoc}]:写入煮面时间{x.Minute}分{x.Second}秒。");
//}
}




+ 1
- 1
BPASmartClient.ViewModel/FoodMenuViewModel.cs Просмотреть файл

@@ -184,7 +184,7 @@ namespace BPASmartClient.ViewModel
{
Application.Current.Dispatcher.BeginInvoke((Action)delegate
{
WaitTakeMeal.Remove(re);
//WaitTakeMeal.Remove(re);
var removeObj = Json<KeepDataBase>.Data.orderLists.FirstOrDefault(p => p.morkOrderPushes.FirstOrDefault(s => s.OrderPush.SuborderId == re.OrderPush.SuborderId) != null);
if (removeObj != null) Json<KeepDataBase>.Data.orderLists.Remove(removeObj);
});


+ 2
- 2
BPASmartClient/Control/FoodMenuView.xaml Просмотреть файл

@@ -118,7 +118,7 @@
</ScrollViewer>
</Grid>
<Grid Grid.Row="2" x:Name="takeGrid" Visibility="Collapsed">
<ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
<ScrollViewer HorizontalScrollBarVisibility="Hidden" PanningMode="VerticalOnly" IsManipulationEnabled="True" VerticalScrollBarVisibility="Hidden">
<ItemsControl Background="#D7D7D7" ItemsSource="{Binding WaitTakeMeal,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}">
<ItemsControl.ItemTemplate>
<DataTemplate>
@@ -156,7 +156,7 @@
</ScrollViewer>
</Grid>
<Grid Grid.Row="2" x:Name="historyGrid" Visibility="Collapsed">
<ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
<ScrollViewer HorizontalScrollBarVisibility="Hidden" PanningMode="VerticalOnly" IsManipulationEnabled="True" VerticalScrollBarVisibility="Hidden">
<ItemsControl Background="#D7D7D7" ItemsSource="{Binding history,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}">
<ItemsControl.ItemTemplate>
<DataTemplate>


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