using BPASmartClient.CustomResource.Pages.Model;
using BPA.Helper;
using BPASmartClient.JXJFoodBigStation.Model.HK_PLC;
using BPASmartClient.JXJFoodBigStation.Model.Siemens;
using BPASmartClient.Modbus;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Configuration;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Markup;
namespace BPASmartClient.JXJFoodBigStation.Model
{
public class ProcessControl
{
private volatile static ProcessControl _Instance;
public static ProcessControl GetInstance => _Instance ?? (_Instance = new ProcessControl());
private ProcessControl() { }
//public SiemensDeviceStatus SiemensDevice = new SiemensDeviceStatus();
public HKDeviceStatus HKDevice = new HKDeviceStatus();
DL_Finish_DB FinishData = new DL_Finish_DB();
///
/// MES配方数据
///
public ObservableCollection SiemensRecipes { get; set; } = new ObservableCollection();
///
/// 本地配方数据
///
//public ObservableCollection LocalRecipes { get; set; } = new ObservableCollection();
///
/// 配方等待执行
///
//public ObservableCollection RecipeWaitExecute { get; set; } = new ObservableCollection();
///
/// 配方正在执行
///
//public ObservableCollection RecipeExecuting { get; set; } = new ObservableCollection();
///
/// 配方执行完成
///
public ObservableCollection RecipeExecuteComple { get; set; } = new ObservableCollection();
///
/// 原料的名称和料仓的位置对应
///
public ConcurrentDictionary RawMaterialsNamePos { get; set; } = new ConcurrentDictionary();
///
/// 硬件料仓的原料信息
///
public ObservableCollection HardWareRawMaterialInfo { get; set; } = new ObservableCollection();
public ObservableCollection RawMaterialsInfo { get; set; } = new ObservableCollection();
///
/// MES配方队列
///
public ConcurrentQueue SiemensRecipeQueue1 = new ConcurrentQueue();
public ConcurrentQueue SiemensRecipeQueue2 = new ConcurrentQueue();
public ConcurrentQueue SiemensRecipeQueue3 = new ConcurrentQueue();
public ConcurrentQueue SiemensRecipeQueue4 = new ConcurrentQueue();
public ConcurrentDictionary> SiemensRecipeQueue = new ConcurrentDictionary>();
//public ObservableCollection recipe = new ObservableCollection();
///
/// 本地配方队列
///
//public ConcurrentQueue LocalRecipeQueue1 = new ConcurrentQueue();
//public ConcurrentQueue LocalRecipeQueue2 = new ConcurrentQueue();
//public ConcurrentQueue LocalRecipeQueue3 = new ConcurrentQueue();
//public ConcurrentQueue LocalRecipeQueue4 = new ConcurrentQueue();
///
/// 海科PLC的IP
///
public string HK_PLC_IP = ConfigurationManager.AppSettings["HKPlc_IP"];
///
/// MESPLC的IP
///
public string Siemens_PLC_IP = ConfigurationManager.AppSettings["Siemens_IP"];
public void Init()
{
//TODO:下发订单数据处理修改
ActionManage.GetInstance.Register(new Action