Переглянути джерело

煮面机流程优化

样式分支
pry 2 роки тому
джерело
коміт
4cd88a99ad
4 змінених файлів з 15 додано та 92 видалено
  1. +10
    -34
      BPASmartClient.MorkS/Control_Morks.cs
  2. +0
    -1
      BPASmartClient.MorkS/GVL_MORKS.cs
  3. +4
    -2
      BPASmartClient.ViewModel/MainViewModel.cs
  4. +1
    -55
      BPASmartClient.ViewModel/OrderStatusViewModel.cs

+ 10
- 34
BPASmartClient.MorkS/Control_Morks.cs Переглянути файл

@@ -279,7 +279,6 @@ namespace BPASmartClient.MorkS
});
}


public override void MainTask()
{
mORKS.AllowRun = mORKS.InitComplete;
@@ -322,8 +321,6 @@ namespace BPASmartClient.MorkS
{
if (mORKS.AllowRun && mORKS.TakeBowlTask.Count > 0 && !mORKS.TakeBowlIdle && !mORKS.TakeBowlInterlock)
{
//if (mORKS.TakeBowlTask.TryDequeue(out OrderLocInfo orderLocInfo))
//{
ushort BowLoc = 0;
var res = orderMaterialDelivery?.BatchingInfo?.Where(p => p.BatchingId == mORKS.TakeBowlTask.ElementAt(0).BatchingId).ToList();
if (res == null || res?.Count == 0)
@@ -355,27 +352,6 @@ namespace BPASmartClient.MorkS
BowlControl(orderLocInfo);
}
}

//if (BowLoc >= 10 && BowLoc <= 11)
//{
// mORKS.TakeBowlInterlock = true;
// mORKS.TakeBowlId = orderLocInfo.SuborderId;
// TakeBowlControl(BowLoc);
// SetRecipeNumber(orderLocInfo.RecipeNumber);
// OrderChange(mORKS.TakeBowlId, ORDER_STATUS.COOKING);
// DeviceProcessLogShow($"订单【{ mORKS.TakeBowlId}】执行取碗控制,位置:[{orderLocInfo.Loc}]");
//}


//之前版本
//mORKS.TakeBowlId = orderLocInfo.SuborderId;
//TakeBowlControl(orderLocInfo.Loc);
//SetRecipeNumber(orderLocInfo.RecipeNumber);
//OrderChange(mORKS.TakeBowlId, ORDER_STATUS.COOKING);
//DeviceProcessLogShow($"订单【{ mORKS.TakeBowlId}】执行取碗控制,位置:[{orderLocInfo.Loc}]");
//mORKS.TakeBowlInterlock = true;
//}

}
}

@@ -493,7 +469,6 @@ namespace BPASmartClient.MorkS
mORKS.TakeNoodleInterlock = true;
}
}

}
}

@@ -547,15 +522,7 @@ namespace BPASmartClient.MorkS
}

//取餐完成逻辑处理
//if (DelayRTrig.GetInstance("CompleteChange1").Start(mORKS.RbOutMealComplete && !mORKS.TakeMealDetect, 2))
//{
// OrderChange(mORKS.OutMealId, ORDER_STATUS.COMPLETED_TAKE);
// DeviceProcessLogShow($"订单【{mORKS.OutMealId}】取餐完成");
// ResetCookComplete();
// mORKS.OutMealId = string.Empty;
//}

if (DelayRTrig.GetInstance("CompleteChange1").Start(mORKS.CookCompleteFlatBit && !mORKS.TakeMealDetect, 2))
if (Delay.GetInstance("CompleteChange1").Start(mORKS.CookCompleteFlatBit && !mORKS.TakeMealDetect, 2))
{
OrderChange(mORKS.OutMealId, ORDER_STATUS.COMPLETED_TAKE);
DeviceProcessLogShow($"订单【{mORKS.OutMealId}】取餐完成");
@@ -564,6 +531,15 @@ namespace BPASmartClient.MorkS
mORKS.OutMealId = string.Empty;
}

//if (DelayRTrig.GetInstance("CompleteChange1").Start(mORKS.CookCompleteFlatBit && !mORKS.TakeMealDetect, 2))
//{
// OrderChange(mORKS.OutMealId, ORDER_STATUS.COMPLETED_TAKE);
// DeviceProcessLogShow($"订单【{mORKS.OutMealId}】取餐完成");
// ResetCookComplete();
// mORKS.CookCompleteFlatBit = false;
// mORKS.OutMealId = string.Empty;
//}

//机器人取面完成信号检测
if (RTrig.GetInstance("TakeNoodleComplete").Start(mORKS.RbTakeNoodleComplete))
{


+ 0
- 1
BPASmartClient.MorkS/GVL_MORKS.cs Переглянути файл

@@ -83,7 +83,6 @@ namespace BPASmartClient.MorkS
public bool TurntableInterlock { get; set; }
#endregion


/// <summary>
/// 初始化完成
/// PLC -> M100.0


+ 4
- 2
BPASmartClient.ViewModel/MainViewModel.cs Переглянути файл

@@ -71,15 +71,17 @@ namespace BPASmartClient.ViewModel
System.Windows.Application.Current?.Dispatcher.Invoke((Action)(() =>
{
NetworkConnectState = UniversalHelper.GetInstance().GetNetworkState();
CurrentOrderCount = Json<KeepDataBase>.Data.orderLists.Count;
}));
};
dispatcherTimer.Interval = TimeSpan.FromSeconds(1);
dispatcherTimer.Start();


}

public int CurrentOrderCount { get { return Json<KeepDataBase>.Data.orderLists.Count; } set { OnPropertyChanged(); } }

public int CurrentOrderCount { get { return _mCurrentOrderCount; } set { _mCurrentOrderCount = value; OnPropertyChanged(); } }
private int _mCurrentOrderCount;

public bool AutoStart { get { return SystemHelper.GetInstance.IsAutoStart(); } set { SystemHelper.GetInstance.AutoStart(value); OnPropertyChanged(); } }



+ 1
- 55
BPASmartClient.ViewModel/OrderStatusViewModel.cs Переглянути файл

@@ -96,60 +96,6 @@ namespace BPASmartClient.ViewModel
}), "AddOrder");

EventBus.EventBus.GetInstance().Subscribe<OrderStatusChangedEvent>(0, OrderStatusChangedHandle);

//ActionManage.GetInstance.Register(new Action<object>((o) =>
//{
// if (o is OrderStatusChangedEvent orderStatusChange)
// {
// int index = Array.FindIndex(orderStatusLists.ToArray(), p => p.OrderPush.SuborderId == orderStatusChange.SubOrderId);
// switch (orderStatusChange.Status)
// {
// case ORDER_STATUS.COOKING:
// if (index >= 0 && index < orderStatusLists.Count)
// orderStatusLists.ElementAt(index).OrderStatus = orderStatusChange.Status;
// break;
// case ORDER_STATUS.COMPLETED_COOK:
// if (index >= 0 && index < orderStatusLists.Count)
// {
// Application.Current.Dispatcher.BeginInvoke((Action)delegate
// {
// orderStatusLists.ElementAt(index).OrderStatus = orderStatusChange.Status;
// orderStatusLists.ElementAt(index).EndDate = DateTime.Now.ToString("HH:mm:ss");
// TimeSpan timeSpan = DateTime.Now.Subtract(Convert.ToDateTime(orderStatusLists.ElementAt(index).StartDate));
// orderStatusLists.ElementAt(index).CompleteDate = $"{timeSpan.TotalSeconds.ToString("0.00")} S";

// //压力测试时注释,正常使用需要取消注释
// if (!BPASmartClient.Business.InternetInfo.IsEnableTest)
// {
// WaitTakeMeal.Insert(0, orderStatusLists.ElementAt(index));
// orderStatusLists.RemoveAt(index);
// }

// });
// }

// break;
// case ORDER_STATUS.COMPLETED_TAKE:
// if (BPASmartClient.Business.InternetInfo.IsEnableTest)
// orderStatusLists.ElementAt(index).OrderStatus = orderStatusChange.Status;

// //压力测试时注释,正常使用需要取消注释
// var re = WaitTakeMeal.FirstOrDefault(p => p.OrderPush.SuborderId == orderStatusChange.SubOrderId);
// if (re != null)
// {
// Application.Current.Dispatcher.BeginInvoke((Action)delegate
// {
// 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);
// });
// }
// break;
// default:
// break;
// }
// }
//}), "OrderStatusChange");
}

private static void OrderStatusChangedHandle(IEvent @event, EventBus.EventBus.EventCallBackHandle callBack)
@@ -184,7 +130,7 @@ namespace BPASmartClient.ViewModel

break;
case ORDER_STATUS.COMPLETED_TAKE:
if (BPASmartClient.Business.InternetInfo.IsEnableTest)
if (BPASmartClient.Business.InternetInfo.IsEnableTest && index >= 0 && index < orderStatusLists.Count)
orderStatusLists.ElementAt(index).OrderStatus = orderStatusChange.Status;

//压力测试时注释,正常使用需要取消注释


Завантаження…
Відмінити
Зберегти