58 lines
1.7 KiB
C#
58 lines
1.7 KiB
C#
using Cowain.Preheat.Common.Enums;
|
|
using Cowain.Preheat.Common.Models;
|
|
using Cowain.Preheat.Model;
|
|
using Cowain.Preheat.Model.Models;
|
|
using Newtonsoft.Json;
|
|
using Newtonsoft.Json.Converters;
|
|
using System;
|
|
using System.Collections.Concurrent;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using System.Threading;
|
|
using System.Windows.Media;
|
|
|
|
namespace Cowain.Preheat.Common.Core
|
|
{
|
|
public class CommonCoreHelper
|
|
{
|
|
public static BlockingCollection<BtnInfoModel> BlockBtnInfo = new BlockingCollection<BtnInfoModel>();
|
|
public static BlockingCollection<TDeviceConfig> BlockStatusColorItems = new BlockingCollection<TDeviceConfig>(200);
|
|
public static AutoResetEvent AutoEventToolTip = new AutoResetEvent(true);
|
|
private CommonCoreHelper()
|
|
{
|
|
|
|
}
|
|
public static List<string> StringToListConverter(string input)
|
|
{
|
|
string[] separators = { " ", ":", ",", ";" };
|
|
if (string.IsNullOrWhiteSpace(input))
|
|
{
|
|
return new List<string>();
|
|
}
|
|
string[] items = input.Split(separators, StringSplitOptions.RemoveEmptyEntries);
|
|
List<string> itemList = new List<string>(items);
|
|
return itemList;
|
|
}
|
|
|
|
|
|
|
|
public static EBatteryStatus GetBatteryStatus(string stationName)
|
|
{
|
|
if (stationName.Contains("上料"))
|
|
{
|
|
return EBatteryStatus.InBound;
|
|
}
|
|
else if (stationName.Contains("下料"))
|
|
{
|
|
return EBatteryStatus.OutBound;
|
|
}
|
|
else
|
|
{
|
|
return EBatteryStatus.Preheat;
|
|
}
|
|
}
|
|
}
|
|
}
|