首次提交:添加src文件夹代码
This commit is contained in:
228
Cowain.Bake.Common/Enums/EnumHelper.cs
Normal file
228
Cowain.Bake.Common/Enums/EnumHelper.cs
Normal file
@@ -0,0 +1,228 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO.Ports;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
namespace Cowain.Bake.Common.Enums
|
||||
{
|
||||
public static class EnumHelper
|
||||
{
|
||||
public static string FetchDescription(this Enum value)
|
||||
{
|
||||
try
|
||||
{
|
||||
FieldInfo fi = value.GetType().GetField(value.ToString());
|
||||
if (null == fi)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
DescriptionAttribute[] attributes = (DescriptionAttribute[])fi.GetCustomAttributes(typeof(DescriptionAttribute), false);
|
||||
if (attributes != null && attributes.Length > 0)
|
||||
return attributes[0].Description;
|
||||
else
|
||||
return value.ToString();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
public static string GetEnumDescription(this Enum @enum, int value)
|
||||
{
|
||||
Type enumType = @enum.GetType();
|
||||
if (Enum.IsDefined(enumType, value))
|
||||
{
|
||||
DescriptionAttribute[] descriptAttr = enumType.GetField(Enum.GetName(enumType, value)).GetDescriptAttr();
|
||||
return descriptAttr == null || descriptAttr.Length == 0 ? "" : descriptAttr[0].Description;
|
||||
}
|
||||
return "枚举异常";
|
||||
}
|
||||
|
||||
public static string GetDescription(this Enum enumName)
|
||||
{
|
||||
string str = string.Empty;
|
||||
DescriptionAttribute[] descriptAttr = enumName.GetType().GetField(enumName.ToString()).GetDescriptAttr();
|
||||
return descriptAttr == null || descriptAttr.Length == 0 ? enumName.ToString() : descriptAttr[0].Description;
|
||||
}
|
||||
public static ArrayList ToArrayList(this Enum en)
|
||||
{
|
||||
ArrayList arrayList = new ArrayList();
|
||||
foreach (Enum @enum in Enum.GetValues(en.GetType()))
|
||||
arrayList.Add(new KeyValuePair<Enum, string>(@enum, @enum.GetDescription()));
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
public static DescriptionAttribute[] GetDescriptAttr(this FieldInfo fieldInfo)
|
||||
{
|
||||
if (fieldInfo != null)
|
||||
return (DescriptionAttribute[])fieldInfo.GetCustomAttributes(typeof(DescriptionAttribute), false);
|
||||
return null;
|
||||
}
|
||||
public static dynamic Todynamic<T>(this Enum en)
|
||||
{
|
||||
Dictionary<int, string> valuePairs = new Dictionary<int, string>();
|
||||
foreach (Enum @enum in Enum.GetValues(en.GetType()))
|
||||
valuePairs.Add((int)Enum.Parse(typeof(T), @enum.ToString()), @enum.GetDescription());
|
||||
return valuePairs;
|
||||
}
|
||||
|
||||
public static dynamic ToStringKey<T>(this Enum en)
|
||||
{
|
||||
Dictionary<string, string> valuePairs = new Dictionary<string, string>();
|
||||
foreach (Enum @enum in Enum.GetValues(en.GetType()))
|
||||
valuePairs.Add(@enum.ToString(), @enum.GetDescription());
|
||||
return valuePairs;
|
||||
}
|
||||
public static dynamic GetListDesc(this Enum en)
|
||||
{
|
||||
List<string> lst = new List<string>();
|
||||
foreach (Enum @enum in Enum.GetValues(en.GetType()))
|
||||
lst.Add(@enum.GetDescription());
|
||||
return lst;
|
||||
}
|
||||
|
||||
public static dynamic ListKeyString<T>(this Enum en)
|
||||
{
|
||||
List<string> lst = new List<string>();
|
||||
foreach (Enum @enum in Enum.GetValues(en.GetType()))
|
||||
lst.Add(@enum.ToString());
|
||||
return lst;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <typeparam name="EnumType">The enum type.</typeparam>
|
||||
/// <param name="description">The description.</param>
|
||||
/// <returns>The enum value.</returns>
|
||||
public static EnumType GetValueByDescription<EnumType>(this string description)
|
||||
{
|
||||
var type = typeof(EnumType);
|
||||
foreach (var enumName in Enum.GetNames(type))
|
||||
{
|
||||
var enumValue = Enum.Parse(type, enumName);
|
||||
if (description == ((Enum)enumValue).GetDescription())
|
||||
return (EnumType)enumValue;
|
||||
}
|
||||
throw new ArgumentException("在指定的枚举类型值中没有此描述的值");
|
||||
}
|
||||
public static EnumType GetValueByKey<EnumType>(this string name)
|
||||
{
|
||||
var type = typeof(EnumType);
|
||||
foreach (var enumName in Enum.GetNames(type))
|
||||
{
|
||||
var enumValue = Enum.Parse(type, enumName);
|
||||
if (name == ((Enum)enumValue).ToString())
|
||||
return (EnumType)enumValue;
|
||||
}
|
||||
throw new ArgumentException("在指定的枚举类型值中没有此描述的值");
|
||||
}
|
||||
public static List<string> GetDescriptions<T>() where T : Enum
|
||||
{
|
||||
return Enum.GetValues(typeof(T))
|
||||
.Cast<T>()
|
||||
.Select(e => GetDescription(e))
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public static List<EnumModel> GetEnumList<EnumType>()
|
||||
{
|
||||
var type = typeof(EnumType);
|
||||
List<EnumModel> enumModels = new List<EnumModel>();
|
||||
foreach (var enumName in Enum.GetNames(type))
|
||||
{
|
||||
EnumModel enumModel = new EnumModel();
|
||||
enumModel.EnumString= enumName;
|
||||
var enumValue = Enum.Parse(type, enumName);
|
||||
enumModel.EnumDesc= ((Enum)enumValue).GetDescription();
|
||||
enumModel.EnumIntValue = int.Parse(((Enum)enumValue).ToString("D"));
|
||||
enumModels.Add(enumModel);
|
||||
}
|
||||
return enumModels;
|
||||
}
|
||||
|
||||
public static Parity GetParity(string name)
|
||||
{
|
||||
Parity parity = Parity.None;
|
||||
var arr = System.Enum.GetValues(typeof(Parity));
|
||||
foreach (Parity item in arr)
|
||||
{
|
||||
if (item.ToString() == name)
|
||||
{
|
||||
parity = item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return parity;
|
||||
}
|
||||
|
||||
public static StopBits GetStopBits(string name)
|
||||
{
|
||||
StopBits stopBits = StopBits.One;
|
||||
var arr = System.Enum.GetValues(typeof(StopBits));
|
||||
foreach (StopBits item in arr)
|
||||
{
|
||||
if (item.ToString() == name)
|
||||
{
|
||||
stopBits = item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return stopBits;
|
||||
}
|
||||
|
||||
public static Handshake GetHandshake(string name)
|
||||
{
|
||||
Handshake handshake = Handshake.None;
|
||||
var arr = System.Enum.GetValues(typeof(Handshake));
|
||||
foreach (Handshake item in arr)
|
||||
{
|
||||
if (item.ToString() == name)
|
||||
{
|
||||
handshake = item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return handshake;
|
||||
}
|
||||
|
||||
public static bool IsDefined<T>(int value) where T : struct, Enum
|
||||
{
|
||||
return Enum.IsDefined(typeof(T), value);
|
||||
}
|
||||
|
||||
//public static T GetNext<T>(this T value) where T : struct, Enum
|
||||
//{
|
||||
// var values = Enum.GetValues(typeof(T)).Cast<T>().ToArray();
|
||||
// int currentIndex = Array.IndexOf(values, value);
|
||||
// if (currentIndex < values.Length - 1)
|
||||
// {
|
||||
// return values[currentIndex + 1];
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return values[0];
|
||||
// }
|
||||
//}
|
||||
|
||||
public static void GetEnum<T>(string a, ref T t)
|
||||
{
|
||||
foreach (T b in Enum.GetValues(typeof(T)))
|
||||
{
|
||||
if (GetDescription(b as Enum) == a)
|
||||
t = b;
|
||||
}
|
||||
}
|
||||
}
|
||||
public class EnumModel
|
||||
{
|
||||
public string EnumString { get; set; }
|
||||
public string EnumDesc { get; set; }
|
||||
public int EnumIntValue { get; set; }
|
||||
}
|
||||
}
|
||||
733
Cowain.Bake.Common/Enums/SysEnum.cs
Normal file
733
Cowain.Bake.Common/Enums/SysEnum.cs
Normal file
@@ -0,0 +1,733 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Cowain.Bake.Common.Enums
|
||||
{
|
||||
public enum EDeviceState
|
||||
{
|
||||
[Description("自动运行")] Run = 0,
|
||||
[Description("待机")] Standby = 1,
|
||||
[Description("正常停机")] Stop = 2,
|
||||
[Description("故障停机")] FaultShutdown = 3,
|
||||
[Description("待料")] WaitingMaterials = 4,
|
||||
[Description("满料")] FullMaterial = 5,
|
||||
}
|
||||
|
||||
public enum EAlarmStationId
|
||||
{
|
||||
Mom = 10000,
|
||||
DevTemp = 10001,
|
||||
}
|
||||
|
||||
public enum EIsReverseOrder
|
||||
{
|
||||
[Description("正向")] Positive = 0,
|
||||
[Description("反向")] Reverse = 1,
|
||||
}
|
||||
|
||||
public enum EAgvMoveStatus
|
||||
{
|
||||
Error = -1,
|
||||
Wait = 0,
|
||||
Normal = 1,
|
||||
}
|
||||
public enum ETaskStatus
|
||||
{
|
||||
[Description("无任务")] None = 0,
|
||||
[Description("未执行")] UnExecute = 1,
|
||||
[Description("执行中")] Executing, //是不用的
|
||||
[Description("执行完成")] ExecutionCompleted,
|
||||
}
|
||||
public enum ETaskStep
|
||||
{
|
||||
[Description("无")] None = 0,
|
||||
[Description("未执行")] Unexecuted = 1,
|
||||
[Description("移至取位")] MoveFrom = 10,
|
||||
[Description("取盘")] Pick = 20,
|
||||
[Description("移至放位")] MoveTo = 11,
|
||||
[Description("放盘")] Place = 30,
|
||||
[Description("完成")] Finish = 50,
|
||||
}
|
||||
public enum EPalletDummyState
|
||||
{
|
||||
[Description("不带水满夹具")] Not_have = 0,
|
||||
[Description("带水满夹具")] Have = 1,
|
||||
[Description("不判断")] Null = 2,
|
||||
}
|
||||
public enum ETagType
|
||||
{
|
||||
[Description("通用")] General = 0,
|
||||
[Description("报警")] Alarm = 1,
|
||||
[Description("温度")] Temperature = 2,
|
||||
[Description("PID")] PID = 3,
|
||||
[Description("工艺参数")] ProcessParams = 4,
|
||||
[Description("逻辑处理")] LogicHandle = 5, //上下料回复
|
||||
[Description("电能表数据")] ElectricEnergy = 6,
|
||||
[Description("输出IO")] OutputSignal = 7, //输出的IO信号(BOOL类型)
|
||||
[Description("昨日耗电量")] YesterdayEnergy = 8,
|
||||
[Description("每日耗电量预警")] DayEnergyAlarmValue = 9,
|
||||
}
|
||||
public enum Direction
|
||||
{
|
||||
Up,
|
||||
Down,
|
||||
Left,
|
||||
Right
|
||||
}
|
||||
public enum DummyPlaceRule
|
||||
{
|
||||
[Description("每个夹具放一个(默认)")] EVERY_PALLET_PLACED_ONE = 1,
|
||||
[Description("每个炉层放一个")] DEFAULT_EVERY_STOVE_LAYER_PLACED_ONE,
|
||||
[Description("每个炉子均不放")] EVERY_STOVE_NOT_PLACED_ANY,
|
||||
}
|
||||
public enum EPalletStatus
|
||||
{
|
||||
//[Description("新盘托")] Init = 1,
|
||||
[Description("上料中")] Loading = 5,
|
||||
[Description("满载")] Advisable = 10,
|
||||
[Description("烘烤中")] Bake = 15,
|
||||
[Description("烘烤完成")] BakeOver = 20,
|
||||
[Description("待测结果")] WaitTest = 25,
|
||||
[Description("检测OK")] TestOK = 30,
|
||||
[Description("检测NG")] TestNG = 35,
|
||||
[Description("下料中")] Blank = 40,
|
||||
[Description("空夹具")] BlankOver = 45,
|
||||
[Description("维修")] Maintain = 50,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否最后一盘
|
||||
/// </summary>
|
||||
public enum EPalletLast
|
||||
{
|
||||
[Description("否")]
|
||||
NoLast = 0,
|
||||
|
||||
[Description("是")]
|
||||
YesLast = 1,
|
||||
}
|
||||
|
||||
public enum EStatusCode
|
||||
{
|
||||
[Description("未知")] UnKnow = 0,
|
||||
[Description("运行")] Runing = 1,
|
||||
[Description("待机")] Wait = 2,
|
||||
[Description("报警")] Warn = 3,
|
||||
[Description("宕机")] Deal,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 炉子运行状态
|
||||
/// </summary>
|
||||
public enum EStoveWorkMode
|
||||
{
|
||||
[Description("空闲")] Free = 0,
|
||||
[Description("待机")] Standby = 1,
|
||||
[Description("停止")] Stop = 2,
|
||||
[Description("工作")] Working = 3,
|
||||
[Description("保压")] Pressurizing,
|
||||
}
|
||||
|
||||
public enum EStoveSignal
|
||||
{
|
||||
[Description("初始化完成信号")]
|
||||
Initialed,
|
||||
|
||||
[Description("露点温度")]
|
||||
DewTemperature,
|
||||
|
||||
[Description("开门到位信号")]
|
||||
OpenDoorPlace,
|
||||
|
||||
[Description("关门到位信号")]
|
||||
CloseDoorPlace,
|
||||
|
||||
[Description("左夹具到位信号")]
|
||||
TrayDetection1,
|
||||
|
||||
[Description("右夹具到位信号")]
|
||||
TrayDetection2,
|
||||
|
||||
[Description("烘烤完成状态")]
|
||||
BakingMark,
|
||||
|
||||
[Description("远程/本地模式")]
|
||||
Remote, //true:远程, false:本地
|
||||
|
||||
[Description("温度")]
|
||||
Temperature,
|
||||
|
||||
[Description("PID输出值")]
|
||||
PID,
|
||||
|
||||
[Description("真空值")]
|
||||
Vacuum,
|
||||
|
||||
[Description("工作时长")] //2024-10-12
|
||||
WorkTime,
|
||||
|
||||
[Description("总工作时长")]
|
||||
TotalWorkTime,
|
||||
|
||||
[Description("系统状态寄存器")]
|
||||
CavityStatus,
|
||||
|
||||
[Description("腔体信号计数")]
|
||||
CountCavitySignal,
|
||||
|
||||
[Description("初始化请求")]
|
||||
Initial,
|
||||
|
||||
[Description("开门请求")]
|
||||
OpenDoor,
|
||||
|
||||
[Description("关门请求")]
|
||||
CloseDoor,
|
||||
|
||||
[Description("心跳")]
|
||||
Heartbeat,
|
||||
|
||||
[Description("托盘记忆1")]
|
||||
Tray1,
|
||||
|
||||
[Description("托盘记忆2")]
|
||||
Tray2,
|
||||
|
||||
[Description("下发参数完成(开始烘烤)")]
|
||||
BakingStart,
|
||||
|
||||
[Description("参数_层烘烤使能")]
|
||||
HeatEnableStep,
|
||||
|
||||
[Description("参数_设定温度")]
|
||||
SetTemp,
|
||||
|
||||
[Description("参数_温度公差")]
|
||||
TemperatureTolerance,
|
||||
|
||||
[Description("参数_温度上限")]
|
||||
TemperatureLimit,
|
||||
|
||||
[Description("参数_真空到达值")]
|
||||
VacuumArriveValue,
|
||||
|
||||
[Description("参数_真空上限")]
|
||||
VacuumUpValue,
|
||||
|
||||
[Description("参数_真空下限")]
|
||||
VacuumDownValue,
|
||||
|
||||
[Description("参数_氮气到达值")]
|
||||
NitrogenArriveValue,
|
||||
|
||||
[Description("参数_氮气上限")]
|
||||
NitrogenUpValue,
|
||||
|
||||
[Description("参数_氮气下限")]
|
||||
NitrogenDownValue,
|
||||
|
||||
[Description("参数_常压到达值")]
|
||||
AtmosphericArriveValue,
|
||||
|
||||
[Description("参数_常压上限")]
|
||||
AtmosphericUpValue,
|
||||
|
||||
[Description("参数_常压下限")]
|
||||
AtmosphericDownValue,
|
||||
|
||||
[Description("参数_循环启动工步")]
|
||||
CycleStartStep,
|
||||
|
||||
[Description("参数_循环结束工步")]
|
||||
CycleEndStep,
|
||||
|
||||
[Description("参数_循环次数")]
|
||||
CycleNumber,
|
||||
|
||||
[Description("参数_加热启用")]
|
||||
HeatingEnabled,
|
||||
|
||||
[Description("参数_真空启用")]
|
||||
VacuumEnabled,
|
||||
|
||||
[Description("参数_氮气启用")]
|
||||
NitrogenEnabled,
|
||||
|
||||
[Description("参数_工步时间")]
|
||||
StepWorkTime,
|
||||
|
||||
[Description("温度上限预警值")]
|
||||
TemperatureUpperWarnValue,
|
||||
|
||||
[Description("真空上限预警值")]
|
||||
VacuumUpperWarnValue,
|
||||
}
|
||||
|
||||
public enum EMesLogClass
|
||||
{
|
||||
[Description("心跳")] EqptAlive = 1,
|
||||
[Description("设备状态")] Status,
|
||||
[Description("设备报警")] Alarm,
|
||||
[Description("参数请求")] ParameterRequest,
|
||||
[Description("参数变更")] ParameterChange,
|
||||
[Description("联机请求")] EqptRun,
|
||||
[Description("电芯状态获取")] GetCellState,
|
||||
[Description("电芯进站")] EnterStation,
|
||||
[Description("烘烤过程参数采集")] BakingParameter,
|
||||
[Description("电芯出站")] ExitStation,
|
||||
}
|
||||
|
||||
public enum EWindowsRowType
|
||||
{
|
||||
Upper = 1,
|
||||
Mid = 2,
|
||||
Lower = 3
|
||||
}
|
||||
|
||||
public enum EKeyFlag
|
||||
{
|
||||
OK = 0,
|
||||
NG = 1,
|
||||
ProcessParam = 2
|
||||
}
|
||||
public enum EMenuType
|
||||
{
|
||||
[Description("视图")] Region = 1,
|
||||
[Description("功能开关")] FunctionSwitch,
|
||||
[Description("弹屏")] ShowDialog,
|
||||
[Description("指令")] Cmd,
|
||||
[Description("下拉框")] DropDown,
|
||||
}
|
||||
|
||||
public enum ESkin
|
||||
{
|
||||
[Description("本色(默认)")] VS2010Theme = 0,
|
||||
[Description("半透明风格")] Aero,
|
||||
[Description("Office 2013 蓝色")] Vs2013BlueTheme,
|
||||
[Description("Office 2013 深色")] Vs2013DarkTheme,
|
||||
[Description("Office 2013 浅色")] Vs2013LightTheme,
|
||||
[Description("深色风格")] ExpressionDark,
|
||||
//[Description("商务")] Background01_png, //商务
|
||||
//[Description("科技")] background0_png, //科技
|
||||
//[Description("机械")] back1_png, //机械
|
||||
//[Description("机械手")] backtest5_png, //机械手
|
||||
//[Description("红树林")] backtest1_jpg, //红树林
|
||||
//[Description("海边灯塔")] backtest2_jpg, //海边灯塔
|
||||
//[Description("深林湖边")] backtest4_jpg //深林湖边
|
||||
}
|
||||
|
||||
public enum EBatteryStatus
|
||||
{
|
||||
[Description("初始值")]
|
||||
Initialise = 0,
|
||||
[Description("入站验证失败")]
|
||||
PullInFail = 5,
|
||||
[Description("扫码完成")]
|
||||
ScanOver = 10,
|
||||
[Description("进入托盘")]
|
||||
ToPallet = 20,
|
||||
[Description("待水含量测试")]
|
||||
ToWaterPlatform = 30,
|
||||
[Description("已经出站")]
|
||||
Over = 40,
|
||||
[Description("记录出站")]
|
||||
OutBoundRecord = 50,
|
||||
}
|
||||
|
||||
public enum EMesUpLoadStatus
|
||||
{
|
||||
[Description("待发送")] Wait,
|
||||
[Description("待发送")] Fail,
|
||||
[Description("发送成功")] Success,
|
||||
}
|
||||
|
||||
public enum ECavityStatus
|
||||
{
|
||||
[Description("未知")] None,
|
||||
[Description("请放")] RequestPlace = 10, //请求放盘
|
||||
[Description("请取")] RequestPick = 20, //请求取盘
|
||||
}
|
||||
|
||||
public enum EStartAllow //启动允许
|
||||
{
|
||||
[Description("不允许")] Not = 0,
|
||||
[Description("允许")] Ok,
|
||||
}
|
||||
|
||||
|
||||
public enum EDeviceStatus //设备状态
|
||||
{
|
||||
[Description("未知")] None = 0,
|
||||
[Description("自动运行中")] Auto = 1,
|
||||
[Description("停止中")] Stop,
|
||||
[Description("启动中")] Start,
|
||||
[Description("准备OK")] Ready,
|
||||
[Description("初始化中")] Init,
|
||||
[Description("报警中")] Alarm,
|
||||
[Description("手动模式")] Manual,
|
||||
[Description("维修模式")] Maintain,
|
||||
[Description("模式未选择")] NotSelected,
|
||||
}
|
||||
|
||||
public enum EDummyState
|
||||
{
|
||||
[Description("正常电芯")]
|
||||
NotHave = 0,
|
||||
|
||||
[Description("水含量电芯")]
|
||||
Have = 1,
|
||||
}
|
||||
|
||||
public enum EScanCode
|
||||
{
|
||||
[Description("上料1#扫码枪")] LoadingBatteryScan1 = 1,
|
||||
[Description("上料2#扫码枪")] LoadingBatteryScan2,
|
||||
[Description("上料3#扫码枪")] LoadingBatteryScan3,
|
||||
[Description("上料4#扫码枪")] LoadingBatteryScan4,
|
||||
[Description("上料5#扫码枪")] LoadingBatteryScan5,
|
||||
[Description("上料6#扫码枪")] LoadingBatteryScan6,
|
||||
[Description("上料7#扫码枪")] LoadingBatteryScan7,
|
||||
[Description("上料8#扫码枪")] LoadingBatteryScan8,
|
||||
[Description("上料假电池扫码枪")] DummyScan,
|
||||
[Description("1#托盘扫码枪")] PalletScan1,
|
||||
[Description("2#托盘扫码枪")] PalletScan2,
|
||||
[Description("下料1#扫码枪")] UnLoadingBatteryScan1,
|
||||
[Description("下料2#扫码枪")] UnLoadingBatteryScan2,
|
||||
[Description("下料3#扫码枪")] UnLoadingBatteryScan3,
|
||||
[Description("下料4#扫码枪")] UnLoadingBatteryScan4,
|
||||
[Description("下料5#扫码枪")] UnLoadingBatteryScan5,
|
||||
[Description("下料6#扫码枪")] UnLoadingBatteryScan6,
|
||||
[Description("下料7#扫码枪")] UnLoadingBatteryScan7,
|
||||
[Description("下料8#扫码枪")] UnLoadingBatteryScan8,
|
||||
}
|
||||
public enum ESysSetup
|
||||
{
|
||||
[Description("工序名称")] ProcessName,
|
||||
[Description("设备编号")] DeviceNum,
|
||||
[Description("产线编号")] Line,
|
||||
[Description("白班开始时间")] DayShift,
|
||||
[Description("晚班开始时间")] NightShift,
|
||||
[Description("假电池位置X")] DummyLocationX,
|
||||
[Description("假电池位置Y")] DummyLocationY,
|
||||
[Description("MOM状态模式")] MOMMode,
|
||||
[Description("采集周期(ms)")] ReadPLCCycle,
|
||||
[Description("数据采集周期(秒)")] DataCollectionCycle,
|
||||
[Description("生产模式(0为调试模式,1为正式模式)")] DebugMode, //只用于扫码还是生成条码
|
||||
[Description("是否启用MOM(0为调试模式,1为正式模式)")] MOMEnable,
|
||||
[Description("扫码模式")] ScanCodeMode, //0:正常扫码,1:复投扫码
|
||||
[Description("数据文件路径")] DataFilePath, //数据路径
|
||||
[Description("电芯条码长度")] BatteryCodeLen, //
|
||||
[Description("隔膜含水量判断(小于)")] SeptumwaterTargetJudge,
|
||||
[Description("负极片含水量判断(小于)")] CathodewaterTargetJudge,
|
||||
[Description("正极片含水量判断(小于)")] AnodewaterTargetJudge,
|
||||
[Description("露点温度报警阈值")] DewTempAlarmTargetValue,
|
||||
}
|
||||
public enum EDeviceType
|
||||
{
|
||||
/*
|
||||
name:用于类型,对应数据库的DType
|
||||
Description:用于找查,对应数据库的Name,另外还有一个编号
|
||||
*/
|
||||
[Description("PLC")] PLC = 1,
|
||||
[Description("MOM")] MOM,
|
||||
[Description("扫码枪")] SCANNER,
|
||||
}
|
||||
|
||||
public enum EParamType
|
||||
{
|
||||
[Description("系统参数")] Sys = 1,
|
||||
[Description("启用参数")] Enable,
|
||||
[Description("MOM联机")] MOM,
|
||||
}
|
||||
|
||||
public enum EDeviceName
|
||||
{
|
||||
[Description("Plc1")] StovePlc1 = 1,
|
||||
[Description("Plc2")] StovePlc2,
|
||||
[Description("Plc3")] StovePlc3,
|
||||
[Description("Plc4")] StovePlc4,
|
||||
[Description("Plc5")] StovePlc5,
|
||||
[Description("上料机")] Loading,
|
||||
[Description("Robot")] AGV,
|
||||
[Description("MOM")] Mom,
|
||||
}
|
||||
public enum EDispatchMode
|
||||
{
|
||||
[Description("自动")]
|
||||
Auto = 1,
|
||||
|
||||
[Description("手动")]
|
||||
Manual = 2,
|
||||
}
|
||||
|
||||
public enum EStationType
|
||||
{
|
||||
[Description("烤箱")] Stove = 1,
|
||||
[Description("上料机")] Loading,
|
||||
[Description("下料机")] UnLoading,
|
||||
[Description("人工上料台")] ManualPlat,
|
||||
[Description("AGV")] AGV,
|
||||
[Description("扫码工站")] ScannCode
|
||||
}
|
||||
public enum EAgvPLC
|
||||
{
|
||||
//写PLC
|
||||
[Description("心跳")] FromWcsHeart,
|
||||
[Description("命令号")] Command,
|
||||
[Description("命令计数")] Count,
|
||||
[Description("取-工位号")] FromStation,
|
||||
[Description("取-行号")] FromRow,
|
||||
[Description("取-列号")] FromCol,
|
||||
[Description("放-工位号")] ToStation,
|
||||
[Description("放-行号")] ToRow,
|
||||
[Description("放-列号")] ToCol,
|
||||
//读PLC
|
||||
[Description("反馈心跳")] ToWcsHeart,
|
||||
[Description("反馈上位机命令")] RetCommand,
|
||||
[Description("反馈上位机命令计数")] RetCount,
|
||||
[Description("反馈上位机结果")] ToWcsResult,
|
||||
|
||||
}
|
||||
public enum EAgvStatus
|
||||
{
|
||||
[Description("未初始化")] None,
|
||||
[Description("待机")] Standby,
|
||||
[Description("运行")] Working,
|
||||
[Description("停止中")] Stop,
|
||||
[Description("异常")] Fail,
|
||||
}
|
||||
|
||||
|
||||
public enum EProductionMode //MES有这二种MES
|
||||
{
|
||||
[Description("调试模式")] Debug,
|
||||
[Description("正常模式")] Normal,
|
||||
}
|
||||
|
||||
public enum EOperTypePLC
|
||||
{
|
||||
Readable = 1,
|
||||
Writable = 2,
|
||||
ReadWrite = 3
|
||||
}
|
||||
|
||||
public enum EResultFlag //这个是MOM的
|
||||
{
|
||||
OK,
|
||||
NG
|
||||
}
|
||||
public enum EResult
|
||||
{
|
||||
OK = 1,
|
||||
NG = 2
|
||||
}
|
||||
|
||||
//public enum EAgvResult
|
||||
//{
|
||||
// NG = -1,
|
||||
// OK = 1,
|
||||
//}
|
||||
///// <summary>
|
||||
///// 日志枚举类型
|
||||
///// </summary>
|
||||
public enum E_LogType
|
||||
{
|
||||
[Description("调试信息")] Debug = 0,
|
||||
[Description("提示")] Info = 1,
|
||||
[Description("警告")] Warn = 2,
|
||||
[Description("错误")] Error = 3,
|
||||
[Description("致命错误")] Fatal = 4,
|
||||
[Description("操作日志")] Operate = 5,
|
||||
[Description("跟踪")] Trace,
|
||||
[Description("全部")] All,
|
||||
}
|
||||
|
||||
public enum EAlarmStatus
|
||||
{
|
||||
[Description("恢复")] Renew,
|
||||
[Description("报警")] Alert,
|
||||
[Description("警告")] Warn
|
||||
}
|
||||
|
||||
|
||||
public enum EMOMMode
|
||||
{
|
||||
[Description("联机模式")] OnLine, //MOM会给设备下达工艺参数信息,设备出入站要判断MOM回复信息是否尾OK值,如果反馈NG需要将电芯放入到NG口
|
||||
[Description("离线模式")] OffLine, //设备需要单机记录所有的生产信息以便MOM回复后上传信息
|
||||
[Description("调机模式")] DebugMachine //设备运行修改MOM提供的工艺参数,正常调用出入站接口,所有这个模式下产出的电芯都需要放入到NG口待人为判定是否可以进入下一站。调机结束后需要再次调用本接口,恢复为联机模式,MOM重新下达工艺参数信息
|
||||
}
|
||||
|
||||
public enum EMOMEnable
|
||||
{
|
||||
[Description("不启用")] Disable,
|
||||
[Description("启用")] Enable,
|
||||
}
|
||||
|
||||
public enum EDataType
|
||||
{
|
||||
[Description("System.Boolean")] BOOL,
|
||||
[Description("System.UInt16")] UINT16,
|
||||
[Description("System.Int16")] INT16,
|
||||
[Description("System.UInt32")] UINT32,
|
||||
[Description("System.Int32")] INT32,
|
||||
[Description("System.String")] STR,
|
||||
[Description("System.Single")] FLOAT, //REAL-FLOAT 一样
|
||||
[Description("System.Double")] DOUBLE,
|
||||
[Description("System.Single")] REAL, //REAL-FLOAT 一样
|
||||
}
|
||||
|
||||
public enum ERole
|
||||
{
|
||||
[Description("管理员")]
|
||||
Admin = 1,
|
||||
|
||||
[Description("操作员")]
|
||||
Operater,
|
||||
|
||||
[Description("维修员")]
|
||||
Mantainer
|
||||
}
|
||||
|
||||
public enum EValidStatus
|
||||
{
|
||||
[Description("无效")]
|
||||
Invalid,
|
||||
[Description("有效")]
|
||||
Valid
|
||||
}
|
||||
|
||||
|
||||
public enum OperTypeEnum
|
||||
{
|
||||
[Description("读")]
|
||||
ParamRead,
|
||||
[Description("写")]
|
||||
ParamWrite,
|
||||
[Description("读写")]
|
||||
ParamReadWrite
|
||||
}
|
||||
|
||||
public enum EStovePLC
|
||||
{
|
||||
[Description("初始化完成信号")]
|
||||
Initialed,
|
||||
|
||||
[Description("开门到位信号")]
|
||||
OpenDoorPlace,
|
||||
|
||||
[Description("关门到位信号")]
|
||||
CloseDoorPlace,
|
||||
|
||||
[Description("左夹具到位信号")]
|
||||
TrayDetection1,
|
||||
|
||||
[Description("右夹具到位信号")]
|
||||
TrayDetection2,
|
||||
|
||||
[Description("烘烤完成状态")]
|
||||
BakingMark,
|
||||
|
||||
[Description("远程/本地模式")]
|
||||
Remote, //true:远程, false:本地
|
||||
|
||||
[Description("温度")]
|
||||
Temperature,
|
||||
|
||||
[Description("真空值")]
|
||||
Vacuum,
|
||||
|
||||
[Description("工作时长")] //2024-10-12
|
||||
WorkTime,
|
||||
|
||||
[Description("系统状态寄存器")]
|
||||
CavityStatus,
|
||||
|
||||
[Description("初始化请求")]
|
||||
Initial,
|
||||
|
||||
[Description("开门请求")]
|
||||
OpenDoor,
|
||||
|
||||
[Description("关门请求")]
|
||||
CloseDoor,
|
||||
|
||||
[Description("心跳")]
|
||||
Heartbeat,
|
||||
|
||||
[Description("托盘记忆1")]
|
||||
Tray1,
|
||||
|
||||
[Description("托盘记忆2")]
|
||||
Tray2,
|
||||
|
||||
[Description("下发参数完成(开始烘烤)")]
|
||||
BakingStart,
|
||||
|
||||
[Description("参数_设定温度")]
|
||||
SetTemp,
|
||||
|
||||
[Description("参数_温度公差")]
|
||||
TemperatureTolerance,
|
||||
|
||||
[Description("参数_温度上限")]
|
||||
TemperatureLimit,
|
||||
|
||||
[Description("参数_真空到达值")]
|
||||
VacuumArriveValue,
|
||||
|
||||
[Description("参数_真空上限")]
|
||||
VacuumUpValue,
|
||||
|
||||
[Description("参数_真空下限")]
|
||||
VacuumDownValue,
|
||||
|
||||
[Description("参数_氮气到达值")]
|
||||
NitrogenArriveValue,
|
||||
|
||||
[Description("参数_氮气上限")]
|
||||
NitrogenUpValue,
|
||||
|
||||
[Description("参数_氮气下限")]
|
||||
NitrogenDownValue,
|
||||
|
||||
[Description("参数_常压到达值")]
|
||||
AtmosphericArriveValue,
|
||||
|
||||
[Description("参数_常压上限")]
|
||||
AtmosphericUpValue,
|
||||
|
||||
[Description("参数_常压下限")]
|
||||
AtmosphericDownValue,
|
||||
|
||||
[Description("参数_循环启动工步")]
|
||||
CycleStartStep,
|
||||
|
||||
[Description("参数_循环结束工步")]
|
||||
CycleEndStep,
|
||||
|
||||
[Description("参数_循环次数")]
|
||||
CycleNumber,
|
||||
|
||||
[Description("参数_加热启用")]
|
||||
HeatingEnabled,
|
||||
|
||||
[Description("参数_真空启用")]
|
||||
VacuumEnabled,
|
||||
|
||||
[Description("参数_氮气启用")]
|
||||
NitrogenEnabled,
|
||||
|
||||
[Description("参数_工步时间")]
|
||||
StepWorkTime,
|
||||
|
||||
[Description("温度上限预警值")]
|
||||
TemperatureUpperWarnValue,
|
||||
|
||||
[Description("真空上限预警值")]
|
||||
VacuumUpperWarnValue,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user